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 #[serde(skip_serializing_if = "wkt::internal::is_default")]
74 pub requested_cancellation: bool,
75
76 #[serde(skip_serializing_if = "std::string::String::is_empty")]
78 pub api_version: std::string::String,
79
80 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
81 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
82}
83
84impl OperationMetadata {
85 pub fn new() -> Self {
86 std::default::Default::default()
87 }
88
89 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
91 mut self,
92 v: T,
93 ) -> Self {
94 self.create_time = v.into();
95 self
96 }
97
98 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
100 mut self,
101 v: T,
102 ) -> Self {
103 self.end_time = v.into();
104 self
105 }
106
107 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
109 self.target = v.into();
110 self
111 }
112
113 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
115 self.verb = v.into();
116 self
117 }
118
119 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
121 self.status_message = v.into();
122 self
123 }
124
125 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
127 self.requested_cancellation = v.into();
128 self
129 }
130
131 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
133 self.api_version = v.into();
134 self
135 }
136}
137
138impl wkt::message::Message for OperationMetadata {
139 fn typename() -> &'static str {
140 "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata"
141 }
142}
143
144#[serde_with::serde_as]
146#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
147#[serde(default, rename_all = "camelCase")]
148#[non_exhaustive]
149pub struct ServiceConnectionMap {
150 #[serde(skip_serializing_if = "std::string::String::is_empty")]
155 pub name: std::string::String,
156
157 #[serde(skip_serializing_if = "std::option::Option::is_none")]
159 pub create_time: std::option::Option<wkt::Timestamp>,
160
161 #[serde(skip_serializing_if = "std::option::Option::is_none")]
163 pub update_time: std::option::Option<wkt::Timestamp>,
164
165 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
167 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
168
169 #[serde(skip_serializing_if = "std::string::String::is_empty")]
171 pub description: std::string::String,
172
173 #[serde(skip_serializing_if = "std::string::String::is_empty")]
178 pub service_class: std::string::String,
179
180 #[serde(skip_serializing_if = "std::string::String::is_empty")]
182 pub service_class_uri: std::string::String,
183
184 pub infrastructure: crate::model::Infrastructure,
187
188 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
190 pub producer_psc_configs:
191 std::vec::Vec<crate::model::service_connection_map::ProducerPscConfig>,
192
193 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
195 pub consumer_psc_configs:
196 std::vec::Vec<crate::model::service_connection_map::ConsumerPscConfig>,
197
198 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
200 pub consumer_psc_connections:
201 std::vec::Vec<crate::model::service_connection_map::ConsumerPscConnection>,
202
203 #[serde(skip_serializing_if = "std::string::String::is_empty")]
206 pub token: std::string::String,
207
208 #[serde(skip_serializing_if = "std::option::Option::is_none")]
212 pub etag: std::option::Option<std::string::String>,
213
214 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
215 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
216}
217
218impl ServiceConnectionMap {
219 pub fn new() -> Self {
220 std::default::Default::default()
221 }
222
223 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
225 self.name = v.into();
226 self
227 }
228
229 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
231 mut self,
232 v: T,
233 ) -> Self {
234 self.create_time = v.into();
235 self
236 }
237
238 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
240 mut self,
241 v: T,
242 ) -> Self {
243 self.update_time = v.into();
244 self
245 }
246
247 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
249 where
250 T: std::iter::IntoIterator<Item = (K, V)>,
251 K: std::convert::Into<std::string::String>,
252 V: std::convert::Into<std::string::String>,
253 {
254 use std::iter::Iterator;
255 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
256 self
257 }
258
259 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
261 self.description = v.into();
262 self
263 }
264
265 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
267 self.service_class = v.into();
268 self
269 }
270
271 pub fn set_service_class_uri<T: std::convert::Into<std::string::String>>(
273 mut self,
274 v: T,
275 ) -> Self {
276 self.service_class_uri = v.into();
277 self
278 }
279
280 pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
282 mut self,
283 v: T,
284 ) -> Self {
285 self.infrastructure = v.into();
286 self
287 }
288
289 pub fn set_producer_psc_configs<T, V>(mut self, v: T) -> Self
291 where
292 T: std::iter::IntoIterator<Item = V>,
293 V: std::convert::Into<crate::model::service_connection_map::ProducerPscConfig>,
294 {
295 use std::iter::Iterator;
296 self.producer_psc_configs = v.into_iter().map(|i| i.into()).collect();
297 self
298 }
299
300 pub fn set_consumer_psc_configs<T, V>(mut self, v: T) -> Self
302 where
303 T: std::iter::IntoIterator<Item = V>,
304 V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConfig>,
305 {
306 use std::iter::Iterator;
307 self.consumer_psc_configs = v.into_iter().map(|i| i.into()).collect();
308 self
309 }
310
311 pub fn set_consumer_psc_connections<T, V>(mut self, v: T) -> Self
313 where
314 T: std::iter::IntoIterator<Item = V>,
315 V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConnection>,
316 {
317 use std::iter::Iterator;
318 self.consumer_psc_connections = v.into_iter().map(|i| i.into()).collect();
319 self
320 }
321
322 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
324 self.token = v.into();
325 self
326 }
327
328 pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
330 mut self,
331 v: T,
332 ) -> Self {
333 self.etag = v.into();
334 self
335 }
336}
337
338impl wkt::message::Message for ServiceConnectionMap {
339 fn typename() -> &'static str {
340 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap"
341 }
342}
343
344pub mod service_connection_map {
346 #[allow(unused_imports)]
347 use super::*;
348
349 #[serde_with::serde_as]
351 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
352 #[serde(default, rename_all = "camelCase")]
353 #[non_exhaustive]
354 pub struct ProducerPscConfig {
355 #[serde(skip_serializing_if = "std::string::String::is_empty")]
359 pub service_attachment_uri: std::string::String,
360
361 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
362 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
363 }
364
365 impl ProducerPscConfig {
366 pub fn new() -> Self {
367 std::default::Default::default()
368 }
369
370 pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
372 mut self,
373 v: T,
374 ) -> Self {
375 self.service_attachment_uri = v.into();
376 self
377 }
378 }
379
380 impl wkt::message::Message for ProducerPscConfig {
381 fn typename() -> &'static str {
382 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ProducerPscConfig"
383 }
384 }
385
386 #[serde_with::serde_as]
388 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
389 #[serde(default, rename_all = "camelCase")]
390 #[non_exhaustive]
391 pub struct ConsumerPscConfig {
392 #[serde(skip_serializing_if = "std::string::String::is_empty")]
394 pub project: std::string::String,
395
396 #[serde(skip_serializing_if = "std::string::String::is_empty")]
402 pub network: std::string::String,
403
404 #[serde(skip_serializing_if = "wkt::internal::is_default")]
407 pub disable_global_access: bool,
408
409 pub state: crate::model::service_connection_map::consumer_psc_config::State,
412
413 #[serde(skip_serializing_if = "std::string::String::is_empty")]
416 #[deprecated]
417 pub producer_instance_id: std::string::String,
418
419 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
423 pub service_attachment_ip_address_map:
424 std::collections::HashMap<std::string::String, std::string::String>,
425
426 #[serde(skip_serializing_if = "std::string::String::is_empty")]
433 pub consumer_instance_project: std::string::String,
434
435 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
437 pub producer_instance_metadata:
438 std::collections::HashMap<std::string::String, std::string::String>,
439
440 #[serde(skip_serializing_if = "std::option::Option::is_none")]
442 pub ip_version: std::option::Option<crate::model::IPVersion>,
443
444 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
445 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
446 }
447
448 impl ConsumerPscConfig {
449 pub fn new() -> Self {
450 std::default::Default::default()
451 }
452
453 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
455 self.project = v.into();
456 self
457 }
458
459 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
461 self.network = v.into();
462 self
463 }
464
465 pub fn set_disable_global_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
467 self.disable_global_access = v.into();
468 self
469 }
470
471 pub fn set_state<
473 T: std::convert::Into<crate::model::service_connection_map::consumer_psc_config::State>,
474 >(
475 mut self,
476 v: T,
477 ) -> Self {
478 self.state = v.into();
479 self
480 }
481
482 #[deprecated]
484 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
485 mut self,
486 v: T,
487 ) -> Self {
488 self.producer_instance_id = v.into();
489 self
490 }
491
492 pub fn set_service_attachment_ip_address_map<T, K, V>(mut self, v: T) -> Self
494 where
495 T: std::iter::IntoIterator<Item = (K, V)>,
496 K: std::convert::Into<std::string::String>,
497 V: std::convert::Into<std::string::String>,
498 {
499 use std::iter::Iterator;
500 self.service_attachment_ip_address_map =
501 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
502 self
503 }
504
505 pub fn set_consumer_instance_project<T: std::convert::Into<std::string::String>>(
507 mut self,
508 v: T,
509 ) -> Self {
510 self.consumer_instance_project = v.into();
511 self
512 }
513
514 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
516 where
517 T: std::iter::IntoIterator<Item = (K, V)>,
518 K: std::convert::Into<std::string::String>,
519 V: std::convert::Into<std::string::String>,
520 {
521 use std::iter::Iterator;
522 self.producer_instance_metadata =
523 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
524 self
525 }
526
527 pub fn set_ip_version<
529 T: std::convert::Into<std::option::Option<crate::model::IPVersion>>,
530 >(
531 mut self,
532 v: T,
533 ) -> Self {
534 self.ip_version = v.into();
535 self
536 }
537 }
538
539 impl wkt::message::Message for ConsumerPscConfig {
540 fn typename() -> &'static str {
541 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig"
542 }
543 }
544
545 pub mod consumer_psc_config {
547 #[allow(unused_imports)]
548 use super::*;
549
550 #[derive(Clone, Debug, PartialEq)]
566 #[non_exhaustive]
567 pub enum State {
568 Unspecified,
570 Valid,
574 ConnectionPolicyMissing,
577 PolicyLimitReached,
580 ConsumerInstanceProjectNotAllowlisted,
584 UnknownValue(state::UnknownValue),
589 }
590
591 #[doc(hidden)]
592 pub mod state {
593 #[allow(unused_imports)]
594 use super::*;
595 #[derive(Clone, Debug, PartialEq)]
596 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
597 }
598
599 impl State {
600 pub fn value(&self) -> std::option::Option<i32> {
605 match self {
606 Self::Unspecified => std::option::Option::Some(0),
607 Self::Valid => std::option::Option::Some(1),
608 Self::ConnectionPolicyMissing => std::option::Option::Some(2),
609 Self::PolicyLimitReached => std::option::Option::Some(3),
610 Self::ConsumerInstanceProjectNotAllowlisted => std::option::Option::Some(4),
611 Self::UnknownValue(u) => u.0.value(),
612 }
613 }
614
615 pub fn name(&self) -> std::option::Option<&str> {
620 match self {
621 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
622 Self::Valid => std::option::Option::Some("VALID"),
623 Self::ConnectionPolicyMissing => {
624 std::option::Option::Some("CONNECTION_POLICY_MISSING")
625 }
626 Self::PolicyLimitReached => std::option::Option::Some("POLICY_LIMIT_REACHED"),
627 Self::ConsumerInstanceProjectNotAllowlisted => {
628 std::option::Option::Some("CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED")
629 }
630 Self::UnknownValue(u) => u.0.name(),
631 }
632 }
633 }
634
635 impl std::default::Default for State {
636 fn default() -> Self {
637 use std::convert::From;
638 Self::from(0)
639 }
640 }
641
642 impl std::fmt::Display for State {
643 fn fmt(
644 &self,
645 f: &mut std::fmt::Formatter<'_>,
646 ) -> std::result::Result<(), std::fmt::Error> {
647 wkt::internal::display_enum(f, self.name(), self.value())
648 }
649 }
650
651 impl std::convert::From<i32> for State {
652 fn from(value: i32) -> Self {
653 match value {
654 0 => Self::Unspecified,
655 1 => Self::Valid,
656 2 => Self::ConnectionPolicyMissing,
657 3 => Self::PolicyLimitReached,
658 4 => Self::ConsumerInstanceProjectNotAllowlisted,
659 _ => Self::UnknownValue(state::UnknownValue(
660 wkt::internal::UnknownEnumValue::Integer(value),
661 )),
662 }
663 }
664 }
665
666 impl std::convert::From<&str> for State {
667 fn from(value: &str) -> Self {
668 use std::string::ToString;
669 match value {
670 "STATE_UNSPECIFIED" => Self::Unspecified,
671 "VALID" => Self::Valid,
672 "CONNECTION_POLICY_MISSING" => Self::ConnectionPolicyMissing,
673 "POLICY_LIMIT_REACHED" => Self::PolicyLimitReached,
674 "CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED" => {
675 Self::ConsumerInstanceProjectNotAllowlisted
676 }
677 _ => Self::UnknownValue(state::UnknownValue(
678 wkt::internal::UnknownEnumValue::String(value.to_string()),
679 )),
680 }
681 }
682 }
683
684 impl serde::ser::Serialize for State {
685 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
686 where
687 S: serde::Serializer,
688 {
689 match self {
690 Self::Unspecified => serializer.serialize_i32(0),
691 Self::Valid => serializer.serialize_i32(1),
692 Self::ConnectionPolicyMissing => serializer.serialize_i32(2),
693 Self::PolicyLimitReached => serializer.serialize_i32(3),
694 Self::ConsumerInstanceProjectNotAllowlisted => serializer.serialize_i32(4),
695 Self::UnknownValue(u) => u.0.serialize(serializer),
696 }
697 }
698 }
699
700 impl<'de> serde::de::Deserialize<'de> for State {
701 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
702 where
703 D: serde::Deserializer<'de>,
704 {
705 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
706 ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig.State"))
707 }
708 }
709 }
710
711 #[serde_with::serde_as]
713 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
714 #[serde(default, rename_all = "camelCase")]
715 #[non_exhaustive]
716 pub struct ConsumerPscConnection {
717 #[serde(skip_serializing_if = "std::string::String::is_empty")]
720 pub service_attachment_uri: std::string::String,
721
722 pub state: crate::model::service_connection_map::consumer_psc_connection::State,
724
725 #[serde(skip_serializing_if = "std::string::String::is_empty")]
728 pub project: std::string::String,
729
730 #[serde(skip_serializing_if = "std::string::String::is_empty")]
734 pub network: std::string::String,
735
736 #[serde(skip_serializing_if = "std::string::String::is_empty")]
739 pub psc_connection_id: std::string::String,
740
741 #[serde(skip_serializing_if = "std::string::String::is_empty")]
745 pub ip: std::string::String,
746
747 #[deprecated]
750 pub error_type: crate::model::ConnectionErrorType,
751
752 #[serde(skip_serializing_if = "std::option::Option::is_none")]
754 #[deprecated]
755 pub error: std::option::Option<rpc::model::Status>,
756
757 #[serde(skip_serializing_if = "std::string::String::is_empty")]
759 pub gce_operation: std::string::String,
760
761 #[serde(skip_serializing_if = "std::string::String::is_empty")]
765 pub forwarding_rule: std::string::String,
766
767 #[serde(skip_serializing_if = "std::option::Option::is_none")]
770 pub error_info: std::option::Option<rpc::model::ErrorInfo>,
771
772 #[serde(skip_serializing_if = "std::string::String::is_empty")]
775 pub selected_subnetwork: std::string::String,
776
777 #[serde(skip_serializing_if = "std::string::String::is_empty")]
780 #[deprecated]
781 pub producer_instance_id: std::string::String,
782
783 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
785 pub producer_instance_metadata:
786 std::collections::HashMap<std::string::String, std::string::String>,
787
788 #[serde(skip_serializing_if = "std::option::Option::is_none")]
790 pub ip_version: std::option::Option<crate::model::IPVersion>,
791
792 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
793 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
794 }
795
796 impl ConsumerPscConnection {
797 pub fn new() -> Self {
798 std::default::Default::default()
799 }
800
801 pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
803 mut self,
804 v: T,
805 ) -> Self {
806 self.service_attachment_uri = v.into();
807 self
808 }
809
810 pub fn set_state<
812 T: std::convert::Into<
813 crate::model::service_connection_map::consumer_psc_connection::State,
814 >,
815 >(
816 mut self,
817 v: T,
818 ) -> Self {
819 self.state = v.into();
820 self
821 }
822
823 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
825 self.project = v.into();
826 self
827 }
828
829 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
831 self.network = v.into();
832 self
833 }
834
835 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
837 mut self,
838 v: T,
839 ) -> Self {
840 self.psc_connection_id = v.into();
841 self
842 }
843
844 pub fn set_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
846 self.ip = v.into();
847 self
848 }
849
850 #[deprecated]
852 pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
853 mut self,
854 v: T,
855 ) -> Self {
856 self.error_type = v.into();
857 self
858 }
859
860 #[deprecated]
862 pub fn set_error<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
863 mut self,
864 v: T,
865 ) -> Self {
866 self.error = v.into();
867 self
868 }
869
870 pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
872 mut self,
873 v: T,
874 ) -> Self {
875 self.gce_operation = v.into();
876 self
877 }
878
879 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(
881 mut self,
882 v: T,
883 ) -> Self {
884 self.forwarding_rule = v.into();
885 self
886 }
887
888 pub fn set_error_info<T: std::convert::Into<std::option::Option<rpc::model::ErrorInfo>>>(
890 mut self,
891 v: T,
892 ) -> Self {
893 self.error_info = v.into();
894 self
895 }
896
897 pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
899 mut self,
900 v: T,
901 ) -> Self {
902 self.selected_subnetwork = v.into();
903 self
904 }
905
906 #[deprecated]
908 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
909 mut self,
910 v: T,
911 ) -> Self {
912 self.producer_instance_id = v.into();
913 self
914 }
915
916 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
918 where
919 T: std::iter::IntoIterator<Item = (K, V)>,
920 K: std::convert::Into<std::string::String>,
921 V: std::convert::Into<std::string::String>,
922 {
923 use std::iter::Iterator;
924 self.producer_instance_metadata =
925 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
926 self
927 }
928
929 pub fn set_ip_version<
931 T: std::convert::Into<std::option::Option<crate::model::IPVersion>>,
932 >(
933 mut self,
934 v: T,
935 ) -> Self {
936 self.ip_version = v.into();
937 self
938 }
939 }
940
941 impl wkt::message::Message for ConsumerPscConnection {
942 fn typename() -> &'static str {
943 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection"
944 }
945 }
946
947 pub mod consumer_psc_connection {
949 #[allow(unused_imports)]
950 use super::*;
951
952 #[derive(Clone, Debug, PartialEq)]
971 #[non_exhaustive]
972 pub enum State {
973 Unspecified,
975 Active,
979 Failed,
982 Creating,
984 Deleting,
986 CreateRepairing,
988 DeleteRepairing,
990 UnknownValue(state::UnknownValue),
995 }
996
997 #[doc(hidden)]
998 pub mod state {
999 #[allow(unused_imports)]
1000 use super::*;
1001 #[derive(Clone, Debug, PartialEq)]
1002 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1003 }
1004
1005 impl State {
1006 pub fn value(&self) -> std::option::Option<i32> {
1011 match self {
1012 Self::Unspecified => std::option::Option::Some(0),
1013 Self::Active => std::option::Option::Some(1),
1014 Self::Failed => std::option::Option::Some(2),
1015 Self::Creating => std::option::Option::Some(3),
1016 Self::Deleting => std::option::Option::Some(4),
1017 Self::CreateRepairing => std::option::Option::Some(5),
1018 Self::DeleteRepairing => std::option::Option::Some(6),
1019 Self::UnknownValue(u) => u.0.value(),
1020 }
1021 }
1022
1023 pub fn name(&self) -> std::option::Option<&str> {
1028 match self {
1029 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1030 Self::Active => std::option::Option::Some("ACTIVE"),
1031 Self::Failed => std::option::Option::Some("FAILED"),
1032 Self::Creating => std::option::Option::Some("CREATING"),
1033 Self::Deleting => std::option::Option::Some("DELETING"),
1034 Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
1035 Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
1036 Self::UnknownValue(u) => u.0.name(),
1037 }
1038 }
1039 }
1040
1041 impl std::default::Default for State {
1042 fn default() -> Self {
1043 use std::convert::From;
1044 Self::from(0)
1045 }
1046 }
1047
1048 impl std::fmt::Display for State {
1049 fn fmt(
1050 &self,
1051 f: &mut std::fmt::Formatter<'_>,
1052 ) -> std::result::Result<(), std::fmt::Error> {
1053 wkt::internal::display_enum(f, self.name(), self.value())
1054 }
1055 }
1056
1057 impl std::convert::From<i32> for State {
1058 fn from(value: i32) -> Self {
1059 match value {
1060 0 => Self::Unspecified,
1061 1 => Self::Active,
1062 2 => Self::Failed,
1063 3 => Self::Creating,
1064 4 => Self::Deleting,
1065 5 => Self::CreateRepairing,
1066 6 => Self::DeleteRepairing,
1067 _ => Self::UnknownValue(state::UnknownValue(
1068 wkt::internal::UnknownEnumValue::Integer(value),
1069 )),
1070 }
1071 }
1072 }
1073
1074 impl std::convert::From<&str> for State {
1075 fn from(value: &str) -> Self {
1076 use std::string::ToString;
1077 match value {
1078 "STATE_UNSPECIFIED" => Self::Unspecified,
1079 "ACTIVE" => Self::Active,
1080 "FAILED" => Self::Failed,
1081 "CREATING" => Self::Creating,
1082 "DELETING" => Self::Deleting,
1083 "CREATE_REPAIRING" => Self::CreateRepairing,
1084 "DELETE_REPAIRING" => Self::DeleteRepairing,
1085 _ => Self::UnknownValue(state::UnknownValue(
1086 wkt::internal::UnknownEnumValue::String(value.to_string()),
1087 )),
1088 }
1089 }
1090 }
1091
1092 impl serde::ser::Serialize for State {
1093 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1094 where
1095 S: serde::Serializer,
1096 {
1097 match self {
1098 Self::Unspecified => serializer.serialize_i32(0),
1099 Self::Active => serializer.serialize_i32(1),
1100 Self::Failed => serializer.serialize_i32(2),
1101 Self::Creating => serializer.serialize_i32(3),
1102 Self::Deleting => serializer.serialize_i32(4),
1103 Self::CreateRepairing => serializer.serialize_i32(5),
1104 Self::DeleteRepairing => serializer.serialize_i32(6),
1105 Self::UnknownValue(u) => u.0.serialize(serializer),
1106 }
1107 }
1108 }
1109
1110 impl<'de> serde::de::Deserialize<'de> for State {
1111 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1112 where
1113 D: serde::Deserializer<'de>,
1114 {
1115 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1116 ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection.State"))
1117 }
1118 }
1119 }
1120}
1121
1122#[serde_with::serde_as]
1124#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1125#[serde(default, rename_all = "camelCase")]
1126#[non_exhaustive]
1127pub struct ListServiceConnectionMapsRequest {
1128 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1130 pub parent: std::string::String,
1131
1132 #[serde(skip_serializing_if = "wkt::internal::is_default")]
1134 pub page_size: i32,
1135
1136 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1138 pub page_token: std::string::String,
1139
1140 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1142 pub filter: std::string::String,
1143
1144 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1146 pub order_by: std::string::String,
1147
1148 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1149 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1150}
1151
1152impl ListServiceConnectionMapsRequest {
1153 pub fn new() -> Self {
1154 std::default::Default::default()
1155 }
1156
1157 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1159 self.parent = v.into();
1160 self
1161 }
1162
1163 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1165 self.page_size = v.into();
1166 self
1167 }
1168
1169 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1171 self.page_token = v.into();
1172 self
1173 }
1174
1175 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1177 self.filter = v.into();
1178 self
1179 }
1180
1181 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1183 self.order_by = v.into();
1184 self
1185 }
1186}
1187
1188impl wkt::message::Message for ListServiceConnectionMapsRequest {
1189 fn typename() -> &'static str {
1190 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsRequest"
1191 }
1192}
1193
1194#[serde_with::serde_as]
1196#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1197#[serde(default, rename_all = "camelCase")]
1198#[non_exhaustive]
1199pub struct ListServiceConnectionMapsResponse {
1200 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1202 pub service_connection_maps: std::vec::Vec<crate::model::ServiceConnectionMap>,
1203
1204 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1207 pub next_page_token: std::string::String,
1208
1209 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1211 pub unreachable: std::vec::Vec<std::string::String>,
1212
1213 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1214 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1215}
1216
1217impl ListServiceConnectionMapsResponse {
1218 pub fn new() -> Self {
1219 std::default::Default::default()
1220 }
1221
1222 pub fn set_service_connection_maps<T, V>(mut self, v: T) -> Self
1224 where
1225 T: std::iter::IntoIterator<Item = V>,
1226 V: std::convert::Into<crate::model::ServiceConnectionMap>,
1227 {
1228 use std::iter::Iterator;
1229 self.service_connection_maps = v.into_iter().map(|i| i.into()).collect();
1230 self
1231 }
1232
1233 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1235 self.next_page_token = v.into();
1236 self
1237 }
1238
1239 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1241 where
1242 T: std::iter::IntoIterator<Item = V>,
1243 V: std::convert::Into<std::string::String>,
1244 {
1245 use std::iter::Iterator;
1246 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1247 self
1248 }
1249}
1250
1251impl wkt::message::Message for ListServiceConnectionMapsResponse {
1252 fn typename() -> &'static str {
1253 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsResponse"
1254 }
1255}
1256
1257#[doc(hidden)]
1258impl gax::paginator::internal::PageableResponse for ListServiceConnectionMapsResponse {
1259 type PageItem = crate::model::ServiceConnectionMap;
1260
1261 fn items(self) -> std::vec::Vec<Self::PageItem> {
1262 self.service_connection_maps
1263 }
1264
1265 fn next_page_token(&self) -> std::string::String {
1266 use std::clone::Clone;
1267 self.next_page_token.clone()
1268 }
1269}
1270
1271#[serde_with::serde_as]
1273#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1274#[serde(default, rename_all = "camelCase")]
1275#[non_exhaustive]
1276pub struct GetServiceConnectionMapRequest {
1277 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1279 pub name: std::string::String,
1280
1281 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1282 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1283}
1284
1285impl GetServiceConnectionMapRequest {
1286 pub fn new() -> Self {
1287 std::default::Default::default()
1288 }
1289
1290 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1292 self.name = v.into();
1293 self
1294 }
1295}
1296
1297impl wkt::message::Message for GetServiceConnectionMapRequest {
1298 fn typename() -> &'static str {
1299 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionMapRequest"
1300 }
1301}
1302
1303#[serde_with::serde_as]
1305#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1306#[serde(default, rename_all = "camelCase")]
1307#[non_exhaustive]
1308pub struct CreateServiceConnectionMapRequest {
1309 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1312 pub parent: std::string::String,
1313
1314 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1320 pub service_connection_map_id: std::string::String,
1321
1322 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1324 pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1325
1326 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1340 pub request_id: std::string::String,
1341
1342 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1343 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1344}
1345
1346impl CreateServiceConnectionMapRequest {
1347 pub fn new() -> Self {
1348 std::default::Default::default()
1349 }
1350
1351 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1353 self.parent = v.into();
1354 self
1355 }
1356
1357 pub fn set_service_connection_map_id<T: std::convert::Into<std::string::String>>(
1359 mut self,
1360 v: T,
1361 ) -> Self {
1362 self.service_connection_map_id = v.into();
1363 self
1364 }
1365
1366 pub fn set_service_connection_map<
1368 T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionMap>>,
1369 >(
1370 mut self,
1371 v: T,
1372 ) -> Self {
1373 self.service_connection_map = v.into();
1374 self
1375 }
1376
1377 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1379 self.request_id = v.into();
1380 self
1381 }
1382}
1383
1384impl wkt::message::Message for CreateServiceConnectionMapRequest {
1385 fn typename() -> &'static str {
1386 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionMapRequest"
1387 }
1388}
1389
1390#[serde_with::serde_as]
1392#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1393#[serde(default, rename_all = "camelCase")]
1394#[non_exhaustive]
1395pub struct UpdateServiceConnectionMapRequest {
1396 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1402 pub update_mask: std::option::Option<wkt::FieldMask>,
1403
1404 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1406 pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1407
1408 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1422 pub request_id: std::string::String,
1423
1424 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1425 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1426}
1427
1428impl UpdateServiceConnectionMapRequest {
1429 pub fn new() -> Self {
1430 std::default::Default::default()
1431 }
1432
1433 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
1435 mut self,
1436 v: T,
1437 ) -> Self {
1438 self.update_mask = v.into();
1439 self
1440 }
1441
1442 pub fn set_service_connection_map<
1444 T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionMap>>,
1445 >(
1446 mut self,
1447 v: T,
1448 ) -> Self {
1449 self.service_connection_map = v.into();
1450 self
1451 }
1452
1453 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1455 self.request_id = v.into();
1456 self
1457 }
1458}
1459
1460impl wkt::message::Message for UpdateServiceConnectionMapRequest {
1461 fn typename() -> &'static str {
1462 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionMapRequest"
1463 }
1464}
1465
1466#[serde_with::serde_as]
1468#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1469#[serde(default, rename_all = "camelCase")]
1470#[non_exhaustive]
1471pub struct DeleteServiceConnectionMapRequest {
1472 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1474 pub name: std::string::String,
1475
1476 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1490 pub request_id: std::string::String,
1491
1492 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1496 pub etag: std::option::Option<std::string::String>,
1497
1498 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1499 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1500}
1501
1502impl DeleteServiceConnectionMapRequest {
1503 pub fn new() -> Self {
1504 std::default::Default::default()
1505 }
1506
1507 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1509 self.name = v.into();
1510 self
1511 }
1512
1513 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1515 self.request_id = v.into();
1516 self
1517 }
1518
1519 pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
1521 mut self,
1522 v: T,
1523 ) -> Self {
1524 self.etag = v.into();
1525 self
1526 }
1527}
1528
1529impl wkt::message::Message for DeleteServiceConnectionMapRequest {
1530 fn typename() -> &'static str {
1531 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionMapRequest"
1532 }
1533}
1534
1535#[serde_with::serde_as]
1537#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1538#[serde(default, rename_all = "camelCase")]
1539#[non_exhaustive]
1540pub struct ServiceConnectionPolicy {
1541 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1546 pub name: std::string::String,
1547
1548 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1550 pub create_time: std::option::Option<wkt::Timestamp>,
1551
1552 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1554 pub update_time: std::option::Option<wkt::Timestamp>,
1555
1556 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1558 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1559
1560 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1562 pub description: std::string::String,
1563
1564 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1569 pub network: std::string::String,
1570
1571 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1578 pub service_class: std::string::String,
1579
1580 pub infrastructure: crate::model::Infrastructure,
1583
1584 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1587 pub psc_config: std::option::Option<crate::model::service_connection_policy::PscConfig>,
1588
1589 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1592 pub psc_connections: std::vec::Vec<crate::model::service_connection_policy::PscConnection>,
1593
1594 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1598 pub etag: std::option::Option<std::string::String>,
1599
1600 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1601 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1602}
1603
1604impl ServiceConnectionPolicy {
1605 pub fn new() -> Self {
1606 std::default::Default::default()
1607 }
1608
1609 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1611 self.name = v.into();
1612 self
1613 }
1614
1615 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1617 mut self,
1618 v: T,
1619 ) -> Self {
1620 self.create_time = v.into();
1621 self
1622 }
1623
1624 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1626 mut self,
1627 v: T,
1628 ) -> Self {
1629 self.update_time = v.into();
1630 self
1631 }
1632
1633 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1635 where
1636 T: std::iter::IntoIterator<Item = (K, V)>,
1637 K: std::convert::Into<std::string::String>,
1638 V: std::convert::Into<std::string::String>,
1639 {
1640 use std::iter::Iterator;
1641 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1642 self
1643 }
1644
1645 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1647 self.description = v.into();
1648 self
1649 }
1650
1651 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1653 self.network = v.into();
1654 self
1655 }
1656
1657 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1659 self.service_class = v.into();
1660 self
1661 }
1662
1663 pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
1665 mut self,
1666 v: T,
1667 ) -> Self {
1668 self.infrastructure = v.into();
1669 self
1670 }
1671
1672 pub fn set_psc_config<
1674 T: std::convert::Into<std::option::Option<crate::model::service_connection_policy::PscConfig>>,
1675 >(
1676 mut self,
1677 v: T,
1678 ) -> Self {
1679 self.psc_config = v.into();
1680 self
1681 }
1682
1683 pub fn set_psc_connections<T, V>(mut self, v: T) -> Self
1685 where
1686 T: std::iter::IntoIterator<Item = V>,
1687 V: std::convert::Into<crate::model::service_connection_policy::PscConnection>,
1688 {
1689 use std::iter::Iterator;
1690 self.psc_connections = v.into_iter().map(|i| i.into()).collect();
1691 self
1692 }
1693
1694 pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
1696 mut self,
1697 v: T,
1698 ) -> Self {
1699 self.etag = v.into();
1700 self
1701 }
1702}
1703
1704impl wkt::message::Message for ServiceConnectionPolicy {
1705 fn typename() -> &'static str {
1706 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy"
1707 }
1708}
1709
1710pub mod service_connection_policy {
1712 #[allow(unused_imports)]
1713 use super::*;
1714
1715 #[serde_with::serde_as]
1718 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1719 #[serde(default, rename_all = "camelCase")]
1720 #[non_exhaustive]
1721 pub struct PscConfig {
1722 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1726 pub subnetworks: std::vec::Vec<std::string::String>,
1727
1728 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1730 #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
1731 pub limit: std::option::Option<i64>,
1732
1733 pub producer_instance_location:
1737 crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
1738
1739 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1755 pub allowed_google_producers_resource_hierarchy_level: std::vec::Vec<std::string::String>,
1756
1757 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1758 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1759 }
1760
1761 impl PscConfig {
1762 pub fn new() -> Self {
1763 std::default::Default::default()
1764 }
1765
1766 pub fn set_subnetworks<T, V>(mut self, v: T) -> Self
1768 where
1769 T: std::iter::IntoIterator<Item = V>,
1770 V: std::convert::Into<std::string::String>,
1771 {
1772 use std::iter::Iterator;
1773 self.subnetworks = v.into_iter().map(|i| i.into()).collect();
1774 self
1775 }
1776
1777 pub fn set_limit<T: std::convert::Into<std::option::Option<i64>>>(mut self, v: T) -> Self {
1779 self.limit = v.into();
1780 self
1781 }
1782
1783 pub fn set_producer_instance_location<
1785 T: std::convert::Into<
1786 crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
1787 >,
1788 >(
1789 mut self,
1790 v: T,
1791 ) -> Self {
1792 self.producer_instance_location = v.into();
1793 self
1794 }
1795
1796 pub fn set_allowed_google_producers_resource_hierarchy_level<T, V>(mut self, v: T) -> Self
1798 where
1799 T: std::iter::IntoIterator<Item = V>,
1800 V: std::convert::Into<std::string::String>,
1801 {
1802 use std::iter::Iterator;
1803 self.allowed_google_producers_resource_hierarchy_level =
1804 v.into_iter().map(|i| i.into()).collect();
1805 self
1806 }
1807 }
1808
1809 impl wkt::message::Message for PscConfig {
1810 fn typename() -> &'static str {
1811 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig"
1812 }
1813 }
1814
1815 pub mod psc_config {
1817 #[allow(unused_imports)]
1818 use super::*;
1819
1820 #[derive(Clone, Debug, PartialEq)]
1837 #[non_exhaustive]
1838 pub enum ProducerInstanceLocation {
1839 Unspecified,
1846 CustomResourceHierarchyLevels,
1849 UnknownValue(producer_instance_location::UnknownValue),
1854 }
1855
1856 #[doc(hidden)]
1857 pub mod producer_instance_location {
1858 #[allow(unused_imports)]
1859 use super::*;
1860 #[derive(Clone, Debug, PartialEq)]
1861 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1862 }
1863
1864 impl ProducerInstanceLocation {
1865 pub fn value(&self) -> std::option::Option<i32> {
1870 match self {
1871 Self::Unspecified => std::option::Option::Some(0),
1872 Self::CustomResourceHierarchyLevels => std::option::Option::Some(1),
1873 Self::UnknownValue(u) => u.0.value(),
1874 }
1875 }
1876
1877 pub fn name(&self) -> std::option::Option<&str> {
1882 match self {
1883 Self::Unspecified => {
1884 std::option::Option::Some("PRODUCER_INSTANCE_LOCATION_UNSPECIFIED")
1885 }
1886 Self::CustomResourceHierarchyLevels => {
1887 std::option::Option::Some("CUSTOM_RESOURCE_HIERARCHY_LEVELS")
1888 }
1889 Self::UnknownValue(u) => u.0.name(),
1890 }
1891 }
1892 }
1893
1894 impl std::default::Default for ProducerInstanceLocation {
1895 fn default() -> Self {
1896 use std::convert::From;
1897 Self::from(0)
1898 }
1899 }
1900
1901 impl std::fmt::Display for ProducerInstanceLocation {
1902 fn fmt(
1903 &self,
1904 f: &mut std::fmt::Formatter<'_>,
1905 ) -> std::result::Result<(), std::fmt::Error> {
1906 wkt::internal::display_enum(f, self.name(), self.value())
1907 }
1908 }
1909
1910 impl std::convert::From<i32> for ProducerInstanceLocation {
1911 fn from(value: i32) -> Self {
1912 match value {
1913 0 => Self::Unspecified,
1914 1 => Self::CustomResourceHierarchyLevels,
1915 _ => Self::UnknownValue(producer_instance_location::UnknownValue(
1916 wkt::internal::UnknownEnumValue::Integer(value),
1917 )),
1918 }
1919 }
1920 }
1921
1922 impl std::convert::From<&str> for ProducerInstanceLocation {
1923 fn from(value: &str) -> Self {
1924 use std::string::ToString;
1925 match value {
1926 "PRODUCER_INSTANCE_LOCATION_UNSPECIFIED" => Self::Unspecified,
1927 "CUSTOM_RESOURCE_HIERARCHY_LEVELS" => Self::CustomResourceHierarchyLevels,
1928 _ => Self::UnknownValue(producer_instance_location::UnknownValue(
1929 wkt::internal::UnknownEnumValue::String(value.to_string()),
1930 )),
1931 }
1932 }
1933 }
1934
1935 impl serde::ser::Serialize for ProducerInstanceLocation {
1936 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1937 where
1938 S: serde::Serializer,
1939 {
1940 match self {
1941 Self::Unspecified => serializer.serialize_i32(0),
1942 Self::CustomResourceHierarchyLevels => serializer.serialize_i32(1),
1943 Self::UnknownValue(u) => u.0.serialize(serializer),
1944 }
1945 }
1946 }
1947
1948 impl<'de> serde::de::Deserialize<'de> for ProducerInstanceLocation {
1949 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1950 where
1951 D: serde::Deserializer<'de>,
1952 {
1953 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProducerInstanceLocation>::new(
1954 ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig.ProducerInstanceLocation"))
1955 }
1956 }
1957 }
1958
1959 #[serde_with::serde_as]
1961 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1962 #[serde(default, rename_all = "camelCase")]
1963 #[non_exhaustive]
1964 pub struct PscConnection {
1965 pub state: crate::model::service_connection_policy::State,
1967
1968 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1971 pub consumer_forwarding_rule: std::string::String,
1972
1973 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1975 pub consumer_address: std::string::String,
1976
1977 #[deprecated]
1980 pub error_type: crate::model::ConnectionErrorType,
1981
1982 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1985 #[deprecated]
1986 pub error: std::option::Option<rpc::model::Status>,
1987
1988 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1990 pub gce_operation: std::string::String,
1991
1992 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1994 pub consumer_target_project: std::string::String,
1995
1996 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1998 pub psc_connection_id: std::string::String,
1999
2000 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2003 pub error_info: std::option::Option<rpc::model::ErrorInfo>,
2004
2005 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2008 pub selected_subnetwork: std::string::String,
2009
2010 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2013 #[deprecated]
2014 pub producer_instance_id: std::string::String,
2015
2016 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2018 pub producer_instance_metadata:
2019 std::collections::HashMap<std::string::String, std::string::String>,
2020
2021 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2025 pub service_class: std::string::String,
2026
2027 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2029 pub ip_version: std::option::Option<crate::model::IPVersion>,
2030
2031 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2032 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2033 }
2034
2035 impl PscConnection {
2036 pub fn new() -> Self {
2037 std::default::Default::default()
2038 }
2039
2040 pub fn set_state<T: std::convert::Into<crate::model::service_connection_policy::State>>(
2042 mut self,
2043 v: T,
2044 ) -> Self {
2045 self.state = v.into();
2046 self
2047 }
2048
2049 pub fn set_consumer_forwarding_rule<T: std::convert::Into<std::string::String>>(
2051 mut self,
2052 v: T,
2053 ) -> Self {
2054 self.consumer_forwarding_rule = v.into();
2055 self
2056 }
2057
2058 pub fn set_consumer_address<T: std::convert::Into<std::string::String>>(
2060 mut self,
2061 v: T,
2062 ) -> Self {
2063 self.consumer_address = v.into();
2064 self
2065 }
2066
2067 #[deprecated]
2069 pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
2070 mut self,
2071 v: T,
2072 ) -> Self {
2073 self.error_type = v.into();
2074 self
2075 }
2076
2077 #[deprecated]
2079 pub fn set_error<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
2080 mut self,
2081 v: T,
2082 ) -> Self {
2083 self.error = v.into();
2084 self
2085 }
2086
2087 pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
2089 mut self,
2090 v: T,
2091 ) -> Self {
2092 self.gce_operation = v.into();
2093 self
2094 }
2095
2096 pub fn set_consumer_target_project<T: std::convert::Into<std::string::String>>(
2098 mut self,
2099 v: T,
2100 ) -> Self {
2101 self.consumer_target_project = v.into();
2102 self
2103 }
2104
2105 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
2107 mut self,
2108 v: T,
2109 ) -> Self {
2110 self.psc_connection_id = v.into();
2111 self
2112 }
2113
2114 pub fn set_error_info<T: std::convert::Into<std::option::Option<rpc::model::ErrorInfo>>>(
2116 mut self,
2117 v: T,
2118 ) -> Self {
2119 self.error_info = v.into();
2120 self
2121 }
2122
2123 pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
2125 mut self,
2126 v: T,
2127 ) -> Self {
2128 self.selected_subnetwork = v.into();
2129 self
2130 }
2131
2132 #[deprecated]
2134 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
2135 mut self,
2136 v: T,
2137 ) -> Self {
2138 self.producer_instance_id = v.into();
2139 self
2140 }
2141
2142 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
2144 where
2145 T: std::iter::IntoIterator<Item = (K, V)>,
2146 K: std::convert::Into<std::string::String>,
2147 V: std::convert::Into<std::string::String>,
2148 {
2149 use std::iter::Iterator;
2150 self.producer_instance_metadata =
2151 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2152 self
2153 }
2154
2155 pub fn set_service_class<T: std::convert::Into<std::string::String>>(
2157 mut self,
2158 v: T,
2159 ) -> Self {
2160 self.service_class = v.into();
2161 self
2162 }
2163
2164 pub fn set_ip_version<
2166 T: std::convert::Into<std::option::Option<crate::model::IPVersion>>,
2167 >(
2168 mut self,
2169 v: T,
2170 ) -> Self {
2171 self.ip_version = v.into();
2172 self
2173 }
2174 }
2175
2176 impl wkt::message::Message for PscConnection {
2177 fn typename() -> &'static str {
2178 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection"
2179 }
2180 }
2181
2182 #[derive(Clone, Debug, PartialEq)]
2201 #[non_exhaustive]
2202 pub enum State {
2203 Unspecified,
2205 Active,
2209 Failed,
2212 Creating,
2214 Deleting,
2216 CreateRepairing,
2218 DeleteRepairing,
2220 UnknownValue(state::UnknownValue),
2225 }
2226
2227 #[doc(hidden)]
2228 pub mod state {
2229 #[allow(unused_imports)]
2230 use super::*;
2231 #[derive(Clone, Debug, PartialEq)]
2232 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2233 }
2234
2235 impl State {
2236 pub fn value(&self) -> std::option::Option<i32> {
2241 match self {
2242 Self::Unspecified => std::option::Option::Some(0),
2243 Self::Active => std::option::Option::Some(1),
2244 Self::Failed => std::option::Option::Some(2),
2245 Self::Creating => std::option::Option::Some(3),
2246 Self::Deleting => std::option::Option::Some(4),
2247 Self::CreateRepairing => std::option::Option::Some(5),
2248 Self::DeleteRepairing => std::option::Option::Some(6),
2249 Self::UnknownValue(u) => u.0.value(),
2250 }
2251 }
2252
2253 pub fn name(&self) -> std::option::Option<&str> {
2258 match self {
2259 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2260 Self::Active => std::option::Option::Some("ACTIVE"),
2261 Self::Failed => std::option::Option::Some("FAILED"),
2262 Self::Creating => std::option::Option::Some("CREATING"),
2263 Self::Deleting => std::option::Option::Some("DELETING"),
2264 Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
2265 Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
2266 Self::UnknownValue(u) => u.0.name(),
2267 }
2268 }
2269 }
2270
2271 impl std::default::Default for State {
2272 fn default() -> Self {
2273 use std::convert::From;
2274 Self::from(0)
2275 }
2276 }
2277
2278 impl std::fmt::Display for State {
2279 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2280 wkt::internal::display_enum(f, self.name(), self.value())
2281 }
2282 }
2283
2284 impl std::convert::From<i32> for State {
2285 fn from(value: i32) -> Self {
2286 match value {
2287 0 => Self::Unspecified,
2288 1 => Self::Active,
2289 2 => Self::Failed,
2290 3 => Self::Creating,
2291 4 => Self::Deleting,
2292 5 => Self::CreateRepairing,
2293 6 => Self::DeleteRepairing,
2294 _ => Self::UnknownValue(state::UnknownValue(
2295 wkt::internal::UnknownEnumValue::Integer(value),
2296 )),
2297 }
2298 }
2299 }
2300
2301 impl std::convert::From<&str> for State {
2302 fn from(value: &str) -> Self {
2303 use std::string::ToString;
2304 match value {
2305 "STATE_UNSPECIFIED" => Self::Unspecified,
2306 "ACTIVE" => Self::Active,
2307 "FAILED" => Self::Failed,
2308 "CREATING" => Self::Creating,
2309 "DELETING" => Self::Deleting,
2310 "CREATE_REPAIRING" => Self::CreateRepairing,
2311 "DELETE_REPAIRING" => Self::DeleteRepairing,
2312 _ => Self::UnknownValue(state::UnknownValue(
2313 wkt::internal::UnknownEnumValue::String(value.to_string()),
2314 )),
2315 }
2316 }
2317 }
2318
2319 impl serde::ser::Serialize for State {
2320 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2321 where
2322 S: serde::Serializer,
2323 {
2324 match self {
2325 Self::Unspecified => serializer.serialize_i32(0),
2326 Self::Active => serializer.serialize_i32(1),
2327 Self::Failed => serializer.serialize_i32(2),
2328 Self::Creating => serializer.serialize_i32(3),
2329 Self::Deleting => serializer.serialize_i32(4),
2330 Self::CreateRepairing => serializer.serialize_i32(5),
2331 Self::DeleteRepairing => serializer.serialize_i32(6),
2332 Self::UnknownValue(u) => u.0.serialize(serializer),
2333 }
2334 }
2335 }
2336
2337 impl<'de> serde::de::Deserialize<'de> for State {
2338 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2339 where
2340 D: serde::Deserializer<'de>,
2341 {
2342 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2343 ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.State",
2344 ))
2345 }
2346 }
2347}
2348
2349#[serde_with::serde_as]
2351#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2352#[serde(default, rename_all = "camelCase")]
2353#[non_exhaustive]
2354pub struct ListServiceConnectionPoliciesRequest {
2355 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2357 pub parent: std::string::String,
2358
2359 #[serde(skip_serializing_if = "wkt::internal::is_default")]
2361 pub page_size: i32,
2362
2363 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2365 pub page_token: std::string::String,
2366
2367 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2369 pub filter: std::string::String,
2370
2371 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2373 pub order_by: std::string::String,
2374
2375 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2376 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2377}
2378
2379impl ListServiceConnectionPoliciesRequest {
2380 pub fn new() -> Self {
2381 std::default::Default::default()
2382 }
2383
2384 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2386 self.parent = v.into();
2387 self
2388 }
2389
2390 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2392 self.page_size = v.into();
2393 self
2394 }
2395
2396 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2398 self.page_token = v.into();
2399 self
2400 }
2401
2402 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2404 self.filter = v.into();
2405 self
2406 }
2407
2408 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2410 self.order_by = v.into();
2411 self
2412 }
2413}
2414
2415impl wkt::message::Message for ListServiceConnectionPoliciesRequest {
2416 fn typename() -> &'static str {
2417 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesRequest"
2418 }
2419}
2420
2421#[serde_with::serde_as]
2423#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2424#[serde(default, rename_all = "camelCase")]
2425#[non_exhaustive]
2426pub struct ListServiceConnectionPoliciesResponse {
2427 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2429 pub service_connection_policies: std::vec::Vec<crate::model::ServiceConnectionPolicy>,
2430
2431 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2434 pub next_page_token: std::string::String,
2435
2436 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2438 pub unreachable: std::vec::Vec<std::string::String>,
2439
2440 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2441 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2442}
2443
2444impl ListServiceConnectionPoliciesResponse {
2445 pub fn new() -> Self {
2446 std::default::Default::default()
2447 }
2448
2449 pub fn set_service_connection_policies<T, V>(mut self, v: T) -> Self
2451 where
2452 T: std::iter::IntoIterator<Item = V>,
2453 V: std::convert::Into<crate::model::ServiceConnectionPolicy>,
2454 {
2455 use std::iter::Iterator;
2456 self.service_connection_policies = v.into_iter().map(|i| i.into()).collect();
2457 self
2458 }
2459
2460 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2462 self.next_page_token = v.into();
2463 self
2464 }
2465
2466 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2468 where
2469 T: std::iter::IntoIterator<Item = V>,
2470 V: std::convert::Into<std::string::String>,
2471 {
2472 use std::iter::Iterator;
2473 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2474 self
2475 }
2476}
2477
2478impl wkt::message::Message for ListServiceConnectionPoliciesResponse {
2479 fn typename() -> &'static str {
2480 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesResponse"
2481 }
2482}
2483
2484#[doc(hidden)]
2485impl gax::paginator::internal::PageableResponse for ListServiceConnectionPoliciesResponse {
2486 type PageItem = crate::model::ServiceConnectionPolicy;
2487
2488 fn items(self) -> std::vec::Vec<Self::PageItem> {
2489 self.service_connection_policies
2490 }
2491
2492 fn next_page_token(&self) -> std::string::String {
2493 use std::clone::Clone;
2494 self.next_page_token.clone()
2495 }
2496}
2497
2498#[serde_with::serde_as]
2500#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2501#[serde(default, rename_all = "camelCase")]
2502#[non_exhaustive]
2503pub struct GetServiceConnectionPolicyRequest {
2504 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2506 pub name: std::string::String,
2507
2508 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2509 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2510}
2511
2512impl GetServiceConnectionPolicyRequest {
2513 pub fn new() -> Self {
2514 std::default::Default::default()
2515 }
2516
2517 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2519 self.name = v.into();
2520 self
2521 }
2522}
2523
2524impl wkt::message::Message for GetServiceConnectionPolicyRequest {
2525 fn typename() -> &'static str {
2526 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionPolicyRequest"
2527 }
2528}
2529
2530#[serde_with::serde_as]
2532#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2533#[serde(default, rename_all = "camelCase")]
2534#[non_exhaustive]
2535pub struct CreateServiceConnectionPolicyRequest {
2536 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2539 pub parent: std::string::String,
2540
2541 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2546 pub service_connection_policy_id: std::string::String,
2547
2548 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2550 pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
2551
2552 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2566 pub request_id: std::string::String,
2567
2568 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2569 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2570}
2571
2572impl CreateServiceConnectionPolicyRequest {
2573 pub fn new() -> Self {
2574 std::default::Default::default()
2575 }
2576
2577 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2579 self.parent = v.into();
2580 self
2581 }
2582
2583 pub fn set_service_connection_policy_id<T: std::convert::Into<std::string::String>>(
2585 mut self,
2586 v: T,
2587 ) -> Self {
2588 self.service_connection_policy_id = v.into();
2589 self
2590 }
2591
2592 pub fn set_service_connection_policy<
2594 T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionPolicy>>,
2595 >(
2596 mut self,
2597 v: T,
2598 ) -> Self {
2599 self.service_connection_policy = v.into();
2600 self
2601 }
2602
2603 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2605 self.request_id = v.into();
2606 self
2607 }
2608}
2609
2610impl wkt::message::Message for CreateServiceConnectionPolicyRequest {
2611 fn typename() -> &'static str {
2612 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionPolicyRequest"
2613 }
2614}
2615
2616#[serde_with::serde_as]
2618#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2619#[serde(default, rename_all = "camelCase")]
2620#[non_exhaustive]
2621pub struct UpdateServiceConnectionPolicyRequest {
2622 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2628 pub update_mask: std::option::Option<wkt::FieldMask>,
2629
2630 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2632 pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
2633
2634 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2648 pub request_id: std::string::String,
2649
2650 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2651 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2652}
2653
2654impl UpdateServiceConnectionPolicyRequest {
2655 pub fn new() -> Self {
2656 std::default::Default::default()
2657 }
2658
2659 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
2661 mut self,
2662 v: T,
2663 ) -> Self {
2664 self.update_mask = v.into();
2665 self
2666 }
2667
2668 pub fn set_service_connection_policy<
2670 T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionPolicy>>,
2671 >(
2672 mut self,
2673 v: T,
2674 ) -> Self {
2675 self.service_connection_policy = v.into();
2676 self
2677 }
2678
2679 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2681 self.request_id = v.into();
2682 self
2683 }
2684}
2685
2686impl wkt::message::Message for UpdateServiceConnectionPolicyRequest {
2687 fn typename() -> &'static str {
2688 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionPolicyRequest"
2689 }
2690}
2691
2692#[serde_with::serde_as]
2694#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2695#[serde(default, rename_all = "camelCase")]
2696#[non_exhaustive]
2697pub struct DeleteServiceConnectionPolicyRequest {
2698 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2700 pub name: std::string::String,
2701
2702 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2716 pub request_id: std::string::String,
2717
2718 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2722 pub etag: std::option::Option<std::string::String>,
2723
2724 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2725 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2726}
2727
2728impl DeleteServiceConnectionPolicyRequest {
2729 pub fn new() -> Self {
2730 std::default::Default::default()
2731 }
2732
2733 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2735 self.name = v.into();
2736 self
2737 }
2738
2739 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2741 self.request_id = v.into();
2742 self
2743 }
2744
2745 pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
2747 mut self,
2748 v: T,
2749 ) -> Self {
2750 self.etag = v.into();
2751 self
2752 }
2753}
2754
2755impl wkt::message::Message for DeleteServiceConnectionPolicyRequest {
2756 fn typename() -> &'static str {
2757 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionPolicyRequest"
2758 }
2759}
2760
2761#[serde_with::serde_as]
2763#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2764#[serde(default, rename_all = "camelCase")]
2765#[non_exhaustive]
2766pub struct ServiceClass {
2767 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2772 pub name: std::string::String,
2773
2774 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2778 pub service_class: std::string::String,
2779
2780 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2782 pub create_time: std::option::Option<wkt::Timestamp>,
2783
2784 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2786 pub update_time: std::option::Option<wkt::Timestamp>,
2787
2788 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2790 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2791
2792 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2794 pub description: std::string::String,
2795
2796 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2800 pub etag: std::option::Option<std::string::String>,
2801
2802 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2803 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2804}
2805
2806impl ServiceClass {
2807 pub fn new() -> Self {
2808 std::default::Default::default()
2809 }
2810
2811 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2813 self.name = v.into();
2814 self
2815 }
2816
2817 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2819 self.service_class = v.into();
2820 self
2821 }
2822
2823 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2825 mut self,
2826 v: T,
2827 ) -> Self {
2828 self.create_time = v.into();
2829 self
2830 }
2831
2832 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2834 mut self,
2835 v: T,
2836 ) -> Self {
2837 self.update_time = v.into();
2838 self
2839 }
2840
2841 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2843 where
2844 T: std::iter::IntoIterator<Item = (K, V)>,
2845 K: std::convert::Into<std::string::String>,
2846 V: std::convert::Into<std::string::String>,
2847 {
2848 use std::iter::Iterator;
2849 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2850 self
2851 }
2852
2853 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2855 self.description = v.into();
2856 self
2857 }
2858
2859 pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
2861 mut self,
2862 v: T,
2863 ) -> Self {
2864 self.etag = v.into();
2865 self
2866 }
2867}
2868
2869impl wkt::message::Message for ServiceClass {
2870 fn typename() -> &'static str {
2871 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceClass"
2872 }
2873}
2874
2875#[serde_with::serde_as]
2877#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2878#[serde(default, rename_all = "camelCase")]
2879#[non_exhaustive]
2880pub struct ListServiceClassesRequest {
2881 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2883 pub parent: std::string::String,
2884
2885 #[serde(skip_serializing_if = "wkt::internal::is_default")]
2887 pub page_size: i32,
2888
2889 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2891 pub page_token: std::string::String,
2892
2893 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2895 pub filter: std::string::String,
2896
2897 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2899 pub order_by: std::string::String,
2900
2901 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2902 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2903}
2904
2905impl ListServiceClassesRequest {
2906 pub fn new() -> Self {
2907 std::default::Default::default()
2908 }
2909
2910 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2912 self.parent = v.into();
2913 self
2914 }
2915
2916 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2918 self.page_size = v.into();
2919 self
2920 }
2921
2922 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2924 self.page_token = v.into();
2925 self
2926 }
2927
2928 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2930 self.filter = v.into();
2931 self
2932 }
2933
2934 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2936 self.order_by = v.into();
2937 self
2938 }
2939}
2940
2941impl wkt::message::Message for ListServiceClassesRequest {
2942 fn typename() -> &'static str {
2943 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesRequest"
2944 }
2945}
2946
2947#[serde_with::serde_as]
2949#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2950#[serde(default, rename_all = "camelCase")]
2951#[non_exhaustive]
2952pub struct ListServiceClassesResponse {
2953 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2955 pub service_classes: std::vec::Vec<crate::model::ServiceClass>,
2956
2957 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2960 pub next_page_token: std::string::String,
2961
2962 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2964 pub unreachable: std::vec::Vec<std::string::String>,
2965
2966 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2967 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2968}
2969
2970impl ListServiceClassesResponse {
2971 pub fn new() -> Self {
2972 std::default::Default::default()
2973 }
2974
2975 pub fn set_service_classes<T, V>(mut self, v: T) -> Self
2977 where
2978 T: std::iter::IntoIterator<Item = V>,
2979 V: std::convert::Into<crate::model::ServiceClass>,
2980 {
2981 use std::iter::Iterator;
2982 self.service_classes = v.into_iter().map(|i| i.into()).collect();
2983 self
2984 }
2985
2986 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2988 self.next_page_token = v.into();
2989 self
2990 }
2991
2992 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2994 where
2995 T: std::iter::IntoIterator<Item = V>,
2996 V: std::convert::Into<std::string::String>,
2997 {
2998 use std::iter::Iterator;
2999 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3000 self
3001 }
3002}
3003
3004impl wkt::message::Message for ListServiceClassesResponse {
3005 fn typename() -> &'static str {
3006 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesResponse"
3007 }
3008}
3009
3010#[doc(hidden)]
3011impl gax::paginator::internal::PageableResponse for ListServiceClassesResponse {
3012 type PageItem = crate::model::ServiceClass;
3013
3014 fn items(self) -> std::vec::Vec<Self::PageItem> {
3015 self.service_classes
3016 }
3017
3018 fn next_page_token(&self) -> std::string::String {
3019 use std::clone::Clone;
3020 self.next_page_token.clone()
3021 }
3022}
3023
3024#[serde_with::serde_as]
3026#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3027#[serde(default, rename_all = "camelCase")]
3028#[non_exhaustive]
3029pub struct GetServiceClassRequest {
3030 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3032 pub name: std::string::String,
3033
3034 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3035 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3036}
3037
3038impl GetServiceClassRequest {
3039 pub fn new() -> Self {
3040 std::default::Default::default()
3041 }
3042
3043 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3045 self.name = v.into();
3046 self
3047 }
3048}
3049
3050impl wkt::message::Message for GetServiceClassRequest {
3051 fn typename() -> &'static str {
3052 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceClassRequest"
3053 }
3054}
3055
3056#[serde_with::serde_as]
3058#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3059#[serde(default, rename_all = "camelCase")]
3060#[non_exhaustive]
3061pub struct UpdateServiceClassRequest {
3062 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3068 pub update_mask: std::option::Option<wkt::FieldMask>,
3069
3070 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3072 pub service_class: std::option::Option<crate::model::ServiceClass>,
3073
3074 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3088 pub request_id: std::string::String,
3089
3090 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3091 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3092}
3093
3094impl UpdateServiceClassRequest {
3095 pub fn new() -> Self {
3096 std::default::Default::default()
3097 }
3098
3099 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
3101 mut self,
3102 v: T,
3103 ) -> Self {
3104 self.update_mask = v.into();
3105 self
3106 }
3107
3108 pub fn set_service_class<
3110 T: std::convert::Into<std::option::Option<crate::model::ServiceClass>>,
3111 >(
3112 mut self,
3113 v: T,
3114 ) -> Self {
3115 self.service_class = v.into();
3116 self
3117 }
3118
3119 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3121 self.request_id = v.into();
3122 self
3123 }
3124}
3125
3126impl wkt::message::Message for UpdateServiceClassRequest {
3127 fn typename() -> &'static str {
3128 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceClassRequest"
3129 }
3130}
3131
3132#[serde_with::serde_as]
3134#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3135#[serde(default, rename_all = "camelCase")]
3136#[non_exhaustive]
3137pub struct DeleteServiceClassRequest {
3138 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3140 pub name: std::string::String,
3141
3142 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3156 pub request_id: std::string::String,
3157
3158 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3162 pub etag: std::option::Option<std::string::String>,
3163
3164 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3165 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3166}
3167
3168impl DeleteServiceClassRequest {
3169 pub fn new() -> Self {
3170 std::default::Default::default()
3171 }
3172
3173 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3175 self.name = v.into();
3176 self
3177 }
3178
3179 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3181 self.request_id = v.into();
3182 self
3183 }
3184
3185 pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
3187 mut self,
3188 v: T,
3189 ) -> Self {
3190 self.etag = v.into();
3191 self
3192 }
3193}
3194
3195impl wkt::message::Message for DeleteServiceClassRequest {
3196 fn typename() -> &'static str {
3197 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceClassRequest"
3198 }
3199}
3200
3201#[serde_with::serde_as]
3203#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3204#[serde(default, rename_all = "camelCase")]
3205#[non_exhaustive]
3206pub struct ServiceConnectionToken {
3207 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3212 pub name: std::string::String,
3213
3214 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3216 pub create_time: std::option::Option<wkt::Timestamp>,
3217
3218 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3220 pub update_time: std::option::Option<wkt::Timestamp>,
3221
3222 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
3224 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3225
3226 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3228 pub description: std::string::String,
3229
3230 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3234 pub network: std::string::String,
3235
3236 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3238 pub token: std::string::String,
3239
3240 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3242 pub expire_time: std::option::Option<wkt::Timestamp>,
3243
3244 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3248 pub etag: std::option::Option<std::string::String>,
3249
3250 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3251 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3252}
3253
3254impl ServiceConnectionToken {
3255 pub fn new() -> Self {
3256 std::default::Default::default()
3257 }
3258
3259 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3261 self.name = v.into();
3262 self
3263 }
3264
3265 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3267 mut self,
3268 v: T,
3269 ) -> Self {
3270 self.create_time = v.into();
3271 self
3272 }
3273
3274 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3276 mut self,
3277 v: T,
3278 ) -> Self {
3279 self.update_time = v.into();
3280 self
3281 }
3282
3283 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3285 where
3286 T: std::iter::IntoIterator<Item = (K, V)>,
3287 K: std::convert::Into<std::string::String>,
3288 V: std::convert::Into<std::string::String>,
3289 {
3290 use std::iter::Iterator;
3291 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3292 self
3293 }
3294
3295 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3297 self.description = v.into();
3298 self
3299 }
3300
3301 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3303 self.network = v.into();
3304 self
3305 }
3306
3307 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3309 self.token = v.into();
3310 self
3311 }
3312
3313 pub fn set_expire_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3315 mut self,
3316 v: T,
3317 ) -> Self {
3318 self.expire_time = v.into();
3319 self
3320 }
3321
3322 pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
3324 mut self,
3325 v: T,
3326 ) -> Self {
3327 self.etag = v.into();
3328 self
3329 }
3330}
3331
3332impl wkt::message::Message for ServiceConnectionToken {
3333 fn typename() -> &'static str {
3334 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionToken"
3335 }
3336}
3337
3338#[serde_with::serde_as]
3340#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3341#[serde(default, rename_all = "camelCase")]
3342#[non_exhaustive]
3343pub struct ListServiceConnectionTokensRequest {
3344 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3346 pub parent: std::string::String,
3347
3348 #[serde(skip_serializing_if = "wkt::internal::is_default")]
3350 pub page_size: i32,
3351
3352 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3354 pub page_token: std::string::String,
3355
3356 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3358 pub filter: std::string::String,
3359
3360 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3362 pub order_by: std::string::String,
3363
3364 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3365 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3366}
3367
3368impl ListServiceConnectionTokensRequest {
3369 pub fn new() -> Self {
3370 std::default::Default::default()
3371 }
3372
3373 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3375 self.parent = v.into();
3376 self
3377 }
3378
3379 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3381 self.page_size = v.into();
3382 self
3383 }
3384
3385 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3387 self.page_token = v.into();
3388 self
3389 }
3390
3391 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3393 self.filter = v.into();
3394 self
3395 }
3396
3397 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3399 self.order_by = v.into();
3400 self
3401 }
3402}
3403
3404impl wkt::message::Message for ListServiceConnectionTokensRequest {
3405 fn typename() -> &'static str {
3406 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensRequest"
3407 }
3408}
3409
3410#[serde_with::serde_as]
3412#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3413#[serde(default, rename_all = "camelCase")]
3414#[non_exhaustive]
3415pub struct ListServiceConnectionTokensResponse {
3416 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3418 pub service_connection_tokens: std::vec::Vec<crate::model::ServiceConnectionToken>,
3419
3420 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3423 pub next_page_token: std::string::String,
3424
3425 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3427 pub unreachable: std::vec::Vec<std::string::String>,
3428
3429 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3430 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3431}
3432
3433impl ListServiceConnectionTokensResponse {
3434 pub fn new() -> Self {
3435 std::default::Default::default()
3436 }
3437
3438 pub fn set_service_connection_tokens<T, V>(mut self, v: T) -> Self
3440 where
3441 T: std::iter::IntoIterator<Item = V>,
3442 V: std::convert::Into<crate::model::ServiceConnectionToken>,
3443 {
3444 use std::iter::Iterator;
3445 self.service_connection_tokens = v.into_iter().map(|i| i.into()).collect();
3446 self
3447 }
3448
3449 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3451 self.next_page_token = v.into();
3452 self
3453 }
3454
3455 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3457 where
3458 T: std::iter::IntoIterator<Item = V>,
3459 V: std::convert::Into<std::string::String>,
3460 {
3461 use std::iter::Iterator;
3462 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3463 self
3464 }
3465}
3466
3467impl wkt::message::Message for ListServiceConnectionTokensResponse {
3468 fn typename() -> &'static str {
3469 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensResponse"
3470 }
3471}
3472
3473#[doc(hidden)]
3474impl gax::paginator::internal::PageableResponse for ListServiceConnectionTokensResponse {
3475 type PageItem = crate::model::ServiceConnectionToken;
3476
3477 fn items(self) -> std::vec::Vec<Self::PageItem> {
3478 self.service_connection_tokens
3479 }
3480
3481 fn next_page_token(&self) -> std::string::String {
3482 use std::clone::Clone;
3483 self.next_page_token.clone()
3484 }
3485}
3486
3487#[serde_with::serde_as]
3489#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3490#[serde(default, rename_all = "camelCase")]
3491#[non_exhaustive]
3492pub struct GetServiceConnectionTokenRequest {
3493 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3495 pub name: std::string::String,
3496
3497 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3498 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3499}
3500
3501impl GetServiceConnectionTokenRequest {
3502 pub fn new() -> Self {
3503 std::default::Default::default()
3504 }
3505
3506 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3508 self.name = v.into();
3509 self
3510 }
3511}
3512
3513impl wkt::message::Message for GetServiceConnectionTokenRequest {
3514 fn typename() -> &'static str {
3515 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionTokenRequest"
3516 }
3517}
3518
3519#[serde_with::serde_as]
3521#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3522#[serde(default, rename_all = "camelCase")]
3523#[non_exhaustive]
3524pub struct CreateServiceConnectionTokenRequest {
3525 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3528 pub parent: std::string::String,
3529
3530 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3536 pub service_connection_token_id: std::string::String,
3537
3538 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3540 pub service_connection_token: std::option::Option<crate::model::ServiceConnectionToken>,
3541
3542 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3556 pub request_id: std::string::String,
3557
3558 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3559 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3560}
3561
3562impl CreateServiceConnectionTokenRequest {
3563 pub fn new() -> Self {
3564 std::default::Default::default()
3565 }
3566
3567 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3569 self.parent = v.into();
3570 self
3571 }
3572
3573 pub fn set_service_connection_token_id<T: std::convert::Into<std::string::String>>(
3575 mut self,
3576 v: T,
3577 ) -> Self {
3578 self.service_connection_token_id = v.into();
3579 self
3580 }
3581
3582 pub fn set_service_connection_token<
3584 T: std::convert::Into<std::option::Option<crate::model::ServiceConnectionToken>>,
3585 >(
3586 mut self,
3587 v: T,
3588 ) -> Self {
3589 self.service_connection_token = v.into();
3590 self
3591 }
3592
3593 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3595 self.request_id = v.into();
3596 self
3597 }
3598}
3599
3600impl wkt::message::Message for CreateServiceConnectionTokenRequest {
3601 fn typename() -> &'static str {
3602 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionTokenRequest"
3603 }
3604}
3605
3606#[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 DeleteServiceConnectionTokenRequest {
3612 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3614 pub name: std::string::String,
3615
3616 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3630 pub request_id: std::string::String,
3631
3632 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3636 pub etag: std::option::Option<std::string::String>,
3637
3638 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3639 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3640}
3641
3642impl DeleteServiceConnectionTokenRequest {
3643 pub fn new() -> Self {
3644 std::default::Default::default()
3645 }
3646
3647 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3649 self.name = v.into();
3650 self
3651 }
3652
3653 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3655 self.request_id = v.into();
3656 self
3657 }
3658
3659 pub fn set_etag<T: std::convert::Into<std::option::Option<std::string::String>>>(
3661 mut self,
3662 v: T,
3663 ) -> Self {
3664 self.etag = v.into();
3665 self
3666 }
3667}
3668
3669impl wkt::message::Message for DeleteServiceConnectionTokenRequest {
3670 fn typename() -> &'static str {
3671 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionTokenRequest"
3672 }
3673}
3674
3675#[serde_with::serde_as]
3682#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3683#[serde(default, rename_all = "camelCase")]
3684#[non_exhaustive]
3685pub struct Hub {
3686 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3690 pub name: std::string::String,
3691
3692 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3694 pub create_time: std::option::Option<wkt::Timestamp>,
3695
3696 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3698 pub update_time: std::option::Option<wkt::Timestamp>,
3699
3700 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
3704 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3705
3706 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3708 pub description: std::string::String,
3709
3710 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3714 pub unique_id: std::string::String,
3715
3716 pub state: crate::model::State,
3718
3719 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3724 pub routing_vpcs: std::vec::Vec<crate::model::RoutingVPC>,
3725
3726 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3733 pub route_tables: std::vec::Vec<std::string::String>,
3734
3735 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3741 pub spoke_summary: std::option::Option<crate::model::SpokeSummary>,
3742
3743 pub policy_mode: crate::model::PolicyMode,
3747
3748 pub preset_topology: crate::model::PresetTopology,
3754
3755 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3760 pub export_psc: std::option::Option<bool>,
3761
3762 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3763 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3764}
3765
3766impl Hub {
3767 pub fn new() -> Self {
3768 std::default::Default::default()
3769 }
3770
3771 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3773 self.name = v.into();
3774 self
3775 }
3776
3777 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3779 mut self,
3780 v: T,
3781 ) -> Self {
3782 self.create_time = v.into();
3783 self
3784 }
3785
3786 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3788 mut self,
3789 v: T,
3790 ) -> Self {
3791 self.update_time = v.into();
3792 self
3793 }
3794
3795 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3797 where
3798 T: std::iter::IntoIterator<Item = (K, V)>,
3799 K: std::convert::Into<std::string::String>,
3800 V: std::convert::Into<std::string::String>,
3801 {
3802 use std::iter::Iterator;
3803 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3804 self
3805 }
3806
3807 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3809 self.description = v.into();
3810 self
3811 }
3812
3813 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3815 self.unique_id = v.into();
3816 self
3817 }
3818
3819 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
3821 self.state = v.into();
3822 self
3823 }
3824
3825 pub fn set_routing_vpcs<T, V>(mut self, v: T) -> Self
3827 where
3828 T: std::iter::IntoIterator<Item = V>,
3829 V: std::convert::Into<crate::model::RoutingVPC>,
3830 {
3831 use std::iter::Iterator;
3832 self.routing_vpcs = v.into_iter().map(|i| i.into()).collect();
3833 self
3834 }
3835
3836 pub fn set_route_tables<T, V>(mut self, v: T) -> Self
3838 where
3839 T: std::iter::IntoIterator<Item = V>,
3840 V: std::convert::Into<std::string::String>,
3841 {
3842 use std::iter::Iterator;
3843 self.route_tables = v.into_iter().map(|i| i.into()).collect();
3844 self
3845 }
3846
3847 pub fn set_spoke_summary<
3849 T: std::convert::Into<std::option::Option<crate::model::SpokeSummary>>,
3850 >(
3851 mut self,
3852 v: T,
3853 ) -> Self {
3854 self.spoke_summary = v.into();
3855 self
3856 }
3857
3858 pub fn set_policy_mode<T: std::convert::Into<crate::model::PolicyMode>>(
3860 mut self,
3861 v: T,
3862 ) -> Self {
3863 self.policy_mode = v.into();
3864 self
3865 }
3866
3867 pub fn set_preset_topology<T: std::convert::Into<crate::model::PresetTopology>>(
3869 mut self,
3870 v: T,
3871 ) -> Self {
3872 self.preset_topology = v.into();
3873 self
3874 }
3875
3876 pub fn set_export_psc<T: std::convert::Into<std::option::Option<bool>>>(
3878 mut self,
3879 v: T,
3880 ) -> Self {
3881 self.export_psc = v.into();
3882 self
3883 }
3884}
3885
3886impl wkt::message::Message for Hub {
3887 fn typename() -> &'static str {
3888 "type.googleapis.com/google.cloud.networkconnectivity.v1.Hub"
3889 }
3890}
3891
3892#[serde_with::serde_as]
3895#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3896#[serde(default, rename_all = "camelCase")]
3897#[non_exhaustive]
3898pub struct RoutingVPC {
3899 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3901 pub uri: std::string::String,
3902
3903 #[serde(skip_serializing_if = "wkt::internal::is_default")]
3909 pub required_for_new_site_to_site_data_transfer_spokes: bool,
3910
3911 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3912 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3913}
3914
3915impl RoutingVPC {
3916 pub fn new() -> Self {
3917 std::default::Default::default()
3918 }
3919
3920 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3922 self.uri = v.into();
3923 self
3924 }
3925
3926 pub fn set_required_for_new_site_to_site_data_transfer_spokes<T: std::convert::Into<bool>>(
3928 mut self,
3929 v: T,
3930 ) -> Self {
3931 self.required_for_new_site_to_site_data_transfer_spokes = v.into();
3932 self
3933 }
3934}
3935
3936impl wkt::message::Message for RoutingVPC {
3937 fn typename() -> &'static str {
3938 "type.googleapis.com/google.cloud.networkconnectivity.v1.RoutingVPC"
3939 }
3940}
3941
3942#[serde_with::serde_as]
3953#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3954#[serde(default, rename_all = "camelCase")]
3955#[non_exhaustive]
3956pub struct Spoke {
3957 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3961 pub name: std::string::String,
3962
3963 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3965 pub create_time: std::option::Option<wkt::Timestamp>,
3966
3967 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3969 pub update_time: std::option::Option<wkt::Timestamp>,
3970
3971 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
3975 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3976
3977 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3979 pub description: std::string::String,
3980
3981 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3983 pub hub: std::string::String,
3984
3985 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3987 pub group: std::string::String,
3988
3989 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3991 pub linked_vpn_tunnels: std::option::Option<crate::model::LinkedVpnTunnels>,
3992
3993 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3995 pub linked_interconnect_attachments:
3996 std::option::Option<crate::model::LinkedInterconnectAttachments>,
3997
3998 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4000 pub linked_router_appliance_instances:
4001 std::option::Option<crate::model::LinkedRouterApplianceInstances>,
4002
4003 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4005 pub linked_vpc_network: std::option::Option<crate::model::LinkedVpcNetwork>,
4006
4007 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4009 pub linked_producer_vpc_network: std::option::Option<crate::model::LinkedProducerVpcNetwork>,
4010
4011 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4015 pub unique_id: std::string::String,
4016
4017 pub state: crate::model::State,
4019
4020 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4022 pub reasons: std::vec::Vec<crate::model::spoke::StateReason>,
4023
4024 pub spoke_type: crate::model::SpokeType,
4026
4027 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4031 pub etag: std::string::String,
4032
4033 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4035 pub field_paths_pending_update: std::vec::Vec<std::string::String>,
4036
4037 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4038 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4039}
4040
4041impl Spoke {
4042 pub fn new() -> Self {
4043 std::default::Default::default()
4044 }
4045
4046 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4048 self.name = v.into();
4049 self
4050 }
4051
4052 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4054 mut self,
4055 v: T,
4056 ) -> Self {
4057 self.create_time = v.into();
4058 self
4059 }
4060
4061 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4063 mut self,
4064 v: T,
4065 ) -> Self {
4066 self.update_time = v.into();
4067 self
4068 }
4069
4070 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4072 where
4073 T: std::iter::IntoIterator<Item = (K, V)>,
4074 K: std::convert::Into<std::string::String>,
4075 V: std::convert::Into<std::string::String>,
4076 {
4077 use std::iter::Iterator;
4078 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4079 self
4080 }
4081
4082 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4084 self.description = v.into();
4085 self
4086 }
4087
4088 pub fn set_hub<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4090 self.hub = v.into();
4091 self
4092 }
4093
4094 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4096 self.group = v.into();
4097 self
4098 }
4099
4100 pub fn set_linked_vpn_tunnels<
4102 T: std::convert::Into<std::option::Option<crate::model::LinkedVpnTunnels>>,
4103 >(
4104 mut self,
4105 v: T,
4106 ) -> Self {
4107 self.linked_vpn_tunnels = v.into();
4108 self
4109 }
4110
4111 pub fn set_linked_interconnect_attachments<
4113 T: std::convert::Into<std::option::Option<crate::model::LinkedInterconnectAttachments>>,
4114 >(
4115 mut self,
4116 v: T,
4117 ) -> Self {
4118 self.linked_interconnect_attachments = v.into();
4119 self
4120 }
4121
4122 pub fn set_linked_router_appliance_instances<
4124 T: std::convert::Into<std::option::Option<crate::model::LinkedRouterApplianceInstances>>,
4125 >(
4126 mut self,
4127 v: T,
4128 ) -> Self {
4129 self.linked_router_appliance_instances = v.into();
4130 self
4131 }
4132
4133 pub fn set_linked_vpc_network<
4135 T: std::convert::Into<std::option::Option<crate::model::LinkedVpcNetwork>>,
4136 >(
4137 mut self,
4138 v: T,
4139 ) -> Self {
4140 self.linked_vpc_network = v.into();
4141 self
4142 }
4143
4144 pub fn set_linked_producer_vpc_network<
4146 T: std::convert::Into<std::option::Option<crate::model::LinkedProducerVpcNetwork>>,
4147 >(
4148 mut self,
4149 v: T,
4150 ) -> Self {
4151 self.linked_producer_vpc_network = v.into();
4152 self
4153 }
4154
4155 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4157 self.unique_id = v.into();
4158 self
4159 }
4160
4161 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
4163 self.state = v.into();
4164 self
4165 }
4166
4167 pub fn set_reasons<T, V>(mut self, v: T) -> Self
4169 where
4170 T: std::iter::IntoIterator<Item = V>,
4171 V: std::convert::Into<crate::model::spoke::StateReason>,
4172 {
4173 use std::iter::Iterator;
4174 self.reasons = v.into_iter().map(|i| i.into()).collect();
4175 self
4176 }
4177
4178 pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(mut self, v: T) -> Self {
4180 self.spoke_type = v.into();
4181 self
4182 }
4183
4184 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4186 self.etag = v.into();
4187 self
4188 }
4189
4190 pub fn set_field_paths_pending_update<T, V>(mut self, v: T) -> Self
4192 where
4193 T: std::iter::IntoIterator<Item = V>,
4194 V: std::convert::Into<std::string::String>,
4195 {
4196 use std::iter::Iterator;
4197 self.field_paths_pending_update = v.into_iter().map(|i| i.into()).collect();
4198 self
4199 }
4200}
4201
4202impl wkt::message::Message for Spoke {
4203 fn typename() -> &'static str {
4204 "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke"
4205 }
4206}
4207
4208pub mod spoke {
4210 #[allow(unused_imports)]
4211 use super::*;
4212
4213 #[serde_with::serde_as]
4215 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4216 #[serde(default, rename_all = "camelCase")]
4217 #[non_exhaustive]
4218 pub struct StateReason {
4219 pub code: crate::model::spoke::state_reason::Code,
4221
4222 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4224 pub message: std::string::String,
4225
4226 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4228 pub user_details: std::string::String,
4229
4230 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4231 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4232 }
4233
4234 impl StateReason {
4235 pub fn new() -> Self {
4236 std::default::Default::default()
4237 }
4238
4239 pub fn set_code<T: std::convert::Into<crate::model::spoke::state_reason::Code>>(
4241 mut self,
4242 v: T,
4243 ) -> Self {
4244 self.code = v.into();
4245 self
4246 }
4247
4248 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4250 self.message = v.into();
4251 self
4252 }
4253
4254 pub fn set_user_details<T: std::convert::Into<std::string::String>>(
4256 mut self,
4257 v: T,
4258 ) -> Self {
4259 self.user_details = v.into();
4260 self
4261 }
4262 }
4263
4264 impl wkt::message::Message for StateReason {
4265 fn typename() -> &'static str {
4266 "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke.StateReason"
4267 }
4268 }
4269
4270 pub mod state_reason {
4272 #[allow(unused_imports)]
4273 use super::*;
4274
4275 #[derive(Clone, Debug, PartialEq)]
4291 #[non_exhaustive]
4292 pub enum Code {
4293 Unspecified,
4295 PendingReview,
4297 Rejected,
4299 Paused,
4301 Failed,
4304 UpdatePendingReview,
4306 UpdateRejected,
4308 UpdateFailed,
4311 UnknownValue(code::UnknownValue),
4316 }
4317
4318 #[doc(hidden)]
4319 pub mod code {
4320 #[allow(unused_imports)]
4321 use super::*;
4322 #[derive(Clone, Debug, PartialEq)]
4323 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4324 }
4325
4326 impl Code {
4327 pub fn value(&self) -> std::option::Option<i32> {
4332 match self {
4333 Self::Unspecified => std::option::Option::Some(0),
4334 Self::PendingReview => std::option::Option::Some(1),
4335 Self::Rejected => std::option::Option::Some(2),
4336 Self::Paused => std::option::Option::Some(3),
4337 Self::Failed => std::option::Option::Some(4),
4338 Self::UpdatePendingReview => std::option::Option::Some(5),
4339 Self::UpdateRejected => std::option::Option::Some(6),
4340 Self::UpdateFailed => std::option::Option::Some(7),
4341 Self::UnknownValue(u) => u.0.value(),
4342 }
4343 }
4344
4345 pub fn name(&self) -> std::option::Option<&str> {
4350 match self {
4351 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
4352 Self::PendingReview => std::option::Option::Some("PENDING_REVIEW"),
4353 Self::Rejected => std::option::Option::Some("REJECTED"),
4354 Self::Paused => std::option::Option::Some("PAUSED"),
4355 Self::Failed => std::option::Option::Some("FAILED"),
4356 Self::UpdatePendingReview => std::option::Option::Some("UPDATE_PENDING_REVIEW"),
4357 Self::UpdateRejected => std::option::Option::Some("UPDATE_REJECTED"),
4358 Self::UpdateFailed => std::option::Option::Some("UPDATE_FAILED"),
4359 Self::UnknownValue(u) => u.0.name(),
4360 }
4361 }
4362 }
4363
4364 impl std::default::Default for Code {
4365 fn default() -> Self {
4366 use std::convert::From;
4367 Self::from(0)
4368 }
4369 }
4370
4371 impl std::fmt::Display for Code {
4372 fn fmt(
4373 &self,
4374 f: &mut std::fmt::Formatter<'_>,
4375 ) -> std::result::Result<(), std::fmt::Error> {
4376 wkt::internal::display_enum(f, self.name(), self.value())
4377 }
4378 }
4379
4380 impl std::convert::From<i32> for Code {
4381 fn from(value: i32) -> Self {
4382 match value {
4383 0 => Self::Unspecified,
4384 1 => Self::PendingReview,
4385 2 => Self::Rejected,
4386 3 => Self::Paused,
4387 4 => Self::Failed,
4388 5 => Self::UpdatePendingReview,
4389 6 => Self::UpdateRejected,
4390 7 => Self::UpdateFailed,
4391 _ => Self::UnknownValue(code::UnknownValue(
4392 wkt::internal::UnknownEnumValue::Integer(value),
4393 )),
4394 }
4395 }
4396 }
4397
4398 impl std::convert::From<&str> for Code {
4399 fn from(value: &str) -> Self {
4400 use std::string::ToString;
4401 match value {
4402 "CODE_UNSPECIFIED" => Self::Unspecified,
4403 "PENDING_REVIEW" => Self::PendingReview,
4404 "REJECTED" => Self::Rejected,
4405 "PAUSED" => Self::Paused,
4406 "FAILED" => Self::Failed,
4407 "UPDATE_PENDING_REVIEW" => Self::UpdatePendingReview,
4408 "UPDATE_REJECTED" => Self::UpdateRejected,
4409 "UPDATE_FAILED" => Self::UpdateFailed,
4410 _ => Self::UnknownValue(code::UnknownValue(
4411 wkt::internal::UnknownEnumValue::String(value.to_string()),
4412 )),
4413 }
4414 }
4415 }
4416
4417 impl serde::ser::Serialize for Code {
4418 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4419 where
4420 S: serde::Serializer,
4421 {
4422 match self {
4423 Self::Unspecified => serializer.serialize_i32(0),
4424 Self::PendingReview => serializer.serialize_i32(1),
4425 Self::Rejected => serializer.serialize_i32(2),
4426 Self::Paused => serializer.serialize_i32(3),
4427 Self::Failed => serializer.serialize_i32(4),
4428 Self::UpdatePendingReview => serializer.serialize_i32(5),
4429 Self::UpdateRejected => serializer.serialize_i32(6),
4430 Self::UpdateFailed => serializer.serialize_i32(7),
4431 Self::UnknownValue(u) => u.0.serialize(serializer),
4432 }
4433 }
4434 }
4435
4436 impl<'de> serde::de::Deserialize<'de> for Code {
4437 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4438 where
4439 D: serde::Deserializer<'de>,
4440 {
4441 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
4442 ".google.cloud.networkconnectivity.v1.Spoke.StateReason.Code",
4443 ))
4444 }
4445 }
4446 }
4447}
4448
4449#[serde_with::serde_as]
4450#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4451#[serde(default, rename_all = "camelCase")]
4452#[non_exhaustive]
4453pub struct RouteTable {
4454 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4458 pub name: std::string::String,
4459
4460 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4462 pub create_time: std::option::Option<wkt::Timestamp>,
4463
4464 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4466 pub update_time: std::option::Option<wkt::Timestamp>,
4467
4468 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4472 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4473
4474 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4476 pub description: std::string::String,
4477
4478 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4483 pub uid: std::string::String,
4484
4485 pub state: crate::model::State,
4487
4488 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4489 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4490}
4491
4492impl RouteTable {
4493 pub fn new() -> Self {
4494 std::default::Default::default()
4495 }
4496
4497 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4499 self.name = v.into();
4500 self
4501 }
4502
4503 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4505 mut self,
4506 v: T,
4507 ) -> Self {
4508 self.create_time = v.into();
4509 self
4510 }
4511
4512 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4514 mut self,
4515 v: T,
4516 ) -> Self {
4517 self.update_time = v.into();
4518 self
4519 }
4520
4521 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4523 where
4524 T: std::iter::IntoIterator<Item = (K, V)>,
4525 K: std::convert::Into<std::string::String>,
4526 V: std::convert::Into<std::string::String>,
4527 {
4528 use std::iter::Iterator;
4529 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4530 self
4531 }
4532
4533 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4535 self.description = v.into();
4536 self
4537 }
4538
4539 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4541 self.uid = v.into();
4542 self
4543 }
4544
4545 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
4547 self.state = v.into();
4548 self
4549 }
4550}
4551
4552impl wkt::message::Message for RouteTable {
4553 fn typename() -> &'static str {
4554 "type.googleapis.com/google.cloud.networkconnectivity.v1.RouteTable"
4555 }
4556}
4557
4558#[serde_with::serde_as]
4561#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4562#[serde(default, rename_all = "camelCase")]
4563#[non_exhaustive]
4564pub struct Route {
4565 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4569 pub name: std::string::String,
4570
4571 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4573 pub create_time: std::option::Option<wkt::Timestamp>,
4574
4575 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4577 pub update_time: std::option::Option<wkt::Timestamp>,
4578
4579 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4581 pub ip_cidr_range: std::string::String,
4582
4583 #[serde(rename = "type")]
4586 pub r#type: crate::model::RouteType,
4587
4588 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4590 pub next_hop_vpc_network: std::option::Option<crate::model::NextHopVpcNetwork>,
4591
4592 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4596 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4597
4598 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4600 pub description: std::string::String,
4601
4602 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4607 pub uid: std::string::String,
4608
4609 pub state: crate::model::State,
4611
4612 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4615 pub spoke: std::string::String,
4616
4617 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4621 pub location: std::string::String,
4622
4623 #[serde(skip_serializing_if = "wkt::internal::is_default")]
4627 #[serde_as(as = "serde_with::DisplayFromStr")]
4628 pub priority: i64,
4629
4630 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4632 pub next_hop_vpn_tunnel: std::option::Option<crate::model::NextHopVPNTunnel>,
4633
4634 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4637 pub next_hop_router_appliance_instance:
4638 std::option::Option<crate::model::NextHopRouterApplianceInstance>,
4639
4640 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4642 pub next_hop_interconnect_attachment:
4643 std::option::Option<crate::model::NextHopInterconnectAttachment>,
4644
4645 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4646 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4647}
4648
4649impl Route {
4650 pub fn new() -> Self {
4651 std::default::Default::default()
4652 }
4653
4654 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4656 self.name = v.into();
4657 self
4658 }
4659
4660 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4662 mut self,
4663 v: T,
4664 ) -> Self {
4665 self.create_time = v.into();
4666 self
4667 }
4668
4669 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4671 mut self,
4672 v: T,
4673 ) -> Self {
4674 self.update_time = v.into();
4675 self
4676 }
4677
4678 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4680 self.ip_cidr_range = v.into();
4681 self
4682 }
4683
4684 pub fn set_type<T: std::convert::Into<crate::model::RouteType>>(mut self, v: T) -> Self {
4686 self.r#type = v.into();
4687 self
4688 }
4689
4690 pub fn set_next_hop_vpc_network<
4692 T: std::convert::Into<std::option::Option<crate::model::NextHopVpcNetwork>>,
4693 >(
4694 mut self,
4695 v: T,
4696 ) -> Self {
4697 self.next_hop_vpc_network = v.into();
4698 self
4699 }
4700
4701 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4703 where
4704 T: std::iter::IntoIterator<Item = (K, V)>,
4705 K: std::convert::Into<std::string::String>,
4706 V: std::convert::Into<std::string::String>,
4707 {
4708 use std::iter::Iterator;
4709 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4710 self
4711 }
4712
4713 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4715 self.description = v.into();
4716 self
4717 }
4718
4719 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4721 self.uid = v.into();
4722 self
4723 }
4724
4725 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
4727 self.state = v.into();
4728 self
4729 }
4730
4731 pub fn set_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4733 self.spoke = v.into();
4734 self
4735 }
4736
4737 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4739 self.location = v.into();
4740 self
4741 }
4742
4743 pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4745 self.priority = v.into();
4746 self
4747 }
4748
4749 pub fn set_next_hop_vpn_tunnel<
4751 T: std::convert::Into<std::option::Option<crate::model::NextHopVPNTunnel>>,
4752 >(
4753 mut self,
4754 v: T,
4755 ) -> Self {
4756 self.next_hop_vpn_tunnel = v.into();
4757 self
4758 }
4759
4760 pub fn set_next_hop_router_appliance_instance<
4762 T: std::convert::Into<std::option::Option<crate::model::NextHopRouterApplianceInstance>>,
4763 >(
4764 mut self,
4765 v: T,
4766 ) -> Self {
4767 self.next_hop_router_appliance_instance = v.into();
4768 self
4769 }
4770
4771 pub fn set_next_hop_interconnect_attachment<
4773 T: std::convert::Into<std::option::Option<crate::model::NextHopInterconnectAttachment>>,
4774 >(
4775 mut self,
4776 v: T,
4777 ) -> Self {
4778 self.next_hop_interconnect_attachment = v.into();
4779 self
4780 }
4781}
4782
4783impl wkt::message::Message for Route {
4784 fn typename() -> &'static str {
4785 "type.googleapis.com/google.cloud.networkconnectivity.v1.Route"
4786 }
4787}
4788
4789#[serde_with::serde_as]
4791#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4792#[serde(default, rename_all = "camelCase")]
4793#[non_exhaustive]
4794pub struct Group {
4795 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4799 pub name: std::string::String,
4800
4801 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4803 pub create_time: std::option::Option<wkt::Timestamp>,
4804
4805 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4807 pub update_time: std::option::Option<wkt::Timestamp>,
4808
4809 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4813 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4814
4815 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4817 pub description: std::string::String,
4818
4819 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4824 pub uid: std::string::String,
4825
4826 pub state: crate::model::State,
4828
4829 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4831 pub auto_accept: std::option::Option<crate::model::AutoAccept>,
4832
4833 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4837 pub route_table: std::string::String,
4838
4839 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4840 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4841}
4842
4843impl Group {
4844 pub fn new() -> Self {
4845 std::default::Default::default()
4846 }
4847
4848 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4850 self.name = v.into();
4851 self
4852 }
4853
4854 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4856 mut self,
4857 v: T,
4858 ) -> Self {
4859 self.create_time = v.into();
4860 self
4861 }
4862
4863 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4865 mut self,
4866 v: T,
4867 ) -> Self {
4868 self.update_time = v.into();
4869 self
4870 }
4871
4872 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4874 where
4875 T: std::iter::IntoIterator<Item = (K, V)>,
4876 K: std::convert::Into<std::string::String>,
4877 V: std::convert::Into<std::string::String>,
4878 {
4879 use std::iter::Iterator;
4880 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4881 self
4882 }
4883
4884 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4886 self.description = v.into();
4887 self
4888 }
4889
4890 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4892 self.uid = v.into();
4893 self
4894 }
4895
4896 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
4898 self.state = v.into();
4899 self
4900 }
4901
4902 pub fn set_auto_accept<T: std::convert::Into<std::option::Option<crate::model::AutoAccept>>>(
4904 mut self,
4905 v: T,
4906 ) -> Self {
4907 self.auto_accept = v.into();
4908 self
4909 }
4910
4911 pub fn set_route_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4913 self.route_table = v.into();
4914 self
4915 }
4916}
4917
4918impl wkt::message::Message for Group {
4919 fn typename() -> &'static str {
4920 "type.googleapis.com/google.cloud.networkconnectivity.v1.Group"
4921 }
4922}
4923
4924#[serde_with::serde_as]
4932#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4933#[serde(default, rename_all = "camelCase")]
4934#[non_exhaustive]
4935pub struct AutoAccept {
4936 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4940 pub auto_accept_projects: std::vec::Vec<std::string::String>,
4941
4942 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4943 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4944}
4945
4946impl AutoAccept {
4947 pub fn new() -> Self {
4948 std::default::Default::default()
4949 }
4950
4951 pub fn set_auto_accept_projects<T, V>(mut self, v: T) -> Self
4953 where
4954 T: std::iter::IntoIterator<Item = V>,
4955 V: std::convert::Into<std::string::String>,
4956 {
4957 use std::iter::Iterator;
4958 self.auto_accept_projects = v.into_iter().map(|i| i.into()).collect();
4959 self
4960 }
4961}
4962
4963impl wkt::message::Message for AutoAccept {
4964 fn typename() -> &'static str {
4965 "type.googleapis.com/google.cloud.networkconnectivity.v1.AutoAccept"
4966 }
4967}
4968
4969#[serde_with::serde_as]
4975#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4976#[serde(default, rename_all = "camelCase")]
4977#[non_exhaustive]
4978pub struct ListHubsRequest {
4979 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4981 pub parent: std::string::String,
4982
4983 #[serde(skip_serializing_if = "wkt::internal::is_default")]
4985 pub page_size: i32,
4986
4987 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4989 pub page_token: std::string::String,
4990
4991 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4993 pub filter: std::string::String,
4994
4995 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4997 pub order_by: std::string::String,
4998
4999 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5000 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5001}
5002
5003impl ListHubsRequest {
5004 pub fn new() -> Self {
5005 std::default::Default::default()
5006 }
5007
5008 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5010 self.parent = v.into();
5011 self
5012 }
5013
5014 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5016 self.page_size = v.into();
5017 self
5018 }
5019
5020 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5022 self.page_token = v.into();
5023 self
5024 }
5025
5026 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5028 self.filter = v.into();
5029 self
5030 }
5031
5032 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5034 self.order_by = v.into();
5035 self
5036 }
5037}
5038
5039impl wkt::message::Message for ListHubsRequest {
5040 fn typename() -> &'static str {
5041 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsRequest"
5042 }
5043}
5044
5045#[serde_with::serde_as]
5051#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5052#[serde(default, rename_all = "camelCase")]
5053#[non_exhaustive]
5054pub struct ListHubsResponse {
5055 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5057 pub hubs: std::vec::Vec<crate::model::Hub>,
5058
5059 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5063 pub next_page_token: std::string::String,
5064
5065 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5067 pub unreachable: std::vec::Vec<std::string::String>,
5068
5069 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5070 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5071}
5072
5073impl ListHubsResponse {
5074 pub fn new() -> Self {
5075 std::default::Default::default()
5076 }
5077
5078 pub fn set_hubs<T, V>(mut self, v: T) -> Self
5080 where
5081 T: std::iter::IntoIterator<Item = V>,
5082 V: std::convert::Into<crate::model::Hub>,
5083 {
5084 use std::iter::Iterator;
5085 self.hubs = v.into_iter().map(|i| i.into()).collect();
5086 self
5087 }
5088
5089 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5091 self.next_page_token = v.into();
5092 self
5093 }
5094
5095 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5097 where
5098 T: std::iter::IntoIterator<Item = V>,
5099 V: std::convert::Into<std::string::String>,
5100 {
5101 use std::iter::Iterator;
5102 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5103 self
5104 }
5105}
5106
5107impl wkt::message::Message for ListHubsResponse {
5108 fn typename() -> &'static str {
5109 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsResponse"
5110 }
5111}
5112
5113#[doc(hidden)]
5114impl gax::paginator::internal::PageableResponse for ListHubsResponse {
5115 type PageItem = crate::model::Hub;
5116
5117 fn items(self) -> std::vec::Vec<Self::PageItem> {
5118 self.hubs
5119 }
5120
5121 fn next_page_token(&self) -> std::string::String {
5122 use std::clone::Clone;
5123 self.next_page_token.clone()
5124 }
5125}
5126
5127#[serde_with::serde_as]
5133#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5134#[serde(default, rename_all = "camelCase")]
5135#[non_exhaustive]
5136pub struct GetHubRequest {
5137 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5139 pub name: std::string::String,
5140
5141 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5142 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5143}
5144
5145impl GetHubRequest {
5146 pub fn new() -> Self {
5147 std::default::Default::default()
5148 }
5149
5150 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5152 self.name = v.into();
5153 self
5154 }
5155}
5156
5157impl wkt::message::Message for GetHubRequest {
5158 fn typename() -> &'static str {
5159 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetHubRequest"
5160 }
5161}
5162
5163#[serde_with::serde_as]
5169#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5170#[serde(default, rename_all = "camelCase")]
5171#[non_exhaustive]
5172pub struct CreateHubRequest {
5173 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5175 pub parent: std::string::String,
5176
5177 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5179 pub hub_id: std::string::String,
5180
5181 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5183 pub hub: std::option::Option<crate::model::Hub>,
5184
5185 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5200 pub request_id: std::string::String,
5201
5202 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5203 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5204}
5205
5206impl CreateHubRequest {
5207 pub fn new() -> Self {
5208 std::default::Default::default()
5209 }
5210
5211 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5213 self.parent = v.into();
5214 self
5215 }
5216
5217 pub fn set_hub_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5219 self.hub_id = v.into();
5220 self
5221 }
5222
5223 pub fn set_hub<T: std::convert::Into<std::option::Option<crate::model::Hub>>>(
5225 mut self,
5226 v: T,
5227 ) -> Self {
5228 self.hub = v.into();
5229 self
5230 }
5231
5232 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5234 self.request_id = v.into();
5235 self
5236 }
5237}
5238
5239impl wkt::message::Message for CreateHubRequest {
5240 fn typename() -> &'static str {
5241 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateHubRequest"
5242 }
5243}
5244
5245#[serde_with::serde_as]
5251#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5252#[serde(default, rename_all = "camelCase")]
5253#[non_exhaustive]
5254pub struct UpdateHubRequest {
5255 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5261 pub update_mask: std::option::Option<wkt::FieldMask>,
5262
5263 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5265 pub hub: std::option::Option<crate::model::Hub>,
5266
5267 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5282 pub request_id: std::string::String,
5283
5284 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5285 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5286}
5287
5288impl UpdateHubRequest {
5289 pub fn new() -> Self {
5290 std::default::Default::default()
5291 }
5292
5293 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
5295 mut self,
5296 v: T,
5297 ) -> Self {
5298 self.update_mask = v.into();
5299 self
5300 }
5301
5302 pub fn set_hub<T: std::convert::Into<std::option::Option<crate::model::Hub>>>(
5304 mut self,
5305 v: T,
5306 ) -> Self {
5307 self.hub = v.into();
5308 self
5309 }
5310
5311 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5313 self.request_id = v.into();
5314 self
5315 }
5316}
5317
5318impl wkt::message::Message for UpdateHubRequest {
5319 fn typename() -> &'static str {
5320 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateHubRequest"
5321 }
5322}
5323
5324#[serde_with::serde_as]
5329#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5330#[serde(default, rename_all = "camelCase")]
5331#[non_exhaustive]
5332pub struct DeleteHubRequest {
5333 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5335 pub name: std::string::String,
5336
5337 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5352 pub request_id: std::string::String,
5353
5354 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5355 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5356}
5357
5358impl DeleteHubRequest {
5359 pub fn new() -> Self {
5360 std::default::Default::default()
5361 }
5362
5363 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5365 self.name = v.into();
5366 self
5367 }
5368
5369 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5371 self.request_id = v.into();
5372 self
5373 }
5374}
5375
5376impl wkt::message::Message for DeleteHubRequest {
5377 fn typename() -> &'static str {
5378 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteHubRequest"
5379 }
5380}
5381
5382#[serde_with::serde_as]
5387#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5388#[serde(default, rename_all = "camelCase")]
5389#[non_exhaustive]
5390pub struct ListHubSpokesRequest {
5391 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5393 pub name: std::string::String,
5394
5395 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5404 pub spoke_locations: std::vec::Vec<std::string::String>,
5405
5406 #[serde(skip_serializing_if = "wkt::internal::is_default")]
5408 pub page_size: i32,
5409
5410 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5412 pub page_token: std::string::String,
5413
5414 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5416 pub filter: std::string::String,
5417
5418 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5420 pub order_by: std::string::String,
5421
5422 pub view: crate::model::list_hub_spokes_request::SpokeView,
5426
5427 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5428 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5429}
5430
5431impl ListHubSpokesRequest {
5432 pub fn new() -> Self {
5433 std::default::Default::default()
5434 }
5435
5436 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5438 self.name = v.into();
5439 self
5440 }
5441
5442 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
5444 where
5445 T: std::iter::IntoIterator<Item = V>,
5446 V: std::convert::Into<std::string::String>,
5447 {
5448 use std::iter::Iterator;
5449 self.spoke_locations = v.into_iter().map(|i| i.into()).collect();
5450 self
5451 }
5452
5453 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5455 self.page_size = v.into();
5456 self
5457 }
5458
5459 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5461 self.page_token = v.into();
5462 self
5463 }
5464
5465 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5467 self.filter = v.into();
5468 self
5469 }
5470
5471 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5473 self.order_by = v.into();
5474 self
5475 }
5476
5477 pub fn set_view<T: std::convert::Into<crate::model::list_hub_spokes_request::SpokeView>>(
5479 mut self,
5480 v: T,
5481 ) -> Self {
5482 self.view = v.into();
5483 self
5484 }
5485}
5486
5487impl wkt::message::Message for ListHubSpokesRequest {
5488 fn typename() -> &'static str {
5489 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesRequest"
5490 }
5491}
5492
5493pub mod list_hub_spokes_request {
5495 #[allow(unused_imports)]
5496 use super::*;
5497
5498 #[derive(Clone, Debug, PartialEq)]
5514 #[non_exhaustive]
5515 pub enum SpokeView {
5516 Unspecified,
5519 Basic,
5522 Detailed,
5526 UnknownValue(spoke_view::UnknownValue),
5531 }
5532
5533 #[doc(hidden)]
5534 pub mod spoke_view {
5535 #[allow(unused_imports)]
5536 use super::*;
5537 #[derive(Clone, Debug, PartialEq)]
5538 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5539 }
5540
5541 impl SpokeView {
5542 pub fn value(&self) -> std::option::Option<i32> {
5547 match self {
5548 Self::Unspecified => std::option::Option::Some(0),
5549 Self::Basic => std::option::Option::Some(1),
5550 Self::Detailed => std::option::Option::Some(2),
5551 Self::UnknownValue(u) => u.0.value(),
5552 }
5553 }
5554
5555 pub fn name(&self) -> std::option::Option<&str> {
5560 match self {
5561 Self::Unspecified => std::option::Option::Some("SPOKE_VIEW_UNSPECIFIED"),
5562 Self::Basic => std::option::Option::Some("BASIC"),
5563 Self::Detailed => std::option::Option::Some("DETAILED"),
5564 Self::UnknownValue(u) => u.0.name(),
5565 }
5566 }
5567 }
5568
5569 impl std::default::Default for SpokeView {
5570 fn default() -> Self {
5571 use std::convert::From;
5572 Self::from(0)
5573 }
5574 }
5575
5576 impl std::fmt::Display for SpokeView {
5577 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5578 wkt::internal::display_enum(f, self.name(), self.value())
5579 }
5580 }
5581
5582 impl std::convert::From<i32> for SpokeView {
5583 fn from(value: i32) -> Self {
5584 match value {
5585 0 => Self::Unspecified,
5586 1 => Self::Basic,
5587 2 => Self::Detailed,
5588 _ => Self::UnknownValue(spoke_view::UnknownValue(
5589 wkt::internal::UnknownEnumValue::Integer(value),
5590 )),
5591 }
5592 }
5593 }
5594
5595 impl std::convert::From<&str> for SpokeView {
5596 fn from(value: &str) -> Self {
5597 use std::string::ToString;
5598 match value {
5599 "SPOKE_VIEW_UNSPECIFIED" => Self::Unspecified,
5600 "BASIC" => Self::Basic,
5601 "DETAILED" => Self::Detailed,
5602 _ => Self::UnknownValue(spoke_view::UnknownValue(
5603 wkt::internal::UnknownEnumValue::String(value.to_string()),
5604 )),
5605 }
5606 }
5607 }
5608
5609 impl serde::ser::Serialize for SpokeView {
5610 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5611 where
5612 S: serde::Serializer,
5613 {
5614 match self {
5615 Self::Unspecified => serializer.serialize_i32(0),
5616 Self::Basic => serializer.serialize_i32(1),
5617 Self::Detailed => serializer.serialize_i32(2),
5618 Self::UnknownValue(u) => u.0.serialize(serializer),
5619 }
5620 }
5621 }
5622
5623 impl<'de> serde::de::Deserialize<'de> for SpokeView {
5624 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5625 where
5626 D: serde::Deserializer<'de>,
5627 {
5628 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeView>::new(
5629 ".google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView",
5630 ))
5631 }
5632 }
5633}
5634
5635#[serde_with::serde_as]
5640#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5641#[serde(default, rename_all = "camelCase")]
5642#[non_exhaustive]
5643pub struct ListHubSpokesResponse {
5644 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5648 pub spokes: std::vec::Vec<crate::model::Spoke>,
5649
5650 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5654 pub next_page_token: std::string::String,
5655
5656 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5658 pub unreachable: std::vec::Vec<std::string::String>,
5659
5660 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5661 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5662}
5663
5664impl ListHubSpokesResponse {
5665 pub fn new() -> Self {
5666 std::default::Default::default()
5667 }
5668
5669 pub fn set_spokes<T, V>(mut self, v: T) -> Self
5671 where
5672 T: std::iter::IntoIterator<Item = V>,
5673 V: std::convert::Into<crate::model::Spoke>,
5674 {
5675 use std::iter::Iterator;
5676 self.spokes = v.into_iter().map(|i| i.into()).collect();
5677 self
5678 }
5679
5680 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5682 self.next_page_token = v.into();
5683 self
5684 }
5685
5686 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5688 where
5689 T: std::iter::IntoIterator<Item = V>,
5690 V: std::convert::Into<std::string::String>,
5691 {
5692 use std::iter::Iterator;
5693 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5694 self
5695 }
5696}
5697
5698impl wkt::message::Message for ListHubSpokesResponse {
5699 fn typename() -> &'static str {
5700 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesResponse"
5701 }
5702}
5703
5704#[doc(hidden)]
5705impl gax::paginator::internal::PageableResponse for ListHubSpokesResponse {
5706 type PageItem = crate::model::Spoke;
5707
5708 fn items(self) -> std::vec::Vec<Self::PageItem> {
5709 self.spokes
5710 }
5711
5712 fn next_page_token(&self) -> std::string::String {
5713 use std::clone::Clone;
5714 self.next_page_token.clone()
5715 }
5716}
5717
5718#[serde_with::serde_as]
5723#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5724#[serde(default, rename_all = "camelCase")]
5725#[non_exhaustive]
5726pub struct QueryHubStatusRequest {
5727 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5729 pub name: std::string::String,
5730
5731 #[serde(skip_serializing_if = "wkt::internal::is_default")]
5733 pub page_size: i32,
5734
5735 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5737 pub page_token: std::string::String,
5738
5739 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5750 pub filter: std::string::String,
5751
5752 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5764 pub order_by: std::string::String,
5765
5766 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5776 pub group_by: std::string::String,
5777
5778 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5779 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5780}
5781
5782impl QueryHubStatusRequest {
5783 pub fn new() -> Self {
5784 std::default::Default::default()
5785 }
5786
5787 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5789 self.name = v.into();
5790 self
5791 }
5792
5793 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5795 self.page_size = v.into();
5796 self
5797 }
5798
5799 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5801 self.page_token = v.into();
5802 self
5803 }
5804
5805 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5807 self.filter = v.into();
5808 self
5809 }
5810
5811 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5813 self.order_by = v.into();
5814 self
5815 }
5816
5817 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5819 self.group_by = v.into();
5820 self
5821 }
5822}
5823
5824impl wkt::message::Message for QueryHubStatusRequest {
5825 fn typename() -> &'static str {
5826 "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusRequest"
5827 }
5828}
5829
5830#[serde_with::serde_as]
5835#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5836#[serde(default, rename_all = "camelCase")]
5837#[non_exhaustive]
5838pub struct QueryHubStatusResponse {
5839 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5841 pub hub_status_entries: std::vec::Vec<crate::model::HubStatusEntry>,
5842
5843 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5847 pub next_page_token: std::string::String,
5848
5849 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5850 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5851}
5852
5853impl QueryHubStatusResponse {
5854 pub fn new() -> Self {
5855 std::default::Default::default()
5856 }
5857
5858 pub fn set_hub_status_entries<T, V>(mut self, v: T) -> Self
5860 where
5861 T: std::iter::IntoIterator<Item = V>,
5862 V: std::convert::Into<crate::model::HubStatusEntry>,
5863 {
5864 use std::iter::Iterator;
5865 self.hub_status_entries = v.into_iter().map(|i| i.into()).collect();
5866 self
5867 }
5868
5869 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5871 self.next_page_token = v.into();
5872 self
5873 }
5874}
5875
5876impl wkt::message::Message for QueryHubStatusResponse {
5877 fn typename() -> &'static str {
5878 "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusResponse"
5879 }
5880}
5881
5882#[doc(hidden)]
5883impl gax::paginator::internal::PageableResponse for QueryHubStatusResponse {
5884 type PageItem = crate::model::HubStatusEntry;
5885
5886 fn items(self) -> std::vec::Vec<Self::PageItem> {
5887 self.hub_status_entries
5888 }
5889
5890 fn next_page_token(&self) -> std::string::String {
5891 use std::clone::Clone;
5892 self.next_page_token.clone()
5893 }
5894}
5895
5896#[serde_with::serde_as]
5899#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5900#[serde(default, rename_all = "camelCase")]
5901#[non_exhaustive]
5902pub struct HubStatusEntry {
5903 #[serde(skip_serializing_if = "wkt::internal::is_default")]
5907 pub count: i32,
5908
5909 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5912 pub group_by: std::string::String,
5913
5914 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5916 pub psc_propagation_status: std::option::Option<crate::model::PscPropagationStatus>,
5917
5918 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5919 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5920}
5921
5922impl HubStatusEntry {
5923 pub fn new() -> Self {
5924 std::default::Default::default()
5925 }
5926
5927 pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5929 self.count = v.into();
5930 self
5931 }
5932
5933 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5935 self.group_by = v.into();
5936 self
5937 }
5938
5939 pub fn set_psc_propagation_status<
5941 T: std::convert::Into<std::option::Option<crate::model::PscPropagationStatus>>,
5942 >(
5943 mut self,
5944 v: T,
5945 ) -> Self {
5946 self.psc_propagation_status = v.into();
5947 self
5948 }
5949}
5950
5951impl wkt::message::Message for HubStatusEntry {
5952 fn typename() -> &'static str {
5953 "type.googleapis.com/google.cloud.networkconnectivity.v1.HubStatusEntry"
5954 }
5955}
5956
5957#[serde_with::serde_as]
5960#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5961#[serde(default, rename_all = "camelCase")]
5962#[non_exhaustive]
5963pub struct PscPropagationStatus {
5964 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5966 pub source_spoke: std::string::String,
5967
5968 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5970 pub source_group: std::string::String,
5971
5972 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5974 pub source_forwarding_rule: std::string::String,
5975
5976 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5978 pub target_spoke: std::string::String,
5979
5980 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5982 pub target_group: std::string::String,
5983
5984 pub code: crate::model::psc_propagation_status::Code,
5986
5987 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5990 pub message: std::string::String,
5991
5992 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5993 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5994}
5995
5996impl PscPropagationStatus {
5997 pub fn new() -> Self {
5998 std::default::Default::default()
5999 }
6000
6001 pub fn set_source_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6003 self.source_spoke = v.into();
6004 self
6005 }
6006
6007 pub fn set_source_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6009 self.source_group = v.into();
6010 self
6011 }
6012
6013 pub fn set_source_forwarding_rule<T: std::convert::Into<std::string::String>>(
6015 mut self,
6016 v: T,
6017 ) -> Self {
6018 self.source_forwarding_rule = v.into();
6019 self
6020 }
6021
6022 pub fn set_target_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6024 self.target_spoke = v.into();
6025 self
6026 }
6027
6028 pub fn set_target_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6030 self.target_group = v.into();
6031 self
6032 }
6033
6034 pub fn set_code<T: std::convert::Into<crate::model::psc_propagation_status::Code>>(
6036 mut self,
6037 v: T,
6038 ) -> Self {
6039 self.code = v.into();
6040 self
6041 }
6042
6043 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6045 self.message = v.into();
6046 self
6047 }
6048}
6049
6050impl wkt::message::Message for PscPropagationStatus {
6051 fn typename() -> &'static str {
6052 "type.googleapis.com/google.cloud.networkconnectivity.v1.PscPropagationStatus"
6053 }
6054}
6055
6056pub mod psc_propagation_status {
6058 #[allow(unused_imports)]
6059 use super::*;
6060
6061 #[derive(Clone, Debug, PartialEq)]
6078 #[non_exhaustive]
6079 pub enum Code {
6080 Unspecified,
6082 Ready,
6084 Propagating,
6087 ErrorProducerPropagatedConnectionLimitExceeded,
6091 ErrorProducerNatIpSpaceExhausted,
6096 ErrorProducerQuotaExceeded,
6100 ErrorConsumerQuotaExceeded,
6104 UnknownValue(code::UnknownValue),
6109 }
6110
6111 #[doc(hidden)]
6112 pub mod code {
6113 #[allow(unused_imports)]
6114 use super::*;
6115 #[derive(Clone, Debug, PartialEq)]
6116 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6117 }
6118
6119 impl Code {
6120 pub fn value(&self) -> std::option::Option<i32> {
6125 match self {
6126 Self::Unspecified => std::option::Option::Some(0),
6127 Self::Ready => std::option::Option::Some(1),
6128 Self::Propagating => std::option::Option::Some(2),
6129 Self::ErrorProducerPropagatedConnectionLimitExceeded => {
6130 std::option::Option::Some(3)
6131 }
6132 Self::ErrorProducerNatIpSpaceExhausted => std::option::Option::Some(4),
6133 Self::ErrorProducerQuotaExceeded => std::option::Option::Some(5),
6134 Self::ErrorConsumerQuotaExceeded => std::option::Option::Some(6),
6135 Self::UnknownValue(u) => u.0.value(),
6136 }
6137 }
6138
6139 pub fn name(&self) -> std::option::Option<&str> {
6144 match self {
6145 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
6146 Self::Ready => std::option::Option::Some("READY"),
6147 Self::Propagating => std::option::Option::Some("PROPAGATING"),
6148 Self::ErrorProducerPropagatedConnectionLimitExceeded => {
6149 std::option::Option::Some("ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED")
6150 }
6151 Self::ErrorProducerNatIpSpaceExhausted => {
6152 std::option::Option::Some("ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED")
6153 }
6154 Self::ErrorProducerQuotaExceeded => {
6155 std::option::Option::Some("ERROR_PRODUCER_QUOTA_EXCEEDED")
6156 }
6157 Self::ErrorConsumerQuotaExceeded => {
6158 std::option::Option::Some("ERROR_CONSUMER_QUOTA_EXCEEDED")
6159 }
6160 Self::UnknownValue(u) => u.0.name(),
6161 }
6162 }
6163 }
6164
6165 impl std::default::Default for Code {
6166 fn default() -> Self {
6167 use std::convert::From;
6168 Self::from(0)
6169 }
6170 }
6171
6172 impl std::fmt::Display for Code {
6173 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6174 wkt::internal::display_enum(f, self.name(), self.value())
6175 }
6176 }
6177
6178 impl std::convert::From<i32> for Code {
6179 fn from(value: i32) -> Self {
6180 match value {
6181 0 => Self::Unspecified,
6182 1 => Self::Ready,
6183 2 => Self::Propagating,
6184 3 => Self::ErrorProducerPropagatedConnectionLimitExceeded,
6185 4 => Self::ErrorProducerNatIpSpaceExhausted,
6186 5 => Self::ErrorProducerQuotaExceeded,
6187 6 => Self::ErrorConsumerQuotaExceeded,
6188 _ => Self::UnknownValue(code::UnknownValue(
6189 wkt::internal::UnknownEnumValue::Integer(value),
6190 )),
6191 }
6192 }
6193 }
6194
6195 impl std::convert::From<&str> for Code {
6196 fn from(value: &str) -> Self {
6197 use std::string::ToString;
6198 match value {
6199 "CODE_UNSPECIFIED" => Self::Unspecified,
6200 "READY" => Self::Ready,
6201 "PROPAGATING" => Self::Propagating,
6202 "ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED" => {
6203 Self::ErrorProducerPropagatedConnectionLimitExceeded
6204 }
6205 "ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED" => Self::ErrorProducerNatIpSpaceExhausted,
6206 "ERROR_PRODUCER_QUOTA_EXCEEDED" => Self::ErrorProducerQuotaExceeded,
6207 "ERROR_CONSUMER_QUOTA_EXCEEDED" => Self::ErrorConsumerQuotaExceeded,
6208 _ => Self::UnknownValue(code::UnknownValue(
6209 wkt::internal::UnknownEnumValue::String(value.to_string()),
6210 )),
6211 }
6212 }
6213 }
6214
6215 impl serde::ser::Serialize for Code {
6216 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6217 where
6218 S: serde::Serializer,
6219 {
6220 match self {
6221 Self::Unspecified => serializer.serialize_i32(0),
6222 Self::Ready => serializer.serialize_i32(1),
6223 Self::Propagating => serializer.serialize_i32(2),
6224 Self::ErrorProducerPropagatedConnectionLimitExceeded => serializer.serialize_i32(3),
6225 Self::ErrorProducerNatIpSpaceExhausted => serializer.serialize_i32(4),
6226 Self::ErrorProducerQuotaExceeded => serializer.serialize_i32(5),
6227 Self::ErrorConsumerQuotaExceeded => serializer.serialize_i32(6),
6228 Self::UnknownValue(u) => u.0.serialize(serializer),
6229 }
6230 }
6231 }
6232
6233 impl<'de> serde::de::Deserialize<'de> for Code {
6234 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6235 where
6236 D: serde::Deserializer<'de>,
6237 {
6238 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
6239 ".google.cloud.networkconnectivity.v1.PscPropagationStatus.Code",
6240 ))
6241 }
6242 }
6243}
6244
6245#[serde_with::serde_as]
6250#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6251#[serde(default, rename_all = "camelCase")]
6252#[non_exhaustive]
6253pub struct ListSpokesRequest {
6254 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6256 pub parent: std::string::String,
6257
6258 #[serde(skip_serializing_if = "wkt::internal::is_default")]
6260 pub page_size: i32,
6261
6262 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6264 pub page_token: std::string::String,
6265
6266 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6268 pub filter: std::string::String,
6269
6270 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6272 pub order_by: std::string::String,
6273
6274 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6275 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6276}
6277
6278impl ListSpokesRequest {
6279 pub fn new() -> Self {
6280 std::default::Default::default()
6281 }
6282
6283 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6285 self.parent = v.into();
6286 self
6287 }
6288
6289 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6291 self.page_size = v.into();
6292 self
6293 }
6294
6295 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6297 self.page_token = v.into();
6298 self
6299 }
6300
6301 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6303 self.filter = v.into();
6304 self
6305 }
6306
6307 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6309 self.order_by = v.into();
6310 self
6311 }
6312}
6313
6314impl wkt::message::Message for ListSpokesRequest {
6315 fn typename() -> &'static str {
6316 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesRequest"
6317 }
6318}
6319
6320#[serde_with::serde_as]
6325#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6326#[serde(default, rename_all = "camelCase")]
6327#[non_exhaustive]
6328pub struct ListSpokesResponse {
6329 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6331 pub spokes: std::vec::Vec<crate::model::Spoke>,
6332
6333 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6337 pub next_page_token: std::string::String,
6338
6339 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6341 pub unreachable: std::vec::Vec<std::string::String>,
6342
6343 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6344 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6345}
6346
6347impl ListSpokesResponse {
6348 pub fn new() -> Self {
6349 std::default::Default::default()
6350 }
6351
6352 pub fn set_spokes<T, V>(mut self, v: T) -> Self
6354 where
6355 T: std::iter::IntoIterator<Item = V>,
6356 V: std::convert::Into<crate::model::Spoke>,
6357 {
6358 use std::iter::Iterator;
6359 self.spokes = v.into_iter().map(|i| i.into()).collect();
6360 self
6361 }
6362
6363 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6365 self.next_page_token = v.into();
6366 self
6367 }
6368
6369 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6371 where
6372 T: std::iter::IntoIterator<Item = V>,
6373 V: std::convert::Into<std::string::String>,
6374 {
6375 use std::iter::Iterator;
6376 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6377 self
6378 }
6379}
6380
6381impl wkt::message::Message for ListSpokesResponse {
6382 fn typename() -> &'static str {
6383 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesResponse"
6384 }
6385}
6386
6387#[doc(hidden)]
6388impl gax::paginator::internal::PageableResponse for ListSpokesResponse {
6389 type PageItem = crate::model::Spoke;
6390
6391 fn items(self) -> std::vec::Vec<Self::PageItem> {
6392 self.spokes
6393 }
6394
6395 fn next_page_token(&self) -> std::string::String {
6396 use std::clone::Clone;
6397 self.next_page_token.clone()
6398 }
6399}
6400
6401#[serde_with::serde_as]
6406#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6407#[serde(default, rename_all = "camelCase")]
6408#[non_exhaustive]
6409pub struct GetSpokeRequest {
6410 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6412 pub name: std::string::String,
6413
6414 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6415 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6416}
6417
6418impl GetSpokeRequest {
6419 pub fn new() -> Self {
6420 std::default::Default::default()
6421 }
6422
6423 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6425 self.name = v.into();
6426 self
6427 }
6428}
6429
6430impl wkt::message::Message for GetSpokeRequest {
6431 fn typename() -> &'static str {
6432 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetSpokeRequest"
6433 }
6434}
6435
6436#[serde_with::serde_as]
6441#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6442#[serde(default, rename_all = "camelCase")]
6443#[non_exhaustive]
6444pub struct CreateSpokeRequest {
6445 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6447 pub parent: std::string::String,
6448
6449 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6451 pub spoke_id: std::string::String,
6452
6453 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6455 pub spoke: std::option::Option<crate::model::Spoke>,
6456
6457 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6472 pub request_id: std::string::String,
6473
6474 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6475 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6476}
6477
6478impl CreateSpokeRequest {
6479 pub fn new() -> Self {
6480 std::default::Default::default()
6481 }
6482
6483 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6485 self.parent = v.into();
6486 self
6487 }
6488
6489 pub fn set_spoke_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6491 self.spoke_id = v.into();
6492 self
6493 }
6494
6495 pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6497 mut self,
6498 v: T,
6499 ) -> Self {
6500 self.spoke = v.into();
6501 self
6502 }
6503
6504 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6506 self.request_id = v.into();
6507 self
6508 }
6509}
6510
6511impl wkt::message::Message for CreateSpokeRequest {
6512 fn typename() -> &'static str {
6513 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateSpokeRequest"
6514 }
6515}
6516
6517#[serde_with::serde_as]
6523#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6524#[serde(default, rename_all = "camelCase")]
6525#[non_exhaustive]
6526pub struct UpdateSpokeRequest {
6527 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6533 pub update_mask: std::option::Option<wkt::FieldMask>,
6534
6535 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6537 pub spoke: std::option::Option<crate::model::Spoke>,
6538
6539 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6554 pub request_id: std::string::String,
6555
6556 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6557 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6558}
6559
6560impl UpdateSpokeRequest {
6561 pub fn new() -> Self {
6562 std::default::Default::default()
6563 }
6564
6565 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
6567 mut self,
6568 v: T,
6569 ) -> Self {
6570 self.update_mask = v.into();
6571 self
6572 }
6573
6574 pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6576 mut self,
6577 v: T,
6578 ) -> Self {
6579 self.spoke = v.into();
6580 self
6581 }
6582
6583 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6585 self.request_id = v.into();
6586 self
6587 }
6588}
6589
6590impl wkt::message::Message for UpdateSpokeRequest {
6591 fn typename() -> &'static str {
6592 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"
6593 }
6594}
6595
6596#[serde_with::serde_as]
6601#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6602#[serde(default, rename_all = "camelCase")]
6603#[non_exhaustive]
6604pub struct DeleteSpokeRequest {
6605 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6607 pub name: std::string::String,
6608
6609 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6624 pub request_id: std::string::String,
6625
6626 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6627 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6628}
6629
6630impl DeleteSpokeRequest {
6631 pub fn new() -> Self {
6632 std::default::Default::default()
6633 }
6634
6635 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6637 self.name = v.into();
6638 self
6639 }
6640
6641 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6643 self.request_id = v.into();
6644 self
6645 }
6646}
6647
6648impl wkt::message::Message for DeleteSpokeRequest {
6649 fn typename() -> &'static str {
6650 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"
6651 }
6652}
6653
6654#[serde_with::serde_as]
6659#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6660#[serde(default, rename_all = "camelCase")]
6661#[non_exhaustive]
6662pub struct AcceptHubSpokeRequest {
6663 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6665 pub name: std::string::String,
6666
6667 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6669 pub spoke_uri: std::string::String,
6670
6671 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6686 pub request_id: std::string::String,
6687
6688 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6689 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6690}
6691
6692impl AcceptHubSpokeRequest {
6693 pub fn new() -> Self {
6694 std::default::Default::default()
6695 }
6696
6697 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6699 self.name = v.into();
6700 self
6701 }
6702
6703 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6705 self.spoke_uri = v.into();
6706 self
6707 }
6708
6709 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6711 self.request_id = v.into();
6712 self
6713 }
6714}
6715
6716impl wkt::message::Message for AcceptHubSpokeRequest {
6717 fn typename() -> &'static str {
6718 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest"
6719 }
6720}
6721
6722#[serde_with::serde_as]
6727#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6728#[serde(default, rename_all = "camelCase")]
6729#[non_exhaustive]
6730pub struct AcceptHubSpokeResponse {
6731 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6733 pub spoke: std::option::Option<crate::model::Spoke>,
6734
6735 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6736 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6737}
6738
6739impl AcceptHubSpokeResponse {
6740 pub fn new() -> Self {
6741 std::default::Default::default()
6742 }
6743
6744 pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6746 mut self,
6747 v: T,
6748 ) -> Self {
6749 self.spoke = v.into();
6750 self
6751 }
6752}
6753
6754impl wkt::message::Message for AcceptHubSpokeResponse {
6755 fn typename() -> &'static str {
6756 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse"
6757 }
6758}
6759
6760#[serde_with::serde_as]
6765#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6766#[serde(default, rename_all = "camelCase")]
6767#[non_exhaustive]
6768pub struct RejectHubSpokeRequest {
6769 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6771 pub name: std::string::String,
6772
6773 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6775 pub spoke_uri: std::string::String,
6776
6777 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6792 pub request_id: std::string::String,
6793
6794 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6796 pub details: std::string::String,
6797
6798 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6799 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6800}
6801
6802impl RejectHubSpokeRequest {
6803 pub fn new() -> Self {
6804 std::default::Default::default()
6805 }
6806
6807 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6809 self.name = v.into();
6810 self
6811 }
6812
6813 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6815 self.spoke_uri = v.into();
6816 self
6817 }
6818
6819 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6821 self.request_id = v.into();
6822 self
6823 }
6824
6825 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6827 self.details = v.into();
6828 self
6829 }
6830}
6831
6832impl wkt::message::Message for RejectHubSpokeRequest {
6833 fn typename() -> &'static str {
6834 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeRequest"
6835 }
6836}
6837
6838#[serde_with::serde_as]
6843#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6844#[serde(default, rename_all = "camelCase")]
6845#[non_exhaustive]
6846pub struct RejectHubSpokeResponse {
6847 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6849 pub spoke: std::option::Option<crate::model::Spoke>,
6850
6851 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6852 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6853}
6854
6855impl RejectHubSpokeResponse {
6856 pub fn new() -> Self {
6857 std::default::Default::default()
6858 }
6859
6860 pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6862 mut self,
6863 v: T,
6864 ) -> Self {
6865 self.spoke = v.into();
6866 self
6867 }
6868}
6869
6870impl wkt::message::Message for RejectHubSpokeResponse {
6871 fn typename() -> &'static str {
6872 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeResponse"
6873 }
6874}
6875
6876#[serde_with::serde_as]
6881#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6882#[serde(default, rename_all = "camelCase")]
6883#[non_exhaustive]
6884pub struct AcceptSpokeUpdateRequest {
6885 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6887 pub name: std::string::String,
6888
6889 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6891 pub spoke_uri: std::string::String,
6892
6893 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6895 pub spoke_etag: std::string::String,
6896
6897 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6912 pub request_id: std::string::String,
6913
6914 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6915 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6916}
6917
6918impl AcceptSpokeUpdateRequest {
6919 pub fn new() -> Self {
6920 std::default::Default::default()
6921 }
6922
6923 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6925 self.name = v.into();
6926 self
6927 }
6928
6929 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6931 self.spoke_uri = v.into();
6932 self
6933 }
6934
6935 pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6937 self.spoke_etag = v.into();
6938 self
6939 }
6940
6941 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6943 self.request_id = v.into();
6944 self
6945 }
6946}
6947
6948impl wkt::message::Message for AcceptSpokeUpdateRequest {
6949 fn typename() -> &'static str {
6950 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateRequest"
6951 }
6952}
6953
6954#[serde_with::serde_as]
6959#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6960#[serde(default, rename_all = "camelCase")]
6961#[non_exhaustive]
6962pub struct AcceptSpokeUpdateResponse {
6963 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6965 pub spoke: std::option::Option<crate::model::Spoke>,
6966
6967 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6968 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6969}
6970
6971impl AcceptSpokeUpdateResponse {
6972 pub fn new() -> Self {
6973 std::default::Default::default()
6974 }
6975
6976 pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
6978 mut self,
6979 v: T,
6980 ) -> Self {
6981 self.spoke = v.into();
6982 self
6983 }
6984}
6985
6986impl wkt::message::Message for AcceptSpokeUpdateResponse {
6987 fn typename() -> &'static str {
6988 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateResponse"
6989 }
6990}
6991
6992#[serde_with::serde_as]
6997#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6998#[serde(default, rename_all = "camelCase")]
6999#[non_exhaustive]
7000pub struct RejectSpokeUpdateRequest {
7001 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7003 pub name: std::string::String,
7004
7005 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7007 pub spoke_uri: std::string::String,
7008
7009 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7011 pub spoke_etag: std::string::String,
7012
7013 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7015 pub details: std::string::String,
7016
7017 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7032 pub request_id: std::string::String,
7033
7034 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7035 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7036}
7037
7038impl RejectSpokeUpdateRequest {
7039 pub fn new() -> Self {
7040 std::default::Default::default()
7041 }
7042
7043 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7045 self.name = v.into();
7046 self
7047 }
7048
7049 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7051 self.spoke_uri = v.into();
7052 self
7053 }
7054
7055 pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7057 self.spoke_etag = v.into();
7058 self
7059 }
7060
7061 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7063 self.details = v.into();
7064 self
7065 }
7066
7067 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7069 self.request_id = v.into();
7070 self
7071 }
7072}
7073
7074impl wkt::message::Message for RejectSpokeUpdateRequest {
7075 fn typename() -> &'static str {
7076 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateRequest"
7077 }
7078}
7079
7080#[serde_with::serde_as]
7085#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7086#[serde(default, rename_all = "camelCase")]
7087#[non_exhaustive]
7088pub struct RejectSpokeUpdateResponse {
7089 #[serde(skip_serializing_if = "std::option::Option::is_none")]
7091 pub spoke: std::option::Option<crate::model::Spoke>,
7092
7093 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7094 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7095}
7096
7097impl RejectSpokeUpdateResponse {
7098 pub fn new() -> Self {
7099 std::default::Default::default()
7100 }
7101
7102 pub fn set_spoke<T: std::convert::Into<std::option::Option<crate::model::Spoke>>>(
7104 mut self,
7105 v: T,
7106 ) -> Self {
7107 self.spoke = v.into();
7108 self
7109 }
7110}
7111
7112impl wkt::message::Message for RejectSpokeUpdateResponse {
7113 fn typename() -> &'static str {
7114 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateResponse"
7115 }
7116}
7117
7118#[serde_with::serde_as]
7123#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7124#[serde(default, rename_all = "camelCase")]
7125#[non_exhaustive]
7126pub struct GetRouteTableRequest {
7127 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7129 pub name: std::string::String,
7130
7131 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7132 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7133}
7134
7135impl GetRouteTableRequest {
7136 pub fn new() -> Self {
7137 std::default::Default::default()
7138 }
7139
7140 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7142 self.name = v.into();
7143 self
7144 }
7145}
7146
7147impl wkt::message::Message for GetRouteTableRequest {
7148 fn typename() -> &'static str {
7149 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteTableRequest"
7150 }
7151}
7152
7153#[serde_with::serde_as]
7158#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7159#[serde(default, rename_all = "camelCase")]
7160#[non_exhaustive]
7161pub struct GetRouteRequest {
7162 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7164 pub name: std::string::String,
7165
7166 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7167 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7168}
7169
7170impl GetRouteRequest {
7171 pub fn new() -> Self {
7172 std::default::Default::default()
7173 }
7174
7175 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7177 self.name = v.into();
7178 self
7179 }
7180}
7181
7182impl wkt::message::Message for GetRouteRequest {
7183 fn typename() -> &'static str {
7184 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteRequest"
7185 }
7186}
7187
7188#[serde_with::serde_as]
7194#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7195#[serde(default, rename_all = "camelCase")]
7196#[non_exhaustive]
7197pub struct ListRoutesRequest {
7198 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7200 pub parent: std::string::String,
7201
7202 #[serde(skip_serializing_if = "wkt::internal::is_default")]
7204 pub page_size: i32,
7205
7206 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7208 pub page_token: std::string::String,
7209
7210 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7212 pub filter: std::string::String,
7213
7214 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7216 pub order_by: std::string::String,
7217
7218 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7219 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7220}
7221
7222impl ListRoutesRequest {
7223 pub fn new() -> Self {
7224 std::default::Default::default()
7225 }
7226
7227 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7229 self.parent = v.into();
7230 self
7231 }
7232
7233 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7235 self.page_size = v.into();
7236 self
7237 }
7238
7239 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7241 self.page_token = v.into();
7242 self
7243 }
7244
7245 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7247 self.filter = v.into();
7248 self
7249 }
7250
7251 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7253 self.order_by = v.into();
7254 self
7255 }
7256}
7257
7258impl wkt::message::Message for ListRoutesRequest {
7259 fn typename() -> &'static str {
7260 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesRequest"
7261 }
7262}
7263
7264#[serde_with::serde_as]
7270#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7271#[serde(default, rename_all = "camelCase")]
7272#[non_exhaustive]
7273pub struct ListRoutesResponse {
7274 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7276 pub routes: std::vec::Vec<crate::model::Route>,
7277
7278 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7282 pub next_page_token: std::string::String,
7283
7284 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7286 pub unreachable: std::vec::Vec<std::string::String>,
7287
7288 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7289 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7290}
7291
7292impl ListRoutesResponse {
7293 pub fn new() -> Self {
7294 std::default::Default::default()
7295 }
7296
7297 pub fn set_routes<T, V>(mut self, v: T) -> Self
7299 where
7300 T: std::iter::IntoIterator<Item = V>,
7301 V: std::convert::Into<crate::model::Route>,
7302 {
7303 use std::iter::Iterator;
7304 self.routes = v.into_iter().map(|i| i.into()).collect();
7305 self
7306 }
7307
7308 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7310 self.next_page_token = v.into();
7311 self
7312 }
7313
7314 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7316 where
7317 T: std::iter::IntoIterator<Item = V>,
7318 V: std::convert::Into<std::string::String>,
7319 {
7320 use std::iter::Iterator;
7321 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7322 self
7323 }
7324}
7325
7326impl wkt::message::Message for ListRoutesResponse {
7327 fn typename() -> &'static str {
7328 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesResponse"
7329 }
7330}
7331
7332#[doc(hidden)]
7333impl gax::paginator::internal::PageableResponse for ListRoutesResponse {
7334 type PageItem = crate::model::Route;
7335
7336 fn items(self) -> std::vec::Vec<Self::PageItem> {
7337 self.routes
7338 }
7339
7340 fn next_page_token(&self) -> std::string::String {
7341 use std::clone::Clone;
7342 self.next_page_token.clone()
7343 }
7344}
7345
7346#[serde_with::serde_as]
7352#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7353#[serde(default, rename_all = "camelCase")]
7354#[non_exhaustive]
7355pub struct ListRouteTablesRequest {
7356 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7358 pub parent: std::string::String,
7359
7360 #[serde(skip_serializing_if = "wkt::internal::is_default")]
7362 pub page_size: i32,
7363
7364 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7366 pub page_token: std::string::String,
7367
7368 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7370 pub filter: std::string::String,
7371
7372 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7374 pub order_by: std::string::String,
7375
7376 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7377 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7378}
7379
7380impl ListRouteTablesRequest {
7381 pub fn new() -> Self {
7382 std::default::Default::default()
7383 }
7384
7385 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7387 self.parent = v.into();
7388 self
7389 }
7390
7391 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7393 self.page_size = v.into();
7394 self
7395 }
7396
7397 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7399 self.page_token = v.into();
7400 self
7401 }
7402
7403 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7405 self.filter = v.into();
7406 self
7407 }
7408
7409 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7411 self.order_by = v.into();
7412 self
7413 }
7414}
7415
7416impl wkt::message::Message for ListRouteTablesRequest {
7417 fn typename() -> &'static str {
7418 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesRequest"
7419 }
7420}
7421
7422#[serde_with::serde_as]
7428#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7429#[serde(default, rename_all = "camelCase")]
7430#[non_exhaustive]
7431pub struct ListRouteTablesResponse {
7432 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7434 pub route_tables: std::vec::Vec<crate::model::RouteTable>,
7435
7436 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7440 pub next_page_token: std::string::String,
7441
7442 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7444 pub unreachable: std::vec::Vec<std::string::String>,
7445
7446 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7447 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7448}
7449
7450impl ListRouteTablesResponse {
7451 pub fn new() -> Self {
7452 std::default::Default::default()
7453 }
7454
7455 pub fn set_route_tables<T, V>(mut self, v: T) -> Self
7457 where
7458 T: std::iter::IntoIterator<Item = V>,
7459 V: std::convert::Into<crate::model::RouteTable>,
7460 {
7461 use std::iter::Iterator;
7462 self.route_tables = v.into_iter().map(|i| i.into()).collect();
7463 self
7464 }
7465
7466 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7468 self.next_page_token = v.into();
7469 self
7470 }
7471
7472 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7474 where
7475 T: std::iter::IntoIterator<Item = V>,
7476 V: std::convert::Into<std::string::String>,
7477 {
7478 use std::iter::Iterator;
7479 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7480 self
7481 }
7482}
7483
7484impl wkt::message::Message for ListRouteTablesResponse {
7485 fn typename() -> &'static str {
7486 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesResponse"
7487 }
7488}
7489
7490#[doc(hidden)]
7491impl gax::paginator::internal::PageableResponse for ListRouteTablesResponse {
7492 type PageItem = crate::model::RouteTable;
7493
7494 fn items(self) -> std::vec::Vec<Self::PageItem> {
7495 self.route_tables
7496 }
7497
7498 fn next_page_token(&self) -> std::string::String {
7499 use std::clone::Clone;
7500 self.next_page_token.clone()
7501 }
7502}
7503
7504#[serde_with::serde_as]
7510#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7511#[serde(default, rename_all = "camelCase")]
7512#[non_exhaustive]
7513pub struct ListGroupsRequest {
7514 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7516 pub parent: std::string::String,
7517
7518 #[serde(skip_serializing_if = "wkt::internal::is_default")]
7520 pub page_size: i32,
7521
7522 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7524 pub page_token: std::string::String,
7525
7526 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7528 pub filter: std::string::String,
7529
7530 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7532 pub order_by: std::string::String,
7533
7534 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7535 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7536}
7537
7538impl ListGroupsRequest {
7539 pub fn new() -> Self {
7540 std::default::Default::default()
7541 }
7542
7543 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7545 self.parent = v.into();
7546 self
7547 }
7548
7549 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7551 self.page_size = v.into();
7552 self
7553 }
7554
7555 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7557 self.page_token = v.into();
7558 self
7559 }
7560
7561 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7563 self.filter = v.into();
7564 self
7565 }
7566
7567 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7569 self.order_by = v.into();
7570 self
7571 }
7572}
7573
7574impl wkt::message::Message for ListGroupsRequest {
7575 fn typename() -> &'static str {
7576 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsRequest"
7577 }
7578}
7579
7580#[serde_with::serde_as]
7586#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7587#[serde(default, rename_all = "camelCase")]
7588#[non_exhaustive]
7589pub struct ListGroupsResponse {
7590 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7592 pub groups: std::vec::Vec<crate::model::Group>,
7593
7594 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7598 pub next_page_token: std::string::String,
7599
7600 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7602 pub unreachable: std::vec::Vec<std::string::String>,
7603
7604 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7605 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7606}
7607
7608impl ListGroupsResponse {
7609 pub fn new() -> Self {
7610 std::default::Default::default()
7611 }
7612
7613 pub fn set_groups<T, V>(mut self, v: T) -> Self
7615 where
7616 T: std::iter::IntoIterator<Item = V>,
7617 V: std::convert::Into<crate::model::Group>,
7618 {
7619 use std::iter::Iterator;
7620 self.groups = v.into_iter().map(|i| i.into()).collect();
7621 self
7622 }
7623
7624 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7626 self.next_page_token = v.into();
7627 self
7628 }
7629
7630 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7632 where
7633 T: std::iter::IntoIterator<Item = V>,
7634 V: std::convert::Into<std::string::String>,
7635 {
7636 use std::iter::Iterator;
7637 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7638 self
7639 }
7640}
7641
7642impl wkt::message::Message for ListGroupsResponse {
7643 fn typename() -> &'static str {
7644 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsResponse"
7645 }
7646}
7647
7648#[doc(hidden)]
7649impl gax::paginator::internal::PageableResponse for ListGroupsResponse {
7650 type PageItem = crate::model::Group;
7651
7652 fn items(self) -> std::vec::Vec<Self::PageItem> {
7653 self.groups
7654 }
7655
7656 fn next_page_token(&self) -> std::string::String {
7657 use std::clone::Clone;
7658 self.next_page_token.clone()
7659 }
7660}
7661
7662#[serde_with::serde_as]
7667#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7668#[serde(default, rename_all = "camelCase")]
7669#[non_exhaustive]
7670pub struct LinkedVpnTunnels {
7671 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7673 pub uris: std::vec::Vec<std::string::String>,
7674
7675 #[serde(skip_serializing_if = "wkt::internal::is_default")]
7679 pub site_to_site_data_transfer: bool,
7680
7681 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7683 pub vpc_network: std::string::String,
7684
7685 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7689 pub include_import_ranges: std::vec::Vec<std::string::String>,
7690
7691 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7692 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7693}
7694
7695impl LinkedVpnTunnels {
7696 pub fn new() -> Self {
7697 std::default::Default::default()
7698 }
7699
7700 pub fn set_uris<T, V>(mut self, v: T) -> Self
7702 where
7703 T: std::iter::IntoIterator<Item = V>,
7704 V: std::convert::Into<std::string::String>,
7705 {
7706 use std::iter::Iterator;
7707 self.uris = v.into_iter().map(|i| i.into()).collect();
7708 self
7709 }
7710
7711 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7713 self.site_to_site_data_transfer = v.into();
7714 self
7715 }
7716
7717 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7719 self.vpc_network = v.into();
7720 self
7721 }
7722
7723 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
7725 where
7726 T: std::iter::IntoIterator<Item = V>,
7727 V: std::convert::Into<std::string::String>,
7728 {
7729 use std::iter::Iterator;
7730 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
7731 self
7732 }
7733}
7734
7735impl wkt::message::Message for LinkedVpnTunnels {
7736 fn typename() -> &'static str {
7737 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"
7738 }
7739}
7740
7741#[serde_with::serde_as]
7746#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7747#[serde(default, rename_all = "camelCase")]
7748#[non_exhaustive]
7749pub struct LinkedInterconnectAttachments {
7750 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7752 pub uris: std::vec::Vec<std::string::String>,
7753
7754 #[serde(skip_serializing_if = "wkt::internal::is_default")]
7758 pub site_to_site_data_transfer: bool,
7759
7760 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7762 pub vpc_network: std::string::String,
7763
7764 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7768 pub include_import_ranges: std::vec::Vec<std::string::String>,
7769
7770 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7771 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7772}
7773
7774impl LinkedInterconnectAttachments {
7775 pub fn new() -> Self {
7776 std::default::Default::default()
7777 }
7778
7779 pub fn set_uris<T, V>(mut self, v: T) -> Self
7781 where
7782 T: std::iter::IntoIterator<Item = V>,
7783 V: std::convert::Into<std::string::String>,
7784 {
7785 use std::iter::Iterator;
7786 self.uris = v.into_iter().map(|i| i.into()).collect();
7787 self
7788 }
7789
7790 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7792 self.site_to_site_data_transfer = v.into();
7793 self
7794 }
7795
7796 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7798 self.vpc_network = v.into();
7799 self
7800 }
7801
7802 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
7804 where
7805 T: std::iter::IntoIterator<Item = V>,
7806 V: std::convert::Into<std::string::String>,
7807 {
7808 use std::iter::Iterator;
7809 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
7810 self
7811 }
7812}
7813
7814impl wkt::message::Message for LinkedInterconnectAttachments {
7815 fn typename() -> &'static str {
7816 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"
7817 }
7818}
7819
7820#[serde_with::serde_as]
7825#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7826#[serde(default, rename_all = "camelCase")]
7827#[non_exhaustive]
7828pub struct LinkedRouterApplianceInstances {
7829 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7831 pub instances: std::vec::Vec<crate::model::RouterApplianceInstance>,
7832
7833 #[serde(skip_serializing_if = "wkt::internal::is_default")]
7837 pub site_to_site_data_transfer: bool,
7838
7839 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7842 pub vpc_network: std::string::String,
7843
7844 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7848 pub include_import_ranges: std::vec::Vec<std::string::String>,
7849
7850 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7851 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7852}
7853
7854impl LinkedRouterApplianceInstances {
7855 pub fn new() -> Self {
7856 std::default::Default::default()
7857 }
7858
7859 pub fn set_instances<T, V>(mut self, v: T) -> Self
7861 where
7862 T: std::iter::IntoIterator<Item = V>,
7863 V: std::convert::Into<crate::model::RouterApplianceInstance>,
7864 {
7865 use std::iter::Iterator;
7866 self.instances = v.into_iter().map(|i| i.into()).collect();
7867 self
7868 }
7869
7870 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7872 self.site_to_site_data_transfer = v.into();
7873 self
7874 }
7875
7876 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7878 self.vpc_network = v.into();
7879 self
7880 }
7881
7882 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
7884 where
7885 T: std::iter::IntoIterator<Item = V>,
7886 V: std::convert::Into<std::string::String>,
7887 {
7888 use std::iter::Iterator;
7889 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
7890 self
7891 }
7892}
7893
7894impl wkt::message::Message for LinkedRouterApplianceInstances {
7895 fn typename() -> &'static str {
7896 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"
7897 }
7898}
7899
7900#[serde_with::serde_as]
7902#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7903#[serde(default, rename_all = "camelCase")]
7904#[non_exhaustive]
7905pub struct LinkedVpcNetwork {
7906 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7908 pub uri: std::string::String,
7909
7910 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7912 pub exclude_export_ranges: std::vec::Vec<std::string::String>,
7913
7914 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7916 pub include_export_ranges: std::vec::Vec<std::string::String>,
7917
7918 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7921 pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
7922
7923 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7926 pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
7927
7928 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7936 pub producer_vpc_spokes: std::vec::Vec<std::string::String>,
7937
7938 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7939 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7940}
7941
7942impl LinkedVpcNetwork {
7943 pub fn new() -> Self {
7944 std::default::Default::default()
7945 }
7946
7947 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7949 self.uri = v.into();
7950 self
7951 }
7952
7953 pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
7955 where
7956 T: std::iter::IntoIterator<Item = V>,
7957 V: std::convert::Into<std::string::String>,
7958 {
7959 use std::iter::Iterator;
7960 self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
7961 self
7962 }
7963
7964 pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
7966 where
7967 T: std::iter::IntoIterator<Item = V>,
7968 V: std::convert::Into<std::string::String>,
7969 {
7970 use std::iter::Iterator;
7971 self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
7972 self
7973 }
7974
7975 pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
7977 where
7978 T: std::iter::IntoIterator<Item = V>,
7979 V: std::convert::Into<std::string::String>,
7980 {
7981 use std::iter::Iterator;
7982 self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
7983 self
7984 }
7985
7986 pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
7988 where
7989 T: std::iter::IntoIterator<Item = V>,
7990 V: std::convert::Into<std::string::String>,
7991 {
7992 use std::iter::Iterator;
7993 self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
7994 self
7995 }
7996
7997 pub fn set_producer_vpc_spokes<T, V>(mut self, v: T) -> Self
7999 where
8000 T: std::iter::IntoIterator<Item = V>,
8001 V: std::convert::Into<std::string::String>,
8002 {
8003 use std::iter::Iterator;
8004 self.producer_vpc_spokes = v.into_iter().map(|i| i.into()).collect();
8005 self
8006 }
8007}
8008
8009impl wkt::message::Message for LinkedVpcNetwork {
8010 fn typename() -> &'static str {
8011 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpcNetwork"
8012 }
8013}
8014
8015#[serde_with::serde_as]
8016#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8017#[serde(default, rename_all = "camelCase")]
8018#[non_exhaustive]
8019pub struct LinkedProducerVpcNetwork {
8020 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8023 pub network: std::string::String,
8024
8025 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8027 pub service_consumer_vpc_spoke: std::string::String,
8028
8029 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8033 pub peering: std::string::String,
8034
8035 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8037 pub producer_network: std::string::String,
8038
8039 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8041 pub exclude_export_ranges: std::vec::Vec<std::string::String>,
8042
8043 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8045 pub include_export_ranges: std::vec::Vec<std::string::String>,
8046
8047 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8050 pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
8051
8052 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8055 pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
8056
8057 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8058 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8059}
8060
8061impl LinkedProducerVpcNetwork {
8062 pub fn new() -> Self {
8063 std::default::Default::default()
8064 }
8065
8066 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8068 self.network = v.into();
8069 self
8070 }
8071
8072 pub fn set_service_consumer_vpc_spoke<T: std::convert::Into<std::string::String>>(
8074 mut self,
8075 v: T,
8076 ) -> Self {
8077 self.service_consumer_vpc_spoke = v.into();
8078 self
8079 }
8080
8081 pub fn set_peering<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8083 self.peering = v.into();
8084 self
8085 }
8086
8087 pub fn set_producer_network<T: std::convert::Into<std::string::String>>(
8089 mut self,
8090 v: T,
8091 ) -> Self {
8092 self.producer_network = v.into();
8093 self
8094 }
8095
8096 pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
8098 where
8099 T: std::iter::IntoIterator<Item = V>,
8100 V: std::convert::Into<std::string::String>,
8101 {
8102 use std::iter::Iterator;
8103 self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
8104 self
8105 }
8106
8107 pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
8109 where
8110 T: std::iter::IntoIterator<Item = V>,
8111 V: std::convert::Into<std::string::String>,
8112 {
8113 use std::iter::Iterator;
8114 self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
8115 self
8116 }
8117
8118 pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
8120 where
8121 T: std::iter::IntoIterator<Item = V>,
8122 V: std::convert::Into<std::string::String>,
8123 {
8124 use std::iter::Iterator;
8125 self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
8126 self
8127 }
8128
8129 pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
8131 where
8132 T: std::iter::IntoIterator<Item = V>,
8133 V: std::convert::Into<std::string::String>,
8134 {
8135 use std::iter::Iterator;
8136 self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
8137 self
8138 }
8139}
8140
8141impl wkt::message::Message for LinkedProducerVpcNetwork {
8142 fn typename() -> &'static str {
8143 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedProducerVpcNetwork"
8144 }
8145}
8146
8147#[serde_with::serde_as]
8152#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8153#[serde(default, rename_all = "camelCase")]
8154#[non_exhaustive]
8155pub struct RouterApplianceInstance {
8156 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8158 pub virtual_machine: std::string::String,
8159
8160 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8162 pub ip_address: std::string::String,
8163
8164 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8165 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8166}
8167
8168impl RouterApplianceInstance {
8169 pub fn new() -> Self {
8170 std::default::Default::default()
8171 }
8172
8173 pub fn set_virtual_machine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8175 self.virtual_machine = v.into();
8176 self
8177 }
8178
8179 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8181 self.ip_address = v.into();
8182 self
8183 }
8184}
8185
8186impl wkt::message::Message for RouterApplianceInstance {
8187 fn typename() -> &'static str {
8188 "type.googleapis.com/google.cloud.networkconnectivity.v1.RouterApplianceInstance"
8189 }
8190}
8191
8192#[serde_with::serde_as]
8194#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8195#[serde(default, rename_all = "camelCase")]
8196#[non_exhaustive]
8197pub struct LocationMetadata {
8198 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8200 pub location_features: std::vec::Vec<crate::model::LocationFeature>,
8201
8202 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8203 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8204}
8205
8206impl LocationMetadata {
8207 pub fn new() -> Self {
8208 std::default::Default::default()
8209 }
8210
8211 pub fn set_location_features<T, V>(mut self, v: T) -> Self
8213 where
8214 T: std::iter::IntoIterator<Item = V>,
8215 V: std::convert::Into<crate::model::LocationFeature>,
8216 {
8217 use std::iter::Iterator;
8218 self.location_features = v.into_iter().map(|i| i.into()).collect();
8219 self
8220 }
8221}
8222
8223impl wkt::message::Message for LocationMetadata {
8224 fn typename() -> &'static str {
8225 "type.googleapis.com/google.cloud.networkconnectivity.v1.LocationMetadata"
8226 }
8227}
8228
8229#[serde_with::serde_as]
8230#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8231#[serde(default, rename_all = "camelCase")]
8232#[non_exhaustive]
8233pub struct NextHopVpcNetwork {
8234 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8236 pub uri: std::string::String,
8237
8238 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8239 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8240}
8241
8242impl NextHopVpcNetwork {
8243 pub fn new() -> Self {
8244 std::default::Default::default()
8245 }
8246
8247 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8249 self.uri = v.into();
8250 self
8251 }
8252}
8253
8254impl wkt::message::Message for NextHopVpcNetwork {
8255 fn typename() -> &'static str {
8256 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVpcNetwork"
8257 }
8258}
8259
8260#[serde_with::serde_as]
8262#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8263#[serde(default, rename_all = "camelCase")]
8264#[non_exhaustive]
8265pub struct NextHopVPNTunnel {
8266 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8268 pub uri: std::string::String,
8269
8270 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8272 pub vpc_network: std::string::String,
8273
8274 #[serde(skip_serializing_if = "wkt::internal::is_default")]
8278 pub site_to_site_data_transfer: bool,
8279
8280 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8281 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8282}
8283
8284impl NextHopVPNTunnel {
8285 pub fn new() -> Self {
8286 std::default::Default::default()
8287 }
8288
8289 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8291 self.uri = v.into();
8292 self
8293 }
8294
8295 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8297 self.vpc_network = v.into();
8298 self
8299 }
8300
8301 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8303 self.site_to_site_data_transfer = v.into();
8304 self
8305 }
8306}
8307
8308impl wkt::message::Message for NextHopVPNTunnel {
8309 fn typename() -> &'static str {
8310 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVPNTunnel"
8311 }
8312}
8313
8314#[serde_with::serde_as]
8316#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8317#[serde(default, rename_all = "camelCase")]
8318#[non_exhaustive]
8319pub struct NextHopRouterApplianceInstance {
8320 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8322 pub uri: std::string::String,
8323
8324 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8326 pub vpc_network: std::string::String,
8327
8328 #[serde(skip_serializing_if = "wkt::internal::is_default")]
8332 pub site_to_site_data_transfer: bool,
8333
8334 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8335 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8336}
8337
8338impl NextHopRouterApplianceInstance {
8339 pub fn new() -> Self {
8340 std::default::Default::default()
8341 }
8342
8343 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8345 self.uri = v.into();
8346 self
8347 }
8348
8349 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8351 self.vpc_network = v.into();
8352 self
8353 }
8354
8355 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8357 self.site_to_site_data_transfer = v.into();
8358 self
8359 }
8360}
8361
8362impl wkt::message::Message for NextHopRouterApplianceInstance {
8363 fn typename() -> &'static str {
8364 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopRouterApplianceInstance"
8365 }
8366}
8367
8368#[serde_with::serde_as]
8370#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8371#[serde(default, rename_all = "camelCase")]
8372#[non_exhaustive]
8373pub struct NextHopInterconnectAttachment {
8374 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8376 pub uri: std::string::String,
8377
8378 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8380 pub vpc_network: std::string::String,
8381
8382 #[serde(skip_serializing_if = "wkt::internal::is_default")]
8387 pub site_to_site_data_transfer: bool,
8388
8389 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8390 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8391}
8392
8393impl NextHopInterconnectAttachment {
8394 pub fn new() -> Self {
8395 std::default::Default::default()
8396 }
8397
8398 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8400 self.uri = v.into();
8401 self
8402 }
8403
8404 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8406 self.vpc_network = v.into();
8407 self
8408 }
8409
8410 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8412 self.site_to_site_data_transfer = v.into();
8413 self
8414 }
8415}
8416
8417impl wkt::message::Message for NextHopInterconnectAttachment {
8418 fn typename() -> &'static str {
8419 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopInterconnectAttachment"
8420 }
8421}
8422
8423#[serde_with::serde_as]
8429#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8430#[serde(default, rename_all = "camelCase")]
8431#[non_exhaustive]
8432pub struct SpokeSummary {
8433 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8436 pub spoke_type_counts: std::vec::Vec<crate::model::spoke_summary::SpokeTypeCount>,
8437
8438 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8441 pub spoke_state_counts: std::vec::Vec<crate::model::spoke_summary::SpokeStateCount>,
8442
8443 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8446 pub spoke_state_reason_counts:
8447 std::vec::Vec<crate::model::spoke_summary::SpokeStateReasonCount>,
8448
8449 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8450 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8451}
8452
8453impl SpokeSummary {
8454 pub fn new() -> Self {
8455 std::default::Default::default()
8456 }
8457
8458 pub fn set_spoke_type_counts<T, V>(mut self, v: T) -> Self
8460 where
8461 T: std::iter::IntoIterator<Item = V>,
8462 V: std::convert::Into<crate::model::spoke_summary::SpokeTypeCount>,
8463 {
8464 use std::iter::Iterator;
8465 self.spoke_type_counts = v.into_iter().map(|i| i.into()).collect();
8466 self
8467 }
8468
8469 pub fn set_spoke_state_counts<T, V>(mut self, v: T) -> Self
8471 where
8472 T: std::iter::IntoIterator<Item = V>,
8473 V: std::convert::Into<crate::model::spoke_summary::SpokeStateCount>,
8474 {
8475 use std::iter::Iterator;
8476 self.spoke_state_counts = v.into_iter().map(|i| i.into()).collect();
8477 self
8478 }
8479
8480 pub fn set_spoke_state_reason_counts<T, V>(mut self, v: T) -> Self
8482 where
8483 T: std::iter::IntoIterator<Item = V>,
8484 V: std::convert::Into<crate::model::spoke_summary::SpokeStateReasonCount>,
8485 {
8486 use std::iter::Iterator;
8487 self.spoke_state_reason_counts = v.into_iter().map(|i| i.into()).collect();
8488 self
8489 }
8490}
8491
8492impl wkt::message::Message for SpokeSummary {
8493 fn typename() -> &'static str {
8494 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary"
8495 }
8496}
8497
8498pub mod spoke_summary {
8500 #[allow(unused_imports)]
8501 use super::*;
8502
8503 #[serde_with::serde_as]
8507 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8508 #[serde(default, rename_all = "camelCase")]
8509 #[non_exhaustive]
8510 pub struct SpokeTypeCount {
8511 pub spoke_type: crate::model::SpokeType,
8513
8514 #[serde(skip_serializing_if = "wkt::internal::is_default")]
8517 #[serde_as(as = "serde_with::DisplayFromStr")]
8518 pub count: i64,
8519
8520 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8521 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8522 }
8523
8524 impl SpokeTypeCount {
8525 pub fn new() -> Self {
8526 std::default::Default::default()
8527 }
8528
8529 pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(
8531 mut self,
8532 v: T,
8533 ) -> Self {
8534 self.spoke_type = v.into();
8535 self
8536 }
8537
8538 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8540 self.count = v.into();
8541 self
8542 }
8543 }
8544
8545 impl wkt::message::Message for SpokeTypeCount {
8546 fn typename() -> &'static str {
8547 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount"
8548 }
8549 }
8550
8551 #[serde_with::serde_as]
8554 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8555 #[serde(default, rename_all = "camelCase")]
8556 #[non_exhaustive]
8557 pub struct SpokeStateCount {
8558 pub state: crate::model::State,
8560
8561 #[serde(skip_serializing_if = "wkt::internal::is_default")]
8564 #[serde_as(as = "serde_with::DisplayFromStr")]
8565 pub count: i64,
8566
8567 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8568 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8569 }
8570
8571 impl SpokeStateCount {
8572 pub fn new() -> Self {
8573 std::default::Default::default()
8574 }
8575
8576 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
8578 self.state = v.into();
8579 self
8580 }
8581
8582 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8584 self.count = v.into();
8585 self
8586 }
8587 }
8588
8589 impl wkt::message::Message for SpokeStateCount {
8590 fn typename() -> &'static str {
8591 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount"
8592 }
8593 }
8594
8595 #[serde_with::serde_as]
8597 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8598 #[serde(default, rename_all = "camelCase")]
8599 #[non_exhaustive]
8600 pub struct SpokeStateReasonCount {
8601 pub state_reason_code: crate::model::spoke::state_reason::Code,
8603
8604 #[serde(skip_serializing_if = "wkt::internal::is_default")]
8607 #[serde_as(as = "serde_with::DisplayFromStr")]
8608 pub count: i64,
8609
8610 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8611 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8612 }
8613
8614 impl SpokeStateReasonCount {
8615 pub fn new() -> Self {
8616 std::default::Default::default()
8617 }
8618
8619 pub fn set_state_reason_code<
8621 T: std::convert::Into<crate::model::spoke::state_reason::Code>,
8622 >(
8623 mut self,
8624 v: T,
8625 ) -> Self {
8626 self.state_reason_code = v.into();
8627 self
8628 }
8629
8630 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8632 self.count = v.into();
8633 self
8634 }
8635 }
8636
8637 impl wkt::message::Message for SpokeStateReasonCount {
8638 fn typename() -> &'static str {
8639 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount"
8640 }
8641 }
8642}
8643
8644#[serde_with::serde_as]
8649#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8650#[serde(default, rename_all = "camelCase")]
8651#[non_exhaustive]
8652pub struct GetGroupRequest {
8653 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8655 pub name: std::string::String,
8656
8657 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8658 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8659}
8660
8661impl GetGroupRequest {
8662 pub fn new() -> Self {
8663 std::default::Default::default()
8664 }
8665
8666 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8668 self.name = v.into();
8669 self
8670 }
8671}
8672
8673impl wkt::message::Message for GetGroupRequest {
8674 fn typename() -> &'static str {
8675 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetGroupRequest"
8676 }
8677}
8678
8679#[serde_with::serde_as]
8685#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8686#[serde(default, rename_all = "camelCase")]
8687#[non_exhaustive]
8688pub struct UpdateGroupRequest {
8689 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8695 pub update_mask: std::option::Option<wkt::FieldMask>,
8696
8697 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8699 pub group: std::option::Option<crate::model::Group>,
8700
8701 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8716 pub request_id: std::string::String,
8717
8718 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8719 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8720}
8721
8722impl UpdateGroupRequest {
8723 pub fn new() -> Self {
8724 std::default::Default::default()
8725 }
8726
8727 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
8729 mut self,
8730 v: T,
8731 ) -> Self {
8732 self.update_mask = v.into();
8733 self
8734 }
8735
8736 pub fn set_group<T: std::convert::Into<std::option::Option<crate::model::Group>>>(
8738 mut self,
8739 v: T,
8740 ) -> Self {
8741 self.group = v.into();
8742 self
8743 }
8744
8745 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8747 self.request_id = v.into();
8748 self
8749 }
8750}
8751
8752impl wkt::message::Message for UpdateGroupRequest {
8753 fn typename() -> &'static str {
8754 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateGroupRequest"
8755 }
8756}
8757
8758#[serde_with::serde_as]
8763#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8764#[serde(default, rename_all = "camelCase")]
8765#[non_exhaustive]
8766pub struct PolicyBasedRoute {
8767 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8770 pub name: std::string::String,
8771
8772 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8774 pub create_time: std::option::Option<wkt::Timestamp>,
8775
8776 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8778 pub update_time: std::option::Option<wkt::Timestamp>,
8779
8780 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8782 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8783
8784 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8787 pub description: std::string::String,
8788
8789 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8792 pub network: std::string::String,
8793
8794 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8796 pub filter: std::option::Option<crate::model::policy_based_route::Filter>,
8797
8798 #[serde(skip_serializing_if = "wkt::internal::is_default")]
8804 pub priority: i32,
8805
8806 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8809 pub warnings: std::vec::Vec<crate::model::policy_based_route::Warnings>,
8810
8811 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8813 pub self_link: std::string::String,
8814
8815 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8818 pub kind: std::string::String,
8819
8820 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8824 pub target: std::option::Option<crate::model::policy_based_route::Target>,
8825
8826 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8827 pub next_hop: std::option::Option<crate::model::policy_based_route::NextHop>,
8828
8829 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8830 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8831}
8832
8833impl PolicyBasedRoute {
8834 pub fn new() -> Self {
8835 std::default::Default::default()
8836 }
8837
8838 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8840 self.name = v.into();
8841 self
8842 }
8843
8844 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8846 mut self,
8847 v: T,
8848 ) -> Self {
8849 self.create_time = v.into();
8850 self
8851 }
8852
8853 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8855 mut self,
8856 v: T,
8857 ) -> Self {
8858 self.update_time = v.into();
8859 self
8860 }
8861
8862 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8864 where
8865 T: std::iter::IntoIterator<Item = (K, V)>,
8866 K: std::convert::Into<std::string::String>,
8867 V: std::convert::Into<std::string::String>,
8868 {
8869 use std::iter::Iterator;
8870 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8871 self
8872 }
8873
8874 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8876 self.description = v.into();
8877 self
8878 }
8879
8880 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8882 self.network = v.into();
8883 self
8884 }
8885
8886 pub fn set_filter<
8888 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Filter>>,
8889 >(
8890 mut self,
8891 v: T,
8892 ) -> Self {
8893 self.filter = v.into();
8894 self
8895 }
8896
8897 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8899 self.priority = v.into();
8900 self
8901 }
8902
8903 pub fn set_warnings<T, V>(mut self, v: T) -> Self
8905 where
8906 T: std::iter::IntoIterator<Item = V>,
8907 V: std::convert::Into<crate::model::policy_based_route::Warnings>,
8908 {
8909 use std::iter::Iterator;
8910 self.warnings = v.into_iter().map(|i| i.into()).collect();
8911 self
8912 }
8913
8914 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8916 self.self_link = v.into();
8917 self
8918 }
8919
8920 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8922 self.kind = v.into();
8923 self
8924 }
8925
8926 pub fn set_target<
8931 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Target>>,
8932 >(
8933 mut self,
8934 v: T,
8935 ) -> Self {
8936 self.target = v.into();
8937 self
8938 }
8939
8940 pub fn virtual_machine(
8944 &self,
8945 ) -> std::option::Option<&std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>
8946 {
8947 #[allow(unreachable_patterns)]
8948 self.target.as_ref().and_then(|v| match v {
8949 crate::model::policy_based_route::Target::VirtualMachine(v) => {
8950 std::option::Option::Some(v)
8951 }
8952 _ => std::option::Option::None,
8953 })
8954 }
8955
8956 pub fn set_virtual_machine<
8962 T: std::convert::Into<std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>,
8963 >(
8964 mut self,
8965 v: T,
8966 ) -> Self {
8967 self.target = std::option::Option::Some(
8968 crate::model::policy_based_route::Target::VirtualMachine(v.into()),
8969 );
8970 self
8971 }
8972
8973 pub fn interconnect_attachment(
8977 &self,
8978 ) -> std::option::Option<
8979 &std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
8980 > {
8981 #[allow(unreachable_patterns)]
8982 self.target.as_ref().and_then(|v| match v {
8983 crate::model::policy_based_route::Target::InterconnectAttachment(v) => {
8984 std::option::Option::Some(v)
8985 }
8986 _ => std::option::Option::None,
8987 })
8988 }
8989
8990 pub fn set_interconnect_attachment<
8996 T: std::convert::Into<
8997 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
8998 >,
8999 >(
9000 mut self,
9001 v: T,
9002 ) -> Self {
9003 self.target = std::option::Option::Some(
9004 crate::model::policy_based_route::Target::InterconnectAttachment(v.into()),
9005 );
9006 self
9007 }
9008
9009 pub fn set_next_hop<
9014 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::NextHop>>,
9015 >(
9016 mut self,
9017 v: T,
9018 ) -> Self {
9019 self.next_hop = v.into();
9020 self
9021 }
9022
9023 pub fn next_hop_ilb_ip(&self) -> std::option::Option<&std::string::String> {
9027 #[allow(unreachable_patterns)]
9028 self.next_hop.as_ref().and_then(|v| match v {
9029 crate::model::policy_based_route::NextHop::NextHopIlbIp(v) => {
9030 std::option::Option::Some(v)
9031 }
9032 _ => std::option::Option::None,
9033 })
9034 }
9035
9036 pub fn set_next_hop_ilb_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9042 self.next_hop = std::option::Option::Some(
9043 crate::model::policy_based_route::NextHop::NextHopIlbIp(v.into()),
9044 );
9045 self
9046 }
9047
9048 pub fn next_hop_other_routes(
9052 &self,
9053 ) -> std::option::Option<&crate::model::policy_based_route::OtherRoutes> {
9054 #[allow(unreachable_patterns)]
9055 self.next_hop.as_ref().and_then(|v| match v {
9056 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v) => {
9057 std::option::Option::Some(v)
9058 }
9059 _ => std::option::Option::None,
9060 })
9061 }
9062
9063 pub fn set_next_hop_other_routes<
9069 T: std::convert::Into<crate::model::policy_based_route::OtherRoutes>,
9070 >(
9071 mut self,
9072 v: T,
9073 ) -> Self {
9074 self.next_hop = std::option::Option::Some(
9075 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v.into()),
9076 );
9077 self
9078 }
9079}
9080
9081impl wkt::message::Message for PolicyBasedRoute {
9082 fn typename() -> &'static str {
9083 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute"
9084 }
9085}
9086
9087pub mod policy_based_route {
9089 #[allow(unused_imports)]
9090 use super::*;
9091
9092 #[serde_with::serde_as]
9094 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9095 #[serde(default, rename_all = "camelCase")]
9096 #[non_exhaustive]
9097 pub struct VirtualMachine {
9098 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9101 pub tags: std::vec::Vec<std::string::String>,
9102
9103 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9104 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9105 }
9106
9107 impl VirtualMachine {
9108 pub fn new() -> Self {
9109 std::default::Default::default()
9110 }
9111
9112 pub fn set_tags<T, V>(mut self, v: T) -> Self
9114 where
9115 T: std::iter::IntoIterator<Item = V>,
9116 V: std::convert::Into<std::string::String>,
9117 {
9118 use std::iter::Iterator;
9119 self.tags = v.into_iter().map(|i| i.into()).collect();
9120 self
9121 }
9122 }
9123
9124 impl wkt::message::Message for VirtualMachine {
9125 fn typename() -> &'static str {
9126 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"
9127 }
9128 }
9129
9130 #[serde_with::serde_as]
9132 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9133 #[serde(default, rename_all = "camelCase")]
9134 #[non_exhaustive]
9135 pub struct InterconnectAttachment {
9136 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9139 pub region: std::string::String,
9140
9141 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9142 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9143 }
9144
9145 impl InterconnectAttachment {
9146 pub fn new() -> Self {
9147 std::default::Default::default()
9148 }
9149
9150 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9152 self.region = v.into();
9153 self
9154 }
9155 }
9156
9157 impl wkt::message::Message for InterconnectAttachment {
9158 fn typename() -> &'static str {
9159 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"
9160 }
9161 }
9162
9163 #[serde_with::serde_as]
9165 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9166 #[serde(default, rename_all = "camelCase")]
9167 #[non_exhaustive]
9168 pub struct Filter {
9169 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9172 pub ip_protocol: std::string::String,
9173
9174 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9177 pub src_range: std::string::String,
9178
9179 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9183 pub dest_range: std::string::String,
9184
9185 pub protocol_version: crate::model::policy_based_route::filter::ProtocolVersion,
9188
9189 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9190 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9191 }
9192
9193 impl Filter {
9194 pub fn new() -> Self {
9195 std::default::Default::default()
9196 }
9197
9198 pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9200 self.ip_protocol = v.into();
9201 self
9202 }
9203
9204 pub fn set_src_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9206 self.src_range = v.into();
9207 self
9208 }
9209
9210 pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9212 self.dest_range = v.into();
9213 self
9214 }
9215
9216 pub fn set_protocol_version<
9218 T: std::convert::Into<crate::model::policy_based_route::filter::ProtocolVersion>,
9219 >(
9220 mut self,
9221 v: T,
9222 ) -> Self {
9223 self.protocol_version = v.into();
9224 self
9225 }
9226 }
9227
9228 impl wkt::message::Message for Filter {
9229 fn typename() -> &'static str {
9230 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"
9231 }
9232 }
9233
9234 pub mod filter {
9236 #[allow(unused_imports)]
9237 use super::*;
9238
9239 #[derive(Clone, Debug, PartialEq)]
9255 #[non_exhaustive]
9256 pub enum ProtocolVersion {
9257 Unspecified,
9259 Ipv4,
9261 UnknownValue(protocol_version::UnknownValue),
9266 }
9267
9268 #[doc(hidden)]
9269 pub mod protocol_version {
9270 #[allow(unused_imports)]
9271 use super::*;
9272 #[derive(Clone, Debug, PartialEq)]
9273 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9274 }
9275
9276 impl ProtocolVersion {
9277 pub fn value(&self) -> std::option::Option<i32> {
9282 match self {
9283 Self::Unspecified => std::option::Option::Some(0),
9284 Self::Ipv4 => std::option::Option::Some(1),
9285 Self::UnknownValue(u) => u.0.value(),
9286 }
9287 }
9288
9289 pub fn name(&self) -> std::option::Option<&str> {
9294 match self {
9295 Self::Unspecified => std::option::Option::Some("PROTOCOL_VERSION_UNSPECIFIED"),
9296 Self::Ipv4 => std::option::Option::Some("IPV4"),
9297 Self::UnknownValue(u) => u.0.name(),
9298 }
9299 }
9300 }
9301
9302 impl std::default::Default for ProtocolVersion {
9303 fn default() -> Self {
9304 use std::convert::From;
9305 Self::from(0)
9306 }
9307 }
9308
9309 impl std::fmt::Display for ProtocolVersion {
9310 fn fmt(
9311 &self,
9312 f: &mut std::fmt::Formatter<'_>,
9313 ) -> std::result::Result<(), std::fmt::Error> {
9314 wkt::internal::display_enum(f, self.name(), self.value())
9315 }
9316 }
9317
9318 impl std::convert::From<i32> for ProtocolVersion {
9319 fn from(value: i32) -> Self {
9320 match value {
9321 0 => Self::Unspecified,
9322 1 => Self::Ipv4,
9323 _ => Self::UnknownValue(protocol_version::UnknownValue(
9324 wkt::internal::UnknownEnumValue::Integer(value),
9325 )),
9326 }
9327 }
9328 }
9329
9330 impl std::convert::From<&str> for ProtocolVersion {
9331 fn from(value: &str) -> Self {
9332 use std::string::ToString;
9333 match value {
9334 "PROTOCOL_VERSION_UNSPECIFIED" => Self::Unspecified,
9335 "IPV4" => Self::Ipv4,
9336 _ => Self::UnknownValue(protocol_version::UnknownValue(
9337 wkt::internal::UnknownEnumValue::String(value.to_string()),
9338 )),
9339 }
9340 }
9341 }
9342
9343 impl serde::ser::Serialize for ProtocolVersion {
9344 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9345 where
9346 S: serde::Serializer,
9347 {
9348 match self {
9349 Self::Unspecified => serializer.serialize_i32(0),
9350 Self::Ipv4 => serializer.serialize_i32(1),
9351 Self::UnknownValue(u) => u.0.serialize(serializer),
9352 }
9353 }
9354 }
9355
9356 impl<'de> serde::de::Deserialize<'de> for ProtocolVersion {
9357 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9358 where
9359 D: serde::Deserializer<'de>,
9360 {
9361 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProtocolVersion>::new(
9362 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion",
9363 ))
9364 }
9365 }
9366 }
9367
9368 #[serde_with::serde_as]
9370 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9371 #[serde(default, rename_all = "camelCase")]
9372 #[non_exhaustive]
9373 pub struct Warnings {
9374 pub code: crate::model::policy_based_route::warnings::Code,
9376
9377 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
9384 pub data: std::collections::HashMap<std::string::String, std::string::String>,
9385
9386 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9388 pub warning_message: std::string::String,
9389
9390 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9391 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9392 }
9393
9394 impl Warnings {
9395 pub fn new() -> Self {
9396 std::default::Default::default()
9397 }
9398
9399 pub fn set_code<T: std::convert::Into<crate::model::policy_based_route::warnings::Code>>(
9401 mut self,
9402 v: T,
9403 ) -> Self {
9404 self.code = v.into();
9405 self
9406 }
9407
9408 pub fn set_data<T, K, V>(mut self, v: T) -> Self
9410 where
9411 T: std::iter::IntoIterator<Item = (K, V)>,
9412 K: std::convert::Into<std::string::String>,
9413 V: std::convert::Into<std::string::String>,
9414 {
9415 use std::iter::Iterator;
9416 self.data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9417 self
9418 }
9419
9420 pub fn set_warning_message<T: std::convert::Into<std::string::String>>(
9422 mut self,
9423 v: T,
9424 ) -> Self {
9425 self.warning_message = v.into();
9426 self
9427 }
9428 }
9429
9430 impl wkt::message::Message for Warnings {
9431 fn typename() -> &'static str {
9432 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"
9433 }
9434 }
9435
9436 pub mod warnings {
9438 #[allow(unused_imports)]
9439 use super::*;
9440
9441 #[derive(Clone, Debug, PartialEq)]
9458 #[non_exhaustive]
9459 pub enum Code {
9460 WarningUnspecified,
9462 ResourceNotActive,
9466 ResourceBeingModified,
9469 UnknownValue(code::UnknownValue),
9474 }
9475
9476 #[doc(hidden)]
9477 pub mod code {
9478 #[allow(unused_imports)]
9479 use super::*;
9480 #[derive(Clone, Debug, PartialEq)]
9481 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9482 }
9483
9484 impl Code {
9485 pub fn value(&self) -> std::option::Option<i32> {
9490 match self {
9491 Self::WarningUnspecified => std::option::Option::Some(0),
9492 Self::ResourceNotActive => std::option::Option::Some(1),
9493 Self::ResourceBeingModified => std::option::Option::Some(2),
9494 Self::UnknownValue(u) => u.0.value(),
9495 }
9496 }
9497
9498 pub fn name(&self) -> std::option::Option<&str> {
9503 match self {
9504 Self::WarningUnspecified => std::option::Option::Some("WARNING_UNSPECIFIED"),
9505 Self::ResourceNotActive => std::option::Option::Some("RESOURCE_NOT_ACTIVE"),
9506 Self::ResourceBeingModified => {
9507 std::option::Option::Some("RESOURCE_BEING_MODIFIED")
9508 }
9509 Self::UnknownValue(u) => u.0.name(),
9510 }
9511 }
9512 }
9513
9514 impl std::default::Default for Code {
9515 fn default() -> Self {
9516 use std::convert::From;
9517 Self::from(0)
9518 }
9519 }
9520
9521 impl std::fmt::Display for Code {
9522 fn fmt(
9523 &self,
9524 f: &mut std::fmt::Formatter<'_>,
9525 ) -> std::result::Result<(), std::fmt::Error> {
9526 wkt::internal::display_enum(f, self.name(), self.value())
9527 }
9528 }
9529
9530 impl std::convert::From<i32> for Code {
9531 fn from(value: i32) -> Self {
9532 match value {
9533 0 => Self::WarningUnspecified,
9534 1 => Self::ResourceNotActive,
9535 2 => Self::ResourceBeingModified,
9536 _ => Self::UnknownValue(code::UnknownValue(
9537 wkt::internal::UnknownEnumValue::Integer(value),
9538 )),
9539 }
9540 }
9541 }
9542
9543 impl std::convert::From<&str> for Code {
9544 fn from(value: &str) -> Self {
9545 use std::string::ToString;
9546 match value {
9547 "WARNING_UNSPECIFIED" => Self::WarningUnspecified,
9548 "RESOURCE_NOT_ACTIVE" => Self::ResourceNotActive,
9549 "RESOURCE_BEING_MODIFIED" => Self::ResourceBeingModified,
9550 _ => Self::UnknownValue(code::UnknownValue(
9551 wkt::internal::UnknownEnumValue::String(value.to_string()),
9552 )),
9553 }
9554 }
9555 }
9556
9557 impl serde::ser::Serialize for Code {
9558 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9559 where
9560 S: serde::Serializer,
9561 {
9562 match self {
9563 Self::WarningUnspecified => serializer.serialize_i32(0),
9564 Self::ResourceNotActive => serializer.serialize_i32(1),
9565 Self::ResourceBeingModified => serializer.serialize_i32(2),
9566 Self::UnknownValue(u) => u.0.serialize(serializer),
9567 }
9568 }
9569 }
9570
9571 impl<'de> serde::de::Deserialize<'de> for Code {
9572 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9573 where
9574 D: serde::Deserializer<'de>,
9575 {
9576 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
9577 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code",
9578 ))
9579 }
9580 }
9581 }
9582
9583 #[derive(Clone, Debug, PartialEq)]
9599 #[non_exhaustive]
9600 pub enum OtherRoutes {
9601 Unspecified,
9603 DefaultRouting,
9608 UnknownValue(other_routes::UnknownValue),
9613 }
9614
9615 #[doc(hidden)]
9616 pub mod other_routes {
9617 #[allow(unused_imports)]
9618 use super::*;
9619 #[derive(Clone, Debug, PartialEq)]
9620 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9621 }
9622
9623 impl OtherRoutes {
9624 pub fn value(&self) -> std::option::Option<i32> {
9629 match self {
9630 Self::Unspecified => std::option::Option::Some(0),
9631 Self::DefaultRouting => std::option::Option::Some(1),
9632 Self::UnknownValue(u) => u.0.value(),
9633 }
9634 }
9635
9636 pub fn name(&self) -> std::option::Option<&str> {
9641 match self {
9642 Self::Unspecified => std::option::Option::Some("OTHER_ROUTES_UNSPECIFIED"),
9643 Self::DefaultRouting => std::option::Option::Some("DEFAULT_ROUTING"),
9644 Self::UnknownValue(u) => u.0.name(),
9645 }
9646 }
9647 }
9648
9649 impl std::default::Default for OtherRoutes {
9650 fn default() -> Self {
9651 use std::convert::From;
9652 Self::from(0)
9653 }
9654 }
9655
9656 impl std::fmt::Display for OtherRoutes {
9657 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9658 wkt::internal::display_enum(f, self.name(), self.value())
9659 }
9660 }
9661
9662 impl std::convert::From<i32> for OtherRoutes {
9663 fn from(value: i32) -> Self {
9664 match value {
9665 0 => Self::Unspecified,
9666 1 => Self::DefaultRouting,
9667 _ => Self::UnknownValue(other_routes::UnknownValue(
9668 wkt::internal::UnknownEnumValue::Integer(value),
9669 )),
9670 }
9671 }
9672 }
9673
9674 impl std::convert::From<&str> for OtherRoutes {
9675 fn from(value: &str) -> Self {
9676 use std::string::ToString;
9677 match value {
9678 "OTHER_ROUTES_UNSPECIFIED" => Self::Unspecified,
9679 "DEFAULT_ROUTING" => Self::DefaultRouting,
9680 _ => Self::UnknownValue(other_routes::UnknownValue(
9681 wkt::internal::UnknownEnumValue::String(value.to_string()),
9682 )),
9683 }
9684 }
9685 }
9686
9687 impl serde::ser::Serialize for OtherRoutes {
9688 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9689 where
9690 S: serde::Serializer,
9691 {
9692 match self {
9693 Self::Unspecified => serializer.serialize_i32(0),
9694 Self::DefaultRouting => serializer.serialize_i32(1),
9695 Self::UnknownValue(u) => u.0.serialize(serializer),
9696 }
9697 }
9698 }
9699
9700 impl<'de> serde::de::Deserialize<'de> for OtherRoutes {
9701 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9702 where
9703 D: serde::Deserializer<'de>,
9704 {
9705 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OtherRoutes>::new(
9706 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes",
9707 ))
9708 }
9709 }
9710
9711 #[serde_with::serde_as]
9715 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9716 #[serde(rename_all = "camelCase")]
9717 #[non_exhaustive]
9718 pub enum Target {
9719 VirtualMachine(std::boxed::Box<crate::model::policy_based_route::VirtualMachine>),
9721 InterconnectAttachment(
9724 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
9725 ),
9726 }
9727
9728 #[serde_with::serde_as]
9729 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9730 #[serde(rename_all = "camelCase")]
9731 #[non_exhaustive]
9732 pub enum NextHop {
9733 NextHopIlbIp(std::string::String),
9737 NextHopOtherRoutes(crate::model::policy_based_route::OtherRoutes),
9740 }
9741}
9742
9743#[serde_with::serde_as]
9749#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9750#[serde(default, rename_all = "camelCase")]
9751#[non_exhaustive]
9752pub struct ListPolicyBasedRoutesRequest {
9753 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9755 pub parent: std::string::String,
9756
9757 #[serde(skip_serializing_if = "wkt::internal::is_default")]
9759 pub page_size: i32,
9760
9761 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9763 pub page_token: std::string::String,
9764
9765 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9767 pub filter: std::string::String,
9768
9769 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9771 pub order_by: std::string::String,
9772
9773 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9774 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9775}
9776
9777impl ListPolicyBasedRoutesRequest {
9778 pub fn new() -> Self {
9779 std::default::Default::default()
9780 }
9781
9782 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9784 self.parent = v.into();
9785 self
9786 }
9787
9788 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9790 self.page_size = v.into();
9791 self
9792 }
9793
9794 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9796 self.page_token = v.into();
9797 self
9798 }
9799
9800 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9802 self.filter = v.into();
9803 self
9804 }
9805
9806 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9808 self.order_by = v.into();
9809 self
9810 }
9811}
9812
9813impl wkt::message::Message for ListPolicyBasedRoutesRequest {
9814 fn typename() -> &'static str {
9815 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"
9816 }
9817}
9818
9819#[serde_with::serde_as]
9825#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9826#[serde(default, rename_all = "camelCase")]
9827#[non_exhaustive]
9828pub struct ListPolicyBasedRoutesResponse {
9829 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9831 pub policy_based_routes: std::vec::Vec<crate::model::PolicyBasedRoute>,
9832
9833 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9836 pub next_page_token: std::string::String,
9837
9838 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9840 pub unreachable: std::vec::Vec<std::string::String>,
9841
9842 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9843 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9844}
9845
9846impl ListPolicyBasedRoutesResponse {
9847 pub fn new() -> Self {
9848 std::default::Default::default()
9849 }
9850
9851 pub fn set_policy_based_routes<T, V>(mut self, v: T) -> Self
9853 where
9854 T: std::iter::IntoIterator<Item = V>,
9855 V: std::convert::Into<crate::model::PolicyBasedRoute>,
9856 {
9857 use std::iter::Iterator;
9858 self.policy_based_routes = v.into_iter().map(|i| i.into()).collect();
9859 self
9860 }
9861
9862 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9864 self.next_page_token = v.into();
9865 self
9866 }
9867
9868 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9870 where
9871 T: std::iter::IntoIterator<Item = V>,
9872 V: std::convert::Into<std::string::String>,
9873 {
9874 use std::iter::Iterator;
9875 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9876 self
9877 }
9878}
9879
9880impl wkt::message::Message for ListPolicyBasedRoutesResponse {
9881 fn typename() -> &'static str {
9882 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"
9883 }
9884}
9885
9886#[doc(hidden)]
9887impl gax::paginator::internal::PageableResponse for ListPolicyBasedRoutesResponse {
9888 type PageItem = crate::model::PolicyBasedRoute;
9889
9890 fn items(self) -> std::vec::Vec<Self::PageItem> {
9891 self.policy_based_routes
9892 }
9893
9894 fn next_page_token(&self) -> std::string::String {
9895 use std::clone::Clone;
9896 self.next_page_token.clone()
9897 }
9898}
9899
9900#[serde_with::serde_as]
9906#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9907#[serde(default, rename_all = "camelCase")]
9908#[non_exhaustive]
9909pub struct GetPolicyBasedRouteRequest {
9910 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9912 pub name: std::string::String,
9913
9914 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9915 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9916}
9917
9918impl GetPolicyBasedRouteRequest {
9919 pub fn new() -> Self {
9920 std::default::Default::default()
9921 }
9922
9923 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9925 self.name = v.into();
9926 self
9927 }
9928}
9929
9930impl wkt::message::Message for GetPolicyBasedRouteRequest {
9931 fn typename() -> &'static str {
9932 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"
9933 }
9934}
9935
9936#[serde_with::serde_as]
9942#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9943#[serde(default, rename_all = "camelCase")]
9944#[non_exhaustive]
9945pub struct CreatePolicyBasedRouteRequest {
9946 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9948 pub parent: std::string::String,
9949
9950 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9959 pub policy_based_route_id: std::string::String,
9960
9961 #[serde(skip_serializing_if = "std::option::Option::is_none")]
9963 pub policy_based_route: std::option::Option<crate::model::PolicyBasedRoute>,
9964
9965 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9979 pub request_id: std::string::String,
9980
9981 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9982 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9983}
9984
9985impl CreatePolicyBasedRouteRequest {
9986 pub fn new() -> Self {
9987 std::default::Default::default()
9988 }
9989
9990 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9992 self.parent = v.into();
9993 self
9994 }
9995
9996 pub fn set_policy_based_route_id<T: std::convert::Into<std::string::String>>(
9998 mut self,
9999 v: T,
10000 ) -> Self {
10001 self.policy_based_route_id = v.into();
10002 self
10003 }
10004
10005 pub fn set_policy_based_route<
10007 T: std::convert::Into<std::option::Option<crate::model::PolicyBasedRoute>>,
10008 >(
10009 mut self,
10010 v: T,
10011 ) -> Self {
10012 self.policy_based_route = v.into();
10013 self
10014 }
10015
10016 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10018 self.request_id = v.into();
10019 self
10020 }
10021}
10022
10023impl wkt::message::Message for CreatePolicyBasedRouteRequest {
10024 fn typename() -> &'static str {
10025 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"
10026 }
10027}
10028
10029#[serde_with::serde_as]
10035#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10036#[serde(default, rename_all = "camelCase")]
10037#[non_exhaustive]
10038pub struct DeletePolicyBasedRouteRequest {
10039 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10041 pub name: std::string::String,
10042
10043 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10057 pub request_id: std::string::String,
10058
10059 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10060 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10061}
10062
10063impl DeletePolicyBasedRouteRequest {
10064 pub fn new() -> Self {
10065 std::default::Default::default()
10066 }
10067
10068 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10070 self.name = v.into();
10071 self
10072 }
10073
10074 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10076 self.request_id = v.into();
10077 self
10078 }
10079}
10080
10081impl wkt::message::Message for DeletePolicyBasedRouteRequest {
10082 fn typename() -> &'static str {
10083 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"
10084 }
10085}
10086
10087#[derive(Clone, Debug, PartialEq)]
10103#[non_exhaustive]
10104pub enum Infrastructure {
10105 Unspecified,
10107 Psc,
10109 UnknownValue(infrastructure::UnknownValue),
10114}
10115
10116#[doc(hidden)]
10117pub mod infrastructure {
10118 #[allow(unused_imports)]
10119 use super::*;
10120 #[derive(Clone, Debug, PartialEq)]
10121 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10122}
10123
10124impl Infrastructure {
10125 pub fn value(&self) -> std::option::Option<i32> {
10130 match self {
10131 Self::Unspecified => std::option::Option::Some(0),
10132 Self::Psc => std::option::Option::Some(1),
10133 Self::UnknownValue(u) => u.0.value(),
10134 }
10135 }
10136
10137 pub fn name(&self) -> std::option::Option<&str> {
10142 match self {
10143 Self::Unspecified => std::option::Option::Some("INFRASTRUCTURE_UNSPECIFIED"),
10144 Self::Psc => std::option::Option::Some("PSC"),
10145 Self::UnknownValue(u) => u.0.name(),
10146 }
10147 }
10148}
10149
10150impl std::default::Default for Infrastructure {
10151 fn default() -> Self {
10152 use std::convert::From;
10153 Self::from(0)
10154 }
10155}
10156
10157impl std::fmt::Display for Infrastructure {
10158 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10159 wkt::internal::display_enum(f, self.name(), self.value())
10160 }
10161}
10162
10163impl std::convert::From<i32> for Infrastructure {
10164 fn from(value: i32) -> Self {
10165 match value {
10166 0 => Self::Unspecified,
10167 1 => Self::Psc,
10168 _ => Self::UnknownValue(infrastructure::UnknownValue(
10169 wkt::internal::UnknownEnumValue::Integer(value),
10170 )),
10171 }
10172 }
10173}
10174
10175impl std::convert::From<&str> for Infrastructure {
10176 fn from(value: &str) -> Self {
10177 use std::string::ToString;
10178 match value {
10179 "INFRASTRUCTURE_UNSPECIFIED" => Self::Unspecified,
10180 "PSC" => Self::Psc,
10181 _ => Self::UnknownValue(infrastructure::UnknownValue(
10182 wkt::internal::UnknownEnumValue::String(value.to_string()),
10183 )),
10184 }
10185 }
10186}
10187
10188impl serde::ser::Serialize for Infrastructure {
10189 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10190 where
10191 S: serde::Serializer,
10192 {
10193 match self {
10194 Self::Unspecified => serializer.serialize_i32(0),
10195 Self::Psc => serializer.serialize_i32(1),
10196 Self::UnknownValue(u) => u.0.serialize(serializer),
10197 }
10198 }
10199}
10200
10201impl<'de> serde::de::Deserialize<'de> for Infrastructure {
10202 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10203 where
10204 D: serde::Deserializer<'de>,
10205 {
10206 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Infrastructure>::new(
10207 ".google.cloud.networkconnectivity.v1.Infrastructure",
10208 ))
10209 }
10210}
10211
10212#[derive(Clone, Debug, PartialEq)]
10229#[non_exhaustive]
10230pub enum ConnectionErrorType {
10231 Unspecified,
10233 ErrorInternal,
10235 ErrorConsumerSide,
10237 ErrorProducerSide,
10239 UnknownValue(connection_error_type::UnknownValue),
10244}
10245
10246#[doc(hidden)]
10247pub mod connection_error_type {
10248 #[allow(unused_imports)]
10249 use super::*;
10250 #[derive(Clone, Debug, PartialEq)]
10251 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10252}
10253
10254impl ConnectionErrorType {
10255 pub fn value(&self) -> std::option::Option<i32> {
10260 match self {
10261 Self::Unspecified => std::option::Option::Some(0),
10262 Self::ErrorInternal => std::option::Option::Some(1),
10263 Self::ErrorConsumerSide => std::option::Option::Some(2),
10264 Self::ErrorProducerSide => std::option::Option::Some(3),
10265 Self::UnknownValue(u) => u.0.value(),
10266 }
10267 }
10268
10269 pub fn name(&self) -> std::option::Option<&str> {
10274 match self {
10275 Self::Unspecified => std::option::Option::Some("CONNECTION_ERROR_TYPE_UNSPECIFIED"),
10276 Self::ErrorInternal => std::option::Option::Some("ERROR_INTERNAL"),
10277 Self::ErrorConsumerSide => std::option::Option::Some("ERROR_CONSUMER_SIDE"),
10278 Self::ErrorProducerSide => std::option::Option::Some("ERROR_PRODUCER_SIDE"),
10279 Self::UnknownValue(u) => u.0.name(),
10280 }
10281 }
10282}
10283
10284impl std::default::Default for ConnectionErrorType {
10285 fn default() -> Self {
10286 use std::convert::From;
10287 Self::from(0)
10288 }
10289}
10290
10291impl std::fmt::Display for ConnectionErrorType {
10292 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10293 wkt::internal::display_enum(f, self.name(), self.value())
10294 }
10295}
10296
10297impl std::convert::From<i32> for ConnectionErrorType {
10298 fn from(value: i32) -> Self {
10299 match value {
10300 0 => Self::Unspecified,
10301 1 => Self::ErrorInternal,
10302 2 => Self::ErrorConsumerSide,
10303 3 => Self::ErrorProducerSide,
10304 _ => Self::UnknownValue(connection_error_type::UnknownValue(
10305 wkt::internal::UnknownEnumValue::Integer(value),
10306 )),
10307 }
10308 }
10309}
10310
10311impl std::convert::From<&str> for ConnectionErrorType {
10312 fn from(value: &str) -> Self {
10313 use std::string::ToString;
10314 match value {
10315 "CONNECTION_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
10316 "ERROR_INTERNAL" => Self::ErrorInternal,
10317 "ERROR_CONSUMER_SIDE" => Self::ErrorConsumerSide,
10318 "ERROR_PRODUCER_SIDE" => Self::ErrorProducerSide,
10319 _ => Self::UnknownValue(connection_error_type::UnknownValue(
10320 wkt::internal::UnknownEnumValue::String(value.to_string()),
10321 )),
10322 }
10323 }
10324}
10325
10326impl serde::ser::Serialize for ConnectionErrorType {
10327 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10328 where
10329 S: serde::Serializer,
10330 {
10331 match self {
10332 Self::Unspecified => serializer.serialize_i32(0),
10333 Self::ErrorInternal => serializer.serialize_i32(1),
10334 Self::ErrorConsumerSide => serializer.serialize_i32(2),
10335 Self::ErrorProducerSide => serializer.serialize_i32(3),
10336 Self::UnknownValue(u) => u.0.serialize(serializer),
10337 }
10338 }
10339}
10340
10341impl<'de> serde::de::Deserialize<'de> for ConnectionErrorType {
10342 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10343 where
10344 D: serde::Deserializer<'de>,
10345 {
10346 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionErrorType>::new(
10347 ".google.cloud.networkconnectivity.v1.ConnectionErrorType",
10348 ))
10349 }
10350}
10351
10352#[derive(Clone, Debug, PartialEq)]
10368#[non_exhaustive]
10369pub enum IPVersion {
10370 Unspecified,
10373 Ipv4,
10375 Ipv6,
10377 UnknownValue(ip_version::UnknownValue),
10382}
10383
10384#[doc(hidden)]
10385pub mod ip_version {
10386 #[allow(unused_imports)]
10387 use super::*;
10388 #[derive(Clone, Debug, PartialEq)]
10389 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10390}
10391
10392impl IPVersion {
10393 pub fn value(&self) -> std::option::Option<i32> {
10398 match self {
10399 Self::Unspecified => std::option::Option::Some(0),
10400 Self::Ipv4 => std::option::Option::Some(1),
10401 Self::Ipv6 => std::option::Option::Some(2),
10402 Self::UnknownValue(u) => u.0.value(),
10403 }
10404 }
10405
10406 pub fn name(&self) -> std::option::Option<&str> {
10411 match self {
10412 Self::Unspecified => std::option::Option::Some("IP_VERSION_UNSPECIFIED"),
10413 Self::Ipv4 => std::option::Option::Some("IPV4"),
10414 Self::Ipv6 => std::option::Option::Some("IPV6"),
10415 Self::UnknownValue(u) => u.0.name(),
10416 }
10417 }
10418}
10419
10420impl std::default::Default for IPVersion {
10421 fn default() -> Self {
10422 use std::convert::From;
10423 Self::from(0)
10424 }
10425}
10426
10427impl std::fmt::Display for IPVersion {
10428 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10429 wkt::internal::display_enum(f, self.name(), self.value())
10430 }
10431}
10432
10433impl std::convert::From<i32> for IPVersion {
10434 fn from(value: i32) -> Self {
10435 match value {
10436 0 => Self::Unspecified,
10437 1 => Self::Ipv4,
10438 2 => Self::Ipv6,
10439 _ => Self::UnknownValue(ip_version::UnknownValue(
10440 wkt::internal::UnknownEnumValue::Integer(value),
10441 )),
10442 }
10443 }
10444}
10445
10446impl std::convert::From<&str> for IPVersion {
10447 fn from(value: &str) -> Self {
10448 use std::string::ToString;
10449 match value {
10450 "IP_VERSION_UNSPECIFIED" => Self::Unspecified,
10451 "IPV4" => Self::Ipv4,
10452 "IPV6" => Self::Ipv6,
10453 _ => Self::UnknownValue(ip_version::UnknownValue(
10454 wkt::internal::UnknownEnumValue::String(value.to_string()),
10455 )),
10456 }
10457 }
10458}
10459
10460impl serde::ser::Serialize for IPVersion {
10461 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10462 where
10463 S: serde::Serializer,
10464 {
10465 match self {
10466 Self::Unspecified => serializer.serialize_i32(0),
10467 Self::Ipv4 => serializer.serialize_i32(1),
10468 Self::Ipv6 => serializer.serialize_i32(2),
10469 Self::UnknownValue(u) => u.0.serialize(serializer),
10470 }
10471 }
10472}
10473
10474impl<'de> serde::de::Deserialize<'de> for IPVersion {
10475 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10476 where
10477 D: serde::Deserializer<'de>,
10478 {
10479 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IPVersion>::new(
10480 ".google.cloud.networkconnectivity.v1.IPVersion",
10481 ))
10482 }
10483}
10484
10485#[derive(Clone, Debug, PartialEq)]
10501#[non_exhaustive]
10502pub enum LocationFeature {
10503 Unspecified,
10505 SiteToCloudSpokes,
10507 SiteToSiteSpokes,
10509 UnknownValue(location_feature::UnknownValue),
10514}
10515
10516#[doc(hidden)]
10517pub mod location_feature {
10518 #[allow(unused_imports)]
10519 use super::*;
10520 #[derive(Clone, Debug, PartialEq)]
10521 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10522}
10523
10524impl LocationFeature {
10525 pub fn value(&self) -> std::option::Option<i32> {
10530 match self {
10531 Self::Unspecified => std::option::Option::Some(0),
10532 Self::SiteToCloudSpokes => std::option::Option::Some(1),
10533 Self::SiteToSiteSpokes => std::option::Option::Some(2),
10534 Self::UnknownValue(u) => u.0.value(),
10535 }
10536 }
10537
10538 pub fn name(&self) -> std::option::Option<&str> {
10543 match self {
10544 Self::Unspecified => std::option::Option::Some("LOCATION_FEATURE_UNSPECIFIED"),
10545 Self::SiteToCloudSpokes => std::option::Option::Some("SITE_TO_CLOUD_SPOKES"),
10546 Self::SiteToSiteSpokes => std::option::Option::Some("SITE_TO_SITE_SPOKES"),
10547 Self::UnknownValue(u) => u.0.name(),
10548 }
10549 }
10550}
10551
10552impl std::default::Default for LocationFeature {
10553 fn default() -> Self {
10554 use std::convert::From;
10555 Self::from(0)
10556 }
10557}
10558
10559impl std::fmt::Display for LocationFeature {
10560 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10561 wkt::internal::display_enum(f, self.name(), self.value())
10562 }
10563}
10564
10565impl std::convert::From<i32> for LocationFeature {
10566 fn from(value: i32) -> Self {
10567 match value {
10568 0 => Self::Unspecified,
10569 1 => Self::SiteToCloudSpokes,
10570 2 => Self::SiteToSiteSpokes,
10571 _ => Self::UnknownValue(location_feature::UnknownValue(
10572 wkt::internal::UnknownEnumValue::Integer(value),
10573 )),
10574 }
10575 }
10576}
10577
10578impl std::convert::From<&str> for LocationFeature {
10579 fn from(value: &str) -> Self {
10580 use std::string::ToString;
10581 match value {
10582 "LOCATION_FEATURE_UNSPECIFIED" => Self::Unspecified,
10583 "SITE_TO_CLOUD_SPOKES" => Self::SiteToCloudSpokes,
10584 "SITE_TO_SITE_SPOKES" => Self::SiteToSiteSpokes,
10585 _ => Self::UnknownValue(location_feature::UnknownValue(
10586 wkt::internal::UnknownEnumValue::String(value.to_string()),
10587 )),
10588 }
10589 }
10590}
10591
10592impl serde::ser::Serialize for LocationFeature {
10593 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10594 where
10595 S: serde::Serializer,
10596 {
10597 match self {
10598 Self::Unspecified => serializer.serialize_i32(0),
10599 Self::SiteToCloudSpokes => serializer.serialize_i32(1),
10600 Self::SiteToSiteSpokes => serializer.serialize_i32(2),
10601 Self::UnknownValue(u) => u.0.serialize(serializer),
10602 }
10603 }
10604}
10605
10606impl<'de> serde::de::Deserialize<'de> for LocationFeature {
10607 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10608 where
10609 D: serde::Deserializer<'de>,
10610 {
10611 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocationFeature>::new(
10612 ".google.cloud.networkconnectivity.v1.LocationFeature",
10613 ))
10614 }
10615}
10616
10617#[derive(Clone, Debug, PartialEq)]
10633#[non_exhaustive]
10634pub enum RouteType {
10635 Unspecified,
10637 VpcPrimarySubnet,
10640 VpcSecondarySubnet,
10643 DynamicRoute,
10647 UnknownValue(route_type::UnknownValue),
10652}
10653
10654#[doc(hidden)]
10655pub mod route_type {
10656 #[allow(unused_imports)]
10657 use super::*;
10658 #[derive(Clone, Debug, PartialEq)]
10659 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10660}
10661
10662impl RouteType {
10663 pub fn value(&self) -> std::option::Option<i32> {
10668 match self {
10669 Self::Unspecified => std::option::Option::Some(0),
10670 Self::VpcPrimarySubnet => std::option::Option::Some(1),
10671 Self::VpcSecondarySubnet => std::option::Option::Some(2),
10672 Self::DynamicRoute => std::option::Option::Some(3),
10673 Self::UnknownValue(u) => u.0.value(),
10674 }
10675 }
10676
10677 pub fn name(&self) -> std::option::Option<&str> {
10682 match self {
10683 Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
10684 Self::VpcPrimarySubnet => std::option::Option::Some("VPC_PRIMARY_SUBNET"),
10685 Self::VpcSecondarySubnet => std::option::Option::Some("VPC_SECONDARY_SUBNET"),
10686 Self::DynamicRoute => std::option::Option::Some("DYNAMIC_ROUTE"),
10687 Self::UnknownValue(u) => u.0.name(),
10688 }
10689 }
10690}
10691
10692impl std::default::Default for RouteType {
10693 fn default() -> Self {
10694 use std::convert::From;
10695 Self::from(0)
10696 }
10697}
10698
10699impl std::fmt::Display for RouteType {
10700 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10701 wkt::internal::display_enum(f, self.name(), self.value())
10702 }
10703}
10704
10705impl std::convert::From<i32> for RouteType {
10706 fn from(value: i32) -> Self {
10707 match value {
10708 0 => Self::Unspecified,
10709 1 => Self::VpcPrimarySubnet,
10710 2 => Self::VpcSecondarySubnet,
10711 3 => Self::DynamicRoute,
10712 _ => Self::UnknownValue(route_type::UnknownValue(
10713 wkt::internal::UnknownEnumValue::Integer(value),
10714 )),
10715 }
10716 }
10717}
10718
10719impl std::convert::From<&str> for RouteType {
10720 fn from(value: &str) -> Self {
10721 use std::string::ToString;
10722 match value {
10723 "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
10724 "VPC_PRIMARY_SUBNET" => Self::VpcPrimarySubnet,
10725 "VPC_SECONDARY_SUBNET" => Self::VpcSecondarySubnet,
10726 "DYNAMIC_ROUTE" => Self::DynamicRoute,
10727 _ => Self::UnknownValue(route_type::UnknownValue(
10728 wkt::internal::UnknownEnumValue::String(value.to_string()),
10729 )),
10730 }
10731 }
10732}
10733
10734impl serde::ser::Serialize for RouteType {
10735 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10736 where
10737 S: serde::Serializer,
10738 {
10739 match self {
10740 Self::Unspecified => serializer.serialize_i32(0),
10741 Self::VpcPrimarySubnet => serializer.serialize_i32(1),
10742 Self::VpcSecondarySubnet => serializer.serialize_i32(2),
10743 Self::DynamicRoute => serializer.serialize_i32(3),
10744 Self::UnknownValue(u) => u.0.serialize(serializer),
10745 }
10746 }
10747}
10748
10749impl<'de> serde::de::Deserialize<'de> for RouteType {
10750 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10751 where
10752 D: serde::Deserializer<'de>,
10753 {
10754 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
10755 ".google.cloud.networkconnectivity.v1.RouteType",
10756 ))
10757 }
10758}
10759
10760#[derive(Clone, Debug, PartialEq)]
10777#[non_exhaustive]
10778pub enum State {
10779 Unspecified,
10781 Creating,
10783 Active,
10785 Deleting,
10787 Accepting,
10789 Rejecting,
10791 Updating,
10793 Inactive,
10795 Obsolete,
10798 Failed,
10802 UnknownValue(state::UnknownValue),
10807}
10808
10809#[doc(hidden)]
10810pub mod state {
10811 #[allow(unused_imports)]
10812 use super::*;
10813 #[derive(Clone, Debug, PartialEq)]
10814 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10815}
10816
10817impl State {
10818 pub fn value(&self) -> std::option::Option<i32> {
10823 match self {
10824 Self::Unspecified => std::option::Option::Some(0),
10825 Self::Creating => std::option::Option::Some(1),
10826 Self::Active => std::option::Option::Some(2),
10827 Self::Deleting => std::option::Option::Some(3),
10828 Self::Accepting => std::option::Option::Some(8),
10829 Self::Rejecting => std::option::Option::Some(9),
10830 Self::Updating => std::option::Option::Some(6),
10831 Self::Inactive => std::option::Option::Some(7),
10832 Self::Obsolete => std::option::Option::Some(10),
10833 Self::Failed => std::option::Option::Some(11),
10834 Self::UnknownValue(u) => u.0.value(),
10835 }
10836 }
10837
10838 pub fn name(&self) -> std::option::Option<&str> {
10843 match self {
10844 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10845 Self::Creating => std::option::Option::Some("CREATING"),
10846 Self::Active => std::option::Option::Some("ACTIVE"),
10847 Self::Deleting => std::option::Option::Some("DELETING"),
10848 Self::Accepting => std::option::Option::Some("ACCEPTING"),
10849 Self::Rejecting => std::option::Option::Some("REJECTING"),
10850 Self::Updating => std::option::Option::Some("UPDATING"),
10851 Self::Inactive => std::option::Option::Some("INACTIVE"),
10852 Self::Obsolete => std::option::Option::Some("OBSOLETE"),
10853 Self::Failed => std::option::Option::Some("FAILED"),
10854 Self::UnknownValue(u) => u.0.name(),
10855 }
10856 }
10857}
10858
10859impl std::default::Default for State {
10860 fn default() -> Self {
10861 use std::convert::From;
10862 Self::from(0)
10863 }
10864}
10865
10866impl std::fmt::Display for State {
10867 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10868 wkt::internal::display_enum(f, self.name(), self.value())
10869 }
10870}
10871
10872impl std::convert::From<i32> for State {
10873 fn from(value: i32) -> Self {
10874 match value {
10875 0 => Self::Unspecified,
10876 1 => Self::Creating,
10877 2 => Self::Active,
10878 3 => Self::Deleting,
10879 6 => Self::Updating,
10880 7 => Self::Inactive,
10881 8 => Self::Accepting,
10882 9 => Self::Rejecting,
10883 10 => Self::Obsolete,
10884 11 => Self::Failed,
10885 _ => Self::UnknownValue(state::UnknownValue(
10886 wkt::internal::UnknownEnumValue::Integer(value),
10887 )),
10888 }
10889 }
10890}
10891
10892impl std::convert::From<&str> for State {
10893 fn from(value: &str) -> Self {
10894 use std::string::ToString;
10895 match value {
10896 "STATE_UNSPECIFIED" => Self::Unspecified,
10897 "CREATING" => Self::Creating,
10898 "ACTIVE" => Self::Active,
10899 "DELETING" => Self::Deleting,
10900 "ACCEPTING" => Self::Accepting,
10901 "REJECTING" => Self::Rejecting,
10902 "UPDATING" => Self::Updating,
10903 "INACTIVE" => Self::Inactive,
10904 "OBSOLETE" => Self::Obsolete,
10905 "FAILED" => Self::Failed,
10906 _ => Self::UnknownValue(state::UnknownValue(
10907 wkt::internal::UnknownEnumValue::String(value.to_string()),
10908 )),
10909 }
10910 }
10911}
10912
10913impl serde::ser::Serialize for State {
10914 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10915 where
10916 S: serde::Serializer,
10917 {
10918 match self {
10919 Self::Unspecified => serializer.serialize_i32(0),
10920 Self::Creating => serializer.serialize_i32(1),
10921 Self::Active => serializer.serialize_i32(2),
10922 Self::Deleting => serializer.serialize_i32(3),
10923 Self::Accepting => serializer.serialize_i32(8),
10924 Self::Rejecting => serializer.serialize_i32(9),
10925 Self::Updating => serializer.serialize_i32(6),
10926 Self::Inactive => serializer.serialize_i32(7),
10927 Self::Obsolete => serializer.serialize_i32(10),
10928 Self::Failed => serializer.serialize_i32(11),
10929 Self::UnknownValue(u) => u.0.serialize(serializer),
10930 }
10931 }
10932}
10933
10934impl<'de> serde::de::Deserialize<'de> for State {
10935 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10936 where
10937 D: serde::Deserializer<'de>,
10938 {
10939 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10940 ".google.cloud.networkconnectivity.v1.State",
10941 ))
10942 }
10943}
10944
10945#[derive(Clone, Debug, PartialEq)]
10962#[non_exhaustive]
10963pub enum SpokeType {
10964 Unspecified,
10966 VpnTunnel,
10968 InterconnectAttachment,
10970 RouterAppliance,
10972 VpcNetwork,
10974 ProducerVpcNetwork,
10976 UnknownValue(spoke_type::UnknownValue),
10981}
10982
10983#[doc(hidden)]
10984pub mod spoke_type {
10985 #[allow(unused_imports)]
10986 use super::*;
10987 #[derive(Clone, Debug, PartialEq)]
10988 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10989}
10990
10991impl SpokeType {
10992 pub fn value(&self) -> std::option::Option<i32> {
10997 match self {
10998 Self::Unspecified => std::option::Option::Some(0),
10999 Self::VpnTunnel => std::option::Option::Some(1),
11000 Self::InterconnectAttachment => std::option::Option::Some(2),
11001 Self::RouterAppliance => std::option::Option::Some(3),
11002 Self::VpcNetwork => std::option::Option::Some(4),
11003 Self::ProducerVpcNetwork => std::option::Option::Some(7),
11004 Self::UnknownValue(u) => u.0.value(),
11005 }
11006 }
11007
11008 pub fn name(&self) -> std::option::Option<&str> {
11013 match self {
11014 Self::Unspecified => std::option::Option::Some("SPOKE_TYPE_UNSPECIFIED"),
11015 Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
11016 Self::InterconnectAttachment => std::option::Option::Some("INTERCONNECT_ATTACHMENT"),
11017 Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
11018 Self::VpcNetwork => std::option::Option::Some("VPC_NETWORK"),
11019 Self::ProducerVpcNetwork => std::option::Option::Some("PRODUCER_VPC_NETWORK"),
11020 Self::UnknownValue(u) => u.0.name(),
11021 }
11022 }
11023}
11024
11025impl std::default::Default for SpokeType {
11026 fn default() -> Self {
11027 use std::convert::From;
11028 Self::from(0)
11029 }
11030}
11031
11032impl std::fmt::Display for SpokeType {
11033 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11034 wkt::internal::display_enum(f, self.name(), self.value())
11035 }
11036}
11037
11038impl std::convert::From<i32> for SpokeType {
11039 fn from(value: i32) -> Self {
11040 match value {
11041 0 => Self::Unspecified,
11042 1 => Self::VpnTunnel,
11043 2 => Self::InterconnectAttachment,
11044 3 => Self::RouterAppliance,
11045 4 => Self::VpcNetwork,
11046 7 => Self::ProducerVpcNetwork,
11047 _ => Self::UnknownValue(spoke_type::UnknownValue(
11048 wkt::internal::UnknownEnumValue::Integer(value),
11049 )),
11050 }
11051 }
11052}
11053
11054impl std::convert::From<&str> for SpokeType {
11055 fn from(value: &str) -> Self {
11056 use std::string::ToString;
11057 match value {
11058 "SPOKE_TYPE_UNSPECIFIED" => Self::Unspecified,
11059 "VPN_TUNNEL" => Self::VpnTunnel,
11060 "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
11061 "ROUTER_APPLIANCE" => Self::RouterAppliance,
11062 "VPC_NETWORK" => Self::VpcNetwork,
11063 "PRODUCER_VPC_NETWORK" => Self::ProducerVpcNetwork,
11064 _ => Self::UnknownValue(spoke_type::UnknownValue(
11065 wkt::internal::UnknownEnumValue::String(value.to_string()),
11066 )),
11067 }
11068 }
11069}
11070
11071impl serde::ser::Serialize for SpokeType {
11072 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11073 where
11074 S: serde::Serializer,
11075 {
11076 match self {
11077 Self::Unspecified => serializer.serialize_i32(0),
11078 Self::VpnTunnel => serializer.serialize_i32(1),
11079 Self::InterconnectAttachment => serializer.serialize_i32(2),
11080 Self::RouterAppliance => serializer.serialize_i32(3),
11081 Self::VpcNetwork => serializer.serialize_i32(4),
11082 Self::ProducerVpcNetwork => serializer.serialize_i32(7),
11083 Self::UnknownValue(u) => u.0.serialize(serializer),
11084 }
11085 }
11086}
11087
11088impl<'de> serde::de::Deserialize<'de> for SpokeType {
11089 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11090 where
11091 D: serde::Deserializer<'de>,
11092 {
11093 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeType>::new(
11094 ".google.cloud.networkconnectivity.v1.SpokeType",
11095 ))
11096 }
11097}
11098
11099#[derive(Clone, Debug, PartialEq)]
11115#[non_exhaustive]
11116pub enum PolicyMode {
11117 Unspecified,
11120 Preset,
11122 UnknownValue(policy_mode::UnknownValue),
11127}
11128
11129#[doc(hidden)]
11130pub mod policy_mode {
11131 #[allow(unused_imports)]
11132 use super::*;
11133 #[derive(Clone, Debug, PartialEq)]
11134 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11135}
11136
11137impl PolicyMode {
11138 pub fn value(&self) -> std::option::Option<i32> {
11143 match self {
11144 Self::Unspecified => std::option::Option::Some(0),
11145 Self::Preset => std::option::Option::Some(1),
11146 Self::UnknownValue(u) => u.0.value(),
11147 }
11148 }
11149
11150 pub fn name(&self) -> std::option::Option<&str> {
11155 match self {
11156 Self::Unspecified => std::option::Option::Some("POLICY_MODE_UNSPECIFIED"),
11157 Self::Preset => std::option::Option::Some("PRESET"),
11158 Self::UnknownValue(u) => u.0.name(),
11159 }
11160 }
11161}
11162
11163impl std::default::Default for PolicyMode {
11164 fn default() -> Self {
11165 use std::convert::From;
11166 Self::from(0)
11167 }
11168}
11169
11170impl std::fmt::Display for PolicyMode {
11171 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11172 wkt::internal::display_enum(f, self.name(), self.value())
11173 }
11174}
11175
11176impl std::convert::From<i32> for PolicyMode {
11177 fn from(value: i32) -> Self {
11178 match value {
11179 0 => Self::Unspecified,
11180 1 => Self::Preset,
11181 _ => Self::UnknownValue(policy_mode::UnknownValue(
11182 wkt::internal::UnknownEnumValue::Integer(value),
11183 )),
11184 }
11185 }
11186}
11187
11188impl std::convert::From<&str> for PolicyMode {
11189 fn from(value: &str) -> Self {
11190 use std::string::ToString;
11191 match value {
11192 "POLICY_MODE_UNSPECIFIED" => Self::Unspecified,
11193 "PRESET" => Self::Preset,
11194 _ => Self::UnknownValue(policy_mode::UnknownValue(
11195 wkt::internal::UnknownEnumValue::String(value.to_string()),
11196 )),
11197 }
11198 }
11199}
11200
11201impl serde::ser::Serialize for PolicyMode {
11202 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11203 where
11204 S: serde::Serializer,
11205 {
11206 match self {
11207 Self::Unspecified => serializer.serialize_i32(0),
11208 Self::Preset => serializer.serialize_i32(1),
11209 Self::UnknownValue(u) => u.0.serialize(serializer),
11210 }
11211 }
11212}
11213
11214impl<'de> serde::de::Deserialize<'de> for PolicyMode {
11215 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11216 where
11217 D: serde::Deserializer<'de>,
11218 {
11219 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyMode>::new(
11220 ".google.cloud.networkconnectivity.v1.PolicyMode",
11221 ))
11222 }
11223}
11224
11225#[derive(Clone, Debug, PartialEq)]
11241#[non_exhaustive]
11242pub enum PresetTopology {
11243 Unspecified,
11246 Mesh,
11249 Star,
11253 UnknownValue(preset_topology::UnknownValue),
11258}
11259
11260#[doc(hidden)]
11261pub mod preset_topology {
11262 #[allow(unused_imports)]
11263 use super::*;
11264 #[derive(Clone, Debug, PartialEq)]
11265 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11266}
11267
11268impl PresetTopology {
11269 pub fn value(&self) -> std::option::Option<i32> {
11274 match self {
11275 Self::Unspecified => std::option::Option::Some(0),
11276 Self::Mesh => std::option::Option::Some(2),
11277 Self::Star => std::option::Option::Some(3),
11278 Self::UnknownValue(u) => u.0.value(),
11279 }
11280 }
11281
11282 pub fn name(&self) -> std::option::Option<&str> {
11287 match self {
11288 Self::Unspecified => std::option::Option::Some("PRESET_TOPOLOGY_UNSPECIFIED"),
11289 Self::Mesh => std::option::Option::Some("MESH"),
11290 Self::Star => std::option::Option::Some("STAR"),
11291 Self::UnknownValue(u) => u.0.name(),
11292 }
11293 }
11294}
11295
11296impl std::default::Default for PresetTopology {
11297 fn default() -> Self {
11298 use std::convert::From;
11299 Self::from(0)
11300 }
11301}
11302
11303impl std::fmt::Display for PresetTopology {
11304 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11305 wkt::internal::display_enum(f, self.name(), self.value())
11306 }
11307}
11308
11309impl std::convert::From<i32> for PresetTopology {
11310 fn from(value: i32) -> Self {
11311 match value {
11312 0 => Self::Unspecified,
11313 2 => Self::Mesh,
11314 3 => Self::Star,
11315 _ => Self::UnknownValue(preset_topology::UnknownValue(
11316 wkt::internal::UnknownEnumValue::Integer(value),
11317 )),
11318 }
11319 }
11320}
11321
11322impl std::convert::From<&str> for PresetTopology {
11323 fn from(value: &str) -> Self {
11324 use std::string::ToString;
11325 match value {
11326 "PRESET_TOPOLOGY_UNSPECIFIED" => Self::Unspecified,
11327 "MESH" => Self::Mesh,
11328 "STAR" => Self::Star,
11329 _ => Self::UnknownValue(preset_topology::UnknownValue(
11330 wkt::internal::UnknownEnumValue::String(value.to_string()),
11331 )),
11332 }
11333 }
11334}
11335
11336impl serde::ser::Serialize for PresetTopology {
11337 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11338 where
11339 S: serde::Serializer,
11340 {
11341 match self {
11342 Self::Unspecified => serializer.serialize_i32(0),
11343 Self::Mesh => serializer.serialize_i32(2),
11344 Self::Star => serializer.serialize_i32(3),
11345 Self::UnknownValue(u) => u.0.serialize(serializer),
11346 }
11347 }
11348}
11349
11350impl<'de> serde::de::Deserialize<'de> for PresetTopology {
11351 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11352 where
11353 D: serde::Deserializer<'de>,
11354 {
11355 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PresetTopology>::new(
11356 ".google.cloud.networkconnectivity.v1.PresetTopology",
11357 ))
11358 }
11359}