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
38mod debug;
39mod deserialize;
40mod serialize;
41
42#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct OperationMetadata {
46 pub create_time: std::option::Option<wkt::Timestamp>,
48
49 pub end_time: std::option::Option<wkt::Timestamp>,
51
52 pub target: std::string::String,
54
55 pub verb: std::string::String,
57
58 pub status_message: std::string::String,
60
61 pub requested_cancellation: bool,
71
72 pub api_version: std::string::String,
74
75 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
76}
77
78impl OperationMetadata {
79 pub fn new() -> Self {
80 std::default::Default::default()
81 }
82
83 pub fn set_create_time<T>(mut self, v: T) -> Self
85 where
86 T: std::convert::Into<wkt::Timestamp>,
87 {
88 self.create_time = std::option::Option::Some(v.into());
89 self
90 }
91
92 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
94 where
95 T: std::convert::Into<wkt::Timestamp>,
96 {
97 self.create_time = v.map(|x| x.into());
98 self
99 }
100
101 pub fn set_end_time<T>(mut self, v: T) -> Self
103 where
104 T: std::convert::Into<wkt::Timestamp>,
105 {
106 self.end_time = std::option::Option::Some(v.into());
107 self
108 }
109
110 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
112 where
113 T: std::convert::Into<wkt::Timestamp>,
114 {
115 self.end_time = v.map(|x| x.into());
116 self
117 }
118
119 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
121 self.target = v.into();
122 self
123 }
124
125 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
127 self.verb = v.into();
128 self
129 }
130
131 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
133 self.status_message = v.into();
134 self
135 }
136
137 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
139 self.requested_cancellation = v.into();
140 self
141 }
142
143 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
145 self.api_version = v.into();
146 self
147 }
148}
149
150impl wkt::message::Message for OperationMetadata {
151 fn typename() -> &'static str {
152 "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata"
153 }
154}
155
156#[derive(Clone, Default, PartialEq)]
158#[non_exhaustive]
159pub struct ServiceConnectionMap {
160 pub name: std::string::String,
165
166 pub create_time: std::option::Option<wkt::Timestamp>,
168
169 pub update_time: std::option::Option<wkt::Timestamp>,
171
172 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
174
175 pub description: std::string::String,
177
178 pub service_class: std::string::String,
183
184 pub service_class_uri: std::string::String,
186
187 pub infrastructure: crate::model::Infrastructure,
190
191 pub producer_psc_configs:
193 std::vec::Vec<crate::model::service_connection_map::ProducerPscConfig>,
194
195 pub consumer_psc_configs:
197 std::vec::Vec<crate::model::service_connection_map::ConsumerPscConfig>,
198
199 pub consumer_psc_connections:
201 std::vec::Vec<crate::model::service_connection_map::ConsumerPscConnection>,
202
203 pub token: std::string::String,
206
207 pub etag: std::option::Option<std::string::String>,
211
212 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
213}
214
215impl ServiceConnectionMap {
216 pub fn new() -> Self {
217 std::default::Default::default()
218 }
219
220 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
222 self.name = v.into();
223 self
224 }
225
226 pub fn set_create_time<T>(mut self, v: T) -> Self
228 where
229 T: std::convert::Into<wkt::Timestamp>,
230 {
231 self.create_time = std::option::Option::Some(v.into());
232 self
233 }
234
235 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
237 where
238 T: std::convert::Into<wkt::Timestamp>,
239 {
240 self.create_time = v.map(|x| x.into());
241 self
242 }
243
244 pub fn set_update_time<T>(mut self, v: T) -> Self
246 where
247 T: std::convert::Into<wkt::Timestamp>,
248 {
249 self.update_time = std::option::Option::Some(v.into());
250 self
251 }
252
253 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
255 where
256 T: std::convert::Into<wkt::Timestamp>,
257 {
258 self.update_time = v.map(|x| x.into());
259 self
260 }
261
262 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
264 where
265 T: std::iter::IntoIterator<Item = (K, V)>,
266 K: std::convert::Into<std::string::String>,
267 V: std::convert::Into<std::string::String>,
268 {
269 use std::iter::Iterator;
270 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
271 self
272 }
273
274 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
276 self.description = v.into();
277 self
278 }
279
280 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
282 self.service_class = v.into();
283 self
284 }
285
286 pub fn set_service_class_uri<T: std::convert::Into<std::string::String>>(
288 mut self,
289 v: T,
290 ) -> Self {
291 self.service_class_uri = v.into();
292 self
293 }
294
295 pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
297 mut self,
298 v: T,
299 ) -> Self {
300 self.infrastructure = v.into();
301 self
302 }
303
304 pub fn set_producer_psc_configs<T, V>(mut self, v: T) -> Self
306 where
307 T: std::iter::IntoIterator<Item = V>,
308 V: std::convert::Into<crate::model::service_connection_map::ProducerPscConfig>,
309 {
310 use std::iter::Iterator;
311 self.producer_psc_configs = v.into_iter().map(|i| i.into()).collect();
312 self
313 }
314
315 pub fn set_consumer_psc_configs<T, V>(mut self, v: T) -> Self
317 where
318 T: std::iter::IntoIterator<Item = V>,
319 V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConfig>,
320 {
321 use std::iter::Iterator;
322 self.consumer_psc_configs = v.into_iter().map(|i| i.into()).collect();
323 self
324 }
325
326 pub fn set_consumer_psc_connections<T, V>(mut self, v: T) -> Self
328 where
329 T: std::iter::IntoIterator<Item = V>,
330 V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConnection>,
331 {
332 use std::iter::Iterator;
333 self.consumer_psc_connections = v.into_iter().map(|i| i.into()).collect();
334 self
335 }
336
337 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
339 self.token = v.into();
340 self
341 }
342
343 pub fn set_etag<T>(mut self, v: T) -> Self
345 where
346 T: std::convert::Into<std::string::String>,
347 {
348 self.etag = std::option::Option::Some(v.into());
349 self
350 }
351
352 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
354 where
355 T: std::convert::Into<std::string::String>,
356 {
357 self.etag = v.map(|x| x.into());
358 self
359 }
360}
361
362impl wkt::message::Message for ServiceConnectionMap {
363 fn typename() -> &'static str {
364 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap"
365 }
366}
367
368pub mod service_connection_map {
370 #[allow(unused_imports)]
371 use super::*;
372
373 #[derive(Clone, Default, PartialEq)]
375 #[non_exhaustive]
376 pub struct ProducerPscConfig {
377 pub service_attachment_uri: std::string::String,
381
382 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
383 }
384
385 impl ProducerPscConfig {
386 pub fn new() -> Self {
387 std::default::Default::default()
388 }
389
390 pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
392 mut self,
393 v: T,
394 ) -> Self {
395 self.service_attachment_uri = v.into();
396 self
397 }
398 }
399
400 impl wkt::message::Message for ProducerPscConfig {
401 fn typename() -> &'static str {
402 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ProducerPscConfig"
403 }
404 }
405
406 #[derive(Clone, Default, PartialEq)]
408 #[non_exhaustive]
409 pub struct ConsumerPscConfig {
410 pub project: std::string::String,
412
413 pub network: std::string::String,
419
420 pub disable_global_access: bool,
423
424 pub state: crate::model::service_connection_map::consumer_psc_config::State,
427
428 #[deprecated]
431 pub producer_instance_id: std::string::String,
432
433 pub service_attachment_ip_address_map:
437 std::collections::HashMap<std::string::String, std::string::String>,
438
439 pub consumer_instance_project: std::string::String,
446
447 pub producer_instance_metadata:
449 std::collections::HashMap<std::string::String, std::string::String>,
450
451 pub ip_version: std::option::Option<crate::model::IPVersion>,
453
454 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
455 }
456
457 impl ConsumerPscConfig {
458 pub fn new() -> Self {
459 std::default::Default::default()
460 }
461
462 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
464 self.project = v.into();
465 self
466 }
467
468 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
470 self.network = v.into();
471 self
472 }
473
474 pub fn set_disable_global_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
476 self.disable_global_access = v.into();
477 self
478 }
479
480 pub fn set_state<
482 T: std::convert::Into<crate::model::service_connection_map::consumer_psc_config::State>,
483 >(
484 mut self,
485 v: T,
486 ) -> Self {
487 self.state = v.into();
488 self
489 }
490
491 #[deprecated]
493 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
494 mut self,
495 v: T,
496 ) -> Self {
497 self.producer_instance_id = v.into();
498 self
499 }
500
501 pub fn set_service_attachment_ip_address_map<T, K, V>(mut self, v: T) -> Self
503 where
504 T: std::iter::IntoIterator<Item = (K, V)>,
505 K: std::convert::Into<std::string::String>,
506 V: std::convert::Into<std::string::String>,
507 {
508 use std::iter::Iterator;
509 self.service_attachment_ip_address_map =
510 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
511 self
512 }
513
514 pub fn set_consumer_instance_project<T: std::convert::Into<std::string::String>>(
516 mut self,
517 v: T,
518 ) -> Self {
519 self.consumer_instance_project = v.into();
520 self
521 }
522
523 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
525 where
526 T: std::iter::IntoIterator<Item = (K, V)>,
527 K: std::convert::Into<std::string::String>,
528 V: std::convert::Into<std::string::String>,
529 {
530 use std::iter::Iterator;
531 self.producer_instance_metadata =
532 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
533 self
534 }
535
536 pub fn set_ip_version<T>(mut self, v: T) -> Self
538 where
539 T: std::convert::Into<crate::model::IPVersion>,
540 {
541 self.ip_version = std::option::Option::Some(v.into());
542 self
543 }
544
545 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
547 where
548 T: std::convert::Into<crate::model::IPVersion>,
549 {
550 self.ip_version = v.map(|x| x.into());
551 self
552 }
553 }
554
555 impl wkt::message::Message for ConsumerPscConfig {
556 fn typename() -> &'static str {
557 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig"
558 }
559 }
560
561 pub mod consumer_psc_config {
563 #[allow(unused_imports)]
564 use super::*;
565
566 #[derive(Clone, Debug, PartialEq)]
582 #[non_exhaustive]
583 pub enum State {
584 Unspecified,
586 Valid,
590 ConnectionPolicyMissing,
593 PolicyLimitReached,
596 ConsumerInstanceProjectNotAllowlisted,
600 UnknownValue(state::UnknownValue),
605 }
606
607 #[doc(hidden)]
608 pub mod state {
609 #[allow(unused_imports)]
610 use super::*;
611 #[derive(Clone, Debug, PartialEq)]
612 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
613 }
614
615 impl State {
616 pub fn value(&self) -> std::option::Option<i32> {
621 match self {
622 Self::Unspecified => std::option::Option::Some(0),
623 Self::Valid => std::option::Option::Some(1),
624 Self::ConnectionPolicyMissing => std::option::Option::Some(2),
625 Self::PolicyLimitReached => std::option::Option::Some(3),
626 Self::ConsumerInstanceProjectNotAllowlisted => std::option::Option::Some(4),
627 Self::UnknownValue(u) => u.0.value(),
628 }
629 }
630
631 pub fn name(&self) -> std::option::Option<&str> {
636 match self {
637 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
638 Self::Valid => std::option::Option::Some("VALID"),
639 Self::ConnectionPolicyMissing => {
640 std::option::Option::Some("CONNECTION_POLICY_MISSING")
641 }
642 Self::PolicyLimitReached => std::option::Option::Some("POLICY_LIMIT_REACHED"),
643 Self::ConsumerInstanceProjectNotAllowlisted => {
644 std::option::Option::Some("CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED")
645 }
646 Self::UnknownValue(u) => u.0.name(),
647 }
648 }
649 }
650
651 impl std::default::Default for State {
652 fn default() -> Self {
653 use std::convert::From;
654 Self::from(0)
655 }
656 }
657
658 impl std::fmt::Display for State {
659 fn fmt(
660 &self,
661 f: &mut std::fmt::Formatter<'_>,
662 ) -> std::result::Result<(), std::fmt::Error> {
663 wkt::internal::display_enum(f, self.name(), self.value())
664 }
665 }
666
667 impl std::convert::From<i32> for State {
668 fn from(value: i32) -> Self {
669 match value {
670 0 => Self::Unspecified,
671 1 => Self::Valid,
672 2 => Self::ConnectionPolicyMissing,
673 3 => Self::PolicyLimitReached,
674 4 => Self::ConsumerInstanceProjectNotAllowlisted,
675 _ => Self::UnknownValue(state::UnknownValue(
676 wkt::internal::UnknownEnumValue::Integer(value),
677 )),
678 }
679 }
680 }
681
682 impl std::convert::From<&str> for State {
683 fn from(value: &str) -> Self {
684 use std::string::ToString;
685 match value {
686 "STATE_UNSPECIFIED" => Self::Unspecified,
687 "VALID" => Self::Valid,
688 "CONNECTION_POLICY_MISSING" => Self::ConnectionPolicyMissing,
689 "POLICY_LIMIT_REACHED" => Self::PolicyLimitReached,
690 "CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED" => {
691 Self::ConsumerInstanceProjectNotAllowlisted
692 }
693 _ => Self::UnknownValue(state::UnknownValue(
694 wkt::internal::UnknownEnumValue::String(value.to_string()),
695 )),
696 }
697 }
698 }
699
700 impl serde::ser::Serialize for State {
701 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
702 where
703 S: serde::Serializer,
704 {
705 match self {
706 Self::Unspecified => serializer.serialize_i32(0),
707 Self::Valid => serializer.serialize_i32(1),
708 Self::ConnectionPolicyMissing => serializer.serialize_i32(2),
709 Self::PolicyLimitReached => serializer.serialize_i32(3),
710 Self::ConsumerInstanceProjectNotAllowlisted => serializer.serialize_i32(4),
711 Self::UnknownValue(u) => u.0.serialize(serializer),
712 }
713 }
714 }
715
716 impl<'de> serde::de::Deserialize<'de> for State {
717 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
718 where
719 D: serde::Deserializer<'de>,
720 {
721 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
722 ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig.State"))
723 }
724 }
725 }
726
727 #[derive(Clone, Default, PartialEq)]
729 #[non_exhaustive]
730 pub struct ConsumerPscConnection {
731 pub service_attachment_uri: std::string::String,
734
735 pub state: crate::model::service_connection_map::consumer_psc_connection::State,
737
738 pub project: std::string::String,
741
742 pub network: std::string::String,
746
747 pub psc_connection_id: std::string::String,
750
751 pub ip: std::string::String,
755
756 #[deprecated]
759 pub error_type: crate::model::ConnectionErrorType,
760
761 #[deprecated]
763 pub error: std::option::Option<rpc::model::Status>,
764
765 pub gce_operation: std::string::String,
767
768 pub forwarding_rule: std::string::String,
772
773 pub error_info: std::option::Option<rpc::model::ErrorInfo>,
776
777 pub selected_subnetwork: std::string::String,
780
781 #[deprecated]
784 pub producer_instance_id: std::string::String,
785
786 pub producer_instance_metadata:
788 std::collections::HashMap<std::string::String, std::string::String>,
789
790 pub ip_version: std::option::Option<crate::model::IPVersion>,
792
793 pub(crate) _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>(mut self, v: T) -> Self
863 where
864 T: std::convert::Into<rpc::model::Status>,
865 {
866 self.error = std::option::Option::Some(v.into());
867 self
868 }
869
870 #[deprecated]
872 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
873 where
874 T: std::convert::Into<rpc::model::Status>,
875 {
876 self.error = v.map(|x| x.into());
877 self
878 }
879
880 pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
882 mut self,
883 v: T,
884 ) -> Self {
885 self.gce_operation = v.into();
886 self
887 }
888
889 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(
891 mut self,
892 v: T,
893 ) -> Self {
894 self.forwarding_rule = v.into();
895 self
896 }
897
898 pub fn set_error_info<T>(mut self, v: T) -> Self
900 where
901 T: std::convert::Into<rpc::model::ErrorInfo>,
902 {
903 self.error_info = std::option::Option::Some(v.into());
904 self
905 }
906
907 pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
909 where
910 T: std::convert::Into<rpc::model::ErrorInfo>,
911 {
912 self.error_info = v.map(|x| x.into());
913 self
914 }
915
916 pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
918 mut self,
919 v: T,
920 ) -> Self {
921 self.selected_subnetwork = v.into();
922 self
923 }
924
925 #[deprecated]
927 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
928 mut self,
929 v: T,
930 ) -> Self {
931 self.producer_instance_id = v.into();
932 self
933 }
934
935 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
937 where
938 T: std::iter::IntoIterator<Item = (K, V)>,
939 K: std::convert::Into<std::string::String>,
940 V: std::convert::Into<std::string::String>,
941 {
942 use std::iter::Iterator;
943 self.producer_instance_metadata =
944 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
945 self
946 }
947
948 pub fn set_ip_version<T>(mut self, v: T) -> Self
950 where
951 T: std::convert::Into<crate::model::IPVersion>,
952 {
953 self.ip_version = std::option::Option::Some(v.into());
954 self
955 }
956
957 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
959 where
960 T: std::convert::Into<crate::model::IPVersion>,
961 {
962 self.ip_version = v.map(|x| x.into());
963 self
964 }
965 }
966
967 impl wkt::message::Message for ConsumerPscConnection {
968 fn typename() -> &'static str {
969 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection"
970 }
971 }
972
973 pub mod consumer_psc_connection {
975 #[allow(unused_imports)]
976 use super::*;
977
978 #[derive(Clone, Debug, PartialEq)]
997 #[non_exhaustive]
998 pub enum State {
999 Unspecified,
1001 Active,
1005 Failed,
1008 Creating,
1010 Deleting,
1012 CreateRepairing,
1014 DeleteRepairing,
1016 UnknownValue(state::UnknownValue),
1021 }
1022
1023 #[doc(hidden)]
1024 pub mod state {
1025 #[allow(unused_imports)]
1026 use super::*;
1027 #[derive(Clone, Debug, PartialEq)]
1028 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1029 }
1030
1031 impl State {
1032 pub fn value(&self) -> std::option::Option<i32> {
1037 match self {
1038 Self::Unspecified => std::option::Option::Some(0),
1039 Self::Active => std::option::Option::Some(1),
1040 Self::Failed => std::option::Option::Some(2),
1041 Self::Creating => std::option::Option::Some(3),
1042 Self::Deleting => std::option::Option::Some(4),
1043 Self::CreateRepairing => std::option::Option::Some(5),
1044 Self::DeleteRepairing => std::option::Option::Some(6),
1045 Self::UnknownValue(u) => u.0.value(),
1046 }
1047 }
1048
1049 pub fn name(&self) -> std::option::Option<&str> {
1054 match self {
1055 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1056 Self::Active => std::option::Option::Some("ACTIVE"),
1057 Self::Failed => std::option::Option::Some("FAILED"),
1058 Self::Creating => std::option::Option::Some("CREATING"),
1059 Self::Deleting => std::option::Option::Some("DELETING"),
1060 Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
1061 Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
1062 Self::UnknownValue(u) => u.0.name(),
1063 }
1064 }
1065 }
1066
1067 impl std::default::Default for State {
1068 fn default() -> Self {
1069 use std::convert::From;
1070 Self::from(0)
1071 }
1072 }
1073
1074 impl std::fmt::Display for State {
1075 fn fmt(
1076 &self,
1077 f: &mut std::fmt::Formatter<'_>,
1078 ) -> std::result::Result<(), std::fmt::Error> {
1079 wkt::internal::display_enum(f, self.name(), self.value())
1080 }
1081 }
1082
1083 impl std::convert::From<i32> for State {
1084 fn from(value: i32) -> Self {
1085 match value {
1086 0 => Self::Unspecified,
1087 1 => Self::Active,
1088 2 => Self::Failed,
1089 3 => Self::Creating,
1090 4 => Self::Deleting,
1091 5 => Self::CreateRepairing,
1092 6 => Self::DeleteRepairing,
1093 _ => Self::UnknownValue(state::UnknownValue(
1094 wkt::internal::UnknownEnumValue::Integer(value),
1095 )),
1096 }
1097 }
1098 }
1099
1100 impl std::convert::From<&str> for State {
1101 fn from(value: &str) -> Self {
1102 use std::string::ToString;
1103 match value {
1104 "STATE_UNSPECIFIED" => Self::Unspecified,
1105 "ACTIVE" => Self::Active,
1106 "FAILED" => Self::Failed,
1107 "CREATING" => Self::Creating,
1108 "DELETING" => Self::Deleting,
1109 "CREATE_REPAIRING" => Self::CreateRepairing,
1110 "DELETE_REPAIRING" => Self::DeleteRepairing,
1111 _ => Self::UnknownValue(state::UnknownValue(
1112 wkt::internal::UnknownEnumValue::String(value.to_string()),
1113 )),
1114 }
1115 }
1116 }
1117
1118 impl serde::ser::Serialize for State {
1119 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1120 where
1121 S: serde::Serializer,
1122 {
1123 match self {
1124 Self::Unspecified => serializer.serialize_i32(0),
1125 Self::Active => serializer.serialize_i32(1),
1126 Self::Failed => serializer.serialize_i32(2),
1127 Self::Creating => serializer.serialize_i32(3),
1128 Self::Deleting => serializer.serialize_i32(4),
1129 Self::CreateRepairing => serializer.serialize_i32(5),
1130 Self::DeleteRepairing => serializer.serialize_i32(6),
1131 Self::UnknownValue(u) => u.0.serialize(serializer),
1132 }
1133 }
1134 }
1135
1136 impl<'de> serde::de::Deserialize<'de> for State {
1137 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1138 where
1139 D: serde::Deserializer<'de>,
1140 {
1141 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1142 ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection.State"))
1143 }
1144 }
1145 }
1146}
1147
1148#[derive(Clone, Default, PartialEq)]
1150#[non_exhaustive]
1151pub struct ListServiceConnectionMapsRequest {
1152 pub parent: std::string::String,
1154
1155 pub page_size: i32,
1157
1158 pub page_token: std::string::String,
1160
1161 pub filter: std::string::String,
1163
1164 pub order_by: std::string::String,
1166
1167 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1168}
1169
1170impl ListServiceConnectionMapsRequest {
1171 pub fn new() -> Self {
1172 std::default::Default::default()
1173 }
1174
1175 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1177 self.parent = v.into();
1178 self
1179 }
1180
1181 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1183 self.page_size = v.into();
1184 self
1185 }
1186
1187 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1189 self.page_token = v.into();
1190 self
1191 }
1192
1193 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1195 self.filter = v.into();
1196 self
1197 }
1198
1199 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1201 self.order_by = v.into();
1202 self
1203 }
1204}
1205
1206impl wkt::message::Message for ListServiceConnectionMapsRequest {
1207 fn typename() -> &'static str {
1208 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsRequest"
1209 }
1210}
1211
1212#[derive(Clone, Default, PartialEq)]
1214#[non_exhaustive]
1215pub struct ListServiceConnectionMapsResponse {
1216 pub service_connection_maps: std::vec::Vec<crate::model::ServiceConnectionMap>,
1218
1219 pub next_page_token: std::string::String,
1222
1223 pub unreachable: std::vec::Vec<std::string::String>,
1225
1226 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1227}
1228
1229impl ListServiceConnectionMapsResponse {
1230 pub fn new() -> Self {
1231 std::default::Default::default()
1232 }
1233
1234 pub fn set_service_connection_maps<T, V>(mut self, v: T) -> Self
1236 where
1237 T: std::iter::IntoIterator<Item = V>,
1238 V: std::convert::Into<crate::model::ServiceConnectionMap>,
1239 {
1240 use std::iter::Iterator;
1241 self.service_connection_maps = v.into_iter().map(|i| i.into()).collect();
1242 self
1243 }
1244
1245 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1247 self.next_page_token = v.into();
1248 self
1249 }
1250
1251 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1253 where
1254 T: std::iter::IntoIterator<Item = V>,
1255 V: std::convert::Into<std::string::String>,
1256 {
1257 use std::iter::Iterator;
1258 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1259 self
1260 }
1261}
1262
1263impl wkt::message::Message for ListServiceConnectionMapsResponse {
1264 fn typename() -> &'static str {
1265 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsResponse"
1266 }
1267}
1268
1269#[doc(hidden)]
1270impl gax::paginator::internal::PageableResponse for ListServiceConnectionMapsResponse {
1271 type PageItem = crate::model::ServiceConnectionMap;
1272
1273 fn items(self) -> std::vec::Vec<Self::PageItem> {
1274 self.service_connection_maps
1275 }
1276
1277 fn next_page_token(&self) -> std::string::String {
1278 use std::clone::Clone;
1279 self.next_page_token.clone()
1280 }
1281}
1282
1283#[derive(Clone, Default, PartialEq)]
1285#[non_exhaustive]
1286pub struct GetServiceConnectionMapRequest {
1287 pub name: std::string::String,
1289
1290 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1291}
1292
1293impl GetServiceConnectionMapRequest {
1294 pub fn new() -> Self {
1295 std::default::Default::default()
1296 }
1297
1298 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1300 self.name = v.into();
1301 self
1302 }
1303}
1304
1305impl wkt::message::Message for GetServiceConnectionMapRequest {
1306 fn typename() -> &'static str {
1307 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionMapRequest"
1308 }
1309}
1310
1311#[derive(Clone, Default, PartialEq)]
1313#[non_exhaustive]
1314pub struct CreateServiceConnectionMapRequest {
1315 pub parent: std::string::String,
1318
1319 pub service_connection_map_id: std::string::String,
1325
1326 pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1328
1329 pub request_id: std::string::String,
1343
1344 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1345}
1346
1347impl CreateServiceConnectionMapRequest {
1348 pub fn new() -> Self {
1349 std::default::Default::default()
1350 }
1351
1352 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1354 self.parent = v.into();
1355 self
1356 }
1357
1358 pub fn set_service_connection_map_id<T: std::convert::Into<std::string::String>>(
1360 mut self,
1361 v: T,
1362 ) -> Self {
1363 self.service_connection_map_id = v.into();
1364 self
1365 }
1366
1367 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
1369 where
1370 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1371 {
1372 self.service_connection_map = std::option::Option::Some(v.into());
1373 self
1374 }
1375
1376 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
1378 where
1379 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1380 {
1381 self.service_connection_map = v.map(|x| x.into());
1382 self
1383 }
1384
1385 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1387 self.request_id = v.into();
1388 self
1389 }
1390}
1391
1392impl wkt::message::Message for CreateServiceConnectionMapRequest {
1393 fn typename() -> &'static str {
1394 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionMapRequest"
1395 }
1396}
1397
1398#[derive(Clone, Default, PartialEq)]
1400#[non_exhaustive]
1401pub struct UpdateServiceConnectionMapRequest {
1402 pub update_mask: std::option::Option<wkt::FieldMask>,
1408
1409 pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1411
1412 pub request_id: std::string::String,
1426
1427 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1428}
1429
1430impl UpdateServiceConnectionMapRequest {
1431 pub fn new() -> Self {
1432 std::default::Default::default()
1433 }
1434
1435 pub fn set_update_mask<T>(mut self, v: T) -> Self
1437 where
1438 T: std::convert::Into<wkt::FieldMask>,
1439 {
1440 self.update_mask = std::option::Option::Some(v.into());
1441 self
1442 }
1443
1444 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1446 where
1447 T: std::convert::Into<wkt::FieldMask>,
1448 {
1449 self.update_mask = v.map(|x| x.into());
1450 self
1451 }
1452
1453 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
1455 where
1456 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1457 {
1458 self.service_connection_map = std::option::Option::Some(v.into());
1459 self
1460 }
1461
1462 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
1464 where
1465 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1466 {
1467 self.service_connection_map = v.map(|x| x.into());
1468 self
1469 }
1470
1471 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1473 self.request_id = v.into();
1474 self
1475 }
1476}
1477
1478impl wkt::message::Message for UpdateServiceConnectionMapRequest {
1479 fn typename() -> &'static str {
1480 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionMapRequest"
1481 }
1482}
1483
1484#[derive(Clone, Default, PartialEq)]
1486#[non_exhaustive]
1487pub struct DeleteServiceConnectionMapRequest {
1488 pub name: std::string::String,
1490
1491 pub request_id: std::string::String,
1505
1506 pub etag: std::option::Option<std::string::String>,
1510
1511 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1512}
1513
1514impl DeleteServiceConnectionMapRequest {
1515 pub fn new() -> Self {
1516 std::default::Default::default()
1517 }
1518
1519 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1521 self.name = v.into();
1522 self
1523 }
1524
1525 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1527 self.request_id = v.into();
1528 self
1529 }
1530
1531 pub fn set_etag<T>(mut self, v: T) -> Self
1533 where
1534 T: std::convert::Into<std::string::String>,
1535 {
1536 self.etag = std::option::Option::Some(v.into());
1537 self
1538 }
1539
1540 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1542 where
1543 T: std::convert::Into<std::string::String>,
1544 {
1545 self.etag = v.map(|x| x.into());
1546 self
1547 }
1548}
1549
1550impl wkt::message::Message for DeleteServiceConnectionMapRequest {
1551 fn typename() -> &'static str {
1552 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionMapRequest"
1553 }
1554}
1555
1556#[derive(Clone, Default, PartialEq)]
1558#[non_exhaustive]
1559pub struct ServiceConnectionPolicy {
1560 pub name: std::string::String,
1565
1566 pub create_time: std::option::Option<wkt::Timestamp>,
1568
1569 pub update_time: std::option::Option<wkt::Timestamp>,
1571
1572 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1574
1575 pub description: std::string::String,
1577
1578 pub network: std::string::String,
1583
1584 pub service_class: std::string::String,
1591
1592 pub infrastructure: crate::model::Infrastructure,
1595
1596 pub psc_config: std::option::Option<crate::model::service_connection_policy::PscConfig>,
1599
1600 pub psc_connections: std::vec::Vec<crate::model::service_connection_policy::PscConnection>,
1603
1604 pub etag: std::option::Option<std::string::String>,
1608
1609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1610}
1611
1612impl ServiceConnectionPolicy {
1613 pub fn new() -> Self {
1614 std::default::Default::default()
1615 }
1616
1617 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1619 self.name = v.into();
1620 self
1621 }
1622
1623 pub fn set_create_time<T>(mut self, v: T) -> Self
1625 where
1626 T: std::convert::Into<wkt::Timestamp>,
1627 {
1628 self.create_time = std::option::Option::Some(v.into());
1629 self
1630 }
1631
1632 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1634 where
1635 T: std::convert::Into<wkt::Timestamp>,
1636 {
1637 self.create_time = v.map(|x| x.into());
1638 self
1639 }
1640
1641 pub fn set_update_time<T>(mut self, v: T) -> Self
1643 where
1644 T: std::convert::Into<wkt::Timestamp>,
1645 {
1646 self.update_time = std::option::Option::Some(v.into());
1647 self
1648 }
1649
1650 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1652 where
1653 T: std::convert::Into<wkt::Timestamp>,
1654 {
1655 self.update_time = v.map(|x| x.into());
1656 self
1657 }
1658
1659 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1661 where
1662 T: std::iter::IntoIterator<Item = (K, V)>,
1663 K: std::convert::Into<std::string::String>,
1664 V: std::convert::Into<std::string::String>,
1665 {
1666 use std::iter::Iterator;
1667 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1668 self
1669 }
1670
1671 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1673 self.description = v.into();
1674 self
1675 }
1676
1677 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1679 self.network = v.into();
1680 self
1681 }
1682
1683 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1685 self.service_class = v.into();
1686 self
1687 }
1688
1689 pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
1691 mut self,
1692 v: T,
1693 ) -> Self {
1694 self.infrastructure = v.into();
1695 self
1696 }
1697
1698 pub fn set_psc_config<T>(mut self, v: T) -> Self
1700 where
1701 T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
1702 {
1703 self.psc_config = std::option::Option::Some(v.into());
1704 self
1705 }
1706
1707 pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
1709 where
1710 T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
1711 {
1712 self.psc_config = v.map(|x| x.into());
1713 self
1714 }
1715
1716 pub fn set_psc_connections<T, V>(mut self, v: T) -> Self
1718 where
1719 T: std::iter::IntoIterator<Item = V>,
1720 V: std::convert::Into<crate::model::service_connection_policy::PscConnection>,
1721 {
1722 use std::iter::Iterator;
1723 self.psc_connections = v.into_iter().map(|i| i.into()).collect();
1724 self
1725 }
1726
1727 pub fn set_etag<T>(mut self, v: T) -> Self
1729 where
1730 T: std::convert::Into<std::string::String>,
1731 {
1732 self.etag = std::option::Option::Some(v.into());
1733 self
1734 }
1735
1736 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
1738 where
1739 T: std::convert::Into<std::string::String>,
1740 {
1741 self.etag = v.map(|x| x.into());
1742 self
1743 }
1744}
1745
1746impl wkt::message::Message for ServiceConnectionPolicy {
1747 fn typename() -> &'static str {
1748 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy"
1749 }
1750}
1751
1752pub mod service_connection_policy {
1754 #[allow(unused_imports)]
1755 use super::*;
1756
1757 #[derive(Clone, Default, PartialEq)]
1760 #[non_exhaustive]
1761 pub struct PscConfig {
1762 pub subnetworks: std::vec::Vec<std::string::String>,
1766
1767 pub limit: std::option::Option<i64>,
1769
1770 pub producer_instance_location:
1774 crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
1775
1776 pub allowed_google_producers_resource_hierarchy_level: std::vec::Vec<std::string::String>,
1792
1793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1794 }
1795
1796 impl PscConfig {
1797 pub fn new() -> Self {
1798 std::default::Default::default()
1799 }
1800
1801 pub fn set_subnetworks<T, V>(mut self, v: T) -> Self
1803 where
1804 T: std::iter::IntoIterator<Item = V>,
1805 V: std::convert::Into<std::string::String>,
1806 {
1807 use std::iter::Iterator;
1808 self.subnetworks = v.into_iter().map(|i| i.into()).collect();
1809 self
1810 }
1811
1812 pub fn set_limit<T>(mut self, v: T) -> Self
1814 where
1815 T: std::convert::Into<i64>,
1816 {
1817 self.limit = std::option::Option::Some(v.into());
1818 self
1819 }
1820
1821 pub fn set_or_clear_limit<T>(mut self, v: std::option::Option<T>) -> Self
1823 where
1824 T: std::convert::Into<i64>,
1825 {
1826 self.limit = v.map(|x| x.into());
1827 self
1828 }
1829
1830 pub fn set_producer_instance_location<
1832 T: std::convert::Into<
1833 crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
1834 >,
1835 >(
1836 mut self,
1837 v: T,
1838 ) -> Self {
1839 self.producer_instance_location = v.into();
1840 self
1841 }
1842
1843 pub fn set_allowed_google_producers_resource_hierarchy_level<T, V>(mut self, v: T) -> Self
1845 where
1846 T: std::iter::IntoIterator<Item = V>,
1847 V: std::convert::Into<std::string::String>,
1848 {
1849 use std::iter::Iterator;
1850 self.allowed_google_producers_resource_hierarchy_level =
1851 v.into_iter().map(|i| i.into()).collect();
1852 self
1853 }
1854 }
1855
1856 impl wkt::message::Message for PscConfig {
1857 fn typename() -> &'static str {
1858 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig"
1859 }
1860 }
1861
1862 pub mod psc_config {
1864 #[allow(unused_imports)]
1865 use super::*;
1866
1867 #[derive(Clone, Debug, PartialEq)]
1884 #[non_exhaustive]
1885 pub enum ProducerInstanceLocation {
1886 Unspecified,
1893 CustomResourceHierarchyLevels,
1896 UnknownValue(producer_instance_location::UnknownValue),
1901 }
1902
1903 #[doc(hidden)]
1904 pub mod producer_instance_location {
1905 #[allow(unused_imports)]
1906 use super::*;
1907 #[derive(Clone, Debug, PartialEq)]
1908 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1909 }
1910
1911 impl ProducerInstanceLocation {
1912 pub fn value(&self) -> std::option::Option<i32> {
1917 match self {
1918 Self::Unspecified => std::option::Option::Some(0),
1919 Self::CustomResourceHierarchyLevels => std::option::Option::Some(1),
1920 Self::UnknownValue(u) => u.0.value(),
1921 }
1922 }
1923
1924 pub fn name(&self) -> std::option::Option<&str> {
1929 match self {
1930 Self::Unspecified => {
1931 std::option::Option::Some("PRODUCER_INSTANCE_LOCATION_UNSPECIFIED")
1932 }
1933 Self::CustomResourceHierarchyLevels => {
1934 std::option::Option::Some("CUSTOM_RESOURCE_HIERARCHY_LEVELS")
1935 }
1936 Self::UnknownValue(u) => u.0.name(),
1937 }
1938 }
1939 }
1940
1941 impl std::default::Default for ProducerInstanceLocation {
1942 fn default() -> Self {
1943 use std::convert::From;
1944 Self::from(0)
1945 }
1946 }
1947
1948 impl std::fmt::Display for ProducerInstanceLocation {
1949 fn fmt(
1950 &self,
1951 f: &mut std::fmt::Formatter<'_>,
1952 ) -> std::result::Result<(), std::fmt::Error> {
1953 wkt::internal::display_enum(f, self.name(), self.value())
1954 }
1955 }
1956
1957 impl std::convert::From<i32> for ProducerInstanceLocation {
1958 fn from(value: i32) -> Self {
1959 match value {
1960 0 => Self::Unspecified,
1961 1 => Self::CustomResourceHierarchyLevels,
1962 _ => Self::UnknownValue(producer_instance_location::UnknownValue(
1963 wkt::internal::UnknownEnumValue::Integer(value),
1964 )),
1965 }
1966 }
1967 }
1968
1969 impl std::convert::From<&str> for ProducerInstanceLocation {
1970 fn from(value: &str) -> Self {
1971 use std::string::ToString;
1972 match value {
1973 "PRODUCER_INSTANCE_LOCATION_UNSPECIFIED" => Self::Unspecified,
1974 "CUSTOM_RESOURCE_HIERARCHY_LEVELS" => Self::CustomResourceHierarchyLevels,
1975 _ => Self::UnknownValue(producer_instance_location::UnknownValue(
1976 wkt::internal::UnknownEnumValue::String(value.to_string()),
1977 )),
1978 }
1979 }
1980 }
1981
1982 impl serde::ser::Serialize for ProducerInstanceLocation {
1983 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1984 where
1985 S: serde::Serializer,
1986 {
1987 match self {
1988 Self::Unspecified => serializer.serialize_i32(0),
1989 Self::CustomResourceHierarchyLevels => serializer.serialize_i32(1),
1990 Self::UnknownValue(u) => u.0.serialize(serializer),
1991 }
1992 }
1993 }
1994
1995 impl<'de> serde::de::Deserialize<'de> for ProducerInstanceLocation {
1996 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1997 where
1998 D: serde::Deserializer<'de>,
1999 {
2000 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProducerInstanceLocation>::new(
2001 ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig.ProducerInstanceLocation"))
2002 }
2003 }
2004 }
2005
2006 #[derive(Clone, Default, PartialEq)]
2008 #[non_exhaustive]
2009 pub struct PscConnection {
2010 pub state: crate::model::service_connection_policy::State,
2012
2013 pub consumer_forwarding_rule: std::string::String,
2016
2017 pub consumer_address: std::string::String,
2019
2020 #[deprecated]
2023 pub error_type: crate::model::ConnectionErrorType,
2024
2025 #[deprecated]
2028 pub error: std::option::Option<rpc::model::Status>,
2029
2030 pub gce_operation: std::string::String,
2032
2033 pub consumer_target_project: std::string::String,
2035
2036 pub psc_connection_id: std::string::String,
2038
2039 pub error_info: std::option::Option<rpc::model::ErrorInfo>,
2042
2043 pub selected_subnetwork: std::string::String,
2046
2047 #[deprecated]
2050 pub producer_instance_id: std::string::String,
2051
2052 pub producer_instance_metadata:
2054 std::collections::HashMap<std::string::String, std::string::String>,
2055
2056 pub service_class: std::string::String,
2060
2061 pub ip_version: std::option::Option<crate::model::IPVersion>,
2063
2064 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2065 }
2066
2067 impl PscConnection {
2068 pub fn new() -> Self {
2069 std::default::Default::default()
2070 }
2071
2072 pub fn set_state<T: std::convert::Into<crate::model::service_connection_policy::State>>(
2074 mut self,
2075 v: T,
2076 ) -> Self {
2077 self.state = v.into();
2078 self
2079 }
2080
2081 pub fn set_consumer_forwarding_rule<T: std::convert::Into<std::string::String>>(
2083 mut self,
2084 v: T,
2085 ) -> Self {
2086 self.consumer_forwarding_rule = v.into();
2087 self
2088 }
2089
2090 pub fn set_consumer_address<T: std::convert::Into<std::string::String>>(
2092 mut self,
2093 v: T,
2094 ) -> Self {
2095 self.consumer_address = v.into();
2096 self
2097 }
2098
2099 #[deprecated]
2101 pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
2102 mut self,
2103 v: T,
2104 ) -> Self {
2105 self.error_type = v.into();
2106 self
2107 }
2108
2109 #[deprecated]
2111 pub fn set_error<T>(mut self, v: T) -> Self
2112 where
2113 T: std::convert::Into<rpc::model::Status>,
2114 {
2115 self.error = std::option::Option::Some(v.into());
2116 self
2117 }
2118
2119 #[deprecated]
2121 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
2122 where
2123 T: std::convert::Into<rpc::model::Status>,
2124 {
2125 self.error = v.map(|x| x.into());
2126 self
2127 }
2128
2129 pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
2131 mut self,
2132 v: T,
2133 ) -> Self {
2134 self.gce_operation = v.into();
2135 self
2136 }
2137
2138 pub fn set_consumer_target_project<T: std::convert::Into<std::string::String>>(
2140 mut self,
2141 v: T,
2142 ) -> Self {
2143 self.consumer_target_project = v.into();
2144 self
2145 }
2146
2147 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
2149 mut self,
2150 v: T,
2151 ) -> Self {
2152 self.psc_connection_id = v.into();
2153 self
2154 }
2155
2156 pub fn set_error_info<T>(mut self, v: T) -> Self
2158 where
2159 T: std::convert::Into<rpc::model::ErrorInfo>,
2160 {
2161 self.error_info = std::option::Option::Some(v.into());
2162 self
2163 }
2164
2165 pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
2167 where
2168 T: std::convert::Into<rpc::model::ErrorInfo>,
2169 {
2170 self.error_info = v.map(|x| x.into());
2171 self
2172 }
2173
2174 pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
2176 mut self,
2177 v: T,
2178 ) -> Self {
2179 self.selected_subnetwork = v.into();
2180 self
2181 }
2182
2183 #[deprecated]
2185 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
2186 mut self,
2187 v: T,
2188 ) -> Self {
2189 self.producer_instance_id = v.into();
2190 self
2191 }
2192
2193 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
2195 where
2196 T: std::iter::IntoIterator<Item = (K, V)>,
2197 K: std::convert::Into<std::string::String>,
2198 V: std::convert::Into<std::string::String>,
2199 {
2200 use std::iter::Iterator;
2201 self.producer_instance_metadata =
2202 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2203 self
2204 }
2205
2206 pub fn set_service_class<T: std::convert::Into<std::string::String>>(
2208 mut self,
2209 v: T,
2210 ) -> Self {
2211 self.service_class = v.into();
2212 self
2213 }
2214
2215 pub fn set_ip_version<T>(mut self, v: T) -> Self
2217 where
2218 T: std::convert::Into<crate::model::IPVersion>,
2219 {
2220 self.ip_version = std::option::Option::Some(v.into());
2221 self
2222 }
2223
2224 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
2226 where
2227 T: std::convert::Into<crate::model::IPVersion>,
2228 {
2229 self.ip_version = v.map(|x| x.into());
2230 self
2231 }
2232 }
2233
2234 impl wkt::message::Message for PscConnection {
2235 fn typename() -> &'static str {
2236 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection"
2237 }
2238 }
2239
2240 #[derive(Clone, Debug, PartialEq)]
2259 #[non_exhaustive]
2260 pub enum State {
2261 Unspecified,
2263 Active,
2267 Failed,
2270 Creating,
2272 Deleting,
2274 CreateRepairing,
2276 DeleteRepairing,
2278 UnknownValue(state::UnknownValue),
2283 }
2284
2285 #[doc(hidden)]
2286 pub mod state {
2287 #[allow(unused_imports)]
2288 use super::*;
2289 #[derive(Clone, Debug, PartialEq)]
2290 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2291 }
2292
2293 impl State {
2294 pub fn value(&self) -> std::option::Option<i32> {
2299 match self {
2300 Self::Unspecified => std::option::Option::Some(0),
2301 Self::Active => std::option::Option::Some(1),
2302 Self::Failed => std::option::Option::Some(2),
2303 Self::Creating => std::option::Option::Some(3),
2304 Self::Deleting => std::option::Option::Some(4),
2305 Self::CreateRepairing => std::option::Option::Some(5),
2306 Self::DeleteRepairing => std::option::Option::Some(6),
2307 Self::UnknownValue(u) => u.0.value(),
2308 }
2309 }
2310
2311 pub fn name(&self) -> std::option::Option<&str> {
2316 match self {
2317 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2318 Self::Active => std::option::Option::Some("ACTIVE"),
2319 Self::Failed => std::option::Option::Some("FAILED"),
2320 Self::Creating => std::option::Option::Some("CREATING"),
2321 Self::Deleting => std::option::Option::Some("DELETING"),
2322 Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
2323 Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
2324 Self::UnknownValue(u) => u.0.name(),
2325 }
2326 }
2327 }
2328
2329 impl std::default::Default for State {
2330 fn default() -> Self {
2331 use std::convert::From;
2332 Self::from(0)
2333 }
2334 }
2335
2336 impl std::fmt::Display for State {
2337 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2338 wkt::internal::display_enum(f, self.name(), self.value())
2339 }
2340 }
2341
2342 impl std::convert::From<i32> for State {
2343 fn from(value: i32) -> Self {
2344 match value {
2345 0 => Self::Unspecified,
2346 1 => Self::Active,
2347 2 => Self::Failed,
2348 3 => Self::Creating,
2349 4 => Self::Deleting,
2350 5 => Self::CreateRepairing,
2351 6 => Self::DeleteRepairing,
2352 _ => Self::UnknownValue(state::UnknownValue(
2353 wkt::internal::UnknownEnumValue::Integer(value),
2354 )),
2355 }
2356 }
2357 }
2358
2359 impl std::convert::From<&str> for State {
2360 fn from(value: &str) -> Self {
2361 use std::string::ToString;
2362 match value {
2363 "STATE_UNSPECIFIED" => Self::Unspecified,
2364 "ACTIVE" => Self::Active,
2365 "FAILED" => Self::Failed,
2366 "CREATING" => Self::Creating,
2367 "DELETING" => Self::Deleting,
2368 "CREATE_REPAIRING" => Self::CreateRepairing,
2369 "DELETE_REPAIRING" => Self::DeleteRepairing,
2370 _ => Self::UnknownValue(state::UnknownValue(
2371 wkt::internal::UnknownEnumValue::String(value.to_string()),
2372 )),
2373 }
2374 }
2375 }
2376
2377 impl serde::ser::Serialize for State {
2378 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2379 where
2380 S: serde::Serializer,
2381 {
2382 match self {
2383 Self::Unspecified => serializer.serialize_i32(0),
2384 Self::Active => serializer.serialize_i32(1),
2385 Self::Failed => serializer.serialize_i32(2),
2386 Self::Creating => serializer.serialize_i32(3),
2387 Self::Deleting => serializer.serialize_i32(4),
2388 Self::CreateRepairing => serializer.serialize_i32(5),
2389 Self::DeleteRepairing => serializer.serialize_i32(6),
2390 Self::UnknownValue(u) => u.0.serialize(serializer),
2391 }
2392 }
2393 }
2394
2395 impl<'de> serde::de::Deserialize<'de> for State {
2396 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2397 where
2398 D: serde::Deserializer<'de>,
2399 {
2400 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2401 ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.State",
2402 ))
2403 }
2404 }
2405}
2406
2407#[derive(Clone, Default, PartialEq)]
2409#[non_exhaustive]
2410pub struct ListServiceConnectionPoliciesRequest {
2411 pub parent: std::string::String,
2413
2414 pub page_size: i32,
2416
2417 pub page_token: std::string::String,
2419
2420 pub filter: std::string::String,
2422
2423 pub order_by: std::string::String,
2425
2426 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2427}
2428
2429impl ListServiceConnectionPoliciesRequest {
2430 pub fn new() -> Self {
2431 std::default::Default::default()
2432 }
2433
2434 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2436 self.parent = v.into();
2437 self
2438 }
2439
2440 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2442 self.page_size = v.into();
2443 self
2444 }
2445
2446 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2448 self.page_token = v.into();
2449 self
2450 }
2451
2452 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2454 self.filter = v.into();
2455 self
2456 }
2457
2458 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2460 self.order_by = v.into();
2461 self
2462 }
2463}
2464
2465impl wkt::message::Message for ListServiceConnectionPoliciesRequest {
2466 fn typename() -> &'static str {
2467 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesRequest"
2468 }
2469}
2470
2471#[derive(Clone, Default, PartialEq)]
2473#[non_exhaustive]
2474pub struct ListServiceConnectionPoliciesResponse {
2475 pub service_connection_policies: std::vec::Vec<crate::model::ServiceConnectionPolicy>,
2477
2478 pub next_page_token: std::string::String,
2481
2482 pub unreachable: std::vec::Vec<std::string::String>,
2484
2485 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2486}
2487
2488impl ListServiceConnectionPoliciesResponse {
2489 pub fn new() -> Self {
2490 std::default::Default::default()
2491 }
2492
2493 pub fn set_service_connection_policies<T, V>(mut self, v: T) -> Self
2495 where
2496 T: std::iter::IntoIterator<Item = V>,
2497 V: std::convert::Into<crate::model::ServiceConnectionPolicy>,
2498 {
2499 use std::iter::Iterator;
2500 self.service_connection_policies = v.into_iter().map(|i| i.into()).collect();
2501 self
2502 }
2503
2504 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2506 self.next_page_token = v.into();
2507 self
2508 }
2509
2510 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2512 where
2513 T: std::iter::IntoIterator<Item = V>,
2514 V: std::convert::Into<std::string::String>,
2515 {
2516 use std::iter::Iterator;
2517 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2518 self
2519 }
2520}
2521
2522impl wkt::message::Message for ListServiceConnectionPoliciesResponse {
2523 fn typename() -> &'static str {
2524 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesResponse"
2525 }
2526}
2527
2528#[doc(hidden)]
2529impl gax::paginator::internal::PageableResponse for ListServiceConnectionPoliciesResponse {
2530 type PageItem = crate::model::ServiceConnectionPolicy;
2531
2532 fn items(self) -> std::vec::Vec<Self::PageItem> {
2533 self.service_connection_policies
2534 }
2535
2536 fn next_page_token(&self) -> std::string::String {
2537 use std::clone::Clone;
2538 self.next_page_token.clone()
2539 }
2540}
2541
2542#[derive(Clone, Default, PartialEq)]
2544#[non_exhaustive]
2545pub struct GetServiceConnectionPolicyRequest {
2546 pub name: std::string::String,
2548
2549 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2550}
2551
2552impl GetServiceConnectionPolicyRequest {
2553 pub fn new() -> Self {
2554 std::default::Default::default()
2555 }
2556
2557 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2559 self.name = v.into();
2560 self
2561 }
2562}
2563
2564impl wkt::message::Message for GetServiceConnectionPolicyRequest {
2565 fn typename() -> &'static str {
2566 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionPolicyRequest"
2567 }
2568}
2569
2570#[derive(Clone, Default, PartialEq)]
2572#[non_exhaustive]
2573pub struct CreateServiceConnectionPolicyRequest {
2574 pub parent: std::string::String,
2577
2578 pub service_connection_policy_id: std::string::String,
2583
2584 pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
2586
2587 pub request_id: std::string::String,
2601
2602 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2603}
2604
2605impl CreateServiceConnectionPolicyRequest {
2606 pub fn new() -> Self {
2607 std::default::Default::default()
2608 }
2609
2610 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2612 self.parent = v.into();
2613 self
2614 }
2615
2616 pub fn set_service_connection_policy_id<T: std::convert::Into<std::string::String>>(
2618 mut self,
2619 v: T,
2620 ) -> Self {
2621 self.service_connection_policy_id = v.into();
2622 self
2623 }
2624
2625 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
2627 where
2628 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
2629 {
2630 self.service_connection_policy = std::option::Option::Some(v.into());
2631 self
2632 }
2633
2634 pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
2636 where
2637 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
2638 {
2639 self.service_connection_policy = v.map(|x| x.into());
2640 self
2641 }
2642
2643 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2645 self.request_id = v.into();
2646 self
2647 }
2648}
2649
2650impl wkt::message::Message for CreateServiceConnectionPolicyRequest {
2651 fn typename() -> &'static str {
2652 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionPolicyRequest"
2653 }
2654}
2655
2656#[derive(Clone, Default, PartialEq)]
2658#[non_exhaustive]
2659pub struct UpdateServiceConnectionPolicyRequest {
2660 pub update_mask: std::option::Option<wkt::FieldMask>,
2666
2667 pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
2669
2670 pub request_id: std::string::String,
2684
2685 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2686}
2687
2688impl UpdateServiceConnectionPolicyRequest {
2689 pub fn new() -> Self {
2690 std::default::Default::default()
2691 }
2692
2693 pub fn set_update_mask<T>(mut self, v: T) -> Self
2695 where
2696 T: std::convert::Into<wkt::FieldMask>,
2697 {
2698 self.update_mask = std::option::Option::Some(v.into());
2699 self
2700 }
2701
2702 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2704 where
2705 T: std::convert::Into<wkt::FieldMask>,
2706 {
2707 self.update_mask = v.map(|x| x.into());
2708 self
2709 }
2710
2711 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
2713 where
2714 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
2715 {
2716 self.service_connection_policy = std::option::Option::Some(v.into());
2717 self
2718 }
2719
2720 pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
2722 where
2723 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
2724 {
2725 self.service_connection_policy = v.map(|x| x.into());
2726 self
2727 }
2728
2729 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2731 self.request_id = v.into();
2732 self
2733 }
2734}
2735
2736impl wkt::message::Message for UpdateServiceConnectionPolicyRequest {
2737 fn typename() -> &'static str {
2738 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionPolicyRequest"
2739 }
2740}
2741
2742#[derive(Clone, Default, PartialEq)]
2744#[non_exhaustive]
2745pub struct DeleteServiceConnectionPolicyRequest {
2746 pub name: std::string::String,
2748
2749 pub request_id: std::string::String,
2763
2764 pub etag: std::option::Option<std::string::String>,
2768
2769 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2770}
2771
2772impl DeleteServiceConnectionPolicyRequest {
2773 pub fn new() -> Self {
2774 std::default::Default::default()
2775 }
2776
2777 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2779 self.name = v.into();
2780 self
2781 }
2782
2783 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2785 self.request_id = v.into();
2786 self
2787 }
2788
2789 pub fn set_etag<T>(mut self, v: T) -> Self
2791 where
2792 T: std::convert::Into<std::string::String>,
2793 {
2794 self.etag = std::option::Option::Some(v.into());
2795 self
2796 }
2797
2798 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2800 where
2801 T: std::convert::Into<std::string::String>,
2802 {
2803 self.etag = v.map(|x| x.into());
2804 self
2805 }
2806}
2807
2808impl wkt::message::Message for DeleteServiceConnectionPolicyRequest {
2809 fn typename() -> &'static str {
2810 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionPolicyRequest"
2811 }
2812}
2813
2814#[derive(Clone, Default, PartialEq)]
2816#[non_exhaustive]
2817pub struct ServiceClass {
2818 pub name: std::string::String,
2823
2824 pub service_class: std::string::String,
2828
2829 pub create_time: std::option::Option<wkt::Timestamp>,
2831
2832 pub update_time: std::option::Option<wkt::Timestamp>,
2834
2835 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2837
2838 pub description: std::string::String,
2840
2841 pub etag: std::option::Option<std::string::String>,
2845
2846 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2847}
2848
2849impl ServiceClass {
2850 pub fn new() -> Self {
2851 std::default::Default::default()
2852 }
2853
2854 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2856 self.name = v.into();
2857 self
2858 }
2859
2860 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2862 self.service_class = v.into();
2863 self
2864 }
2865
2866 pub fn set_create_time<T>(mut self, v: T) -> Self
2868 where
2869 T: std::convert::Into<wkt::Timestamp>,
2870 {
2871 self.create_time = std::option::Option::Some(v.into());
2872 self
2873 }
2874
2875 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2877 where
2878 T: std::convert::Into<wkt::Timestamp>,
2879 {
2880 self.create_time = v.map(|x| x.into());
2881 self
2882 }
2883
2884 pub fn set_update_time<T>(mut self, v: T) -> Self
2886 where
2887 T: std::convert::Into<wkt::Timestamp>,
2888 {
2889 self.update_time = std::option::Option::Some(v.into());
2890 self
2891 }
2892
2893 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2895 where
2896 T: std::convert::Into<wkt::Timestamp>,
2897 {
2898 self.update_time = v.map(|x| x.into());
2899 self
2900 }
2901
2902 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2904 where
2905 T: std::iter::IntoIterator<Item = (K, V)>,
2906 K: std::convert::Into<std::string::String>,
2907 V: std::convert::Into<std::string::String>,
2908 {
2909 use std::iter::Iterator;
2910 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2911 self
2912 }
2913
2914 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2916 self.description = v.into();
2917 self
2918 }
2919
2920 pub fn set_etag<T>(mut self, v: T) -> Self
2922 where
2923 T: std::convert::Into<std::string::String>,
2924 {
2925 self.etag = std::option::Option::Some(v.into());
2926 self
2927 }
2928
2929 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2931 where
2932 T: std::convert::Into<std::string::String>,
2933 {
2934 self.etag = v.map(|x| x.into());
2935 self
2936 }
2937}
2938
2939impl wkt::message::Message for ServiceClass {
2940 fn typename() -> &'static str {
2941 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceClass"
2942 }
2943}
2944
2945#[derive(Clone, Default, PartialEq)]
2947#[non_exhaustive]
2948pub struct ListServiceClassesRequest {
2949 pub parent: std::string::String,
2951
2952 pub page_size: i32,
2954
2955 pub page_token: std::string::String,
2957
2958 pub filter: std::string::String,
2960
2961 pub order_by: std::string::String,
2963
2964 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2965}
2966
2967impl ListServiceClassesRequest {
2968 pub fn new() -> Self {
2969 std::default::Default::default()
2970 }
2971
2972 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2974 self.parent = v.into();
2975 self
2976 }
2977
2978 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2980 self.page_size = v.into();
2981 self
2982 }
2983
2984 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2986 self.page_token = v.into();
2987 self
2988 }
2989
2990 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2992 self.filter = v.into();
2993 self
2994 }
2995
2996 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2998 self.order_by = v.into();
2999 self
3000 }
3001}
3002
3003impl wkt::message::Message for ListServiceClassesRequest {
3004 fn typename() -> &'static str {
3005 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesRequest"
3006 }
3007}
3008
3009#[derive(Clone, Default, PartialEq)]
3011#[non_exhaustive]
3012pub struct ListServiceClassesResponse {
3013 pub service_classes: std::vec::Vec<crate::model::ServiceClass>,
3015
3016 pub next_page_token: std::string::String,
3019
3020 pub unreachable: std::vec::Vec<std::string::String>,
3022
3023 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3024}
3025
3026impl ListServiceClassesResponse {
3027 pub fn new() -> Self {
3028 std::default::Default::default()
3029 }
3030
3031 pub fn set_service_classes<T, V>(mut self, v: T) -> Self
3033 where
3034 T: std::iter::IntoIterator<Item = V>,
3035 V: std::convert::Into<crate::model::ServiceClass>,
3036 {
3037 use std::iter::Iterator;
3038 self.service_classes = v.into_iter().map(|i| i.into()).collect();
3039 self
3040 }
3041
3042 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3044 self.next_page_token = v.into();
3045 self
3046 }
3047
3048 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3050 where
3051 T: std::iter::IntoIterator<Item = V>,
3052 V: std::convert::Into<std::string::String>,
3053 {
3054 use std::iter::Iterator;
3055 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3056 self
3057 }
3058}
3059
3060impl wkt::message::Message for ListServiceClassesResponse {
3061 fn typename() -> &'static str {
3062 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesResponse"
3063 }
3064}
3065
3066#[doc(hidden)]
3067impl gax::paginator::internal::PageableResponse for ListServiceClassesResponse {
3068 type PageItem = crate::model::ServiceClass;
3069
3070 fn items(self) -> std::vec::Vec<Self::PageItem> {
3071 self.service_classes
3072 }
3073
3074 fn next_page_token(&self) -> std::string::String {
3075 use std::clone::Clone;
3076 self.next_page_token.clone()
3077 }
3078}
3079
3080#[derive(Clone, Default, PartialEq)]
3082#[non_exhaustive]
3083pub struct GetServiceClassRequest {
3084 pub name: std::string::String,
3086
3087 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3088}
3089
3090impl GetServiceClassRequest {
3091 pub fn new() -> Self {
3092 std::default::Default::default()
3093 }
3094
3095 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3097 self.name = v.into();
3098 self
3099 }
3100}
3101
3102impl wkt::message::Message for GetServiceClassRequest {
3103 fn typename() -> &'static str {
3104 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceClassRequest"
3105 }
3106}
3107
3108#[derive(Clone, Default, PartialEq)]
3110#[non_exhaustive]
3111pub struct UpdateServiceClassRequest {
3112 pub update_mask: std::option::Option<wkt::FieldMask>,
3118
3119 pub service_class: std::option::Option<crate::model::ServiceClass>,
3121
3122 pub request_id: std::string::String,
3136
3137 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3138}
3139
3140impl UpdateServiceClassRequest {
3141 pub fn new() -> Self {
3142 std::default::Default::default()
3143 }
3144
3145 pub fn set_update_mask<T>(mut self, v: T) -> Self
3147 where
3148 T: std::convert::Into<wkt::FieldMask>,
3149 {
3150 self.update_mask = std::option::Option::Some(v.into());
3151 self
3152 }
3153
3154 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3156 where
3157 T: std::convert::Into<wkt::FieldMask>,
3158 {
3159 self.update_mask = v.map(|x| x.into());
3160 self
3161 }
3162
3163 pub fn set_service_class<T>(mut self, v: T) -> Self
3165 where
3166 T: std::convert::Into<crate::model::ServiceClass>,
3167 {
3168 self.service_class = std::option::Option::Some(v.into());
3169 self
3170 }
3171
3172 pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
3174 where
3175 T: std::convert::Into<crate::model::ServiceClass>,
3176 {
3177 self.service_class = v.map(|x| x.into());
3178 self
3179 }
3180
3181 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3183 self.request_id = v.into();
3184 self
3185 }
3186}
3187
3188impl wkt::message::Message for UpdateServiceClassRequest {
3189 fn typename() -> &'static str {
3190 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceClassRequest"
3191 }
3192}
3193
3194#[derive(Clone, Default, PartialEq)]
3196#[non_exhaustive]
3197pub struct DeleteServiceClassRequest {
3198 pub name: std::string::String,
3200
3201 pub request_id: std::string::String,
3215
3216 pub etag: std::option::Option<std::string::String>,
3220
3221 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3222}
3223
3224impl DeleteServiceClassRequest {
3225 pub fn new() -> Self {
3226 std::default::Default::default()
3227 }
3228
3229 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3231 self.name = v.into();
3232 self
3233 }
3234
3235 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3237 self.request_id = v.into();
3238 self
3239 }
3240
3241 pub fn set_etag<T>(mut self, v: T) -> Self
3243 where
3244 T: std::convert::Into<std::string::String>,
3245 {
3246 self.etag = std::option::Option::Some(v.into());
3247 self
3248 }
3249
3250 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
3252 where
3253 T: std::convert::Into<std::string::String>,
3254 {
3255 self.etag = v.map(|x| x.into());
3256 self
3257 }
3258}
3259
3260impl wkt::message::Message for DeleteServiceClassRequest {
3261 fn typename() -> &'static str {
3262 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceClassRequest"
3263 }
3264}
3265
3266#[derive(Clone, Default, PartialEq)]
3268#[non_exhaustive]
3269pub struct ServiceConnectionToken {
3270 pub name: std::string::String,
3275
3276 pub create_time: std::option::Option<wkt::Timestamp>,
3278
3279 pub update_time: std::option::Option<wkt::Timestamp>,
3281
3282 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3284
3285 pub description: std::string::String,
3287
3288 pub network: std::string::String,
3292
3293 pub token: std::string::String,
3295
3296 pub expire_time: std::option::Option<wkt::Timestamp>,
3298
3299 pub etag: std::option::Option<std::string::String>,
3303
3304 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3305}
3306
3307impl ServiceConnectionToken {
3308 pub fn new() -> Self {
3309 std::default::Default::default()
3310 }
3311
3312 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3314 self.name = v.into();
3315 self
3316 }
3317
3318 pub fn set_create_time<T>(mut self, v: T) -> Self
3320 where
3321 T: std::convert::Into<wkt::Timestamp>,
3322 {
3323 self.create_time = std::option::Option::Some(v.into());
3324 self
3325 }
3326
3327 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3329 where
3330 T: std::convert::Into<wkt::Timestamp>,
3331 {
3332 self.create_time = v.map(|x| x.into());
3333 self
3334 }
3335
3336 pub fn set_update_time<T>(mut self, v: T) -> Self
3338 where
3339 T: std::convert::Into<wkt::Timestamp>,
3340 {
3341 self.update_time = std::option::Option::Some(v.into());
3342 self
3343 }
3344
3345 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3347 where
3348 T: std::convert::Into<wkt::Timestamp>,
3349 {
3350 self.update_time = v.map(|x| x.into());
3351 self
3352 }
3353
3354 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3356 where
3357 T: std::iter::IntoIterator<Item = (K, V)>,
3358 K: std::convert::Into<std::string::String>,
3359 V: std::convert::Into<std::string::String>,
3360 {
3361 use std::iter::Iterator;
3362 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3363 self
3364 }
3365
3366 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3368 self.description = v.into();
3369 self
3370 }
3371
3372 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3374 self.network = v.into();
3375 self
3376 }
3377
3378 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3380 self.token = v.into();
3381 self
3382 }
3383
3384 pub fn set_expire_time<T>(mut self, v: T) -> Self
3386 where
3387 T: std::convert::Into<wkt::Timestamp>,
3388 {
3389 self.expire_time = std::option::Option::Some(v.into());
3390 self
3391 }
3392
3393 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
3395 where
3396 T: std::convert::Into<wkt::Timestamp>,
3397 {
3398 self.expire_time = v.map(|x| x.into());
3399 self
3400 }
3401
3402 pub fn set_etag<T>(mut self, v: T) -> Self
3404 where
3405 T: std::convert::Into<std::string::String>,
3406 {
3407 self.etag = std::option::Option::Some(v.into());
3408 self
3409 }
3410
3411 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
3413 where
3414 T: std::convert::Into<std::string::String>,
3415 {
3416 self.etag = v.map(|x| x.into());
3417 self
3418 }
3419}
3420
3421impl wkt::message::Message for ServiceConnectionToken {
3422 fn typename() -> &'static str {
3423 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionToken"
3424 }
3425}
3426
3427#[derive(Clone, Default, PartialEq)]
3429#[non_exhaustive]
3430pub struct ListServiceConnectionTokensRequest {
3431 pub parent: std::string::String,
3433
3434 pub page_size: i32,
3436
3437 pub page_token: std::string::String,
3439
3440 pub filter: std::string::String,
3442
3443 pub order_by: std::string::String,
3445
3446 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3447}
3448
3449impl ListServiceConnectionTokensRequest {
3450 pub fn new() -> Self {
3451 std::default::Default::default()
3452 }
3453
3454 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3456 self.parent = v.into();
3457 self
3458 }
3459
3460 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3462 self.page_size = v.into();
3463 self
3464 }
3465
3466 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3468 self.page_token = v.into();
3469 self
3470 }
3471
3472 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3474 self.filter = v.into();
3475 self
3476 }
3477
3478 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3480 self.order_by = v.into();
3481 self
3482 }
3483}
3484
3485impl wkt::message::Message for ListServiceConnectionTokensRequest {
3486 fn typename() -> &'static str {
3487 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensRequest"
3488 }
3489}
3490
3491#[derive(Clone, Default, PartialEq)]
3493#[non_exhaustive]
3494pub struct ListServiceConnectionTokensResponse {
3495 pub service_connection_tokens: std::vec::Vec<crate::model::ServiceConnectionToken>,
3497
3498 pub next_page_token: std::string::String,
3501
3502 pub unreachable: std::vec::Vec<std::string::String>,
3504
3505 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3506}
3507
3508impl ListServiceConnectionTokensResponse {
3509 pub fn new() -> Self {
3510 std::default::Default::default()
3511 }
3512
3513 pub fn set_service_connection_tokens<T, V>(mut self, v: T) -> Self
3515 where
3516 T: std::iter::IntoIterator<Item = V>,
3517 V: std::convert::Into<crate::model::ServiceConnectionToken>,
3518 {
3519 use std::iter::Iterator;
3520 self.service_connection_tokens = v.into_iter().map(|i| i.into()).collect();
3521 self
3522 }
3523
3524 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3526 self.next_page_token = v.into();
3527 self
3528 }
3529
3530 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3532 where
3533 T: std::iter::IntoIterator<Item = V>,
3534 V: std::convert::Into<std::string::String>,
3535 {
3536 use std::iter::Iterator;
3537 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3538 self
3539 }
3540}
3541
3542impl wkt::message::Message for ListServiceConnectionTokensResponse {
3543 fn typename() -> &'static str {
3544 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensResponse"
3545 }
3546}
3547
3548#[doc(hidden)]
3549impl gax::paginator::internal::PageableResponse for ListServiceConnectionTokensResponse {
3550 type PageItem = crate::model::ServiceConnectionToken;
3551
3552 fn items(self) -> std::vec::Vec<Self::PageItem> {
3553 self.service_connection_tokens
3554 }
3555
3556 fn next_page_token(&self) -> std::string::String {
3557 use std::clone::Clone;
3558 self.next_page_token.clone()
3559 }
3560}
3561
3562#[derive(Clone, Default, PartialEq)]
3564#[non_exhaustive]
3565pub struct GetServiceConnectionTokenRequest {
3566 pub name: std::string::String,
3568
3569 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3570}
3571
3572impl GetServiceConnectionTokenRequest {
3573 pub fn new() -> Self {
3574 std::default::Default::default()
3575 }
3576
3577 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3579 self.name = v.into();
3580 self
3581 }
3582}
3583
3584impl wkt::message::Message for GetServiceConnectionTokenRequest {
3585 fn typename() -> &'static str {
3586 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionTokenRequest"
3587 }
3588}
3589
3590#[derive(Clone, Default, PartialEq)]
3592#[non_exhaustive]
3593pub struct CreateServiceConnectionTokenRequest {
3594 pub parent: std::string::String,
3597
3598 pub service_connection_token_id: std::string::String,
3604
3605 pub service_connection_token: std::option::Option<crate::model::ServiceConnectionToken>,
3607
3608 pub request_id: std::string::String,
3622
3623 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3624}
3625
3626impl CreateServiceConnectionTokenRequest {
3627 pub fn new() -> Self {
3628 std::default::Default::default()
3629 }
3630
3631 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3633 self.parent = v.into();
3634 self
3635 }
3636
3637 pub fn set_service_connection_token_id<T: std::convert::Into<std::string::String>>(
3639 mut self,
3640 v: T,
3641 ) -> Self {
3642 self.service_connection_token_id = v.into();
3643 self
3644 }
3645
3646 pub fn set_service_connection_token<T>(mut self, v: T) -> Self
3648 where
3649 T: std::convert::Into<crate::model::ServiceConnectionToken>,
3650 {
3651 self.service_connection_token = std::option::Option::Some(v.into());
3652 self
3653 }
3654
3655 pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
3657 where
3658 T: std::convert::Into<crate::model::ServiceConnectionToken>,
3659 {
3660 self.service_connection_token = v.map(|x| x.into());
3661 self
3662 }
3663
3664 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3666 self.request_id = v.into();
3667 self
3668 }
3669}
3670
3671impl wkt::message::Message for CreateServiceConnectionTokenRequest {
3672 fn typename() -> &'static str {
3673 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionTokenRequest"
3674 }
3675}
3676
3677#[derive(Clone, Default, PartialEq)]
3679#[non_exhaustive]
3680pub struct DeleteServiceConnectionTokenRequest {
3681 pub name: std::string::String,
3683
3684 pub request_id: std::string::String,
3698
3699 pub etag: std::option::Option<std::string::String>,
3703
3704 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3705}
3706
3707impl DeleteServiceConnectionTokenRequest {
3708 pub fn new() -> Self {
3709 std::default::Default::default()
3710 }
3711
3712 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3714 self.name = v.into();
3715 self
3716 }
3717
3718 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3720 self.request_id = v.into();
3721 self
3722 }
3723
3724 pub fn set_etag<T>(mut self, v: T) -> Self
3726 where
3727 T: std::convert::Into<std::string::String>,
3728 {
3729 self.etag = std::option::Option::Some(v.into());
3730 self
3731 }
3732
3733 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
3735 where
3736 T: std::convert::Into<std::string::String>,
3737 {
3738 self.etag = v.map(|x| x.into());
3739 self
3740 }
3741}
3742
3743impl wkt::message::Message for DeleteServiceConnectionTokenRequest {
3744 fn typename() -> &'static str {
3745 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionTokenRequest"
3746 }
3747}
3748
3749#[derive(Clone, Default, PartialEq)]
3752#[non_exhaustive]
3753pub struct MulticloudDataTransferConfig {
3754 pub name: std::string::String,
3758
3759 pub create_time: std::option::Option<wkt::Timestamp>,
3762
3763 pub update_time: std::option::Option<wkt::Timestamp>,
3766
3767 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3769
3770 pub etag: std::string::String,
3774
3775 pub description: std::string::String,
3777
3778 pub destinations_count: i32,
3781
3782 pub destinations_active_count: i32,
3785
3786 pub services: std::collections::HashMap<std::string::String, crate::model::StateTimeline>,
3810
3811 pub uid: std::string::String,
3817
3818 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3819}
3820
3821impl MulticloudDataTransferConfig {
3822 pub fn new() -> Self {
3823 std::default::Default::default()
3824 }
3825
3826 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3828 self.name = v.into();
3829 self
3830 }
3831
3832 pub fn set_create_time<T>(mut self, v: T) -> Self
3834 where
3835 T: std::convert::Into<wkt::Timestamp>,
3836 {
3837 self.create_time = std::option::Option::Some(v.into());
3838 self
3839 }
3840
3841 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3843 where
3844 T: std::convert::Into<wkt::Timestamp>,
3845 {
3846 self.create_time = v.map(|x| x.into());
3847 self
3848 }
3849
3850 pub fn set_update_time<T>(mut self, v: T) -> Self
3852 where
3853 T: std::convert::Into<wkt::Timestamp>,
3854 {
3855 self.update_time = std::option::Option::Some(v.into());
3856 self
3857 }
3858
3859 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3861 where
3862 T: std::convert::Into<wkt::Timestamp>,
3863 {
3864 self.update_time = v.map(|x| x.into());
3865 self
3866 }
3867
3868 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3870 where
3871 T: std::iter::IntoIterator<Item = (K, V)>,
3872 K: std::convert::Into<std::string::String>,
3873 V: std::convert::Into<std::string::String>,
3874 {
3875 use std::iter::Iterator;
3876 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3877 self
3878 }
3879
3880 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3882 self.etag = v.into();
3883 self
3884 }
3885
3886 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3888 self.description = v.into();
3889 self
3890 }
3891
3892 pub fn set_destinations_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3894 self.destinations_count = v.into();
3895 self
3896 }
3897
3898 pub fn set_destinations_active_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3900 self.destinations_active_count = v.into();
3901 self
3902 }
3903
3904 pub fn set_services<T, K, V>(mut self, v: T) -> Self
3906 where
3907 T: std::iter::IntoIterator<Item = (K, V)>,
3908 K: std::convert::Into<std::string::String>,
3909 V: std::convert::Into<crate::model::StateTimeline>,
3910 {
3911 use std::iter::Iterator;
3912 self.services = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3913 self
3914 }
3915
3916 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3918 self.uid = v.into();
3919 self
3920 }
3921}
3922
3923impl wkt::message::Message for MulticloudDataTransferConfig {
3924 fn typename() -> &'static str {
3925 "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferConfig"
3926 }
3927}
3928
3929#[derive(Clone, Default, PartialEq)]
3931#[non_exhaustive]
3932pub struct ListMulticloudDataTransferConfigsRequest {
3933 pub parent: std::string::String,
3935
3936 pub page_size: i32,
3938
3939 pub page_token: std::string::String,
3941
3942 pub filter: std::string::String,
3944
3945 pub order_by: std::string::String,
3947
3948 pub return_partial_success: bool,
3951
3952 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3953}
3954
3955impl ListMulticloudDataTransferConfigsRequest {
3956 pub fn new() -> Self {
3957 std::default::Default::default()
3958 }
3959
3960 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3962 self.parent = v.into();
3963 self
3964 }
3965
3966 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3968 self.page_size = v.into();
3969 self
3970 }
3971
3972 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3974 self.page_token = v.into();
3975 self
3976 }
3977
3978 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3980 self.filter = v.into();
3981 self
3982 }
3983
3984 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3986 self.order_by = v.into();
3987 self
3988 }
3989
3990 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3992 self.return_partial_success = v.into();
3993 self
3994 }
3995}
3996
3997impl wkt::message::Message for ListMulticloudDataTransferConfigsRequest {
3998 fn typename() -> &'static str {
3999 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsRequest"
4000 }
4001}
4002
4003#[derive(Clone, Default, PartialEq)]
4005#[non_exhaustive]
4006pub struct ListMulticloudDataTransferConfigsResponse {
4007 pub multicloud_data_transfer_configs: std::vec::Vec<crate::model::MulticloudDataTransferConfig>,
4009
4010 pub next_page_token: std::string::String,
4012
4013 pub unreachable: std::vec::Vec<std::string::String>,
4015
4016 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4017}
4018
4019impl ListMulticloudDataTransferConfigsResponse {
4020 pub fn new() -> Self {
4021 std::default::Default::default()
4022 }
4023
4024 pub fn set_multicloud_data_transfer_configs<T, V>(mut self, v: T) -> Self
4026 where
4027 T: std::iter::IntoIterator<Item = V>,
4028 V: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
4029 {
4030 use std::iter::Iterator;
4031 self.multicloud_data_transfer_configs = v.into_iter().map(|i| i.into()).collect();
4032 self
4033 }
4034
4035 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4037 self.next_page_token = v.into();
4038 self
4039 }
4040
4041 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4043 where
4044 T: std::iter::IntoIterator<Item = V>,
4045 V: std::convert::Into<std::string::String>,
4046 {
4047 use std::iter::Iterator;
4048 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4049 self
4050 }
4051}
4052
4053impl wkt::message::Message for ListMulticloudDataTransferConfigsResponse {
4054 fn typename() -> &'static str {
4055 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsResponse"
4056 }
4057}
4058
4059#[doc(hidden)]
4060impl gax::paginator::internal::PageableResponse for ListMulticloudDataTransferConfigsResponse {
4061 type PageItem = crate::model::MulticloudDataTransferConfig;
4062
4063 fn items(self) -> std::vec::Vec<Self::PageItem> {
4064 self.multicloud_data_transfer_configs
4065 }
4066
4067 fn next_page_token(&self) -> std::string::String {
4068 use std::clone::Clone;
4069 self.next_page_token.clone()
4070 }
4071}
4072
4073#[derive(Clone, Default, PartialEq)]
4076#[non_exhaustive]
4077pub struct GetMulticloudDataTransferConfigRequest {
4078 pub name: std::string::String,
4080
4081 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4082}
4083
4084impl GetMulticloudDataTransferConfigRequest {
4085 pub fn new() -> Self {
4086 std::default::Default::default()
4087 }
4088
4089 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4091 self.name = v.into();
4092 self
4093 }
4094}
4095
4096impl wkt::message::Message for GetMulticloudDataTransferConfigRequest {
4097 fn typename() -> &'static str {
4098 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferConfigRequest"
4099 }
4100}
4101
4102#[derive(Clone, Default, PartialEq)]
4104#[non_exhaustive]
4105pub struct CreateMulticloudDataTransferConfigRequest {
4106 pub parent: std::string::String,
4108
4109 pub multicloud_data_transfer_config_id: std::string::String,
4113
4114 pub multicloud_data_transfer_config:
4116 std::option::Option<crate::model::MulticloudDataTransferConfig>,
4117
4118 pub request_id: std::string::String,
4133
4134 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4135}
4136
4137impl CreateMulticloudDataTransferConfigRequest {
4138 pub fn new() -> Self {
4139 std::default::Default::default()
4140 }
4141
4142 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4144 self.parent = v.into();
4145 self
4146 }
4147
4148 pub fn set_multicloud_data_transfer_config_id<T: std::convert::Into<std::string::String>>(
4150 mut self,
4151 v: T,
4152 ) -> Self {
4153 self.multicloud_data_transfer_config_id = v.into();
4154 self
4155 }
4156
4157 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
4159 where
4160 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
4161 {
4162 self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
4163 self
4164 }
4165
4166 pub fn set_or_clear_multicloud_data_transfer_config<T>(
4168 mut self,
4169 v: std::option::Option<T>,
4170 ) -> Self
4171 where
4172 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
4173 {
4174 self.multicloud_data_transfer_config = v.map(|x| x.into());
4175 self
4176 }
4177
4178 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4180 self.request_id = v.into();
4181 self
4182 }
4183}
4184
4185impl wkt::message::Message for CreateMulticloudDataTransferConfigRequest {
4186 fn typename() -> &'static str {
4187 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateMulticloudDataTransferConfigRequest"
4188 }
4189}
4190
4191#[derive(Clone, Default, PartialEq)]
4193#[non_exhaustive]
4194pub struct UpdateMulticloudDataTransferConfigRequest {
4195 pub update_mask: std::option::Option<wkt::FieldMask>,
4201
4202 pub multicloud_data_transfer_config:
4204 std::option::Option<crate::model::MulticloudDataTransferConfig>,
4205
4206 pub request_id: std::string::String,
4221
4222 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4223}
4224
4225impl UpdateMulticloudDataTransferConfigRequest {
4226 pub fn new() -> Self {
4227 std::default::Default::default()
4228 }
4229
4230 pub fn set_update_mask<T>(mut self, v: T) -> Self
4232 where
4233 T: std::convert::Into<wkt::FieldMask>,
4234 {
4235 self.update_mask = std::option::Option::Some(v.into());
4236 self
4237 }
4238
4239 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4241 where
4242 T: std::convert::Into<wkt::FieldMask>,
4243 {
4244 self.update_mask = v.map(|x| x.into());
4245 self
4246 }
4247
4248 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
4250 where
4251 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
4252 {
4253 self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
4254 self
4255 }
4256
4257 pub fn set_or_clear_multicloud_data_transfer_config<T>(
4259 mut self,
4260 v: std::option::Option<T>,
4261 ) -> Self
4262 where
4263 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
4264 {
4265 self.multicloud_data_transfer_config = v.map(|x| x.into());
4266 self
4267 }
4268
4269 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4271 self.request_id = v.into();
4272 self
4273 }
4274}
4275
4276impl wkt::message::Message for UpdateMulticloudDataTransferConfigRequest {
4277 fn typename() -> &'static str {
4278 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateMulticloudDataTransferConfigRequest"
4279 }
4280}
4281
4282#[derive(Clone, Default, PartialEq)]
4284#[non_exhaustive]
4285pub struct DeleteMulticloudDataTransferConfigRequest {
4286 pub name: std::string::String,
4289
4290 pub request_id: std::string::String,
4305
4306 pub etag: std::string::String,
4310
4311 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4312}
4313
4314impl DeleteMulticloudDataTransferConfigRequest {
4315 pub fn new() -> Self {
4316 std::default::Default::default()
4317 }
4318
4319 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4321 self.name = v.into();
4322 self
4323 }
4324
4325 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4327 self.request_id = v.into();
4328 self
4329 }
4330
4331 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4333 self.etag = v.into();
4334 self
4335 }
4336}
4337
4338impl wkt::message::Message for DeleteMulticloudDataTransferConfigRequest {
4339 fn typename() -> &'static str {
4340 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteMulticloudDataTransferConfigRequest"
4341 }
4342}
4343
4344#[derive(Clone, Default, PartialEq)]
4348#[non_exhaustive]
4349pub struct Destination {
4350 pub name: std::string::String,
4354
4355 pub create_time: std::option::Option<wkt::Timestamp>,
4357
4358 pub update_time: std::option::Option<wkt::Timestamp>,
4360
4361 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4363
4364 pub etag: std::string::String,
4368
4369 pub description: std::string::String,
4371
4372 pub ip_prefix: std::string::String,
4375
4376 pub endpoints: std::vec::Vec<crate::model::destination::DestinationEndpoint>,
4379
4380 pub state_timeline: std::option::Option<crate::model::StateTimeline>,
4400
4401 pub uid: std::string::String,
4406
4407 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4408}
4409
4410impl Destination {
4411 pub fn new() -> Self {
4412 std::default::Default::default()
4413 }
4414
4415 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4417 self.name = v.into();
4418 self
4419 }
4420
4421 pub fn set_create_time<T>(mut self, v: T) -> Self
4423 where
4424 T: std::convert::Into<wkt::Timestamp>,
4425 {
4426 self.create_time = std::option::Option::Some(v.into());
4427 self
4428 }
4429
4430 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4432 where
4433 T: std::convert::Into<wkt::Timestamp>,
4434 {
4435 self.create_time = v.map(|x| x.into());
4436 self
4437 }
4438
4439 pub fn set_update_time<T>(mut self, v: T) -> Self
4441 where
4442 T: std::convert::Into<wkt::Timestamp>,
4443 {
4444 self.update_time = std::option::Option::Some(v.into());
4445 self
4446 }
4447
4448 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4450 where
4451 T: std::convert::Into<wkt::Timestamp>,
4452 {
4453 self.update_time = v.map(|x| x.into());
4454 self
4455 }
4456
4457 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4459 where
4460 T: std::iter::IntoIterator<Item = (K, V)>,
4461 K: std::convert::Into<std::string::String>,
4462 V: std::convert::Into<std::string::String>,
4463 {
4464 use std::iter::Iterator;
4465 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4466 self
4467 }
4468
4469 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4471 self.etag = v.into();
4472 self
4473 }
4474
4475 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4477 self.description = v.into();
4478 self
4479 }
4480
4481 pub fn set_ip_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4483 self.ip_prefix = v.into();
4484 self
4485 }
4486
4487 pub fn set_endpoints<T, V>(mut self, v: T) -> Self
4489 where
4490 T: std::iter::IntoIterator<Item = V>,
4491 V: std::convert::Into<crate::model::destination::DestinationEndpoint>,
4492 {
4493 use std::iter::Iterator;
4494 self.endpoints = v.into_iter().map(|i| i.into()).collect();
4495 self
4496 }
4497
4498 pub fn set_state_timeline<T>(mut self, v: T) -> Self
4500 where
4501 T: std::convert::Into<crate::model::StateTimeline>,
4502 {
4503 self.state_timeline = std::option::Option::Some(v.into());
4504 self
4505 }
4506
4507 pub fn set_or_clear_state_timeline<T>(mut self, v: std::option::Option<T>) -> Self
4509 where
4510 T: std::convert::Into<crate::model::StateTimeline>,
4511 {
4512 self.state_timeline = v.map(|x| x.into());
4513 self
4514 }
4515
4516 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4518 self.uid = v.into();
4519 self
4520 }
4521}
4522
4523impl wkt::message::Message for Destination {
4524 fn typename() -> &'static str {
4525 "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination"
4526 }
4527}
4528
4529pub mod destination {
4531 #[allow(unused_imports)]
4532 use super::*;
4533
4534 #[derive(Clone, Default, PartialEq)]
4536 #[non_exhaustive]
4537 pub struct DestinationEndpoint {
4538 pub asn: i64,
4540
4541 pub csp: std::string::String,
4543
4544 pub state: crate::model::destination::destination_endpoint::State,
4546
4547 pub update_time: std::option::Option<wkt::Timestamp>,
4549
4550 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4551 }
4552
4553 impl DestinationEndpoint {
4554 pub fn new() -> Self {
4555 std::default::Default::default()
4556 }
4557
4558 pub fn set_asn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4560 self.asn = v.into();
4561 self
4562 }
4563
4564 pub fn set_csp<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4566 self.csp = v.into();
4567 self
4568 }
4569
4570 pub fn set_state<
4572 T: std::convert::Into<crate::model::destination::destination_endpoint::State>,
4573 >(
4574 mut self,
4575 v: T,
4576 ) -> Self {
4577 self.state = v.into();
4578 self
4579 }
4580
4581 pub fn set_update_time<T>(mut self, v: T) -> Self
4583 where
4584 T: std::convert::Into<wkt::Timestamp>,
4585 {
4586 self.update_time = std::option::Option::Some(v.into());
4587 self
4588 }
4589
4590 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4592 where
4593 T: std::convert::Into<wkt::Timestamp>,
4594 {
4595 self.update_time = v.map(|x| x.into());
4596 self
4597 }
4598 }
4599
4600 impl wkt::message::Message for DestinationEndpoint {
4601 fn typename() -> &'static str {
4602 "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint"
4603 }
4604 }
4605
4606 pub mod destination_endpoint {
4608 #[allow(unused_imports)]
4609 use super::*;
4610
4611 #[derive(Clone, Debug, PartialEq)]
4627 #[non_exhaustive]
4628 pub enum State {
4629 Unspecified,
4631 Valid,
4633 Invalid,
4635 UnknownValue(state::UnknownValue),
4640 }
4641
4642 #[doc(hidden)]
4643 pub mod state {
4644 #[allow(unused_imports)]
4645 use super::*;
4646 #[derive(Clone, Debug, PartialEq)]
4647 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4648 }
4649
4650 impl State {
4651 pub fn value(&self) -> std::option::Option<i32> {
4656 match self {
4657 Self::Unspecified => std::option::Option::Some(0),
4658 Self::Valid => std::option::Option::Some(1),
4659 Self::Invalid => std::option::Option::Some(2),
4660 Self::UnknownValue(u) => u.0.value(),
4661 }
4662 }
4663
4664 pub fn name(&self) -> std::option::Option<&str> {
4669 match self {
4670 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4671 Self::Valid => std::option::Option::Some("VALID"),
4672 Self::Invalid => std::option::Option::Some("INVALID"),
4673 Self::UnknownValue(u) => u.0.name(),
4674 }
4675 }
4676 }
4677
4678 impl std::default::Default for State {
4679 fn default() -> Self {
4680 use std::convert::From;
4681 Self::from(0)
4682 }
4683 }
4684
4685 impl std::fmt::Display for State {
4686 fn fmt(
4687 &self,
4688 f: &mut std::fmt::Formatter<'_>,
4689 ) -> std::result::Result<(), std::fmt::Error> {
4690 wkt::internal::display_enum(f, self.name(), self.value())
4691 }
4692 }
4693
4694 impl std::convert::From<i32> for State {
4695 fn from(value: i32) -> Self {
4696 match value {
4697 0 => Self::Unspecified,
4698 1 => Self::Valid,
4699 2 => Self::Invalid,
4700 _ => Self::UnknownValue(state::UnknownValue(
4701 wkt::internal::UnknownEnumValue::Integer(value),
4702 )),
4703 }
4704 }
4705 }
4706
4707 impl std::convert::From<&str> for State {
4708 fn from(value: &str) -> Self {
4709 use std::string::ToString;
4710 match value {
4711 "STATE_UNSPECIFIED" => Self::Unspecified,
4712 "VALID" => Self::Valid,
4713 "INVALID" => Self::Invalid,
4714 _ => Self::UnknownValue(state::UnknownValue(
4715 wkt::internal::UnknownEnumValue::String(value.to_string()),
4716 )),
4717 }
4718 }
4719 }
4720
4721 impl serde::ser::Serialize for State {
4722 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4723 where
4724 S: serde::Serializer,
4725 {
4726 match self {
4727 Self::Unspecified => serializer.serialize_i32(0),
4728 Self::Valid => serializer.serialize_i32(1),
4729 Self::Invalid => serializer.serialize_i32(2),
4730 Self::UnknownValue(u) => u.0.serialize(serializer),
4731 }
4732 }
4733 }
4734
4735 impl<'de> serde::de::Deserialize<'de> for State {
4736 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4737 where
4738 D: serde::Deserializer<'de>,
4739 {
4740 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4741 ".google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint.State",
4742 ))
4743 }
4744 }
4745 }
4746}
4747
4748#[derive(Clone, Default, PartialEq)]
4750#[non_exhaustive]
4751pub struct ListDestinationsRequest {
4752 pub parent: std::string::String,
4754
4755 pub page_size: i32,
4757
4758 pub page_token: std::string::String,
4760
4761 pub filter: std::string::String,
4763
4764 pub order_by: std::string::String,
4766
4767 pub return_partial_success: bool,
4770
4771 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4772}
4773
4774impl ListDestinationsRequest {
4775 pub fn new() -> Self {
4776 std::default::Default::default()
4777 }
4778
4779 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4781 self.parent = v.into();
4782 self
4783 }
4784
4785 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4787 self.page_size = v.into();
4788 self
4789 }
4790
4791 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4793 self.page_token = v.into();
4794 self
4795 }
4796
4797 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4799 self.filter = v.into();
4800 self
4801 }
4802
4803 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4805 self.order_by = v.into();
4806 self
4807 }
4808
4809 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4811 self.return_partial_success = v.into();
4812 self
4813 }
4814}
4815
4816impl wkt::message::Message for ListDestinationsRequest {
4817 fn typename() -> &'static str {
4818 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsRequest"
4819 }
4820}
4821
4822#[derive(Clone, Default, PartialEq)]
4824#[non_exhaustive]
4825pub struct ListDestinationsResponse {
4826 pub destinations: std::vec::Vec<crate::model::Destination>,
4828
4829 pub next_page_token: std::string::String,
4831
4832 pub unreachable: std::vec::Vec<std::string::String>,
4834
4835 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4836}
4837
4838impl ListDestinationsResponse {
4839 pub fn new() -> Self {
4840 std::default::Default::default()
4841 }
4842
4843 pub fn set_destinations<T, V>(mut self, v: T) -> Self
4845 where
4846 T: std::iter::IntoIterator<Item = V>,
4847 V: std::convert::Into<crate::model::Destination>,
4848 {
4849 use std::iter::Iterator;
4850 self.destinations = v.into_iter().map(|i| i.into()).collect();
4851 self
4852 }
4853
4854 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4856 self.next_page_token = v.into();
4857 self
4858 }
4859
4860 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4862 where
4863 T: std::iter::IntoIterator<Item = V>,
4864 V: std::convert::Into<std::string::String>,
4865 {
4866 use std::iter::Iterator;
4867 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4868 self
4869 }
4870}
4871
4872impl wkt::message::Message for ListDestinationsResponse {
4873 fn typename() -> &'static str {
4874 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsResponse"
4875 }
4876}
4877
4878#[doc(hidden)]
4879impl gax::paginator::internal::PageableResponse for ListDestinationsResponse {
4880 type PageItem = crate::model::Destination;
4881
4882 fn items(self) -> std::vec::Vec<Self::PageItem> {
4883 self.destinations
4884 }
4885
4886 fn next_page_token(&self) -> std::string::String {
4887 use std::clone::Clone;
4888 self.next_page_token.clone()
4889 }
4890}
4891
4892#[derive(Clone, Default, PartialEq)]
4894#[non_exhaustive]
4895pub struct GetDestinationRequest {
4896 pub name: std::string::String,
4898
4899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4900}
4901
4902impl GetDestinationRequest {
4903 pub fn new() -> Self {
4904 std::default::Default::default()
4905 }
4906
4907 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4909 self.name = v.into();
4910 self
4911 }
4912}
4913
4914impl wkt::message::Message for GetDestinationRequest {
4915 fn typename() -> &'static str {
4916 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetDestinationRequest"
4917 }
4918}
4919
4920#[derive(Clone, Default, PartialEq)]
4922#[non_exhaustive]
4923pub struct CreateDestinationRequest {
4924 pub parent: std::string::String,
4926
4927 pub destination_id: std::string::String,
4930
4931 pub destination: std::option::Option<crate::model::Destination>,
4933
4934 pub request_id: std::string::String,
4949
4950 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4951}
4952
4953impl CreateDestinationRequest {
4954 pub fn new() -> Self {
4955 std::default::Default::default()
4956 }
4957
4958 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4960 self.parent = v.into();
4961 self
4962 }
4963
4964 pub fn set_destination_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4966 self.destination_id = v.into();
4967 self
4968 }
4969
4970 pub fn set_destination<T>(mut self, v: T) -> Self
4972 where
4973 T: std::convert::Into<crate::model::Destination>,
4974 {
4975 self.destination = std::option::Option::Some(v.into());
4976 self
4977 }
4978
4979 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
4981 where
4982 T: std::convert::Into<crate::model::Destination>,
4983 {
4984 self.destination = v.map(|x| x.into());
4985 self
4986 }
4987
4988 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4990 self.request_id = v.into();
4991 self
4992 }
4993}
4994
4995impl wkt::message::Message for CreateDestinationRequest {
4996 fn typename() -> &'static str {
4997 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateDestinationRequest"
4998 }
4999}
5000
5001#[derive(Clone, Default, PartialEq)]
5003#[non_exhaustive]
5004pub struct UpdateDestinationRequest {
5005 pub update_mask: std::option::Option<wkt::FieldMask>,
5011
5012 pub destination: std::option::Option<crate::model::Destination>,
5014
5015 pub request_id: std::string::String,
5028
5029 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5030}
5031
5032impl UpdateDestinationRequest {
5033 pub fn new() -> Self {
5034 std::default::Default::default()
5035 }
5036
5037 pub fn set_update_mask<T>(mut self, v: T) -> Self
5039 where
5040 T: std::convert::Into<wkt::FieldMask>,
5041 {
5042 self.update_mask = std::option::Option::Some(v.into());
5043 self
5044 }
5045
5046 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5048 where
5049 T: std::convert::Into<wkt::FieldMask>,
5050 {
5051 self.update_mask = v.map(|x| x.into());
5052 self
5053 }
5054
5055 pub fn set_destination<T>(mut self, v: T) -> Self
5057 where
5058 T: std::convert::Into<crate::model::Destination>,
5059 {
5060 self.destination = std::option::Option::Some(v.into());
5061 self
5062 }
5063
5064 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
5066 where
5067 T: std::convert::Into<crate::model::Destination>,
5068 {
5069 self.destination = v.map(|x| x.into());
5070 self
5071 }
5072
5073 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5075 self.request_id = v.into();
5076 self
5077 }
5078}
5079
5080impl wkt::message::Message for UpdateDestinationRequest {
5081 fn typename() -> &'static str {
5082 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateDestinationRequest"
5083 }
5084}
5085
5086#[derive(Clone, Default, PartialEq)]
5088#[non_exhaustive]
5089pub struct DeleteDestinationRequest {
5090 pub name: std::string::String,
5092
5093 pub request_id: std::string::String,
5106
5107 pub etag: std::string::String,
5111
5112 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5113}
5114
5115impl DeleteDestinationRequest {
5116 pub fn new() -> Self {
5117 std::default::Default::default()
5118 }
5119
5120 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5122 self.name = v.into();
5123 self
5124 }
5125
5126 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5128 self.request_id = v.into();
5129 self
5130 }
5131
5132 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5134 self.etag = v.into();
5135 self
5136 }
5137}
5138
5139impl wkt::message::Message for DeleteDestinationRequest {
5140 fn typename() -> &'static str {
5141 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteDestinationRequest"
5142 }
5143}
5144
5145#[derive(Clone, Default, PartialEq)]
5147#[non_exhaustive]
5148pub struct StateTimeline {
5149 pub states: std::vec::Vec<crate::model::state_timeline::StateMetadata>,
5151
5152 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5153}
5154
5155impl StateTimeline {
5156 pub fn new() -> Self {
5157 std::default::Default::default()
5158 }
5159
5160 pub fn set_states<T, V>(mut self, v: T) -> Self
5162 where
5163 T: std::iter::IntoIterator<Item = V>,
5164 V: std::convert::Into<crate::model::state_timeline::StateMetadata>,
5165 {
5166 use std::iter::Iterator;
5167 self.states = v.into_iter().map(|i| i.into()).collect();
5168 self
5169 }
5170}
5171
5172impl wkt::message::Message for StateTimeline {
5173 fn typename() -> &'static str {
5174 "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline"
5175 }
5176}
5177
5178pub mod state_timeline {
5180 #[allow(unused_imports)]
5181 use super::*;
5182
5183 #[derive(Clone, Default, PartialEq)]
5185 #[non_exhaustive]
5186 pub struct StateMetadata {
5187 pub state: crate::model::state_timeline::state_metadata::State,
5189
5190 pub effective_time: std::option::Option<wkt::Timestamp>,
5196
5197 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5198 }
5199
5200 impl StateMetadata {
5201 pub fn new() -> Self {
5202 std::default::Default::default()
5203 }
5204
5205 pub fn set_state<
5207 T: std::convert::Into<crate::model::state_timeline::state_metadata::State>,
5208 >(
5209 mut self,
5210 v: T,
5211 ) -> Self {
5212 self.state = v.into();
5213 self
5214 }
5215
5216 pub fn set_effective_time<T>(mut self, v: T) -> Self
5218 where
5219 T: std::convert::Into<wkt::Timestamp>,
5220 {
5221 self.effective_time = std::option::Option::Some(v.into());
5222 self
5223 }
5224
5225 pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
5227 where
5228 T: std::convert::Into<wkt::Timestamp>,
5229 {
5230 self.effective_time = v.map(|x| x.into());
5231 self
5232 }
5233 }
5234
5235 impl wkt::message::Message for StateMetadata {
5236 fn typename() -> &'static str {
5237 "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata"
5238 }
5239 }
5240
5241 pub mod state_metadata {
5243 #[allow(unused_imports)]
5244 use super::*;
5245
5246 #[derive(Clone, Debug, PartialEq)]
5262 #[non_exhaustive]
5263 pub enum State {
5264 Unspecified,
5266 Adding,
5268 Active,
5270 Deleting,
5272 Suspending,
5274 Suspended,
5276 UnknownValue(state::UnknownValue),
5281 }
5282
5283 #[doc(hidden)]
5284 pub mod state {
5285 #[allow(unused_imports)]
5286 use super::*;
5287 #[derive(Clone, Debug, PartialEq)]
5288 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5289 }
5290
5291 impl State {
5292 pub fn value(&self) -> std::option::Option<i32> {
5297 match self {
5298 Self::Unspecified => std::option::Option::Some(0),
5299 Self::Adding => std::option::Option::Some(1),
5300 Self::Active => std::option::Option::Some(2),
5301 Self::Deleting => std::option::Option::Some(3),
5302 Self::Suspending => std::option::Option::Some(4),
5303 Self::Suspended => std::option::Option::Some(5),
5304 Self::UnknownValue(u) => u.0.value(),
5305 }
5306 }
5307
5308 pub fn name(&self) -> std::option::Option<&str> {
5313 match self {
5314 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5315 Self::Adding => std::option::Option::Some("ADDING"),
5316 Self::Active => std::option::Option::Some("ACTIVE"),
5317 Self::Deleting => std::option::Option::Some("DELETING"),
5318 Self::Suspending => std::option::Option::Some("SUSPENDING"),
5319 Self::Suspended => std::option::Option::Some("SUSPENDED"),
5320 Self::UnknownValue(u) => u.0.name(),
5321 }
5322 }
5323 }
5324
5325 impl std::default::Default for State {
5326 fn default() -> Self {
5327 use std::convert::From;
5328 Self::from(0)
5329 }
5330 }
5331
5332 impl std::fmt::Display for State {
5333 fn fmt(
5334 &self,
5335 f: &mut std::fmt::Formatter<'_>,
5336 ) -> std::result::Result<(), std::fmt::Error> {
5337 wkt::internal::display_enum(f, self.name(), self.value())
5338 }
5339 }
5340
5341 impl std::convert::From<i32> for State {
5342 fn from(value: i32) -> Self {
5343 match value {
5344 0 => Self::Unspecified,
5345 1 => Self::Adding,
5346 2 => Self::Active,
5347 3 => Self::Deleting,
5348 4 => Self::Suspending,
5349 5 => Self::Suspended,
5350 _ => Self::UnknownValue(state::UnknownValue(
5351 wkt::internal::UnknownEnumValue::Integer(value),
5352 )),
5353 }
5354 }
5355 }
5356
5357 impl std::convert::From<&str> for State {
5358 fn from(value: &str) -> Self {
5359 use std::string::ToString;
5360 match value {
5361 "STATE_UNSPECIFIED" => Self::Unspecified,
5362 "ADDING" => Self::Adding,
5363 "ACTIVE" => Self::Active,
5364 "DELETING" => Self::Deleting,
5365 "SUSPENDING" => Self::Suspending,
5366 "SUSPENDED" => Self::Suspended,
5367 _ => Self::UnknownValue(state::UnknownValue(
5368 wkt::internal::UnknownEnumValue::String(value.to_string()),
5369 )),
5370 }
5371 }
5372 }
5373
5374 impl serde::ser::Serialize for State {
5375 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5376 where
5377 S: serde::Serializer,
5378 {
5379 match self {
5380 Self::Unspecified => serializer.serialize_i32(0),
5381 Self::Adding => serializer.serialize_i32(1),
5382 Self::Active => serializer.serialize_i32(2),
5383 Self::Deleting => serializer.serialize_i32(3),
5384 Self::Suspending => serializer.serialize_i32(4),
5385 Self::Suspended => serializer.serialize_i32(5),
5386 Self::UnknownValue(u) => u.0.serialize(serializer),
5387 }
5388 }
5389 }
5390
5391 impl<'de> serde::de::Deserialize<'de> for State {
5392 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5393 where
5394 D: serde::Deserializer<'de>,
5395 {
5396 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5397 ".google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata.State",
5398 ))
5399 }
5400 }
5401 }
5402}
5403
5404#[derive(Clone, Default, PartialEq)]
5407#[non_exhaustive]
5408pub struct MulticloudDataTransferSupportedService {
5409 pub name: std::string::String,
5411
5412 pub service_configs: std::vec::Vec<crate::model::ServiceConfig>,
5415
5416 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5417}
5418
5419impl MulticloudDataTransferSupportedService {
5420 pub fn new() -> Self {
5421 std::default::Default::default()
5422 }
5423
5424 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5426 self.name = v.into();
5427 self
5428 }
5429
5430 pub fn set_service_configs<T, V>(mut self, v: T) -> Self
5432 where
5433 T: std::iter::IntoIterator<Item = V>,
5434 V: std::convert::Into<crate::model::ServiceConfig>,
5435 {
5436 use std::iter::Iterator;
5437 self.service_configs = v.into_iter().map(|i| i.into()).collect();
5438 self
5439 }
5440}
5441
5442impl wkt::message::Message for MulticloudDataTransferSupportedService {
5443 fn typename() -> &'static str {
5444 "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferSupportedService"
5445 }
5446}
5447
5448#[derive(Clone, Default, PartialEq)]
5450#[non_exhaustive]
5451pub struct ServiceConfig {
5452 pub eligibility_criteria: crate::model::service_config::EligibilityCriteria,
5454
5455 pub support_end_time: std::option::Option<wkt::Timestamp>,
5458
5459 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5460}
5461
5462impl ServiceConfig {
5463 pub fn new() -> Self {
5464 std::default::Default::default()
5465 }
5466
5467 pub fn set_eligibility_criteria<
5469 T: std::convert::Into<crate::model::service_config::EligibilityCriteria>,
5470 >(
5471 mut self,
5472 v: T,
5473 ) -> Self {
5474 self.eligibility_criteria = v.into();
5475 self
5476 }
5477
5478 pub fn set_support_end_time<T>(mut self, v: T) -> Self
5480 where
5481 T: std::convert::Into<wkt::Timestamp>,
5482 {
5483 self.support_end_time = std::option::Option::Some(v.into());
5484 self
5485 }
5486
5487 pub fn set_or_clear_support_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5489 where
5490 T: std::convert::Into<wkt::Timestamp>,
5491 {
5492 self.support_end_time = v.map(|x| x.into());
5493 self
5494 }
5495}
5496
5497impl wkt::message::Message for ServiceConfig {
5498 fn typename() -> &'static str {
5499 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConfig"
5500 }
5501}
5502
5503pub mod service_config {
5505 #[allow(unused_imports)]
5506 use super::*;
5507
5508 #[derive(Clone, Debug, PartialEq)]
5524 #[non_exhaustive]
5525 pub enum EligibilityCriteria {
5526 Unspecified,
5529 NetworkServiceTierPremiumOnly,
5532 NetworkServiceTierStandardOnly,
5535 RequestEndpointRegionalEndpointOnly,
5538 UnknownValue(eligibility_criteria::UnknownValue),
5543 }
5544
5545 #[doc(hidden)]
5546 pub mod eligibility_criteria {
5547 #[allow(unused_imports)]
5548 use super::*;
5549 #[derive(Clone, Debug, PartialEq)]
5550 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5551 }
5552
5553 impl EligibilityCriteria {
5554 pub fn value(&self) -> std::option::Option<i32> {
5559 match self {
5560 Self::Unspecified => std::option::Option::Some(0),
5561 Self::NetworkServiceTierPremiumOnly => std::option::Option::Some(1),
5562 Self::NetworkServiceTierStandardOnly => std::option::Option::Some(2),
5563 Self::RequestEndpointRegionalEndpointOnly => std::option::Option::Some(3),
5564 Self::UnknownValue(u) => u.0.value(),
5565 }
5566 }
5567
5568 pub fn name(&self) -> std::option::Option<&str> {
5573 match self {
5574 Self::Unspecified => std::option::Option::Some("ELIGIBILITY_CRITERIA_UNSPECIFIED"),
5575 Self::NetworkServiceTierPremiumOnly => {
5576 std::option::Option::Some("NETWORK_SERVICE_TIER_PREMIUM_ONLY")
5577 }
5578 Self::NetworkServiceTierStandardOnly => {
5579 std::option::Option::Some("NETWORK_SERVICE_TIER_STANDARD_ONLY")
5580 }
5581 Self::RequestEndpointRegionalEndpointOnly => {
5582 std::option::Option::Some("REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY")
5583 }
5584 Self::UnknownValue(u) => u.0.name(),
5585 }
5586 }
5587 }
5588
5589 impl std::default::Default for EligibilityCriteria {
5590 fn default() -> Self {
5591 use std::convert::From;
5592 Self::from(0)
5593 }
5594 }
5595
5596 impl std::fmt::Display for EligibilityCriteria {
5597 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5598 wkt::internal::display_enum(f, self.name(), self.value())
5599 }
5600 }
5601
5602 impl std::convert::From<i32> for EligibilityCriteria {
5603 fn from(value: i32) -> Self {
5604 match value {
5605 0 => Self::Unspecified,
5606 1 => Self::NetworkServiceTierPremiumOnly,
5607 2 => Self::NetworkServiceTierStandardOnly,
5608 3 => Self::RequestEndpointRegionalEndpointOnly,
5609 _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
5610 wkt::internal::UnknownEnumValue::Integer(value),
5611 )),
5612 }
5613 }
5614 }
5615
5616 impl std::convert::From<&str> for EligibilityCriteria {
5617 fn from(value: &str) -> Self {
5618 use std::string::ToString;
5619 match value {
5620 "ELIGIBILITY_CRITERIA_UNSPECIFIED" => Self::Unspecified,
5621 "NETWORK_SERVICE_TIER_PREMIUM_ONLY" => Self::NetworkServiceTierPremiumOnly,
5622 "NETWORK_SERVICE_TIER_STANDARD_ONLY" => Self::NetworkServiceTierStandardOnly,
5623 "REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY" => {
5624 Self::RequestEndpointRegionalEndpointOnly
5625 }
5626 _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
5627 wkt::internal::UnknownEnumValue::String(value.to_string()),
5628 )),
5629 }
5630 }
5631 }
5632
5633 impl serde::ser::Serialize for EligibilityCriteria {
5634 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5635 where
5636 S: serde::Serializer,
5637 {
5638 match self {
5639 Self::Unspecified => serializer.serialize_i32(0),
5640 Self::NetworkServiceTierPremiumOnly => serializer.serialize_i32(1),
5641 Self::NetworkServiceTierStandardOnly => serializer.serialize_i32(2),
5642 Self::RequestEndpointRegionalEndpointOnly => serializer.serialize_i32(3),
5643 Self::UnknownValue(u) => u.0.serialize(serializer),
5644 }
5645 }
5646 }
5647
5648 impl<'de> serde::de::Deserialize<'de> for EligibilityCriteria {
5649 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5650 where
5651 D: serde::Deserializer<'de>,
5652 {
5653 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EligibilityCriteria>::new(
5654 ".google.cloud.networkconnectivity.v1.ServiceConfig.EligibilityCriteria",
5655 ))
5656 }
5657 }
5658}
5659
5660#[derive(Clone, Default, PartialEq)]
5663#[non_exhaustive]
5664pub struct GetMulticloudDataTransferSupportedServiceRequest {
5665 pub name: std::string::String,
5667
5668 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5669}
5670
5671impl GetMulticloudDataTransferSupportedServiceRequest {
5672 pub fn new() -> Self {
5673 std::default::Default::default()
5674 }
5675
5676 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5678 self.name = v.into();
5679 self
5680 }
5681}
5682
5683impl wkt::message::Message for GetMulticloudDataTransferSupportedServiceRequest {
5684 fn typename() -> &'static str {
5685 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferSupportedServiceRequest"
5686 }
5687}
5688
5689#[derive(Clone, Default, PartialEq)]
5692#[non_exhaustive]
5693pub struct ListMulticloudDataTransferSupportedServicesRequest {
5694 pub parent: std::string::String,
5696
5697 pub page_size: i32,
5699
5700 pub page_token: std::string::String,
5702
5703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5704}
5705
5706impl ListMulticloudDataTransferSupportedServicesRequest {
5707 pub fn new() -> Self {
5708 std::default::Default::default()
5709 }
5710
5711 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5713 self.parent = v.into();
5714 self
5715 }
5716
5717 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5719 self.page_size = v.into();
5720 self
5721 }
5722
5723 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5725 self.page_token = v.into();
5726 self
5727 }
5728}
5729
5730impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesRequest {
5731 fn typename() -> &'static str {
5732 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesRequest"
5733 }
5734}
5735
5736#[derive(Clone, Default, PartialEq)]
5739#[non_exhaustive]
5740pub struct ListMulticloudDataTransferSupportedServicesResponse {
5741 pub multicloud_data_transfer_supported_services:
5743 std::vec::Vec<crate::model::MulticloudDataTransferSupportedService>,
5744
5745 pub next_page_token: std::string::String,
5747
5748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5749}
5750
5751impl ListMulticloudDataTransferSupportedServicesResponse {
5752 pub fn new() -> Self {
5753 std::default::Default::default()
5754 }
5755
5756 pub fn set_multicloud_data_transfer_supported_services<T, V>(mut self, v: T) -> Self
5758 where
5759 T: std::iter::IntoIterator<Item = V>,
5760 V: std::convert::Into<crate::model::MulticloudDataTransferSupportedService>,
5761 {
5762 use std::iter::Iterator;
5763 self.multicloud_data_transfer_supported_services =
5764 v.into_iter().map(|i| i.into()).collect();
5765 self
5766 }
5767
5768 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5770 self.next_page_token = v.into();
5771 self
5772 }
5773}
5774
5775impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesResponse {
5776 fn typename() -> &'static str {
5777 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesResponse"
5778 }
5779}
5780
5781#[doc(hidden)]
5782impl gax::paginator::internal::PageableResponse
5783 for ListMulticloudDataTransferSupportedServicesResponse
5784{
5785 type PageItem = crate::model::MulticloudDataTransferSupportedService;
5786
5787 fn items(self) -> std::vec::Vec<Self::PageItem> {
5788 self.multicloud_data_transfer_supported_services
5789 }
5790
5791 fn next_page_token(&self) -> std::string::String {
5792 use std::clone::Clone;
5793 self.next_page_token.clone()
5794 }
5795}
5796
5797#[derive(Clone, Default, PartialEq)]
5804#[non_exhaustive]
5805pub struct Hub {
5806 pub name: std::string::String,
5810
5811 pub create_time: std::option::Option<wkt::Timestamp>,
5813
5814 pub update_time: std::option::Option<wkt::Timestamp>,
5816
5817 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5821
5822 pub description: std::string::String,
5824
5825 pub unique_id: std::string::String,
5829
5830 pub state: crate::model::State,
5832
5833 pub routing_vpcs: std::vec::Vec<crate::model::RoutingVPC>,
5838
5839 pub route_tables: std::vec::Vec<std::string::String>,
5846
5847 pub spoke_summary: std::option::Option<crate::model::SpokeSummary>,
5853
5854 pub policy_mode: crate::model::PolicyMode,
5858
5859 pub preset_topology: crate::model::PresetTopology,
5865
5866 pub export_psc: std::option::Option<bool>,
5871
5872 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5873}
5874
5875impl Hub {
5876 pub fn new() -> Self {
5877 std::default::Default::default()
5878 }
5879
5880 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5882 self.name = v.into();
5883 self
5884 }
5885
5886 pub fn set_create_time<T>(mut self, v: T) -> Self
5888 where
5889 T: std::convert::Into<wkt::Timestamp>,
5890 {
5891 self.create_time = std::option::Option::Some(v.into());
5892 self
5893 }
5894
5895 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5897 where
5898 T: std::convert::Into<wkt::Timestamp>,
5899 {
5900 self.create_time = v.map(|x| x.into());
5901 self
5902 }
5903
5904 pub fn set_update_time<T>(mut self, v: T) -> Self
5906 where
5907 T: std::convert::Into<wkt::Timestamp>,
5908 {
5909 self.update_time = std::option::Option::Some(v.into());
5910 self
5911 }
5912
5913 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5915 where
5916 T: std::convert::Into<wkt::Timestamp>,
5917 {
5918 self.update_time = v.map(|x| x.into());
5919 self
5920 }
5921
5922 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5924 where
5925 T: std::iter::IntoIterator<Item = (K, V)>,
5926 K: std::convert::Into<std::string::String>,
5927 V: std::convert::Into<std::string::String>,
5928 {
5929 use std::iter::Iterator;
5930 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5931 self
5932 }
5933
5934 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5936 self.description = v.into();
5937 self
5938 }
5939
5940 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5942 self.unique_id = v.into();
5943 self
5944 }
5945
5946 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
5948 self.state = v.into();
5949 self
5950 }
5951
5952 pub fn set_routing_vpcs<T, V>(mut self, v: T) -> Self
5954 where
5955 T: std::iter::IntoIterator<Item = V>,
5956 V: std::convert::Into<crate::model::RoutingVPC>,
5957 {
5958 use std::iter::Iterator;
5959 self.routing_vpcs = v.into_iter().map(|i| i.into()).collect();
5960 self
5961 }
5962
5963 pub fn set_route_tables<T, V>(mut self, v: T) -> Self
5965 where
5966 T: std::iter::IntoIterator<Item = V>,
5967 V: std::convert::Into<std::string::String>,
5968 {
5969 use std::iter::Iterator;
5970 self.route_tables = v.into_iter().map(|i| i.into()).collect();
5971 self
5972 }
5973
5974 pub fn set_spoke_summary<T>(mut self, v: T) -> Self
5976 where
5977 T: std::convert::Into<crate::model::SpokeSummary>,
5978 {
5979 self.spoke_summary = std::option::Option::Some(v.into());
5980 self
5981 }
5982
5983 pub fn set_or_clear_spoke_summary<T>(mut self, v: std::option::Option<T>) -> Self
5985 where
5986 T: std::convert::Into<crate::model::SpokeSummary>,
5987 {
5988 self.spoke_summary = v.map(|x| x.into());
5989 self
5990 }
5991
5992 pub fn set_policy_mode<T: std::convert::Into<crate::model::PolicyMode>>(
5994 mut self,
5995 v: T,
5996 ) -> Self {
5997 self.policy_mode = v.into();
5998 self
5999 }
6000
6001 pub fn set_preset_topology<T: std::convert::Into<crate::model::PresetTopology>>(
6003 mut self,
6004 v: T,
6005 ) -> Self {
6006 self.preset_topology = v.into();
6007 self
6008 }
6009
6010 pub fn set_export_psc<T>(mut self, v: T) -> Self
6012 where
6013 T: std::convert::Into<bool>,
6014 {
6015 self.export_psc = std::option::Option::Some(v.into());
6016 self
6017 }
6018
6019 pub fn set_or_clear_export_psc<T>(mut self, v: std::option::Option<T>) -> Self
6021 where
6022 T: std::convert::Into<bool>,
6023 {
6024 self.export_psc = v.map(|x| x.into());
6025 self
6026 }
6027}
6028
6029impl wkt::message::Message for Hub {
6030 fn typename() -> &'static str {
6031 "type.googleapis.com/google.cloud.networkconnectivity.v1.Hub"
6032 }
6033}
6034
6035#[derive(Clone, Default, PartialEq)]
6038#[non_exhaustive]
6039pub struct RoutingVPC {
6040 pub uri: std::string::String,
6042
6043 pub required_for_new_site_to_site_data_transfer_spokes: bool,
6049
6050 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6051}
6052
6053impl RoutingVPC {
6054 pub fn new() -> Self {
6055 std::default::Default::default()
6056 }
6057
6058 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6060 self.uri = v.into();
6061 self
6062 }
6063
6064 pub fn set_required_for_new_site_to_site_data_transfer_spokes<T: std::convert::Into<bool>>(
6066 mut self,
6067 v: T,
6068 ) -> Self {
6069 self.required_for_new_site_to_site_data_transfer_spokes = v.into();
6070 self
6071 }
6072}
6073
6074impl wkt::message::Message for RoutingVPC {
6075 fn typename() -> &'static str {
6076 "type.googleapis.com/google.cloud.networkconnectivity.v1.RoutingVPC"
6077 }
6078}
6079
6080#[derive(Clone, Default, PartialEq)]
6091#[non_exhaustive]
6092pub struct Spoke {
6093 pub name: std::string::String,
6097
6098 pub create_time: std::option::Option<wkt::Timestamp>,
6100
6101 pub update_time: std::option::Option<wkt::Timestamp>,
6103
6104 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6108
6109 pub description: std::string::String,
6111
6112 pub hub: std::string::String,
6114
6115 pub group: std::string::String,
6117
6118 pub linked_vpn_tunnels: std::option::Option<crate::model::LinkedVpnTunnels>,
6120
6121 pub linked_interconnect_attachments:
6123 std::option::Option<crate::model::LinkedInterconnectAttachments>,
6124
6125 pub linked_router_appliance_instances:
6127 std::option::Option<crate::model::LinkedRouterApplianceInstances>,
6128
6129 pub linked_vpc_network: std::option::Option<crate::model::LinkedVpcNetwork>,
6131
6132 pub linked_producer_vpc_network: std::option::Option<crate::model::LinkedProducerVpcNetwork>,
6134
6135 pub unique_id: std::string::String,
6139
6140 pub state: crate::model::State,
6142
6143 pub reasons: std::vec::Vec<crate::model::spoke::StateReason>,
6145
6146 pub spoke_type: crate::model::SpokeType,
6148
6149 pub etag: std::string::String,
6153
6154 pub field_paths_pending_update: std::vec::Vec<std::string::String>,
6156
6157 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6158}
6159
6160impl Spoke {
6161 pub fn new() -> Self {
6162 std::default::Default::default()
6163 }
6164
6165 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6167 self.name = v.into();
6168 self
6169 }
6170
6171 pub fn set_create_time<T>(mut self, v: T) -> Self
6173 where
6174 T: std::convert::Into<wkt::Timestamp>,
6175 {
6176 self.create_time = std::option::Option::Some(v.into());
6177 self
6178 }
6179
6180 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6182 where
6183 T: std::convert::Into<wkt::Timestamp>,
6184 {
6185 self.create_time = v.map(|x| x.into());
6186 self
6187 }
6188
6189 pub fn set_update_time<T>(mut self, v: T) -> Self
6191 where
6192 T: std::convert::Into<wkt::Timestamp>,
6193 {
6194 self.update_time = std::option::Option::Some(v.into());
6195 self
6196 }
6197
6198 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6200 where
6201 T: std::convert::Into<wkt::Timestamp>,
6202 {
6203 self.update_time = v.map(|x| x.into());
6204 self
6205 }
6206
6207 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6209 where
6210 T: std::iter::IntoIterator<Item = (K, V)>,
6211 K: std::convert::Into<std::string::String>,
6212 V: std::convert::Into<std::string::String>,
6213 {
6214 use std::iter::Iterator;
6215 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6216 self
6217 }
6218
6219 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6221 self.description = v.into();
6222 self
6223 }
6224
6225 pub fn set_hub<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6227 self.hub = v.into();
6228 self
6229 }
6230
6231 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6233 self.group = v.into();
6234 self
6235 }
6236
6237 pub fn set_linked_vpn_tunnels<T>(mut self, v: T) -> Self
6239 where
6240 T: std::convert::Into<crate::model::LinkedVpnTunnels>,
6241 {
6242 self.linked_vpn_tunnels = std::option::Option::Some(v.into());
6243 self
6244 }
6245
6246 pub fn set_or_clear_linked_vpn_tunnels<T>(mut self, v: std::option::Option<T>) -> Self
6248 where
6249 T: std::convert::Into<crate::model::LinkedVpnTunnels>,
6250 {
6251 self.linked_vpn_tunnels = v.map(|x| x.into());
6252 self
6253 }
6254
6255 pub fn set_linked_interconnect_attachments<T>(mut self, v: T) -> Self
6257 where
6258 T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
6259 {
6260 self.linked_interconnect_attachments = std::option::Option::Some(v.into());
6261 self
6262 }
6263
6264 pub fn set_or_clear_linked_interconnect_attachments<T>(
6266 mut self,
6267 v: std::option::Option<T>,
6268 ) -> Self
6269 where
6270 T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
6271 {
6272 self.linked_interconnect_attachments = v.map(|x| x.into());
6273 self
6274 }
6275
6276 pub fn set_linked_router_appliance_instances<T>(mut self, v: T) -> Self
6278 where
6279 T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
6280 {
6281 self.linked_router_appliance_instances = std::option::Option::Some(v.into());
6282 self
6283 }
6284
6285 pub fn set_or_clear_linked_router_appliance_instances<T>(
6287 mut self,
6288 v: std::option::Option<T>,
6289 ) -> Self
6290 where
6291 T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
6292 {
6293 self.linked_router_appliance_instances = v.map(|x| x.into());
6294 self
6295 }
6296
6297 pub fn set_linked_vpc_network<T>(mut self, v: T) -> Self
6299 where
6300 T: std::convert::Into<crate::model::LinkedVpcNetwork>,
6301 {
6302 self.linked_vpc_network = std::option::Option::Some(v.into());
6303 self
6304 }
6305
6306 pub fn set_or_clear_linked_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
6308 where
6309 T: std::convert::Into<crate::model::LinkedVpcNetwork>,
6310 {
6311 self.linked_vpc_network = v.map(|x| x.into());
6312 self
6313 }
6314
6315 pub fn set_linked_producer_vpc_network<T>(mut self, v: T) -> Self
6317 where
6318 T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
6319 {
6320 self.linked_producer_vpc_network = std::option::Option::Some(v.into());
6321 self
6322 }
6323
6324 pub fn set_or_clear_linked_producer_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
6326 where
6327 T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
6328 {
6329 self.linked_producer_vpc_network = v.map(|x| x.into());
6330 self
6331 }
6332
6333 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6335 self.unique_id = v.into();
6336 self
6337 }
6338
6339 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
6341 self.state = v.into();
6342 self
6343 }
6344
6345 pub fn set_reasons<T, V>(mut self, v: T) -> Self
6347 where
6348 T: std::iter::IntoIterator<Item = V>,
6349 V: std::convert::Into<crate::model::spoke::StateReason>,
6350 {
6351 use std::iter::Iterator;
6352 self.reasons = v.into_iter().map(|i| i.into()).collect();
6353 self
6354 }
6355
6356 pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(mut self, v: T) -> Self {
6358 self.spoke_type = v.into();
6359 self
6360 }
6361
6362 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6364 self.etag = v.into();
6365 self
6366 }
6367
6368 pub fn set_field_paths_pending_update<T, V>(mut self, v: T) -> Self
6370 where
6371 T: std::iter::IntoIterator<Item = V>,
6372 V: std::convert::Into<std::string::String>,
6373 {
6374 use std::iter::Iterator;
6375 self.field_paths_pending_update = v.into_iter().map(|i| i.into()).collect();
6376 self
6377 }
6378}
6379
6380impl wkt::message::Message for Spoke {
6381 fn typename() -> &'static str {
6382 "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke"
6383 }
6384}
6385
6386pub mod spoke {
6388 #[allow(unused_imports)]
6389 use super::*;
6390
6391 #[derive(Clone, Default, PartialEq)]
6393 #[non_exhaustive]
6394 pub struct StateReason {
6395 pub code: crate::model::spoke::state_reason::Code,
6397
6398 pub message: std::string::String,
6400
6401 pub user_details: std::string::String,
6403
6404 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6405 }
6406
6407 impl StateReason {
6408 pub fn new() -> Self {
6409 std::default::Default::default()
6410 }
6411
6412 pub fn set_code<T: std::convert::Into<crate::model::spoke::state_reason::Code>>(
6414 mut self,
6415 v: T,
6416 ) -> Self {
6417 self.code = v.into();
6418 self
6419 }
6420
6421 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6423 self.message = v.into();
6424 self
6425 }
6426
6427 pub fn set_user_details<T: std::convert::Into<std::string::String>>(
6429 mut self,
6430 v: T,
6431 ) -> Self {
6432 self.user_details = v.into();
6433 self
6434 }
6435 }
6436
6437 impl wkt::message::Message for StateReason {
6438 fn typename() -> &'static str {
6439 "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke.StateReason"
6440 }
6441 }
6442
6443 pub mod state_reason {
6445 #[allow(unused_imports)]
6446 use super::*;
6447
6448 #[derive(Clone, Debug, PartialEq)]
6464 #[non_exhaustive]
6465 pub enum Code {
6466 Unspecified,
6468 PendingReview,
6470 Rejected,
6472 Paused,
6474 Failed,
6477 UpdatePendingReview,
6479 UpdateRejected,
6481 UpdateFailed,
6484 UnknownValue(code::UnknownValue),
6489 }
6490
6491 #[doc(hidden)]
6492 pub mod code {
6493 #[allow(unused_imports)]
6494 use super::*;
6495 #[derive(Clone, Debug, PartialEq)]
6496 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6497 }
6498
6499 impl Code {
6500 pub fn value(&self) -> std::option::Option<i32> {
6505 match self {
6506 Self::Unspecified => std::option::Option::Some(0),
6507 Self::PendingReview => std::option::Option::Some(1),
6508 Self::Rejected => std::option::Option::Some(2),
6509 Self::Paused => std::option::Option::Some(3),
6510 Self::Failed => std::option::Option::Some(4),
6511 Self::UpdatePendingReview => std::option::Option::Some(5),
6512 Self::UpdateRejected => std::option::Option::Some(6),
6513 Self::UpdateFailed => std::option::Option::Some(7),
6514 Self::UnknownValue(u) => u.0.value(),
6515 }
6516 }
6517
6518 pub fn name(&self) -> std::option::Option<&str> {
6523 match self {
6524 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
6525 Self::PendingReview => std::option::Option::Some("PENDING_REVIEW"),
6526 Self::Rejected => std::option::Option::Some("REJECTED"),
6527 Self::Paused => std::option::Option::Some("PAUSED"),
6528 Self::Failed => std::option::Option::Some("FAILED"),
6529 Self::UpdatePendingReview => std::option::Option::Some("UPDATE_PENDING_REVIEW"),
6530 Self::UpdateRejected => std::option::Option::Some("UPDATE_REJECTED"),
6531 Self::UpdateFailed => std::option::Option::Some("UPDATE_FAILED"),
6532 Self::UnknownValue(u) => u.0.name(),
6533 }
6534 }
6535 }
6536
6537 impl std::default::Default for Code {
6538 fn default() -> Self {
6539 use std::convert::From;
6540 Self::from(0)
6541 }
6542 }
6543
6544 impl std::fmt::Display for Code {
6545 fn fmt(
6546 &self,
6547 f: &mut std::fmt::Formatter<'_>,
6548 ) -> std::result::Result<(), std::fmt::Error> {
6549 wkt::internal::display_enum(f, self.name(), self.value())
6550 }
6551 }
6552
6553 impl std::convert::From<i32> for Code {
6554 fn from(value: i32) -> Self {
6555 match value {
6556 0 => Self::Unspecified,
6557 1 => Self::PendingReview,
6558 2 => Self::Rejected,
6559 3 => Self::Paused,
6560 4 => Self::Failed,
6561 5 => Self::UpdatePendingReview,
6562 6 => Self::UpdateRejected,
6563 7 => Self::UpdateFailed,
6564 _ => Self::UnknownValue(code::UnknownValue(
6565 wkt::internal::UnknownEnumValue::Integer(value),
6566 )),
6567 }
6568 }
6569 }
6570
6571 impl std::convert::From<&str> for Code {
6572 fn from(value: &str) -> Self {
6573 use std::string::ToString;
6574 match value {
6575 "CODE_UNSPECIFIED" => Self::Unspecified,
6576 "PENDING_REVIEW" => Self::PendingReview,
6577 "REJECTED" => Self::Rejected,
6578 "PAUSED" => Self::Paused,
6579 "FAILED" => Self::Failed,
6580 "UPDATE_PENDING_REVIEW" => Self::UpdatePendingReview,
6581 "UPDATE_REJECTED" => Self::UpdateRejected,
6582 "UPDATE_FAILED" => Self::UpdateFailed,
6583 _ => Self::UnknownValue(code::UnknownValue(
6584 wkt::internal::UnknownEnumValue::String(value.to_string()),
6585 )),
6586 }
6587 }
6588 }
6589
6590 impl serde::ser::Serialize for Code {
6591 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6592 where
6593 S: serde::Serializer,
6594 {
6595 match self {
6596 Self::Unspecified => serializer.serialize_i32(0),
6597 Self::PendingReview => serializer.serialize_i32(1),
6598 Self::Rejected => serializer.serialize_i32(2),
6599 Self::Paused => serializer.serialize_i32(3),
6600 Self::Failed => serializer.serialize_i32(4),
6601 Self::UpdatePendingReview => serializer.serialize_i32(5),
6602 Self::UpdateRejected => serializer.serialize_i32(6),
6603 Self::UpdateFailed => serializer.serialize_i32(7),
6604 Self::UnknownValue(u) => u.0.serialize(serializer),
6605 }
6606 }
6607 }
6608
6609 impl<'de> serde::de::Deserialize<'de> for Code {
6610 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6611 where
6612 D: serde::Deserializer<'de>,
6613 {
6614 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
6615 ".google.cloud.networkconnectivity.v1.Spoke.StateReason.Code",
6616 ))
6617 }
6618 }
6619 }
6620}
6621
6622#[derive(Clone, Default, PartialEq)]
6623#[non_exhaustive]
6624pub struct RouteTable {
6625 pub name: std::string::String,
6629
6630 pub create_time: std::option::Option<wkt::Timestamp>,
6632
6633 pub update_time: std::option::Option<wkt::Timestamp>,
6635
6636 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6640
6641 pub description: std::string::String,
6643
6644 pub uid: std::string::String,
6649
6650 pub state: crate::model::State,
6652
6653 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6654}
6655
6656impl RouteTable {
6657 pub fn new() -> Self {
6658 std::default::Default::default()
6659 }
6660
6661 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6663 self.name = v.into();
6664 self
6665 }
6666
6667 pub fn set_create_time<T>(mut self, v: T) -> Self
6669 where
6670 T: std::convert::Into<wkt::Timestamp>,
6671 {
6672 self.create_time = std::option::Option::Some(v.into());
6673 self
6674 }
6675
6676 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6678 where
6679 T: std::convert::Into<wkt::Timestamp>,
6680 {
6681 self.create_time = v.map(|x| x.into());
6682 self
6683 }
6684
6685 pub fn set_update_time<T>(mut self, v: T) -> Self
6687 where
6688 T: std::convert::Into<wkt::Timestamp>,
6689 {
6690 self.update_time = std::option::Option::Some(v.into());
6691 self
6692 }
6693
6694 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6696 where
6697 T: std::convert::Into<wkt::Timestamp>,
6698 {
6699 self.update_time = v.map(|x| x.into());
6700 self
6701 }
6702
6703 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6705 where
6706 T: std::iter::IntoIterator<Item = (K, V)>,
6707 K: std::convert::Into<std::string::String>,
6708 V: std::convert::Into<std::string::String>,
6709 {
6710 use std::iter::Iterator;
6711 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6712 self
6713 }
6714
6715 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6717 self.description = v.into();
6718 self
6719 }
6720
6721 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6723 self.uid = v.into();
6724 self
6725 }
6726
6727 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
6729 self.state = v.into();
6730 self
6731 }
6732}
6733
6734impl wkt::message::Message for RouteTable {
6735 fn typename() -> &'static str {
6736 "type.googleapis.com/google.cloud.networkconnectivity.v1.RouteTable"
6737 }
6738}
6739
6740#[derive(Clone, Default, PartialEq)]
6743#[non_exhaustive]
6744pub struct Route {
6745 pub name: std::string::String,
6749
6750 pub create_time: std::option::Option<wkt::Timestamp>,
6752
6753 pub update_time: std::option::Option<wkt::Timestamp>,
6755
6756 pub ip_cidr_range: std::string::String,
6758
6759 pub r#type: crate::model::RouteType,
6762
6763 pub next_hop_vpc_network: std::option::Option<crate::model::NextHopVpcNetwork>,
6765
6766 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6770
6771 pub description: std::string::String,
6773
6774 pub uid: std::string::String,
6779
6780 pub state: crate::model::State,
6782
6783 pub spoke: std::string::String,
6786
6787 pub location: std::string::String,
6791
6792 pub priority: i64,
6796
6797 pub next_hop_vpn_tunnel: std::option::Option<crate::model::NextHopVPNTunnel>,
6799
6800 pub next_hop_router_appliance_instance:
6803 std::option::Option<crate::model::NextHopRouterApplianceInstance>,
6804
6805 pub next_hop_interconnect_attachment:
6807 std::option::Option<crate::model::NextHopInterconnectAttachment>,
6808
6809 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6810}
6811
6812impl Route {
6813 pub fn new() -> Self {
6814 std::default::Default::default()
6815 }
6816
6817 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6819 self.name = v.into();
6820 self
6821 }
6822
6823 pub fn set_create_time<T>(mut self, v: T) -> Self
6825 where
6826 T: std::convert::Into<wkt::Timestamp>,
6827 {
6828 self.create_time = std::option::Option::Some(v.into());
6829 self
6830 }
6831
6832 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6834 where
6835 T: std::convert::Into<wkt::Timestamp>,
6836 {
6837 self.create_time = v.map(|x| x.into());
6838 self
6839 }
6840
6841 pub fn set_update_time<T>(mut self, v: T) -> Self
6843 where
6844 T: std::convert::Into<wkt::Timestamp>,
6845 {
6846 self.update_time = std::option::Option::Some(v.into());
6847 self
6848 }
6849
6850 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6852 where
6853 T: std::convert::Into<wkt::Timestamp>,
6854 {
6855 self.update_time = v.map(|x| x.into());
6856 self
6857 }
6858
6859 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6861 self.ip_cidr_range = v.into();
6862 self
6863 }
6864
6865 pub fn set_type<T: std::convert::Into<crate::model::RouteType>>(mut self, v: T) -> Self {
6867 self.r#type = v.into();
6868 self
6869 }
6870
6871 pub fn set_next_hop_vpc_network<T>(mut self, v: T) -> Self
6873 where
6874 T: std::convert::Into<crate::model::NextHopVpcNetwork>,
6875 {
6876 self.next_hop_vpc_network = std::option::Option::Some(v.into());
6877 self
6878 }
6879
6880 pub fn set_or_clear_next_hop_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
6882 where
6883 T: std::convert::Into<crate::model::NextHopVpcNetwork>,
6884 {
6885 self.next_hop_vpc_network = v.map(|x| x.into());
6886 self
6887 }
6888
6889 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6891 where
6892 T: std::iter::IntoIterator<Item = (K, V)>,
6893 K: std::convert::Into<std::string::String>,
6894 V: std::convert::Into<std::string::String>,
6895 {
6896 use std::iter::Iterator;
6897 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6898 self
6899 }
6900
6901 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6903 self.description = v.into();
6904 self
6905 }
6906
6907 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6909 self.uid = v.into();
6910 self
6911 }
6912
6913 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
6915 self.state = v.into();
6916 self
6917 }
6918
6919 pub fn set_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6921 self.spoke = v.into();
6922 self
6923 }
6924
6925 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6927 self.location = v.into();
6928 self
6929 }
6930
6931 pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6933 self.priority = v.into();
6934 self
6935 }
6936
6937 pub fn set_next_hop_vpn_tunnel<T>(mut self, v: T) -> Self
6939 where
6940 T: std::convert::Into<crate::model::NextHopVPNTunnel>,
6941 {
6942 self.next_hop_vpn_tunnel = std::option::Option::Some(v.into());
6943 self
6944 }
6945
6946 pub fn set_or_clear_next_hop_vpn_tunnel<T>(mut self, v: std::option::Option<T>) -> Self
6948 where
6949 T: std::convert::Into<crate::model::NextHopVPNTunnel>,
6950 {
6951 self.next_hop_vpn_tunnel = v.map(|x| x.into());
6952 self
6953 }
6954
6955 pub fn set_next_hop_router_appliance_instance<T>(mut self, v: T) -> Self
6957 where
6958 T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
6959 {
6960 self.next_hop_router_appliance_instance = std::option::Option::Some(v.into());
6961 self
6962 }
6963
6964 pub fn set_or_clear_next_hop_router_appliance_instance<T>(
6966 mut self,
6967 v: std::option::Option<T>,
6968 ) -> Self
6969 where
6970 T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
6971 {
6972 self.next_hop_router_appliance_instance = v.map(|x| x.into());
6973 self
6974 }
6975
6976 pub fn set_next_hop_interconnect_attachment<T>(mut self, v: T) -> Self
6978 where
6979 T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
6980 {
6981 self.next_hop_interconnect_attachment = std::option::Option::Some(v.into());
6982 self
6983 }
6984
6985 pub fn set_or_clear_next_hop_interconnect_attachment<T>(
6987 mut self,
6988 v: std::option::Option<T>,
6989 ) -> Self
6990 where
6991 T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
6992 {
6993 self.next_hop_interconnect_attachment = v.map(|x| x.into());
6994 self
6995 }
6996}
6997
6998impl wkt::message::Message for Route {
6999 fn typename() -> &'static str {
7000 "type.googleapis.com/google.cloud.networkconnectivity.v1.Route"
7001 }
7002}
7003
7004#[derive(Clone, Default, PartialEq)]
7006#[non_exhaustive]
7007pub struct Group {
7008 pub name: std::string::String,
7012
7013 pub create_time: std::option::Option<wkt::Timestamp>,
7015
7016 pub update_time: std::option::Option<wkt::Timestamp>,
7018
7019 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7023
7024 pub description: std::string::String,
7026
7027 pub uid: std::string::String,
7032
7033 pub state: crate::model::State,
7035
7036 pub auto_accept: std::option::Option<crate::model::AutoAccept>,
7038
7039 pub route_table: std::string::String,
7043
7044 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7045}
7046
7047impl Group {
7048 pub fn new() -> Self {
7049 std::default::Default::default()
7050 }
7051
7052 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7054 self.name = v.into();
7055 self
7056 }
7057
7058 pub fn set_create_time<T>(mut self, v: T) -> Self
7060 where
7061 T: std::convert::Into<wkt::Timestamp>,
7062 {
7063 self.create_time = std::option::Option::Some(v.into());
7064 self
7065 }
7066
7067 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7069 where
7070 T: std::convert::Into<wkt::Timestamp>,
7071 {
7072 self.create_time = v.map(|x| x.into());
7073 self
7074 }
7075
7076 pub fn set_update_time<T>(mut self, v: T) -> Self
7078 where
7079 T: std::convert::Into<wkt::Timestamp>,
7080 {
7081 self.update_time = std::option::Option::Some(v.into());
7082 self
7083 }
7084
7085 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7087 where
7088 T: std::convert::Into<wkt::Timestamp>,
7089 {
7090 self.update_time = v.map(|x| x.into());
7091 self
7092 }
7093
7094 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7096 where
7097 T: std::iter::IntoIterator<Item = (K, V)>,
7098 K: std::convert::Into<std::string::String>,
7099 V: std::convert::Into<std::string::String>,
7100 {
7101 use std::iter::Iterator;
7102 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7103 self
7104 }
7105
7106 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7108 self.description = v.into();
7109 self
7110 }
7111
7112 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7114 self.uid = v.into();
7115 self
7116 }
7117
7118 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
7120 self.state = v.into();
7121 self
7122 }
7123
7124 pub fn set_auto_accept<T>(mut self, v: T) -> Self
7126 where
7127 T: std::convert::Into<crate::model::AutoAccept>,
7128 {
7129 self.auto_accept = std::option::Option::Some(v.into());
7130 self
7131 }
7132
7133 pub fn set_or_clear_auto_accept<T>(mut self, v: std::option::Option<T>) -> Self
7135 where
7136 T: std::convert::Into<crate::model::AutoAccept>,
7137 {
7138 self.auto_accept = v.map(|x| x.into());
7139 self
7140 }
7141
7142 pub fn set_route_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7144 self.route_table = v.into();
7145 self
7146 }
7147}
7148
7149impl wkt::message::Message for Group {
7150 fn typename() -> &'static str {
7151 "type.googleapis.com/google.cloud.networkconnectivity.v1.Group"
7152 }
7153}
7154
7155#[derive(Clone, Default, PartialEq)]
7163#[non_exhaustive]
7164pub struct AutoAccept {
7165 pub auto_accept_projects: std::vec::Vec<std::string::String>,
7169
7170 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7171}
7172
7173impl AutoAccept {
7174 pub fn new() -> Self {
7175 std::default::Default::default()
7176 }
7177
7178 pub fn set_auto_accept_projects<T, V>(mut self, v: T) -> Self
7180 where
7181 T: std::iter::IntoIterator<Item = V>,
7182 V: std::convert::Into<std::string::String>,
7183 {
7184 use std::iter::Iterator;
7185 self.auto_accept_projects = v.into_iter().map(|i| i.into()).collect();
7186 self
7187 }
7188}
7189
7190impl wkt::message::Message for AutoAccept {
7191 fn typename() -> &'static str {
7192 "type.googleapis.com/google.cloud.networkconnectivity.v1.AutoAccept"
7193 }
7194}
7195
7196#[derive(Clone, Default, PartialEq)]
7202#[non_exhaustive]
7203pub struct ListHubsRequest {
7204 pub parent: std::string::String,
7206
7207 pub page_size: i32,
7209
7210 pub page_token: std::string::String,
7212
7213 pub filter: std::string::String,
7215
7216 pub order_by: std::string::String,
7218
7219 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7220}
7221
7222impl ListHubsRequest {
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 ListHubsRequest {
7259 fn typename() -> &'static str {
7260 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsRequest"
7261 }
7262}
7263
7264#[derive(Clone, Default, PartialEq)]
7270#[non_exhaustive]
7271pub struct ListHubsResponse {
7272 pub hubs: std::vec::Vec<crate::model::Hub>,
7274
7275 pub next_page_token: std::string::String,
7279
7280 pub unreachable: std::vec::Vec<std::string::String>,
7282
7283 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7284}
7285
7286impl ListHubsResponse {
7287 pub fn new() -> Self {
7288 std::default::Default::default()
7289 }
7290
7291 pub fn set_hubs<T, V>(mut self, v: T) -> Self
7293 where
7294 T: std::iter::IntoIterator<Item = V>,
7295 V: std::convert::Into<crate::model::Hub>,
7296 {
7297 use std::iter::Iterator;
7298 self.hubs = v.into_iter().map(|i| i.into()).collect();
7299 self
7300 }
7301
7302 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7304 self.next_page_token = v.into();
7305 self
7306 }
7307
7308 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7310 where
7311 T: std::iter::IntoIterator<Item = V>,
7312 V: std::convert::Into<std::string::String>,
7313 {
7314 use std::iter::Iterator;
7315 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7316 self
7317 }
7318}
7319
7320impl wkt::message::Message for ListHubsResponse {
7321 fn typename() -> &'static str {
7322 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsResponse"
7323 }
7324}
7325
7326#[doc(hidden)]
7327impl gax::paginator::internal::PageableResponse for ListHubsResponse {
7328 type PageItem = crate::model::Hub;
7329
7330 fn items(self) -> std::vec::Vec<Self::PageItem> {
7331 self.hubs
7332 }
7333
7334 fn next_page_token(&self) -> std::string::String {
7335 use std::clone::Clone;
7336 self.next_page_token.clone()
7337 }
7338}
7339
7340#[derive(Clone, Default, PartialEq)]
7346#[non_exhaustive]
7347pub struct GetHubRequest {
7348 pub name: std::string::String,
7350
7351 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7352}
7353
7354impl GetHubRequest {
7355 pub fn new() -> Self {
7356 std::default::Default::default()
7357 }
7358
7359 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7361 self.name = v.into();
7362 self
7363 }
7364}
7365
7366impl wkt::message::Message for GetHubRequest {
7367 fn typename() -> &'static str {
7368 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetHubRequest"
7369 }
7370}
7371
7372#[derive(Clone, Default, PartialEq)]
7378#[non_exhaustive]
7379pub struct CreateHubRequest {
7380 pub parent: std::string::String,
7382
7383 pub hub_id: std::string::String,
7385
7386 pub hub: std::option::Option<crate::model::Hub>,
7388
7389 pub request_id: std::string::String,
7404
7405 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7406}
7407
7408impl CreateHubRequest {
7409 pub fn new() -> Self {
7410 std::default::Default::default()
7411 }
7412
7413 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7415 self.parent = v.into();
7416 self
7417 }
7418
7419 pub fn set_hub_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7421 self.hub_id = v.into();
7422 self
7423 }
7424
7425 pub fn set_hub<T>(mut self, v: T) -> Self
7427 where
7428 T: std::convert::Into<crate::model::Hub>,
7429 {
7430 self.hub = std::option::Option::Some(v.into());
7431 self
7432 }
7433
7434 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
7436 where
7437 T: std::convert::Into<crate::model::Hub>,
7438 {
7439 self.hub = v.map(|x| x.into());
7440 self
7441 }
7442
7443 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7445 self.request_id = v.into();
7446 self
7447 }
7448}
7449
7450impl wkt::message::Message for CreateHubRequest {
7451 fn typename() -> &'static str {
7452 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateHubRequest"
7453 }
7454}
7455
7456#[derive(Clone, Default, PartialEq)]
7462#[non_exhaustive]
7463pub struct UpdateHubRequest {
7464 pub update_mask: std::option::Option<wkt::FieldMask>,
7470
7471 pub hub: std::option::Option<crate::model::Hub>,
7473
7474 pub request_id: std::string::String,
7489
7490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7491}
7492
7493impl UpdateHubRequest {
7494 pub fn new() -> Self {
7495 std::default::Default::default()
7496 }
7497
7498 pub fn set_update_mask<T>(mut self, v: T) -> Self
7500 where
7501 T: std::convert::Into<wkt::FieldMask>,
7502 {
7503 self.update_mask = std::option::Option::Some(v.into());
7504 self
7505 }
7506
7507 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7509 where
7510 T: std::convert::Into<wkt::FieldMask>,
7511 {
7512 self.update_mask = v.map(|x| x.into());
7513 self
7514 }
7515
7516 pub fn set_hub<T>(mut self, v: T) -> Self
7518 where
7519 T: std::convert::Into<crate::model::Hub>,
7520 {
7521 self.hub = std::option::Option::Some(v.into());
7522 self
7523 }
7524
7525 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
7527 where
7528 T: std::convert::Into<crate::model::Hub>,
7529 {
7530 self.hub = v.map(|x| x.into());
7531 self
7532 }
7533
7534 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7536 self.request_id = v.into();
7537 self
7538 }
7539}
7540
7541impl wkt::message::Message for UpdateHubRequest {
7542 fn typename() -> &'static str {
7543 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateHubRequest"
7544 }
7545}
7546
7547#[derive(Clone, Default, PartialEq)]
7552#[non_exhaustive]
7553pub struct DeleteHubRequest {
7554 pub name: std::string::String,
7556
7557 pub request_id: std::string::String,
7572
7573 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7574}
7575
7576impl DeleteHubRequest {
7577 pub fn new() -> Self {
7578 std::default::Default::default()
7579 }
7580
7581 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7583 self.name = v.into();
7584 self
7585 }
7586
7587 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7589 self.request_id = v.into();
7590 self
7591 }
7592}
7593
7594impl wkt::message::Message for DeleteHubRequest {
7595 fn typename() -> &'static str {
7596 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteHubRequest"
7597 }
7598}
7599
7600#[derive(Clone, Default, PartialEq)]
7605#[non_exhaustive]
7606pub struct ListHubSpokesRequest {
7607 pub name: std::string::String,
7609
7610 pub spoke_locations: std::vec::Vec<std::string::String>,
7619
7620 pub page_size: i32,
7622
7623 pub page_token: std::string::String,
7625
7626 pub filter: std::string::String,
7628
7629 pub order_by: std::string::String,
7631
7632 pub view: crate::model::list_hub_spokes_request::SpokeView,
7636
7637 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7638}
7639
7640impl ListHubSpokesRequest {
7641 pub fn new() -> Self {
7642 std::default::Default::default()
7643 }
7644
7645 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7647 self.name = v.into();
7648 self
7649 }
7650
7651 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
7653 where
7654 T: std::iter::IntoIterator<Item = V>,
7655 V: std::convert::Into<std::string::String>,
7656 {
7657 use std::iter::Iterator;
7658 self.spoke_locations = v.into_iter().map(|i| i.into()).collect();
7659 self
7660 }
7661
7662 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7664 self.page_size = v.into();
7665 self
7666 }
7667
7668 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7670 self.page_token = v.into();
7671 self
7672 }
7673
7674 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7676 self.filter = v.into();
7677 self
7678 }
7679
7680 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7682 self.order_by = v.into();
7683 self
7684 }
7685
7686 pub fn set_view<T: std::convert::Into<crate::model::list_hub_spokes_request::SpokeView>>(
7688 mut self,
7689 v: T,
7690 ) -> Self {
7691 self.view = v.into();
7692 self
7693 }
7694}
7695
7696impl wkt::message::Message for ListHubSpokesRequest {
7697 fn typename() -> &'static str {
7698 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesRequest"
7699 }
7700}
7701
7702pub mod list_hub_spokes_request {
7704 #[allow(unused_imports)]
7705 use super::*;
7706
7707 #[derive(Clone, Debug, PartialEq)]
7723 #[non_exhaustive]
7724 pub enum SpokeView {
7725 Unspecified,
7728 Basic,
7731 Detailed,
7735 UnknownValue(spoke_view::UnknownValue),
7740 }
7741
7742 #[doc(hidden)]
7743 pub mod spoke_view {
7744 #[allow(unused_imports)]
7745 use super::*;
7746 #[derive(Clone, Debug, PartialEq)]
7747 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7748 }
7749
7750 impl SpokeView {
7751 pub fn value(&self) -> std::option::Option<i32> {
7756 match self {
7757 Self::Unspecified => std::option::Option::Some(0),
7758 Self::Basic => std::option::Option::Some(1),
7759 Self::Detailed => std::option::Option::Some(2),
7760 Self::UnknownValue(u) => u.0.value(),
7761 }
7762 }
7763
7764 pub fn name(&self) -> std::option::Option<&str> {
7769 match self {
7770 Self::Unspecified => std::option::Option::Some("SPOKE_VIEW_UNSPECIFIED"),
7771 Self::Basic => std::option::Option::Some("BASIC"),
7772 Self::Detailed => std::option::Option::Some("DETAILED"),
7773 Self::UnknownValue(u) => u.0.name(),
7774 }
7775 }
7776 }
7777
7778 impl std::default::Default for SpokeView {
7779 fn default() -> Self {
7780 use std::convert::From;
7781 Self::from(0)
7782 }
7783 }
7784
7785 impl std::fmt::Display for SpokeView {
7786 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7787 wkt::internal::display_enum(f, self.name(), self.value())
7788 }
7789 }
7790
7791 impl std::convert::From<i32> for SpokeView {
7792 fn from(value: i32) -> Self {
7793 match value {
7794 0 => Self::Unspecified,
7795 1 => Self::Basic,
7796 2 => Self::Detailed,
7797 _ => Self::UnknownValue(spoke_view::UnknownValue(
7798 wkt::internal::UnknownEnumValue::Integer(value),
7799 )),
7800 }
7801 }
7802 }
7803
7804 impl std::convert::From<&str> for SpokeView {
7805 fn from(value: &str) -> Self {
7806 use std::string::ToString;
7807 match value {
7808 "SPOKE_VIEW_UNSPECIFIED" => Self::Unspecified,
7809 "BASIC" => Self::Basic,
7810 "DETAILED" => Self::Detailed,
7811 _ => Self::UnknownValue(spoke_view::UnknownValue(
7812 wkt::internal::UnknownEnumValue::String(value.to_string()),
7813 )),
7814 }
7815 }
7816 }
7817
7818 impl serde::ser::Serialize for SpokeView {
7819 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7820 where
7821 S: serde::Serializer,
7822 {
7823 match self {
7824 Self::Unspecified => serializer.serialize_i32(0),
7825 Self::Basic => serializer.serialize_i32(1),
7826 Self::Detailed => serializer.serialize_i32(2),
7827 Self::UnknownValue(u) => u.0.serialize(serializer),
7828 }
7829 }
7830 }
7831
7832 impl<'de> serde::de::Deserialize<'de> for SpokeView {
7833 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7834 where
7835 D: serde::Deserializer<'de>,
7836 {
7837 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeView>::new(
7838 ".google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView",
7839 ))
7840 }
7841 }
7842}
7843
7844#[derive(Clone, Default, PartialEq)]
7849#[non_exhaustive]
7850pub struct ListHubSpokesResponse {
7851 pub spokes: std::vec::Vec<crate::model::Spoke>,
7855
7856 pub next_page_token: std::string::String,
7860
7861 pub unreachable: std::vec::Vec<std::string::String>,
7863
7864 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7865}
7866
7867impl ListHubSpokesResponse {
7868 pub fn new() -> Self {
7869 std::default::Default::default()
7870 }
7871
7872 pub fn set_spokes<T, V>(mut self, v: T) -> Self
7874 where
7875 T: std::iter::IntoIterator<Item = V>,
7876 V: std::convert::Into<crate::model::Spoke>,
7877 {
7878 use std::iter::Iterator;
7879 self.spokes = v.into_iter().map(|i| i.into()).collect();
7880 self
7881 }
7882
7883 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7885 self.next_page_token = v.into();
7886 self
7887 }
7888
7889 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7891 where
7892 T: std::iter::IntoIterator<Item = V>,
7893 V: std::convert::Into<std::string::String>,
7894 {
7895 use std::iter::Iterator;
7896 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7897 self
7898 }
7899}
7900
7901impl wkt::message::Message for ListHubSpokesResponse {
7902 fn typename() -> &'static str {
7903 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesResponse"
7904 }
7905}
7906
7907#[doc(hidden)]
7908impl gax::paginator::internal::PageableResponse for ListHubSpokesResponse {
7909 type PageItem = crate::model::Spoke;
7910
7911 fn items(self) -> std::vec::Vec<Self::PageItem> {
7912 self.spokes
7913 }
7914
7915 fn next_page_token(&self) -> std::string::String {
7916 use std::clone::Clone;
7917 self.next_page_token.clone()
7918 }
7919}
7920
7921#[derive(Clone, Default, PartialEq)]
7926#[non_exhaustive]
7927pub struct QueryHubStatusRequest {
7928 pub name: std::string::String,
7930
7931 pub page_size: i32,
7933
7934 pub page_token: std::string::String,
7936
7937 pub filter: std::string::String,
7948
7949 pub order_by: std::string::String,
7961
7962 pub group_by: std::string::String,
7972
7973 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7974}
7975
7976impl QueryHubStatusRequest {
7977 pub fn new() -> Self {
7978 std::default::Default::default()
7979 }
7980
7981 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7983 self.name = v.into();
7984 self
7985 }
7986
7987 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7989 self.page_size = v.into();
7990 self
7991 }
7992
7993 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7995 self.page_token = v.into();
7996 self
7997 }
7998
7999 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8001 self.filter = v.into();
8002 self
8003 }
8004
8005 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8007 self.order_by = v.into();
8008 self
8009 }
8010
8011 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8013 self.group_by = v.into();
8014 self
8015 }
8016}
8017
8018impl wkt::message::Message for QueryHubStatusRequest {
8019 fn typename() -> &'static str {
8020 "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusRequest"
8021 }
8022}
8023
8024#[derive(Clone, Default, PartialEq)]
8029#[non_exhaustive]
8030pub struct QueryHubStatusResponse {
8031 pub hub_status_entries: std::vec::Vec<crate::model::HubStatusEntry>,
8033
8034 pub next_page_token: std::string::String,
8038
8039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8040}
8041
8042impl QueryHubStatusResponse {
8043 pub fn new() -> Self {
8044 std::default::Default::default()
8045 }
8046
8047 pub fn set_hub_status_entries<T, V>(mut self, v: T) -> Self
8049 where
8050 T: std::iter::IntoIterator<Item = V>,
8051 V: std::convert::Into<crate::model::HubStatusEntry>,
8052 {
8053 use std::iter::Iterator;
8054 self.hub_status_entries = v.into_iter().map(|i| i.into()).collect();
8055 self
8056 }
8057
8058 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8060 self.next_page_token = v.into();
8061 self
8062 }
8063}
8064
8065impl wkt::message::Message for QueryHubStatusResponse {
8066 fn typename() -> &'static str {
8067 "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusResponse"
8068 }
8069}
8070
8071#[doc(hidden)]
8072impl gax::paginator::internal::PageableResponse for QueryHubStatusResponse {
8073 type PageItem = crate::model::HubStatusEntry;
8074
8075 fn items(self) -> std::vec::Vec<Self::PageItem> {
8076 self.hub_status_entries
8077 }
8078
8079 fn next_page_token(&self) -> std::string::String {
8080 use std::clone::Clone;
8081 self.next_page_token.clone()
8082 }
8083}
8084
8085#[derive(Clone, Default, PartialEq)]
8088#[non_exhaustive]
8089pub struct HubStatusEntry {
8090 pub count: i32,
8094
8095 pub group_by: std::string::String,
8098
8099 pub psc_propagation_status: std::option::Option<crate::model::PscPropagationStatus>,
8101
8102 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8103}
8104
8105impl HubStatusEntry {
8106 pub fn new() -> Self {
8107 std::default::Default::default()
8108 }
8109
8110 pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8112 self.count = v.into();
8113 self
8114 }
8115
8116 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8118 self.group_by = v.into();
8119 self
8120 }
8121
8122 pub fn set_psc_propagation_status<T>(mut self, v: T) -> Self
8124 where
8125 T: std::convert::Into<crate::model::PscPropagationStatus>,
8126 {
8127 self.psc_propagation_status = std::option::Option::Some(v.into());
8128 self
8129 }
8130
8131 pub fn set_or_clear_psc_propagation_status<T>(mut self, v: std::option::Option<T>) -> Self
8133 where
8134 T: std::convert::Into<crate::model::PscPropagationStatus>,
8135 {
8136 self.psc_propagation_status = v.map(|x| x.into());
8137 self
8138 }
8139}
8140
8141impl wkt::message::Message for HubStatusEntry {
8142 fn typename() -> &'static str {
8143 "type.googleapis.com/google.cloud.networkconnectivity.v1.HubStatusEntry"
8144 }
8145}
8146
8147#[derive(Clone, Default, PartialEq)]
8150#[non_exhaustive]
8151pub struct PscPropagationStatus {
8152 pub source_spoke: std::string::String,
8154
8155 pub source_group: std::string::String,
8157
8158 pub source_forwarding_rule: std::string::String,
8160
8161 pub target_spoke: std::string::String,
8163
8164 pub target_group: std::string::String,
8166
8167 pub code: crate::model::psc_propagation_status::Code,
8169
8170 pub message: std::string::String,
8173
8174 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8175}
8176
8177impl PscPropagationStatus {
8178 pub fn new() -> Self {
8179 std::default::Default::default()
8180 }
8181
8182 pub fn set_source_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8184 self.source_spoke = v.into();
8185 self
8186 }
8187
8188 pub fn set_source_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8190 self.source_group = v.into();
8191 self
8192 }
8193
8194 pub fn set_source_forwarding_rule<T: std::convert::Into<std::string::String>>(
8196 mut self,
8197 v: T,
8198 ) -> Self {
8199 self.source_forwarding_rule = v.into();
8200 self
8201 }
8202
8203 pub fn set_target_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8205 self.target_spoke = v.into();
8206 self
8207 }
8208
8209 pub fn set_target_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8211 self.target_group = v.into();
8212 self
8213 }
8214
8215 pub fn set_code<T: std::convert::Into<crate::model::psc_propagation_status::Code>>(
8217 mut self,
8218 v: T,
8219 ) -> Self {
8220 self.code = v.into();
8221 self
8222 }
8223
8224 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8226 self.message = v.into();
8227 self
8228 }
8229}
8230
8231impl wkt::message::Message for PscPropagationStatus {
8232 fn typename() -> &'static str {
8233 "type.googleapis.com/google.cloud.networkconnectivity.v1.PscPropagationStatus"
8234 }
8235}
8236
8237pub mod psc_propagation_status {
8239 #[allow(unused_imports)]
8240 use super::*;
8241
8242 #[derive(Clone, Debug, PartialEq)]
8259 #[non_exhaustive]
8260 pub enum Code {
8261 Unspecified,
8263 Ready,
8265 Propagating,
8268 ErrorProducerPropagatedConnectionLimitExceeded,
8272 ErrorProducerNatIpSpaceExhausted,
8277 ErrorProducerQuotaExceeded,
8281 ErrorConsumerQuotaExceeded,
8285 UnknownValue(code::UnknownValue),
8290 }
8291
8292 #[doc(hidden)]
8293 pub mod code {
8294 #[allow(unused_imports)]
8295 use super::*;
8296 #[derive(Clone, Debug, PartialEq)]
8297 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8298 }
8299
8300 impl Code {
8301 pub fn value(&self) -> std::option::Option<i32> {
8306 match self {
8307 Self::Unspecified => std::option::Option::Some(0),
8308 Self::Ready => std::option::Option::Some(1),
8309 Self::Propagating => std::option::Option::Some(2),
8310 Self::ErrorProducerPropagatedConnectionLimitExceeded => {
8311 std::option::Option::Some(3)
8312 }
8313 Self::ErrorProducerNatIpSpaceExhausted => std::option::Option::Some(4),
8314 Self::ErrorProducerQuotaExceeded => std::option::Option::Some(5),
8315 Self::ErrorConsumerQuotaExceeded => std::option::Option::Some(6),
8316 Self::UnknownValue(u) => u.0.value(),
8317 }
8318 }
8319
8320 pub fn name(&self) -> std::option::Option<&str> {
8325 match self {
8326 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
8327 Self::Ready => std::option::Option::Some("READY"),
8328 Self::Propagating => std::option::Option::Some("PROPAGATING"),
8329 Self::ErrorProducerPropagatedConnectionLimitExceeded => {
8330 std::option::Option::Some("ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED")
8331 }
8332 Self::ErrorProducerNatIpSpaceExhausted => {
8333 std::option::Option::Some("ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED")
8334 }
8335 Self::ErrorProducerQuotaExceeded => {
8336 std::option::Option::Some("ERROR_PRODUCER_QUOTA_EXCEEDED")
8337 }
8338 Self::ErrorConsumerQuotaExceeded => {
8339 std::option::Option::Some("ERROR_CONSUMER_QUOTA_EXCEEDED")
8340 }
8341 Self::UnknownValue(u) => u.0.name(),
8342 }
8343 }
8344 }
8345
8346 impl std::default::Default for Code {
8347 fn default() -> Self {
8348 use std::convert::From;
8349 Self::from(0)
8350 }
8351 }
8352
8353 impl std::fmt::Display for Code {
8354 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8355 wkt::internal::display_enum(f, self.name(), self.value())
8356 }
8357 }
8358
8359 impl std::convert::From<i32> for Code {
8360 fn from(value: i32) -> Self {
8361 match value {
8362 0 => Self::Unspecified,
8363 1 => Self::Ready,
8364 2 => Self::Propagating,
8365 3 => Self::ErrorProducerPropagatedConnectionLimitExceeded,
8366 4 => Self::ErrorProducerNatIpSpaceExhausted,
8367 5 => Self::ErrorProducerQuotaExceeded,
8368 6 => Self::ErrorConsumerQuotaExceeded,
8369 _ => Self::UnknownValue(code::UnknownValue(
8370 wkt::internal::UnknownEnumValue::Integer(value),
8371 )),
8372 }
8373 }
8374 }
8375
8376 impl std::convert::From<&str> for Code {
8377 fn from(value: &str) -> Self {
8378 use std::string::ToString;
8379 match value {
8380 "CODE_UNSPECIFIED" => Self::Unspecified,
8381 "READY" => Self::Ready,
8382 "PROPAGATING" => Self::Propagating,
8383 "ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED" => {
8384 Self::ErrorProducerPropagatedConnectionLimitExceeded
8385 }
8386 "ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED" => Self::ErrorProducerNatIpSpaceExhausted,
8387 "ERROR_PRODUCER_QUOTA_EXCEEDED" => Self::ErrorProducerQuotaExceeded,
8388 "ERROR_CONSUMER_QUOTA_EXCEEDED" => Self::ErrorConsumerQuotaExceeded,
8389 _ => Self::UnknownValue(code::UnknownValue(
8390 wkt::internal::UnknownEnumValue::String(value.to_string()),
8391 )),
8392 }
8393 }
8394 }
8395
8396 impl serde::ser::Serialize for Code {
8397 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8398 where
8399 S: serde::Serializer,
8400 {
8401 match self {
8402 Self::Unspecified => serializer.serialize_i32(0),
8403 Self::Ready => serializer.serialize_i32(1),
8404 Self::Propagating => serializer.serialize_i32(2),
8405 Self::ErrorProducerPropagatedConnectionLimitExceeded => serializer.serialize_i32(3),
8406 Self::ErrorProducerNatIpSpaceExhausted => serializer.serialize_i32(4),
8407 Self::ErrorProducerQuotaExceeded => serializer.serialize_i32(5),
8408 Self::ErrorConsumerQuotaExceeded => serializer.serialize_i32(6),
8409 Self::UnknownValue(u) => u.0.serialize(serializer),
8410 }
8411 }
8412 }
8413
8414 impl<'de> serde::de::Deserialize<'de> for Code {
8415 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8416 where
8417 D: serde::Deserializer<'de>,
8418 {
8419 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
8420 ".google.cloud.networkconnectivity.v1.PscPropagationStatus.Code",
8421 ))
8422 }
8423 }
8424}
8425
8426#[derive(Clone, Default, PartialEq)]
8431#[non_exhaustive]
8432pub struct ListSpokesRequest {
8433 pub parent: std::string::String,
8435
8436 pub page_size: i32,
8438
8439 pub page_token: std::string::String,
8441
8442 pub filter: std::string::String,
8444
8445 pub order_by: std::string::String,
8447
8448 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8449}
8450
8451impl ListSpokesRequest {
8452 pub fn new() -> Self {
8453 std::default::Default::default()
8454 }
8455
8456 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8458 self.parent = v.into();
8459 self
8460 }
8461
8462 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8464 self.page_size = v.into();
8465 self
8466 }
8467
8468 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8470 self.page_token = v.into();
8471 self
8472 }
8473
8474 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8476 self.filter = v.into();
8477 self
8478 }
8479
8480 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8482 self.order_by = v.into();
8483 self
8484 }
8485}
8486
8487impl wkt::message::Message for ListSpokesRequest {
8488 fn typename() -> &'static str {
8489 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesRequest"
8490 }
8491}
8492
8493#[derive(Clone, Default, PartialEq)]
8498#[non_exhaustive]
8499pub struct ListSpokesResponse {
8500 pub spokes: std::vec::Vec<crate::model::Spoke>,
8502
8503 pub next_page_token: std::string::String,
8507
8508 pub unreachable: std::vec::Vec<std::string::String>,
8510
8511 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8512}
8513
8514impl ListSpokesResponse {
8515 pub fn new() -> Self {
8516 std::default::Default::default()
8517 }
8518
8519 pub fn set_spokes<T, V>(mut self, v: T) -> Self
8521 where
8522 T: std::iter::IntoIterator<Item = V>,
8523 V: std::convert::Into<crate::model::Spoke>,
8524 {
8525 use std::iter::Iterator;
8526 self.spokes = v.into_iter().map(|i| i.into()).collect();
8527 self
8528 }
8529
8530 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8532 self.next_page_token = v.into();
8533 self
8534 }
8535
8536 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8538 where
8539 T: std::iter::IntoIterator<Item = V>,
8540 V: std::convert::Into<std::string::String>,
8541 {
8542 use std::iter::Iterator;
8543 self.unreachable = v.into_iter().map(|i| i.into()).collect();
8544 self
8545 }
8546}
8547
8548impl wkt::message::Message for ListSpokesResponse {
8549 fn typename() -> &'static str {
8550 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesResponse"
8551 }
8552}
8553
8554#[doc(hidden)]
8555impl gax::paginator::internal::PageableResponse for ListSpokesResponse {
8556 type PageItem = crate::model::Spoke;
8557
8558 fn items(self) -> std::vec::Vec<Self::PageItem> {
8559 self.spokes
8560 }
8561
8562 fn next_page_token(&self) -> std::string::String {
8563 use std::clone::Clone;
8564 self.next_page_token.clone()
8565 }
8566}
8567
8568#[derive(Clone, Default, PartialEq)]
8573#[non_exhaustive]
8574pub struct GetSpokeRequest {
8575 pub name: std::string::String,
8577
8578 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8579}
8580
8581impl GetSpokeRequest {
8582 pub fn new() -> Self {
8583 std::default::Default::default()
8584 }
8585
8586 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8588 self.name = v.into();
8589 self
8590 }
8591}
8592
8593impl wkt::message::Message for GetSpokeRequest {
8594 fn typename() -> &'static str {
8595 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetSpokeRequest"
8596 }
8597}
8598
8599#[derive(Clone, Default, PartialEq)]
8604#[non_exhaustive]
8605pub struct CreateSpokeRequest {
8606 pub parent: std::string::String,
8608
8609 pub spoke_id: std::string::String,
8611
8612 pub spoke: std::option::Option<crate::model::Spoke>,
8614
8615 pub request_id: std::string::String,
8630
8631 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8632}
8633
8634impl CreateSpokeRequest {
8635 pub fn new() -> Self {
8636 std::default::Default::default()
8637 }
8638
8639 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8641 self.parent = v.into();
8642 self
8643 }
8644
8645 pub fn set_spoke_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8647 self.spoke_id = v.into();
8648 self
8649 }
8650
8651 pub fn set_spoke<T>(mut self, v: T) -> Self
8653 where
8654 T: std::convert::Into<crate::model::Spoke>,
8655 {
8656 self.spoke = std::option::Option::Some(v.into());
8657 self
8658 }
8659
8660 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
8662 where
8663 T: std::convert::Into<crate::model::Spoke>,
8664 {
8665 self.spoke = v.map(|x| x.into());
8666 self
8667 }
8668
8669 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8671 self.request_id = v.into();
8672 self
8673 }
8674}
8675
8676impl wkt::message::Message for CreateSpokeRequest {
8677 fn typename() -> &'static str {
8678 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateSpokeRequest"
8679 }
8680}
8681
8682#[derive(Clone, Default, PartialEq)]
8688#[non_exhaustive]
8689pub struct UpdateSpokeRequest {
8690 pub update_mask: std::option::Option<wkt::FieldMask>,
8696
8697 pub spoke: std::option::Option<crate::model::Spoke>,
8699
8700 pub request_id: std::string::String,
8715
8716 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8717}
8718
8719impl UpdateSpokeRequest {
8720 pub fn new() -> Self {
8721 std::default::Default::default()
8722 }
8723
8724 pub fn set_update_mask<T>(mut self, v: T) -> Self
8726 where
8727 T: std::convert::Into<wkt::FieldMask>,
8728 {
8729 self.update_mask = std::option::Option::Some(v.into());
8730 self
8731 }
8732
8733 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8735 where
8736 T: std::convert::Into<wkt::FieldMask>,
8737 {
8738 self.update_mask = v.map(|x| x.into());
8739 self
8740 }
8741
8742 pub fn set_spoke<T>(mut self, v: T) -> Self
8744 where
8745 T: std::convert::Into<crate::model::Spoke>,
8746 {
8747 self.spoke = std::option::Option::Some(v.into());
8748 self
8749 }
8750
8751 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
8753 where
8754 T: std::convert::Into<crate::model::Spoke>,
8755 {
8756 self.spoke = v.map(|x| x.into());
8757 self
8758 }
8759
8760 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8762 self.request_id = v.into();
8763 self
8764 }
8765}
8766
8767impl wkt::message::Message for UpdateSpokeRequest {
8768 fn typename() -> &'static str {
8769 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"
8770 }
8771}
8772
8773#[derive(Clone, Default, PartialEq)]
8778#[non_exhaustive]
8779pub struct DeleteSpokeRequest {
8780 pub name: std::string::String,
8782
8783 pub request_id: std::string::String,
8798
8799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8800}
8801
8802impl DeleteSpokeRequest {
8803 pub fn new() -> Self {
8804 std::default::Default::default()
8805 }
8806
8807 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8809 self.name = v.into();
8810 self
8811 }
8812
8813 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8815 self.request_id = v.into();
8816 self
8817 }
8818}
8819
8820impl wkt::message::Message for DeleteSpokeRequest {
8821 fn typename() -> &'static str {
8822 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"
8823 }
8824}
8825
8826#[derive(Clone, Default, PartialEq)]
8831#[non_exhaustive]
8832pub struct AcceptHubSpokeRequest {
8833 pub name: std::string::String,
8835
8836 pub spoke_uri: std::string::String,
8838
8839 pub request_id: std::string::String,
8854
8855 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8856}
8857
8858impl AcceptHubSpokeRequest {
8859 pub fn new() -> Self {
8860 std::default::Default::default()
8861 }
8862
8863 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8865 self.name = v.into();
8866 self
8867 }
8868
8869 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8871 self.spoke_uri = v.into();
8872 self
8873 }
8874
8875 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8877 self.request_id = v.into();
8878 self
8879 }
8880}
8881
8882impl wkt::message::Message for AcceptHubSpokeRequest {
8883 fn typename() -> &'static str {
8884 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest"
8885 }
8886}
8887
8888#[derive(Clone, Default, PartialEq)]
8893#[non_exhaustive]
8894pub struct AcceptHubSpokeResponse {
8895 pub spoke: std::option::Option<crate::model::Spoke>,
8897
8898 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8899}
8900
8901impl AcceptHubSpokeResponse {
8902 pub fn new() -> Self {
8903 std::default::Default::default()
8904 }
8905
8906 pub fn set_spoke<T>(mut self, v: T) -> Self
8908 where
8909 T: std::convert::Into<crate::model::Spoke>,
8910 {
8911 self.spoke = std::option::Option::Some(v.into());
8912 self
8913 }
8914
8915 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
8917 where
8918 T: std::convert::Into<crate::model::Spoke>,
8919 {
8920 self.spoke = v.map(|x| x.into());
8921 self
8922 }
8923}
8924
8925impl wkt::message::Message for AcceptHubSpokeResponse {
8926 fn typename() -> &'static str {
8927 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse"
8928 }
8929}
8930
8931#[derive(Clone, Default, PartialEq)]
8936#[non_exhaustive]
8937pub struct RejectHubSpokeRequest {
8938 pub name: std::string::String,
8940
8941 pub spoke_uri: std::string::String,
8943
8944 pub request_id: std::string::String,
8959
8960 pub details: std::string::String,
8962
8963 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8964}
8965
8966impl RejectHubSpokeRequest {
8967 pub fn new() -> Self {
8968 std::default::Default::default()
8969 }
8970
8971 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8973 self.name = v.into();
8974 self
8975 }
8976
8977 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8979 self.spoke_uri = v.into();
8980 self
8981 }
8982
8983 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8985 self.request_id = v.into();
8986 self
8987 }
8988
8989 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8991 self.details = v.into();
8992 self
8993 }
8994}
8995
8996impl wkt::message::Message for RejectHubSpokeRequest {
8997 fn typename() -> &'static str {
8998 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeRequest"
8999 }
9000}
9001
9002#[derive(Clone, Default, PartialEq)]
9007#[non_exhaustive]
9008pub struct RejectHubSpokeResponse {
9009 pub spoke: std::option::Option<crate::model::Spoke>,
9011
9012 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9013}
9014
9015impl RejectHubSpokeResponse {
9016 pub fn new() -> Self {
9017 std::default::Default::default()
9018 }
9019
9020 pub fn set_spoke<T>(mut self, v: T) -> Self
9022 where
9023 T: std::convert::Into<crate::model::Spoke>,
9024 {
9025 self.spoke = std::option::Option::Some(v.into());
9026 self
9027 }
9028
9029 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
9031 where
9032 T: std::convert::Into<crate::model::Spoke>,
9033 {
9034 self.spoke = v.map(|x| x.into());
9035 self
9036 }
9037}
9038
9039impl wkt::message::Message for RejectHubSpokeResponse {
9040 fn typename() -> &'static str {
9041 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeResponse"
9042 }
9043}
9044
9045#[derive(Clone, Default, PartialEq)]
9050#[non_exhaustive]
9051pub struct AcceptSpokeUpdateRequest {
9052 pub name: std::string::String,
9054
9055 pub spoke_uri: std::string::String,
9057
9058 pub spoke_etag: std::string::String,
9060
9061 pub request_id: std::string::String,
9076
9077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9078}
9079
9080impl AcceptSpokeUpdateRequest {
9081 pub fn new() -> Self {
9082 std::default::Default::default()
9083 }
9084
9085 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9087 self.name = v.into();
9088 self
9089 }
9090
9091 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9093 self.spoke_uri = v.into();
9094 self
9095 }
9096
9097 pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9099 self.spoke_etag = v.into();
9100 self
9101 }
9102
9103 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9105 self.request_id = v.into();
9106 self
9107 }
9108}
9109
9110impl wkt::message::Message for AcceptSpokeUpdateRequest {
9111 fn typename() -> &'static str {
9112 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateRequest"
9113 }
9114}
9115
9116#[derive(Clone, Default, PartialEq)]
9121#[non_exhaustive]
9122pub struct AcceptSpokeUpdateResponse {
9123 pub spoke: std::option::Option<crate::model::Spoke>,
9125
9126 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9127}
9128
9129impl AcceptSpokeUpdateResponse {
9130 pub fn new() -> Self {
9131 std::default::Default::default()
9132 }
9133
9134 pub fn set_spoke<T>(mut self, v: T) -> Self
9136 where
9137 T: std::convert::Into<crate::model::Spoke>,
9138 {
9139 self.spoke = std::option::Option::Some(v.into());
9140 self
9141 }
9142
9143 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
9145 where
9146 T: std::convert::Into<crate::model::Spoke>,
9147 {
9148 self.spoke = v.map(|x| x.into());
9149 self
9150 }
9151}
9152
9153impl wkt::message::Message for AcceptSpokeUpdateResponse {
9154 fn typename() -> &'static str {
9155 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateResponse"
9156 }
9157}
9158
9159#[derive(Clone, Default, PartialEq)]
9164#[non_exhaustive]
9165pub struct RejectSpokeUpdateRequest {
9166 pub name: std::string::String,
9168
9169 pub spoke_uri: std::string::String,
9171
9172 pub spoke_etag: std::string::String,
9174
9175 pub details: std::string::String,
9177
9178 pub request_id: std::string::String,
9193
9194 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9195}
9196
9197impl RejectSpokeUpdateRequest {
9198 pub fn new() -> Self {
9199 std::default::Default::default()
9200 }
9201
9202 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9204 self.name = v.into();
9205 self
9206 }
9207
9208 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9210 self.spoke_uri = v.into();
9211 self
9212 }
9213
9214 pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9216 self.spoke_etag = v.into();
9217 self
9218 }
9219
9220 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9222 self.details = v.into();
9223 self
9224 }
9225
9226 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9228 self.request_id = v.into();
9229 self
9230 }
9231}
9232
9233impl wkt::message::Message for RejectSpokeUpdateRequest {
9234 fn typename() -> &'static str {
9235 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateRequest"
9236 }
9237}
9238
9239#[derive(Clone, Default, PartialEq)]
9244#[non_exhaustive]
9245pub struct RejectSpokeUpdateResponse {
9246 pub spoke: std::option::Option<crate::model::Spoke>,
9248
9249 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9250}
9251
9252impl RejectSpokeUpdateResponse {
9253 pub fn new() -> Self {
9254 std::default::Default::default()
9255 }
9256
9257 pub fn set_spoke<T>(mut self, v: T) -> Self
9259 where
9260 T: std::convert::Into<crate::model::Spoke>,
9261 {
9262 self.spoke = std::option::Option::Some(v.into());
9263 self
9264 }
9265
9266 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
9268 where
9269 T: std::convert::Into<crate::model::Spoke>,
9270 {
9271 self.spoke = v.map(|x| x.into());
9272 self
9273 }
9274}
9275
9276impl wkt::message::Message for RejectSpokeUpdateResponse {
9277 fn typename() -> &'static str {
9278 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateResponse"
9279 }
9280}
9281
9282#[derive(Clone, Default, PartialEq)]
9287#[non_exhaustive]
9288pub struct GetRouteTableRequest {
9289 pub name: std::string::String,
9291
9292 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9293}
9294
9295impl GetRouteTableRequest {
9296 pub fn new() -> Self {
9297 std::default::Default::default()
9298 }
9299
9300 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9302 self.name = v.into();
9303 self
9304 }
9305}
9306
9307impl wkt::message::Message for GetRouteTableRequest {
9308 fn typename() -> &'static str {
9309 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteTableRequest"
9310 }
9311}
9312
9313#[derive(Clone, Default, PartialEq)]
9318#[non_exhaustive]
9319pub struct GetRouteRequest {
9320 pub name: std::string::String,
9322
9323 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9324}
9325
9326impl GetRouteRequest {
9327 pub fn new() -> Self {
9328 std::default::Default::default()
9329 }
9330
9331 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9333 self.name = v.into();
9334 self
9335 }
9336}
9337
9338impl wkt::message::Message for GetRouteRequest {
9339 fn typename() -> &'static str {
9340 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteRequest"
9341 }
9342}
9343
9344#[derive(Clone, Default, PartialEq)]
9350#[non_exhaustive]
9351pub struct ListRoutesRequest {
9352 pub parent: std::string::String,
9354
9355 pub page_size: i32,
9357
9358 pub page_token: std::string::String,
9360
9361 pub filter: std::string::String,
9363
9364 pub order_by: std::string::String,
9366
9367 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9368}
9369
9370impl ListRoutesRequest {
9371 pub fn new() -> Self {
9372 std::default::Default::default()
9373 }
9374
9375 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9377 self.parent = v.into();
9378 self
9379 }
9380
9381 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9383 self.page_size = v.into();
9384 self
9385 }
9386
9387 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9389 self.page_token = v.into();
9390 self
9391 }
9392
9393 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9395 self.filter = v.into();
9396 self
9397 }
9398
9399 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9401 self.order_by = v.into();
9402 self
9403 }
9404}
9405
9406impl wkt::message::Message for ListRoutesRequest {
9407 fn typename() -> &'static str {
9408 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesRequest"
9409 }
9410}
9411
9412#[derive(Clone, Default, PartialEq)]
9418#[non_exhaustive]
9419pub struct ListRoutesResponse {
9420 pub routes: std::vec::Vec<crate::model::Route>,
9422
9423 pub next_page_token: std::string::String,
9427
9428 pub unreachable: std::vec::Vec<std::string::String>,
9430
9431 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9432}
9433
9434impl ListRoutesResponse {
9435 pub fn new() -> Self {
9436 std::default::Default::default()
9437 }
9438
9439 pub fn set_routes<T, V>(mut self, v: T) -> Self
9441 where
9442 T: std::iter::IntoIterator<Item = V>,
9443 V: std::convert::Into<crate::model::Route>,
9444 {
9445 use std::iter::Iterator;
9446 self.routes = v.into_iter().map(|i| i.into()).collect();
9447 self
9448 }
9449
9450 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9452 self.next_page_token = v.into();
9453 self
9454 }
9455
9456 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9458 where
9459 T: std::iter::IntoIterator<Item = V>,
9460 V: std::convert::Into<std::string::String>,
9461 {
9462 use std::iter::Iterator;
9463 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9464 self
9465 }
9466}
9467
9468impl wkt::message::Message for ListRoutesResponse {
9469 fn typename() -> &'static str {
9470 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesResponse"
9471 }
9472}
9473
9474#[doc(hidden)]
9475impl gax::paginator::internal::PageableResponse for ListRoutesResponse {
9476 type PageItem = crate::model::Route;
9477
9478 fn items(self) -> std::vec::Vec<Self::PageItem> {
9479 self.routes
9480 }
9481
9482 fn next_page_token(&self) -> std::string::String {
9483 use std::clone::Clone;
9484 self.next_page_token.clone()
9485 }
9486}
9487
9488#[derive(Clone, Default, PartialEq)]
9494#[non_exhaustive]
9495pub struct ListRouteTablesRequest {
9496 pub parent: std::string::String,
9498
9499 pub page_size: i32,
9501
9502 pub page_token: std::string::String,
9504
9505 pub filter: std::string::String,
9507
9508 pub order_by: std::string::String,
9510
9511 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9512}
9513
9514impl ListRouteTablesRequest {
9515 pub fn new() -> Self {
9516 std::default::Default::default()
9517 }
9518
9519 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9521 self.parent = v.into();
9522 self
9523 }
9524
9525 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9527 self.page_size = v.into();
9528 self
9529 }
9530
9531 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9533 self.page_token = v.into();
9534 self
9535 }
9536
9537 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9539 self.filter = v.into();
9540 self
9541 }
9542
9543 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9545 self.order_by = v.into();
9546 self
9547 }
9548}
9549
9550impl wkt::message::Message for ListRouteTablesRequest {
9551 fn typename() -> &'static str {
9552 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesRequest"
9553 }
9554}
9555
9556#[derive(Clone, Default, PartialEq)]
9562#[non_exhaustive]
9563pub struct ListRouteTablesResponse {
9564 pub route_tables: std::vec::Vec<crate::model::RouteTable>,
9566
9567 pub next_page_token: std::string::String,
9571
9572 pub unreachable: std::vec::Vec<std::string::String>,
9574
9575 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9576}
9577
9578impl ListRouteTablesResponse {
9579 pub fn new() -> Self {
9580 std::default::Default::default()
9581 }
9582
9583 pub fn set_route_tables<T, V>(mut self, v: T) -> Self
9585 where
9586 T: std::iter::IntoIterator<Item = V>,
9587 V: std::convert::Into<crate::model::RouteTable>,
9588 {
9589 use std::iter::Iterator;
9590 self.route_tables = v.into_iter().map(|i| i.into()).collect();
9591 self
9592 }
9593
9594 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9596 self.next_page_token = v.into();
9597 self
9598 }
9599
9600 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9602 where
9603 T: std::iter::IntoIterator<Item = V>,
9604 V: std::convert::Into<std::string::String>,
9605 {
9606 use std::iter::Iterator;
9607 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9608 self
9609 }
9610}
9611
9612impl wkt::message::Message for ListRouteTablesResponse {
9613 fn typename() -> &'static str {
9614 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesResponse"
9615 }
9616}
9617
9618#[doc(hidden)]
9619impl gax::paginator::internal::PageableResponse for ListRouteTablesResponse {
9620 type PageItem = crate::model::RouteTable;
9621
9622 fn items(self) -> std::vec::Vec<Self::PageItem> {
9623 self.route_tables
9624 }
9625
9626 fn next_page_token(&self) -> std::string::String {
9627 use std::clone::Clone;
9628 self.next_page_token.clone()
9629 }
9630}
9631
9632#[derive(Clone, Default, PartialEq)]
9638#[non_exhaustive]
9639pub struct ListGroupsRequest {
9640 pub parent: std::string::String,
9642
9643 pub page_size: i32,
9645
9646 pub page_token: std::string::String,
9648
9649 pub filter: std::string::String,
9651
9652 pub order_by: std::string::String,
9654
9655 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9656}
9657
9658impl ListGroupsRequest {
9659 pub fn new() -> Self {
9660 std::default::Default::default()
9661 }
9662
9663 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9665 self.parent = v.into();
9666 self
9667 }
9668
9669 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9671 self.page_size = v.into();
9672 self
9673 }
9674
9675 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9677 self.page_token = v.into();
9678 self
9679 }
9680
9681 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9683 self.filter = v.into();
9684 self
9685 }
9686
9687 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9689 self.order_by = v.into();
9690 self
9691 }
9692}
9693
9694impl wkt::message::Message for ListGroupsRequest {
9695 fn typename() -> &'static str {
9696 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsRequest"
9697 }
9698}
9699
9700#[derive(Clone, Default, PartialEq)]
9706#[non_exhaustive]
9707pub struct ListGroupsResponse {
9708 pub groups: std::vec::Vec<crate::model::Group>,
9710
9711 pub next_page_token: std::string::String,
9715
9716 pub unreachable: std::vec::Vec<std::string::String>,
9718
9719 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9720}
9721
9722impl ListGroupsResponse {
9723 pub fn new() -> Self {
9724 std::default::Default::default()
9725 }
9726
9727 pub fn set_groups<T, V>(mut self, v: T) -> Self
9729 where
9730 T: std::iter::IntoIterator<Item = V>,
9731 V: std::convert::Into<crate::model::Group>,
9732 {
9733 use std::iter::Iterator;
9734 self.groups = v.into_iter().map(|i| i.into()).collect();
9735 self
9736 }
9737
9738 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9740 self.next_page_token = v.into();
9741 self
9742 }
9743
9744 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9746 where
9747 T: std::iter::IntoIterator<Item = V>,
9748 V: std::convert::Into<std::string::String>,
9749 {
9750 use std::iter::Iterator;
9751 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9752 self
9753 }
9754}
9755
9756impl wkt::message::Message for ListGroupsResponse {
9757 fn typename() -> &'static str {
9758 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsResponse"
9759 }
9760}
9761
9762#[doc(hidden)]
9763impl gax::paginator::internal::PageableResponse for ListGroupsResponse {
9764 type PageItem = crate::model::Group;
9765
9766 fn items(self) -> std::vec::Vec<Self::PageItem> {
9767 self.groups
9768 }
9769
9770 fn next_page_token(&self) -> std::string::String {
9771 use std::clone::Clone;
9772 self.next_page_token.clone()
9773 }
9774}
9775
9776#[derive(Clone, Default, PartialEq)]
9781#[non_exhaustive]
9782pub struct LinkedVpnTunnels {
9783 pub uris: std::vec::Vec<std::string::String>,
9785
9786 pub site_to_site_data_transfer: bool,
9790
9791 pub vpc_network: std::string::String,
9793
9794 pub include_import_ranges: std::vec::Vec<std::string::String>,
9798
9799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9800}
9801
9802impl LinkedVpnTunnels {
9803 pub fn new() -> Self {
9804 std::default::Default::default()
9805 }
9806
9807 pub fn set_uris<T, V>(mut self, v: T) -> Self
9809 where
9810 T: std::iter::IntoIterator<Item = V>,
9811 V: std::convert::Into<std::string::String>,
9812 {
9813 use std::iter::Iterator;
9814 self.uris = v.into_iter().map(|i| i.into()).collect();
9815 self
9816 }
9817
9818 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9820 self.site_to_site_data_transfer = v.into();
9821 self
9822 }
9823
9824 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9826 self.vpc_network = v.into();
9827 self
9828 }
9829
9830 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
9832 where
9833 T: std::iter::IntoIterator<Item = V>,
9834 V: std::convert::Into<std::string::String>,
9835 {
9836 use std::iter::Iterator;
9837 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
9838 self
9839 }
9840}
9841
9842impl wkt::message::Message for LinkedVpnTunnels {
9843 fn typename() -> &'static str {
9844 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"
9845 }
9846}
9847
9848#[derive(Clone, Default, PartialEq)]
9853#[non_exhaustive]
9854pub struct LinkedInterconnectAttachments {
9855 pub uris: std::vec::Vec<std::string::String>,
9857
9858 pub site_to_site_data_transfer: bool,
9862
9863 pub vpc_network: std::string::String,
9865
9866 pub include_import_ranges: std::vec::Vec<std::string::String>,
9870
9871 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9872}
9873
9874impl LinkedInterconnectAttachments {
9875 pub fn new() -> Self {
9876 std::default::Default::default()
9877 }
9878
9879 pub fn set_uris<T, V>(mut self, v: T) -> Self
9881 where
9882 T: std::iter::IntoIterator<Item = V>,
9883 V: std::convert::Into<std::string::String>,
9884 {
9885 use std::iter::Iterator;
9886 self.uris = v.into_iter().map(|i| i.into()).collect();
9887 self
9888 }
9889
9890 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9892 self.site_to_site_data_transfer = v.into();
9893 self
9894 }
9895
9896 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9898 self.vpc_network = v.into();
9899 self
9900 }
9901
9902 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
9904 where
9905 T: std::iter::IntoIterator<Item = V>,
9906 V: std::convert::Into<std::string::String>,
9907 {
9908 use std::iter::Iterator;
9909 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
9910 self
9911 }
9912}
9913
9914impl wkt::message::Message for LinkedInterconnectAttachments {
9915 fn typename() -> &'static str {
9916 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"
9917 }
9918}
9919
9920#[derive(Clone, Default, PartialEq)]
9925#[non_exhaustive]
9926pub struct LinkedRouterApplianceInstances {
9927 pub instances: std::vec::Vec<crate::model::RouterApplianceInstance>,
9929
9930 pub site_to_site_data_transfer: bool,
9934
9935 pub vpc_network: std::string::String,
9938
9939 pub include_import_ranges: std::vec::Vec<std::string::String>,
9943
9944 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9945}
9946
9947impl LinkedRouterApplianceInstances {
9948 pub fn new() -> Self {
9949 std::default::Default::default()
9950 }
9951
9952 pub fn set_instances<T, V>(mut self, v: T) -> Self
9954 where
9955 T: std::iter::IntoIterator<Item = V>,
9956 V: std::convert::Into<crate::model::RouterApplianceInstance>,
9957 {
9958 use std::iter::Iterator;
9959 self.instances = v.into_iter().map(|i| i.into()).collect();
9960 self
9961 }
9962
9963 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9965 self.site_to_site_data_transfer = v.into();
9966 self
9967 }
9968
9969 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9971 self.vpc_network = v.into();
9972 self
9973 }
9974
9975 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
9977 where
9978 T: std::iter::IntoIterator<Item = V>,
9979 V: std::convert::Into<std::string::String>,
9980 {
9981 use std::iter::Iterator;
9982 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
9983 self
9984 }
9985}
9986
9987impl wkt::message::Message for LinkedRouterApplianceInstances {
9988 fn typename() -> &'static str {
9989 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"
9990 }
9991}
9992
9993#[derive(Clone, Default, PartialEq)]
9995#[non_exhaustive]
9996pub struct LinkedVpcNetwork {
9997 pub uri: std::string::String,
9999
10000 pub exclude_export_ranges: std::vec::Vec<std::string::String>,
10002
10003 pub include_export_ranges: std::vec::Vec<std::string::String>,
10005
10006 pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
10009
10010 pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
10013
10014 pub producer_vpc_spokes: std::vec::Vec<std::string::String>,
10022
10023 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10024}
10025
10026impl LinkedVpcNetwork {
10027 pub fn new() -> Self {
10028 std::default::Default::default()
10029 }
10030
10031 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10033 self.uri = v.into();
10034 self
10035 }
10036
10037 pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
10039 where
10040 T: std::iter::IntoIterator<Item = V>,
10041 V: std::convert::Into<std::string::String>,
10042 {
10043 use std::iter::Iterator;
10044 self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
10045 self
10046 }
10047
10048 pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
10050 where
10051 T: std::iter::IntoIterator<Item = V>,
10052 V: std::convert::Into<std::string::String>,
10053 {
10054 use std::iter::Iterator;
10055 self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
10056 self
10057 }
10058
10059 pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
10061 where
10062 T: std::iter::IntoIterator<Item = V>,
10063 V: std::convert::Into<std::string::String>,
10064 {
10065 use std::iter::Iterator;
10066 self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
10067 self
10068 }
10069
10070 pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
10072 where
10073 T: std::iter::IntoIterator<Item = V>,
10074 V: std::convert::Into<std::string::String>,
10075 {
10076 use std::iter::Iterator;
10077 self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
10078 self
10079 }
10080
10081 pub fn set_producer_vpc_spokes<T, V>(mut self, v: T) -> Self
10083 where
10084 T: std::iter::IntoIterator<Item = V>,
10085 V: std::convert::Into<std::string::String>,
10086 {
10087 use std::iter::Iterator;
10088 self.producer_vpc_spokes = v.into_iter().map(|i| i.into()).collect();
10089 self
10090 }
10091}
10092
10093impl wkt::message::Message for LinkedVpcNetwork {
10094 fn typename() -> &'static str {
10095 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpcNetwork"
10096 }
10097}
10098
10099#[derive(Clone, Default, PartialEq)]
10100#[non_exhaustive]
10101pub struct LinkedProducerVpcNetwork {
10102 pub network: std::string::String,
10105
10106 pub service_consumer_vpc_spoke: std::string::String,
10108
10109 pub peering: std::string::String,
10113
10114 pub producer_network: std::string::String,
10116
10117 pub exclude_export_ranges: std::vec::Vec<std::string::String>,
10119
10120 pub include_export_ranges: std::vec::Vec<std::string::String>,
10122
10123 pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
10126
10127 pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
10130
10131 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10132}
10133
10134impl LinkedProducerVpcNetwork {
10135 pub fn new() -> Self {
10136 std::default::Default::default()
10137 }
10138
10139 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10141 self.network = v.into();
10142 self
10143 }
10144
10145 pub fn set_service_consumer_vpc_spoke<T: std::convert::Into<std::string::String>>(
10147 mut self,
10148 v: T,
10149 ) -> Self {
10150 self.service_consumer_vpc_spoke = v.into();
10151 self
10152 }
10153
10154 pub fn set_peering<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10156 self.peering = v.into();
10157 self
10158 }
10159
10160 pub fn set_producer_network<T: std::convert::Into<std::string::String>>(
10162 mut self,
10163 v: T,
10164 ) -> Self {
10165 self.producer_network = v.into();
10166 self
10167 }
10168
10169 pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
10171 where
10172 T: std::iter::IntoIterator<Item = V>,
10173 V: std::convert::Into<std::string::String>,
10174 {
10175 use std::iter::Iterator;
10176 self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
10177 self
10178 }
10179
10180 pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
10182 where
10183 T: std::iter::IntoIterator<Item = V>,
10184 V: std::convert::Into<std::string::String>,
10185 {
10186 use std::iter::Iterator;
10187 self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
10188 self
10189 }
10190
10191 pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
10193 where
10194 T: std::iter::IntoIterator<Item = V>,
10195 V: std::convert::Into<std::string::String>,
10196 {
10197 use std::iter::Iterator;
10198 self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
10199 self
10200 }
10201
10202 pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
10204 where
10205 T: std::iter::IntoIterator<Item = V>,
10206 V: std::convert::Into<std::string::String>,
10207 {
10208 use std::iter::Iterator;
10209 self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
10210 self
10211 }
10212}
10213
10214impl wkt::message::Message for LinkedProducerVpcNetwork {
10215 fn typename() -> &'static str {
10216 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedProducerVpcNetwork"
10217 }
10218}
10219
10220#[derive(Clone, Default, PartialEq)]
10225#[non_exhaustive]
10226pub struct RouterApplianceInstance {
10227 pub virtual_machine: std::string::String,
10229
10230 pub ip_address: std::string::String,
10232
10233 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10234}
10235
10236impl RouterApplianceInstance {
10237 pub fn new() -> Self {
10238 std::default::Default::default()
10239 }
10240
10241 pub fn set_virtual_machine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10243 self.virtual_machine = v.into();
10244 self
10245 }
10246
10247 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10249 self.ip_address = v.into();
10250 self
10251 }
10252}
10253
10254impl wkt::message::Message for RouterApplianceInstance {
10255 fn typename() -> &'static str {
10256 "type.googleapis.com/google.cloud.networkconnectivity.v1.RouterApplianceInstance"
10257 }
10258}
10259
10260#[derive(Clone, Default, PartialEq)]
10262#[non_exhaustive]
10263pub struct LocationMetadata {
10264 pub location_features: std::vec::Vec<crate::model::LocationFeature>,
10266
10267 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10268}
10269
10270impl LocationMetadata {
10271 pub fn new() -> Self {
10272 std::default::Default::default()
10273 }
10274
10275 pub fn set_location_features<T, V>(mut self, v: T) -> Self
10277 where
10278 T: std::iter::IntoIterator<Item = V>,
10279 V: std::convert::Into<crate::model::LocationFeature>,
10280 {
10281 use std::iter::Iterator;
10282 self.location_features = v.into_iter().map(|i| i.into()).collect();
10283 self
10284 }
10285}
10286
10287impl wkt::message::Message for LocationMetadata {
10288 fn typename() -> &'static str {
10289 "type.googleapis.com/google.cloud.networkconnectivity.v1.LocationMetadata"
10290 }
10291}
10292
10293#[derive(Clone, Default, PartialEq)]
10294#[non_exhaustive]
10295pub struct NextHopVpcNetwork {
10296 pub uri: std::string::String,
10298
10299 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10300}
10301
10302impl NextHopVpcNetwork {
10303 pub fn new() -> Self {
10304 std::default::Default::default()
10305 }
10306
10307 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10309 self.uri = v.into();
10310 self
10311 }
10312}
10313
10314impl wkt::message::Message for NextHopVpcNetwork {
10315 fn typename() -> &'static str {
10316 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVpcNetwork"
10317 }
10318}
10319
10320#[derive(Clone, Default, PartialEq)]
10322#[non_exhaustive]
10323pub struct NextHopVPNTunnel {
10324 pub uri: std::string::String,
10326
10327 pub vpc_network: std::string::String,
10329
10330 pub site_to_site_data_transfer: bool,
10334
10335 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10336}
10337
10338impl NextHopVPNTunnel {
10339 pub fn new() -> Self {
10340 std::default::Default::default()
10341 }
10342
10343 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10345 self.uri = v.into();
10346 self
10347 }
10348
10349 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10351 self.vpc_network = v.into();
10352 self
10353 }
10354
10355 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10357 self.site_to_site_data_transfer = v.into();
10358 self
10359 }
10360}
10361
10362impl wkt::message::Message for NextHopVPNTunnel {
10363 fn typename() -> &'static str {
10364 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVPNTunnel"
10365 }
10366}
10367
10368#[derive(Clone, Default, PartialEq)]
10370#[non_exhaustive]
10371pub struct NextHopRouterApplianceInstance {
10372 pub uri: std::string::String,
10374
10375 pub vpc_network: std::string::String,
10377
10378 pub site_to_site_data_transfer: bool,
10382
10383 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10384}
10385
10386impl NextHopRouterApplianceInstance {
10387 pub fn new() -> Self {
10388 std::default::Default::default()
10389 }
10390
10391 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10393 self.uri = v.into();
10394 self
10395 }
10396
10397 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10399 self.vpc_network = v.into();
10400 self
10401 }
10402
10403 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10405 self.site_to_site_data_transfer = v.into();
10406 self
10407 }
10408}
10409
10410impl wkt::message::Message for NextHopRouterApplianceInstance {
10411 fn typename() -> &'static str {
10412 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopRouterApplianceInstance"
10413 }
10414}
10415
10416#[derive(Clone, Default, PartialEq)]
10418#[non_exhaustive]
10419pub struct NextHopInterconnectAttachment {
10420 pub uri: std::string::String,
10422
10423 pub vpc_network: std::string::String,
10425
10426 pub site_to_site_data_transfer: bool,
10431
10432 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10433}
10434
10435impl NextHopInterconnectAttachment {
10436 pub fn new() -> Self {
10437 std::default::Default::default()
10438 }
10439
10440 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10442 self.uri = v.into();
10443 self
10444 }
10445
10446 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10448 self.vpc_network = v.into();
10449 self
10450 }
10451
10452 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10454 self.site_to_site_data_transfer = v.into();
10455 self
10456 }
10457}
10458
10459impl wkt::message::Message for NextHopInterconnectAttachment {
10460 fn typename() -> &'static str {
10461 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopInterconnectAttachment"
10462 }
10463}
10464
10465#[derive(Clone, Default, PartialEq)]
10471#[non_exhaustive]
10472pub struct SpokeSummary {
10473 pub spoke_type_counts: std::vec::Vec<crate::model::spoke_summary::SpokeTypeCount>,
10476
10477 pub spoke_state_counts: std::vec::Vec<crate::model::spoke_summary::SpokeStateCount>,
10480
10481 pub spoke_state_reason_counts:
10484 std::vec::Vec<crate::model::spoke_summary::SpokeStateReasonCount>,
10485
10486 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10487}
10488
10489impl SpokeSummary {
10490 pub fn new() -> Self {
10491 std::default::Default::default()
10492 }
10493
10494 pub fn set_spoke_type_counts<T, V>(mut self, v: T) -> Self
10496 where
10497 T: std::iter::IntoIterator<Item = V>,
10498 V: std::convert::Into<crate::model::spoke_summary::SpokeTypeCount>,
10499 {
10500 use std::iter::Iterator;
10501 self.spoke_type_counts = v.into_iter().map(|i| i.into()).collect();
10502 self
10503 }
10504
10505 pub fn set_spoke_state_counts<T, V>(mut self, v: T) -> Self
10507 where
10508 T: std::iter::IntoIterator<Item = V>,
10509 V: std::convert::Into<crate::model::spoke_summary::SpokeStateCount>,
10510 {
10511 use std::iter::Iterator;
10512 self.spoke_state_counts = v.into_iter().map(|i| i.into()).collect();
10513 self
10514 }
10515
10516 pub fn set_spoke_state_reason_counts<T, V>(mut self, v: T) -> Self
10518 where
10519 T: std::iter::IntoIterator<Item = V>,
10520 V: std::convert::Into<crate::model::spoke_summary::SpokeStateReasonCount>,
10521 {
10522 use std::iter::Iterator;
10523 self.spoke_state_reason_counts = v.into_iter().map(|i| i.into()).collect();
10524 self
10525 }
10526}
10527
10528impl wkt::message::Message for SpokeSummary {
10529 fn typename() -> &'static str {
10530 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary"
10531 }
10532}
10533
10534pub mod spoke_summary {
10536 #[allow(unused_imports)]
10537 use super::*;
10538
10539 #[derive(Clone, Default, PartialEq)]
10543 #[non_exhaustive]
10544 pub struct SpokeTypeCount {
10545 pub spoke_type: crate::model::SpokeType,
10547
10548 pub count: i64,
10551
10552 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10553 }
10554
10555 impl SpokeTypeCount {
10556 pub fn new() -> Self {
10557 std::default::Default::default()
10558 }
10559
10560 pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(
10562 mut self,
10563 v: T,
10564 ) -> Self {
10565 self.spoke_type = v.into();
10566 self
10567 }
10568
10569 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10571 self.count = v.into();
10572 self
10573 }
10574 }
10575
10576 impl wkt::message::Message for SpokeTypeCount {
10577 fn typename() -> &'static str {
10578 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount"
10579 }
10580 }
10581
10582 #[derive(Clone, Default, PartialEq)]
10585 #[non_exhaustive]
10586 pub struct SpokeStateCount {
10587 pub state: crate::model::State,
10589
10590 pub count: i64,
10593
10594 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10595 }
10596
10597 impl SpokeStateCount {
10598 pub fn new() -> Self {
10599 std::default::Default::default()
10600 }
10601
10602 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
10604 self.state = v.into();
10605 self
10606 }
10607
10608 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10610 self.count = v.into();
10611 self
10612 }
10613 }
10614
10615 impl wkt::message::Message for SpokeStateCount {
10616 fn typename() -> &'static str {
10617 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount"
10618 }
10619 }
10620
10621 #[derive(Clone, Default, PartialEq)]
10623 #[non_exhaustive]
10624 pub struct SpokeStateReasonCount {
10625 pub state_reason_code: crate::model::spoke::state_reason::Code,
10627
10628 pub count: i64,
10631
10632 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10633 }
10634
10635 impl SpokeStateReasonCount {
10636 pub fn new() -> Self {
10637 std::default::Default::default()
10638 }
10639
10640 pub fn set_state_reason_code<
10642 T: std::convert::Into<crate::model::spoke::state_reason::Code>,
10643 >(
10644 mut self,
10645 v: T,
10646 ) -> Self {
10647 self.state_reason_code = v.into();
10648 self
10649 }
10650
10651 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10653 self.count = v.into();
10654 self
10655 }
10656 }
10657
10658 impl wkt::message::Message for SpokeStateReasonCount {
10659 fn typename() -> &'static str {
10660 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount"
10661 }
10662 }
10663}
10664
10665#[derive(Clone, Default, PartialEq)]
10670#[non_exhaustive]
10671pub struct GetGroupRequest {
10672 pub name: std::string::String,
10674
10675 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10676}
10677
10678impl GetGroupRequest {
10679 pub fn new() -> Self {
10680 std::default::Default::default()
10681 }
10682
10683 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10685 self.name = v.into();
10686 self
10687 }
10688}
10689
10690impl wkt::message::Message for GetGroupRequest {
10691 fn typename() -> &'static str {
10692 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetGroupRequest"
10693 }
10694}
10695
10696#[derive(Clone, Default, PartialEq)]
10702#[non_exhaustive]
10703pub struct UpdateGroupRequest {
10704 pub update_mask: std::option::Option<wkt::FieldMask>,
10710
10711 pub group: std::option::Option<crate::model::Group>,
10713
10714 pub request_id: std::string::String,
10729
10730 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10731}
10732
10733impl UpdateGroupRequest {
10734 pub fn new() -> Self {
10735 std::default::Default::default()
10736 }
10737
10738 pub fn set_update_mask<T>(mut self, v: T) -> Self
10740 where
10741 T: std::convert::Into<wkt::FieldMask>,
10742 {
10743 self.update_mask = std::option::Option::Some(v.into());
10744 self
10745 }
10746
10747 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10749 where
10750 T: std::convert::Into<wkt::FieldMask>,
10751 {
10752 self.update_mask = v.map(|x| x.into());
10753 self
10754 }
10755
10756 pub fn set_group<T>(mut self, v: T) -> Self
10758 where
10759 T: std::convert::Into<crate::model::Group>,
10760 {
10761 self.group = std::option::Option::Some(v.into());
10762 self
10763 }
10764
10765 pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
10767 where
10768 T: std::convert::Into<crate::model::Group>,
10769 {
10770 self.group = v.map(|x| x.into());
10771 self
10772 }
10773
10774 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10776 self.request_id = v.into();
10777 self
10778 }
10779}
10780
10781impl wkt::message::Message for UpdateGroupRequest {
10782 fn typename() -> &'static str {
10783 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateGroupRequest"
10784 }
10785}
10786
10787#[derive(Clone, Default, PartialEq)]
10793#[non_exhaustive]
10794pub struct InternalRange {
10795 pub name: std::string::String,
10800
10801 pub create_time: std::option::Option<wkt::Timestamp>,
10803
10804 pub update_time: std::option::Option<wkt::Timestamp>,
10806
10807 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10809
10810 pub description: std::string::String,
10812
10813 pub ip_cidr_range: std::string::String,
10819
10820 pub network: std::string::String,
10828
10829 pub usage: crate::model::internal_range::Usage,
10831
10832 pub peering: crate::model::internal_range::Peering,
10834
10835 pub prefix_length: i32,
10844
10845 pub target_cidr_range: std::vec::Vec<std::string::String>,
10851
10852 pub users: std::vec::Vec<std::string::String>,
10859
10860 pub overlaps: std::vec::Vec<crate::model::internal_range::Overlap>,
10863
10864 pub migration: std::option::Option<crate::model::internal_range::Migration>,
10866
10867 pub immutable: bool,
10870
10871 pub allocation_options: std::option::Option<crate::model::internal_range::AllocationOptions>,
10875
10876 pub exclude_cidr_ranges: std::vec::Vec<std::string::String>,
10880
10881 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10882}
10883
10884impl InternalRange {
10885 pub fn new() -> Self {
10886 std::default::Default::default()
10887 }
10888
10889 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10891 self.name = v.into();
10892 self
10893 }
10894
10895 pub fn set_create_time<T>(mut self, v: T) -> Self
10897 where
10898 T: std::convert::Into<wkt::Timestamp>,
10899 {
10900 self.create_time = std::option::Option::Some(v.into());
10901 self
10902 }
10903
10904 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10906 where
10907 T: std::convert::Into<wkt::Timestamp>,
10908 {
10909 self.create_time = v.map(|x| x.into());
10910 self
10911 }
10912
10913 pub fn set_update_time<T>(mut self, v: T) -> Self
10915 where
10916 T: std::convert::Into<wkt::Timestamp>,
10917 {
10918 self.update_time = std::option::Option::Some(v.into());
10919 self
10920 }
10921
10922 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10924 where
10925 T: std::convert::Into<wkt::Timestamp>,
10926 {
10927 self.update_time = v.map(|x| x.into());
10928 self
10929 }
10930
10931 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10933 where
10934 T: std::iter::IntoIterator<Item = (K, V)>,
10935 K: std::convert::Into<std::string::String>,
10936 V: std::convert::Into<std::string::String>,
10937 {
10938 use std::iter::Iterator;
10939 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10940 self
10941 }
10942
10943 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10945 self.description = v.into();
10946 self
10947 }
10948
10949 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10951 self.ip_cidr_range = v.into();
10952 self
10953 }
10954
10955 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10957 self.network = v.into();
10958 self
10959 }
10960
10961 pub fn set_usage<T: std::convert::Into<crate::model::internal_range::Usage>>(
10963 mut self,
10964 v: T,
10965 ) -> Self {
10966 self.usage = v.into();
10967 self
10968 }
10969
10970 pub fn set_peering<T: std::convert::Into<crate::model::internal_range::Peering>>(
10972 mut self,
10973 v: T,
10974 ) -> Self {
10975 self.peering = v.into();
10976 self
10977 }
10978
10979 pub fn set_prefix_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10981 self.prefix_length = v.into();
10982 self
10983 }
10984
10985 pub fn set_target_cidr_range<T, V>(mut self, v: T) -> Self
10987 where
10988 T: std::iter::IntoIterator<Item = V>,
10989 V: std::convert::Into<std::string::String>,
10990 {
10991 use std::iter::Iterator;
10992 self.target_cidr_range = v.into_iter().map(|i| i.into()).collect();
10993 self
10994 }
10995
10996 pub fn set_users<T, V>(mut self, v: T) -> Self
10998 where
10999 T: std::iter::IntoIterator<Item = V>,
11000 V: std::convert::Into<std::string::String>,
11001 {
11002 use std::iter::Iterator;
11003 self.users = v.into_iter().map(|i| i.into()).collect();
11004 self
11005 }
11006
11007 pub fn set_overlaps<T, V>(mut self, v: T) -> Self
11009 where
11010 T: std::iter::IntoIterator<Item = V>,
11011 V: std::convert::Into<crate::model::internal_range::Overlap>,
11012 {
11013 use std::iter::Iterator;
11014 self.overlaps = v.into_iter().map(|i| i.into()).collect();
11015 self
11016 }
11017
11018 pub fn set_migration<T>(mut self, v: T) -> Self
11020 where
11021 T: std::convert::Into<crate::model::internal_range::Migration>,
11022 {
11023 self.migration = std::option::Option::Some(v.into());
11024 self
11025 }
11026
11027 pub fn set_or_clear_migration<T>(mut self, v: std::option::Option<T>) -> Self
11029 where
11030 T: std::convert::Into<crate::model::internal_range::Migration>,
11031 {
11032 self.migration = v.map(|x| x.into());
11033 self
11034 }
11035
11036 pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11038 self.immutable = v.into();
11039 self
11040 }
11041
11042 pub fn set_allocation_options<T>(mut self, v: T) -> Self
11044 where
11045 T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
11046 {
11047 self.allocation_options = std::option::Option::Some(v.into());
11048 self
11049 }
11050
11051 pub fn set_or_clear_allocation_options<T>(mut self, v: std::option::Option<T>) -> Self
11053 where
11054 T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
11055 {
11056 self.allocation_options = v.map(|x| x.into());
11057 self
11058 }
11059
11060 pub fn set_exclude_cidr_ranges<T, V>(mut self, v: T) -> Self
11062 where
11063 T: std::iter::IntoIterator<Item = V>,
11064 V: std::convert::Into<std::string::String>,
11065 {
11066 use std::iter::Iterator;
11067 self.exclude_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
11068 self
11069 }
11070}
11071
11072impl wkt::message::Message for InternalRange {
11073 fn typename() -> &'static str {
11074 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange"
11075 }
11076}
11077
11078pub mod internal_range {
11080 #[allow(unused_imports)]
11081 use super::*;
11082
11083 #[derive(Clone, Default, PartialEq)]
11085 #[non_exhaustive]
11086 pub struct Migration {
11087 pub source: std::string::String,
11092
11093 pub target: std::string::String,
11098
11099 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11100 }
11101
11102 impl Migration {
11103 pub fn new() -> Self {
11104 std::default::Default::default()
11105 }
11106
11107 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11109 self.source = v.into();
11110 self
11111 }
11112
11113 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11115 self.target = v.into();
11116 self
11117 }
11118 }
11119
11120 impl wkt::message::Message for Migration {
11121 fn typename() -> &'static str {
11122 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.Migration"
11123 }
11124 }
11125
11126 #[derive(Clone, Default, PartialEq)]
11129 #[non_exhaustive]
11130 pub struct AllocationOptions {
11131 pub allocation_strategy: crate::model::internal_range::AllocationStrategy,
11134
11135 pub first_available_ranges_lookup_size: i32,
11140
11141 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11142 }
11143
11144 impl AllocationOptions {
11145 pub fn new() -> Self {
11146 std::default::Default::default()
11147 }
11148
11149 pub fn set_allocation_strategy<
11151 T: std::convert::Into<crate::model::internal_range::AllocationStrategy>,
11152 >(
11153 mut self,
11154 v: T,
11155 ) -> Self {
11156 self.allocation_strategy = v.into();
11157 self
11158 }
11159
11160 pub fn set_first_available_ranges_lookup_size<T: std::convert::Into<i32>>(
11162 mut self,
11163 v: T,
11164 ) -> Self {
11165 self.first_available_ranges_lookup_size = v.into();
11166 self
11167 }
11168 }
11169
11170 impl wkt::message::Message for AllocationOptions {
11171 fn typename() -> &'static str {
11172 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.AllocationOptions"
11173 }
11174 }
11175
11176 #[derive(Clone, Debug, PartialEq)]
11192 #[non_exhaustive]
11193 pub enum Usage {
11194 Unspecified,
11200 ForVpc,
11203 ExternalToVpc,
11208 ForMigration,
11212 UnknownValue(usage::UnknownValue),
11217 }
11218
11219 #[doc(hidden)]
11220 pub mod usage {
11221 #[allow(unused_imports)]
11222 use super::*;
11223 #[derive(Clone, Debug, PartialEq)]
11224 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11225 }
11226
11227 impl Usage {
11228 pub fn value(&self) -> std::option::Option<i32> {
11233 match self {
11234 Self::Unspecified => std::option::Option::Some(0),
11235 Self::ForVpc => std::option::Option::Some(1),
11236 Self::ExternalToVpc => std::option::Option::Some(2),
11237 Self::ForMigration => std::option::Option::Some(3),
11238 Self::UnknownValue(u) => u.0.value(),
11239 }
11240 }
11241
11242 pub fn name(&self) -> std::option::Option<&str> {
11247 match self {
11248 Self::Unspecified => std::option::Option::Some("USAGE_UNSPECIFIED"),
11249 Self::ForVpc => std::option::Option::Some("FOR_VPC"),
11250 Self::ExternalToVpc => std::option::Option::Some("EXTERNAL_TO_VPC"),
11251 Self::ForMigration => std::option::Option::Some("FOR_MIGRATION"),
11252 Self::UnknownValue(u) => u.0.name(),
11253 }
11254 }
11255 }
11256
11257 impl std::default::Default for Usage {
11258 fn default() -> Self {
11259 use std::convert::From;
11260 Self::from(0)
11261 }
11262 }
11263
11264 impl std::fmt::Display for Usage {
11265 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11266 wkt::internal::display_enum(f, self.name(), self.value())
11267 }
11268 }
11269
11270 impl std::convert::From<i32> for Usage {
11271 fn from(value: i32) -> Self {
11272 match value {
11273 0 => Self::Unspecified,
11274 1 => Self::ForVpc,
11275 2 => Self::ExternalToVpc,
11276 3 => Self::ForMigration,
11277 _ => Self::UnknownValue(usage::UnknownValue(
11278 wkt::internal::UnknownEnumValue::Integer(value),
11279 )),
11280 }
11281 }
11282 }
11283
11284 impl std::convert::From<&str> for Usage {
11285 fn from(value: &str) -> Self {
11286 use std::string::ToString;
11287 match value {
11288 "USAGE_UNSPECIFIED" => Self::Unspecified,
11289 "FOR_VPC" => Self::ForVpc,
11290 "EXTERNAL_TO_VPC" => Self::ExternalToVpc,
11291 "FOR_MIGRATION" => Self::ForMigration,
11292 _ => Self::UnknownValue(usage::UnknownValue(
11293 wkt::internal::UnknownEnumValue::String(value.to_string()),
11294 )),
11295 }
11296 }
11297 }
11298
11299 impl serde::ser::Serialize for Usage {
11300 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11301 where
11302 S: serde::Serializer,
11303 {
11304 match self {
11305 Self::Unspecified => serializer.serialize_i32(0),
11306 Self::ForVpc => serializer.serialize_i32(1),
11307 Self::ExternalToVpc => serializer.serialize_i32(2),
11308 Self::ForMigration => serializer.serialize_i32(3),
11309 Self::UnknownValue(u) => u.0.serialize(serializer),
11310 }
11311 }
11312 }
11313
11314 impl<'de> serde::de::Deserialize<'de> for Usage {
11315 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11316 where
11317 D: serde::Deserializer<'de>,
11318 {
11319 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Usage>::new(
11320 ".google.cloud.networkconnectivity.v1.InternalRange.Usage",
11321 ))
11322 }
11323 }
11324
11325 #[derive(Clone, Debug, PartialEq)]
11341 #[non_exhaustive]
11342 pub enum Peering {
11343 Unspecified,
11346 ForSelf,
11351 ForPeer,
11357 NotShared,
11366 UnknownValue(peering::UnknownValue),
11371 }
11372
11373 #[doc(hidden)]
11374 pub mod peering {
11375 #[allow(unused_imports)]
11376 use super::*;
11377 #[derive(Clone, Debug, PartialEq)]
11378 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11379 }
11380
11381 impl Peering {
11382 pub fn value(&self) -> std::option::Option<i32> {
11387 match self {
11388 Self::Unspecified => std::option::Option::Some(0),
11389 Self::ForSelf => std::option::Option::Some(1),
11390 Self::ForPeer => std::option::Option::Some(2),
11391 Self::NotShared => std::option::Option::Some(3),
11392 Self::UnknownValue(u) => u.0.value(),
11393 }
11394 }
11395
11396 pub fn name(&self) -> std::option::Option<&str> {
11401 match self {
11402 Self::Unspecified => std::option::Option::Some("PEERING_UNSPECIFIED"),
11403 Self::ForSelf => std::option::Option::Some("FOR_SELF"),
11404 Self::ForPeer => std::option::Option::Some("FOR_PEER"),
11405 Self::NotShared => std::option::Option::Some("NOT_SHARED"),
11406 Self::UnknownValue(u) => u.0.name(),
11407 }
11408 }
11409 }
11410
11411 impl std::default::Default for Peering {
11412 fn default() -> Self {
11413 use std::convert::From;
11414 Self::from(0)
11415 }
11416 }
11417
11418 impl std::fmt::Display for Peering {
11419 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11420 wkt::internal::display_enum(f, self.name(), self.value())
11421 }
11422 }
11423
11424 impl std::convert::From<i32> for Peering {
11425 fn from(value: i32) -> Self {
11426 match value {
11427 0 => Self::Unspecified,
11428 1 => Self::ForSelf,
11429 2 => Self::ForPeer,
11430 3 => Self::NotShared,
11431 _ => Self::UnknownValue(peering::UnknownValue(
11432 wkt::internal::UnknownEnumValue::Integer(value),
11433 )),
11434 }
11435 }
11436 }
11437
11438 impl std::convert::From<&str> for Peering {
11439 fn from(value: &str) -> Self {
11440 use std::string::ToString;
11441 match value {
11442 "PEERING_UNSPECIFIED" => Self::Unspecified,
11443 "FOR_SELF" => Self::ForSelf,
11444 "FOR_PEER" => Self::ForPeer,
11445 "NOT_SHARED" => Self::NotShared,
11446 _ => Self::UnknownValue(peering::UnknownValue(
11447 wkt::internal::UnknownEnumValue::String(value.to_string()),
11448 )),
11449 }
11450 }
11451 }
11452
11453 impl serde::ser::Serialize for Peering {
11454 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11455 where
11456 S: serde::Serializer,
11457 {
11458 match self {
11459 Self::Unspecified => serializer.serialize_i32(0),
11460 Self::ForSelf => serializer.serialize_i32(1),
11461 Self::ForPeer => serializer.serialize_i32(2),
11462 Self::NotShared => serializer.serialize_i32(3),
11463 Self::UnknownValue(u) => u.0.serialize(serializer),
11464 }
11465 }
11466 }
11467
11468 impl<'de> serde::de::Deserialize<'de> for Peering {
11469 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11470 where
11471 D: serde::Deserializer<'de>,
11472 {
11473 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Peering>::new(
11474 ".google.cloud.networkconnectivity.v1.InternalRange.Peering",
11475 ))
11476 }
11477 }
11478
11479 #[derive(Clone, Debug, PartialEq)]
11495 #[non_exhaustive]
11496 pub enum Overlap {
11497 Unspecified,
11499 RouteRange,
11502 ExistingSubnetRange,
11504 UnknownValue(overlap::UnknownValue),
11509 }
11510
11511 #[doc(hidden)]
11512 pub mod overlap {
11513 #[allow(unused_imports)]
11514 use super::*;
11515 #[derive(Clone, Debug, PartialEq)]
11516 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11517 }
11518
11519 impl Overlap {
11520 pub fn value(&self) -> std::option::Option<i32> {
11525 match self {
11526 Self::Unspecified => std::option::Option::Some(0),
11527 Self::RouteRange => std::option::Option::Some(1),
11528 Self::ExistingSubnetRange => std::option::Option::Some(2),
11529 Self::UnknownValue(u) => u.0.value(),
11530 }
11531 }
11532
11533 pub fn name(&self) -> std::option::Option<&str> {
11538 match self {
11539 Self::Unspecified => std::option::Option::Some("OVERLAP_UNSPECIFIED"),
11540 Self::RouteRange => std::option::Option::Some("OVERLAP_ROUTE_RANGE"),
11541 Self::ExistingSubnetRange => {
11542 std::option::Option::Some("OVERLAP_EXISTING_SUBNET_RANGE")
11543 }
11544 Self::UnknownValue(u) => u.0.name(),
11545 }
11546 }
11547 }
11548
11549 impl std::default::Default for Overlap {
11550 fn default() -> Self {
11551 use std::convert::From;
11552 Self::from(0)
11553 }
11554 }
11555
11556 impl std::fmt::Display for Overlap {
11557 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11558 wkt::internal::display_enum(f, self.name(), self.value())
11559 }
11560 }
11561
11562 impl std::convert::From<i32> for Overlap {
11563 fn from(value: i32) -> Self {
11564 match value {
11565 0 => Self::Unspecified,
11566 1 => Self::RouteRange,
11567 2 => Self::ExistingSubnetRange,
11568 _ => Self::UnknownValue(overlap::UnknownValue(
11569 wkt::internal::UnknownEnumValue::Integer(value),
11570 )),
11571 }
11572 }
11573 }
11574
11575 impl std::convert::From<&str> for Overlap {
11576 fn from(value: &str) -> Self {
11577 use std::string::ToString;
11578 match value {
11579 "OVERLAP_UNSPECIFIED" => Self::Unspecified,
11580 "OVERLAP_ROUTE_RANGE" => Self::RouteRange,
11581 "OVERLAP_EXISTING_SUBNET_RANGE" => Self::ExistingSubnetRange,
11582 _ => Self::UnknownValue(overlap::UnknownValue(
11583 wkt::internal::UnknownEnumValue::String(value.to_string()),
11584 )),
11585 }
11586 }
11587 }
11588
11589 impl serde::ser::Serialize for Overlap {
11590 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11591 where
11592 S: serde::Serializer,
11593 {
11594 match self {
11595 Self::Unspecified => serializer.serialize_i32(0),
11596 Self::RouteRange => serializer.serialize_i32(1),
11597 Self::ExistingSubnetRange => serializer.serialize_i32(2),
11598 Self::UnknownValue(u) => u.0.serialize(serializer),
11599 }
11600 }
11601 }
11602
11603 impl<'de> serde::de::Deserialize<'de> for Overlap {
11604 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11605 where
11606 D: serde::Deserializer<'de>,
11607 {
11608 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Overlap>::new(
11609 ".google.cloud.networkconnectivity.v1.InternalRange.Overlap",
11610 ))
11611 }
11612 }
11613
11614 #[derive(Clone, Debug, PartialEq)]
11630 #[non_exhaustive]
11631 pub enum AllocationStrategy {
11632 Unspecified,
11636 Random,
11642 FirstAvailable,
11645 RandomFirstNAvailable,
11650 FirstSmallestFitting,
11653 UnknownValue(allocation_strategy::UnknownValue),
11658 }
11659
11660 #[doc(hidden)]
11661 pub mod allocation_strategy {
11662 #[allow(unused_imports)]
11663 use super::*;
11664 #[derive(Clone, Debug, PartialEq)]
11665 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11666 }
11667
11668 impl AllocationStrategy {
11669 pub fn value(&self) -> std::option::Option<i32> {
11674 match self {
11675 Self::Unspecified => std::option::Option::Some(0),
11676 Self::Random => std::option::Option::Some(1),
11677 Self::FirstAvailable => std::option::Option::Some(2),
11678 Self::RandomFirstNAvailable => std::option::Option::Some(3),
11679 Self::FirstSmallestFitting => std::option::Option::Some(4),
11680 Self::UnknownValue(u) => u.0.value(),
11681 }
11682 }
11683
11684 pub fn name(&self) -> std::option::Option<&str> {
11689 match self {
11690 Self::Unspecified => std::option::Option::Some("ALLOCATION_STRATEGY_UNSPECIFIED"),
11691 Self::Random => std::option::Option::Some("RANDOM"),
11692 Self::FirstAvailable => std::option::Option::Some("FIRST_AVAILABLE"),
11693 Self::RandomFirstNAvailable => {
11694 std::option::Option::Some("RANDOM_FIRST_N_AVAILABLE")
11695 }
11696 Self::FirstSmallestFitting => std::option::Option::Some("FIRST_SMALLEST_FITTING"),
11697 Self::UnknownValue(u) => u.0.name(),
11698 }
11699 }
11700 }
11701
11702 impl std::default::Default for AllocationStrategy {
11703 fn default() -> Self {
11704 use std::convert::From;
11705 Self::from(0)
11706 }
11707 }
11708
11709 impl std::fmt::Display for AllocationStrategy {
11710 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11711 wkt::internal::display_enum(f, self.name(), self.value())
11712 }
11713 }
11714
11715 impl std::convert::From<i32> for AllocationStrategy {
11716 fn from(value: i32) -> Self {
11717 match value {
11718 0 => Self::Unspecified,
11719 1 => Self::Random,
11720 2 => Self::FirstAvailable,
11721 3 => Self::RandomFirstNAvailable,
11722 4 => Self::FirstSmallestFitting,
11723 _ => Self::UnknownValue(allocation_strategy::UnknownValue(
11724 wkt::internal::UnknownEnumValue::Integer(value),
11725 )),
11726 }
11727 }
11728 }
11729
11730 impl std::convert::From<&str> for AllocationStrategy {
11731 fn from(value: &str) -> Self {
11732 use std::string::ToString;
11733 match value {
11734 "ALLOCATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
11735 "RANDOM" => Self::Random,
11736 "FIRST_AVAILABLE" => Self::FirstAvailable,
11737 "RANDOM_FIRST_N_AVAILABLE" => Self::RandomFirstNAvailable,
11738 "FIRST_SMALLEST_FITTING" => Self::FirstSmallestFitting,
11739 _ => Self::UnknownValue(allocation_strategy::UnknownValue(
11740 wkt::internal::UnknownEnumValue::String(value.to_string()),
11741 )),
11742 }
11743 }
11744 }
11745
11746 impl serde::ser::Serialize for AllocationStrategy {
11747 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11748 where
11749 S: serde::Serializer,
11750 {
11751 match self {
11752 Self::Unspecified => serializer.serialize_i32(0),
11753 Self::Random => serializer.serialize_i32(1),
11754 Self::FirstAvailable => serializer.serialize_i32(2),
11755 Self::RandomFirstNAvailable => serializer.serialize_i32(3),
11756 Self::FirstSmallestFitting => serializer.serialize_i32(4),
11757 Self::UnknownValue(u) => u.0.serialize(serializer),
11758 }
11759 }
11760 }
11761
11762 impl<'de> serde::de::Deserialize<'de> for AllocationStrategy {
11763 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11764 where
11765 D: serde::Deserializer<'de>,
11766 {
11767 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AllocationStrategy>::new(
11768 ".google.cloud.networkconnectivity.v1.InternalRange.AllocationStrategy",
11769 ))
11770 }
11771 }
11772}
11773
11774#[derive(Clone, Default, PartialEq)]
11776#[non_exhaustive]
11777pub struct ListInternalRangesRequest {
11778 pub parent: std::string::String,
11780
11781 pub page_size: i32,
11783
11784 pub page_token: std::string::String,
11786
11787 pub filter: std::string::String,
11789
11790 pub order_by: std::string::String,
11792
11793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11794}
11795
11796impl ListInternalRangesRequest {
11797 pub fn new() -> Self {
11798 std::default::Default::default()
11799 }
11800
11801 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11803 self.parent = v.into();
11804 self
11805 }
11806
11807 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11809 self.page_size = v.into();
11810 self
11811 }
11812
11813 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11815 self.page_token = v.into();
11816 self
11817 }
11818
11819 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11821 self.filter = v.into();
11822 self
11823 }
11824
11825 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11827 self.order_by = v.into();
11828 self
11829 }
11830}
11831
11832impl wkt::message::Message for ListInternalRangesRequest {
11833 fn typename() -> &'static str {
11834 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesRequest"
11835 }
11836}
11837
11838#[derive(Clone, Default, PartialEq)]
11840#[non_exhaustive]
11841pub struct ListInternalRangesResponse {
11842 pub internal_ranges: std::vec::Vec<crate::model::InternalRange>,
11844
11845 pub next_page_token: std::string::String,
11848
11849 pub unreachable: std::vec::Vec<std::string::String>,
11851
11852 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11853}
11854
11855impl ListInternalRangesResponse {
11856 pub fn new() -> Self {
11857 std::default::Default::default()
11858 }
11859
11860 pub fn set_internal_ranges<T, V>(mut self, v: T) -> Self
11862 where
11863 T: std::iter::IntoIterator<Item = V>,
11864 V: std::convert::Into<crate::model::InternalRange>,
11865 {
11866 use std::iter::Iterator;
11867 self.internal_ranges = v.into_iter().map(|i| i.into()).collect();
11868 self
11869 }
11870
11871 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11873 self.next_page_token = v.into();
11874 self
11875 }
11876
11877 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11879 where
11880 T: std::iter::IntoIterator<Item = V>,
11881 V: std::convert::Into<std::string::String>,
11882 {
11883 use std::iter::Iterator;
11884 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11885 self
11886 }
11887}
11888
11889impl wkt::message::Message for ListInternalRangesResponse {
11890 fn typename() -> &'static str {
11891 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesResponse"
11892 }
11893}
11894
11895#[doc(hidden)]
11896impl gax::paginator::internal::PageableResponse for ListInternalRangesResponse {
11897 type PageItem = crate::model::InternalRange;
11898
11899 fn items(self) -> std::vec::Vec<Self::PageItem> {
11900 self.internal_ranges
11901 }
11902
11903 fn next_page_token(&self) -> std::string::String {
11904 use std::clone::Clone;
11905 self.next_page_token.clone()
11906 }
11907}
11908
11909#[derive(Clone, Default, PartialEq)]
11911#[non_exhaustive]
11912pub struct GetInternalRangeRequest {
11913 pub name: std::string::String,
11915
11916 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11917}
11918
11919impl GetInternalRangeRequest {
11920 pub fn new() -> Self {
11921 std::default::Default::default()
11922 }
11923
11924 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11926 self.name = v.into();
11927 self
11928 }
11929}
11930
11931impl wkt::message::Message for GetInternalRangeRequest {
11932 fn typename() -> &'static str {
11933 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetInternalRangeRequest"
11934 }
11935}
11936
11937#[derive(Clone, Default, PartialEq)]
11939#[non_exhaustive]
11940pub struct CreateInternalRangeRequest {
11941 pub parent: std::string::String,
11943
11944 pub internal_range_id: std::string::String,
11949
11950 pub internal_range: std::option::Option<crate::model::InternalRange>,
11952
11953 pub request_id: std::string::String,
11967
11968 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11969}
11970
11971impl CreateInternalRangeRequest {
11972 pub fn new() -> Self {
11973 std::default::Default::default()
11974 }
11975
11976 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11978 self.parent = v.into();
11979 self
11980 }
11981
11982 pub fn set_internal_range_id<T: std::convert::Into<std::string::String>>(
11984 mut self,
11985 v: T,
11986 ) -> Self {
11987 self.internal_range_id = v.into();
11988 self
11989 }
11990
11991 pub fn set_internal_range<T>(mut self, v: T) -> Self
11993 where
11994 T: std::convert::Into<crate::model::InternalRange>,
11995 {
11996 self.internal_range = std::option::Option::Some(v.into());
11997 self
11998 }
11999
12000 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
12002 where
12003 T: std::convert::Into<crate::model::InternalRange>,
12004 {
12005 self.internal_range = v.map(|x| x.into());
12006 self
12007 }
12008
12009 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12011 self.request_id = v.into();
12012 self
12013 }
12014}
12015
12016impl wkt::message::Message for CreateInternalRangeRequest {
12017 fn typename() -> &'static str {
12018 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateInternalRangeRequest"
12019 }
12020}
12021
12022#[derive(Clone, Default, PartialEq)]
12024#[non_exhaustive]
12025pub struct UpdateInternalRangeRequest {
12026 pub update_mask: std::option::Option<wkt::FieldMask>,
12032
12033 pub internal_range: std::option::Option<crate::model::InternalRange>,
12035
12036 pub request_id: std::string::String,
12050
12051 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12052}
12053
12054impl UpdateInternalRangeRequest {
12055 pub fn new() -> Self {
12056 std::default::Default::default()
12057 }
12058
12059 pub fn set_update_mask<T>(mut self, v: T) -> Self
12061 where
12062 T: std::convert::Into<wkt::FieldMask>,
12063 {
12064 self.update_mask = std::option::Option::Some(v.into());
12065 self
12066 }
12067
12068 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12070 where
12071 T: std::convert::Into<wkt::FieldMask>,
12072 {
12073 self.update_mask = v.map(|x| x.into());
12074 self
12075 }
12076
12077 pub fn set_internal_range<T>(mut self, v: T) -> Self
12079 where
12080 T: std::convert::Into<crate::model::InternalRange>,
12081 {
12082 self.internal_range = std::option::Option::Some(v.into());
12083 self
12084 }
12085
12086 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
12088 where
12089 T: std::convert::Into<crate::model::InternalRange>,
12090 {
12091 self.internal_range = v.map(|x| x.into());
12092 self
12093 }
12094
12095 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12097 self.request_id = v.into();
12098 self
12099 }
12100}
12101
12102impl wkt::message::Message for UpdateInternalRangeRequest {
12103 fn typename() -> &'static str {
12104 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateInternalRangeRequest"
12105 }
12106}
12107
12108#[derive(Clone, Default, PartialEq)]
12110#[non_exhaustive]
12111pub struct DeleteInternalRangeRequest {
12112 pub name: std::string::String,
12114
12115 pub request_id: std::string::String,
12129
12130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12131}
12132
12133impl DeleteInternalRangeRequest {
12134 pub fn new() -> Self {
12135 std::default::Default::default()
12136 }
12137
12138 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12140 self.name = v.into();
12141 self
12142 }
12143
12144 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12146 self.request_id = v.into();
12147 self
12148 }
12149}
12150
12151impl wkt::message::Message for DeleteInternalRangeRequest {
12152 fn typename() -> &'static str {
12153 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteInternalRangeRequest"
12154 }
12155}
12156
12157#[derive(Clone, Default, PartialEq)]
12162#[non_exhaustive]
12163pub struct PolicyBasedRoute {
12164 pub name: std::string::String,
12167
12168 pub create_time: std::option::Option<wkt::Timestamp>,
12170
12171 pub update_time: std::option::Option<wkt::Timestamp>,
12173
12174 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12176
12177 pub description: std::string::String,
12180
12181 pub network: std::string::String,
12184
12185 pub filter: std::option::Option<crate::model::policy_based_route::Filter>,
12187
12188 pub priority: i32,
12194
12195 pub warnings: std::vec::Vec<crate::model::policy_based_route::Warnings>,
12198
12199 pub self_link: std::string::String,
12201
12202 pub kind: std::string::String,
12205
12206 pub target: std::option::Option<crate::model::policy_based_route::Target>,
12210
12211 pub next_hop: std::option::Option<crate::model::policy_based_route::NextHop>,
12212
12213 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12214}
12215
12216impl PolicyBasedRoute {
12217 pub fn new() -> Self {
12218 std::default::Default::default()
12219 }
12220
12221 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12223 self.name = v.into();
12224 self
12225 }
12226
12227 pub fn set_create_time<T>(mut self, v: T) -> Self
12229 where
12230 T: std::convert::Into<wkt::Timestamp>,
12231 {
12232 self.create_time = std::option::Option::Some(v.into());
12233 self
12234 }
12235
12236 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12238 where
12239 T: std::convert::Into<wkt::Timestamp>,
12240 {
12241 self.create_time = v.map(|x| x.into());
12242 self
12243 }
12244
12245 pub fn set_update_time<T>(mut self, v: T) -> Self
12247 where
12248 T: std::convert::Into<wkt::Timestamp>,
12249 {
12250 self.update_time = std::option::Option::Some(v.into());
12251 self
12252 }
12253
12254 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12256 where
12257 T: std::convert::Into<wkt::Timestamp>,
12258 {
12259 self.update_time = v.map(|x| x.into());
12260 self
12261 }
12262
12263 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12265 where
12266 T: std::iter::IntoIterator<Item = (K, V)>,
12267 K: std::convert::Into<std::string::String>,
12268 V: std::convert::Into<std::string::String>,
12269 {
12270 use std::iter::Iterator;
12271 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12272 self
12273 }
12274
12275 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12277 self.description = v.into();
12278 self
12279 }
12280
12281 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12283 self.network = v.into();
12284 self
12285 }
12286
12287 pub fn set_filter<T>(mut self, v: T) -> Self
12289 where
12290 T: std::convert::Into<crate::model::policy_based_route::Filter>,
12291 {
12292 self.filter = std::option::Option::Some(v.into());
12293 self
12294 }
12295
12296 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
12298 where
12299 T: std::convert::Into<crate::model::policy_based_route::Filter>,
12300 {
12301 self.filter = v.map(|x| x.into());
12302 self
12303 }
12304
12305 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12307 self.priority = v.into();
12308 self
12309 }
12310
12311 pub fn set_warnings<T, V>(mut self, v: T) -> Self
12313 where
12314 T: std::iter::IntoIterator<Item = V>,
12315 V: std::convert::Into<crate::model::policy_based_route::Warnings>,
12316 {
12317 use std::iter::Iterator;
12318 self.warnings = v.into_iter().map(|i| i.into()).collect();
12319 self
12320 }
12321
12322 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12324 self.self_link = v.into();
12325 self
12326 }
12327
12328 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12330 self.kind = v.into();
12331 self
12332 }
12333
12334 pub fn set_target<
12339 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Target>>,
12340 >(
12341 mut self,
12342 v: T,
12343 ) -> Self {
12344 self.target = v.into();
12345 self
12346 }
12347
12348 pub fn virtual_machine(
12352 &self,
12353 ) -> std::option::Option<&std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>
12354 {
12355 #[allow(unreachable_patterns)]
12356 self.target.as_ref().and_then(|v| match v {
12357 crate::model::policy_based_route::Target::VirtualMachine(v) => {
12358 std::option::Option::Some(v)
12359 }
12360 _ => std::option::Option::None,
12361 })
12362 }
12363
12364 pub fn set_virtual_machine<
12370 T: std::convert::Into<std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>,
12371 >(
12372 mut self,
12373 v: T,
12374 ) -> Self {
12375 self.target = std::option::Option::Some(
12376 crate::model::policy_based_route::Target::VirtualMachine(v.into()),
12377 );
12378 self
12379 }
12380
12381 pub fn interconnect_attachment(
12385 &self,
12386 ) -> std::option::Option<
12387 &std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
12388 > {
12389 #[allow(unreachable_patterns)]
12390 self.target.as_ref().and_then(|v| match v {
12391 crate::model::policy_based_route::Target::InterconnectAttachment(v) => {
12392 std::option::Option::Some(v)
12393 }
12394 _ => std::option::Option::None,
12395 })
12396 }
12397
12398 pub fn set_interconnect_attachment<
12404 T: std::convert::Into<
12405 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
12406 >,
12407 >(
12408 mut self,
12409 v: T,
12410 ) -> Self {
12411 self.target = std::option::Option::Some(
12412 crate::model::policy_based_route::Target::InterconnectAttachment(v.into()),
12413 );
12414 self
12415 }
12416
12417 pub fn set_next_hop<
12422 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::NextHop>>,
12423 >(
12424 mut self,
12425 v: T,
12426 ) -> Self {
12427 self.next_hop = v.into();
12428 self
12429 }
12430
12431 pub fn next_hop_ilb_ip(&self) -> std::option::Option<&std::string::String> {
12435 #[allow(unreachable_patterns)]
12436 self.next_hop.as_ref().and_then(|v| match v {
12437 crate::model::policy_based_route::NextHop::NextHopIlbIp(v) => {
12438 std::option::Option::Some(v)
12439 }
12440 _ => std::option::Option::None,
12441 })
12442 }
12443
12444 pub fn set_next_hop_ilb_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12450 self.next_hop = std::option::Option::Some(
12451 crate::model::policy_based_route::NextHop::NextHopIlbIp(v.into()),
12452 );
12453 self
12454 }
12455
12456 pub fn next_hop_other_routes(
12460 &self,
12461 ) -> std::option::Option<&crate::model::policy_based_route::OtherRoutes> {
12462 #[allow(unreachable_patterns)]
12463 self.next_hop.as_ref().and_then(|v| match v {
12464 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v) => {
12465 std::option::Option::Some(v)
12466 }
12467 _ => std::option::Option::None,
12468 })
12469 }
12470
12471 pub fn set_next_hop_other_routes<
12477 T: std::convert::Into<crate::model::policy_based_route::OtherRoutes>,
12478 >(
12479 mut self,
12480 v: T,
12481 ) -> Self {
12482 self.next_hop = std::option::Option::Some(
12483 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v.into()),
12484 );
12485 self
12486 }
12487}
12488
12489impl wkt::message::Message for PolicyBasedRoute {
12490 fn typename() -> &'static str {
12491 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute"
12492 }
12493}
12494
12495pub mod policy_based_route {
12497 #[allow(unused_imports)]
12498 use super::*;
12499
12500 #[derive(Clone, Default, PartialEq)]
12502 #[non_exhaustive]
12503 pub struct VirtualMachine {
12504 pub tags: std::vec::Vec<std::string::String>,
12507
12508 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12509 }
12510
12511 impl VirtualMachine {
12512 pub fn new() -> Self {
12513 std::default::Default::default()
12514 }
12515
12516 pub fn set_tags<T, V>(mut self, v: T) -> Self
12518 where
12519 T: std::iter::IntoIterator<Item = V>,
12520 V: std::convert::Into<std::string::String>,
12521 {
12522 use std::iter::Iterator;
12523 self.tags = v.into_iter().map(|i| i.into()).collect();
12524 self
12525 }
12526 }
12527
12528 impl wkt::message::Message for VirtualMachine {
12529 fn typename() -> &'static str {
12530 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"
12531 }
12532 }
12533
12534 #[derive(Clone, Default, PartialEq)]
12536 #[non_exhaustive]
12537 pub struct InterconnectAttachment {
12538 pub region: std::string::String,
12541
12542 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12543 }
12544
12545 impl InterconnectAttachment {
12546 pub fn new() -> Self {
12547 std::default::Default::default()
12548 }
12549
12550 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12552 self.region = v.into();
12553 self
12554 }
12555 }
12556
12557 impl wkt::message::Message for InterconnectAttachment {
12558 fn typename() -> &'static str {
12559 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"
12560 }
12561 }
12562
12563 #[derive(Clone, Default, PartialEq)]
12565 #[non_exhaustive]
12566 pub struct Filter {
12567 pub ip_protocol: std::string::String,
12570
12571 pub src_range: std::string::String,
12574
12575 pub dest_range: std::string::String,
12579
12580 pub protocol_version: crate::model::policy_based_route::filter::ProtocolVersion,
12583
12584 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12585 }
12586
12587 impl Filter {
12588 pub fn new() -> Self {
12589 std::default::Default::default()
12590 }
12591
12592 pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12594 self.ip_protocol = v.into();
12595 self
12596 }
12597
12598 pub fn set_src_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12600 self.src_range = v.into();
12601 self
12602 }
12603
12604 pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12606 self.dest_range = v.into();
12607 self
12608 }
12609
12610 pub fn set_protocol_version<
12612 T: std::convert::Into<crate::model::policy_based_route::filter::ProtocolVersion>,
12613 >(
12614 mut self,
12615 v: T,
12616 ) -> Self {
12617 self.protocol_version = v.into();
12618 self
12619 }
12620 }
12621
12622 impl wkt::message::Message for Filter {
12623 fn typename() -> &'static str {
12624 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"
12625 }
12626 }
12627
12628 pub mod filter {
12630 #[allow(unused_imports)]
12631 use super::*;
12632
12633 #[derive(Clone, Debug, PartialEq)]
12649 #[non_exhaustive]
12650 pub enum ProtocolVersion {
12651 Unspecified,
12653 Ipv4,
12655 UnknownValue(protocol_version::UnknownValue),
12660 }
12661
12662 #[doc(hidden)]
12663 pub mod protocol_version {
12664 #[allow(unused_imports)]
12665 use super::*;
12666 #[derive(Clone, Debug, PartialEq)]
12667 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12668 }
12669
12670 impl ProtocolVersion {
12671 pub fn value(&self) -> std::option::Option<i32> {
12676 match self {
12677 Self::Unspecified => std::option::Option::Some(0),
12678 Self::Ipv4 => std::option::Option::Some(1),
12679 Self::UnknownValue(u) => u.0.value(),
12680 }
12681 }
12682
12683 pub fn name(&self) -> std::option::Option<&str> {
12688 match self {
12689 Self::Unspecified => std::option::Option::Some("PROTOCOL_VERSION_UNSPECIFIED"),
12690 Self::Ipv4 => std::option::Option::Some("IPV4"),
12691 Self::UnknownValue(u) => u.0.name(),
12692 }
12693 }
12694 }
12695
12696 impl std::default::Default for ProtocolVersion {
12697 fn default() -> Self {
12698 use std::convert::From;
12699 Self::from(0)
12700 }
12701 }
12702
12703 impl std::fmt::Display for ProtocolVersion {
12704 fn fmt(
12705 &self,
12706 f: &mut std::fmt::Formatter<'_>,
12707 ) -> std::result::Result<(), std::fmt::Error> {
12708 wkt::internal::display_enum(f, self.name(), self.value())
12709 }
12710 }
12711
12712 impl std::convert::From<i32> for ProtocolVersion {
12713 fn from(value: i32) -> Self {
12714 match value {
12715 0 => Self::Unspecified,
12716 1 => Self::Ipv4,
12717 _ => Self::UnknownValue(protocol_version::UnknownValue(
12718 wkt::internal::UnknownEnumValue::Integer(value),
12719 )),
12720 }
12721 }
12722 }
12723
12724 impl std::convert::From<&str> for ProtocolVersion {
12725 fn from(value: &str) -> Self {
12726 use std::string::ToString;
12727 match value {
12728 "PROTOCOL_VERSION_UNSPECIFIED" => Self::Unspecified,
12729 "IPV4" => Self::Ipv4,
12730 _ => Self::UnknownValue(protocol_version::UnknownValue(
12731 wkt::internal::UnknownEnumValue::String(value.to_string()),
12732 )),
12733 }
12734 }
12735 }
12736
12737 impl serde::ser::Serialize for ProtocolVersion {
12738 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12739 where
12740 S: serde::Serializer,
12741 {
12742 match self {
12743 Self::Unspecified => serializer.serialize_i32(0),
12744 Self::Ipv4 => serializer.serialize_i32(1),
12745 Self::UnknownValue(u) => u.0.serialize(serializer),
12746 }
12747 }
12748 }
12749
12750 impl<'de> serde::de::Deserialize<'de> for ProtocolVersion {
12751 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12752 where
12753 D: serde::Deserializer<'de>,
12754 {
12755 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProtocolVersion>::new(
12756 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion",
12757 ))
12758 }
12759 }
12760 }
12761
12762 #[derive(Clone, Default, PartialEq)]
12764 #[non_exhaustive]
12765 pub struct Warnings {
12766 pub code: crate::model::policy_based_route::warnings::Code,
12768
12769 pub data: std::collections::HashMap<std::string::String, std::string::String>,
12776
12777 pub warning_message: std::string::String,
12779
12780 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12781 }
12782
12783 impl Warnings {
12784 pub fn new() -> Self {
12785 std::default::Default::default()
12786 }
12787
12788 pub fn set_code<T: std::convert::Into<crate::model::policy_based_route::warnings::Code>>(
12790 mut self,
12791 v: T,
12792 ) -> Self {
12793 self.code = v.into();
12794 self
12795 }
12796
12797 pub fn set_data<T, K, V>(mut self, v: T) -> Self
12799 where
12800 T: std::iter::IntoIterator<Item = (K, V)>,
12801 K: std::convert::Into<std::string::String>,
12802 V: std::convert::Into<std::string::String>,
12803 {
12804 use std::iter::Iterator;
12805 self.data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12806 self
12807 }
12808
12809 pub fn set_warning_message<T: std::convert::Into<std::string::String>>(
12811 mut self,
12812 v: T,
12813 ) -> Self {
12814 self.warning_message = v.into();
12815 self
12816 }
12817 }
12818
12819 impl wkt::message::Message for Warnings {
12820 fn typename() -> &'static str {
12821 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"
12822 }
12823 }
12824
12825 pub mod warnings {
12827 #[allow(unused_imports)]
12828 use super::*;
12829
12830 #[derive(Clone, Debug, PartialEq)]
12847 #[non_exhaustive]
12848 pub enum Code {
12849 WarningUnspecified,
12851 ResourceNotActive,
12855 ResourceBeingModified,
12858 UnknownValue(code::UnknownValue),
12863 }
12864
12865 #[doc(hidden)]
12866 pub mod code {
12867 #[allow(unused_imports)]
12868 use super::*;
12869 #[derive(Clone, Debug, PartialEq)]
12870 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12871 }
12872
12873 impl Code {
12874 pub fn value(&self) -> std::option::Option<i32> {
12879 match self {
12880 Self::WarningUnspecified => std::option::Option::Some(0),
12881 Self::ResourceNotActive => std::option::Option::Some(1),
12882 Self::ResourceBeingModified => std::option::Option::Some(2),
12883 Self::UnknownValue(u) => u.0.value(),
12884 }
12885 }
12886
12887 pub fn name(&self) -> std::option::Option<&str> {
12892 match self {
12893 Self::WarningUnspecified => std::option::Option::Some("WARNING_UNSPECIFIED"),
12894 Self::ResourceNotActive => std::option::Option::Some("RESOURCE_NOT_ACTIVE"),
12895 Self::ResourceBeingModified => {
12896 std::option::Option::Some("RESOURCE_BEING_MODIFIED")
12897 }
12898 Self::UnknownValue(u) => u.0.name(),
12899 }
12900 }
12901 }
12902
12903 impl std::default::Default for Code {
12904 fn default() -> Self {
12905 use std::convert::From;
12906 Self::from(0)
12907 }
12908 }
12909
12910 impl std::fmt::Display for Code {
12911 fn fmt(
12912 &self,
12913 f: &mut std::fmt::Formatter<'_>,
12914 ) -> std::result::Result<(), std::fmt::Error> {
12915 wkt::internal::display_enum(f, self.name(), self.value())
12916 }
12917 }
12918
12919 impl std::convert::From<i32> for Code {
12920 fn from(value: i32) -> Self {
12921 match value {
12922 0 => Self::WarningUnspecified,
12923 1 => Self::ResourceNotActive,
12924 2 => Self::ResourceBeingModified,
12925 _ => Self::UnknownValue(code::UnknownValue(
12926 wkt::internal::UnknownEnumValue::Integer(value),
12927 )),
12928 }
12929 }
12930 }
12931
12932 impl std::convert::From<&str> for Code {
12933 fn from(value: &str) -> Self {
12934 use std::string::ToString;
12935 match value {
12936 "WARNING_UNSPECIFIED" => Self::WarningUnspecified,
12937 "RESOURCE_NOT_ACTIVE" => Self::ResourceNotActive,
12938 "RESOURCE_BEING_MODIFIED" => Self::ResourceBeingModified,
12939 _ => Self::UnknownValue(code::UnknownValue(
12940 wkt::internal::UnknownEnumValue::String(value.to_string()),
12941 )),
12942 }
12943 }
12944 }
12945
12946 impl serde::ser::Serialize for Code {
12947 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12948 where
12949 S: serde::Serializer,
12950 {
12951 match self {
12952 Self::WarningUnspecified => serializer.serialize_i32(0),
12953 Self::ResourceNotActive => serializer.serialize_i32(1),
12954 Self::ResourceBeingModified => serializer.serialize_i32(2),
12955 Self::UnknownValue(u) => u.0.serialize(serializer),
12956 }
12957 }
12958 }
12959
12960 impl<'de> serde::de::Deserialize<'de> for Code {
12961 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12962 where
12963 D: serde::Deserializer<'de>,
12964 {
12965 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
12966 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code",
12967 ))
12968 }
12969 }
12970 }
12971
12972 #[derive(Clone, Debug, PartialEq)]
12988 #[non_exhaustive]
12989 pub enum OtherRoutes {
12990 Unspecified,
12992 DefaultRouting,
12997 UnknownValue(other_routes::UnknownValue),
13002 }
13003
13004 #[doc(hidden)]
13005 pub mod other_routes {
13006 #[allow(unused_imports)]
13007 use super::*;
13008 #[derive(Clone, Debug, PartialEq)]
13009 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13010 }
13011
13012 impl OtherRoutes {
13013 pub fn value(&self) -> std::option::Option<i32> {
13018 match self {
13019 Self::Unspecified => std::option::Option::Some(0),
13020 Self::DefaultRouting => std::option::Option::Some(1),
13021 Self::UnknownValue(u) => u.0.value(),
13022 }
13023 }
13024
13025 pub fn name(&self) -> std::option::Option<&str> {
13030 match self {
13031 Self::Unspecified => std::option::Option::Some("OTHER_ROUTES_UNSPECIFIED"),
13032 Self::DefaultRouting => std::option::Option::Some("DEFAULT_ROUTING"),
13033 Self::UnknownValue(u) => u.0.name(),
13034 }
13035 }
13036 }
13037
13038 impl std::default::Default for OtherRoutes {
13039 fn default() -> Self {
13040 use std::convert::From;
13041 Self::from(0)
13042 }
13043 }
13044
13045 impl std::fmt::Display for OtherRoutes {
13046 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13047 wkt::internal::display_enum(f, self.name(), self.value())
13048 }
13049 }
13050
13051 impl std::convert::From<i32> for OtherRoutes {
13052 fn from(value: i32) -> Self {
13053 match value {
13054 0 => Self::Unspecified,
13055 1 => Self::DefaultRouting,
13056 _ => Self::UnknownValue(other_routes::UnknownValue(
13057 wkt::internal::UnknownEnumValue::Integer(value),
13058 )),
13059 }
13060 }
13061 }
13062
13063 impl std::convert::From<&str> for OtherRoutes {
13064 fn from(value: &str) -> Self {
13065 use std::string::ToString;
13066 match value {
13067 "OTHER_ROUTES_UNSPECIFIED" => Self::Unspecified,
13068 "DEFAULT_ROUTING" => Self::DefaultRouting,
13069 _ => Self::UnknownValue(other_routes::UnknownValue(
13070 wkt::internal::UnknownEnumValue::String(value.to_string()),
13071 )),
13072 }
13073 }
13074 }
13075
13076 impl serde::ser::Serialize for OtherRoutes {
13077 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13078 where
13079 S: serde::Serializer,
13080 {
13081 match self {
13082 Self::Unspecified => serializer.serialize_i32(0),
13083 Self::DefaultRouting => serializer.serialize_i32(1),
13084 Self::UnknownValue(u) => u.0.serialize(serializer),
13085 }
13086 }
13087 }
13088
13089 impl<'de> serde::de::Deserialize<'de> for OtherRoutes {
13090 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13091 where
13092 D: serde::Deserializer<'de>,
13093 {
13094 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OtherRoutes>::new(
13095 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes",
13096 ))
13097 }
13098 }
13099
13100 #[derive(Clone, Debug, PartialEq)]
13104 #[non_exhaustive]
13105 pub enum Target {
13106 VirtualMachine(std::boxed::Box<crate::model::policy_based_route::VirtualMachine>),
13108 InterconnectAttachment(
13111 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
13112 ),
13113 }
13114
13115 #[derive(Clone, Debug, PartialEq)]
13116 #[non_exhaustive]
13117 pub enum NextHop {
13118 NextHopIlbIp(std::string::String),
13122 NextHopOtherRoutes(crate::model::policy_based_route::OtherRoutes),
13125 }
13126}
13127
13128#[derive(Clone, Default, PartialEq)]
13134#[non_exhaustive]
13135pub struct ListPolicyBasedRoutesRequest {
13136 pub parent: std::string::String,
13138
13139 pub page_size: i32,
13141
13142 pub page_token: std::string::String,
13144
13145 pub filter: std::string::String,
13147
13148 pub order_by: std::string::String,
13150
13151 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13152}
13153
13154impl ListPolicyBasedRoutesRequest {
13155 pub fn new() -> Self {
13156 std::default::Default::default()
13157 }
13158
13159 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13161 self.parent = v.into();
13162 self
13163 }
13164
13165 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13167 self.page_size = v.into();
13168 self
13169 }
13170
13171 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13173 self.page_token = v.into();
13174 self
13175 }
13176
13177 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13179 self.filter = v.into();
13180 self
13181 }
13182
13183 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13185 self.order_by = v.into();
13186 self
13187 }
13188}
13189
13190impl wkt::message::Message for ListPolicyBasedRoutesRequest {
13191 fn typename() -> &'static str {
13192 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"
13193 }
13194}
13195
13196#[derive(Clone, Default, PartialEq)]
13202#[non_exhaustive]
13203pub struct ListPolicyBasedRoutesResponse {
13204 pub policy_based_routes: std::vec::Vec<crate::model::PolicyBasedRoute>,
13206
13207 pub next_page_token: std::string::String,
13210
13211 pub unreachable: std::vec::Vec<std::string::String>,
13213
13214 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13215}
13216
13217impl ListPolicyBasedRoutesResponse {
13218 pub fn new() -> Self {
13219 std::default::Default::default()
13220 }
13221
13222 pub fn set_policy_based_routes<T, V>(mut self, v: T) -> Self
13224 where
13225 T: std::iter::IntoIterator<Item = V>,
13226 V: std::convert::Into<crate::model::PolicyBasedRoute>,
13227 {
13228 use std::iter::Iterator;
13229 self.policy_based_routes = v.into_iter().map(|i| i.into()).collect();
13230 self
13231 }
13232
13233 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13235 self.next_page_token = v.into();
13236 self
13237 }
13238
13239 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13241 where
13242 T: std::iter::IntoIterator<Item = V>,
13243 V: std::convert::Into<std::string::String>,
13244 {
13245 use std::iter::Iterator;
13246 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13247 self
13248 }
13249}
13250
13251impl wkt::message::Message for ListPolicyBasedRoutesResponse {
13252 fn typename() -> &'static str {
13253 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"
13254 }
13255}
13256
13257#[doc(hidden)]
13258impl gax::paginator::internal::PageableResponse for ListPolicyBasedRoutesResponse {
13259 type PageItem = crate::model::PolicyBasedRoute;
13260
13261 fn items(self) -> std::vec::Vec<Self::PageItem> {
13262 self.policy_based_routes
13263 }
13264
13265 fn next_page_token(&self) -> std::string::String {
13266 use std::clone::Clone;
13267 self.next_page_token.clone()
13268 }
13269}
13270
13271#[derive(Clone, Default, PartialEq)]
13277#[non_exhaustive]
13278pub struct GetPolicyBasedRouteRequest {
13279 pub name: std::string::String,
13281
13282 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13283}
13284
13285impl GetPolicyBasedRouteRequest {
13286 pub fn new() -> Self {
13287 std::default::Default::default()
13288 }
13289
13290 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13292 self.name = v.into();
13293 self
13294 }
13295}
13296
13297impl wkt::message::Message for GetPolicyBasedRouteRequest {
13298 fn typename() -> &'static str {
13299 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"
13300 }
13301}
13302
13303#[derive(Clone, Default, PartialEq)]
13309#[non_exhaustive]
13310pub struct CreatePolicyBasedRouteRequest {
13311 pub parent: std::string::String,
13313
13314 pub policy_based_route_id: std::string::String,
13323
13324 pub policy_based_route: std::option::Option<crate::model::PolicyBasedRoute>,
13326
13327 pub request_id: std::string::String,
13341
13342 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13343}
13344
13345impl CreatePolicyBasedRouteRequest {
13346 pub fn new() -> Self {
13347 std::default::Default::default()
13348 }
13349
13350 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13352 self.parent = v.into();
13353 self
13354 }
13355
13356 pub fn set_policy_based_route_id<T: std::convert::Into<std::string::String>>(
13358 mut self,
13359 v: T,
13360 ) -> Self {
13361 self.policy_based_route_id = v.into();
13362 self
13363 }
13364
13365 pub fn set_policy_based_route<T>(mut self, v: T) -> Self
13367 where
13368 T: std::convert::Into<crate::model::PolicyBasedRoute>,
13369 {
13370 self.policy_based_route = std::option::Option::Some(v.into());
13371 self
13372 }
13373
13374 pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
13376 where
13377 T: std::convert::Into<crate::model::PolicyBasedRoute>,
13378 {
13379 self.policy_based_route = v.map(|x| x.into());
13380 self
13381 }
13382
13383 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13385 self.request_id = v.into();
13386 self
13387 }
13388}
13389
13390impl wkt::message::Message for CreatePolicyBasedRouteRequest {
13391 fn typename() -> &'static str {
13392 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"
13393 }
13394}
13395
13396#[derive(Clone, Default, PartialEq)]
13402#[non_exhaustive]
13403pub struct DeletePolicyBasedRouteRequest {
13404 pub name: std::string::String,
13406
13407 pub request_id: std::string::String,
13421
13422 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13423}
13424
13425impl DeletePolicyBasedRouteRequest {
13426 pub fn new() -> Self {
13427 std::default::Default::default()
13428 }
13429
13430 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13432 self.name = v.into();
13433 self
13434 }
13435
13436 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13438 self.request_id = v.into();
13439 self
13440 }
13441}
13442
13443impl wkt::message::Message for DeletePolicyBasedRouteRequest {
13444 fn typename() -> &'static str {
13445 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"
13446 }
13447}
13448
13449#[derive(Clone, Debug, PartialEq)]
13465#[non_exhaustive]
13466pub enum Infrastructure {
13467 Unspecified,
13469 Psc,
13471 UnknownValue(infrastructure::UnknownValue),
13476}
13477
13478#[doc(hidden)]
13479pub mod infrastructure {
13480 #[allow(unused_imports)]
13481 use super::*;
13482 #[derive(Clone, Debug, PartialEq)]
13483 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13484}
13485
13486impl Infrastructure {
13487 pub fn value(&self) -> std::option::Option<i32> {
13492 match self {
13493 Self::Unspecified => std::option::Option::Some(0),
13494 Self::Psc => std::option::Option::Some(1),
13495 Self::UnknownValue(u) => u.0.value(),
13496 }
13497 }
13498
13499 pub fn name(&self) -> std::option::Option<&str> {
13504 match self {
13505 Self::Unspecified => std::option::Option::Some("INFRASTRUCTURE_UNSPECIFIED"),
13506 Self::Psc => std::option::Option::Some("PSC"),
13507 Self::UnknownValue(u) => u.0.name(),
13508 }
13509 }
13510}
13511
13512impl std::default::Default for Infrastructure {
13513 fn default() -> Self {
13514 use std::convert::From;
13515 Self::from(0)
13516 }
13517}
13518
13519impl std::fmt::Display for Infrastructure {
13520 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13521 wkt::internal::display_enum(f, self.name(), self.value())
13522 }
13523}
13524
13525impl std::convert::From<i32> for Infrastructure {
13526 fn from(value: i32) -> Self {
13527 match value {
13528 0 => Self::Unspecified,
13529 1 => Self::Psc,
13530 _ => Self::UnknownValue(infrastructure::UnknownValue(
13531 wkt::internal::UnknownEnumValue::Integer(value),
13532 )),
13533 }
13534 }
13535}
13536
13537impl std::convert::From<&str> for Infrastructure {
13538 fn from(value: &str) -> Self {
13539 use std::string::ToString;
13540 match value {
13541 "INFRASTRUCTURE_UNSPECIFIED" => Self::Unspecified,
13542 "PSC" => Self::Psc,
13543 _ => Self::UnknownValue(infrastructure::UnknownValue(
13544 wkt::internal::UnknownEnumValue::String(value.to_string()),
13545 )),
13546 }
13547 }
13548}
13549
13550impl serde::ser::Serialize for Infrastructure {
13551 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13552 where
13553 S: serde::Serializer,
13554 {
13555 match self {
13556 Self::Unspecified => serializer.serialize_i32(0),
13557 Self::Psc => serializer.serialize_i32(1),
13558 Self::UnknownValue(u) => u.0.serialize(serializer),
13559 }
13560 }
13561}
13562
13563impl<'de> serde::de::Deserialize<'de> for Infrastructure {
13564 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13565 where
13566 D: serde::Deserializer<'de>,
13567 {
13568 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Infrastructure>::new(
13569 ".google.cloud.networkconnectivity.v1.Infrastructure",
13570 ))
13571 }
13572}
13573
13574#[derive(Clone, Debug, PartialEq)]
13591#[non_exhaustive]
13592pub enum ConnectionErrorType {
13593 Unspecified,
13595 ErrorInternal,
13597 ErrorConsumerSide,
13599 ErrorProducerSide,
13601 UnknownValue(connection_error_type::UnknownValue),
13606}
13607
13608#[doc(hidden)]
13609pub mod connection_error_type {
13610 #[allow(unused_imports)]
13611 use super::*;
13612 #[derive(Clone, Debug, PartialEq)]
13613 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13614}
13615
13616impl ConnectionErrorType {
13617 pub fn value(&self) -> std::option::Option<i32> {
13622 match self {
13623 Self::Unspecified => std::option::Option::Some(0),
13624 Self::ErrorInternal => std::option::Option::Some(1),
13625 Self::ErrorConsumerSide => std::option::Option::Some(2),
13626 Self::ErrorProducerSide => std::option::Option::Some(3),
13627 Self::UnknownValue(u) => u.0.value(),
13628 }
13629 }
13630
13631 pub fn name(&self) -> std::option::Option<&str> {
13636 match self {
13637 Self::Unspecified => std::option::Option::Some("CONNECTION_ERROR_TYPE_UNSPECIFIED"),
13638 Self::ErrorInternal => std::option::Option::Some("ERROR_INTERNAL"),
13639 Self::ErrorConsumerSide => std::option::Option::Some("ERROR_CONSUMER_SIDE"),
13640 Self::ErrorProducerSide => std::option::Option::Some("ERROR_PRODUCER_SIDE"),
13641 Self::UnknownValue(u) => u.0.name(),
13642 }
13643 }
13644}
13645
13646impl std::default::Default for ConnectionErrorType {
13647 fn default() -> Self {
13648 use std::convert::From;
13649 Self::from(0)
13650 }
13651}
13652
13653impl std::fmt::Display for ConnectionErrorType {
13654 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13655 wkt::internal::display_enum(f, self.name(), self.value())
13656 }
13657}
13658
13659impl std::convert::From<i32> for ConnectionErrorType {
13660 fn from(value: i32) -> Self {
13661 match value {
13662 0 => Self::Unspecified,
13663 1 => Self::ErrorInternal,
13664 2 => Self::ErrorConsumerSide,
13665 3 => Self::ErrorProducerSide,
13666 _ => Self::UnknownValue(connection_error_type::UnknownValue(
13667 wkt::internal::UnknownEnumValue::Integer(value),
13668 )),
13669 }
13670 }
13671}
13672
13673impl std::convert::From<&str> for ConnectionErrorType {
13674 fn from(value: &str) -> Self {
13675 use std::string::ToString;
13676 match value {
13677 "CONNECTION_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
13678 "ERROR_INTERNAL" => Self::ErrorInternal,
13679 "ERROR_CONSUMER_SIDE" => Self::ErrorConsumerSide,
13680 "ERROR_PRODUCER_SIDE" => Self::ErrorProducerSide,
13681 _ => Self::UnknownValue(connection_error_type::UnknownValue(
13682 wkt::internal::UnknownEnumValue::String(value.to_string()),
13683 )),
13684 }
13685 }
13686}
13687
13688impl serde::ser::Serialize for ConnectionErrorType {
13689 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13690 where
13691 S: serde::Serializer,
13692 {
13693 match self {
13694 Self::Unspecified => serializer.serialize_i32(0),
13695 Self::ErrorInternal => serializer.serialize_i32(1),
13696 Self::ErrorConsumerSide => serializer.serialize_i32(2),
13697 Self::ErrorProducerSide => serializer.serialize_i32(3),
13698 Self::UnknownValue(u) => u.0.serialize(serializer),
13699 }
13700 }
13701}
13702
13703impl<'de> serde::de::Deserialize<'de> for ConnectionErrorType {
13704 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13705 where
13706 D: serde::Deserializer<'de>,
13707 {
13708 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionErrorType>::new(
13709 ".google.cloud.networkconnectivity.v1.ConnectionErrorType",
13710 ))
13711 }
13712}
13713
13714#[derive(Clone, Debug, PartialEq)]
13730#[non_exhaustive]
13731pub enum IPVersion {
13732 Unspecified,
13735 Ipv4,
13737 Ipv6,
13739 UnknownValue(ip_version::UnknownValue),
13744}
13745
13746#[doc(hidden)]
13747pub mod ip_version {
13748 #[allow(unused_imports)]
13749 use super::*;
13750 #[derive(Clone, Debug, PartialEq)]
13751 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13752}
13753
13754impl IPVersion {
13755 pub fn value(&self) -> std::option::Option<i32> {
13760 match self {
13761 Self::Unspecified => std::option::Option::Some(0),
13762 Self::Ipv4 => std::option::Option::Some(1),
13763 Self::Ipv6 => std::option::Option::Some(2),
13764 Self::UnknownValue(u) => u.0.value(),
13765 }
13766 }
13767
13768 pub fn name(&self) -> std::option::Option<&str> {
13773 match self {
13774 Self::Unspecified => std::option::Option::Some("IP_VERSION_UNSPECIFIED"),
13775 Self::Ipv4 => std::option::Option::Some("IPV4"),
13776 Self::Ipv6 => std::option::Option::Some("IPV6"),
13777 Self::UnknownValue(u) => u.0.name(),
13778 }
13779 }
13780}
13781
13782impl std::default::Default for IPVersion {
13783 fn default() -> Self {
13784 use std::convert::From;
13785 Self::from(0)
13786 }
13787}
13788
13789impl std::fmt::Display for IPVersion {
13790 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13791 wkt::internal::display_enum(f, self.name(), self.value())
13792 }
13793}
13794
13795impl std::convert::From<i32> for IPVersion {
13796 fn from(value: i32) -> Self {
13797 match value {
13798 0 => Self::Unspecified,
13799 1 => Self::Ipv4,
13800 2 => Self::Ipv6,
13801 _ => Self::UnknownValue(ip_version::UnknownValue(
13802 wkt::internal::UnknownEnumValue::Integer(value),
13803 )),
13804 }
13805 }
13806}
13807
13808impl std::convert::From<&str> for IPVersion {
13809 fn from(value: &str) -> Self {
13810 use std::string::ToString;
13811 match value {
13812 "IP_VERSION_UNSPECIFIED" => Self::Unspecified,
13813 "IPV4" => Self::Ipv4,
13814 "IPV6" => Self::Ipv6,
13815 _ => Self::UnknownValue(ip_version::UnknownValue(
13816 wkt::internal::UnknownEnumValue::String(value.to_string()),
13817 )),
13818 }
13819 }
13820}
13821
13822impl serde::ser::Serialize for IPVersion {
13823 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13824 where
13825 S: serde::Serializer,
13826 {
13827 match self {
13828 Self::Unspecified => serializer.serialize_i32(0),
13829 Self::Ipv4 => serializer.serialize_i32(1),
13830 Self::Ipv6 => serializer.serialize_i32(2),
13831 Self::UnknownValue(u) => u.0.serialize(serializer),
13832 }
13833 }
13834}
13835
13836impl<'de> serde::de::Deserialize<'de> for IPVersion {
13837 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13838 where
13839 D: serde::Deserializer<'de>,
13840 {
13841 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IPVersion>::new(
13842 ".google.cloud.networkconnectivity.v1.IPVersion",
13843 ))
13844 }
13845}
13846
13847#[derive(Clone, Debug, PartialEq)]
13863#[non_exhaustive]
13864pub enum LocationFeature {
13865 Unspecified,
13867 SiteToCloudSpokes,
13869 SiteToSiteSpokes,
13871 UnknownValue(location_feature::UnknownValue),
13876}
13877
13878#[doc(hidden)]
13879pub mod location_feature {
13880 #[allow(unused_imports)]
13881 use super::*;
13882 #[derive(Clone, Debug, PartialEq)]
13883 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13884}
13885
13886impl LocationFeature {
13887 pub fn value(&self) -> std::option::Option<i32> {
13892 match self {
13893 Self::Unspecified => std::option::Option::Some(0),
13894 Self::SiteToCloudSpokes => std::option::Option::Some(1),
13895 Self::SiteToSiteSpokes => std::option::Option::Some(2),
13896 Self::UnknownValue(u) => u.0.value(),
13897 }
13898 }
13899
13900 pub fn name(&self) -> std::option::Option<&str> {
13905 match self {
13906 Self::Unspecified => std::option::Option::Some("LOCATION_FEATURE_UNSPECIFIED"),
13907 Self::SiteToCloudSpokes => std::option::Option::Some("SITE_TO_CLOUD_SPOKES"),
13908 Self::SiteToSiteSpokes => std::option::Option::Some("SITE_TO_SITE_SPOKES"),
13909 Self::UnknownValue(u) => u.0.name(),
13910 }
13911 }
13912}
13913
13914impl std::default::Default for LocationFeature {
13915 fn default() -> Self {
13916 use std::convert::From;
13917 Self::from(0)
13918 }
13919}
13920
13921impl std::fmt::Display for LocationFeature {
13922 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13923 wkt::internal::display_enum(f, self.name(), self.value())
13924 }
13925}
13926
13927impl std::convert::From<i32> for LocationFeature {
13928 fn from(value: i32) -> Self {
13929 match value {
13930 0 => Self::Unspecified,
13931 1 => Self::SiteToCloudSpokes,
13932 2 => Self::SiteToSiteSpokes,
13933 _ => Self::UnknownValue(location_feature::UnknownValue(
13934 wkt::internal::UnknownEnumValue::Integer(value),
13935 )),
13936 }
13937 }
13938}
13939
13940impl std::convert::From<&str> for LocationFeature {
13941 fn from(value: &str) -> Self {
13942 use std::string::ToString;
13943 match value {
13944 "LOCATION_FEATURE_UNSPECIFIED" => Self::Unspecified,
13945 "SITE_TO_CLOUD_SPOKES" => Self::SiteToCloudSpokes,
13946 "SITE_TO_SITE_SPOKES" => Self::SiteToSiteSpokes,
13947 _ => Self::UnknownValue(location_feature::UnknownValue(
13948 wkt::internal::UnknownEnumValue::String(value.to_string()),
13949 )),
13950 }
13951 }
13952}
13953
13954impl serde::ser::Serialize for LocationFeature {
13955 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13956 where
13957 S: serde::Serializer,
13958 {
13959 match self {
13960 Self::Unspecified => serializer.serialize_i32(0),
13961 Self::SiteToCloudSpokes => serializer.serialize_i32(1),
13962 Self::SiteToSiteSpokes => serializer.serialize_i32(2),
13963 Self::UnknownValue(u) => u.0.serialize(serializer),
13964 }
13965 }
13966}
13967
13968impl<'de> serde::de::Deserialize<'de> for LocationFeature {
13969 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13970 where
13971 D: serde::Deserializer<'de>,
13972 {
13973 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocationFeature>::new(
13974 ".google.cloud.networkconnectivity.v1.LocationFeature",
13975 ))
13976 }
13977}
13978
13979#[derive(Clone, Debug, PartialEq)]
13995#[non_exhaustive]
13996pub enum RouteType {
13997 Unspecified,
13999 VpcPrimarySubnet,
14002 VpcSecondarySubnet,
14005 DynamicRoute,
14009 UnknownValue(route_type::UnknownValue),
14014}
14015
14016#[doc(hidden)]
14017pub mod route_type {
14018 #[allow(unused_imports)]
14019 use super::*;
14020 #[derive(Clone, Debug, PartialEq)]
14021 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14022}
14023
14024impl RouteType {
14025 pub fn value(&self) -> std::option::Option<i32> {
14030 match self {
14031 Self::Unspecified => std::option::Option::Some(0),
14032 Self::VpcPrimarySubnet => std::option::Option::Some(1),
14033 Self::VpcSecondarySubnet => std::option::Option::Some(2),
14034 Self::DynamicRoute => std::option::Option::Some(3),
14035 Self::UnknownValue(u) => u.0.value(),
14036 }
14037 }
14038
14039 pub fn name(&self) -> std::option::Option<&str> {
14044 match self {
14045 Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
14046 Self::VpcPrimarySubnet => std::option::Option::Some("VPC_PRIMARY_SUBNET"),
14047 Self::VpcSecondarySubnet => std::option::Option::Some("VPC_SECONDARY_SUBNET"),
14048 Self::DynamicRoute => std::option::Option::Some("DYNAMIC_ROUTE"),
14049 Self::UnknownValue(u) => u.0.name(),
14050 }
14051 }
14052}
14053
14054impl std::default::Default for RouteType {
14055 fn default() -> Self {
14056 use std::convert::From;
14057 Self::from(0)
14058 }
14059}
14060
14061impl std::fmt::Display for RouteType {
14062 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14063 wkt::internal::display_enum(f, self.name(), self.value())
14064 }
14065}
14066
14067impl std::convert::From<i32> for RouteType {
14068 fn from(value: i32) -> Self {
14069 match value {
14070 0 => Self::Unspecified,
14071 1 => Self::VpcPrimarySubnet,
14072 2 => Self::VpcSecondarySubnet,
14073 3 => Self::DynamicRoute,
14074 _ => Self::UnknownValue(route_type::UnknownValue(
14075 wkt::internal::UnknownEnumValue::Integer(value),
14076 )),
14077 }
14078 }
14079}
14080
14081impl std::convert::From<&str> for RouteType {
14082 fn from(value: &str) -> Self {
14083 use std::string::ToString;
14084 match value {
14085 "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
14086 "VPC_PRIMARY_SUBNET" => Self::VpcPrimarySubnet,
14087 "VPC_SECONDARY_SUBNET" => Self::VpcSecondarySubnet,
14088 "DYNAMIC_ROUTE" => Self::DynamicRoute,
14089 _ => Self::UnknownValue(route_type::UnknownValue(
14090 wkt::internal::UnknownEnumValue::String(value.to_string()),
14091 )),
14092 }
14093 }
14094}
14095
14096impl serde::ser::Serialize for RouteType {
14097 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14098 where
14099 S: serde::Serializer,
14100 {
14101 match self {
14102 Self::Unspecified => serializer.serialize_i32(0),
14103 Self::VpcPrimarySubnet => serializer.serialize_i32(1),
14104 Self::VpcSecondarySubnet => serializer.serialize_i32(2),
14105 Self::DynamicRoute => serializer.serialize_i32(3),
14106 Self::UnknownValue(u) => u.0.serialize(serializer),
14107 }
14108 }
14109}
14110
14111impl<'de> serde::de::Deserialize<'de> for RouteType {
14112 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14113 where
14114 D: serde::Deserializer<'de>,
14115 {
14116 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
14117 ".google.cloud.networkconnectivity.v1.RouteType",
14118 ))
14119 }
14120}
14121
14122#[derive(Clone, Debug, PartialEq)]
14139#[non_exhaustive]
14140pub enum State {
14141 Unspecified,
14143 Creating,
14145 Active,
14147 Deleting,
14149 Accepting,
14151 Rejecting,
14153 Updating,
14155 Inactive,
14157 Obsolete,
14160 Failed,
14164 UnknownValue(state::UnknownValue),
14169}
14170
14171#[doc(hidden)]
14172pub mod state {
14173 #[allow(unused_imports)]
14174 use super::*;
14175 #[derive(Clone, Debug, PartialEq)]
14176 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14177}
14178
14179impl State {
14180 pub fn value(&self) -> std::option::Option<i32> {
14185 match self {
14186 Self::Unspecified => std::option::Option::Some(0),
14187 Self::Creating => std::option::Option::Some(1),
14188 Self::Active => std::option::Option::Some(2),
14189 Self::Deleting => std::option::Option::Some(3),
14190 Self::Accepting => std::option::Option::Some(8),
14191 Self::Rejecting => std::option::Option::Some(9),
14192 Self::Updating => std::option::Option::Some(6),
14193 Self::Inactive => std::option::Option::Some(7),
14194 Self::Obsolete => std::option::Option::Some(10),
14195 Self::Failed => std::option::Option::Some(11),
14196 Self::UnknownValue(u) => u.0.value(),
14197 }
14198 }
14199
14200 pub fn name(&self) -> std::option::Option<&str> {
14205 match self {
14206 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14207 Self::Creating => std::option::Option::Some("CREATING"),
14208 Self::Active => std::option::Option::Some("ACTIVE"),
14209 Self::Deleting => std::option::Option::Some("DELETING"),
14210 Self::Accepting => std::option::Option::Some("ACCEPTING"),
14211 Self::Rejecting => std::option::Option::Some("REJECTING"),
14212 Self::Updating => std::option::Option::Some("UPDATING"),
14213 Self::Inactive => std::option::Option::Some("INACTIVE"),
14214 Self::Obsolete => std::option::Option::Some("OBSOLETE"),
14215 Self::Failed => std::option::Option::Some("FAILED"),
14216 Self::UnknownValue(u) => u.0.name(),
14217 }
14218 }
14219}
14220
14221impl std::default::Default for State {
14222 fn default() -> Self {
14223 use std::convert::From;
14224 Self::from(0)
14225 }
14226}
14227
14228impl std::fmt::Display for State {
14229 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14230 wkt::internal::display_enum(f, self.name(), self.value())
14231 }
14232}
14233
14234impl std::convert::From<i32> for State {
14235 fn from(value: i32) -> Self {
14236 match value {
14237 0 => Self::Unspecified,
14238 1 => Self::Creating,
14239 2 => Self::Active,
14240 3 => Self::Deleting,
14241 6 => Self::Updating,
14242 7 => Self::Inactive,
14243 8 => Self::Accepting,
14244 9 => Self::Rejecting,
14245 10 => Self::Obsolete,
14246 11 => Self::Failed,
14247 _ => Self::UnknownValue(state::UnknownValue(
14248 wkt::internal::UnknownEnumValue::Integer(value),
14249 )),
14250 }
14251 }
14252}
14253
14254impl std::convert::From<&str> for State {
14255 fn from(value: &str) -> Self {
14256 use std::string::ToString;
14257 match value {
14258 "STATE_UNSPECIFIED" => Self::Unspecified,
14259 "CREATING" => Self::Creating,
14260 "ACTIVE" => Self::Active,
14261 "DELETING" => Self::Deleting,
14262 "ACCEPTING" => Self::Accepting,
14263 "REJECTING" => Self::Rejecting,
14264 "UPDATING" => Self::Updating,
14265 "INACTIVE" => Self::Inactive,
14266 "OBSOLETE" => Self::Obsolete,
14267 "FAILED" => Self::Failed,
14268 _ => Self::UnknownValue(state::UnknownValue(
14269 wkt::internal::UnknownEnumValue::String(value.to_string()),
14270 )),
14271 }
14272 }
14273}
14274
14275impl serde::ser::Serialize for State {
14276 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14277 where
14278 S: serde::Serializer,
14279 {
14280 match self {
14281 Self::Unspecified => serializer.serialize_i32(0),
14282 Self::Creating => serializer.serialize_i32(1),
14283 Self::Active => serializer.serialize_i32(2),
14284 Self::Deleting => serializer.serialize_i32(3),
14285 Self::Accepting => serializer.serialize_i32(8),
14286 Self::Rejecting => serializer.serialize_i32(9),
14287 Self::Updating => serializer.serialize_i32(6),
14288 Self::Inactive => serializer.serialize_i32(7),
14289 Self::Obsolete => serializer.serialize_i32(10),
14290 Self::Failed => serializer.serialize_i32(11),
14291 Self::UnknownValue(u) => u.0.serialize(serializer),
14292 }
14293 }
14294}
14295
14296impl<'de> serde::de::Deserialize<'de> for State {
14297 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14298 where
14299 D: serde::Deserializer<'de>,
14300 {
14301 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14302 ".google.cloud.networkconnectivity.v1.State",
14303 ))
14304 }
14305}
14306
14307#[derive(Clone, Debug, PartialEq)]
14324#[non_exhaustive]
14325pub enum SpokeType {
14326 Unspecified,
14328 VpnTunnel,
14330 InterconnectAttachment,
14332 RouterAppliance,
14334 VpcNetwork,
14336 ProducerVpcNetwork,
14338 UnknownValue(spoke_type::UnknownValue),
14343}
14344
14345#[doc(hidden)]
14346pub mod spoke_type {
14347 #[allow(unused_imports)]
14348 use super::*;
14349 #[derive(Clone, Debug, PartialEq)]
14350 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14351}
14352
14353impl SpokeType {
14354 pub fn value(&self) -> std::option::Option<i32> {
14359 match self {
14360 Self::Unspecified => std::option::Option::Some(0),
14361 Self::VpnTunnel => std::option::Option::Some(1),
14362 Self::InterconnectAttachment => std::option::Option::Some(2),
14363 Self::RouterAppliance => std::option::Option::Some(3),
14364 Self::VpcNetwork => std::option::Option::Some(4),
14365 Self::ProducerVpcNetwork => std::option::Option::Some(7),
14366 Self::UnknownValue(u) => u.0.value(),
14367 }
14368 }
14369
14370 pub fn name(&self) -> std::option::Option<&str> {
14375 match self {
14376 Self::Unspecified => std::option::Option::Some("SPOKE_TYPE_UNSPECIFIED"),
14377 Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
14378 Self::InterconnectAttachment => std::option::Option::Some("INTERCONNECT_ATTACHMENT"),
14379 Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
14380 Self::VpcNetwork => std::option::Option::Some("VPC_NETWORK"),
14381 Self::ProducerVpcNetwork => std::option::Option::Some("PRODUCER_VPC_NETWORK"),
14382 Self::UnknownValue(u) => u.0.name(),
14383 }
14384 }
14385}
14386
14387impl std::default::Default for SpokeType {
14388 fn default() -> Self {
14389 use std::convert::From;
14390 Self::from(0)
14391 }
14392}
14393
14394impl std::fmt::Display for SpokeType {
14395 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14396 wkt::internal::display_enum(f, self.name(), self.value())
14397 }
14398}
14399
14400impl std::convert::From<i32> for SpokeType {
14401 fn from(value: i32) -> Self {
14402 match value {
14403 0 => Self::Unspecified,
14404 1 => Self::VpnTunnel,
14405 2 => Self::InterconnectAttachment,
14406 3 => Self::RouterAppliance,
14407 4 => Self::VpcNetwork,
14408 7 => Self::ProducerVpcNetwork,
14409 _ => Self::UnknownValue(spoke_type::UnknownValue(
14410 wkt::internal::UnknownEnumValue::Integer(value),
14411 )),
14412 }
14413 }
14414}
14415
14416impl std::convert::From<&str> for SpokeType {
14417 fn from(value: &str) -> Self {
14418 use std::string::ToString;
14419 match value {
14420 "SPOKE_TYPE_UNSPECIFIED" => Self::Unspecified,
14421 "VPN_TUNNEL" => Self::VpnTunnel,
14422 "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
14423 "ROUTER_APPLIANCE" => Self::RouterAppliance,
14424 "VPC_NETWORK" => Self::VpcNetwork,
14425 "PRODUCER_VPC_NETWORK" => Self::ProducerVpcNetwork,
14426 _ => Self::UnknownValue(spoke_type::UnknownValue(
14427 wkt::internal::UnknownEnumValue::String(value.to_string()),
14428 )),
14429 }
14430 }
14431}
14432
14433impl serde::ser::Serialize for SpokeType {
14434 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14435 where
14436 S: serde::Serializer,
14437 {
14438 match self {
14439 Self::Unspecified => serializer.serialize_i32(0),
14440 Self::VpnTunnel => serializer.serialize_i32(1),
14441 Self::InterconnectAttachment => serializer.serialize_i32(2),
14442 Self::RouterAppliance => serializer.serialize_i32(3),
14443 Self::VpcNetwork => serializer.serialize_i32(4),
14444 Self::ProducerVpcNetwork => serializer.serialize_i32(7),
14445 Self::UnknownValue(u) => u.0.serialize(serializer),
14446 }
14447 }
14448}
14449
14450impl<'de> serde::de::Deserialize<'de> for SpokeType {
14451 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14452 where
14453 D: serde::Deserializer<'de>,
14454 {
14455 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeType>::new(
14456 ".google.cloud.networkconnectivity.v1.SpokeType",
14457 ))
14458 }
14459}
14460
14461#[derive(Clone, Debug, PartialEq)]
14477#[non_exhaustive]
14478pub enum PolicyMode {
14479 Unspecified,
14482 Preset,
14484 UnknownValue(policy_mode::UnknownValue),
14489}
14490
14491#[doc(hidden)]
14492pub mod policy_mode {
14493 #[allow(unused_imports)]
14494 use super::*;
14495 #[derive(Clone, Debug, PartialEq)]
14496 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14497}
14498
14499impl PolicyMode {
14500 pub fn value(&self) -> std::option::Option<i32> {
14505 match self {
14506 Self::Unspecified => std::option::Option::Some(0),
14507 Self::Preset => std::option::Option::Some(1),
14508 Self::UnknownValue(u) => u.0.value(),
14509 }
14510 }
14511
14512 pub fn name(&self) -> std::option::Option<&str> {
14517 match self {
14518 Self::Unspecified => std::option::Option::Some("POLICY_MODE_UNSPECIFIED"),
14519 Self::Preset => std::option::Option::Some("PRESET"),
14520 Self::UnknownValue(u) => u.0.name(),
14521 }
14522 }
14523}
14524
14525impl std::default::Default for PolicyMode {
14526 fn default() -> Self {
14527 use std::convert::From;
14528 Self::from(0)
14529 }
14530}
14531
14532impl std::fmt::Display for PolicyMode {
14533 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14534 wkt::internal::display_enum(f, self.name(), self.value())
14535 }
14536}
14537
14538impl std::convert::From<i32> for PolicyMode {
14539 fn from(value: i32) -> Self {
14540 match value {
14541 0 => Self::Unspecified,
14542 1 => Self::Preset,
14543 _ => Self::UnknownValue(policy_mode::UnknownValue(
14544 wkt::internal::UnknownEnumValue::Integer(value),
14545 )),
14546 }
14547 }
14548}
14549
14550impl std::convert::From<&str> for PolicyMode {
14551 fn from(value: &str) -> Self {
14552 use std::string::ToString;
14553 match value {
14554 "POLICY_MODE_UNSPECIFIED" => Self::Unspecified,
14555 "PRESET" => Self::Preset,
14556 _ => Self::UnknownValue(policy_mode::UnknownValue(
14557 wkt::internal::UnknownEnumValue::String(value.to_string()),
14558 )),
14559 }
14560 }
14561}
14562
14563impl serde::ser::Serialize for PolicyMode {
14564 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14565 where
14566 S: serde::Serializer,
14567 {
14568 match self {
14569 Self::Unspecified => serializer.serialize_i32(0),
14570 Self::Preset => serializer.serialize_i32(1),
14571 Self::UnknownValue(u) => u.0.serialize(serializer),
14572 }
14573 }
14574}
14575
14576impl<'de> serde::de::Deserialize<'de> for PolicyMode {
14577 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14578 where
14579 D: serde::Deserializer<'de>,
14580 {
14581 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyMode>::new(
14582 ".google.cloud.networkconnectivity.v1.PolicyMode",
14583 ))
14584 }
14585}
14586
14587#[derive(Clone, Debug, PartialEq)]
14603#[non_exhaustive]
14604pub enum PresetTopology {
14605 Unspecified,
14608 Mesh,
14611 Star,
14615 UnknownValue(preset_topology::UnknownValue),
14620}
14621
14622#[doc(hidden)]
14623pub mod preset_topology {
14624 #[allow(unused_imports)]
14625 use super::*;
14626 #[derive(Clone, Debug, PartialEq)]
14627 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14628}
14629
14630impl PresetTopology {
14631 pub fn value(&self) -> std::option::Option<i32> {
14636 match self {
14637 Self::Unspecified => std::option::Option::Some(0),
14638 Self::Mesh => std::option::Option::Some(2),
14639 Self::Star => std::option::Option::Some(3),
14640 Self::UnknownValue(u) => u.0.value(),
14641 }
14642 }
14643
14644 pub fn name(&self) -> std::option::Option<&str> {
14649 match self {
14650 Self::Unspecified => std::option::Option::Some("PRESET_TOPOLOGY_UNSPECIFIED"),
14651 Self::Mesh => std::option::Option::Some("MESH"),
14652 Self::Star => std::option::Option::Some("STAR"),
14653 Self::UnknownValue(u) => u.0.name(),
14654 }
14655 }
14656}
14657
14658impl std::default::Default for PresetTopology {
14659 fn default() -> Self {
14660 use std::convert::From;
14661 Self::from(0)
14662 }
14663}
14664
14665impl std::fmt::Display for PresetTopology {
14666 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14667 wkt::internal::display_enum(f, self.name(), self.value())
14668 }
14669}
14670
14671impl std::convert::From<i32> for PresetTopology {
14672 fn from(value: i32) -> Self {
14673 match value {
14674 0 => Self::Unspecified,
14675 2 => Self::Mesh,
14676 3 => Self::Star,
14677 _ => Self::UnknownValue(preset_topology::UnknownValue(
14678 wkt::internal::UnknownEnumValue::Integer(value),
14679 )),
14680 }
14681 }
14682}
14683
14684impl std::convert::From<&str> for PresetTopology {
14685 fn from(value: &str) -> Self {
14686 use std::string::ToString;
14687 match value {
14688 "PRESET_TOPOLOGY_UNSPECIFIED" => Self::Unspecified,
14689 "MESH" => Self::Mesh,
14690 "STAR" => Self::Star,
14691 _ => Self::UnknownValue(preset_topology::UnknownValue(
14692 wkt::internal::UnknownEnumValue::String(value.to_string()),
14693 )),
14694 }
14695 }
14696}
14697
14698impl serde::ser::Serialize for PresetTopology {
14699 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14700 where
14701 S: serde::Serializer,
14702 {
14703 match self {
14704 Self::Unspecified => serializer.serialize_i32(0),
14705 Self::Mesh => serializer.serialize_i32(2),
14706 Self::Star => serializer.serialize_i32(3),
14707 Self::UnknownValue(u) => u.0.serialize(serializer),
14708 }
14709 }
14710}
14711
14712impl<'de> serde::de::Deserialize<'de> for PresetTopology {
14713 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14714 where
14715 D: serde::Deserializer<'de>,
14716 {
14717 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PresetTopology>::new(
14718 ".google.cloud.networkconnectivity.v1.PresetTopology",
14719 ))
14720 }
14721}