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 ConnectivityTest {
46 pub name: std::string::String,
49
50 pub description: std::string::String,
53
54 pub source: std::option::Option<crate::model::Endpoint>,
63
64 pub destination: std::option::Option<crate::model::Endpoint>,
73
74 pub protocol: std::string::String,
76
77 pub related_projects: std::vec::Vec<std::string::String>,
80
81 pub display_name: std::string::String,
83
84 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
86
87 pub create_time: std::option::Option<wkt::Timestamp>,
89
90 pub update_time: std::option::Option<wkt::Timestamp>,
92
93 pub reachability_details: std::option::Option<crate::model::ReachabilityDetails>,
97
98 pub probing_details: std::option::Option<crate::model::ProbingDetails>,
103
104 pub round_trip: bool,
107
108 pub return_reachability_details: std::option::Option<crate::model::ReachabilityDetails>,
113
114 pub bypass_firewall_checks: bool,
116
117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
118}
119
120impl ConnectivityTest {
121 pub fn new() -> Self {
122 std::default::Default::default()
123 }
124
125 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
127 self.name = v.into();
128 self
129 }
130
131 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
133 self.description = v.into();
134 self
135 }
136
137 pub fn set_source<T>(mut self, v: T) -> Self
139 where
140 T: std::convert::Into<crate::model::Endpoint>,
141 {
142 self.source = std::option::Option::Some(v.into());
143 self
144 }
145
146 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
148 where
149 T: std::convert::Into<crate::model::Endpoint>,
150 {
151 self.source = v.map(|x| x.into());
152 self
153 }
154
155 pub fn set_destination<T>(mut self, v: T) -> Self
157 where
158 T: std::convert::Into<crate::model::Endpoint>,
159 {
160 self.destination = std::option::Option::Some(v.into());
161 self
162 }
163
164 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
166 where
167 T: std::convert::Into<crate::model::Endpoint>,
168 {
169 self.destination = v.map(|x| x.into());
170 self
171 }
172
173 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
175 self.protocol = v.into();
176 self
177 }
178
179 pub fn set_related_projects<T, V>(mut self, v: T) -> Self
181 where
182 T: std::iter::IntoIterator<Item = V>,
183 V: std::convert::Into<std::string::String>,
184 {
185 use std::iter::Iterator;
186 self.related_projects = v.into_iter().map(|i| i.into()).collect();
187 self
188 }
189
190 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
192 self.display_name = v.into();
193 self
194 }
195
196 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
198 where
199 T: std::iter::IntoIterator<Item = (K, V)>,
200 K: std::convert::Into<std::string::String>,
201 V: std::convert::Into<std::string::String>,
202 {
203 use std::iter::Iterator;
204 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
205 self
206 }
207
208 pub fn set_create_time<T>(mut self, v: T) -> Self
210 where
211 T: std::convert::Into<wkt::Timestamp>,
212 {
213 self.create_time = std::option::Option::Some(v.into());
214 self
215 }
216
217 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
219 where
220 T: std::convert::Into<wkt::Timestamp>,
221 {
222 self.create_time = v.map(|x| x.into());
223 self
224 }
225
226 pub fn set_update_time<T>(mut self, v: T) -> Self
228 where
229 T: std::convert::Into<wkt::Timestamp>,
230 {
231 self.update_time = std::option::Option::Some(v.into());
232 self
233 }
234
235 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
237 where
238 T: std::convert::Into<wkt::Timestamp>,
239 {
240 self.update_time = v.map(|x| x.into());
241 self
242 }
243
244 pub fn set_reachability_details<T>(mut self, v: T) -> Self
246 where
247 T: std::convert::Into<crate::model::ReachabilityDetails>,
248 {
249 self.reachability_details = std::option::Option::Some(v.into());
250 self
251 }
252
253 pub fn set_or_clear_reachability_details<T>(mut self, v: std::option::Option<T>) -> Self
255 where
256 T: std::convert::Into<crate::model::ReachabilityDetails>,
257 {
258 self.reachability_details = v.map(|x| x.into());
259 self
260 }
261
262 pub fn set_probing_details<T>(mut self, v: T) -> Self
264 where
265 T: std::convert::Into<crate::model::ProbingDetails>,
266 {
267 self.probing_details = std::option::Option::Some(v.into());
268 self
269 }
270
271 pub fn set_or_clear_probing_details<T>(mut self, v: std::option::Option<T>) -> Self
273 where
274 T: std::convert::Into<crate::model::ProbingDetails>,
275 {
276 self.probing_details = v.map(|x| x.into());
277 self
278 }
279
280 pub fn set_round_trip<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
282 self.round_trip = v.into();
283 self
284 }
285
286 pub fn set_return_reachability_details<T>(mut self, v: T) -> Self
288 where
289 T: std::convert::Into<crate::model::ReachabilityDetails>,
290 {
291 self.return_reachability_details = std::option::Option::Some(v.into());
292 self
293 }
294
295 pub fn set_or_clear_return_reachability_details<T>(mut self, v: std::option::Option<T>) -> Self
297 where
298 T: std::convert::Into<crate::model::ReachabilityDetails>,
299 {
300 self.return_reachability_details = v.map(|x| x.into());
301 self
302 }
303
304 pub fn set_bypass_firewall_checks<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
306 self.bypass_firewall_checks = v.into();
307 self
308 }
309}
310
311impl wkt::message::Message for ConnectivityTest {
312 fn typename() -> &'static str {
313 "type.googleapis.com/google.cloud.networkmanagement.v1.ConnectivityTest"
314 }
315}
316
317#[derive(Clone, Default, PartialEq)]
319#[non_exhaustive]
320pub struct Endpoint {
321 pub ip_address: std::string::String,
323
324 pub port: i32,
327
328 pub instance: std::string::String,
330
331 pub forwarding_rule: std::string::String,
339
340 pub forwarding_rule_target: std::option::Option<crate::model::endpoint::ForwardingRuleTarget>,
342
343 pub load_balancer_id: std::option::Option<std::string::String>,
346
347 pub load_balancer_type: std::option::Option<crate::model::LoadBalancerType>,
349
350 pub gke_master_cluster: std::string::String,
353
354 pub fqdn: std::string::String,
359
360 pub cloud_sql_instance: std::string::String,
362
363 pub redis_instance: std::string::String,
366
367 pub redis_cluster: std::string::String,
370
371 pub cloud_function: std::option::Option<crate::model::endpoint::CloudFunctionEndpoint>,
374
375 pub app_engine_version: std::option::Option<crate::model::endpoint::AppEngineVersionEndpoint>,
379
380 pub cloud_run_revision: std::option::Option<crate::model::endpoint::CloudRunRevisionEndpoint>,
384
385 pub network: std::string::String,
387
388 pub network_type: crate::model::endpoint::NetworkType,
392
393 pub project_id: std::string::String,
404
405 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
406}
407
408impl Endpoint {
409 pub fn new() -> Self {
410 std::default::Default::default()
411 }
412
413 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
415 self.ip_address = v.into();
416 self
417 }
418
419 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
421 self.port = v.into();
422 self
423 }
424
425 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
427 self.instance = v.into();
428 self
429 }
430
431 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
433 self.forwarding_rule = v.into();
434 self
435 }
436
437 pub fn set_forwarding_rule_target<T>(mut self, v: T) -> Self
439 where
440 T: std::convert::Into<crate::model::endpoint::ForwardingRuleTarget>,
441 {
442 self.forwarding_rule_target = std::option::Option::Some(v.into());
443 self
444 }
445
446 pub fn set_or_clear_forwarding_rule_target<T>(mut self, v: std::option::Option<T>) -> Self
448 where
449 T: std::convert::Into<crate::model::endpoint::ForwardingRuleTarget>,
450 {
451 self.forwarding_rule_target = v.map(|x| x.into());
452 self
453 }
454
455 pub fn set_load_balancer_id<T>(mut self, v: T) -> Self
457 where
458 T: std::convert::Into<std::string::String>,
459 {
460 self.load_balancer_id = std::option::Option::Some(v.into());
461 self
462 }
463
464 pub fn set_or_clear_load_balancer_id<T>(mut self, v: std::option::Option<T>) -> Self
466 where
467 T: std::convert::Into<std::string::String>,
468 {
469 self.load_balancer_id = v.map(|x| x.into());
470 self
471 }
472
473 pub fn set_load_balancer_type<T>(mut self, v: T) -> Self
475 where
476 T: std::convert::Into<crate::model::LoadBalancerType>,
477 {
478 self.load_balancer_type = std::option::Option::Some(v.into());
479 self
480 }
481
482 pub fn set_or_clear_load_balancer_type<T>(mut self, v: std::option::Option<T>) -> Self
484 where
485 T: std::convert::Into<crate::model::LoadBalancerType>,
486 {
487 self.load_balancer_type = v.map(|x| x.into());
488 self
489 }
490
491 pub fn set_gke_master_cluster<T: std::convert::Into<std::string::String>>(
493 mut self,
494 v: T,
495 ) -> Self {
496 self.gke_master_cluster = v.into();
497 self
498 }
499
500 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
502 self.fqdn = v.into();
503 self
504 }
505
506 pub fn set_cloud_sql_instance<T: std::convert::Into<std::string::String>>(
508 mut self,
509 v: T,
510 ) -> Self {
511 self.cloud_sql_instance = v.into();
512 self
513 }
514
515 pub fn set_redis_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
517 self.redis_instance = v.into();
518 self
519 }
520
521 pub fn set_redis_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
523 self.redis_cluster = v.into();
524 self
525 }
526
527 pub fn set_cloud_function<T>(mut self, v: T) -> Self
529 where
530 T: std::convert::Into<crate::model::endpoint::CloudFunctionEndpoint>,
531 {
532 self.cloud_function = std::option::Option::Some(v.into());
533 self
534 }
535
536 pub fn set_or_clear_cloud_function<T>(mut self, v: std::option::Option<T>) -> Self
538 where
539 T: std::convert::Into<crate::model::endpoint::CloudFunctionEndpoint>,
540 {
541 self.cloud_function = v.map(|x| x.into());
542 self
543 }
544
545 pub fn set_app_engine_version<T>(mut self, v: T) -> Self
547 where
548 T: std::convert::Into<crate::model::endpoint::AppEngineVersionEndpoint>,
549 {
550 self.app_engine_version = std::option::Option::Some(v.into());
551 self
552 }
553
554 pub fn set_or_clear_app_engine_version<T>(mut self, v: std::option::Option<T>) -> Self
556 where
557 T: std::convert::Into<crate::model::endpoint::AppEngineVersionEndpoint>,
558 {
559 self.app_engine_version = v.map(|x| x.into());
560 self
561 }
562
563 pub fn set_cloud_run_revision<T>(mut self, v: T) -> Self
565 where
566 T: std::convert::Into<crate::model::endpoint::CloudRunRevisionEndpoint>,
567 {
568 self.cloud_run_revision = std::option::Option::Some(v.into());
569 self
570 }
571
572 pub fn set_or_clear_cloud_run_revision<T>(mut self, v: std::option::Option<T>) -> Self
574 where
575 T: std::convert::Into<crate::model::endpoint::CloudRunRevisionEndpoint>,
576 {
577 self.cloud_run_revision = v.map(|x| x.into());
578 self
579 }
580
581 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
583 self.network = v.into();
584 self
585 }
586
587 pub fn set_network_type<T: std::convert::Into<crate::model::endpoint::NetworkType>>(
589 mut self,
590 v: T,
591 ) -> Self {
592 self.network_type = v.into();
593 self
594 }
595
596 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
598 self.project_id = v.into();
599 self
600 }
601}
602
603impl wkt::message::Message for Endpoint {
604 fn typename() -> &'static str {
605 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint"
606 }
607}
608
609pub mod endpoint {
611 #[allow(unused_imports)]
612 use super::*;
613
614 #[derive(Clone, Default, PartialEq)]
616 #[non_exhaustive]
617 pub struct CloudFunctionEndpoint {
618 pub uri: std::string::String,
620
621 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
622 }
623
624 impl CloudFunctionEndpoint {
625 pub fn new() -> Self {
626 std::default::Default::default()
627 }
628
629 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
631 self.uri = v.into();
632 self
633 }
634 }
635
636 impl wkt::message::Message for CloudFunctionEndpoint {
637 fn typename() -> &'static str {
638 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.CloudFunctionEndpoint"
639 }
640 }
641
642 #[derive(Clone, Default, PartialEq)]
644 #[non_exhaustive]
645 pub struct AppEngineVersionEndpoint {
646 pub uri: std::string::String,
650
651 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
652 }
653
654 impl AppEngineVersionEndpoint {
655 pub fn new() -> Self {
656 std::default::Default::default()
657 }
658
659 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
661 self.uri = v.into();
662 self
663 }
664 }
665
666 impl wkt::message::Message for AppEngineVersionEndpoint {
667 fn typename() -> &'static str {
668 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.AppEngineVersionEndpoint"
669 }
670 }
671
672 #[derive(Clone, Default, PartialEq)]
674 #[non_exhaustive]
675 pub struct CloudRunRevisionEndpoint {
676 pub uri: std::string::String,
681
682 pub service_uri: std::string::String,
686
687 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
688 }
689
690 impl CloudRunRevisionEndpoint {
691 pub fn new() -> Self {
692 std::default::Default::default()
693 }
694
695 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
697 self.uri = v.into();
698 self
699 }
700
701 pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
703 self.service_uri = v.into();
704 self
705 }
706 }
707
708 impl wkt::message::Message for CloudRunRevisionEndpoint {
709 fn typename() -> &'static str {
710 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.CloudRunRevisionEndpoint"
711 }
712 }
713
714 #[derive(Clone, Debug, PartialEq)]
731 #[non_exhaustive]
732 pub enum NetworkType {
733 Unspecified,
735 GcpNetwork,
739 NonGcpNetwork,
743 UnknownValue(network_type::UnknownValue),
748 }
749
750 #[doc(hidden)]
751 pub mod network_type {
752 #[allow(unused_imports)]
753 use super::*;
754 #[derive(Clone, Debug, PartialEq)]
755 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
756 }
757
758 impl NetworkType {
759 pub fn value(&self) -> std::option::Option<i32> {
764 match self {
765 Self::Unspecified => std::option::Option::Some(0),
766 Self::GcpNetwork => std::option::Option::Some(1),
767 Self::NonGcpNetwork => std::option::Option::Some(2),
768 Self::UnknownValue(u) => u.0.value(),
769 }
770 }
771
772 pub fn name(&self) -> std::option::Option<&str> {
777 match self {
778 Self::Unspecified => std::option::Option::Some("NETWORK_TYPE_UNSPECIFIED"),
779 Self::GcpNetwork => std::option::Option::Some("GCP_NETWORK"),
780 Self::NonGcpNetwork => std::option::Option::Some("NON_GCP_NETWORK"),
781 Self::UnknownValue(u) => u.0.name(),
782 }
783 }
784 }
785
786 impl std::default::Default for NetworkType {
787 fn default() -> Self {
788 use std::convert::From;
789 Self::from(0)
790 }
791 }
792
793 impl std::fmt::Display for NetworkType {
794 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
795 wkt::internal::display_enum(f, self.name(), self.value())
796 }
797 }
798
799 impl std::convert::From<i32> for NetworkType {
800 fn from(value: i32) -> Self {
801 match value {
802 0 => Self::Unspecified,
803 1 => Self::GcpNetwork,
804 2 => Self::NonGcpNetwork,
805 _ => Self::UnknownValue(network_type::UnknownValue(
806 wkt::internal::UnknownEnumValue::Integer(value),
807 )),
808 }
809 }
810 }
811
812 impl std::convert::From<&str> for NetworkType {
813 fn from(value: &str) -> Self {
814 use std::string::ToString;
815 match value {
816 "NETWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
817 "GCP_NETWORK" => Self::GcpNetwork,
818 "NON_GCP_NETWORK" => Self::NonGcpNetwork,
819 _ => Self::UnknownValue(network_type::UnknownValue(
820 wkt::internal::UnknownEnumValue::String(value.to_string()),
821 )),
822 }
823 }
824 }
825
826 impl serde::ser::Serialize for NetworkType {
827 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
828 where
829 S: serde::Serializer,
830 {
831 match self {
832 Self::Unspecified => serializer.serialize_i32(0),
833 Self::GcpNetwork => serializer.serialize_i32(1),
834 Self::NonGcpNetwork => serializer.serialize_i32(2),
835 Self::UnknownValue(u) => u.0.serialize(serializer),
836 }
837 }
838 }
839
840 impl<'de> serde::de::Deserialize<'de> for NetworkType {
841 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
842 where
843 D: serde::Deserializer<'de>,
844 {
845 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NetworkType>::new(
846 ".google.cloud.networkmanagement.v1.Endpoint.NetworkType",
847 ))
848 }
849 }
850
851 #[derive(Clone, Debug, PartialEq)]
867 #[non_exhaustive]
868 pub enum ForwardingRuleTarget {
869 Unspecified,
871 Instance,
873 LoadBalancer,
876 VpnGateway,
878 Psc,
880 UnknownValue(forwarding_rule_target::UnknownValue),
885 }
886
887 #[doc(hidden)]
888 pub mod forwarding_rule_target {
889 #[allow(unused_imports)]
890 use super::*;
891 #[derive(Clone, Debug, PartialEq)]
892 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
893 }
894
895 impl ForwardingRuleTarget {
896 pub fn value(&self) -> std::option::Option<i32> {
901 match self {
902 Self::Unspecified => std::option::Option::Some(0),
903 Self::Instance => std::option::Option::Some(1),
904 Self::LoadBalancer => std::option::Option::Some(2),
905 Self::VpnGateway => std::option::Option::Some(3),
906 Self::Psc => std::option::Option::Some(4),
907 Self::UnknownValue(u) => u.0.value(),
908 }
909 }
910
911 pub fn name(&self) -> std::option::Option<&str> {
916 match self {
917 Self::Unspecified => {
918 std::option::Option::Some("FORWARDING_RULE_TARGET_UNSPECIFIED")
919 }
920 Self::Instance => std::option::Option::Some("INSTANCE"),
921 Self::LoadBalancer => std::option::Option::Some("LOAD_BALANCER"),
922 Self::VpnGateway => std::option::Option::Some("VPN_GATEWAY"),
923 Self::Psc => std::option::Option::Some("PSC"),
924 Self::UnknownValue(u) => u.0.name(),
925 }
926 }
927 }
928
929 impl std::default::Default for ForwardingRuleTarget {
930 fn default() -> Self {
931 use std::convert::From;
932 Self::from(0)
933 }
934 }
935
936 impl std::fmt::Display for ForwardingRuleTarget {
937 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
938 wkt::internal::display_enum(f, self.name(), self.value())
939 }
940 }
941
942 impl std::convert::From<i32> for ForwardingRuleTarget {
943 fn from(value: i32) -> Self {
944 match value {
945 0 => Self::Unspecified,
946 1 => Self::Instance,
947 2 => Self::LoadBalancer,
948 3 => Self::VpnGateway,
949 4 => Self::Psc,
950 _ => Self::UnknownValue(forwarding_rule_target::UnknownValue(
951 wkt::internal::UnknownEnumValue::Integer(value),
952 )),
953 }
954 }
955 }
956
957 impl std::convert::From<&str> for ForwardingRuleTarget {
958 fn from(value: &str) -> Self {
959 use std::string::ToString;
960 match value {
961 "FORWARDING_RULE_TARGET_UNSPECIFIED" => Self::Unspecified,
962 "INSTANCE" => Self::Instance,
963 "LOAD_BALANCER" => Self::LoadBalancer,
964 "VPN_GATEWAY" => Self::VpnGateway,
965 "PSC" => Self::Psc,
966 _ => Self::UnknownValue(forwarding_rule_target::UnknownValue(
967 wkt::internal::UnknownEnumValue::String(value.to_string()),
968 )),
969 }
970 }
971 }
972
973 impl serde::ser::Serialize for ForwardingRuleTarget {
974 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
975 where
976 S: serde::Serializer,
977 {
978 match self {
979 Self::Unspecified => serializer.serialize_i32(0),
980 Self::Instance => serializer.serialize_i32(1),
981 Self::LoadBalancer => serializer.serialize_i32(2),
982 Self::VpnGateway => serializer.serialize_i32(3),
983 Self::Psc => serializer.serialize_i32(4),
984 Self::UnknownValue(u) => u.0.serialize(serializer),
985 }
986 }
987 }
988
989 impl<'de> serde::de::Deserialize<'de> for ForwardingRuleTarget {
990 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
991 where
992 D: serde::Deserializer<'de>,
993 {
994 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ForwardingRuleTarget>::new(
995 ".google.cloud.networkmanagement.v1.Endpoint.ForwardingRuleTarget",
996 ))
997 }
998 }
999}
1000
1001#[derive(Clone, Default, PartialEq)]
1003#[non_exhaustive]
1004pub struct ReachabilityDetails {
1005 pub result: crate::model::reachability_details::Result,
1007
1008 pub verify_time: std::option::Option<wkt::Timestamp>,
1010
1011 pub error: std::option::Option<rpc::model::Status>,
1013
1014 pub traces: std::vec::Vec<crate::model::Trace>,
1018
1019 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1020}
1021
1022impl ReachabilityDetails {
1023 pub fn new() -> Self {
1024 std::default::Default::default()
1025 }
1026
1027 pub fn set_result<T: std::convert::Into<crate::model::reachability_details::Result>>(
1029 mut self,
1030 v: T,
1031 ) -> Self {
1032 self.result = v.into();
1033 self
1034 }
1035
1036 pub fn set_verify_time<T>(mut self, v: T) -> Self
1038 where
1039 T: std::convert::Into<wkt::Timestamp>,
1040 {
1041 self.verify_time = std::option::Option::Some(v.into());
1042 self
1043 }
1044
1045 pub fn set_or_clear_verify_time<T>(mut self, v: std::option::Option<T>) -> Self
1047 where
1048 T: std::convert::Into<wkt::Timestamp>,
1049 {
1050 self.verify_time = v.map(|x| x.into());
1051 self
1052 }
1053
1054 pub fn set_error<T>(mut self, v: T) -> Self
1056 where
1057 T: std::convert::Into<rpc::model::Status>,
1058 {
1059 self.error = std::option::Option::Some(v.into());
1060 self
1061 }
1062
1063 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1065 where
1066 T: std::convert::Into<rpc::model::Status>,
1067 {
1068 self.error = v.map(|x| x.into());
1069 self
1070 }
1071
1072 pub fn set_traces<T, V>(mut self, v: T) -> Self
1074 where
1075 T: std::iter::IntoIterator<Item = V>,
1076 V: std::convert::Into<crate::model::Trace>,
1077 {
1078 use std::iter::Iterator;
1079 self.traces = v.into_iter().map(|i| i.into()).collect();
1080 self
1081 }
1082}
1083
1084impl wkt::message::Message for ReachabilityDetails {
1085 fn typename() -> &'static str {
1086 "type.googleapis.com/google.cloud.networkmanagement.v1.ReachabilityDetails"
1087 }
1088}
1089
1090pub mod reachability_details {
1092 #[allow(unused_imports)]
1093 use super::*;
1094
1095 #[derive(Clone, Debug, PartialEq)]
1111 #[non_exhaustive]
1112 pub enum Result {
1113 Unspecified,
1115 Reachable,
1123 Unreachable,
1126 Ambiguous,
1133 Undetermined,
1141 UnknownValue(result::UnknownValue),
1146 }
1147
1148 #[doc(hidden)]
1149 pub mod result {
1150 #[allow(unused_imports)]
1151 use super::*;
1152 #[derive(Clone, Debug, PartialEq)]
1153 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1154 }
1155
1156 impl Result {
1157 pub fn value(&self) -> std::option::Option<i32> {
1162 match self {
1163 Self::Unspecified => std::option::Option::Some(0),
1164 Self::Reachable => std::option::Option::Some(1),
1165 Self::Unreachable => std::option::Option::Some(2),
1166 Self::Ambiguous => std::option::Option::Some(4),
1167 Self::Undetermined => std::option::Option::Some(5),
1168 Self::UnknownValue(u) => u.0.value(),
1169 }
1170 }
1171
1172 pub fn name(&self) -> std::option::Option<&str> {
1177 match self {
1178 Self::Unspecified => std::option::Option::Some("RESULT_UNSPECIFIED"),
1179 Self::Reachable => std::option::Option::Some("REACHABLE"),
1180 Self::Unreachable => std::option::Option::Some("UNREACHABLE"),
1181 Self::Ambiguous => std::option::Option::Some("AMBIGUOUS"),
1182 Self::Undetermined => std::option::Option::Some("UNDETERMINED"),
1183 Self::UnknownValue(u) => u.0.name(),
1184 }
1185 }
1186 }
1187
1188 impl std::default::Default for Result {
1189 fn default() -> Self {
1190 use std::convert::From;
1191 Self::from(0)
1192 }
1193 }
1194
1195 impl std::fmt::Display for Result {
1196 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1197 wkt::internal::display_enum(f, self.name(), self.value())
1198 }
1199 }
1200
1201 impl std::convert::From<i32> for Result {
1202 fn from(value: i32) -> Self {
1203 match value {
1204 0 => Self::Unspecified,
1205 1 => Self::Reachable,
1206 2 => Self::Unreachable,
1207 4 => Self::Ambiguous,
1208 5 => Self::Undetermined,
1209 _ => Self::UnknownValue(result::UnknownValue(
1210 wkt::internal::UnknownEnumValue::Integer(value),
1211 )),
1212 }
1213 }
1214 }
1215
1216 impl std::convert::From<&str> for Result {
1217 fn from(value: &str) -> Self {
1218 use std::string::ToString;
1219 match value {
1220 "RESULT_UNSPECIFIED" => Self::Unspecified,
1221 "REACHABLE" => Self::Reachable,
1222 "UNREACHABLE" => Self::Unreachable,
1223 "AMBIGUOUS" => Self::Ambiguous,
1224 "UNDETERMINED" => Self::Undetermined,
1225 _ => Self::UnknownValue(result::UnknownValue(
1226 wkt::internal::UnknownEnumValue::String(value.to_string()),
1227 )),
1228 }
1229 }
1230 }
1231
1232 impl serde::ser::Serialize for Result {
1233 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1234 where
1235 S: serde::Serializer,
1236 {
1237 match self {
1238 Self::Unspecified => serializer.serialize_i32(0),
1239 Self::Reachable => serializer.serialize_i32(1),
1240 Self::Unreachable => serializer.serialize_i32(2),
1241 Self::Ambiguous => serializer.serialize_i32(4),
1242 Self::Undetermined => serializer.serialize_i32(5),
1243 Self::UnknownValue(u) => u.0.serialize(serializer),
1244 }
1245 }
1246 }
1247
1248 impl<'de> serde::de::Deserialize<'de> for Result {
1249 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1250 where
1251 D: serde::Deserializer<'de>,
1252 {
1253 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Result>::new(
1254 ".google.cloud.networkmanagement.v1.ReachabilityDetails.Result",
1255 ))
1256 }
1257 }
1258}
1259
1260#[derive(Clone, Default, PartialEq)]
1262#[non_exhaustive]
1263pub struct LatencyPercentile {
1264 pub percent: i32,
1266
1267 pub latency_micros: i64,
1271
1272 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1273}
1274
1275impl LatencyPercentile {
1276 pub fn new() -> Self {
1277 std::default::Default::default()
1278 }
1279
1280 pub fn set_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1282 self.percent = v.into();
1283 self
1284 }
1285
1286 pub fn set_latency_micros<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1288 self.latency_micros = v.into();
1289 self
1290 }
1291}
1292
1293impl wkt::message::Message for LatencyPercentile {
1294 fn typename() -> &'static str {
1295 "type.googleapis.com/google.cloud.networkmanagement.v1.LatencyPercentile"
1296 }
1297}
1298
1299#[derive(Clone, Default, PartialEq)]
1301#[non_exhaustive]
1302pub struct LatencyDistribution {
1303 pub latency_percentiles: std::vec::Vec<crate::model::LatencyPercentile>,
1305
1306 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1307}
1308
1309impl LatencyDistribution {
1310 pub fn new() -> Self {
1311 std::default::Default::default()
1312 }
1313
1314 pub fn set_latency_percentiles<T, V>(mut self, v: T) -> Self
1316 where
1317 T: std::iter::IntoIterator<Item = V>,
1318 V: std::convert::Into<crate::model::LatencyPercentile>,
1319 {
1320 use std::iter::Iterator;
1321 self.latency_percentiles = v.into_iter().map(|i| i.into()).collect();
1322 self
1323 }
1324}
1325
1326impl wkt::message::Message for LatencyDistribution {
1327 fn typename() -> &'static str {
1328 "type.googleapis.com/google.cloud.networkmanagement.v1.LatencyDistribution"
1329 }
1330}
1331
1332#[derive(Clone, Default, PartialEq)]
1334#[non_exhaustive]
1335pub struct ProbingDetails {
1336 pub result: crate::model::probing_details::ProbingResult,
1338
1339 pub verify_time: std::option::Option<wkt::Timestamp>,
1341
1342 pub error: std::option::Option<rpc::model::Status>,
1344
1345 pub abort_cause: crate::model::probing_details::ProbingAbortCause,
1347
1348 pub sent_probe_count: i32,
1350
1351 pub successful_probe_count: i32,
1353
1354 pub endpoint_info: std::option::Option<crate::model::EndpointInfo>,
1357
1358 pub probing_latency: std::option::Option<crate::model::LatencyDistribution>,
1361
1362 pub destination_egress_location:
1369 std::option::Option<crate::model::probing_details::EdgeLocation>,
1370
1371 pub edge_responses: std::vec::Vec<crate::model::probing_details::SingleEdgeResponse>,
1373
1374 pub probed_all_devices: bool,
1376
1377 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1378}
1379
1380impl ProbingDetails {
1381 pub fn new() -> Self {
1382 std::default::Default::default()
1383 }
1384
1385 pub fn set_result<T: std::convert::Into<crate::model::probing_details::ProbingResult>>(
1387 mut self,
1388 v: T,
1389 ) -> Self {
1390 self.result = v.into();
1391 self
1392 }
1393
1394 pub fn set_verify_time<T>(mut self, v: T) -> Self
1396 where
1397 T: std::convert::Into<wkt::Timestamp>,
1398 {
1399 self.verify_time = std::option::Option::Some(v.into());
1400 self
1401 }
1402
1403 pub fn set_or_clear_verify_time<T>(mut self, v: std::option::Option<T>) -> Self
1405 where
1406 T: std::convert::Into<wkt::Timestamp>,
1407 {
1408 self.verify_time = v.map(|x| x.into());
1409 self
1410 }
1411
1412 pub fn set_error<T>(mut self, v: T) -> Self
1414 where
1415 T: std::convert::Into<rpc::model::Status>,
1416 {
1417 self.error = std::option::Option::Some(v.into());
1418 self
1419 }
1420
1421 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1423 where
1424 T: std::convert::Into<rpc::model::Status>,
1425 {
1426 self.error = v.map(|x| x.into());
1427 self
1428 }
1429
1430 pub fn set_abort_cause<
1432 T: std::convert::Into<crate::model::probing_details::ProbingAbortCause>,
1433 >(
1434 mut self,
1435 v: T,
1436 ) -> Self {
1437 self.abort_cause = v.into();
1438 self
1439 }
1440
1441 pub fn set_sent_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1443 self.sent_probe_count = v.into();
1444 self
1445 }
1446
1447 pub fn set_successful_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1449 self.successful_probe_count = v.into();
1450 self
1451 }
1452
1453 pub fn set_endpoint_info<T>(mut self, v: T) -> Self
1455 where
1456 T: std::convert::Into<crate::model::EndpointInfo>,
1457 {
1458 self.endpoint_info = std::option::Option::Some(v.into());
1459 self
1460 }
1461
1462 pub fn set_or_clear_endpoint_info<T>(mut self, v: std::option::Option<T>) -> Self
1464 where
1465 T: std::convert::Into<crate::model::EndpointInfo>,
1466 {
1467 self.endpoint_info = v.map(|x| x.into());
1468 self
1469 }
1470
1471 pub fn set_probing_latency<T>(mut self, v: T) -> Self
1473 where
1474 T: std::convert::Into<crate::model::LatencyDistribution>,
1475 {
1476 self.probing_latency = std::option::Option::Some(v.into());
1477 self
1478 }
1479
1480 pub fn set_or_clear_probing_latency<T>(mut self, v: std::option::Option<T>) -> Self
1482 where
1483 T: std::convert::Into<crate::model::LatencyDistribution>,
1484 {
1485 self.probing_latency = v.map(|x| x.into());
1486 self
1487 }
1488
1489 pub fn set_destination_egress_location<T>(mut self, v: T) -> Self
1491 where
1492 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
1493 {
1494 self.destination_egress_location = std::option::Option::Some(v.into());
1495 self
1496 }
1497
1498 pub fn set_or_clear_destination_egress_location<T>(mut self, v: std::option::Option<T>) -> Self
1500 where
1501 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
1502 {
1503 self.destination_egress_location = v.map(|x| x.into());
1504 self
1505 }
1506
1507 pub fn set_edge_responses<T, V>(mut self, v: T) -> Self
1509 where
1510 T: std::iter::IntoIterator<Item = V>,
1511 V: std::convert::Into<crate::model::probing_details::SingleEdgeResponse>,
1512 {
1513 use std::iter::Iterator;
1514 self.edge_responses = v.into_iter().map(|i| i.into()).collect();
1515 self
1516 }
1517
1518 pub fn set_probed_all_devices<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1520 self.probed_all_devices = v.into();
1521 self
1522 }
1523}
1524
1525impl wkt::message::Message for ProbingDetails {
1526 fn typename() -> &'static str {
1527 "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails"
1528 }
1529}
1530
1531pub mod probing_details {
1533 #[allow(unused_imports)]
1534 use super::*;
1535
1536 #[derive(Clone, Default, PartialEq)]
1539 #[non_exhaustive]
1540 pub struct EdgeLocation {
1541 pub metropolitan_area: std::string::String,
1543
1544 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1545 }
1546
1547 impl EdgeLocation {
1548 pub fn new() -> Self {
1549 std::default::Default::default()
1550 }
1551
1552 pub fn set_metropolitan_area<T: std::convert::Into<std::string::String>>(
1554 mut self,
1555 v: T,
1556 ) -> Self {
1557 self.metropolitan_area = v.into();
1558 self
1559 }
1560 }
1561
1562 impl wkt::message::Message for EdgeLocation {
1563 fn typename() -> &'static str {
1564 "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails.EdgeLocation"
1565 }
1566 }
1567
1568 #[derive(Clone, Default, PartialEq)]
1570 #[non_exhaustive]
1571 pub struct SingleEdgeResponse {
1572 pub result: crate::model::probing_details::ProbingResult,
1574
1575 pub sent_probe_count: i32,
1577
1578 pub successful_probe_count: i32,
1580
1581 pub probing_latency: std::option::Option<crate::model::LatencyDistribution>,
1584
1585 pub destination_egress_location:
1592 std::option::Option<crate::model::probing_details::EdgeLocation>,
1593
1594 pub destination_router: std::string::String,
1597
1598 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1599 }
1600
1601 impl SingleEdgeResponse {
1602 pub fn new() -> Self {
1603 std::default::Default::default()
1604 }
1605
1606 pub fn set_result<T: std::convert::Into<crate::model::probing_details::ProbingResult>>(
1608 mut self,
1609 v: T,
1610 ) -> Self {
1611 self.result = v.into();
1612 self
1613 }
1614
1615 pub fn set_sent_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1617 self.sent_probe_count = v.into();
1618 self
1619 }
1620
1621 pub fn set_successful_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1623 self.successful_probe_count = v.into();
1624 self
1625 }
1626
1627 pub fn set_probing_latency<T>(mut self, v: T) -> Self
1629 where
1630 T: std::convert::Into<crate::model::LatencyDistribution>,
1631 {
1632 self.probing_latency = std::option::Option::Some(v.into());
1633 self
1634 }
1635
1636 pub fn set_or_clear_probing_latency<T>(mut self, v: std::option::Option<T>) -> Self
1638 where
1639 T: std::convert::Into<crate::model::LatencyDistribution>,
1640 {
1641 self.probing_latency = v.map(|x| x.into());
1642 self
1643 }
1644
1645 pub fn set_destination_egress_location<T>(mut self, v: T) -> Self
1647 where
1648 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
1649 {
1650 self.destination_egress_location = std::option::Option::Some(v.into());
1651 self
1652 }
1653
1654 pub fn set_or_clear_destination_egress_location<T>(
1656 mut self,
1657 v: std::option::Option<T>,
1658 ) -> Self
1659 where
1660 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
1661 {
1662 self.destination_egress_location = v.map(|x| x.into());
1663 self
1664 }
1665
1666 pub fn set_destination_router<T: std::convert::Into<std::string::String>>(
1668 mut self,
1669 v: T,
1670 ) -> Self {
1671 self.destination_router = v.into();
1672 self
1673 }
1674 }
1675
1676 impl wkt::message::Message for SingleEdgeResponse {
1677 fn typename() -> &'static str {
1678 "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails.SingleEdgeResponse"
1679 }
1680 }
1681
1682 #[derive(Clone, Debug, PartialEq)]
1698 #[non_exhaustive]
1699 pub enum ProbingResult {
1700 Unspecified,
1702 Reachable,
1704 Unreachable,
1706 ReachabilityInconsistent,
1708 Undetermined,
1715 UnknownValue(probing_result::UnknownValue),
1720 }
1721
1722 #[doc(hidden)]
1723 pub mod probing_result {
1724 #[allow(unused_imports)]
1725 use super::*;
1726 #[derive(Clone, Debug, PartialEq)]
1727 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1728 }
1729
1730 impl ProbingResult {
1731 pub fn value(&self) -> std::option::Option<i32> {
1736 match self {
1737 Self::Unspecified => std::option::Option::Some(0),
1738 Self::Reachable => std::option::Option::Some(1),
1739 Self::Unreachable => std::option::Option::Some(2),
1740 Self::ReachabilityInconsistent => std::option::Option::Some(3),
1741 Self::Undetermined => std::option::Option::Some(4),
1742 Self::UnknownValue(u) => u.0.value(),
1743 }
1744 }
1745
1746 pub fn name(&self) -> std::option::Option<&str> {
1751 match self {
1752 Self::Unspecified => std::option::Option::Some("PROBING_RESULT_UNSPECIFIED"),
1753 Self::Reachable => std::option::Option::Some("REACHABLE"),
1754 Self::Unreachable => std::option::Option::Some("UNREACHABLE"),
1755 Self::ReachabilityInconsistent => {
1756 std::option::Option::Some("REACHABILITY_INCONSISTENT")
1757 }
1758 Self::Undetermined => std::option::Option::Some("UNDETERMINED"),
1759 Self::UnknownValue(u) => u.0.name(),
1760 }
1761 }
1762 }
1763
1764 impl std::default::Default for ProbingResult {
1765 fn default() -> Self {
1766 use std::convert::From;
1767 Self::from(0)
1768 }
1769 }
1770
1771 impl std::fmt::Display for ProbingResult {
1772 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1773 wkt::internal::display_enum(f, self.name(), self.value())
1774 }
1775 }
1776
1777 impl std::convert::From<i32> for ProbingResult {
1778 fn from(value: i32) -> Self {
1779 match value {
1780 0 => Self::Unspecified,
1781 1 => Self::Reachable,
1782 2 => Self::Unreachable,
1783 3 => Self::ReachabilityInconsistent,
1784 4 => Self::Undetermined,
1785 _ => Self::UnknownValue(probing_result::UnknownValue(
1786 wkt::internal::UnknownEnumValue::Integer(value),
1787 )),
1788 }
1789 }
1790 }
1791
1792 impl std::convert::From<&str> for ProbingResult {
1793 fn from(value: &str) -> Self {
1794 use std::string::ToString;
1795 match value {
1796 "PROBING_RESULT_UNSPECIFIED" => Self::Unspecified,
1797 "REACHABLE" => Self::Reachable,
1798 "UNREACHABLE" => Self::Unreachable,
1799 "REACHABILITY_INCONSISTENT" => Self::ReachabilityInconsistent,
1800 "UNDETERMINED" => Self::Undetermined,
1801 _ => Self::UnknownValue(probing_result::UnknownValue(
1802 wkt::internal::UnknownEnumValue::String(value.to_string()),
1803 )),
1804 }
1805 }
1806 }
1807
1808 impl serde::ser::Serialize for ProbingResult {
1809 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1810 where
1811 S: serde::Serializer,
1812 {
1813 match self {
1814 Self::Unspecified => serializer.serialize_i32(0),
1815 Self::Reachable => serializer.serialize_i32(1),
1816 Self::Unreachable => serializer.serialize_i32(2),
1817 Self::ReachabilityInconsistent => serializer.serialize_i32(3),
1818 Self::Undetermined => serializer.serialize_i32(4),
1819 Self::UnknownValue(u) => u.0.serialize(serializer),
1820 }
1821 }
1822 }
1823
1824 impl<'de> serde::de::Deserialize<'de> for ProbingResult {
1825 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1826 where
1827 D: serde::Deserializer<'de>,
1828 {
1829 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProbingResult>::new(
1830 ".google.cloud.networkmanagement.v1.ProbingDetails.ProbingResult",
1831 ))
1832 }
1833 }
1834
1835 #[derive(Clone, Debug, PartialEq)]
1851 #[non_exhaustive]
1852 pub enum ProbingAbortCause {
1853 Unspecified,
1855 PermissionDenied,
1858 NoSourceLocation,
1860 UnknownValue(probing_abort_cause::UnknownValue),
1865 }
1866
1867 #[doc(hidden)]
1868 pub mod probing_abort_cause {
1869 #[allow(unused_imports)]
1870 use super::*;
1871 #[derive(Clone, Debug, PartialEq)]
1872 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1873 }
1874
1875 impl ProbingAbortCause {
1876 pub fn value(&self) -> std::option::Option<i32> {
1881 match self {
1882 Self::Unspecified => std::option::Option::Some(0),
1883 Self::PermissionDenied => std::option::Option::Some(1),
1884 Self::NoSourceLocation => std::option::Option::Some(2),
1885 Self::UnknownValue(u) => u.0.value(),
1886 }
1887 }
1888
1889 pub fn name(&self) -> std::option::Option<&str> {
1894 match self {
1895 Self::Unspecified => std::option::Option::Some("PROBING_ABORT_CAUSE_UNSPECIFIED"),
1896 Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
1897 Self::NoSourceLocation => std::option::Option::Some("NO_SOURCE_LOCATION"),
1898 Self::UnknownValue(u) => u.0.name(),
1899 }
1900 }
1901 }
1902
1903 impl std::default::Default for ProbingAbortCause {
1904 fn default() -> Self {
1905 use std::convert::From;
1906 Self::from(0)
1907 }
1908 }
1909
1910 impl std::fmt::Display for ProbingAbortCause {
1911 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1912 wkt::internal::display_enum(f, self.name(), self.value())
1913 }
1914 }
1915
1916 impl std::convert::From<i32> for ProbingAbortCause {
1917 fn from(value: i32) -> Self {
1918 match value {
1919 0 => Self::Unspecified,
1920 1 => Self::PermissionDenied,
1921 2 => Self::NoSourceLocation,
1922 _ => Self::UnknownValue(probing_abort_cause::UnknownValue(
1923 wkt::internal::UnknownEnumValue::Integer(value),
1924 )),
1925 }
1926 }
1927 }
1928
1929 impl std::convert::From<&str> for ProbingAbortCause {
1930 fn from(value: &str) -> Self {
1931 use std::string::ToString;
1932 match value {
1933 "PROBING_ABORT_CAUSE_UNSPECIFIED" => Self::Unspecified,
1934 "PERMISSION_DENIED" => Self::PermissionDenied,
1935 "NO_SOURCE_LOCATION" => Self::NoSourceLocation,
1936 _ => Self::UnknownValue(probing_abort_cause::UnknownValue(
1937 wkt::internal::UnknownEnumValue::String(value.to_string()),
1938 )),
1939 }
1940 }
1941 }
1942
1943 impl serde::ser::Serialize for ProbingAbortCause {
1944 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1945 where
1946 S: serde::Serializer,
1947 {
1948 match self {
1949 Self::Unspecified => serializer.serialize_i32(0),
1950 Self::PermissionDenied => serializer.serialize_i32(1),
1951 Self::NoSourceLocation => serializer.serialize_i32(2),
1952 Self::UnknownValue(u) => u.0.serialize(serializer),
1953 }
1954 }
1955 }
1956
1957 impl<'de> serde::de::Deserialize<'de> for ProbingAbortCause {
1958 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1959 where
1960 D: serde::Deserializer<'de>,
1961 {
1962 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProbingAbortCause>::new(
1963 ".google.cloud.networkmanagement.v1.ProbingDetails.ProbingAbortCause",
1964 ))
1965 }
1966 }
1967}
1968
1969#[derive(Clone, Default, PartialEq)]
1971#[non_exhaustive]
1972pub struct ListConnectivityTestsRequest {
1973 pub parent: std::string::String,
1976
1977 pub page_size: i32,
1979
1980 pub page_token: std::string::String,
1982
1983 pub filter: std::string::String,
2004
2005 pub order_by: std::string::String,
2007
2008 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2009}
2010
2011impl ListConnectivityTestsRequest {
2012 pub fn new() -> Self {
2013 std::default::Default::default()
2014 }
2015
2016 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2018 self.parent = v.into();
2019 self
2020 }
2021
2022 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2024 self.page_size = v.into();
2025 self
2026 }
2027
2028 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2030 self.page_token = v.into();
2031 self
2032 }
2033
2034 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2036 self.filter = v.into();
2037 self
2038 }
2039
2040 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2042 self.order_by = v.into();
2043 self
2044 }
2045}
2046
2047impl wkt::message::Message for ListConnectivityTestsRequest {
2048 fn typename() -> &'static str {
2049 "type.googleapis.com/google.cloud.networkmanagement.v1.ListConnectivityTestsRequest"
2050 }
2051}
2052
2053#[derive(Clone, Default, PartialEq)]
2055#[non_exhaustive]
2056pub struct ListConnectivityTestsResponse {
2057 pub resources: std::vec::Vec<crate::model::ConnectivityTest>,
2059
2060 pub next_page_token: std::string::String,
2062
2063 pub unreachable: std::vec::Vec<std::string::String>,
2065
2066 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2067}
2068
2069impl ListConnectivityTestsResponse {
2070 pub fn new() -> Self {
2071 std::default::Default::default()
2072 }
2073
2074 pub fn set_resources<T, V>(mut self, v: T) -> Self
2076 where
2077 T: std::iter::IntoIterator<Item = V>,
2078 V: std::convert::Into<crate::model::ConnectivityTest>,
2079 {
2080 use std::iter::Iterator;
2081 self.resources = v.into_iter().map(|i| i.into()).collect();
2082 self
2083 }
2084
2085 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2087 self.next_page_token = v.into();
2088 self
2089 }
2090
2091 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2093 where
2094 T: std::iter::IntoIterator<Item = V>,
2095 V: std::convert::Into<std::string::String>,
2096 {
2097 use std::iter::Iterator;
2098 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2099 self
2100 }
2101}
2102
2103impl wkt::message::Message for ListConnectivityTestsResponse {
2104 fn typename() -> &'static str {
2105 "type.googleapis.com/google.cloud.networkmanagement.v1.ListConnectivityTestsResponse"
2106 }
2107}
2108
2109#[doc(hidden)]
2110impl gax::paginator::internal::PageableResponse for ListConnectivityTestsResponse {
2111 type PageItem = crate::model::ConnectivityTest;
2112
2113 fn items(self) -> std::vec::Vec<Self::PageItem> {
2114 self.resources
2115 }
2116
2117 fn next_page_token(&self) -> std::string::String {
2118 use std::clone::Clone;
2119 self.next_page_token.clone()
2120 }
2121}
2122
2123#[derive(Clone, Default, PartialEq)]
2125#[non_exhaustive]
2126pub struct GetConnectivityTestRequest {
2127 pub name: std::string::String,
2130
2131 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2132}
2133
2134impl GetConnectivityTestRequest {
2135 pub fn new() -> Self {
2136 std::default::Default::default()
2137 }
2138
2139 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2141 self.name = v.into();
2142 self
2143 }
2144}
2145
2146impl wkt::message::Message for GetConnectivityTestRequest {
2147 fn typename() -> &'static str {
2148 "type.googleapis.com/google.cloud.networkmanagement.v1.GetConnectivityTestRequest"
2149 }
2150}
2151
2152#[derive(Clone, Default, PartialEq)]
2154#[non_exhaustive]
2155pub struct CreateConnectivityTestRequest {
2156 pub parent: std::string::String,
2159
2160 pub test_id: std::string::String,
2169
2170 pub resource: std::option::Option<crate::model::ConnectivityTest>,
2172
2173 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2174}
2175
2176impl CreateConnectivityTestRequest {
2177 pub fn new() -> Self {
2178 std::default::Default::default()
2179 }
2180
2181 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2183 self.parent = v.into();
2184 self
2185 }
2186
2187 pub fn set_test_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2189 self.test_id = v.into();
2190 self
2191 }
2192
2193 pub fn set_resource<T>(mut self, v: T) -> Self
2195 where
2196 T: std::convert::Into<crate::model::ConnectivityTest>,
2197 {
2198 self.resource = std::option::Option::Some(v.into());
2199 self
2200 }
2201
2202 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
2204 where
2205 T: std::convert::Into<crate::model::ConnectivityTest>,
2206 {
2207 self.resource = v.map(|x| x.into());
2208 self
2209 }
2210}
2211
2212impl wkt::message::Message for CreateConnectivityTestRequest {
2213 fn typename() -> &'static str {
2214 "type.googleapis.com/google.cloud.networkmanagement.v1.CreateConnectivityTestRequest"
2215 }
2216}
2217
2218#[derive(Clone, Default, PartialEq)]
2220#[non_exhaustive]
2221pub struct UpdateConnectivityTestRequest {
2222 pub update_mask: std::option::Option<wkt::FieldMask>,
2225
2226 pub resource: std::option::Option<crate::model::ConnectivityTest>,
2228
2229 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2230}
2231
2232impl UpdateConnectivityTestRequest {
2233 pub fn new() -> Self {
2234 std::default::Default::default()
2235 }
2236
2237 pub fn set_update_mask<T>(mut self, v: T) -> Self
2239 where
2240 T: std::convert::Into<wkt::FieldMask>,
2241 {
2242 self.update_mask = std::option::Option::Some(v.into());
2243 self
2244 }
2245
2246 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2248 where
2249 T: std::convert::Into<wkt::FieldMask>,
2250 {
2251 self.update_mask = v.map(|x| x.into());
2252 self
2253 }
2254
2255 pub fn set_resource<T>(mut self, v: T) -> Self
2257 where
2258 T: std::convert::Into<crate::model::ConnectivityTest>,
2259 {
2260 self.resource = std::option::Option::Some(v.into());
2261 self
2262 }
2263
2264 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
2266 where
2267 T: std::convert::Into<crate::model::ConnectivityTest>,
2268 {
2269 self.resource = v.map(|x| x.into());
2270 self
2271 }
2272}
2273
2274impl wkt::message::Message for UpdateConnectivityTestRequest {
2275 fn typename() -> &'static str {
2276 "type.googleapis.com/google.cloud.networkmanagement.v1.UpdateConnectivityTestRequest"
2277 }
2278}
2279
2280#[derive(Clone, Default, PartialEq)]
2282#[non_exhaustive]
2283pub struct DeleteConnectivityTestRequest {
2284 pub name: std::string::String,
2287
2288 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2289}
2290
2291impl DeleteConnectivityTestRequest {
2292 pub fn new() -> Self {
2293 std::default::Default::default()
2294 }
2295
2296 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2298 self.name = v.into();
2299 self
2300 }
2301}
2302
2303impl wkt::message::Message for DeleteConnectivityTestRequest {
2304 fn typename() -> &'static str {
2305 "type.googleapis.com/google.cloud.networkmanagement.v1.DeleteConnectivityTestRequest"
2306 }
2307}
2308
2309#[derive(Clone, Default, PartialEq)]
2311#[non_exhaustive]
2312pub struct RerunConnectivityTestRequest {
2313 pub name: std::string::String,
2316
2317 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2318}
2319
2320impl RerunConnectivityTestRequest {
2321 pub fn new() -> Self {
2322 std::default::Default::default()
2323 }
2324
2325 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2327 self.name = v.into();
2328 self
2329 }
2330}
2331
2332impl wkt::message::Message for RerunConnectivityTestRequest {
2333 fn typename() -> &'static str {
2334 "type.googleapis.com/google.cloud.networkmanagement.v1.RerunConnectivityTestRequest"
2335 }
2336}
2337
2338#[derive(Clone, Default, PartialEq)]
2342#[non_exhaustive]
2343pub struct OperationMetadata {
2344 pub create_time: std::option::Option<wkt::Timestamp>,
2346
2347 pub end_time: std::option::Option<wkt::Timestamp>,
2349
2350 pub target: std::string::String,
2353
2354 pub verb: std::string::String,
2356
2357 pub status_detail: std::string::String,
2359
2360 pub cancel_requested: bool,
2362
2363 pub api_version: std::string::String,
2365
2366 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2367}
2368
2369impl OperationMetadata {
2370 pub fn new() -> Self {
2371 std::default::Default::default()
2372 }
2373
2374 pub fn set_create_time<T>(mut self, v: T) -> Self
2376 where
2377 T: std::convert::Into<wkt::Timestamp>,
2378 {
2379 self.create_time = std::option::Option::Some(v.into());
2380 self
2381 }
2382
2383 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2385 where
2386 T: std::convert::Into<wkt::Timestamp>,
2387 {
2388 self.create_time = v.map(|x| x.into());
2389 self
2390 }
2391
2392 pub fn set_end_time<T>(mut self, v: T) -> Self
2394 where
2395 T: std::convert::Into<wkt::Timestamp>,
2396 {
2397 self.end_time = std::option::Option::Some(v.into());
2398 self
2399 }
2400
2401 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2403 where
2404 T: std::convert::Into<wkt::Timestamp>,
2405 {
2406 self.end_time = v.map(|x| x.into());
2407 self
2408 }
2409
2410 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2412 self.target = v.into();
2413 self
2414 }
2415
2416 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2418 self.verb = v.into();
2419 self
2420 }
2421
2422 pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2424 self.status_detail = v.into();
2425 self
2426 }
2427
2428 pub fn set_cancel_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2430 self.cancel_requested = v.into();
2431 self
2432 }
2433
2434 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2436 self.api_version = v.into();
2437 self
2438 }
2439}
2440
2441impl wkt::message::Message for OperationMetadata {
2442 fn typename() -> &'static str {
2443 "type.googleapis.com/google.cloud.networkmanagement.v1.OperationMetadata"
2444 }
2445}
2446
2447#[derive(Clone, Default, PartialEq)]
2460#[non_exhaustive]
2461pub struct Trace {
2462 pub endpoint_info: std::option::Option<crate::model::EndpointInfo>,
2467
2468 pub steps: std::vec::Vec<crate::model::Step>,
2475
2476 pub forward_trace_id: i32,
2480
2481 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2482}
2483
2484impl Trace {
2485 pub fn new() -> Self {
2486 std::default::Default::default()
2487 }
2488
2489 pub fn set_endpoint_info<T>(mut self, v: T) -> Self
2491 where
2492 T: std::convert::Into<crate::model::EndpointInfo>,
2493 {
2494 self.endpoint_info = std::option::Option::Some(v.into());
2495 self
2496 }
2497
2498 pub fn set_or_clear_endpoint_info<T>(mut self, v: std::option::Option<T>) -> Self
2500 where
2501 T: std::convert::Into<crate::model::EndpointInfo>,
2502 {
2503 self.endpoint_info = v.map(|x| x.into());
2504 self
2505 }
2506
2507 pub fn set_steps<T, V>(mut self, v: T) -> Self
2509 where
2510 T: std::iter::IntoIterator<Item = V>,
2511 V: std::convert::Into<crate::model::Step>,
2512 {
2513 use std::iter::Iterator;
2514 self.steps = v.into_iter().map(|i| i.into()).collect();
2515 self
2516 }
2517
2518 pub fn set_forward_trace_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2520 self.forward_trace_id = v.into();
2521 self
2522 }
2523}
2524
2525impl wkt::message::Message for Trace {
2526 fn typename() -> &'static str {
2527 "type.googleapis.com/google.cloud.networkmanagement.v1.Trace"
2528 }
2529}
2530
2531#[derive(Clone, Default, PartialEq)]
2534#[non_exhaustive]
2535pub struct Step {
2536 pub description: std::string::String,
2538
2539 pub state: crate::model::step::State,
2541
2542 pub causes_drop: bool,
2544
2545 pub project_id: std::string::String,
2547
2548 pub step_info: std::option::Option<crate::model::step::StepInfo>,
2554
2555 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2556}
2557
2558impl Step {
2559 pub fn new() -> Self {
2560 std::default::Default::default()
2561 }
2562
2563 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2565 self.description = v.into();
2566 self
2567 }
2568
2569 pub fn set_state<T: std::convert::Into<crate::model::step::State>>(mut self, v: T) -> Self {
2571 self.state = v.into();
2572 self
2573 }
2574
2575 pub fn set_causes_drop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2577 self.causes_drop = v.into();
2578 self
2579 }
2580
2581 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2583 self.project_id = v.into();
2584 self
2585 }
2586
2587 pub fn set_step_info<
2592 T: std::convert::Into<std::option::Option<crate::model::step::StepInfo>>,
2593 >(
2594 mut self,
2595 v: T,
2596 ) -> Self {
2597 self.step_info = v.into();
2598 self
2599 }
2600
2601 pub fn instance(&self) -> std::option::Option<&std::boxed::Box<crate::model::InstanceInfo>> {
2605 #[allow(unreachable_patterns)]
2606 self.step_info.as_ref().and_then(|v| match v {
2607 crate::model::step::StepInfo::Instance(v) => std::option::Option::Some(v),
2608 _ => std::option::Option::None,
2609 })
2610 }
2611
2612 pub fn set_instance<T: std::convert::Into<std::boxed::Box<crate::model::InstanceInfo>>>(
2618 mut self,
2619 v: T,
2620 ) -> Self {
2621 self.step_info =
2622 std::option::Option::Some(crate::model::step::StepInfo::Instance(v.into()));
2623 self
2624 }
2625
2626 pub fn firewall(&self) -> std::option::Option<&std::boxed::Box<crate::model::FirewallInfo>> {
2630 #[allow(unreachable_patterns)]
2631 self.step_info.as_ref().and_then(|v| match v {
2632 crate::model::step::StepInfo::Firewall(v) => std::option::Option::Some(v),
2633 _ => std::option::Option::None,
2634 })
2635 }
2636
2637 pub fn set_firewall<T: std::convert::Into<std::boxed::Box<crate::model::FirewallInfo>>>(
2643 mut self,
2644 v: T,
2645 ) -> Self {
2646 self.step_info =
2647 std::option::Option::Some(crate::model::step::StepInfo::Firewall(v.into()));
2648 self
2649 }
2650
2651 pub fn route(&self) -> std::option::Option<&std::boxed::Box<crate::model::RouteInfo>> {
2655 #[allow(unreachable_patterns)]
2656 self.step_info.as_ref().and_then(|v| match v {
2657 crate::model::step::StepInfo::Route(v) => std::option::Option::Some(v),
2658 _ => std::option::Option::None,
2659 })
2660 }
2661
2662 pub fn set_route<T: std::convert::Into<std::boxed::Box<crate::model::RouteInfo>>>(
2668 mut self,
2669 v: T,
2670 ) -> Self {
2671 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Route(v.into()));
2672 self
2673 }
2674
2675 pub fn endpoint(&self) -> std::option::Option<&std::boxed::Box<crate::model::EndpointInfo>> {
2679 #[allow(unreachable_patterns)]
2680 self.step_info.as_ref().and_then(|v| match v {
2681 crate::model::step::StepInfo::Endpoint(v) => std::option::Option::Some(v),
2682 _ => std::option::Option::None,
2683 })
2684 }
2685
2686 pub fn set_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::EndpointInfo>>>(
2692 mut self,
2693 v: T,
2694 ) -> Self {
2695 self.step_info =
2696 std::option::Option::Some(crate::model::step::StepInfo::Endpoint(v.into()));
2697 self
2698 }
2699
2700 pub fn google_service(
2704 &self,
2705 ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleServiceInfo>> {
2706 #[allow(unreachable_patterns)]
2707 self.step_info.as_ref().and_then(|v| match v {
2708 crate::model::step::StepInfo::GoogleService(v) => std::option::Option::Some(v),
2709 _ => std::option::Option::None,
2710 })
2711 }
2712
2713 pub fn set_google_service<
2719 T: std::convert::Into<std::boxed::Box<crate::model::GoogleServiceInfo>>,
2720 >(
2721 mut self,
2722 v: T,
2723 ) -> Self {
2724 self.step_info =
2725 std::option::Option::Some(crate::model::step::StepInfo::GoogleService(v.into()));
2726 self
2727 }
2728
2729 pub fn forwarding_rule(
2733 &self,
2734 ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardingRuleInfo>> {
2735 #[allow(unreachable_patterns)]
2736 self.step_info.as_ref().and_then(|v| match v {
2737 crate::model::step::StepInfo::ForwardingRule(v) => std::option::Option::Some(v),
2738 _ => std::option::Option::None,
2739 })
2740 }
2741
2742 pub fn set_forwarding_rule<
2748 T: std::convert::Into<std::boxed::Box<crate::model::ForwardingRuleInfo>>,
2749 >(
2750 mut self,
2751 v: T,
2752 ) -> Self {
2753 self.step_info =
2754 std::option::Option::Some(crate::model::step::StepInfo::ForwardingRule(v.into()));
2755 self
2756 }
2757
2758 pub fn hybrid_subnet(
2762 &self,
2763 ) -> std::option::Option<&std::boxed::Box<crate::model::HybridSubnetInfo>> {
2764 #[allow(unreachable_patterns)]
2765 self.step_info.as_ref().and_then(|v| match v {
2766 crate::model::step::StepInfo::HybridSubnet(v) => std::option::Option::Some(v),
2767 _ => std::option::Option::None,
2768 })
2769 }
2770
2771 pub fn set_hybrid_subnet<
2777 T: std::convert::Into<std::boxed::Box<crate::model::HybridSubnetInfo>>,
2778 >(
2779 mut self,
2780 v: T,
2781 ) -> Self {
2782 self.step_info =
2783 std::option::Option::Some(crate::model::step::StepInfo::HybridSubnet(v.into()));
2784 self
2785 }
2786
2787 pub fn vpn_gateway(
2791 &self,
2792 ) -> std::option::Option<&std::boxed::Box<crate::model::VpnGatewayInfo>> {
2793 #[allow(unreachable_patterns)]
2794 self.step_info.as_ref().and_then(|v| match v {
2795 crate::model::step::StepInfo::VpnGateway(v) => std::option::Option::Some(v),
2796 _ => std::option::Option::None,
2797 })
2798 }
2799
2800 pub fn set_vpn_gateway<T: std::convert::Into<std::boxed::Box<crate::model::VpnGatewayInfo>>>(
2806 mut self,
2807 v: T,
2808 ) -> Self {
2809 self.step_info =
2810 std::option::Option::Some(crate::model::step::StepInfo::VpnGateway(v.into()));
2811 self
2812 }
2813
2814 pub fn vpn_tunnel(&self) -> std::option::Option<&std::boxed::Box<crate::model::VpnTunnelInfo>> {
2818 #[allow(unreachable_patterns)]
2819 self.step_info.as_ref().and_then(|v| match v {
2820 crate::model::step::StepInfo::VpnTunnel(v) => std::option::Option::Some(v),
2821 _ => std::option::Option::None,
2822 })
2823 }
2824
2825 pub fn set_vpn_tunnel<T: std::convert::Into<std::boxed::Box<crate::model::VpnTunnelInfo>>>(
2831 mut self,
2832 v: T,
2833 ) -> Self {
2834 self.step_info =
2835 std::option::Option::Some(crate::model::step::StepInfo::VpnTunnel(v.into()));
2836 self
2837 }
2838
2839 pub fn interconnect_attachment(
2843 &self,
2844 ) -> std::option::Option<&std::boxed::Box<crate::model::InterconnectAttachmentInfo>> {
2845 #[allow(unreachable_patterns)]
2846 self.step_info.as_ref().and_then(|v| match v {
2847 crate::model::step::StepInfo::InterconnectAttachment(v) => std::option::Option::Some(v),
2848 _ => std::option::Option::None,
2849 })
2850 }
2851
2852 pub fn set_interconnect_attachment<
2858 T: std::convert::Into<std::boxed::Box<crate::model::InterconnectAttachmentInfo>>,
2859 >(
2860 mut self,
2861 v: T,
2862 ) -> Self {
2863 self.step_info = std::option::Option::Some(
2864 crate::model::step::StepInfo::InterconnectAttachment(v.into()),
2865 );
2866 self
2867 }
2868
2869 pub fn vpc_connector(
2873 &self,
2874 ) -> std::option::Option<&std::boxed::Box<crate::model::VpcConnectorInfo>> {
2875 #[allow(unreachable_patterns)]
2876 self.step_info.as_ref().and_then(|v| match v {
2877 crate::model::step::StepInfo::VpcConnector(v) => std::option::Option::Some(v),
2878 _ => std::option::Option::None,
2879 })
2880 }
2881
2882 pub fn set_vpc_connector<
2888 T: std::convert::Into<std::boxed::Box<crate::model::VpcConnectorInfo>>,
2889 >(
2890 mut self,
2891 v: T,
2892 ) -> Self {
2893 self.step_info =
2894 std::option::Option::Some(crate::model::step::StepInfo::VpcConnector(v.into()));
2895 self
2896 }
2897
2898 pub fn direct_vpc_egress_connection(
2902 &self,
2903 ) -> std::option::Option<&std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>> {
2904 #[allow(unreachable_patterns)]
2905 self.step_info.as_ref().and_then(|v| match v {
2906 crate::model::step::StepInfo::DirectVpcEgressConnection(v) => {
2907 std::option::Option::Some(v)
2908 }
2909 _ => std::option::Option::None,
2910 })
2911 }
2912
2913 pub fn set_direct_vpc_egress_connection<
2919 T: std::convert::Into<std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>>,
2920 >(
2921 mut self,
2922 v: T,
2923 ) -> Self {
2924 self.step_info = std::option::Option::Some(
2925 crate::model::step::StepInfo::DirectVpcEgressConnection(v.into()),
2926 );
2927 self
2928 }
2929
2930 pub fn serverless_external_connection(
2934 &self,
2935 ) -> std::option::Option<&std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>> {
2936 #[allow(unreachable_patterns)]
2937 self.step_info.as_ref().and_then(|v| match v {
2938 crate::model::step::StepInfo::ServerlessExternalConnection(v) => {
2939 std::option::Option::Some(v)
2940 }
2941 _ => std::option::Option::None,
2942 })
2943 }
2944
2945 pub fn set_serverless_external_connection<
2951 T: std::convert::Into<std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>>,
2952 >(
2953 mut self,
2954 v: T,
2955 ) -> Self {
2956 self.step_info = std::option::Option::Some(
2957 crate::model::step::StepInfo::ServerlessExternalConnection(v.into()),
2958 );
2959 self
2960 }
2961
2962 pub fn deliver(&self) -> std::option::Option<&std::boxed::Box<crate::model::DeliverInfo>> {
2966 #[allow(unreachable_patterns)]
2967 self.step_info.as_ref().and_then(|v| match v {
2968 crate::model::step::StepInfo::Deliver(v) => std::option::Option::Some(v),
2969 _ => std::option::Option::None,
2970 })
2971 }
2972
2973 pub fn set_deliver<T: std::convert::Into<std::boxed::Box<crate::model::DeliverInfo>>>(
2979 mut self,
2980 v: T,
2981 ) -> Self {
2982 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Deliver(v.into()));
2983 self
2984 }
2985
2986 pub fn forward(&self) -> std::option::Option<&std::boxed::Box<crate::model::ForwardInfo>> {
2990 #[allow(unreachable_patterns)]
2991 self.step_info.as_ref().and_then(|v| match v {
2992 crate::model::step::StepInfo::Forward(v) => std::option::Option::Some(v),
2993 _ => std::option::Option::None,
2994 })
2995 }
2996
2997 pub fn set_forward<T: std::convert::Into<std::boxed::Box<crate::model::ForwardInfo>>>(
3003 mut self,
3004 v: T,
3005 ) -> Self {
3006 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Forward(v.into()));
3007 self
3008 }
3009
3010 pub fn abort(&self) -> std::option::Option<&std::boxed::Box<crate::model::AbortInfo>> {
3014 #[allow(unreachable_patterns)]
3015 self.step_info.as_ref().and_then(|v| match v {
3016 crate::model::step::StepInfo::Abort(v) => std::option::Option::Some(v),
3017 _ => std::option::Option::None,
3018 })
3019 }
3020
3021 pub fn set_abort<T: std::convert::Into<std::boxed::Box<crate::model::AbortInfo>>>(
3027 mut self,
3028 v: T,
3029 ) -> Self {
3030 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Abort(v.into()));
3031 self
3032 }
3033
3034 pub fn drop(&self) -> std::option::Option<&std::boxed::Box<crate::model::DropInfo>> {
3038 #[allow(unreachable_patterns)]
3039 self.step_info.as_ref().and_then(|v| match v {
3040 crate::model::step::StepInfo::Drop(v) => std::option::Option::Some(v),
3041 _ => std::option::Option::None,
3042 })
3043 }
3044
3045 pub fn set_drop<T: std::convert::Into<std::boxed::Box<crate::model::DropInfo>>>(
3051 mut self,
3052 v: T,
3053 ) -> Self {
3054 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Drop(v.into()));
3055 self
3056 }
3057
3058 #[deprecated]
3062 pub fn load_balancer(
3063 &self,
3064 ) -> std::option::Option<&std::boxed::Box<crate::model::LoadBalancerInfo>> {
3065 #[allow(unreachable_patterns)]
3066 self.step_info.as_ref().and_then(|v| match v {
3067 crate::model::step::StepInfo::LoadBalancer(v) => std::option::Option::Some(v),
3068 _ => std::option::Option::None,
3069 })
3070 }
3071
3072 #[deprecated]
3078 pub fn set_load_balancer<
3079 T: std::convert::Into<std::boxed::Box<crate::model::LoadBalancerInfo>>,
3080 >(
3081 mut self,
3082 v: T,
3083 ) -> Self {
3084 self.step_info =
3085 std::option::Option::Some(crate::model::step::StepInfo::LoadBalancer(v.into()));
3086 self
3087 }
3088
3089 pub fn network(&self) -> std::option::Option<&std::boxed::Box<crate::model::NetworkInfo>> {
3093 #[allow(unreachable_patterns)]
3094 self.step_info.as_ref().and_then(|v| match v {
3095 crate::model::step::StepInfo::Network(v) => std::option::Option::Some(v),
3096 _ => std::option::Option::None,
3097 })
3098 }
3099
3100 pub fn set_network<T: std::convert::Into<std::boxed::Box<crate::model::NetworkInfo>>>(
3106 mut self,
3107 v: T,
3108 ) -> Self {
3109 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Network(v.into()));
3110 self
3111 }
3112
3113 pub fn gke_master(&self) -> std::option::Option<&std::boxed::Box<crate::model::GKEMasterInfo>> {
3117 #[allow(unreachable_patterns)]
3118 self.step_info.as_ref().and_then(|v| match v {
3119 crate::model::step::StepInfo::GkeMaster(v) => std::option::Option::Some(v),
3120 _ => std::option::Option::None,
3121 })
3122 }
3123
3124 pub fn set_gke_master<T: std::convert::Into<std::boxed::Box<crate::model::GKEMasterInfo>>>(
3130 mut self,
3131 v: T,
3132 ) -> Self {
3133 self.step_info =
3134 std::option::Option::Some(crate::model::step::StepInfo::GkeMaster(v.into()));
3135 self
3136 }
3137
3138 pub fn cloud_sql_instance(
3142 &self,
3143 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudSQLInstanceInfo>> {
3144 #[allow(unreachable_patterns)]
3145 self.step_info.as_ref().and_then(|v| match v {
3146 crate::model::step::StepInfo::CloudSqlInstance(v) => std::option::Option::Some(v),
3147 _ => std::option::Option::None,
3148 })
3149 }
3150
3151 pub fn set_cloud_sql_instance<
3157 T: std::convert::Into<std::boxed::Box<crate::model::CloudSQLInstanceInfo>>,
3158 >(
3159 mut self,
3160 v: T,
3161 ) -> Self {
3162 self.step_info =
3163 std::option::Option::Some(crate::model::step::StepInfo::CloudSqlInstance(v.into()));
3164 self
3165 }
3166
3167 pub fn redis_instance(
3171 &self,
3172 ) -> std::option::Option<&std::boxed::Box<crate::model::RedisInstanceInfo>> {
3173 #[allow(unreachable_patterns)]
3174 self.step_info.as_ref().and_then(|v| match v {
3175 crate::model::step::StepInfo::RedisInstance(v) => std::option::Option::Some(v),
3176 _ => std::option::Option::None,
3177 })
3178 }
3179
3180 pub fn set_redis_instance<
3186 T: std::convert::Into<std::boxed::Box<crate::model::RedisInstanceInfo>>,
3187 >(
3188 mut self,
3189 v: T,
3190 ) -> Self {
3191 self.step_info =
3192 std::option::Option::Some(crate::model::step::StepInfo::RedisInstance(v.into()));
3193 self
3194 }
3195
3196 pub fn redis_cluster(
3200 &self,
3201 ) -> std::option::Option<&std::boxed::Box<crate::model::RedisClusterInfo>> {
3202 #[allow(unreachable_patterns)]
3203 self.step_info.as_ref().and_then(|v| match v {
3204 crate::model::step::StepInfo::RedisCluster(v) => std::option::Option::Some(v),
3205 _ => std::option::Option::None,
3206 })
3207 }
3208
3209 pub fn set_redis_cluster<
3215 T: std::convert::Into<std::boxed::Box<crate::model::RedisClusterInfo>>,
3216 >(
3217 mut self,
3218 v: T,
3219 ) -> Self {
3220 self.step_info =
3221 std::option::Option::Some(crate::model::step::StepInfo::RedisCluster(v.into()));
3222 self
3223 }
3224
3225 pub fn cloud_function(
3229 &self,
3230 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudFunctionInfo>> {
3231 #[allow(unreachable_patterns)]
3232 self.step_info.as_ref().and_then(|v| match v {
3233 crate::model::step::StepInfo::CloudFunction(v) => std::option::Option::Some(v),
3234 _ => std::option::Option::None,
3235 })
3236 }
3237
3238 pub fn set_cloud_function<
3244 T: std::convert::Into<std::boxed::Box<crate::model::CloudFunctionInfo>>,
3245 >(
3246 mut self,
3247 v: T,
3248 ) -> Self {
3249 self.step_info =
3250 std::option::Option::Some(crate::model::step::StepInfo::CloudFunction(v.into()));
3251 self
3252 }
3253
3254 pub fn app_engine_version(
3258 &self,
3259 ) -> std::option::Option<&std::boxed::Box<crate::model::AppEngineVersionInfo>> {
3260 #[allow(unreachable_patterns)]
3261 self.step_info.as_ref().and_then(|v| match v {
3262 crate::model::step::StepInfo::AppEngineVersion(v) => std::option::Option::Some(v),
3263 _ => std::option::Option::None,
3264 })
3265 }
3266
3267 pub fn set_app_engine_version<
3273 T: std::convert::Into<std::boxed::Box<crate::model::AppEngineVersionInfo>>,
3274 >(
3275 mut self,
3276 v: T,
3277 ) -> Self {
3278 self.step_info =
3279 std::option::Option::Some(crate::model::step::StepInfo::AppEngineVersion(v.into()));
3280 self
3281 }
3282
3283 pub fn cloud_run_revision(
3287 &self,
3288 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunRevisionInfo>> {
3289 #[allow(unreachable_patterns)]
3290 self.step_info.as_ref().and_then(|v| match v {
3291 crate::model::step::StepInfo::CloudRunRevision(v) => std::option::Option::Some(v),
3292 _ => std::option::Option::None,
3293 })
3294 }
3295
3296 pub fn set_cloud_run_revision<
3302 T: std::convert::Into<std::boxed::Box<crate::model::CloudRunRevisionInfo>>,
3303 >(
3304 mut self,
3305 v: T,
3306 ) -> Self {
3307 self.step_info =
3308 std::option::Option::Some(crate::model::step::StepInfo::CloudRunRevision(v.into()));
3309 self
3310 }
3311
3312 pub fn nat(&self) -> std::option::Option<&std::boxed::Box<crate::model::NatInfo>> {
3316 #[allow(unreachable_patterns)]
3317 self.step_info.as_ref().and_then(|v| match v {
3318 crate::model::step::StepInfo::Nat(v) => std::option::Option::Some(v),
3319 _ => std::option::Option::None,
3320 })
3321 }
3322
3323 pub fn set_nat<T: std::convert::Into<std::boxed::Box<crate::model::NatInfo>>>(
3329 mut self,
3330 v: T,
3331 ) -> Self {
3332 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Nat(v.into()));
3333 self
3334 }
3335
3336 pub fn proxy_connection(
3340 &self,
3341 ) -> std::option::Option<&std::boxed::Box<crate::model::ProxyConnectionInfo>> {
3342 #[allow(unreachable_patterns)]
3343 self.step_info.as_ref().and_then(|v| match v {
3344 crate::model::step::StepInfo::ProxyConnection(v) => std::option::Option::Some(v),
3345 _ => std::option::Option::None,
3346 })
3347 }
3348
3349 pub fn set_proxy_connection<
3355 T: std::convert::Into<std::boxed::Box<crate::model::ProxyConnectionInfo>>,
3356 >(
3357 mut self,
3358 v: T,
3359 ) -> Self {
3360 self.step_info =
3361 std::option::Option::Some(crate::model::step::StepInfo::ProxyConnection(v.into()));
3362 self
3363 }
3364
3365 pub fn load_balancer_backend_info(
3369 &self,
3370 ) -> std::option::Option<&std::boxed::Box<crate::model::LoadBalancerBackendInfo>> {
3371 #[allow(unreachable_patterns)]
3372 self.step_info.as_ref().and_then(|v| match v {
3373 crate::model::step::StepInfo::LoadBalancerBackendInfo(v) => {
3374 std::option::Option::Some(v)
3375 }
3376 _ => std::option::Option::None,
3377 })
3378 }
3379
3380 pub fn set_load_balancer_backend_info<
3386 T: std::convert::Into<std::boxed::Box<crate::model::LoadBalancerBackendInfo>>,
3387 >(
3388 mut self,
3389 v: T,
3390 ) -> Self {
3391 self.step_info = std::option::Option::Some(
3392 crate::model::step::StepInfo::LoadBalancerBackendInfo(v.into()),
3393 );
3394 self
3395 }
3396
3397 pub fn storage_bucket(
3401 &self,
3402 ) -> std::option::Option<&std::boxed::Box<crate::model::StorageBucketInfo>> {
3403 #[allow(unreachable_patterns)]
3404 self.step_info.as_ref().and_then(|v| match v {
3405 crate::model::step::StepInfo::StorageBucket(v) => std::option::Option::Some(v),
3406 _ => std::option::Option::None,
3407 })
3408 }
3409
3410 pub fn set_storage_bucket<
3416 T: std::convert::Into<std::boxed::Box<crate::model::StorageBucketInfo>>,
3417 >(
3418 mut self,
3419 v: T,
3420 ) -> Self {
3421 self.step_info =
3422 std::option::Option::Some(crate::model::step::StepInfo::StorageBucket(v.into()));
3423 self
3424 }
3425
3426 pub fn serverless_neg(
3430 &self,
3431 ) -> std::option::Option<&std::boxed::Box<crate::model::ServerlessNegInfo>> {
3432 #[allow(unreachable_patterns)]
3433 self.step_info.as_ref().and_then(|v| match v {
3434 crate::model::step::StepInfo::ServerlessNeg(v) => std::option::Option::Some(v),
3435 _ => std::option::Option::None,
3436 })
3437 }
3438
3439 pub fn set_serverless_neg<
3445 T: std::convert::Into<std::boxed::Box<crate::model::ServerlessNegInfo>>,
3446 >(
3447 mut self,
3448 v: T,
3449 ) -> Self {
3450 self.step_info =
3451 std::option::Option::Some(crate::model::step::StepInfo::ServerlessNeg(v.into()));
3452 self
3453 }
3454}
3455
3456impl wkt::message::Message for Step {
3457 fn typename() -> &'static str {
3458 "type.googleapis.com/google.cloud.networkmanagement.v1.Step"
3459 }
3460}
3461
3462pub mod step {
3464 #[allow(unused_imports)]
3465 use super::*;
3466
3467 #[derive(Clone, Debug, PartialEq)]
3484 #[non_exhaustive]
3485 pub enum State {
3486 Unspecified,
3488 StartFromInstance,
3491 StartFromInternet,
3494 StartFromGoogleService,
3497 StartFromPrivateNetwork,
3502 StartFromGkeMaster,
3505 StartFromCloudSqlInstance,
3508 StartFromRedisInstance,
3511 StartFromRedisCluster,
3514 StartFromCloudFunction,
3517 StartFromAppEngineVersion,
3520 StartFromCloudRunRevision,
3523 StartFromStorageBucket,
3527 StartFromPscPublishedService,
3530 StartFromServerlessNeg,
3534 ApplyIngressFirewallRule,
3536 ApplyEgressFirewallRule,
3538 ApplyRoute,
3540 ApplyForwardingRule,
3542 AnalyzeLoadBalancerBackend,
3544 SpoofingApproved,
3547 ArriveAtInstance,
3549 #[deprecated]
3551 ArriveAtInternalLoadBalancer,
3552 #[deprecated]
3554 ArriveAtExternalLoadBalancer,
3555 ArriveAtHybridSubnet,
3558 ArriveAtVpnGateway,
3560 ArriveAtVpnTunnel,
3562 ArriveAtInterconnectAttachment,
3564 ArriveAtVpcConnector,
3566 DirectVpcEgressConnection,
3569 ServerlessExternalConnection,
3572 Nat,
3575 ProxyConnection,
3578 Deliver,
3580 Drop,
3582 Forward,
3585 Abort,
3587 ViewerPermissionMissing,
3590 UnknownValue(state::UnknownValue),
3595 }
3596
3597 #[doc(hidden)]
3598 pub mod state {
3599 #[allow(unused_imports)]
3600 use super::*;
3601 #[derive(Clone, Debug, PartialEq)]
3602 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3603 }
3604
3605 impl State {
3606 pub fn value(&self) -> std::option::Option<i32> {
3611 match self {
3612 Self::Unspecified => std::option::Option::Some(0),
3613 Self::StartFromInstance => std::option::Option::Some(1),
3614 Self::StartFromInternet => std::option::Option::Some(2),
3615 Self::StartFromGoogleService => std::option::Option::Some(27),
3616 Self::StartFromPrivateNetwork => std::option::Option::Some(3),
3617 Self::StartFromGkeMaster => std::option::Option::Some(21),
3618 Self::StartFromCloudSqlInstance => std::option::Option::Some(22),
3619 Self::StartFromRedisInstance => std::option::Option::Some(32),
3620 Self::StartFromRedisCluster => std::option::Option::Some(33),
3621 Self::StartFromCloudFunction => std::option::Option::Some(23),
3622 Self::StartFromAppEngineVersion => std::option::Option::Some(25),
3623 Self::StartFromCloudRunRevision => std::option::Option::Some(26),
3624 Self::StartFromStorageBucket => std::option::Option::Some(29),
3625 Self::StartFromPscPublishedService => std::option::Option::Some(30),
3626 Self::StartFromServerlessNeg => std::option::Option::Some(31),
3627 Self::ApplyIngressFirewallRule => std::option::Option::Some(4),
3628 Self::ApplyEgressFirewallRule => std::option::Option::Some(5),
3629 Self::ApplyRoute => std::option::Option::Some(6),
3630 Self::ApplyForwardingRule => std::option::Option::Some(7),
3631 Self::AnalyzeLoadBalancerBackend => std::option::Option::Some(28),
3632 Self::SpoofingApproved => std::option::Option::Some(8),
3633 Self::ArriveAtInstance => std::option::Option::Some(9),
3634 Self::ArriveAtInternalLoadBalancer => std::option::Option::Some(10),
3635 Self::ArriveAtExternalLoadBalancer => std::option::Option::Some(11),
3636 Self::ArriveAtHybridSubnet => std::option::Option::Some(38),
3637 Self::ArriveAtVpnGateway => std::option::Option::Some(12),
3638 Self::ArriveAtVpnTunnel => std::option::Option::Some(13),
3639 Self::ArriveAtInterconnectAttachment => std::option::Option::Some(37),
3640 Self::ArriveAtVpcConnector => std::option::Option::Some(24),
3641 Self::DirectVpcEgressConnection => std::option::Option::Some(35),
3642 Self::ServerlessExternalConnection => std::option::Option::Some(36),
3643 Self::Nat => std::option::Option::Some(14),
3644 Self::ProxyConnection => std::option::Option::Some(15),
3645 Self::Deliver => std::option::Option::Some(16),
3646 Self::Drop => std::option::Option::Some(17),
3647 Self::Forward => std::option::Option::Some(18),
3648 Self::Abort => std::option::Option::Some(19),
3649 Self::ViewerPermissionMissing => std::option::Option::Some(20),
3650 Self::UnknownValue(u) => u.0.value(),
3651 }
3652 }
3653
3654 pub fn name(&self) -> std::option::Option<&str> {
3659 match self {
3660 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3661 Self::StartFromInstance => std::option::Option::Some("START_FROM_INSTANCE"),
3662 Self::StartFromInternet => std::option::Option::Some("START_FROM_INTERNET"),
3663 Self::StartFromGoogleService => {
3664 std::option::Option::Some("START_FROM_GOOGLE_SERVICE")
3665 }
3666 Self::StartFromPrivateNetwork => {
3667 std::option::Option::Some("START_FROM_PRIVATE_NETWORK")
3668 }
3669 Self::StartFromGkeMaster => std::option::Option::Some("START_FROM_GKE_MASTER"),
3670 Self::StartFromCloudSqlInstance => {
3671 std::option::Option::Some("START_FROM_CLOUD_SQL_INSTANCE")
3672 }
3673 Self::StartFromRedisInstance => {
3674 std::option::Option::Some("START_FROM_REDIS_INSTANCE")
3675 }
3676 Self::StartFromRedisCluster => {
3677 std::option::Option::Some("START_FROM_REDIS_CLUSTER")
3678 }
3679 Self::StartFromCloudFunction => {
3680 std::option::Option::Some("START_FROM_CLOUD_FUNCTION")
3681 }
3682 Self::StartFromAppEngineVersion => {
3683 std::option::Option::Some("START_FROM_APP_ENGINE_VERSION")
3684 }
3685 Self::StartFromCloudRunRevision => {
3686 std::option::Option::Some("START_FROM_CLOUD_RUN_REVISION")
3687 }
3688 Self::StartFromStorageBucket => {
3689 std::option::Option::Some("START_FROM_STORAGE_BUCKET")
3690 }
3691 Self::StartFromPscPublishedService => {
3692 std::option::Option::Some("START_FROM_PSC_PUBLISHED_SERVICE")
3693 }
3694 Self::StartFromServerlessNeg => {
3695 std::option::Option::Some("START_FROM_SERVERLESS_NEG")
3696 }
3697 Self::ApplyIngressFirewallRule => {
3698 std::option::Option::Some("APPLY_INGRESS_FIREWALL_RULE")
3699 }
3700 Self::ApplyEgressFirewallRule => {
3701 std::option::Option::Some("APPLY_EGRESS_FIREWALL_RULE")
3702 }
3703 Self::ApplyRoute => std::option::Option::Some("APPLY_ROUTE"),
3704 Self::ApplyForwardingRule => std::option::Option::Some("APPLY_FORWARDING_RULE"),
3705 Self::AnalyzeLoadBalancerBackend => {
3706 std::option::Option::Some("ANALYZE_LOAD_BALANCER_BACKEND")
3707 }
3708 Self::SpoofingApproved => std::option::Option::Some("SPOOFING_APPROVED"),
3709 Self::ArriveAtInstance => std::option::Option::Some("ARRIVE_AT_INSTANCE"),
3710 Self::ArriveAtInternalLoadBalancer => {
3711 std::option::Option::Some("ARRIVE_AT_INTERNAL_LOAD_BALANCER")
3712 }
3713 Self::ArriveAtExternalLoadBalancer => {
3714 std::option::Option::Some("ARRIVE_AT_EXTERNAL_LOAD_BALANCER")
3715 }
3716 Self::ArriveAtHybridSubnet => std::option::Option::Some("ARRIVE_AT_HYBRID_SUBNET"),
3717 Self::ArriveAtVpnGateway => std::option::Option::Some("ARRIVE_AT_VPN_GATEWAY"),
3718 Self::ArriveAtVpnTunnel => std::option::Option::Some("ARRIVE_AT_VPN_TUNNEL"),
3719 Self::ArriveAtInterconnectAttachment => {
3720 std::option::Option::Some("ARRIVE_AT_INTERCONNECT_ATTACHMENT")
3721 }
3722 Self::ArriveAtVpcConnector => std::option::Option::Some("ARRIVE_AT_VPC_CONNECTOR"),
3723 Self::DirectVpcEgressConnection => {
3724 std::option::Option::Some("DIRECT_VPC_EGRESS_CONNECTION")
3725 }
3726 Self::ServerlessExternalConnection => {
3727 std::option::Option::Some("SERVERLESS_EXTERNAL_CONNECTION")
3728 }
3729 Self::Nat => std::option::Option::Some("NAT"),
3730 Self::ProxyConnection => std::option::Option::Some("PROXY_CONNECTION"),
3731 Self::Deliver => std::option::Option::Some("DELIVER"),
3732 Self::Drop => std::option::Option::Some("DROP"),
3733 Self::Forward => std::option::Option::Some("FORWARD"),
3734 Self::Abort => std::option::Option::Some("ABORT"),
3735 Self::ViewerPermissionMissing => {
3736 std::option::Option::Some("VIEWER_PERMISSION_MISSING")
3737 }
3738 Self::UnknownValue(u) => u.0.name(),
3739 }
3740 }
3741 }
3742
3743 impl std::default::Default for State {
3744 fn default() -> Self {
3745 use std::convert::From;
3746 Self::from(0)
3747 }
3748 }
3749
3750 impl std::fmt::Display for State {
3751 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3752 wkt::internal::display_enum(f, self.name(), self.value())
3753 }
3754 }
3755
3756 impl std::convert::From<i32> for State {
3757 fn from(value: i32) -> Self {
3758 match value {
3759 0 => Self::Unspecified,
3760 1 => Self::StartFromInstance,
3761 2 => Self::StartFromInternet,
3762 3 => Self::StartFromPrivateNetwork,
3763 4 => Self::ApplyIngressFirewallRule,
3764 5 => Self::ApplyEgressFirewallRule,
3765 6 => Self::ApplyRoute,
3766 7 => Self::ApplyForwardingRule,
3767 8 => Self::SpoofingApproved,
3768 9 => Self::ArriveAtInstance,
3769 10 => Self::ArriveAtInternalLoadBalancer,
3770 11 => Self::ArriveAtExternalLoadBalancer,
3771 12 => Self::ArriveAtVpnGateway,
3772 13 => Self::ArriveAtVpnTunnel,
3773 14 => Self::Nat,
3774 15 => Self::ProxyConnection,
3775 16 => Self::Deliver,
3776 17 => Self::Drop,
3777 18 => Self::Forward,
3778 19 => Self::Abort,
3779 20 => Self::ViewerPermissionMissing,
3780 21 => Self::StartFromGkeMaster,
3781 22 => Self::StartFromCloudSqlInstance,
3782 23 => Self::StartFromCloudFunction,
3783 24 => Self::ArriveAtVpcConnector,
3784 25 => Self::StartFromAppEngineVersion,
3785 26 => Self::StartFromCloudRunRevision,
3786 27 => Self::StartFromGoogleService,
3787 28 => Self::AnalyzeLoadBalancerBackend,
3788 29 => Self::StartFromStorageBucket,
3789 30 => Self::StartFromPscPublishedService,
3790 31 => Self::StartFromServerlessNeg,
3791 32 => Self::StartFromRedisInstance,
3792 33 => Self::StartFromRedisCluster,
3793 35 => Self::DirectVpcEgressConnection,
3794 36 => Self::ServerlessExternalConnection,
3795 37 => Self::ArriveAtInterconnectAttachment,
3796 38 => Self::ArriveAtHybridSubnet,
3797 _ => Self::UnknownValue(state::UnknownValue(
3798 wkt::internal::UnknownEnumValue::Integer(value),
3799 )),
3800 }
3801 }
3802 }
3803
3804 impl std::convert::From<&str> for State {
3805 fn from(value: &str) -> Self {
3806 use std::string::ToString;
3807 match value {
3808 "STATE_UNSPECIFIED" => Self::Unspecified,
3809 "START_FROM_INSTANCE" => Self::StartFromInstance,
3810 "START_FROM_INTERNET" => Self::StartFromInternet,
3811 "START_FROM_GOOGLE_SERVICE" => Self::StartFromGoogleService,
3812 "START_FROM_PRIVATE_NETWORK" => Self::StartFromPrivateNetwork,
3813 "START_FROM_GKE_MASTER" => Self::StartFromGkeMaster,
3814 "START_FROM_CLOUD_SQL_INSTANCE" => Self::StartFromCloudSqlInstance,
3815 "START_FROM_REDIS_INSTANCE" => Self::StartFromRedisInstance,
3816 "START_FROM_REDIS_CLUSTER" => Self::StartFromRedisCluster,
3817 "START_FROM_CLOUD_FUNCTION" => Self::StartFromCloudFunction,
3818 "START_FROM_APP_ENGINE_VERSION" => Self::StartFromAppEngineVersion,
3819 "START_FROM_CLOUD_RUN_REVISION" => Self::StartFromCloudRunRevision,
3820 "START_FROM_STORAGE_BUCKET" => Self::StartFromStorageBucket,
3821 "START_FROM_PSC_PUBLISHED_SERVICE" => Self::StartFromPscPublishedService,
3822 "START_FROM_SERVERLESS_NEG" => Self::StartFromServerlessNeg,
3823 "APPLY_INGRESS_FIREWALL_RULE" => Self::ApplyIngressFirewallRule,
3824 "APPLY_EGRESS_FIREWALL_RULE" => Self::ApplyEgressFirewallRule,
3825 "APPLY_ROUTE" => Self::ApplyRoute,
3826 "APPLY_FORWARDING_RULE" => Self::ApplyForwardingRule,
3827 "ANALYZE_LOAD_BALANCER_BACKEND" => Self::AnalyzeLoadBalancerBackend,
3828 "SPOOFING_APPROVED" => Self::SpoofingApproved,
3829 "ARRIVE_AT_INSTANCE" => Self::ArriveAtInstance,
3830 "ARRIVE_AT_INTERNAL_LOAD_BALANCER" => Self::ArriveAtInternalLoadBalancer,
3831 "ARRIVE_AT_EXTERNAL_LOAD_BALANCER" => Self::ArriveAtExternalLoadBalancer,
3832 "ARRIVE_AT_HYBRID_SUBNET" => Self::ArriveAtHybridSubnet,
3833 "ARRIVE_AT_VPN_GATEWAY" => Self::ArriveAtVpnGateway,
3834 "ARRIVE_AT_VPN_TUNNEL" => Self::ArriveAtVpnTunnel,
3835 "ARRIVE_AT_INTERCONNECT_ATTACHMENT" => Self::ArriveAtInterconnectAttachment,
3836 "ARRIVE_AT_VPC_CONNECTOR" => Self::ArriveAtVpcConnector,
3837 "DIRECT_VPC_EGRESS_CONNECTION" => Self::DirectVpcEgressConnection,
3838 "SERVERLESS_EXTERNAL_CONNECTION" => Self::ServerlessExternalConnection,
3839 "NAT" => Self::Nat,
3840 "PROXY_CONNECTION" => Self::ProxyConnection,
3841 "DELIVER" => Self::Deliver,
3842 "DROP" => Self::Drop,
3843 "FORWARD" => Self::Forward,
3844 "ABORT" => Self::Abort,
3845 "VIEWER_PERMISSION_MISSING" => Self::ViewerPermissionMissing,
3846 _ => Self::UnknownValue(state::UnknownValue(
3847 wkt::internal::UnknownEnumValue::String(value.to_string()),
3848 )),
3849 }
3850 }
3851 }
3852
3853 impl serde::ser::Serialize for State {
3854 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3855 where
3856 S: serde::Serializer,
3857 {
3858 match self {
3859 Self::Unspecified => serializer.serialize_i32(0),
3860 Self::StartFromInstance => serializer.serialize_i32(1),
3861 Self::StartFromInternet => serializer.serialize_i32(2),
3862 Self::StartFromGoogleService => serializer.serialize_i32(27),
3863 Self::StartFromPrivateNetwork => serializer.serialize_i32(3),
3864 Self::StartFromGkeMaster => serializer.serialize_i32(21),
3865 Self::StartFromCloudSqlInstance => serializer.serialize_i32(22),
3866 Self::StartFromRedisInstance => serializer.serialize_i32(32),
3867 Self::StartFromRedisCluster => serializer.serialize_i32(33),
3868 Self::StartFromCloudFunction => serializer.serialize_i32(23),
3869 Self::StartFromAppEngineVersion => serializer.serialize_i32(25),
3870 Self::StartFromCloudRunRevision => serializer.serialize_i32(26),
3871 Self::StartFromStorageBucket => serializer.serialize_i32(29),
3872 Self::StartFromPscPublishedService => serializer.serialize_i32(30),
3873 Self::StartFromServerlessNeg => serializer.serialize_i32(31),
3874 Self::ApplyIngressFirewallRule => serializer.serialize_i32(4),
3875 Self::ApplyEgressFirewallRule => serializer.serialize_i32(5),
3876 Self::ApplyRoute => serializer.serialize_i32(6),
3877 Self::ApplyForwardingRule => serializer.serialize_i32(7),
3878 Self::AnalyzeLoadBalancerBackend => serializer.serialize_i32(28),
3879 Self::SpoofingApproved => serializer.serialize_i32(8),
3880 Self::ArriveAtInstance => serializer.serialize_i32(9),
3881 Self::ArriveAtInternalLoadBalancer => serializer.serialize_i32(10),
3882 Self::ArriveAtExternalLoadBalancer => serializer.serialize_i32(11),
3883 Self::ArriveAtHybridSubnet => serializer.serialize_i32(38),
3884 Self::ArriveAtVpnGateway => serializer.serialize_i32(12),
3885 Self::ArriveAtVpnTunnel => serializer.serialize_i32(13),
3886 Self::ArriveAtInterconnectAttachment => serializer.serialize_i32(37),
3887 Self::ArriveAtVpcConnector => serializer.serialize_i32(24),
3888 Self::DirectVpcEgressConnection => serializer.serialize_i32(35),
3889 Self::ServerlessExternalConnection => serializer.serialize_i32(36),
3890 Self::Nat => serializer.serialize_i32(14),
3891 Self::ProxyConnection => serializer.serialize_i32(15),
3892 Self::Deliver => serializer.serialize_i32(16),
3893 Self::Drop => serializer.serialize_i32(17),
3894 Self::Forward => serializer.serialize_i32(18),
3895 Self::Abort => serializer.serialize_i32(19),
3896 Self::ViewerPermissionMissing => serializer.serialize_i32(20),
3897 Self::UnknownValue(u) => u.0.serialize(serializer),
3898 }
3899 }
3900 }
3901
3902 impl<'de> serde::de::Deserialize<'de> for State {
3903 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3904 where
3905 D: serde::Deserializer<'de>,
3906 {
3907 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3908 ".google.cloud.networkmanagement.v1.Step.State",
3909 ))
3910 }
3911 }
3912
3913 #[derive(Clone, Debug, PartialEq)]
3919 #[non_exhaustive]
3920 pub enum StepInfo {
3921 Instance(std::boxed::Box<crate::model::InstanceInfo>),
3923 Firewall(std::boxed::Box<crate::model::FirewallInfo>),
3925 Route(std::boxed::Box<crate::model::RouteInfo>),
3927 Endpoint(std::boxed::Box<crate::model::EndpointInfo>),
3932 GoogleService(std::boxed::Box<crate::model::GoogleServiceInfo>),
3934 ForwardingRule(std::boxed::Box<crate::model::ForwardingRuleInfo>),
3936 HybridSubnet(std::boxed::Box<crate::model::HybridSubnetInfo>),
3938 VpnGateway(std::boxed::Box<crate::model::VpnGatewayInfo>),
3940 VpnTunnel(std::boxed::Box<crate::model::VpnTunnelInfo>),
3942 InterconnectAttachment(std::boxed::Box<crate::model::InterconnectAttachmentInfo>),
3944 VpcConnector(std::boxed::Box<crate::model::VpcConnectorInfo>),
3946 DirectVpcEgressConnection(std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>),
3948 ServerlessExternalConnection(
3950 std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>,
3951 ),
3952 Deliver(std::boxed::Box<crate::model::DeliverInfo>),
3954 Forward(std::boxed::Box<crate::model::ForwardInfo>),
3956 Abort(std::boxed::Box<crate::model::AbortInfo>),
3958 Drop(std::boxed::Box<crate::model::DropInfo>),
3960 #[deprecated]
3963 LoadBalancer(std::boxed::Box<crate::model::LoadBalancerInfo>),
3964 Network(std::boxed::Box<crate::model::NetworkInfo>),
3966 GkeMaster(std::boxed::Box<crate::model::GKEMasterInfo>),
3968 CloudSqlInstance(std::boxed::Box<crate::model::CloudSQLInstanceInfo>),
3970 RedisInstance(std::boxed::Box<crate::model::RedisInstanceInfo>),
3972 RedisCluster(std::boxed::Box<crate::model::RedisClusterInfo>),
3974 CloudFunction(std::boxed::Box<crate::model::CloudFunctionInfo>),
3976 AppEngineVersion(std::boxed::Box<crate::model::AppEngineVersionInfo>),
3978 CloudRunRevision(std::boxed::Box<crate::model::CloudRunRevisionInfo>),
3980 Nat(std::boxed::Box<crate::model::NatInfo>),
3982 ProxyConnection(std::boxed::Box<crate::model::ProxyConnectionInfo>),
3984 LoadBalancerBackendInfo(std::boxed::Box<crate::model::LoadBalancerBackendInfo>),
3986 StorageBucket(std::boxed::Box<crate::model::StorageBucketInfo>),
3988 ServerlessNeg(std::boxed::Box<crate::model::ServerlessNegInfo>),
3991 }
3992}
3993
3994#[derive(Clone, Default, PartialEq)]
3996#[non_exhaustive]
3997pub struct InstanceInfo {
3998 pub display_name: std::string::String,
4000
4001 pub uri: std::string::String,
4003
4004 pub interface: std::string::String,
4006
4007 pub network_uri: std::string::String,
4009
4010 pub internal_ip: std::string::String,
4012
4013 pub external_ip: std::string::String,
4015
4016 pub network_tags: std::vec::Vec<std::string::String>,
4018
4019 #[deprecated]
4021 pub service_account: std::string::String,
4022
4023 pub psc_network_attachment_uri: std::string::String,
4025
4026 #[deprecated]
4029 pub running: bool,
4030
4031 pub status: crate::model::instance_info::Status,
4033
4034 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4035}
4036
4037impl InstanceInfo {
4038 pub fn new() -> Self {
4039 std::default::Default::default()
4040 }
4041
4042 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4044 self.display_name = v.into();
4045 self
4046 }
4047
4048 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4050 self.uri = v.into();
4051 self
4052 }
4053
4054 pub fn set_interface<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4056 self.interface = v.into();
4057 self
4058 }
4059
4060 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4062 self.network_uri = v.into();
4063 self
4064 }
4065
4066 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4068 self.internal_ip = v.into();
4069 self
4070 }
4071
4072 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4074 self.external_ip = v.into();
4075 self
4076 }
4077
4078 pub fn set_network_tags<T, V>(mut self, v: T) -> Self
4080 where
4081 T: std::iter::IntoIterator<Item = V>,
4082 V: std::convert::Into<std::string::String>,
4083 {
4084 use std::iter::Iterator;
4085 self.network_tags = v.into_iter().map(|i| i.into()).collect();
4086 self
4087 }
4088
4089 #[deprecated]
4091 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4092 self.service_account = v.into();
4093 self
4094 }
4095
4096 pub fn set_psc_network_attachment_uri<T: std::convert::Into<std::string::String>>(
4098 mut self,
4099 v: T,
4100 ) -> Self {
4101 self.psc_network_attachment_uri = v.into();
4102 self
4103 }
4104
4105 #[deprecated]
4107 pub fn set_running<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4108 self.running = v.into();
4109 self
4110 }
4111
4112 pub fn set_status<T: std::convert::Into<crate::model::instance_info::Status>>(
4114 mut self,
4115 v: T,
4116 ) -> Self {
4117 self.status = v.into();
4118 self
4119 }
4120}
4121
4122impl wkt::message::Message for InstanceInfo {
4123 fn typename() -> &'static str {
4124 "type.googleapis.com/google.cloud.networkmanagement.v1.InstanceInfo"
4125 }
4126}
4127
4128pub mod instance_info {
4130 #[allow(unused_imports)]
4131 use super::*;
4132
4133 #[derive(Clone, Debug, PartialEq)]
4150 #[non_exhaustive]
4151 pub enum Status {
4152 Unspecified,
4154 Running,
4156 NotRunning,
4158 UnknownValue(status::UnknownValue),
4163 }
4164
4165 #[doc(hidden)]
4166 pub mod status {
4167 #[allow(unused_imports)]
4168 use super::*;
4169 #[derive(Clone, Debug, PartialEq)]
4170 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4171 }
4172
4173 impl Status {
4174 pub fn value(&self) -> std::option::Option<i32> {
4179 match self {
4180 Self::Unspecified => std::option::Option::Some(0),
4181 Self::Running => std::option::Option::Some(1),
4182 Self::NotRunning => std::option::Option::Some(2),
4183 Self::UnknownValue(u) => u.0.value(),
4184 }
4185 }
4186
4187 pub fn name(&self) -> std::option::Option<&str> {
4192 match self {
4193 Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
4194 Self::Running => std::option::Option::Some("RUNNING"),
4195 Self::NotRunning => std::option::Option::Some("NOT_RUNNING"),
4196 Self::UnknownValue(u) => u.0.name(),
4197 }
4198 }
4199 }
4200
4201 impl std::default::Default for Status {
4202 fn default() -> Self {
4203 use std::convert::From;
4204 Self::from(0)
4205 }
4206 }
4207
4208 impl std::fmt::Display for Status {
4209 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4210 wkt::internal::display_enum(f, self.name(), self.value())
4211 }
4212 }
4213
4214 impl std::convert::From<i32> for Status {
4215 fn from(value: i32) -> Self {
4216 match value {
4217 0 => Self::Unspecified,
4218 1 => Self::Running,
4219 2 => Self::NotRunning,
4220 _ => Self::UnknownValue(status::UnknownValue(
4221 wkt::internal::UnknownEnumValue::Integer(value),
4222 )),
4223 }
4224 }
4225 }
4226
4227 impl std::convert::From<&str> for Status {
4228 fn from(value: &str) -> Self {
4229 use std::string::ToString;
4230 match value {
4231 "STATUS_UNSPECIFIED" => Self::Unspecified,
4232 "RUNNING" => Self::Running,
4233 "NOT_RUNNING" => Self::NotRunning,
4234 _ => Self::UnknownValue(status::UnknownValue(
4235 wkt::internal::UnknownEnumValue::String(value.to_string()),
4236 )),
4237 }
4238 }
4239 }
4240
4241 impl serde::ser::Serialize for Status {
4242 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4243 where
4244 S: serde::Serializer,
4245 {
4246 match self {
4247 Self::Unspecified => serializer.serialize_i32(0),
4248 Self::Running => serializer.serialize_i32(1),
4249 Self::NotRunning => serializer.serialize_i32(2),
4250 Self::UnknownValue(u) => u.0.serialize(serializer),
4251 }
4252 }
4253 }
4254
4255 impl<'de> serde::de::Deserialize<'de> for Status {
4256 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4257 where
4258 D: serde::Deserializer<'de>,
4259 {
4260 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
4261 ".google.cloud.networkmanagement.v1.InstanceInfo.Status",
4262 ))
4263 }
4264 }
4265}
4266
4267#[derive(Clone, Default, PartialEq)]
4269#[non_exhaustive]
4270pub struct NetworkInfo {
4271 pub display_name: std::string::String,
4273
4274 pub uri: std::string::String,
4276
4277 pub matched_subnet_uri: std::string::String,
4279
4280 pub matched_ip_range: std::string::String,
4282
4283 pub region: std::string::String,
4285
4286 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4287}
4288
4289impl NetworkInfo {
4290 pub fn new() -> Self {
4291 std::default::Default::default()
4292 }
4293
4294 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4296 self.display_name = v.into();
4297 self
4298 }
4299
4300 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4302 self.uri = v.into();
4303 self
4304 }
4305
4306 pub fn set_matched_subnet_uri<T: std::convert::Into<std::string::String>>(
4308 mut self,
4309 v: T,
4310 ) -> Self {
4311 self.matched_subnet_uri = v.into();
4312 self
4313 }
4314
4315 pub fn set_matched_ip_range<T: std::convert::Into<std::string::String>>(
4317 mut self,
4318 v: T,
4319 ) -> Self {
4320 self.matched_ip_range = v.into();
4321 self
4322 }
4323
4324 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4326 self.region = v.into();
4327 self
4328 }
4329}
4330
4331impl wkt::message::Message for NetworkInfo {
4332 fn typename() -> &'static str {
4333 "type.googleapis.com/google.cloud.networkmanagement.v1.NetworkInfo"
4334 }
4335}
4336
4337#[derive(Clone, Default, PartialEq)]
4340#[non_exhaustive]
4341pub struct FirewallInfo {
4342 pub display_name: std::string::String,
4345
4346 pub uri: std::string::String,
4349
4350 pub direction: std::string::String,
4352
4353 pub action: std::string::String,
4355
4356 pub priority: i32,
4358
4359 pub network_uri: std::string::String,
4362
4363 pub target_tags: std::vec::Vec<std::string::String>,
4366
4367 pub target_service_accounts: std::vec::Vec<std::string::String>,
4369
4370 pub policy: std::string::String,
4374
4375 pub policy_uri: std::string::String,
4379
4380 pub firewall_rule_type: crate::model::firewall_info::FirewallRuleType,
4382
4383 pub policy_priority: i32,
4387
4388 pub target_type: crate::model::firewall_info::TargetType,
4390
4391 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4392}
4393
4394impl FirewallInfo {
4395 pub fn new() -> Self {
4396 std::default::Default::default()
4397 }
4398
4399 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4401 self.display_name = v.into();
4402 self
4403 }
4404
4405 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4407 self.uri = v.into();
4408 self
4409 }
4410
4411 pub fn set_direction<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4413 self.direction = v.into();
4414 self
4415 }
4416
4417 pub fn set_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4419 self.action = v.into();
4420 self
4421 }
4422
4423 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4425 self.priority = v.into();
4426 self
4427 }
4428
4429 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4431 self.network_uri = v.into();
4432 self
4433 }
4434
4435 pub fn set_target_tags<T, V>(mut self, v: T) -> Self
4437 where
4438 T: std::iter::IntoIterator<Item = V>,
4439 V: std::convert::Into<std::string::String>,
4440 {
4441 use std::iter::Iterator;
4442 self.target_tags = v.into_iter().map(|i| i.into()).collect();
4443 self
4444 }
4445
4446 pub fn set_target_service_accounts<T, V>(mut self, v: T) -> Self
4448 where
4449 T: std::iter::IntoIterator<Item = V>,
4450 V: std::convert::Into<std::string::String>,
4451 {
4452 use std::iter::Iterator;
4453 self.target_service_accounts = v.into_iter().map(|i| i.into()).collect();
4454 self
4455 }
4456
4457 pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4459 self.policy = v.into();
4460 self
4461 }
4462
4463 pub fn set_policy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4465 self.policy_uri = v.into();
4466 self
4467 }
4468
4469 pub fn set_firewall_rule_type<
4471 T: std::convert::Into<crate::model::firewall_info::FirewallRuleType>,
4472 >(
4473 mut self,
4474 v: T,
4475 ) -> Self {
4476 self.firewall_rule_type = v.into();
4477 self
4478 }
4479
4480 pub fn set_policy_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4482 self.policy_priority = v.into();
4483 self
4484 }
4485
4486 pub fn set_target_type<T: std::convert::Into<crate::model::firewall_info::TargetType>>(
4488 mut self,
4489 v: T,
4490 ) -> Self {
4491 self.target_type = v.into();
4492 self
4493 }
4494}
4495
4496impl wkt::message::Message for FirewallInfo {
4497 fn typename() -> &'static str {
4498 "type.googleapis.com/google.cloud.networkmanagement.v1.FirewallInfo"
4499 }
4500}
4501
4502pub mod firewall_info {
4504 #[allow(unused_imports)]
4505 use super::*;
4506
4507 #[derive(Clone, Debug, PartialEq)]
4523 #[non_exhaustive]
4524 pub enum FirewallRuleType {
4525 Unspecified,
4527 HierarchicalFirewallPolicyRule,
4531 VpcFirewallRule,
4535 ImpliedVpcFirewallRule,
4539 ServerlessVpcAccessManagedFirewallRule,
4544 NetworkFirewallPolicyRule,
4548 NetworkRegionalFirewallPolicyRule,
4552 UnsupportedFirewallPolicyRule,
4557 TrackingState,
4562 AnalysisSkipped,
4565 UnknownValue(firewall_rule_type::UnknownValue),
4570 }
4571
4572 #[doc(hidden)]
4573 pub mod firewall_rule_type {
4574 #[allow(unused_imports)]
4575 use super::*;
4576 #[derive(Clone, Debug, PartialEq)]
4577 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4578 }
4579
4580 impl FirewallRuleType {
4581 pub fn value(&self) -> std::option::Option<i32> {
4586 match self {
4587 Self::Unspecified => std::option::Option::Some(0),
4588 Self::HierarchicalFirewallPolicyRule => std::option::Option::Some(1),
4589 Self::VpcFirewallRule => std::option::Option::Some(2),
4590 Self::ImpliedVpcFirewallRule => std::option::Option::Some(3),
4591 Self::ServerlessVpcAccessManagedFirewallRule => std::option::Option::Some(4),
4592 Self::NetworkFirewallPolicyRule => std::option::Option::Some(5),
4593 Self::NetworkRegionalFirewallPolicyRule => std::option::Option::Some(6),
4594 Self::UnsupportedFirewallPolicyRule => std::option::Option::Some(100),
4595 Self::TrackingState => std::option::Option::Some(101),
4596 Self::AnalysisSkipped => std::option::Option::Some(102),
4597 Self::UnknownValue(u) => u.0.value(),
4598 }
4599 }
4600
4601 pub fn name(&self) -> std::option::Option<&str> {
4606 match self {
4607 Self::Unspecified => std::option::Option::Some("FIREWALL_RULE_TYPE_UNSPECIFIED"),
4608 Self::HierarchicalFirewallPolicyRule => {
4609 std::option::Option::Some("HIERARCHICAL_FIREWALL_POLICY_RULE")
4610 }
4611 Self::VpcFirewallRule => std::option::Option::Some("VPC_FIREWALL_RULE"),
4612 Self::ImpliedVpcFirewallRule => {
4613 std::option::Option::Some("IMPLIED_VPC_FIREWALL_RULE")
4614 }
4615 Self::ServerlessVpcAccessManagedFirewallRule => {
4616 std::option::Option::Some("SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE")
4617 }
4618 Self::NetworkFirewallPolicyRule => {
4619 std::option::Option::Some("NETWORK_FIREWALL_POLICY_RULE")
4620 }
4621 Self::NetworkRegionalFirewallPolicyRule => {
4622 std::option::Option::Some("NETWORK_REGIONAL_FIREWALL_POLICY_RULE")
4623 }
4624 Self::UnsupportedFirewallPolicyRule => {
4625 std::option::Option::Some("UNSUPPORTED_FIREWALL_POLICY_RULE")
4626 }
4627 Self::TrackingState => std::option::Option::Some("TRACKING_STATE"),
4628 Self::AnalysisSkipped => std::option::Option::Some("ANALYSIS_SKIPPED"),
4629 Self::UnknownValue(u) => u.0.name(),
4630 }
4631 }
4632 }
4633
4634 impl std::default::Default for FirewallRuleType {
4635 fn default() -> Self {
4636 use std::convert::From;
4637 Self::from(0)
4638 }
4639 }
4640
4641 impl std::fmt::Display for FirewallRuleType {
4642 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4643 wkt::internal::display_enum(f, self.name(), self.value())
4644 }
4645 }
4646
4647 impl std::convert::From<i32> for FirewallRuleType {
4648 fn from(value: i32) -> Self {
4649 match value {
4650 0 => Self::Unspecified,
4651 1 => Self::HierarchicalFirewallPolicyRule,
4652 2 => Self::VpcFirewallRule,
4653 3 => Self::ImpliedVpcFirewallRule,
4654 4 => Self::ServerlessVpcAccessManagedFirewallRule,
4655 5 => Self::NetworkFirewallPolicyRule,
4656 6 => Self::NetworkRegionalFirewallPolicyRule,
4657 100 => Self::UnsupportedFirewallPolicyRule,
4658 101 => Self::TrackingState,
4659 102 => Self::AnalysisSkipped,
4660 _ => Self::UnknownValue(firewall_rule_type::UnknownValue(
4661 wkt::internal::UnknownEnumValue::Integer(value),
4662 )),
4663 }
4664 }
4665 }
4666
4667 impl std::convert::From<&str> for FirewallRuleType {
4668 fn from(value: &str) -> Self {
4669 use std::string::ToString;
4670 match value {
4671 "FIREWALL_RULE_TYPE_UNSPECIFIED" => Self::Unspecified,
4672 "HIERARCHICAL_FIREWALL_POLICY_RULE" => Self::HierarchicalFirewallPolicyRule,
4673 "VPC_FIREWALL_RULE" => Self::VpcFirewallRule,
4674 "IMPLIED_VPC_FIREWALL_RULE" => Self::ImpliedVpcFirewallRule,
4675 "SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE" => {
4676 Self::ServerlessVpcAccessManagedFirewallRule
4677 }
4678 "NETWORK_FIREWALL_POLICY_RULE" => Self::NetworkFirewallPolicyRule,
4679 "NETWORK_REGIONAL_FIREWALL_POLICY_RULE" => Self::NetworkRegionalFirewallPolicyRule,
4680 "UNSUPPORTED_FIREWALL_POLICY_RULE" => Self::UnsupportedFirewallPolicyRule,
4681 "TRACKING_STATE" => Self::TrackingState,
4682 "ANALYSIS_SKIPPED" => Self::AnalysisSkipped,
4683 _ => Self::UnknownValue(firewall_rule_type::UnknownValue(
4684 wkt::internal::UnknownEnumValue::String(value.to_string()),
4685 )),
4686 }
4687 }
4688 }
4689
4690 impl serde::ser::Serialize for FirewallRuleType {
4691 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4692 where
4693 S: serde::Serializer,
4694 {
4695 match self {
4696 Self::Unspecified => serializer.serialize_i32(0),
4697 Self::HierarchicalFirewallPolicyRule => serializer.serialize_i32(1),
4698 Self::VpcFirewallRule => serializer.serialize_i32(2),
4699 Self::ImpliedVpcFirewallRule => serializer.serialize_i32(3),
4700 Self::ServerlessVpcAccessManagedFirewallRule => serializer.serialize_i32(4),
4701 Self::NetworkFirewallPolicyRule => serializer.serialize_i32(5),
4702 Self::NetworkRegionalFirewallPolicyRule => serializer.serialize_i32(6),
4703 Self::UnsupportedFirewallPolicyRule => serializer.serialize_i32(100),
4704 Self::TrackingState => serializer.serialize_i32(101),
4705 Self::AnalysisSkipped => serializer.serialize_i32(102),
4706 Self::UnknownValue(u) => u.0.serialize(serializer),
4707 }
4708 }
4709 }
4710
4711 impl<'de> serde::de::Deserialize<'de> for FirewallRuleType {
4712 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4713 where
4714 D: serde::Deserializer<'de>,
4715 {
4716 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FirewallRuleType>::new(
4717 ".google.cloud.networkmanagement.v1.FirewallInfo.FirewallRuleType",
4718 ))
4719 }
4720 }
4721
4722 #[derive(Clone, Debug, PartialEq)]
4738 #[non_exhaustive]
4739 pub enum TargetType {
4740 Unspecified,
4743 Instances,
4745 InternalManagedLb,
4747 UnknownValue(target_type::UnknownValue),
4752 }
4753
4754 #[doc(hidden)]
4755 pub mod target_type {
4756 #[allow(unused_imports)]
4757 use super::*;
4758 #[derive(Clone, Debug, PartialEq)]
4759 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4760 }
4761
4762 impl TargetType {
4763 pub fn value(&self) -> std::option::Option<i32> {
4768 match self {
4769 Self::Unspecified => std::option::Option::Some(0),
4770 Self::Instances => std::option::Option::Some(1),
4771 Self::InternalManagedLb => std::option::Option::Some(2),
4772 Self::UnknownValue(u) => u.0.value(),
4773 }
4774 }
4775
4776 pub fn name(&self) -> std::option::Option<&str> {
4781 match self {
4782 Self::Unspecified => std::option::Option::Some("TARGET_TYPE_UNSPECIFIED"),
4783 Self::Instances => std::option::Option::Some("INSTANCES"),
4784 Self::InternalManagedLb => std::option::Option::Some("INTERNAL_MANAGED_LB"),
4785 Self::UnknownValue(u) => u.0.name(),
4786 }
4787 }
4788 }
4789
4790 impl std::default::Default for TargetType {
4791 fn default() -> Self {
4792 use std::convert::From;
4793 Self::from(0)
4794 }
4795 }
4796
4797 impl std::fmt::Display for TargetType {
4798 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4799 wkt::internal::display_enum(f, self.name(), self.value())
4800 }
4801 }
4802
4803 impl std::convert::From<i32> for TargetType {
4804 fn from(value: i32) -> Self {
4805 match value {
4806 0 => Self::Unspecified,
4807 1 => Self::Instances,
4808 2 => Self::InternalManagedLb,
4809 _ => Self::UnknownValue(target_type::UnknownValue(
4810 wkt::internal::UnknownEnumValue::Integer(value),
4811 )),
4812 }
4813 }
4814 }
4815
4816 impl std::convert::From<&str> for TargetType {
4817 fn from(value: &str) -> Self {
4818 use std::string::ToString;
4819 match value {
4820 "TARGET_TYPE_UNSPECIFIED" => Self::Unspecified,
4821 "INSTANCES" => Self::Instances,
4822 "INTERNAL_MANAGED_LB" => Self::InternalManagedLb,
4823 _ => Self::UnknownValue(target_type::UnknownValue(
4824 wkt::internal::UnknownEnumValue::String(value.to_string()),
4825 )),
4826 }
4827 }
4828 }
4829
4830 impl serde::ser::Serialize for TargetType {
4831 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4832 where
4833 S: serde::Serializer,
4834 {
4835 match self {
4836 Self::Unspecified => serializer.serialize_i32(0),
4837 Self::Instances => serializer.serialize_i32(1),
4838 Self::InternalManagedLb => serializer.serialize_i32(2),
4839 Self::UnknownValue(u) => u.0.serialize(serializer),
4840 }
4841 }
4842 }
4843
4844 impl<'de> serde::de::Deserialize<'de> for TargetType {
4845 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4846 where
4847 D: serde::Deserializer<'de>,
4848 {
4849 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetType>::new(
4850 ".google.cloud.networkmanagement.v1.FirewallInfo.TargetType",
4851 ))
4852 }
4853 }
4854}
4855
4856#[derive(Clone, Default, PartialEq)]
4858#[non_exhaustive]
4859pub struct RouteInfo {
4860 pub route_type: crate::model::route_info::RouteType,
4862
4863 pub next_hop_type: crate::model::route_info::NextHopType,
4865
4866 #[deprecated]
4869 pub route_scope: crate::model::route_info::RouteScope,
4870
4871 pub display_name: std::string::String,
4873
4874 pub uri: std::string::String,
4877
4878 pub region: std::string::String,
4882
4883 pub dest_ip_range: std::string::String,
4885
4886 #[deprecated]
4890 pub next_hop: std::string::String,
4891
4892 pub network_uri: std::string::String,
4894
4895 pub priority: i32,
4897
4898 pub instance_tags: std::vec::Vec<std::string::String>,
4900
4901 pub src_ip_range: std::string::String,
4903
4904 pub dest_port_ranges: std::vec::Vec<std::string::String>,
4906
4907 pub src_port_ranges: std::vec::Vec<std::string::String>,
4909
4910 pub protocols: std::vec::Vec<std::string::String>,
4912
4913 pub ncc_hub_uri: std::option::Option<std::string::String>,
4916
4917 pub ncc_spoke_uri: std::option::Option<std::string::String>,
4920
4921 pub advertised_route_source_router_uri: std::option::Option<std::string::String>,
4924
4925 #[deprecated]
4931 pub advertised_route_next_hop_uri: std::option::Option<std::string::String>,
4932
4933 pub next_hop_uri: std::string::String,
4935
4936 pub next_hop_network_uri: std::string::String,
4938
4939 pub originating_route_uri: std::string::String,
4942
4943 pub originating_route_display_name: std::string::String,
4946
4947 pub ncc_hub_route_uri: std::string::String,
4950
4951 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4952}
4953
4954impl RouteInfo {
4955 pub fn new() -> Self {
4956 std::default::Default::default()
4957 }
4958
4959 pub fn set_route_type<T: std::convert::Into<crate::model::route_info::RouteType>>(
4961 mut self,
4962 v: T,
4963 ) -> Self {
4964 self.route_type = v.into();
4965 self
4966 }
4967
4968 pub fn set_next_hop_type<T: std::convert::Into<crate::model::route_info::NextHopType>>(
4970 mut self,
4971 v: T,
4972 ) -> Self {
4973 self.next_hop_type = v.into();
4974 self
4975 }
4976
4977 #[deprecated]
4979 pub fn set_route_scope<T: std::convert::Into<crate::model::route_info::RouteScope>>(
4980 mut self,
4981 v: T,
4982 ) -> Self {
4983 self.route_scope = v.into();
4984 self
4985 }
4986
4987 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4989 self.display_name = v.into();
4990 self
4991 }
4992
4993 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4995 self.uri = v.into();
4996 self
4997 }
4998
4999 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5001 self.region = v.into();
5002 self
5003 }
5004
5005 pub fn set_dest_ip_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5007 self.dest_ip_range = v.into();
5008 self
5009 }
5010
5011 #[deprecated]
5013 pub fn set_next_hop<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5014 self.next_hop = v.into();
5015 self
5016 }
5017
5018 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5020 self.network_uri = v.into();
5021 self
5022 }
5023
5024 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5026 self.priority = v.into();
5027 self
5028 }
5029
5030 pub fn set_instance_tags<T, V>(mut self, v: T) -> Self
5032 where
5033 T: std::iter::IntoIterator<Item = V>,
5034 V: std::convert::Into<std::string::String>,
5035 {
5036 use std::iter::Iterator;
5037 self.instance_tags = v.into_iter().map(|i| i.into()).collect();
5038 self
5039 }
5040
5041 pub fn set_src_ip_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5043 self.src_ip_range = v.into();
5044 self
5045 }
5046
5047 pub fn set_dest_port_ranges<T, V>(mut self, v: T) -> Self
5049 where
5050 T: std::iter::IntoIterator<Item = V>,
5051 V: std::convert::Into<std::string::String>,
5052 {
5053 use std::iter::Iterator;
5054 self.dest_port_ranges = v.into_iter().map(|i| i.into()).collect();
5055 self
5056 }
5057
5058 pub fn set_src_port_ranges<T, V>(mut self, v: T) -> Self
5060 where
5061 T: std::iter::IntoIterator<Item = V>,
5062 V: std::convert::Into<std::string::String>,
5063 {
5064 use std::iter::Iterator;
5065 self.src_port_ranges = v.into_iter().map(|i| i.into()).collect();
5066 self
5067 }
5068
5069 pub fn set_protocols<T, V>(mut self, v: T) -> Self
5071 where
5072 T: std::iter::IntoIterator<Item = V>,
5073 V: std::convert::Into<std::string::String>,
5074 {
5075 use std::iter::Iterator;
5076 self.protocols = v.into_iter().map(|i| i.into()).collect();
5077 self
5078 }
5079
5080 pub fn set_ncc_hub_uri<T>(mut self, v: T) -> Self
5082 where
5083 T: std::convert::Into<std::string::String>,
5084 {
5085 self.ncc_hub_uri = std::option::Option::Some(v.into());
5086 self
5087 }
5088
5089 pub fn set_or_clear_ncc_hub_uri<T>(mut self, v: std::option::Option<T>) -> Self
5091 where
5092 T: std::convert::Into<std::string::String>,
5093 {
5094 self.ncc_hub_uri = v.map(|x| x.into());
5095 self
5096 }
5097
5098 pub fn set_ncc_spoke_uri<T>(mut self, v: T) -> Self
5100 where
5101 T: std::convert::Into<std::string::String>,
5102 {
5103 self.ncc_spoke_uri = std::option::Option::Some(v.into());
5104 self
5105 }
5106
5107 pub fn set_or_clear_ncc_spoke_uri<T>(mut self, v: std::option::Option<T>) -> Self
5109 where
5110 T: std::convert::Into<std::string::String>,
5111 {
5112 self.ncc_spoke_uri = v.map(|x| x.into());
5113 self
5114 }
5115
5116 pub fn set_advertised_route_source_router_uri<T>(mut self, v: T) -> Self
5118 where
5119 T: std::convert::Into<std::string::String>,
5120 {
5121 self.advertised_route_source_router_uri = std::option::Option::Some(v.into());
5122 self
5123 }
5124
5125 pub fn set_or_clear_advertised_route_source_router_uri<T>(
5127 mut self,
5128 v: std::option::Option<T>,
5129 ) -> Self
5130 where
5131 T: std::convert::Into<std::string::String>,
5132 {
5133 self.advertised_route_source_router_uri = v.map(|x| x.into());
5134 self
5135 }
5136
5137 #[deprecated]
5139 pub fn set_advertised_route_next_hop_uri<T>(mut self, v: T) -> Self
5140 where
5141 T: std::convert::Into<std::string::String>,
5142 {
5143 self.advertised_route_next_hop_uri = std::option::Option::Some(v.into());
5144 self
5145 }
5146
5147 #[deprecated]
5149 pub fn set_or_clear_advertised_route_next_hop_uri<T>(
5150 mut self,
5151 v: std::option::Option<T>,
5152 ) -> Self
5153 where
5154 T: std::convert::Into<std::string::String>,
5155 {
5156 self.advertised_route_next_hop_uri = v.map(|x| x.into());
5157 self
5158 }
5159
5160 pub fn set_next_hop_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5162 self.next_hop_uri = v.into();
5163 self
5164 }
5165
5166 pub fn set_next_hop_network_uri<T: std::convert::Into<std::string::String>>(
5168 mut self,
5169 v: T,
5170 ) -> Self {
5171 self.next_hop_network_uri = v.into();
5172 self
5173 }
5174
5175 pub fn set_originating_route_uri<T: std::convert::Into<std::string::String>>(
5177 mut self,
5178 v: T,
5179 ) -> Self {
5180 self.originating_route_uri = v.into();
5181 self
5182 }
5183
5184 pub fn set_originating_route_display_name<T: std::convert::Into<std::string::String>>(
5186 mut self,
5187 v: T,
5188 ) -> Self {
5189 self.originating_route_display_name = v.into();
5190 self
5191 }
5192
5193 pub fn set_ncc_hub_route_uri<T: std::convert::Into<std::string::String>>(
5195 mut self,
5196 v: T,
5197 ) -> Self {
5198 self.ncc_hub_route_uri = v.into();
5199 self
5200 }
5201}
5202
5203impl wkt::message::Message for RouteInfo {
5204 fn typename() -> &'static str {
5205 "type.googleapis.com/google.cloud.networkmanagement.v1.RouteInfo"
5206 }
5207}
5208
5209pub mod route_info {
5211 #[allow(unused_imports)]
5212 use super::*;
5213
5214 #[derive(Clone, Debug, PartialEq)]
5230 #[non_exhaustive]
5231 pub enum RouteType {
5232 Unspecified,
5234 Subnet,
5236 Static,
5239 Dynamic,
5241 PeeringSubnet,
5243 PeeringStatic,
5245 PeeringDynamic,
5247 PolicyBased,
5249 Advertised,
5252 UnknownValue(route_type::UnknownValue),
5257 }
5258
5259 #[doc(hidden)]
5260 pub mod route_type {
5261 #[allow(unused_imports)]
5262 use super::*;
5263 #[derive(Clone, Debug, PartialEq)]
5264 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5265 }
5266
5267 impl RouteType {
5268 pub fn value(&self) -> std::option::Option<i32> {
5273 match self {
5274 Self::Unspecified => std::option::Option::Some(0),
5275 Self::Subnet => std::option::Option::Some(1),
5276 Self::Static => std::option::Option::Some(2),
5277 Self::Dynamic => std::option::Option::Some(3),
5278 Self::PeeringSubnet => std::option::Option::Some(4),
5279 Self::PeeringStatic => std::option::Option::Some(5),
5280 Self::PeeringDynamic => std::option::Option::Some(6),
5281 Self::PolicyBased => std::option::Option::Some(7),
5282 Self::Advertised => std::option::Option::Some(101),
5283 Self::UnknownValue(u) => u.0.value(),
5284 }
5285 }
5286
5287 pub fn name(&self) -> std::option::Option<&str> {
5292 match self {
5293 Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
5294 Self::Subnet => std::option::Option::Some("SUBNET"),
5295 Self::Static => std::option::Option::Some("STATIC"),
5296 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
5297 Self::PeeringSubnet => std::option::Option::Some("PEERING_SUBNET"),
5298 Self::PeeringStatic => std::option::Option::Some("PEERING_STATIC"),
5299 Self::PeeringDynamic => std::option::Option::Some("PEERING_DYNAMIC"),
5300 Self::PolicyBased => std::option::Option::Some("POLICY_BASED"),
5301 Self::Advertised => std::option::Option::Some("ADVERTISED"),
5302 Self::UnknownValue(u) => u.0.name(),
5303 }
5304 }
5305 }
5306
5307 impl std::default::Default for RouteType {
5308 fn default() -> Self {
5309 use std::convert::From;
5310 Self::from(0)
5311 }
5312 }
5313
5314 impl std::fmt::Display for RouteType {
5315 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5316 wkt::internal::display_enum(f, self.name(), self.value())
5317 }
5318 }
5319
5320 impl std::convert::From<i32> for RouteType {
5321 fn from(value: i32) -> Self {
5322 match value {
5323 0 => Self::Unspecified,
5324 1 => Self::Subnet,
5325 2 => Self::Static,
5326 3 => Self::Dynamic,
5327 4 => Self::PeeringSubnet,
5328 5 => Self::PeeringStatic,
5329 6 => Self::PeeringDynamic,
5330 7 => Self::PolicyBased,
5331 101 => Self::Advertised,
5332 _ => Self::UnknownValue(route_type::UnknownValue(
5333 wkt::internal::UnknownEnumValue::Integer(value),
5334 )),
5335 }
5336 }
5337 }
5338
5339 impl std::convert::From<&str> for RouteType {
5340 fn from(value: &str) -> Self {
5341 use std::string::ToString;
5342 match value {
5343 "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
5344 "SUBNET" => Self::Subnet,
5345 "STATIC" => Self::Static,
5346 "DYNAMIC" => Self::Dynamic,
5347 "PEERING_SUBNET" => Self::PeeringSubnet,
5348 "PEERING_STATIC" => Self::PeeringStatic,
5349 "PEERING_DYNAMIC" => Self::PeeringDynamic,
5350 "POLICY_BASED" => Self::PolicyBased,
5351 "ADVERTISED" => Self::Advertised,
5352 _ => Self::UnknownValue(route_type::UnknownValue(
5353 wkt::internal::UnknownEnumValue::String(value.to_string()),
5354 )),
5355 }
5356 }
5357 }
5358
5359 impl serde::ser::Serialize for RouteType {
5360 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5361 where
5362 S: serde::Serializer,
5363 {
5364 match self {
5365 Self::Unspecified => serializer.serialize_i32(0),
5366 Self::Subnet => serializer.serialize_i32(1),
5367 Self::Static => serializer.serialize_i32(2),
5368 Self::Dynamic => serializer.serialize_i32(3),
5369 Self::PeeringSubnet => serializer.serialize_i32(4),
5370 Self::PeeringStatic => serializer.serialize_i32(5),
5371 Self::PeeringDynamic => serializer.serialize_i32(6),
5372 Self::PolicyBased => serializer.serialize_i32(7),
5373 Self::Advertised => serializer.serialize_i32(101),
5374 Self::UnknownValue(u) => u.0.serialize(serializer),
5375 }
5376 }
5377 }
5378
5379 impl<'de> serde::de::Deserialize<'de> for RouteType {
5380 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5381 where
5382 D: serde::Deserializer<'de>,
5383 {
5384 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
5385 ".google.cloud.networkmanagement.v1.RouteInfo.RouteType",
5386 ))
5387 }
5388 }
5389
5390 #[derive(Clone, Debug, PartialEq)]
5406 #[non_exhaustive]
5407 pub enum NextHopType {
5408 Unspecified,
5410 NextHopIp,
5412 NextHopInstance,
5414 NextHopNetwork,
5416 NextHopPeering,
5420 NextHopInterconnect,
5422 NextHopVpnTunnel,
5424 NextHopVpnGateway,
5429 NextHopInternetGateway,
5431 NextHopBlackhole,
5434 NextHopIlb,
5436 NextHopRouterAppliance,
5440 NextHopNccHub,
5443 SecureWebProxyGateway,
5445 UnknownValue(next_hop_type::UnknownValue),
5450 }
5451
5452 #[doc(hidden)]
5453 pub mod next_hop_type {
5454 #[allow(unused_imports)]
5455 use super::*;
5456 #[derive(Clone, Debug, PartialEq)]
5457 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5458 }
5459
5460 impl NextHopType {
5461 pub fn value(&self) -> std::option::Option<i32> {
5466 match self {
5467 Self::Unspecified => std::option::Option::Some(0),
5468 Self::NextHopIp => std::option::Option::Some(1),
5469 Self::NextHopInstance => std::option::Option::Some(2),
5470 Self::NextHopNetwork => std::option::Option::Some(3),
5471 Self::NextHopPeering => std::option::Option::Some(4),
5472 Self::NextHopInterconnect => std::option::Option::Some(5),
5473 Self::NextHopVpnTunnel => std::option::Option::Some(6),
5474 Self::NextHopVpnGateway => std::option::Option::Some(7),
5475 Self::NextHopInternetGateway => std::option::Option::Some(8),
5476 Self::NextHopBlackhole => std::option::Option::Some(9),
5477 Self::NextHopIlb => std::option::Option::Some(10),
5478 Self::NextHopRouterAppliance => std::option::Option::Some(11),
5479 Self::NextHopNccHub => std::option::Option::Some(12),
5480 Self::SecureWebProxyGateway => std::option::Option::Some(13),
5481 Self::UnknownValue(u) => u.0.value(),
5482 }
5483 }
5484
5485 pub fn name(&self) -> std::option::Option<&str> {
5490 match self {
5491 Self::Unspecified => std::option::Option::Some("NEXT_HOP_TYPE_UNSPECIFIED"),
5492 Self::NextHopIp => std::option::Option::Some("NEXT_HOP_IP"),
5493 Self::NextHopInstance => std::option::Option::Some("NEXT_HOP_INSTANCE"),
5494 Self::NextHopNetwork => std::option::Option::Some("NEXT_HOP_NETWORK"),
5495 Self::NextHopPeering => std::option::Option::Some("NEXT_HOP_PEERING"),
5496 Self::NextHopInterconnect => std::option::Option::Some("NEXT_HOP_INTERCONNECT"),
5497 Self::NextHopVpnTunnel => std::option::Option::Some("NEXT_HOP_VPN_TUNNEL"),
5498 Self::NextHopVpnGateway => std::option::Option::Some("NEXT_HOP_VPN_GATEWAY"),
5499 Self::NextHopInternetGateway => {
5500 std::option::Option::Some("NEXT_HOP_INTERNET_GATEWAY")
5501 }
5502 Self::NextHopBlackhole => std::option::Option::Some("NEXT_HOP_BLACKHOLE"),
5503 Self::NextHopIlb => std::option::Option::Some("NEXT_HOP_ILB"),
5504 Self::NextHopRouterAppliance => {
5505 std::option::Option::Some("NEXT_HOP_ROUTER_APPLIANCE")
5506 }
5507 Self::NextHopNccHub => std::option::Option::Some("NEXT_HOP_NCC_HUB"),
5508 Self::SecureWebProxyGateway => {
5509 std::option::Option::Some("SECURE_WEB_PROXY_GATEWAY")
5510 }
5511 Self::UnknownValue(u) => u.0.name(),
5512 }
5513 }
5514 }
5515
5516 impl std::default::Default for NextHopType {
5517 fn default() -> Self {
5518 use std::convert::From;
5519 Self::from(0)
5520 }
5521 }
5522
5523 impl std::fmt::Display for NextHopType {
5524 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5525 wkt::internal::display_enum(f, self.name(), self.value())
5526 }
5527 }
5528
5529 impl std::convert::From<i32> for NextHopType {
5530 fn from(value: i32) -> Self {
5531 match value {
5532 0 => Self::Unspecified,
5533 1 => Self::NextHopIp,
5534 2 => Self::NextHopInstance,
5535 3 => Self::NextHopNetwork,
5536 4 => Self::NextHopPeering,
5537 5 => Self::NextHopInterconnect,
5538 6 => Self::NextHopVpnTunnel,
5539 7 => Self::NextHopVpnGateway,
5540 8 => Self::NextHopInternetGateway,
5541 9 => Self::NextHopBlackhole,
5542 10 => Self::NextHopIlb,
5543 11 => Self::NextHopRouterAppliance,
5544 12 => Self::NextHopNccHub,
5545 13 => Self::SecureWebProxyGateway,
5546 _ => Self::UnknownValue(next_hop_type::UnknownValue(
5547 wkt::internal::UnknownEnumValue::Integer(value),
5548 )),
5549 }
5550 }
5551 }
5552
5553 impl std::convert::From<&str> for NextHopType {
5554 fn from(value: &str) -> Self {
5555 use std::string::ToString;
5556 match value {
5557 "NEXT_HOP_TYPE_UNSPECIFIED" => Self::Unspecified,
5558 "NEXT_HOP_IP" => Self::NextHopIp,
5559 "NEXT_HOP_INSTANCE" => Self::NextHopInstance,
5560 "NEXT_HOP_NETWORK" => Self::NextHopNetwork,
5561 "NEXT_HOP_PEERING" => Self::NextHopPeering,
5562 "NEXT_HOP_INTERCONNECT" => Self::NextHopInterconnect,
5563 "NEXT_HOP_VPN_TUNNEL" => Self::NextHopVpnTunnel,
5564 "NEXT_HOP_VPN_GATEWAY" => Self::NextHopVpnGateway,
5565 "NEXT_HOP_INTERNET_GATEWAY" => Self::NextHopInternetGateway,
5566 "NEXT_HOP_BLACKHOLE" => Self::NextHopBlackhole,
5567 "NEXT_HOP_ILB" => Self::NextHopIlb,
5568 "NEXT_HOP_ROUTER_APPLIANCE" => Self::NextHopRouterAppliance,
5569 "NEXT_HOP_NCC_HUB" => Self::NextHopNccHub,
5570 "SECURE_WEB_PROXY_GATEWAY" => Self::SecureWebProxyGateway,
5571 _ => Self::UnknownValue(next_hop_type::UnknownValue(
5572 wkt::internal::UnknownEnumValue::String(value.to_string()),
5573 )),
5574 }
5575 }
5576 }
5577
5578 impl serde::ser::Serialize for NextHopType {
5579 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5580 where
5581 S: serde::Serializer,
5582 {
5583 match self {
5584 Self::Unspecified => serializer.serialize_i32(0),
5585 Self::NextHopIp => serializer.serialize_i32(1),
5586 Self::NextHopInstance => serializer.serialize_i32(2),
5587 Self::NextHopNetwork => serializer.serialize_i32(3),
5588 Self::NextHopPeering => serializer.serialize_i32(4),
5589 Self::NextHopInterconnect => serializer.serialize_i32(5),
5590 Self::NextHopVpnTunnel => serializer.serialize_i32(6),
5591 Self::NextHopVpnGateway => serializer.serialize_i32(7),
5592 Self::NextHopInternetGateway => serializer.serialize_i32(8),
5593 Self::NextHopBlackhole => serializer.serialize_i32(9),
5594 Self::NextHopIlb => serializer.serialize_i32(10),
5595 Self::NextHopRouterAppliance => serializer.serialize_i32(11),
5596 Self::NextHopNccHub => serializer.serialize_i32(12),
5597 Self::SecureWebProxyGateway => serializer.serialize_i32(13),
5598 Self::UnknownValue(u) => u.0.serialize(serializer),
5599 }
5600 }
5601 }
5602
5603 impl<'de> serde::de::Deserialize<'de> for NextHopType {
5604 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5605 where
5606 D: serde::Deserializer<'de>,
5607 {
5608 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NextHopType>::new(
5609 ".google.cloud.networkmanagement.v1.RouteInfo.NextHopType",
5610 ))
5611 }
5612 }
5613
5614 #[derive(Clone, Debug, PartialEq)]
5630 #[non_exhaustive]
5631 pub enum RouteScope {
5632 Unspecified,
5634 Network,
5636 NccHub,
5638 UnknownValue(route_scope::UnknownValue),
5643 }
5644
5645 #[doc(hidden)]
5646 pub mod route_scope {
5647 #[allow(unused_imports)]
5648 use super::*;
5649 #[derive(Clone, Debug, PartialEq)]
5650 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5651 }
5652
5653 impl RouteScope {
5654 pub fn value(&self) -> std::option::Option<i32> {
5659 match self {
5660 Self::Unspecified => std::option::Option::Some(0),
5661 Self::Network => std::option::Option::Some(1),
5662 Self::NccHub => std::option::Option::Some(2),
5663 Self::UnknownValue(u) => u.0.value(),
5664 }
5665 }
5666
5667 pub fn name(&self) -> std::option::Option<&str> {
5672 match self {
5673 Self::Unspecified => std::option::Option::Some("ROUTE_SCOPE_UNSPECIFIED"),
5674 Self::Network => std::option::Option::Some("NETWORK"),
5675 Self::NccHub => std::option::Option::Some("NCC_HUB"),
5676 Self::UnknownValue(u) => u.0.name(),
5677 }
5678 }
5679 }
5680
5681 impl std::default::Default for RouteScope {
5682 fn default() -> Self {
5683 use std::convert::From;
5684 Self::from(0)
5685 }
5686 }
5687
5688 impl std::fmt::Display for RouteScope {
5689 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5690 wkt::internal::display_enum(f, self.name(), self.value())
5691 }
5692 }
5693
5694 impl std::convert::From<i32> for RouteScope {
5695 fn from(value: i32) -> Self {
5696 match value {
5697 0 => Self::Unspecified,
5698 1 => Self::Network,
5699 2 => Self::NccHub,
5700 _ => Self::UnknownValue(route_scope::UnknownValue(
5701 wkt::internal::UnknownEnumValue::Integer(value),
5702 )),
5703 }
5704 }
5705 }
5706
5707 impl std::convert::From<&str> for RouteScope {
5708 fn from(value: &str) -> Self {
5709 use std::string::ToString;
5710 match value {
5711 "ROUTE_SCOPE_UNSPECIFIED" => Self::Unspecified,
5712 "NETWORK" => Self::Network,
5713 "NCC_HUB" => Self::NccHub,
5714 _ => Self::UnknownValue(route_scope::UnknownValue(
5715 wkt::internal::UnknownEnumValue::String(value.to_string()),
5716 )),
5717 }
5718 }
5719 }
5720
5721 impl serde::ser::Serialize for RouteScope {
5722 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5723 where
5724 S: serde::Serializer,
5725 {
5726 match self {
5727 Self::Unspecified => serializer.serialize_i32(0),
5728 Self::Network => serializer.serialize_i32(1),
5729 Self::NccHub => serializer.serialize_i32(2),
5730 Self::UnknownValue(u) => u.0.serialize(serializer),
5731 }
5732 }
5733 }
5734
5735 impl<'de> serde::de::Deserialize<'de> for RouteScope {
5736 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5737 where
5738 D: serde::Deserializer<'de>,
5739 {
5740 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteScope>::new(
5741 ".google.cloud.networkmanagement.v1.RouteInfo.RouteScope",
5742 ))
5743 }
5744 }
5745}
5746
5747#[derive(Clone, Default, PartialEq)]
5753#[non_exhaustive]
5754pub struct GoogleServiceInfo {
5755 pub source_ip: std::string::String,
5757
5758 pub google_service_type: crate::model::google_service_info::GoogleServiceType,
5760
5761 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5762}
5763
5764impl GoogleServiceInfo {
5765 pub fn new() -> Self {
5766 std::default::Default::default()
5767 }
5768
5769 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5771 self.source_ip = v.into();
5772 self
5773 }
5774
5775 pub fn set_google_service_type<
5777 T: std::convert::Into<crate::model::google_service_info::GoogleServiceType>,
5778 >(
5779 mut self,
5780 v: T,
5781 ) -> Self {
5782 self.google_service_type = v.into();
5783 self
5784 }
5785}
5786
5787impl wkt::message::Message for GoogleServiceInfo {
5788 fn typename() -> &'static str {
5789 "type.googleapis.com/google.cloud.networkmanagement.v1.GoogleServiceInfo"
5790 }
5791}
5792
5793pub mod google_service_info {
5795 #[allow(unused_imports)]
5796 use super::*;
5797
5798 #[derive(Clone, Debug, PartialEq)]
5814 #[non_exhaustive]
5815 pub enum GoogleServiceType {
5816 Unspecified,
5818 Iap,
5821 GfeProxyOrHealthCheckProber,
5827 CloudDns,
5832 GoogleApi,
5834 GoogleApiPsc,
5837 GoogleApiVpcSc,
5840 ServerlessVpcAccess,
5843 UnknownValue(google_service_type::UnknownValue),
5848 }
5849
5850 #[doc(hidden)]
5851 pub mod google_service_type {
5852 #[allow(unused_imports)]
5853 use super::*;
5854 #[derive(Clone, Debug, PartialEq)]
5855 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5856 }
5857
5858 impl GoogleServiceType {
5859 pub fn value(&self) -> std::option::Option<i32> {
5864 match self {
5865 Self::Unspecified => std::option::Option::Some(0),
5866 Self::Iap => std::option::Option::Some(1),
5867 Self::GfeProxyOrHealthCheckProber => std::option::Option::Some(2),
5868 Self::CloudDns => std::option::Option::Some(3),
5869 Self::GoogleApi => std::option::Option::Some(4),
5870 Self::GoogleApiPsc => std::option::Option::Some(5),
5871 Self::GoogleApiVpcSc => std::option::Option::Some(6),
5872 Self::ServerlessVpcAccess => std::option::Option::Some(7),
5873 Self::UnknownValue(u) => u.0.value(),
5874 }
5875 }
5876
5877 pub fn name(&self) -> std::option::Option<&str> {
5882 match self {
5883 Self::Unspecified => std::option::Option::Some("GOOGLE_SERVICE_TYPE_UNSPECIFIED"),
5884 Self::Iap => std::option::Option::Some("IAP"),
5885 Self::GfeProxyOrHealthCheckProber => {
5886 std::option::Option::Some("GFE_PROXY_OR_HEALTH_CHECK_PROBER")
5887 }
5888 Self::CloudDns => std::option::Option::Some("CLOUD_DNS"),
5889 Self::GoogleApi => std::option::Option::Some("GOOGLE_API"),
5890 Self::GoogleApiPsc => std::option::Option::Some("GOOGLE_API_PSC"),
5891 Self::GoogleApiVpcSc => std::option::Option::Some("GOOGLE_API_VPC_SC"),
5892 Self::ServerlessVpcAccess => std::option::Option::Some("SERVERLESS_VPC_ACCESS"),
5893 Self::UnknownValue(u) => u.0.name(),
5894 }
5895 }
5896 }
5897
5898 impl std::default::Default for GoogleServiceType {
5899 fn default() -> Self {
5900 use std::convert::From;
5901 Self::from(0)
5902 }
5903 }
5904
5905 impl std::fmt::Display for GoogleServiceType {
5906 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5907 wkt::internal::display_enum(f, self.name(), self.value())
5908 }
5909 }
5910
5911 impl std::convert::From<i32> for GoogleServiceType {
5912 fn from(value: i32) -> Self {
5913 match value {
5914 0 => Self::Unspecified,
5915 1 => Self::Iap,
5916 2 => Self::GfeProxyOrHealthCheckProber,
5917 3 => Self::CloudDns,
5918 4 => Self::GoogleApi,
5919 5 => Self::GoogleApiPsc,
5920 6 => Self::GoogleApiVpcSc,
5921 7 => Self::ServerlessVpcAccess,
5922 _ => Self::UnknownValue(google_service_type::UnknownValue(
5923 wkt::internal::UnknownEnumValue::Integer(value),
5924 )),
5925 }
5926 }
5927 }
5928
5929 impl std::convert::From<&str> for GoogleServiceType {
5930 fn from(value: &str) -> Self {
5931 use std::string::ToString;
5932 match value {
5933 "GOOGLE_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
5934 "IAP" => Self::Iap,
5935 "GFE_PROXY_OR_HEALTH_CHECK_PROBER" => Self::GfeProxyOrHealthCheckProber,
5936 "CLOUD_DNS" => Self::CloudDns,
5937 "GOOGLE_API" => Self::GoogleApi,
5938 "GOOGLE_API_PSC" => Self::GoogleApiPsc,
5939 "GOOGLE_API_VPC_SC" => Self::GoogleApiVpcSc,
5940 "SERVERLESS_VPC_ACCESS" => Self::ServerlessVpcAccess,
5941 _ => Self::UnknownValue(google_service_type::UnknownValue(
5942 wkt::internal::UnknownEnumValue::String(value.to_string()),
5943 )),
5944 }
5945 }
5946 }
5947
5948 impl serde::ser::Serialize for GoogleServiceType {
5949 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5950 where
5951 S: serde::Serializer,
5952 {
5953 match self {
5954 Self::Unspecified => serializer.serialize_i32(0),
5955 Self::Iap => serializer.serialize_i32(1),
5956 Self::GfeProxyOrHealthCheckProber => serializer.serialize_i32(2),
5957 Self::CloudDns => serializer.serialize_i32(3),
5958 Self::GoogleApi => serializer.serialize_i32(4),
5959 Self::GoogleApiPsc => serializer.serialize_i32(5),
5960 Self::GoogleApiVpcSc => serializer.serialize_i32(6),
5961 Self::ServerlessVpcAccess => serializer.serialize_i32(7),
5962 Self::UnknownValue(u) => u.0.serialize(serializer),
5963 }
5964 }
5965 }
5966
5967 impl<'de> serde::de::Deserialize<'de> for GoogleServiceType {
5968 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5969 where
5970 D: serde::Deserializer<'de>,
5971 {
5972 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GoogleServiceType>::new(
5973 ".google.cloud.networkmanagement.v1.GoogleServiceInfo.GoogleServiceType",
5974 ))
5975 }
5976 }
5977}
5978
5979#[derive(Clone, Default, PartialEq)]
5981#[non_exhaustive]
5982pub struct ForwardingRuleInfo {
5983 pub display_name: std::string::String,
5985
5986 pub uri: std::string::String,
5988
5989 pub matched_protocol: std::string::String,
5991
5992 pub matched_port_range: std::string::String,
5994
5995 pub vip: std::string::String,
5997
5998 pub target: std::string::String,
6000
6001 pub network_uri: std::string::String,
6003
6004 pub region: std::string::String,
6006
6007 pub load_balancer_name: std::string::String,
6010
6011 pub psc_service_attachment_uri: std::string::String,
6014
6015 pub psc_google_api_target: std::string::String,
6017
6018 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6019}
6020
6021impl ForwardingRuleInfo {
6022 pub fn new() -> Self {
6023 std::default::Default::default()
6024 }
6025
6026 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6028 self.display_name = v.into();
6029 self
6030 }
6031
6032 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6034 self.uri = v.into();
6035 self
6036 }
6037
6038 pub fn set_matched_protocol<T: std::convert::Into<std::string::String>>(
6040 mut self,
6041 v: T,
6042 ) -> Self {
6043 self.matched_protocol = v.into();
6044 self
6045 }
6046
6047 pub fn set_matched_port_range<T: std::convert::Into<std::string::String>>(
6049 mut self,
6050 v: T,
6051 ) -> Self {
6052 self.matched_port_range = v.into();
6053 self
6054 }
6055
6056 pub fn set_vip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6058 self.vip = v.into();
6059 self
6060 }
6061
6062 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6064 self.target = v.into();
6065 self
6066 }
6067
6068 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6070 self.network_uri = v.into();
6071 self
6072 }
6073
6074 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6076 self.region = v.into();
6077 self
6078 }
6079
6080 pub fn set_load_balancer_name<T: std::convert::Into<std::string::String>>(
6082 mut self,
6083 v: T,
6084 ) -> Self {
6085 self.load_balancer_name = v.into();
6086 self
6087 }
6088
6089 pub fn set_psc_service_attachment_uri<T: std::convert::Into<std::string::String>>(
6091 mut self,
6092 v: T,
6093 ) -> Self {
6094 self.psc_service_attachment_uri = v.into();
6095 self
6096 }
6097
6098 pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
6100 mut self,
6101 v: T,
6102 ) -> Self {
6103 self.psc_google_api_target = v.into();
6104 self
6105 }
6106}
6107
6108impl wkt::message::Message for ForwardingRuleInfo {
6109 fn typename() -> &'static str {
6110 "type.googleapis.com/google.cloud.networkmanagement.v1.ForwardingRuleInfo"
6111 }
6112}
6113
6114#[derive(Clone, Default, PartialEq)]
6116#[non_exhaustive]
6117pub struct LoadBalancerInfo {
6118 pub load_balancer_type: crate::model::load_balancer_info::LoadBalancerType,
6120
6121 #[deprecated]
6125 pub health_check_uri: std::string::String,
6126
6127 pub backends: std::vec::Vec<crate::model::LoadBalancerBackend>,
6129
6130 pub backend_type: crate::model::load_balancer_info::BackendType,
6132
6133 pub backend_uri: std::string::String,
6135
6136 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6137}
6138
6139impl LoadBalancerInfo {
6140 pub fn new() -> Self {
6141 std::default::Default::default()
6142 }
6143
6144 pub fn set_load_balancer_type<
6146 T: std::convert::Into<crate::model::load_balancer_info::LoadBalancerType>,
6147 >(
6148 mut self,
6149 v: T,
6150 ) -> Self {
6151 self.load_balancer_type = v.into();
6152 self
6153 }
6154
6155 #[deprecated]
6157 pub fn set_health_check_uri<T: std::convert::Into<std::string::String>>(
6158 mut self,
6159 v: T,
6160 ) -> Self {
6161 self.health_check_uri = v.into();
6162 self
6163 }
6164
6165 pub fn set_backends<T, V>(mut self, v: T) -> Self
6167 where
6168 T: std::iter::IntoIterator<Item = V>,
6169 V: std::convert::Into<crate::model::LoadBalancerBackend>,
6170 {
6171 use std::iter::Iterator;
6172 self.backends = v.into_iter().map(|i| i.into()).collect();
6173 self
6174 }
6175
6176 pub fn set_backend_type<
6178 T: std::convert::Into<crate::model::load_balancer_info::BackendType>,
6179 >(
6180 mut self,
6181 v: T,
6182 ) -> Self {
6183 self.backend_type = v.into();
6184 self
6185 }
6186
6187 pub fn set_backend_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6189 self.backend_uri = v.into();
6190 self
6191 }
6192}
6193
6194impl wkt::message::Message for LoadBalancerInfo {
6195 fn typename() -> &'static str {
6196 "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerInfo"
6197 }
6198}
6199
6200pub mod load_balancer_info {
6202 #[allow(unused_imports)]
6203 use super::*;
6204
6205 #[derive(Clone, Debug, PartialEq)]
6221 #[non_exhaustive]
6222 pub enum LoadBalancerType {
6223 Unspecified,
6225 InternalTcpUdp,
6227 NetworkTcpUdp,
6229 HttpProxy,
6231 TcpProxy,
6233 SslProxy,
6235 UnknownValue(load_balancer_type::UnknownValue),
6240 }
6241
6242 #[doc(hidden)]
6243 pub mod load_balancer_type {
6244 #[allow(unused_imports)]
6245 use super::*;
6246 #[derive(Clone, Debug, PartialEq)]
6247 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6248 }
6249
6250 impl LoadBalancerType {
6251 pub fn value(&self) -> std::option::Option<i32> {
6256 match self {
6257 Self::Unspecified => std::option::Option::Some(0),
6258 Self::InternalTcpUdp => std::option::Option::Some(1),
6259 Self::NetworkTcpUdp => std::option::Option::Some(2),
6260 Self::HttpProxy => std::option::Option::Some(3),
6261 Self::TcpProxy => std::option::Option::Some(4),
6262 Self::SslProxy => std::option::Option::Some(5),
6263 Self::UnknownValue(u) => u.0.value(),
6264 }
6265 }
6266
6267 pub fn name(&self) -> std::option::Option<&str> {
6272 match self {
6273 Self::Unspecified => std::option::Option::Some("LOAD_BALANCER_TYPE_UNSPECIFIED"),
6274 Self::InternalTcpUdp => std::option::Option::Some("INTERNAL_TCP_UDP"),
6275 Self::NetworkTcpUdp => std::option::Option::Some("NETWORK_TCP_UDP"),
6276 Self::HttpProxy => std::option::Option::Some("HTTP_PROXY"),
6277 Self::TcpProxy => std::option::Option::Some("TCP_PROXY"),
6278 Self::SslProxy => std::option::Option::Some("SSL_PROXY"),
6279 Self::UnknownValue(u) => u.0.name(),
6280 }
6281 }
6282 }
6283
6284 impl std::default::Default for LoadBalancerType {
6285 fn default() -> Self {
6286 use std::convert::From;
6287 Self::from(0)
6288 }
6289 }
6290
6291 impl std::fmt::Display for LoadBalancerType {
6292 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6293 wkt::internal::display_enum(f, self.name(), self.value())
6294 }
6295 }
6296
6297 impl std::convert::From<i32> for LoadBalancerType {
6298 fn from(value: i32) -> Self {
6299 match value {
6300 0 => Self::Unspecified,
6301 1 => Self::InternalTcpUdp,
6302 2 => Self::NetworkTcpUdp,
6303 3 => Self::HttpProxy,
6304 4 => Self::TcpProxy,
6305 5 => Self::SslProxy,
6306 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
6307 wkt::internal::UnknownEnumValue::Integer(value),
6308 )),
6309 }
6310 }
6311 }
6312
6313 impl std::convert::From<&str> for LoadBalancerType {
6314 fn from(value: &str) -> Self {
6315 use std::string::ToString;
6316 match value {
6317 "LOAD_BALANCER_TYPE_UNSPECIFIED" => Self::Unspecified,
6318 "INTERNAL_TCP_UDP" => Self::InternalTcpUdp,
6319 "NETWORK_TCP_UDP" => Self::NetworkTcpUdp,
6320 "HTTP_PROXY" => Self::HttpProxy,
6321 "TCP_PROXY" => Self::TcpProxy,
6322 "SSL_PROXY" => Self::SslProxy,
6323 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
6324 wkt::internal::UnknownEnumValue::String(value.to_string()),
6325 )),
6326 }
6327 }
6328 }
6329
6330 impl serde::ser::Serialize for LoadBalancerType {
6331 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6332 where
6333 S: serde::Serializer,
6334 {
6335 match self {
6336 Self::Unspecified => serializer.serialize_i32(0),
6337 Self::InternalTcpUdp => serializer.serialize_i32(1),
6338 Self::NetworkTcpUdp => serializer.serialize_i32(2),
6339 Self::HttpProxy => serializer.serialize_i32(3),
6340 Self::TcpProxy => serializer.serialize_i32(4),
6341 Self::SslProxy => serializer.serialize_i32(5),
6342 Self::UnknownValue(u) => u.0.serialize(serializer),
6343 }
6344 }
6345 }
6346
6347 impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
6348 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6349 where
6350 D: serde::Deserializer<'de>,
6351 {
6352 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
6353 ".google.cloud.networkmanagement.v1.LoadBalancerInfo.LoadBalancerType",
6354 ))
6355 }
6356 }
6357
6358 #[derive(Clone, Debug, PartialEq)]
6374 #[non_exhaustive]
6375 pub enum BackendType {
6376 Unspecified,
6378 BackendService,
6380 TargetPool,
6382 TargetInstance,
6384 UnknownValue(backend_type::UnknownValue),
6389 }
6390
6391 #[doc(hidden)]
6392 pub mod backend_type {
6393 #[allow(unused_imports)]
6394 use super::*;
6395 #[derive(Clone, Debug, PartialEq)]
6396 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6397 }
6398
6399 impl BackendType {
6400 pub fn value(&self) -> std::option::Option<i32> {
6405 match self {
6406 Self::Unspecified => std::option::Option::Some(0),
6407 Self::BackendService => std::option::Option::Some(1),
6408 Self::TargetPool => std::option::Option::Some(2),
6409 Self::TargetInstance => std::option::Option::Some(3),
6410 Self::UnknownValue(u) => u.0.value(),
6411 }
6412 }
6413
6414 pub fn name(&self) -> std::option::Option<&str> {
6419 match self {
6420 Self::Unspecified => std::option::Option::Some("BACKEND_TYPE_UNSPECIFIED"),
6421 Self::BackendService => std::option::Option::Some("BACKEND_SERVICE"),
6422 Self::TargetPool => std::option::Option::Some("TARGET_POOL"),
6423 Self::TargetInstance => std::option::Option::Some("TARGET_INSTANCE"),
6424 Self::UnknownValue(u) => u.0.name(),
6425 }
6426 }
6427 }
6428
6429 impl std::default::Default for BackendType {
6430 fn default() -> Self {
6431 use std::convert::From;
6432 Self::from(0)
6433 }
6434 }
6435
6436 impl std::fmt::Display for BackendType {
6437 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6438 wkt::internal::display_enum(f, self.name(), self.value())
6439 }
6440 }
6441
6442 impl std::convert::From<i32> for BackendType {
6443 fn from(value: i32) -> Self {
6444 match value {
6445 0 => Self::Unspecified,
6446 1 => Self::BackendService,
6447 2 => Self::TargetPool,
6448 3 => Self::TargetInstance,
6449 _ => Self::UnknownValue(backend_type::UnknownValue(
6450 wkt::internal::UnknownEnumValue::Integer(value),
6451 )),
6452 }
6453 }
6454 }
6455
6456 impl std::convert::From<&str> for BackendType {
6457 fn from(value: &str) -> Self {
6458 use std::string::ToString;
6459 match value {
6460 "BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
6461 "BACKEND_SERVICE" => Self::BackendService,
6462 "TARGET_POOL" => Self::TargetPool,
6463 "TARGET_INSTANCE" => Self::TargetInstance,
6464 _ => Self::UnknownValue(backend_type::UnknownValue(
6465 wkt::internal::UnknownEnumValue::String(value.to_string()),
6466 )),
6467 }
6468 }
6469 }
6470
6471 impl serde::ser::Serialize for BackendType {
6472 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6473 where
6474 S: serde::Serializer,
6475 {
6476 match self {
6477 Self::Unspecified => serializer.serialize_i32(0),
6478 Self::BackendService => serializer.serialize_i32(1),
6479 Self::TargetPool => serializer.serialize_i32(2),
6480 Self::TargetInstance => serializer.serialize_i32(3),
6481 Self::UnknownValue(u) => u.0.serialize(serializer),
6482 }
6483 }
6484 }
6485
6486 impl<'de> serde::de::Deserialize<'de> for BackendType {
6487 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6488 where
6489 D: serde::Deserializer<'de>,
6490 {
6491 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackendType>::new(
6492 ".google.cloud.networkmanagement.v1.LoadBalancerInfo.BackendType",
6493 ))
6494 }
6495 }
6496}
6497
6498#[derive(Clone, Default, PartialEq)]
6500#[non_exhaustive]
6501pub struct LoadBalancerBackend {
6502 pub display_name: std::string::String,
6504
6505 pub uri: std::string::String,
6507
6508 pub health_check_firewall_state: crate::model::load_balancer_backend::HealthCheckFirewallState,
6510
6511 pub health_check_allowing_firewall_rules: std::vec::Vec<std::string::String>,
6513
6514 pub health_check_blocking_firewall_rules: std::vec::Vec<std::string::String>,
6516
6517 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6518}
6519
6520impl LoadBalancerBackend {
6521 pub fn new() -> Self {
6522 std::default::Default::default()
6523 }
6524
6525 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6527 self.display_name = v.into();
6528 self
6529 }
6530
6531 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6533 self.uri = v.into();
6534 self
6535 }
6536
6537 pub fn set_health_check_firewall_state<
6539 T: std::convert::Into<crate::model::load_balancer_backend::HealthCheckFirewallState>,
6540 >(
6541 mut self,
6542 v: T,
6543 ) -> Self {
6544 self.health_check_firewall_state = v.into();
6545 self
6546 }
6547
6548 pub fn set_health_check_allowing_firewall_rules<T, V>(mut self, v: T) -> Self
6550 where
6551 T: std::iter::IntoIterator<Item = V>,
6552 V: std::convert::Into<std::string::String>,
6553 {
6554 use std::iter::Iterator;
6555 self.health_check_allowing_firewall_rules = v.into_iter().map(|i| i.into()).collect();
6556 self
6557 }
6558
6559 pub fn set_health_check_blocking_firewall_rules<T, V>(mut self, v: T) -> Self
6561 where
6562 T: std::iter::IntoIterator<Item = V>,
6563 V: std::convert::Into<std::string::String>,
6564 {
6565 use std::iter::Iterator;
6566 self.health_check_blocking_firewall_rules = v.into_iter().map(|i| i.into()).collect();
6567 self
6568 }
6569}
6570
6571impl wkt::message::Message for LoadBalancerBackend {
6572 fn typename() -> &'static str {
6573 "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerBackend"
6574 }
6575}
6576
6577pub mod load_balancer_backend {
6579 #[allow(unused_imports)]
6580 use super::*;
6581
6582 #[derive(Clone, Debug, PartialEq)]
6598 #[non_exhaustive]
6599 pub enum HealthCheckFirewallState {
6600 Unspecified,
6602 Configured,
6605 Misconfigured,
6611 UnknownValue(health_check_firewall_state::UnknownValue),
6616 }
6617
6618 #[doc(hidden)]
6619 pub mod health_check_firewall_state {
6620 #[allow(unused_imports)]
6621 use super::*;
6622 #[derive(Clone, Debug, PartialEq)]
6623 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6624 }
6625
6626 impl HealthCheckFirewallState {
6627 pub fn value(&self) -> std::option::Option<i32> {
6632 match self {
6633 Self::Unspecified => std::option::Option::Some(0),
6634 Self::Configured => std::option::Option::Some(1),
6635 Self::Misconfigured => std::option::Option::Some(2),
6636 Self::UnknownValue(u) => u.0.value(),
6637 }
6638 }
6639
6640 pub fn name(&self) -> std::option::Option<&str> {
6645 match self {
6646 Self::Unspecified => {
6647 std::option::Option::Some("HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED")
6648 }
6649 Self::Configured => std::option::Option::Some("CONFIGURED"),
6650 Self::Misconfigured => std::option::Option::Some("MISCONFIGURED"),
6651 Self::UnknownValue(u) => u.0.name(),
6652 }
6653 }
6654 }
6655
6656 impl std::default::Default for HealthCheckFirewallState {
6657 fn default() -> Self {
6658 use std::convert::From;
6659 Self::from(0)
6660 }
6661 }
6662
6663 impl std::fmt::Display for HealthCheckFirewallState {
6664 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6665 wkt::internal::display_enum(f, self.name(), self.value())
6666 }
6667 }
6668
6669 impl std::convert::From<i32> for HealthCheckFirewallState {
6670 fn from(value: i32) -> Self {
6671 match value {
6672 0 => Self::Unspecified,
6673 1 => Self::Configured,
6674 2 => Self::Misconfigured,
6675 _ => Self::UnknownValue(health_check_firewall_state::UnknownValue(
6676 wkt::internal::UnknownEnumValue::Integer(value),
6677 )),
6678 }
6679 }
6680 }
6681
6682 impl std::convert::From<&str> for HealthCheckFirewallState {
6683 fn from(value: &str) -> Self {
6684 use std::string::ToString;
6685 match value {
6686 "HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED" => Self::Unspecified,
6687 "CONFIGURED" => Self::Configured,
6688 "MISCONFIGURED" => Self::Misconfigured,
6689 _ => Self::UnknownValue(health_check_firewall_state::UnknownValue(
6690 wkt::internal::UnknownEnumValue::String(value.to_string()),
6691 )),
6692 }
6693 }
6694 }
6695
6696 impl serde::ser::Serialize for HealthCheckFirewallState {
6697 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6698 where
6699 S: serde::Serializer,
6700 {
6701 match self {
6702 Self::Unspecified => serializer.serialize_i32(0),
6703 Self::Configured => serializer.serialize_i32(1),
6704 Self::Misconfigured => serializer.serialize_i32(2),
6705 Self::UnknownValue(u) => u.0.serialize(serializer),
6706 }
6707 }
6708 }
6709
6710 impl<'de> serde::de::Deserialize<'de> for HealthCheckFirewallState {
6711 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6712 where
6713 D: serde::Deserializer<'de>,
6714 {
6715 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HealthCheckFirewallState>::new(
6716 ".google.cloud.networkmanagement.v1.LoadBalancerBackend.HealthCheckFirewallState"))
6717 }
6718 }
6719}
6720
6721#[derive(Clone, Default, PartialEq)]
6723#[non_exhaustive]
6724pub struct HybridSubnetInfo {
6725 pub display_name: std::string::String,
6727
6728 pub uri: std::string::String,
6730
6731 pub region: std::string::String,
6733
6734 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6735}
6736
6737impl HybridSubnetInfo {
6738 pub fn new() -> Self {
6739 std::default::Default::default()
6740 }
6741
6742 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6744 self.display_name = v.into();
6745 self
6746 }
6747
6748 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6750 self.uri = v.into();
6751 self
6752 }
6753
6754 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6756 self.region = v.into();
6757 self
6758 }
6759}
6760
6761impl wkt::message::Message for HybridSubnetInfo {
6762 fn typename() -> &'static str {
6763 "type.googleapis.com/google.cloud.networkmanagement.v1.HybridSubnetInfo"
6764 }
6765}
6766
6767#[derive(Clone, Default, PartialEq)]
6769#[non_exhaustive]
6770pub struct VpnGatewayInfo {
6771 pub display_name: std::string::String,
6773
6774 pub uri: std::string::String,
6776
6777 pub network_uri: std::string::String,
6779
6780 pub ip_address: std::string::String,
6782
6783 pub vpn_tunnel_uri: std::string::String,
6787
6788 pub region: std::string::String,
6790
6791 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6792}
6793
6794impl VpnGatewayInfo {
6795 pub fn new() -> Self {
6796 std::default::Default::default()
6797 }
6798
6799 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6801 self.display_name = v.into();
6802 self
6803 }
6804
6805 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6807 self.uri = v.into();
6808 self
6809 }
6810
6811 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6813 self.network_uri = v.into();
6814 self
6815 }
6816
6817 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6819 self.ip_address = v.into();
6820 self
6821 }
6822
6823 pub fn set_vpn_tunnel_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6825 self.vpn_tunnel_uri = v.into();
6826 self
6827 }
6828
6829 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6831 self.region = v.into();
6832 self
6833 }
6834}
6835
6836impl wkt::message::Message for VpnGatewayInfo {
6837 fn typename() -> &'static str {
6838 "type.googleapis.com/google.cloud.networkmanagement.v1.VpnGatewayInfo"
6839 }
6840}
6841
6842#[derive(Clone, Default, PartialEq)]
6844#[non_exhaustive]
6845pub struct VpnTunnelInfo {
6846 pub display_name: std::string::String,
6848
6849 pub uri: std::string::String,
6851
6852 pub source_gateway: std::string::String,
6854
6855 pub remote_gateway: std::string::String,
6857
6858 pub remote_gateway_ip: std::string::String,
6860
6861 pub source_gateway_ip: std::string::String,
6863
6864 pub network_uri: std::string::String,
6866
6867 pub region: std::string::String,
6869
6870 pub routing_type: crate::model::vpn_tunnel_info::RoutingType,
6872
6873 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6874}
6875
6876impl VpnTunnelInfo {
6877 pub fn new() -> Self {
6878 std::default::Default::default()
6879 }
6880
6881 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6883 self.display_name = v.into();
6884 self
6885 }
6886
6887 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6889 self.uri = v.into();
6890 self
6891 }
6892
6893 pub fn set_source_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6895 self.source_gateway = v.into();
6896 self
6897 }
6898
6899 pub fn set_remote_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6901 self.remote_gateway = v.into();
6902 self
6903 }
6904
6905 pub fn set_remote_gateway_ip<T: std::convert::Into<std::string::String>>(
6907 mut self,
6908 v: T,
6909 ) -> Self {
6910 self.remote_gateway_ip = v.into();
6911 self
6912 }
6913
6914 pub fn set_source_gateway_ip<T: std::convert::Into<std::string::String>>(
6916 mut self,
6917 v: T,
6918 ) -> Self {
6919 self.source_gateway_ip = v.into();
6920 self
6921 }
6922
6923 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6925 self.network_uri = v.into();
6926 self
6927 }
6928
6929 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6931 self.region = v.into();
6932 self
6933 }
6934
6935 pub fn set_routing_type<T: std::convert::Into<crate::model::vpn_tunnel_info::RoutingType>>(
6937 mut self,
6938 v: T,
6939 ) -> Self {
6940 self.routing_type = v.into();
6941 self
6942 }
6943}
6944
6945impl wkt::message::Message for VpnTunnelInfo {
6946 fn typename() -> &'static str {
6947 "type.googleapis.com/google.cloud.networkmanagement.v1.VpnTunnelInfo"
6948 }
6949}
6950
6951pub mod vpn_tunnel_info {
6953 #[allow(unused_imports)]
6954 use super::*;
6955
6956 #[derive(Clone, Debug, PartialEq)]
6973 #[non_exhaustive]
6974 pub enum RoutingType {
6975 Unspecified,
6977 RouteBased,
6979 PolicyBased,
6981 Dynamic,
6983 UnknownValue(routing_type::UnknownValue),
6988 }
6989
6990 #[doc(hidden)]
6991 pub mod routing_type {
6992 #[allow(unused_imports)]
6993 use super::*;
6994 #[derive(Clone, Debug, PartialEq)]
6995 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6996 }
6997
6998 impl RoutingType {
6999 pub fn value(&self) -> std::option::Option<i32> {
7004 match self {
7005 Self::Unspecified => std::option::Option::Some(0),
7006 Self::RouteBased => std::option::Option::Some(1),
7007 Self::PolicyBased => std::option::Option::Some(2),
7008 Self::Dynamic => std::option::Option::Some(3),
7009 Self::UnknownValue(u) => u.0.value(),
7010 }
7011 }
7012
7013 pub fn name(&self) -> std::option::Option<&str> {
7018 match self {
7019 Self::Unspecified => std::option::Option::Some("ROUTING_TYPE_UNSPECIFIED"),
7020 Self::RouteBased => std::option::Option::Some("ROUTE_BASED"),
7021 Self::PolicyBased => std::option::Option::Some("POLICY_BASED"),
7022 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
7023 Self::UnknownValue(u) => u.0.name(),
7024 }
7025 }
7026 }
7027
7028 impl std::default::Default for RoutingType {
7029 fn default() -> Self {
7030 use std::convert::From;
7031 Self::from(0)
7032 }
7033 }
7034
7035 impl std::fmt::Display for RoutingType {
7036 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7037 wkt::internal::display_enum(f, self.name(), self.value())
7038 }
7039 }
7040
7041 impl std::convert::From<i32> for RoutingType {
7042 fn from(value: i32) -> Self {
7043 match value {
7044 0 => Self::Unspecified,
7045 1 => Self::RouteBased,
7046 2 => Self::PolicyBased,
7047 3 => Self::Dynamic,
7048 _ => Self::UnknownValue(routing_type::UnknownValue(
7049 wkt::internal::UnknownEnumValue::Integer(value),
7050 )),
7051 }
7052 }
7053 }
7054
7055 impl std::convert::From<&str> for RoutingType {
7056 fn from(value: &str) -> Self {
7057 use std::string::ToString;
7058 match value {
7059 "ROUTING_TYPE_UNSPECIFIED" => Self::Unspecified,
7060 "ROUTE_BASED" => Self::RouteBased,
7061 "POLICY_BASED" => Self::PolicyBased,
7062 "DYNAMIC" => Self::Dynamic,
7063 _ => Self::UnknownValue(routing_type::UnknownValue(
7064 wkt::internal::UnknownEnumValue::String(value.to_string()),
7065 )),
7066 }
7067 }
7068 }
7069
7070 impl serde::ser::Serialize for RoutingType {
7071 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7072 where
7073 S: serde::Serializer,
7074 {
7075 match self {
7076 Self::Unspecified => serializer.serialize_i32(0),
7077 Self::RouteBased => serializer.serialize_i32(1),
7078 Self::PolicyBased => serializer.serialize_i32(2),
7079 Self::Dynamic => serializer.serialize_i32(3),
7080 Self::UnknownValue(u) => u.0.serialize(serializer),
7081 }
7082 }
7083 }
7084
7085 impl<'de> serde::de::Deserialize<'de> for RoutingType {
7086 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7087 where
7088 D: serde::Deserializer<'de>,
7089 {
7090 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutingType>::new(
7091 ".google.cloud.networkmanagement.v1.VpnTunnelInfo.RoutingType",
7092 ))
7093 }
7094 }
7095}
7096
7097#[derive(Clone, Default, PartialEq)]
7099#[non_exhaustive]
7100pub struct InterconnectAttachmentInfo {
7101 pub display_name: std::string::String,
7103
7104 pub uri: std::string::String,
7106
7107 pub interconnect_uri: std::string::String,
7110
7111 pub region: std::string::String,
7114
7115 pub cloud_router_uri: std::string::String,
7117
7118 pub r#type: crate::model::interconnect_attachment_info::Type,
7120
7121 pub l2_attachment_matched_ip_address: std::string::String,
7123
7124 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7125}
7126
7127impl InterconnectAttachmentInfo {
7128 pub fn new() -> Self {
7129 std::default::Default::default()
7130 }
7131
7132 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7134 self.display_name = v.into();
7135 self
7136 }
7137
7138 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7140 self.uri = v.into();
7141 self
7142 }
7143
7144 pub fn set_interconnect_uri<T: std::convert::Into<std::string::String>>(
7146 mut self,
7147 v: T,
7148 ) -> Self {
7149 self.interconnect_uri = v.into();
7150 self
7151 }
7152
7153 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7155 self.region = v.into();
7156 self
7157 }
7158
7159 pub fn set_cloud_router_uri<T: std::convert::Into<std::string::String>>(
7161 mut self,
7162 v: T,
7163 ) -> Self {
7164 self.cloud_router_uri = v.into();
7165 self
7166 }
7167
7168 pub fn set_type<T: std::convert::Into<crate::model::interconnect_attachment_info::Type>>(
7170 mut self,
7171 v: T,
7172 ) -> Self {
7173 self.r#type = v.into();
7174 self
7175 }
7176
7177 pub fn set_l2_attachment_matched_ip_address<T: std::convert::Into<std::string::String>>(
7179 mut self,
7180 v: T,
7181 ) -> Self {
7182 self.l2_attachment_matched_ip_address = v.into();
7183 self
7184 }
7185}
7186
7187impl wkt::message::Message for InterconnectAttachmentInfo {
7188 fn typename() -> &'static str {
7189 "type.googleapis.com/google.cloud.networkmanagement.v1.InterconnectAttachmentInfo"
7190 }
7191}
7192
7193pub mod interconnect_attachment_info {
7195 #[allow(unused_imports)]
7196 use super::*;
7197
7198 #[derive(Clone, Debug, PartialEq)]
7214 #[non_exhaustive]
7215 pub enum Type {
7216 Unspecified,
7218 Dedicated,
7220 Partner,
7222 PartnerProvider,
7224 L2Dedicated,
7226 UnknownValue(r#type::UnknownValue),
7231 }
7232
7233 #[doc(hidden)]
7234 pub mod r#type {
7235 #[allow(unused_imports)]
7236 use super::*;
7237 #[derive(Clone, Debug, PartialEq)]
7238 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7239 }
7240
7241 impl Type {
7242 pub fn value(&self) -> std::option::Option<i32> {
7247 match self {
7248 Self::Unspecified => std::option::Option::Some(0),
7249 Self::Dedicated => std::option::Option::Some(1),
7250 Self::Partner => std::option::Option::Some(2),
7251 Self::PartnerProvider => std::option::Option::Some(3),
7252 Self::L2Dedicated => std::option::Option::Some(4),
7253 Self::UnknownValue(u) => u.0.value(),
7254 }
7255 }
7256
7257 pub fn name(&self) -> std::option::Option<&str> {
7262 match self {
7263 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
7264 Self::Dedicated => std::option::Option::Some("DEDICATED"),
7265 Self::Partner => std::option::Option::Some("PARTNER"),
7266 Self::PartnerProvider => std::option::Option::Some("PARTNER_PROVIDER"),
7267 Self::L2Dedicated => std::option::Option::Some("L2_DEDICATED"),
7268 Self::UnknownValue(u) => u.0.name(),
7269 }
7270 }
7271 }
7272
7273 impl std::default::Default for Type {
7274 fn default() -> Self {
7275 use std::convert::From;
7276 Self::from(0)
7277 }
7278 }
7279
7280 impl std::fmt::Display for Type {
7281 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7282 wkt::internal::display_enum(f, self.name(), self.value())
7283 }
7284 }
7285
7286 impl std::convert::From<i32> for Type {
7287 fn from(value: i32) -> Self {
7288 match value {
7289 0 => Self::Unspecified,
7290 1 => Self::Dedicated,
7291 2 => Self::Partner,
7292 3 => Self::PartnerProvider,
7293 4 => Self::L2Dedicated,
7294 _ => Self::UnknownValue(r#type::UnknownValue(
7295 wkt::internal::UnknownEnumValue::Integer(value),
7296 )),
7297 }
7298 }
7299 }
7300
7301 impl std::convert::From<&str> for Type {
7302 fn from(value: &str) -> Self {
7303 use std::string::ToString;
7304 match value {
7305 "TYPE_UNSPECIFIED" => Self::Unspecified,
7306 "DEDICATED" => Self::Dedicated,
7307 "PARTNER" => Self::Partner,
7308 "PARTNER_PROVIDER" => Self::PartnerProvider,
7309 "L2_DEDICATED" => Self::L2Dedicated,
7310 _ => Self::UnknownValue(r#type::UnknownValue(
7311 wkt::internal::UnknownEnumValue::String(value.to_string()),
7312 )),
7313 }
7314 }
7315 }
7316
7317 impl serde::ser::Serialize for Type {
7318 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7319 where
7320 S: serde::Serializer,
7321 {
7322 match self {
7323 Self::Unspecified => serializer.serialize_i32(0),
7324 Self::Dedicated => serializer.serialize_i32(1),
7325 Self::Partner => serializer.serialize_i32(2),
7326 Self::PartnerProvider => serializer.serialize_i32(3),
7327 Self::L2Dedicated => serializer.serialize_i32(4),
7328 Self::UnknownValue(u) => u.0.serialize(serializer),
7329 }
7330 }
7331 }
7332
7333 impl<'de> serde::de::Deserialize<'de> for Type {
7334 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7335 where
7336 D: serde::Deserializer<'de>,
7337 {
7338 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
7339 ".google.cloud.networkmanagement.v1.InterconnectAttachmentInfo.Type",
7340 ))
7341 }
7342 }
7343}
7344
7345#[derive(Clone, Default, PartialEq)]
7349#[non_exhaustive]
7350pub struct EndpointInfo {
7351 pub source_ip: std::string::String,
7353
7354 pub destination_ip: std::string::String,
7356
7357 pub protocol: std::string::String,
7359
7360 pub source_port: i32,
7362
7363 pub destination_port: i32,
7365
7366 pub source_network_uri: std::string::String,
7368
7369 pub destination_network_uri: std::string::String,
7371
7372 pub source_agent_uri: std::string::String,
7374
7375 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7376}
7377
7378impl EndpointInfo {
7379 pub fn new() -> Self {
7380 std::default::Default::default()
7381 }
7382
7383 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7385 self.source_ip = v.into();
7386 self
7387 }
7388
7389 pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7391 self.destination_ip = v.into();
7392 self
7393 }
7394
7395 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7397 self.protocol = v.into();
7398 self
7399 }
7400
7401 pub fn set_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7403 self.source_port = v.into();
7404 self
7405 }
7406
7407 pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7409 self.destination_port = v.into();
7410 self
7411 }
7412
7413 pub fn set_source_network_uri<T: std::convert::Into<std::string::String>>(
7415 mut self,
7416 v: T,
7417 ) -> Self {
7418 self.source_network_uri = v.into();
7419 self
7420 }
7421
7422 pub fn set_destination_network_uri<T: std::convert::Into<std::string::String>>(
7424 mut self,
7425 v: T,
7426 ) -> Self {
7427 self.destination_network_uri = v.into();
7428 self
7429 }
7430
7431 pub fn set_source_agent_uri<T: std::convert::Into<std::string::String>>(
7433 mut self,
7434 v: T,
7435 ) -> Self {
7436 self.source_agent_uri = v.into();
7437 self
7438 }
7439}
7440
7441impl wkt::message::Message for EndpointInfo {
7442 fn typename() -> &'static str {
7443 "type.googleapis.com/google.cloud.networkmanagement.v1.EndpointInfo"
7444 }
7445}
7446
7447#[derive(Clone, Default, PartialEq)]
7449#[non_exhaustive]
7450pub struct DeliverInfo {
7451 pub target: crate::model::deliver_info::Target,
7453
7454 pub resource_uri: std::string::String,
7456
7457 pub ip_address: std::string::String,
7459
7460 pub storage_bucket: std::string::String,
7463
7464 pub psc_google_api_target: std::string::String,
7466
7467 pub google_service_type: crate::model::deliver_info::GoogleServiceType,
7470
7471 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7472}
7473
7474impl DeliverInfo {
7475 pub fn new() -> Self {
7476 std::default::Default::default()
7477 }
7478
7479 pub fn set_target<T: std::convert::Into<crate::model::deliver_info::Target>>(
7481 mut self,
7482 v: T,
7483 ) -> Self {
7484 self.target = v.into();
7485 self
7486 }
7487
7488 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7490 self.resource_uri = v.into();
7491 self
7492 }
7493
7494 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7496 self.ip_address = v.into();
7497 self
7498 }
7499
7500 pub fn set_storage_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7502 self.storage_bucket = v.into();
7503 self
7504 }
7505
7506 pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
7508 mut self,
7509 v: T,
7510 ) -> Self {
7511 self.psc_google_api_target = v.into();
7512 self
7513 }
7514
7515 pub fn set_google_service_type<
7517 T: std::convert::Into<crate::model::deliver_info::GoogleServiceType>,
7518 >(
7519 mut self,
7520 v: T,
7521 ) -> Self {
7522 self.google_service_type = v.into();
7523 self
7524 }
7525}
7526
7527impl wkt::message::Message for DeliverInfo {
7528 fn typename() -> &'static str {
7529 "type.googleapis.com/google.cloud.networkmanagement.v1.DeliverInfo"
7530 }
7531}
7532
7533pub mod deliver_info {
7535 #[allow(unused_imports)]
7536 use super::*;
7537
7538 #[derive(Clone, Debug, PartialEq)]
7554 #[non_exhaustive]
7555 pub enum Target {
7556 Unspecified,
7558 Instance,
7560 Internet,
7562 GoogleApi,
7564 GkeMaster,
7566 CloudSqlInstance,
7568 PscPublishedService,
7571 PscGoogleApi,
7574 PscVpcSc,
7577 ServerlessNeg,
7579 StorageBucket,
7581 PrivateNetwork,
7583 CloudFunction,
7585 AppEngineVersion,
7587 CloudRunRevision,
7589 GoogleManagedService,
7591 RedisInstance,
7593 RedisCluster,
7595 UnknownValue(target::UnknownValue),
7600 }
7601
7602 #[doc(hidden)]
7603 pub mod target {
7604 #[allow(unused_imports)]
7605 use super::*;
7606 #[derive(Clone, Debug, PartialEq)]
7607 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7608 }
7609
7610 impl Target {
7611 pub fn value(&self) -> std::option::Option<i32> {
7616 match self {
7617 Self::Unspecified => std::option::Option::Some(0),
7618 Self::Instance => std::option::Option::Some(1),
7619 Self::Internet => std::option::Option::Some(2),
7620 Self::GoogleApi => std::option::Option::Some(3),
7621 Self::GkeMaster => std::option::Option::Some(4),
7622 Self::CloudSqlInstance => std::option::Option::Some(5),
7623 Self::PscPublishedService => std::option::Option::Some(6),
7624 Self::PscGoogleApi => std::option::Option::Some(7),
7625 Self::PscVpcSc => std::option::Option::Some(8),
7626 Self::ServerlessNeg => std::option::Option::Some(9),
7627 Self::StorageBucket => std::option::Option::Some(10),
7628 Self::PrivateNetwork => std::option::Option::Some(11),
7629 Self::CloudFunction => std::option::Option::Some(12),
7630 Self::AppEngineVersion => std::option::Option::Some(13),
7631 Self::CloudRunRevision => std::option::Option::Some(14),
7632 Self::GoogleManagedService => std::option::Option::Some(15),
7633 Self::RedisInstance => std::option::Option::Some(16),
7634 Self::RedisCluster => std::option::Option::Some(17),
7635 Self::UnknownValue(u) => u.0.value(),
7636 }
7637 }
7638
7639 pub fn name(&self) -> std::option::Option<&str> {
7644 match self {
7645 Self::Unspecified => std::option::Option::Some("TARGET_UNSPECIFIED"),
7646 Self::Instance => std::option::Option::Some("INSTANCE"),
7647 Self::Internet => std::option::Option::Some("INTERNET"),
7648 Self::GoogleApi => std::option::Option::Some("GOOGLE_API"),
7649 Self::GkeMaster => std::option::Option::Some("GKE_MASTER"),
7650 Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
7651 Self::PscPublishedService => std::option::Option::Some("PSC_PUBLISHED_SERVICE"),
7652 Self::PscGoogleApi => std::option::Option::Some("PSC_GOOGLE_API"),
7653 Self::PscVpcSc => std::option::Option::Some("PSC_VPC_SC"),
7654 Self::ServerlessNeg => std::option::Option::Some("SERVERLESS_NEG"),
7655 Self::StorageBucket => std::option::Option::Some("STORAGE_BUCKET"),
7656 Self::PrivateNetwork => std::option::Option::Some("PRIVATE_NETWORK"),
7657 Self::CloudFunction => std::option::Option::Some("CLOUD_FUNCTION"),
7658 Self::AppEngineVersion => std::option::Option::Some("APP_ENGINE_VERSION"),
7659 Self::CloudRunRevision => std::option::Option::Some("CLOUD_RUN_REVISION"),
7660 Self::GoogleManagedService => std::option::Option::Some("GOOGLE_MANAGED_SERVICE"),
7661 Self::RedisInstance => std::option::Option::Some("REDIS_INSTANCE"),
7662 Self::RedisCluster => std::option::Option::Some("REDIS_CLUSTER"),
7663 Self::UnknownValue(u) => u.0.name(),
7664 }
7665 }
7666 }
7667
7668 impl std::default::Default for Target {
7669 fn default() -> Self {
7670 use std::convert::From;
7671 Self::from(0)
7672 }
7673 }
7674
7675 impl std::fmt::Display for Target {
7676 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7677 wkt::internal::display_enum(f, self.name(), self.value())
7678 }
7679 }
7680
7681 impl std::convert::From<i32> for Target {
7682 fn from(value: i32) -> Self {
7683 match value {
7684 0 => Self::Unspecified,
7685 1 => Self::Instance,
7686 2 => Self::Internet,
7687 3 => Self::GoogleApi,
7688 4 => Self::GkeMaster,
7689 5 => Self::CloudSqlInstance,
7690 6 => Self::PscPublishedService,
7691 7 => Self::PscGoogleApi,
7692 8 => Self::PscVpcSc,
7693 9 => Self::ServerlessNeg,
7694 10 => Self::StorageBucket,
7695 11 => Self::PrivateNetwork,
7696 12 => Self::CloudFunction,
7697 13 => Self::AppEngineVersion,
7698 14 => Self::CloudRunRevision,
7699 15 => Self::GoogleManagedService,
7700 16 => Self::RedisInstance,
7701 17 => Self::RedisCluster,
7702 _ => Self::UnknownValue(target::UnknownValue(
7703 wkt::internal::UnknownEnumValue::Integer(value),
7704 )),
7705 }
7706 }
7707 }
7708
7709 impl std::convert::From<&str> for Target {
7710 fn from(value: &str) -> Self {
7711 use std::string::ToString;
7712 match value {
7713 "TARGET_UNSPECIFIED" => Self::Unspecified,
7714 "INSTANCE" => Self::Instance,
7715 "INTERNET" => Self::Internet,
7716 "GOOGLE_API" => Self::GoogleApi,
7717 "GKE_MASTER" => Self::GkeMaster,
7718 "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
7719 "PSC_PUBLISHED_SERVICE" => Self::PscPublishedService,
7720 "PSC_GOOGLE_API" => Self::PscGoogleApi,
7721 "PSC_VPC_SC" => Self::PscVpcSc,
7722 "SERVERLESS_NEG" => Self::ServerlessNeg,
7723 "STORAGE_BUCKET" => Self::StorageBucket,
7724 "PRIVATE_NETWORK" => Self::PrivateNetwork,
7725 "CLOUD_FUNCTION" => Self::CloudFunction,
7726 "APP_ENGINE_VERSION" => Self::AppEngineVersion,
7727 "CLOUD_RUN_REVISION" => Self::CloudRunRevision,
7728 "GOOGLE_MANAGED_SERVICE" => Self::GoogleManagedService,
7729 "REDIS_INSTANCE" => Self::RedisInstance,
7730 "REDIS_CLUSTER" => Self::RedisCluster,
7731 _ => Self::UnknownValue(target::UnknownValue(
7732 wkt::internal::UnknownEnumValue::String(value.to_string()),
7733 )),
7734 }
7735 }
7736 }
7737
7738 impl serde::ser::Serialize for Target {
7739 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7740 where
7741 S: serde::Serializer,
7742 {
7743 match self {
7744 Self::Unspecified => serializer.serialize_i32(0),
7745 Self::Instance => serializer.serialize_i32(1),
7746 Self::Internet => serializer.serialize_i32(2),
7747 Self::GoogleApi => serializer.serialize_i32(3),
7748 Self::GkeMaster => serializer.serialize_i32(4),
7749 Self::CloudSqlInstance => serializer.serialize_i32(5),
7750 Self::PscPublishedService => serializer.serialize_i32(6),
7751 Self::PscGoogleApi => serializer.serialize_i32(7),
7752 Self::PscVpcSc => serializer.serialize_i32(8),
7753 Self::ServerlessNeg => serializer.serialize_i32(9),
7754 Self::StorageBucket => serializer.serialize_i32(10),
7755 Self::PrivateNetwork => serializer.serialize_i32(11),
7756 Self::CloudFunction => serializer.serialize_i32(12),
7757 Self::AppEngineVersion => serializer.serialize_i32(13),
7758 Self::CloudRunRevision => serializer.serialize_i32(14),
7759 Self::GoogleManagedService => serializer.serialize_i32(15),
7760 Self::RedisInstance => serializer.serialize_i32(16),
7761 Self::RedisCluster => serializer.serialize_i32(17),
7762 Self::UnknownValue(u) => u.0.serialize(serializer),
7763 }
7764 }
7765 }
7766
7767 impl<'de> serde::de::Deserialize<'de> for Target {
7768 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7769 where
7770 D: serde::Deserializer<'de>,
7771 {
7772 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Target>::new(
7773 ".google.cloud.networkmanagement.v1.DeliverInfo.Target",
7774 ))
7775 }
7776 }
7777
7778 #[derive(Clone, Debug, PartialEq)]
7794 #[non_exhaustive]
7795 pub enum GoogleServiceType {
7796 Unspecified,
7798 Iap,
7801 GfeProxyOrHealthCheckProber,
7807 CloudDns,
7812 PrivateGoogleAccess,
7814 ServerlessVpcAccess,
7819 UnknownValue(google_service_type::UnknownValue),
7824 }
7825
7826 #[doc(hidden)]
7827 pub mod google_service_type {
7828 #[allow(unused_imports)]
7829 use super::*;
7830 #[derive(Clone, Debug, PartialEq)]
7831 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7832 }
7833
7834 impl GoogleServiceType {
7835 pub fn value(&self) -> std::option::Option<i32> {
7840 match self {
7841 Self::Unspecified => std::option::Option::Some(0),
7842 Self::Iap => std::option::Option::Some(1),
7843 Self::GfeProxyOrHealthCheckProber => std::option::Option::Some(2),
7844 Self::CloudDns => std::option::Option::Some(3),
7845 Self::PrivateGoogleAccess => std::option::Option::Some(4),
7846 Self::ServerlessVpcAccess => std::option::Option::Some(5),
7847 Self::UnknownValue(u) => u.0.value(),
7848 }
7849 }
7850
7851 pub fn name(&self) -> std::option::Option<&str> {
7856 match self {
7857 Self::Unspecified => std::option::Option::Some("GOOGLE_SERVICE_TYPE_UNSPECIFIED"),
7858 Self::Iap => std::option::Option::Some("IAP"),
7859 Self::GfeProxyOrHealthCheckProber => {
7860 std::option::Option::Some("GFE_PROXY_OR_HEALTH_CHECK_PROBER")
7861 }
7862 Self::CloudDns => std::option::Option::Some("CLOUD_DNS"),
7863 Self::PrivateGoogleAccess => std::option::Option::Some("PRIVATE_GOOGLE_ACCESS"),
7864 Self::ServerlessVpcAccess => std::option::Option::Some("SERVERLESS_VPC_ACCESS"),
7865 Self::UnknownValue(u) => u.0.name(),
7866 }
7867 }
7868 }
7869
7870 impl std::default::Default for GoogleServiceType {
7871 fn default() -> Self {
7872 use std::convert::From;
7873 Self::from(0)
7874 }
7875 }
7876
7877 impl std::fmt::Display for GoogleServiceType {
7878 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7879 wkt::internal::display_enum(f, self.name(), self.value())
7880 }
7881 }
7882
7883 impl std::convert::From<i32> for GoogleServiceType {
7884 fn from(value: i32) -> Self {
7885 match value {
7886 0 => Self::Unspecified,
7887 1 => Self::Iap,
7888 2 => Self::GfeProxyOrHealthCheckProber,
7889 3 => Self::CloudDns,
7890 4 => Self::PrivateGoogleAccess,
7891 5 => Self::ServerlessVpcAccess,
7892 _ => Self::UnknownValue(google_service_type::UnknownValue(
7893 wkt::internal::UnknownEnumValue::Integer(value),
7894 )),
7895 }
7896 }
7897 }
7898
7899 impl std::convert::From<&str> for GoogleServiceType {
7900 fn from(value: &str) -> Self {
7901 use std::string::ToString;
7902 match value {
7903 "GOOGLE_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
7904 "IAP" => Self::Iap,
7905 "GFE_PROXY_OR_HEALTH_CHECK_PROBER" => Self::GfeProxyOrHealthCheckProber,
7906 "CLOUD_DNS" => Self::CloudDns,
7907 "PRIVATE_GOOGLE_ACCESS" => Self::PrivateGoogleAccess,
7908 "SERVERLESS_VPC_ACCESS" => Self::ServerlessVpcAccess,
7909 _ => Self::UnknownValue(google_service_type::UnknownValue(
7910 wkt::internal::UnknownEnumValue::String(value.to_string()),
7911 )),
7912 }
7913 }
7914 }
7915
7916 impl serde::ser::Serialize for GoogleServiceType {
7917 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7918 where
7919 S: serde::Serializer,
7920 {
7921 match self {
7922 Self::Unspecified => serializer.serialize_i32(0),
7923 Self::Iap => serializer.serialize_i32(1),
7924 Self::GfeProxyOrHealthCheckProber => serializer.serialize_i32(2),
7925 Self::CloudDns => serializer.serialize_i32(3),
7926 Self::PrivateGoogleAccess => serializer.serialize_i32(4),
7927 Self::ServerlessVpcAccess => serializer.serialize_i32(5),
7928 Self::UnknownValue(u) => u.0.serialize(serializer),
7929 }
7930 }
7931 }
7932
7933 impl<'de> serde::de::Deserialize<'de> for GoogleServiceType {
7934 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7935 where
7936 D: serde::Deserializer<'de>,
7937 {
7938 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GoogleServiceType>::new(
7939 ".google.cloud.networkmanagement.v1.DeliverInfo.GoogleServiceType",
7940 ))
7941 }
7942 }
7943}
7944
7945#[derive(Clone, Default, PartialEq)]
7947#[non_exhaustive]
7948pub struct ForwardInfo {
7949 pub target: crate::model::forward_info::Target,
7951
7952 pub resource_uri: std::string::String,
7954
7955 pub ip_address: std::string::String,
7957
7958 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7959}
7960
7961impl ForwardInfo {
7962 pub fn new() -> Self {
7963 std::default::Default::default()
7964 }
7965
7966 pub fn set_target<T: std::convert::Into<crate::model::forward_info::Target>>(
7968 mut self,
7969 v: T,
7970 ) -> Self {
7971 self.target = v.into();
7972 self
7973 }
7974
7975 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7977 self.resource_uri = v.into();
7978 self
7979 }
7980
7981 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7983 self.ip_address = v.into();
7984 self
7985 }
7986}
7987
7988impl wkt::message::Message for ForwardInfo {
7989 fn typename() -> &'static str {
7990 "type.googleapis.com/google.cloud.networkmanagement.v1.ForwardInfo"
7991 }
7992}
7993
7994pub mod forward_info {
7996 #[allow(unused_imports)]
7997 use super::*;
7998
7999 #[derive(Clone, Debug, PartialEq)]
8015 #[non_exhaustive]
8016 pub enum Target {
8017 Unspecified,
8019 PeeringVpc,
8021 VpnGateway,
8023 Interconnect,
8025 #[deprecated]
8027 GkeMaster,
8028 ImportedCustomRouteNextHop,
8030 #[deprecated]
8032 CloudSqlInstance,
8033 AnotherProject,
8035 NccHub,
8037 RouterAppliance,
8039 SecureWebProxyGateway,
8041 UnknownValue(target::UnknownValue),
8046 }
8047
8048 #[doc(hidden)]
8049 pub mod target {
8050 #[allow(unused_imports)]
8051 use super::*;
8052 #[derive(Clone, Debug, PartialEq)]
8053 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8054 }
8055
8056 impl Target {
8057 pub fn value(&self) -> std::option::Option<i32> {
8062 match self {
8063 Self::Unspecified => std::option::Option::Some(0),
8064 Self::PeeringVpc => std::option::Option::Some(1),
8065 Self::VpnGateway => std::option::Option::Some(2),
8066 Self::Interconnect => std::option::Option::Some(3),
8067 Self::GkeMaster => std::option::Option::Some(4),
8068 Self::ImportedCustomRouteNextHop => std::option::Option::Some(5),
8069 Self::CloudSqlInstance => std::option::Option::Some(6),
8070 Self::AnotherProject => std::option::Option::Some(7),
8071 Self::NccHub => std::option::Option::Some(8),
8072 Self::RouterAppliance => std::option::Option::Some(9),
8073 Self::SecureWebProxyGateway => std::option::Option::Some(10),
8074 Self::UnknownValue(u) => u.0.value(),
8075 }
8076 }
8077
8078 pub fn name(&self) -> std::option::Option<&str> {
8083 match self {
8084 Self::Unspecified => std::option::Option::Some("TARGET_UNSPECIFIED"),
8085 Self::PeeringVpc => std::option::Option::Some("PEERING_VPC"),
8086 Self::VpnGateway => std::option::Option::Some("VPN_GATEWAY"),
8087 Self::Interconnect => std::option::Option::Some("INTERCONNECT"),
8088 Self::GkeMaster => std::option::Option::Some("GKE_MASTER"),
8089 Self::ImportedCustomRouteNextHop => {
8090 std::option::Option::Some("IMPORTED_CUSTOM_ROUTE_NEXT_HOP")
8091 }
8092 Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
8093 Self::AnotherProject => std::option::Option::Some("ANOTHER_PROJECT"),
8094 Self::NccHub => std::option::Option::Some("NCC_HUB"),
8095 Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
8096 Self::SecureWebProxyGateway => {
8097 std::option::Option::Some("SECURE_WEB_PROXY_GATEWAY")
8098 }
8099 Self::UnknownValue(u) => u.0.name(),
8100 }
8101 }
8102 }
8103
8104 impl std::default::Default for Target {
8105 fn default() -> Self {
8106 use std::convert::From;
8107 Self::from(0)
8108 }
8109 }
8110
8111 impl std::fmt::Display for Target {
8112 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8113 wkt::internal::display_enum(f, self.name(), self.value())
8114 }
8115 }
8116
8117 impl std::convert::From<i32> for Target {
8118 fn from(value: i32) -> Self {
8119 match value {
8120 0 => Self::Unspecified,
8121 1 => Self::PeeringVpc,
8122 2 => Self::VpnGateway,
8123 3 => Self::Interconnect,
8124 4 => Self::GkeMaster,
8125 5 => Self::ImportedCustomRouteNextHop,
8126 6 => Self::CloudSqlInstance,
8127 7 => Self::AnotherProject,
8128 8 => Self::NccHub,
8129 9 => Self::RouterAppliance,
8130 10 => Self::SecureWebProxyGateway,
8131 _ => Self::UnknownValue(target::UnknownValue(
8132 wkt::internal::UnknownEnumValue::Integer(value),
8133 )),
8134 }
8135 }
8136 }
8137
8138 impl std::convert::From<&str> for Target {
8139 fn from(value: &str) -> Self {
8140 use std::string::ToString;
8141 match value {
8142 "TARGET_UNSPECIFIED" => Self::Unspecified,
8143 "PEERING_VPC" => Self::PeeringVpc,
8144 "VPN_GATEWAY" => Self::VpnGateway,
8145 "INTERCONNECT" => Self::Interconnect,
8146 "GKE_MASTER" => Self::GkeMaster,
8147 "IMPORTED_CUSTOM_ROUTE_NEXT_HOP" => Self::ImportedCustomRouteNextHop,
8148 "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
8149 "ANOTHER_PROJECT" => Self::AnotherProject,
8150 "NCC_HUB" => Self::NccHub,
8151 "ROUTER_APPLIANCE" => Self::RouterAppliance,
8152 "SECURE_WEB_PROXY_GATEWAY" => Self::SecureWebProxyGateway,
8153 _ => Self::UnknownValue(target::UnknownValue(
8154 wkt::internal::UnknownEnumValue::String(value.to_string()),
8155 )),
8156 }
8157 }
8158 }
8159
8160 impl serde::ser::Serialize for Target {
8161 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8162 where
8163 S: serde::Serializer,
8164 {
8165 match self {
8166 Self::Unspecified => serializer.serialize_i32(0),
8167 Self::PeeringVpc => serializer.serialize_i32(1),
8168 Self::VpnGateway => serializer.serialize_i32(2),
8169 Self::Interconnect => serializer.serialize_i32(3),
8170 Self::GkeMaster => serializer.serialize_i32(4),
8171 Self::ImportedCustomRouteNextHop => serializer.serialize_i32(5),
8172 Self::CloudSqlInstance => serializer.serialize_i32(6),
8173 Self::AnotherProject => serializer.serialize_i32(7),
8174 Self::NccHub => serializer.serialize_i32(8),
8175 Self::RouterAppliance => serializer.serialize_i32(9),
8176 Self::SecureWebProxyGateway => serializer.serialize_i32(10),
8177 Self::UnknownValue(u) => u.0.serialize(serializer),
8178 }
8179 }
8180 }
8181
8182 impl<'de> serde::de::Deserialize<'de> for Target {
8183 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8184 where
8185 D: serde::Deserializer<'de>,
8186 {
8187 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Target>::new(
8188 ".google.cloud.networkmanagement.v1.ForwardInfo.Target",
8189 ))
8190 }
8191 }
8192}
8193
8194#[derive(Clone, Default, PartialEq)]
8196#[non_exhaustive]
8197pub struct AbortInfo {
8198 pub cause: crate::model::abort_info::Cause,
8200
8201 pub resource_uri: std::string::String,
8203
8204 pub ip_address: std::string::String,
8206
8207 pub projects_missing_permission: std::vec::Vec<std::string::String>,
8210
8211 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8212}
8213
8214impl AbortInfo {
8215 pub fn new() -> Self {
8216 std::default::Default::default()
8217 }
8218
8219 pub fn set_cause<T: std::convert::Into<crate::model::abort_info::Cause>>(
8221 mut self,
8222 v: T,
8223 ) -> Self {
8224 self.cause = v.into();
8225 self
8226 }
8227
8228 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8230 self.resource_uri = v.into();
8231 self
8232 }
8233
8234 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8236 self.ip_address = v.into();
8237 self
8238 }
8239
8240 pub fn set_projects_missing_permission<T, V>(mut self, v: T) -> Self
8242 where
8243 T: std::iter::IntoIterator<Item = V>,
8244 V: std::convert::Into<std::string::String>,
8245 {
8246 use std::iter::Iterator;
8247 self.projects_missing_permission = v.into_iter().map(|i| i.into()).collect();
8248 self
8249 }
8250}
8251
8252impl wkt::message::Message for AbortInfo {
8253 fn typename() -> &'static str {
8254 "type.googleapis.com/google.cloud.networkmanagement.v1.AbortInfo"
8255 }
8256}
8257
8258pub mod abort_info {
8260 #[allow(unused_imports)]
8261 use super::*;
8262
8263 #[derive(Clone, Debug, PartialEq)]
8279 #[non_exhaustive]
8280 pub enum Cause {
8281 Unspecified,
8283 #[deprecated]
8285 UnknownNetwork,
8286 #[deprecated]
8289 UnknownProject,
8290 #[deprecated]
8293 NoExternalIp,
8294 #[deprecated]
8298 UnintendedDestination,
8299 #[deprecated]
8302 SourceEndpointNotFound,
8303 #[deprecated]
8306 MismatchedSourceNetwork,
8307 #[deprecated]
8310 DestinationEndpointNotFound,
8311 #[deprecated]
8314 MismatchedDestinationNetwork,
8315 UnknownIp,
8318 GoogleManagedServiceUnknownIp,
8321 SourceIpAddressNotInSourceNetwork,
8324 PermissionDenied,
8327 PermissionDeniedNoCloudNatConfigs,
8330 PermissionDeniedNoNegEndpointConfigs,
8333 PermissionDeniedNoCloudRouterConfigs,
8336 NoSourceLocation,
8339 InvalidArgument,
8348 TraceTooLong,
8351 InternalError,
8353 Unsupported,
8355 MismatchedIpVersion,
8358 GkeKonnectivityProxyUnsupported,
8362 ResourceConfigNotFound,
8364 VmInstanceConfigNotFound,
8366 NetworkConfigNotFound,
8368 FirewallConfigNotFound,
8370 RouteConfigNotFound,
8372 GoogleManagedServiceAmbiguousPscEndpoint,
8375 GoogleManagedServiceAmbiguousEndpoint,
8378 SourcePscCloudSqlUnsupported,
8381 SourceRedisClusterUnsupported,
8383 SourceRedisInstanceUnsupported,
8386 SourceForwardingRuleUnsupported,
8389 NonRoutableIpAddress,
8392 UnknownIssueInGoogleManagedProject,
8394 UnsupportedGoogleManagedProjectConfig,
8397 NoServerlessIpRanges,
8400 IpVersionProtocolMismatch,
8403 UnknownValue(cause::UnknownValue),
8408 }
8409
8410 #[doc(hidden)]
8411 pub mod cause {
8412 #[allow(unused_imports)]
8413 use super::*;
8414 #[derive(Clone, Debug, PartialEq)]
8415 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8416 }
8417
8418 impl Cause {
8419 pub fn value(&self) -> std::option::Option<i32> {
8424 match self {
8425 Self::Unspecified => std::option::Option::Some(0),
8426 Self::UnknownNetwork => std::option::Option::Some(1),
8427 Self::UnknownProject => std::option::Option::Some(3),
8428 Self::NoExternalIp => std::option::Option::Some(7),
8429 Self::UnintendedDestination => std::option::Option::Some(8),
8430 Self::SourceEndpointNotFound => std::option::Option::Some(11),
8431 Self::MismatchedSourceNetwork => std::option::Option::Some(12),
8432 Self::DestinationEndpointNotFound => std::option::Option::Some(13),
8433 Self::MismatchedDestinationNetwork => std::option::Option::Some(14),
8434 Self::UnknownIp => std::option::Option::Some(2),
8435 Self::GoogleManagedServiceUnknownIp => std::option::Option::Some(32),
8436 Self::SourceIpAddressNotInSourceNetwork => std::option::Option::Some(23),
8437 Self::PermissionDenied => std::option::Option::Some(4),
8438 Self::PermissionDeniedNoCloudNatConfigs => std::option::Option::Some(28),
8439 Self::PermissionDeniedNoNegEndpointConfigs => std::option::Option::Some(29),
8440 Self::PermissionDeniedNoCloudRouterConfigs => std::option::Option::Some(36),
8441 Self::NoSourceLocation => std::option::Option::Some(5),
8442 Self::InvalidArgument => std::option::Option::Some(6),
8443 Self::TraceTooLong => std::option::Option::Some(9),
8444 Self::InternalError => std::option::Option::Some(10),
8445 Self::Unsupported => std::option::Option::Some(15),
8446 Self::MismatchedIpVersion => std::option::Option::Some(16),
8447 Self::GkeKonnectivityProxyUnsupported => std::option::Option::Some(17),
8448 Self::ResourceConfigNotFound => std::option::Option::Some(18),
8449 Self::VmInstanceConfigNotFound => std::option::Option::Some(24),
8450 Self::NetworkConfigNotFound => std::option::Option::Some(25),
8451 Self::FirewallConfigNotFound => std::option::Option::Some(26),
8452 Self::RouteConfigNotFound => std::option::Option::Some(27),
8453 Self::GoogleManagedServiceAmbiguousPscEndpoint => std::option::Option::Some(19),
8454 Self::GoogleManagedServiceAmbiguousEndpoint => std::option::Option::Some(39),
8455 Self::SourcePscCloudSqlUnsupported => std::option::Option::Some(20),
8456 Self::SourceRedisClusterUnsupported => std::option::Option::Some(34),
8457 Self::SourceRedisInstanceUnsupported => std::option::Option::Some(35),
8458 Self::SourceForwardingRuleUnsupported => std::option::Option::Some(21),
8459 Self::NonRoutableIpAddress => std::option::Option::Some(22),
8460 Self::UnknownIssueInGoogleManagedProject => std::option::Option::Some(30),
8461 Self::UnsupportedGoogleManagedProjectConfig => std::option::Option::Some(31),
8462 Self::NoServerlessIpRanges => std::option::Option::Some(37),
8463 Self::IpVersionProtocolMismatch => std::option::Option::Some(40),
8464 Self::UnknownValue(u) => u.0.value(),
8465 }
8466 }
8467
8468 pub fn name(&self) -> std::option::Option<&str> {
8473 match self {
8474 Self::Unspecified => std::option::Option::Some("CAUSE_UNSPECIFIED"),
8475 Self::UnknownNetwork => std::option::Option::Some("UNKNOWN_NETWORK"),
8476 Self::UnknownProject => std::option::Option::Some("UNKNOWN_PROJECT"),
8477 Self::NoExternalIp => std::option::Option::Some("NO_EXTERNAL_IP"),
8478 Self::UnintendedDestination => std::option::Option::Some("UNINTENDED_DESTINATION"),
8479 Self::SourceEndpointNotFound => {
8480 std::option::Option::Some("SOURCE_ENDPOINT_NOT_FOUND")
8481 }
8482 Self::MismatchedSourceNetwork => {
8483 std::option::Option::Some("MISMATCHED_SOURCE_NETWORK")
8484 }
8485 Self::DestinationEndpointNotFound => {
8486 std::option::Option::Some("DESTINATION_ENDPOINT_NOT_FOUND")
8487 }
8488 Self::MismatchedDestinationNetwork => {
8489 std::option::Option::Some("MISMATCHED_DESTINATION_NETWORK")
8490 }
8491 Self::UnknownIp => std::option::Option::Some("UNKNOWN_IP"),
8492 Self::GoogleManagedServiceUnknownIp => {
8493 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_UNKNOWN_IP")
8494 }
8495 Self::SourceIpAddressNotInSourceNetwork => {
8496 std::option::Option::Some("SOURCE_IP_ADDRESS_NOT_IN_SOURCE_NETWORK")
8497 }
8498 Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
8499 Self::PermissionDeniedNoCloudNatConfigs => {
8500 std::option::Option::Some("PERMISSION_DENIED_NO_CLOUD_NAT_CONFIGS")
8501 }
8502 Self::PermissionDeniedNoNegEndpointConfigs => {
8503 std::option::Option::Some("PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS")
8504 }
8505 Self::PermissionDeniedNoCloudRouterConfigs => {
8506 std::option::Option::Some("PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS")
8507 }
8508 Self::NoSourceLocation => std::option::Option::Some("NO_SOURCE_LOCATION"),
8509 Self::InvalidArgument => std::option::Option::Some("INVALID_ARGUMENT"),
8510 Self::TraceTooLong => std::option::Option::Some("TRACE_TOO_LONG"),
8511 Self::InternalError => std::option::Option::Some("INTERNAL_ERROR"),
8512 Self::Unsupported => std::option::Option::Some("UNSUPPORTED"),
8513 Self::MismatchedIpVersion => std::option::Option::Some("MISMATCHED_IP_VERSION"),
8514 Self::GkeKonnectivityProxyUnsupported => {
8515 std::option::Option::Some("GKE_KONNECTIVITY_PROXY_UNSUPPORTED")
8516 }
8517 Self::ResourceConfigNotFound => {
8518 std::option::Option::Some("RESOURCE_CONFIG_NOT_FOUND")
8519 }
8520 Self::VmInstanceConfigNotFound => {
8521 std::option::Option::Some("VM_INSTANCE_CONFIG_NOT_FOUND")
8522 }
8523 Self::NetworkConfigNotFound => {
8524 std::option::Option::Some("NETWORK_CONFIG_NOT_FOUND")
8525 }
8526 Self::FirewallConfigNotFound => {
8527 std::option::Option::Some("FIREWALL_CONFIG_NOT_FOUND")
8528 }
8529 Self::RouteConfigNotFound => std::option::Option::Some("ROUTE_CONFIG_NOT_FOUND"),
8530 Self::GoogleManagedServiceAmbiguousPscEndpoint => {
8531 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT")
8532 }
8533 Self::GoogleManagedServiceAmbiguousEndpoint => {
8534 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT")
8535 }
8536 Self::SourcePscCloudSqlUnsupported => {
8537 std::option::Option::Some("SOURCE_PSC_CLOUD_SQL_UNSUPPORTED")
8538 }
8539 Self::SourceRedisClusterUnsupported => {
8540 std::option::Option::Some("SOURCE_REDIS_CLUSTER_UNSUPPORTED")
8541 }
8542 Self::SourceRedisInstanceUnsupported => {
8543 std::option::Option::Some("SOURCE_REDIS_INSTANCE_UNSUPPORTED")
8544 }
8545 Self::SourceForwardingRuleUnsupported => {
8546 std::option::Option::Some("SOURCE_FORWARDING_RULE_UNSUPPORTED")
8547 }
8548 Self::NonRoutableIpAddress => std::option::Option::Some("NON_ROUTABLE_IP_ADDRESS"),
8549 Self::UnknownIssueInGoogleManagedProject => {
8550 std::option::Option::Some("UNKNOWN_ISSUE_IN_GOOGLE_MANAGED_PROJECT")
8551 }
8552 Self::UnsupportedGoogleManagedProjectConfig => {
8553 std::option::Option::Some("UNSUPPORTED_GOOGLE_MANAGED_PROJECT_CONFIG")
8554 }
8555 Self::NoServerlessIpRanges => std::option::Option::Some("NO_SERVERLESS_IP_RANGES"),
8556 Self::IpVersionProtocolMismatch => {
8557 std::option::Option::Some("IP_VERSION_PROTOCOL_MISMATCH")
8558 }
8559 Self::UnknownValue(u) => u.0.name(),
8560 }
8561 }
8562 }
8563
8564 impl std::default::Default for Cause {
8565 fn default() -> Self {
8566 use std::convert::From;
8567 Self::from(0)
8568 }
8569 }
8570
8571 impl std::fmt::Display for Cause {
8572 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8573 wkt::internal::display_enum(f, self.name(), self.value())
8574 }
8575 }
8576
8577 impl std::convert::From<i32> for Cause {
8578 fn from(value: i32) -> Self {
8579 match value {
8580 0 => Self::Unspecified,
8581 1 => Self::UnknownNetwork,
8582 2 => Self::UnknownIp,
8583 3 => Self::UnknownProject,
8584 4 => Self::PermissionDenied,
8585 5 => Self::NoSourceLocation,
8586 6 => Self::InvalidArgument,
8587 7 => Self::NoExternalIp,
8588 8 => Self::UnintendedDestination,
8589 9 => Self::TraceTooLong,
8590 10 => Self::InternalError,
8591 11 => Self::SourceEndpointNotFound,
8592 12 => Self::MismatchedSourceNetwork,
8593 13 => Self::DestinationEndpointNotFound,
8594 14 => Self::MismatchedDestinationNetwork,
8595 15 => Self::Unsupported,
8596 16 => Self::MismatchedIpVersion,
8597 17 => Self::GkeKonnectivityProxyUnsupported,
8598 18 => Self::ResourceConfigNotFound,
8599 19 => Self::GoogleManagedServiceAmbiguousPscEndpoint,
8600 20 => Self::SourcePscCloudSqlUnsupported,
8601 21 => Self::SourceForwardingRuleUnsupported,
8602 22 => Self::NonRoutableIpAddress,
8603 23 => Self::SourceIpAddressNotInSourceNetwork,
8604 24 => Self::VmInstanceConfigNotFound,
8605 25 => Self::NetworkConfigNotFound,
8606 26 => Self::FirewallConfigNotFound,
8607 27 => Self::RouteConfigNotFound,
8608 28 => Self::PermissionDeniedNoCloudNatConfigs,
8609 29 => Self::PermissionDeniedNoNegEndpointConfigs,
8610 30 => Self::UnknownIssueInGoogleManagedProject,
8611 31 => Self::UnsupportedGoogleManagedProjectConfig,
8612 32 => Self::GoogleManagedServiceUnknownIp,
8613 34 => Self::SourceRedisClusterUnsupported,
8614 35 => Self::SourceRedisInstanceUnsupported,
8615 36 => Self::PermissionDeniedNoCloudRouterConfigs,
8616 37 => Self::NoServerlessIpRanges,
8617 39 => Self::GoogleManagedServiceAmbiguousEndpoint,
8618 40 => Self::IpVersionProtocolMismatch,
8619 _ => Self::UnknownValue(cause::UnknownValue(
8620 wkt::internal::UnknownEnumValue::Integer(value),
8621 )),
8622 }
8623 }
8624 }
8625
8626 impl std::convert::From<&str> for Cause {
8627 fn from(value: &str) -> Self {
8628 use std::string::ToString;
8629 match value {
8630 "CAUSE_UNSPECIFIED" => Self::Unspecified,
8631 "UNKNOWN_NETWORK" => Self::UnknownNetwork,
8632 "UNKNOWN_PROJECT" => Self::UnknownProject,
8633 "NO_EXTERNAL_IP" => Self::NoExternalIp,
8634 "UNINTENDED_DESTINATION" => Self::UnintendedDestination,
8635 "SOURCE_ENDPOINT_NOT_FOUND" => Self::SourceEndpointNotFound,
8636 "MISMATCHED_SOURCE_NETWORK" => Self::MismatchedSourceNetwork,
8637 "DESTINATION_ENDPOINT_NOT_FOUND" => Self::DestinationEndpointNotFound,
8638 "MISMATCHED_DESTINATION_NETWORK" => Self::MismatchedDestinationNetwork,
8639 "UNKNOWN_IP" => Self::UnknownIp,
8640 "GOOGLE_MANAGED_SERVICE_UNKNOWN_IP" => Self::GoogleManagedServiceUnknownIp,
8641 "SOURCE_IP_ADDRESS_NOT_IN_SOURCE_NETWORK" => {
8642 Self::SourceIpAddressNotInSourceNetwork
8643 }
8644 "PERMISSION_DENIED" => Self::PermissionDenied,
8645 "PERMISSION_DENIED_NO_CLOUD_NAT_CONFIGS" => Self::PermissionDeniedNoCloudNatConfigs,
8646 "PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS" => {
8647 Self::PermissionDeniedNoNegEndpointConfigs
8648 }
8649 "PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS" => {
8650 Self::PermissionDeniedNoCloudRouterConfigs
8651 }
8652 "NO_SOURCE_LOCATION" => Self::NoSourceLocation,
8653 "INVALID_ARGUMENT" => Self::InvalidArgument,
8654 "TRACE_TOO_LONG" => Self::TraceTooLong,
8655 "INTERNAL_ERROR" => Self::InternalError,
8656 "UNSUPPORTED" => Self::Unsupported,
8657 "MISMATCHED_IP_VERSION" => Self::MismatchedIpVersion,
8658 "GKE_KONNECTIVITY_PROXY_UNSUPPORTED" => Self::GkeKonnectivityProxyUnsupported,
8659 "RESOURCE_CONFIG_NOT_FOUND" => Self::ResourceConfigNotFound,
8660 "VM_INSTANCE_CONFIG_NOT_FOUND" => Self::VmInstanceConfigNotFound,
8661 "NETWORK_CONFIG_NOT_FOUND" => Self::NetworkConfigNotFound,
8662 "FIREWALL_CONFIG_NOT_FOUND" => Self::FirewallConfigNotFound,
8663 "ROUTE_CONFIG_NOT_FOUND" => Self::RouteConfigNotFound,
8664 "GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT" => {
8665 Self::GoogleManagedServiceAmbiguousPscEndpoint
8666 }
8667 "GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT" => {
8668 Self::GoogleManagedServiceAmbiguousEndpoint
8669 }
8670 "SOURCE_PSC_CLOUD_SQL_UNSUPPORTED" => Self::SourcePscCloudSqlUnsupported,
8671 "SOURCE_REDIS_CLUSTER_UNSUPPORTED" => Self::SourceRedisClusterUnsupported,
8672 "SOURCE_REDIS_INSTANCE_UNSUPPORTED" => Self::SourceRedisInstanceUnsupported,
8673 "SOURCE_FORWARDING_RULE_UNSUPPORTED" => Self::SourceForwardingRuleUnsupported,
8674 "NON_ROUTABLE_IP_ADDRESS" => Self::NonRoutableIpAddress,
8675 "UNKNOWN_ISSUE_IN_GOOGLE_MANAGED_PROJECT" => {
8676 Self::UnknownIssueInGoogleManagedProject
8677 }
8678 "UNSUPPORTED_GOOGLE_MANAGED_PROJECT_CONFIG" => {
8679 Self::UnsupportedGoogleManagedProjectConfig
8680 }
8681 "NO_SERVERLESS_IP_RANGES" => Self::NoServerlessIpRanges,
8682 "IP_VERSION_PROTOCOL_MISMATCH" => Self::IpVersionProtocolMismatch,
8683 _ => Self::UnknownValue(cause::UnknownValue(
8684 wkt::internal::UnknownEnumValue::String(value.to_string()),
8685 )),
8686 }
8687 }
8688 }
8689
8690 impl serde::ser::Serialize for Cause {
8691 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8692 where
8693 S: serde::Serializer,
8694 {
8695 match self {
8696 Self::Unspecified => serializer.serialize_i32(0),
8697 Self::UnknownNetwork => serializer.serialize_i32(1),
8698 Self::UnknownProject => serializer.serialize_i32(3),
8699 Self::NoExternalIp => serializer.serialize_i32(7),
8700 Self::UnintendedDestination => serializer.serialize_i32(8),
8701 Self::SourceEndpointNotFound => serializer.serialize_i32(11),
8702 Self::MismatchedSourceNetwork => serializer.serialize_i32(12),
8703 Self::DestinationEndpointNotFound => serializer.serialize_i32(13),
8704 Self::MismatchedDestinationNetwork => serializer.serialize_i32(14),
8705 Self::UnknownIp => serializer.serialize_i32(2),
8706 Self::GoogleManagedServiceUnknownIp => serializer.serialize_i32(32),
8707 Self::SourceIpAddressNotInSourceNetwork => serializer.serialize_i32(23),
8708 Self::PermissionDenied => serializer.serialize_i32(4),
8709 Self::PermissionDeniedNoCloudNatConfigs => serializer.serialize_i32(28),
8710 Self::PermissionDeniedNoNegEndpointConfigs => serializer.serialize_i32(29),
8711 Self::PermissionDeniedNoCloudRouterConfigs => serializer.serialize_i32(36),
8712 Self::NoSourceLocation => serializer.serialize_i32(5),
8713 Self::InvalidArgument => serializer.serialize_i32(6),
8714 Self::TraceTooLong => serializer.serialize_i32(9),
8715 Self::InternalError => serializer.serialize_i32(10),
8716 Self::Unsupported => serializer.serialize_i32(15),
8717 Self::MismatchedIpVersion => serializer.serialize_i32(16),
8718 Self::GkeKonnectivityProxyUnsupported => serializer.serialize_i32(17),
8719 Self::ResourceConfigNotFound => serializer.serialize_i32(18),
8720 Self::VmInstanceConfigNotFound => serializer.serialize_i32(24),
8721 Self::NetworkConfigNotFound => serializer.serialize_i32(25),
8722 Self::FirewallConfigNotFound => serializer.serialize_i32(26),
8723 Self::RouteConfigNotFound => serializer.serialize_i32(27),
8724 Self::GoogleManagedServiceAmbiguousPscEndpoint => serializer.serialize_i32(19),
8725 Self::GoogleManagedServiceAmbiguousEndpoint => serializer.serialize_i32(39),
8726 Self::SourcePscCloudSqlUnsupported => serializer.serialize_i32(20),
8727 Self::SourceRedisClusterUnsupported => serializer.serialize_i32(34),
8728 Self::SourceRedisInstanceUnsupported => serializer.serialize_i32(35),
8729 Self::SourceForwardingRuleUnsupported => serializer.serialize_i32(21),
8730 Self::NonRoutableIpAddress => serializer.serialize_i32(22),
8731 Self::UnknownIssueInGoogleManagedProject => serializer.serialize_i32(30),
8732 Self::UnsupportedGoogleManagedProjectConfig => serializer.serialize_i32(31),
8733 Self::NoServerlessIpRanges => serializer.serialize_i32(37),
8734 Self::IpVersionProtocolMismatch => serializer.serialize_i32(40),
8735 Self::UnknownValue(u) => u.0.serialize(serializer),
8736 }
8737 }
8738 }
8739
8740 impl<'de> serde::de::Deserialize<'de> for Cause {
8741 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8742 where
8743 D: serde::Deserializer<'de>,
8744 {
8745 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Cause>::new(
8746 ".google.cloud.networkmanagement.v1.AbortInfo.Cause",
8747 ))
8748 }
8749 }
8750}
8751
8752#[derive(Clone, Default, PartialEq)]
8754#[non_exhaustive]
8755pub struct DropInfo {
8756 pub cause: crate::model::drop_info::Cause,
8758
8759 pub resource_uri: std::string::String,
8761
8762 pub source_ip: std::string::String,
8764
8765 pub destination_ip: std::string::String,
8767
8768 pub region: std::string::String,
8770
8771 pub source_geolocation_code: std::string::String,
8773
8774 pub destination_geolocation_code: std::string::String,
8776
8777 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8778}
8779
8780impl DropInfo {
8781 pub fn new() -> Self {
8782 std::default::Default::default()
8783 }
8784
8785 pub fn set_cause<T: std::convert::Into<crate::model::drop_info::Cause>>(
8787 mut self,
8788 v: T,
8789 ) -> Self {
8790 self.cause = v.into();
8791 self
8792 }
8793
8794 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8796 self.resource_uri = v.into();
8797 self
8798 }
8799
8800 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8802 self.source_ip = v.into();
8803 self
8804 }
8805
8806 pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8808 self.destination_ip = v.into();
8809 self
8810 }
8811
8812 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8814 self.region = v.into();
8815 self
8816 }
8817
8818 pub fn set_source_geolocation_code<T: std::convert::Into<std::string::String>>(
8820 mut self,
8821 v: T,
8822 ) -> Self {
8823 self.source_geolocation_code = v.into();
8824 self
8825 }
8826
8827 pub fn set_destination_geolocation_code<T: std::convert::Into<std::string::String>>(
8829 mut self,
8830 v: T,
8831 ) -> Self {
8832 self.destination_geolocation_code = v.into();
8833 self
8834 }
8835}
8836
8837impl wkt::message::Message for DropInfo {
8838 fn typename() -> &'static str {
8839 "type.googleapis.com/google.cloud.networkmanagement.v1.DropInfo"
8840 }
8841}
8842
8843pub mod drop_info {
8845 #[allow(unused_imports)]
8846 use super::*;
8847
8848 #[derive(Clone, Debug, PartialEq)]
8864 #[non_exhaustive]
8865 pub enum Cause {
8866 Unspecified,
8868 UnknownExternalAddress,
8872 ForeignIpDisallowed,
8875 FirewallRule,
8878 NoRoute,
8880 RouteBlackhole,
8882 RouteWrongNetwork,
8886 RouteNextHopIpAddressNotResolved,
8888 RouteNextHopResourceNotFound,
8890 RouteNextHopInstanceWrongNetwork,
8892 RouteNextHopInstanceNonPrimaryIp,
8895 RouteNextHopForwardingRuleIpMismatch,
8897 RouteNextHopVpnTunnelNotEstablished,
8899 RouteNextHopForwardingRuleTypeInvalid,
8902 NoRouteFromInternetToPrivateIpv6Address,
8905 NoRouteFromExternalIpv6SourceToPrivateIpv6Address,
8908 VpnTunnelLocalSelectorMismatch,
8910 VpnTunnelRemoteSelectorMismatch,
8912 PrivateTrafficToInternet,
8914 PrivateGoogleAccessDisallowed,
8918 PrivateGoogleAccessViaVpnTunnelUnsupported,
8922 NoExternalAddress,
8925 UnknownInternalAddress,
8930 ForwardingRuleMismatch,
8932 ForwardingRuleNoInstances,
8934 FirewallBlockingLoadBalancerBackendHealthCheck,
8939 IngressFirewallTagsUnsupportedByDirectVpcEgress,
8943 InstanceNotRunning,
8946 GkeClusterNotRunning,
8948 CloudSqlInstanceNotRunning,
8950 RedisInstanceNotRunning,
8952 RedisClusterNotRunning,
8954 TrafficTypeBlocked,
8959 GkeMasterUnauthorizedAccess,
8964 CloudSqlInstanceUnauthorizedAccess,
8969 DroppedInsideGkeService,
8971 DroppedInsideCloudSqlService,
8973 GoogleManagedServiceNoPeering,
8976 GoogleManagedServiceNoPscEndpoint,
8979 GkePscEndpointMissing,
8982 CloudSqlInstanceNoIpAddress,
8985 GkeControlPlaneRegionMismatch,
8988 PublicGkeControlPlaneToPrivateDestination,
8991 GkeControlPlaneNoRoute,
8994 CloudSqlInstanceNotConfiguredForExternalTraffic,
8998 PublicCloudSqlInstanceToPrivateDestination,
9001 CloudSqlInstanceNoRoute,
9004 CloudSqlConnectorRequired,
9008 CloudFunctionNotActive,
9011 VpcConnectorNotSet,
9013 VpcConnectorNotRunning,
9016 VpcConnectorServerlessTrafficBlocked,
9019 VpcConnectorHealthCheckTrafficBlocked,
9022 ForwardingRuleRegionMismatch,
9025 PscConnectionNotAccepted,
9028 PscEndpointAccessedFromPeeredNetwork,
9032 PscNegProducerEndpointNoGlobalAccess,
9036 PscNegProducerForwardingRuleMultiplePorts,
9040 CloudSqlPscNegUnsupported,
9044 NoNatSubnetsForPscServiceAttachment,
9046 PscTransitivityNotPropagated,
9049 HybridNegNonDynamicRouteMatched,
9052 HybridNegNonLocalDynamicRouteMatched,
9056 CloudRunRevisionNotReady,
9058 DroppedInsidePscServiceProducer,
9060 LoadBalancerHasNoProxySubnet,
9063 CloudNatNoAddresses,
9065 RoutingLoop,
9067 DroppedInsideGoogleManagedService,
9071 LoadBalancerBackendInvalidNetwork,
9074 BackendServiceNamedPortNotDefined,
9077 DestinationIsPrivateNatIpRange,
9080 DroppedInsideRedisInstanceService,
9083 RedisInstanceUnsupportedPort,
9086 RedisInstanceConnectingFromPupiAddress,
9089 RedisInstanceNoRouteToDestinationNetwork,
9091 RedisInstanceNoExternalIp,
9093 RedisInstanceUnsupportedProtocol,
9096 DroppedInsideRedisClusterService,
9099 RedisClusterUnsupportedPort,
9103 RedisClusterNoExternalIp,
9105 RedisClusterUnsupportedProtocol,
9108 NoAdvertisedRouteToGcpDestination,
9112 NoTrafficSelectorToGcpDestination,
9116 NoKnownRouteFromPeeredNetworkToDestination,
9119 PrivateNatToPscEndpointUnsupported,
9122 PscPortMappingPortMismatch,
9125 PscPortMappingWithoutPscConnectionUnsupported,
9128 UnsupportedRouteMatchedForNat64Destination,
9131 TrafficFromHybridEndpointToInternetDisallowed,
9134 NoMatchingNat64Gateway,
9137 LoadBalancerBackendIpVersionMismatch,
9140 NoKnownRouteFromNccNetworkToDestination,
9143 CloudNatProtocolUnsupported,
9145 L2InterconnectUnsupportedProtocol,
9148 L2InterconnectUnsupportedPort,
9151 L2InterconnectDestinationIpMismatch,
9154 NccRouteWithinHybridSubnetUnsupported,
9158 HybridSubnetRegionMismatch,
9162 UnknownValue(cause::UnknownValue),
9167 }
9168
9169 #[doc(hidden)]
9170 pub mod cause {
9171 #[allow(unused_imports)]
9172 use super::*;
9173 #[derive(Clone, Debug, PartialEq)]
9174 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9175 }
9176
9177 impl Cause {
9178 pub fn value(&self) -> std::option::Option<i32> {
9183 match self {
9184 Self::Unspecified => std::option::Option::Some(0),
9185 Self::UnknownExternalAddress => std::option::Option::Some(1),
9186 Self::ForeignIpDisallowed => std::option::Option::Some(2),
9187 Self::FirewallRule => std::option::Option::Some(3),
9188 Self::NoRoute => std::option::Option::Some(4),
9189 Self::RouteBlackhole => std::option::Option::Some(5),
9190 Self::RouteWrongNetwork => std::option::Option::Some(6),
9191 Self::RouteNextHopIpAddressNotResolved => std::option::Option::Some(42),
9192 Self::RouteNextHopResourceNotFound => std::option::Option::Some(43),
9193 Self::RouteNextHopInstanceWrongNetwork => std::option::Option::Some(49),
9194 Self::RouteNextHopInstanceNonPrimaryIp => std::option::Option::Some(50),
9195 Self::RouteNextHopForwardingRuleIpMismatch => std::option::Option::Some(51),
9196 Self::RouteNextHopVpnTunnelNotEstablished => std::option::Option::Some(52),
9197 Self::RouteNextHopForwardingRuleTypeInvalid => std::option::Option::Some(53),
9198 Self::NoRouteFromInternetToPrivateIpv6Address => std::option::Option::Some(44),
9199 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
9200 std::option::Option::Some(98)
9201 }
9202 Self::VpnTunnelLocalSelectorMismatch => std::option::Option::Some(45),
9203 Self::VpnTunnelRemoteSelectorMismatch => std::option::Option::Some(46),
9204 Self::PrivateTrafficToInternet => std::option::Option::Some(7),
9205 Self::PrivateGoogleAccessDisallowed => std::option::Option::Some(8),
9206 Self::PrivateGoogleAccessViaVpnTunnelUnsupported => std::option::Option::Some(47),
9207 Self::NoExternalAddress => std::option::Option::Some(9),
9208 Self::UnknownInternalAddress => std::option::Option::Some(10),
9209 Self::ForwardingRuleMismatch => std::option::Option::Some(11),
9210 Self::ForwardingRuleNoInstances => std::option::Option::Some(12),
9211 Self::FirewallBlockingLoadBalancerBackendHealthCheck => {
9212 std::option::Option::Some(13)
9213 }
9214 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => {
9215 std::option::Option::Some(85)
9216 }
9217 Self::InstanceNotRunning => std::option::Option::Some(14),
9218 Self::GkeClusterNotRunning => std::option::Option::Some(27),
9219 Self::CloudSqlInstanceNotRunning => std::option::Option::Some(28),
9220 Self::RedisInstanceNotRunning => std::option::Option::Some(68),
9221 Self::RedisClusterNotRunning => std::option::Option::Some(69),
9222 Self::TrafficTypeBlocked => std::option::Option::Some(15),
9223 Self::GkeMasterUnauthorizedAccess => std::option::Option::Some(16),
9224 Self::CloudSqlInstanceUnauthorizedAccess => std::option::Option::Some(17),
9225 Self::DroppedInsideGkeService => std::option::Option::Some(18),
9226 Self::DroppedInsideCloudSqlService => std::option::Option::Some(19),
9227 Self::GoogleManagedServiceNoPeering => std::option::Option::Some(20),
9228 Self::GoogleManagedServiceNoPscEndpoint => std::option::Option::Some(38),
9229 Self::GkePscEndpointMissing => std::option::Option::Some(36),
9230 Self::CloudSqlInstanceNoIpAddress => std::option::Option::Some(21),
9231 Self::GkeControlPlaneRegionMismatch => std::option::Option::Some(30),
9232 Self::PublicGkeControlPlaneToPrivateDestination => std::option::Option::Some(31),
9233 Self::GkeControlPlaneNoRoute => std::option::Option::Some(32),
9234 Self::CloudSqlInstanceNotConfiguredForExternalTraffic => {
9235 std::option::Option::Some(33)
9236 }
9237 Self::PublicCloudSqlInstanceToPrivateDestination => std::option::Option::Some(34),
9238 Self::CloudSqlInstanceNoRoute => std::option::Option::Some(35),
9239 Self::CloudSqlConnectorRequired => std::option::Option::Some(63),
9240 Self::CloudFunctionNotActive => std::option::Option::Some(22),
9241 Self::VpcConnectorNotSet => std::option::Option::Some(23),
9242 Self::VpcConnectorNotRunning => std::option::Option::Some(24),
9243 Self::VpcConnectorServerlessTrafficBlocked => std::option::Option::Some(60),
9244 Self::VpcConnectorHealthCheckTrafficBlocked => std::option::Option::Some(61),
9245 Self::ForwardingRuleRegionMismatch => std::option::Option::Some(25),
9246 Self::PscConnectionNotAccepted => std::option::Option::Some(26),
9247 Self::PscEndpointAccessedFromPeeredNetwork => std::option::Option::Some(41),
9248 Self::PscNegProducerEndpointNoGlobalAccess => std::option::Option::Some(48),
9249 Self::PscNegProducerForwardingRuleMultiplePorts => std::option::Option::Some(54),
9250 Self::CloudSqlPscNegUnsupported => std::option::Option::Some(58),
9251 Self::NoNatSubnetsForPscServiceAttachment => std::option::Option::Some(57),
9252 Self::PscTransitivityNotPropagated => std::option::Option::Some(64),
9253 Self::HybridNegNonDynamicRouteMatched => std::option::Option::Some(55),
9254 Self::HybridNegNonLocalDynamicRouteMatched => std::option::Option::Some(56),
9255 Self::CloudRunRevisionNotReady => std::option::Option::Some(29),
9256 Self::DroppedInsidePscServiceProducer => std::option::Option::Some(37),
9257 Self::LoadBalancerHasNoProxySubnet => std::option::Option::Some(39),
9258 Self::CloudNatNoAddresses => std::option::Option::Some(40),
9259 Self::RoutingLoop => std::option::Option::Some(59),
9260 Self::DroppedInsideGoogleManagedService => std::option::Option::Some(62),
9261 Self::LoadBalancerBackendInvalidNetwork => std::option::Option::Some(65),
9262 Self::BackendServiceNamedPortNotDefined => std::option::Option::Some(66),
9263 Self::DestinationIsPrivateNatIpRange => std::option::Option::Some(67),
9264 Self::DroppedInsideRedisInstanceService => std::option::Option::Some(70),
9265 Self::RedisInstanceUnsupportedPort => std::option::Option::Some(71),
9266 Self::RedisInstanceConnectingFromPupiAddress => std::option::Option::Some(72),
9267 Self::RedisInstanceNoRouteToDestinationNetwork => std::option::Option::Some(73),
9268 Self::RedisInstanceNoExternalIp => std::option::Option::Some(74),
9269 Self::RedisInstanceUnsupportedProtocol => std::option::Option::Some(78),
9270 Self::DroppedInsideRedisClusterService => std::option::Option::Some(75),
9271 Self::RedisClusterUnsupportedPort => std::option::Option::Some(76),
9272 Self::RedisClusterNoExternalIp => std::option::Option::Some(77),
9273 Self::RedisClusterUnsupportedProtocol => std::option::Option::Some(79),
9274 Self::NoAdvertisedRouteToGcpDestination => std::option::Option::Some(80),
9275 Self::NoTrafficSelectorToGcpDestination => std::option::Option::Some(81),
9276 Self::NoKnownRouteFromPeeredNetworkToDestination => std::option::Option::Some(82),
9277 Self::PrivateNatToPscEndpointUnsupported => std::option::Option::Some(83),
9278 Self::PscPortMappingPortMismatch => std::option::Option::Some(86),
9279 Self::PscPortMappingWithoutPscConnectionUnsupported => {
9280 std::option::Option::Some(87)
9281 }
9282 Self::UnsupportedRouteMatchedForNat64Destination => std::option::Option::Some(88),
9283 Self::TrafficFromHybridEndpointToInternetDisallowed => {
9284 std::option::Option::Some(89)
9285 }
9286 Self::NoMatchingNat64Gateway => std::option::Option::Some(90),
9287 Self::LoadBalancerBackendIpVersionMismatch => std::option::Option::Some(96),
9288 Self::NoKnownRouteFromNccNetworkToDestination => std::option::Option::Some(97),
9289 Self::CloudNatProtocolUnsupported => std::option::Option::Some(99),
9290 Self::L2InterconnectUnsupportedProtocol => std::option::Option::Some(100),
9291 Self::L2InterconnectUnsupportedPort => std::option::Option::Some(101),
9292 Self::L2InterconnectDestinationIpMismatch => std::option::Option::Some(102),
9293 Self::NccRouteWithinHybridSubnetUnsupported => std::option::Option::Some(104),
9294 Self::HybridSubnetRegionMismatch => std::option::Option::Some(105),
9295 Self::UnknownValue(u) => u.0.value(),
9296 }
9297 }
9298
9299 pub fn name(&self) -> std::option::Option<&str> {
9304 match self {
9305 Self::Unspecified => std::option::Option::Some("CAUSE_UNSPECIFIED"),
9306 Self::UnknownExternalAddress => {
9307 std::option::Option::Some("UNKNOWN_EXTERNAL_ADDRESS")
9308 }
9309 Self::ForeignIpDisallowed => std::option::Option::Some("FOREIGN_IP_DISALLOWED"),
9310 Self::FirewallRule => std::option::Option::Some("FIREWALL_RULE"),
9311 Self::NoRoute => std::option::Option::Some("NO_ROUTE"),
9312 Self::RouteBlackhole => std::option::Option::Some("ROUTE_BLACKHOLE"),
9313 Self::RouteWrongNetwork => std::option::Option::Some("ROUTE_WRONG_NETWORK"),
9314 Self::RouteNextHopIpAddressNotResolved => {
9315 std::option::Option::Some("ROUTE_NEXT_HOP_IP_ADDRESS_NOT_RESOLVED")
9316 }
9317 Self::RouteNextHopResourceNotFound => {
9318 std::option::Option::Some("ROUTE_NEXT_HOP_RESOURCE_NOT_FOUND")
9319 }
9320 Self::RouteNextHopInstanceWrongNetwork => {
9321 std::option::Option::Some("ROUTE_NEXT_HOP_INSTANCE_WRONG_NETWORK")
9322 }
9323 Self::RouteNextHopInstanceNonPrimaryIp => {
9324 std::option::Option::Some("ROUTE_NEXT_HOP_INSTANCE_NON_PRIMARY_IP")
9325 }
9326 Self::RouteNextHopForwardingRuleIpMismatch => {
9327 std::option::Option::Some("ROUTE_NEXT_HOP_FORWARDING_RULE_IP_MISMATCH")
9328 }
9329 Self::RouteNextHopVpnTunnelNotEstablished => {
9330 std::option::Option::Some("ROUTE_NEXT_HOP_VPN_TUNNEL_NOT_ESTABLISHED")
9331 }
9332 Self::RouteNextHopForwardingRuleTypeInvalid => {
9333 std::option::Option::Some("ROUTE_NEXT_HOP_FORWARDING_RULE_TYPE_INVALID")
9334 }
9335 Self::NoRouteFromInternetToPrivateIpv6Address => {
9336 std::option::Option::Some("NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV6_ADDRESS")
9337 }
9338 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
9339 std::option::Option::Some(
9340 "NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS",
9341 )
9342 }
9343 Self::VpnTunnelLocalSelectorMismatch => {
9344 std::option::Option::Some("VPN_TUNNEL_LOCAL_SELECTOR_MISMATCH")
9345 }
9346 Self::VpnTunnelRemoteSelectorMismatch => {
9347 std::option::Option::Some("VPN_TUNNEL_REMOTE_SELECTOR_MISMATCH")
9348 }
9349 Self::PrivateTrafficToInternet => {
9350 std::option::Option::Some("PRIVATE_TRAFFIC_TO_INTERNET")
9351 }
9352 Self::PrivateGoogleAccessDisallowed => {
9353 std::option::Option::Some("PRIVATE_GOOGLE_ACCESS_DISALLOWED")
9354 }
9355 Self::PrivateGoogleAccessViaVpnTunnelUnsupported => {
9356 std::option::Option::Some("PRIVATE_GOOGLE_ACCESS_VIA_VPN_TUNNEL_UNSUPPORTED")
9357 }
9358 Self::NoExternalAddress => std::option::Option::Some("NO_EXTERNAL_ADDRESS"),
9359 Self::UnknownInternalAddress => {
9360 std::option::Option::Some("UNKNOWN_INTERNAL_ADDRESS")
9361 }
9362 Self::ForwardingRuleMismatch => {
9363 std::option::Option::Some("FORWARDING_RULE_MISMATCH")
9364 }
9365 Self::ForwardingRuleNoInstances => {
9366 std::option::Option::Some("FORWARDING_RULE_NO_INSTANCES")
9367 }
9368 Self::FirewallBlockingLoadBalancerBackendHealthCheck => std::option::Option::Some(
9369 "FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK",
9370 ),
9371 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => std::option::Option::Some(
9372 "INGRESS_FIREWALL_TAGS_UNSUPPORTED_BY_DIRECT_VPC_EGRESS",
9373 ),
9374 Self::InstanceNotRunning => std::option::Option::Some("INSTANCE_NOT_RUNNING"),
9375 Self::GkeClusterNotRunning => std::option::Option::Some("GKE_CLUSTER_NOT_RUNNING"),
9376 Self::CloudSqlInstanceNotRunning => {
9377 std::option::Option::Some("CLOUD_SQL_INSTANCE_NOT_RUNNING")
9378 }
9379 Self::RedisInstanceNotRunning => {
9380 std::option::Option::Some("REDIS_INSTANCE_NOT_RUNNING")
9381 }
9382 Self::RedisClusterNotRunning => {
9383 std::option::Option::Some("REDIS_CLUSTER_NOT_RUNNING")
9384 }
9385 Self::TrafficTypeBlocked => std::option::Option::Some("TRAFFIC_TYPE_BLOCKED"),
9386 Self::GkeMasterUnauthorizedAccess => {
9387 std::option::Option::Some("GKE_MASTER_UNAUTHORIZED_ACCESS")
9388 }
9389 Self::CloudSqlInstanceUnauthorizedAccess => {
9390 std::option::Option::Some("CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS")
9391 }
9392 Self::DroppedInsideGkeService => {
9393 std::option::Option::Some("DROPPED_INSIDE_GKE_SERVICE")
9394 }
9395 Self::DroppedInsideCloudSqlService => {
9396 std::option::Option::Some("DROPPED_INSIDE_CLOUD_SQL_SERVICE")
9397 }
9398 Self::GoogleManagedServiceNoPeering => {
9399 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_NO_PEERING")
9400 }
9401 Self::GoogleManagedServiceNoPscEndpoint => {
9402 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_NO_PSC_ENDPOINT")
9403 }
9404 Self::GkePscEndpointMissing => {
9405 std::option::Option::Some("GKE_PSC_ENDPOINT_MISSING")
9406 }
9407 Self::CloudSqlInstanceNoIpAddress => {
9408 std::option::Option::Some("CLOUD_SQL_INSTANCE_NO_IP_ADDRESS")
9409 }
9410 Self::GkeControlPlaneRegionMismatch => {
9411 std::option::Option::Some("GKE_CONTROL_PLANE_REGION_MISMATCH")
9412 }
9413 Self::PublicGkeControlPlaneToPrivateDestination => {
9414 std::option::Option::Some("PUBLIC_GKE_CONTROL_PLANE_TO_PRIVATE_DESTINATION")
9415 }
9416 Self::GkeControlPlaneNoRoute => {
9417 std::option::Option::Some("GKE_CONTROL_PLANE_NO_ROUTE")
9418 }
9419 Self::CloudSqlInstanceNotConfiguredForExternalTraffic => std::option::Option::Some(
9420 "CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC",
9421 ),
9422 Self::PublicCloudSqlInstanceToPrivateDestination => {
9423 std::option::Option::Some("PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION")
9424 }
9425 Self::CloudSqlInstanceNoRoute => {
9426 std::option::Option::Some("CLOUD_SQL_INSTANCE_NO_ROUTE")
9427 }
9428 Self::CloudSqlConnectorRequired => {
9429 std::option::Option::Some("CLOUD_SQL_CONNECTOR_REQUIRED")
9430 }
9431 Self::CloudFunctionNotActive => {
9432 std::option::Option::Some("CLOUD_FUNCTION_NOT_ACTIVE")
9433 }
9434 Self::VpcConnectorNotSet => std::option::Option::Some("VPC_CONNECTOR_NOT_SET"),
9435 Self::VpcConnectorNotRunning => {
9436 std::option::Option::Some("VPC_CONNECTOR_NOT_RUNNING")
9437 }
9438 Self::VpcConnectorServerlessTrafficBlocked => {
9439 std::option::Option::Some("VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED")
9440 }
9441 Self::VpcConnectorHealthCheckTrafficBlocked => {
9442 std::option::Option::Some("VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED")
9443 }
9444 Self::ForwardingRuleRegionMismatch => {
9445 std::option::Option::Some("FORWARDING_RULE_REGION_MISMATCH")
9446 }
9447 Self::PscConnectionNotAccepted => {
9448 std::option::Option::Some("PSC_CONNECTION_NOT_ACCEPTED")
9449 }
9450 Self::PscEndpointAccessedFromPeeredNetwork => {
9451 std::option::Option::Some("PSC_ENDPOINT_ACCESSED_FROM_PEERED_NETWORK")
9452 }
9453 Self::PscNegProducerEndpointNoGlobalAccess => {
9454 std::option::Option::Some("PSC_NEG_PRODUCER_ENDPOINT_NO_GLOBAL_ACCESS")
9455 }
9456 Self::PscNegProducerForwardingRuleMultiplePorts => {
9457 std::option::Option::Some("PSC_NEG_PRODUCER_FORWARDING_RULE_MULTIPLE_PORTS")
9458 }
9459 Self::CloudSqlPscNegUnsupported => {
9460 std::option::Option::Some("CLOUD_SQL_PSC_NEG_UNSUPPORTED")
9461 }
9462 Self::NoNatSubnetsForPscServiceAttachment => {
9463 std::option::Option::Some("NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT")
9464 }
9465 Self::PscTransitivityNotPropagated => {
9466 std::option::Option::Some("PSC_TRANSITIVITY_NOT_PROPAGATED")
9467 }
9468 Self::HybridNegNonDynamicRouteMatched => {
9469 std::option::Option::Some("HYBRID_NEG_NON_DYNAMIC_ROUTE_MATCHED")
9470 }
9471 Self::HybridNegNonLocalDynamicRouteMatched => {
9472 std::option::Option::Some("HYBRID_NEG_NON_LOCAL_DYNAMIC_ROUTE_MATCHED")
9473 }
9474 Self::CloudRunRevisionNotReady => {
9475 std::option::Option::Some("CLOUD_RUN_REVISION_NOT_READY")
9476 }
9477 Self::DroppedInsidePscServiceProducer => {
9478 std::option::Option::Some("DROPPED_INSIDE_PSC_SERVICE_PRODUCER")
9479 }
9480 Self::LoadBalancerHasNoProxySubnet => {
9481 std::option::Option::Some("LOAD_BALANCER_HAS_NO_PROXY_SUBNET")
9482 }
9483 Self::CloudNatNoAddresses => std::option::Option::Some("CLOUD_NAT_NO_ADDRESSES"),
9484 Self::RoutingLoop => std::option::Option::Some("ROUTING_LOOP"),
9485 Self::DroppedInsideGoogleManagedService => {
9486 std::option::Option::Some("DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE")
9487 }
9488 Self::LoadBalancerBackendInvalidNetwork => {
9489 std::option::Option::Some("LOAD_BALANCER_BACKEND_INVALID_NETWORK")
9490 }
9491 Self::BackendServiceNamedPortNotDefined => {
9492 std::option::Option::Some("BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED")
9493 }
9494 Self::DestinationIsPrivateNatIpRange => {
9495 std::option::Option::Some("DESTINATION_IS_PRIVATE_NAT_IP_RANGE")
9496 }
9497 Self::DroppedInsideRedisInstanceService => {
9498 std::option::Option::Some("DROPPED_INSIDE_REDIS_INSTANCE_SERVICE")
9499 }
9500 Self::RedisInstanceUnsupportedPort => {
9501 std::option::Option::Some("REDIS_INSTANCE_UNSUPPORTED_PORT")
9502 }
9503 Self::RedisInstanceConnectingFromPupiAddress => {
9504 std::option::Option::Some("REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS")
9505 }
9506 Self::RedisInstanceNoRouteToDestinationNetwork => {
9507 std::option::Option::Some("REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK")
9508 }
9509 Self::RedisInstanceNoExternalIp => {
9510 std::option::Option::Some("REDIS_INSTANCE_NO_EXTERNAL_IP")
9511 }
9512 Self::RedisInstanceUnsupportedProtocol => {
9513 std::option::Option::Some("REDIS_INSTANCE_UNSUPPORTED_PROTOCOL")
9514 }
9515 Self::DroppedInsideRedisClusterService => {
9516 std::option::Option::Some("DROPPED_INSIDE_REDIS_CLUSTER_SERVICE")
9517 }
9518 Self::RedisClusterUnsupportedPort => {
9519 std::option::Option::Some("REDIS_CLUSTER_UNSUPPORTED_PORT")
9520 }
9521 Self::RedisClusterNoExternalIp => {
9522 std::option::Option::Some("REDIS_CLUSTER_NO_EXTERNAL_IP")
9523 }
9524 Self::RedisClusterUnsupportedProtocol => {
9525 std::option::Option::Some("REDIS_CLUSTER_UNSUPPORTED_PROTOCOL")
9526 }
9527 Self::NoAdvertisedRouteToGcpDestination => {
9528 std::option::Option::Some("NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION")
9529 }
9530 Self::NoTrafficSelectorToGcpDestination => {
9531 std::option::Option::Some("NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION")
9532 }
9533 Self::NoKnownRouteFromPeeredNetworkToDestination => {
9534 std::option::Option::Some("NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION")
9535 }
9536 Self::PrivateNatToPscEndpointUnsupported => {
9537 std::option::Option::Some("PRIVATE_NAT_TO_PSC_ENDPOINT_UNSUPPORTED")
9538 }
9539 Self::PscPortMappingPortMismatch => {
9540 std::option::Option::Some("PSC_PORT_MAPPING_PORT_MISMATCH")
9541 }
9542 Self::PscPortMappingWithoutPscConnectionUnsupported => {
9543 std::option::Option::Some("PSC_PORT_MAPPING_WITHOUT_PSC_CONNECTION_UNSUPPORTED")
9544 }
9545 Self::UnsupportedRouteMatchedForNat64Destination => {
9546 std::option::Option::Some("UNSUPPORTED_ROUTE_MATCHED_FOR_NAT64_DESTINATION")
9547 }
9548 Self::TrafficFromHybridEndpointToInternetDisallowed => {
9549 std::option::Option::Some("TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED")
9550 }
9551 Self::NoMatchingNat64Gateway => {
9552 std::option::Option::Some("NO_MATCHING_NAT64_GATEWAY")
9553 }
9554 Self::LoadBalancerBackendIpVersionMismatch => {
9555 std::option::Option::Some("LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH")
9556 }
9557 Self::NoKnownRouteFromNccNetworkToDestination => {
9558 std::option::Option::Some("NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION")
9559 }
9560 Self::CloudNatProtocolUnsupported => {
9561 std::option::Option::Some("CLOUD_NAT_PROTOCOL_UNSUPPORTED")
9562 }
9563 Self::L2InterconnectUnsupportedProtocol => {
9564 std::option::Option::Some("L2_INTERCONNECT_UNSUPPORTED_PROTOCOL")
9565 }
9566 Self::L2InterconnectUnsupportedPort => {
9567 std::option::Option::Some("L2_INTERCONNECT_UNSUPPORTED_PORT")
9568 }
9569 Self::L2InterconnectDestinationIpMismatch => {
9570 std::option::Option::Some("L2_INTERCONNECT_DESTINATION_IP_MISMATCH")
9571 }
9572 Self::NccRouteWithinHybridSubnetUnsupported => {
9573 std::option::Option::Some("NCC_ROUTE_WITHIN_HYBRID_SUBNET_UNSUPPORTED")
9574 }
9575 Self::HybridSubnetRegionMismatch => {
9576 std::option::Option::Some("HYBRID_SUBNET_REGION_MISMATCH")
9577 }
9578 Self::UnknownValue(u) => u.0.name(),
9579 }
9580 }
9581 }
9582
9583 impl std::default::Default for Cause {
9584 fn default() -> Self {
9585 use std::convert::From;
9586 Self::from(0)
9587 }
9588 }
9589
9590 impl std::fmt::Display for Cause {
9591 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9592 wkt::internal::display_enum(f, self.name(), self.value())
9593 }
9594 }
9595
9596 impl std::convert::From<i32> for Cause {
9597 fn from(value: i32) -> Self {
9598 match value {
9599 0 => Self::Unspecified,
9600 1 => Self::UnknownExternalAddress,
9601 2 => Self::ForeignIpDisallowed,
9602 3 => Self::FirewallRule,
9603 4 => Self::NoRoute,
9604 5 => Self::RouteBlackhole,
9605 6 => Self::RouteWrongNetwork,
9606 7 => Self::PrivateTrafficToInternet,
9607 8 => Self::PrivateGoogleAccessDisallowed,
9608 9 => Self::NoExternalAddress,
9609 10 => Self::UnknownInternalAddress,
9610 11 => Self::ForwardingRuleMismatch,
9611 12 => Self::ForwardingRuleNoInstances,
9612 13 => Self::FirewallBlockingLoadBalancerBackendHealthCheck,
9613 14 => Self::InstanceNotRunning,
9614 15 => Self::TrafficTypeBlocked,
9615 16 => Self::GkeMasterUnauthorizedAccess,
9616 17 => Self::CloudSqlInstanceUnauthorizedAccess,
9617 18 => Self::DroppedInsideGkeService,
9618 19 => Self::DroppedInsideCloudSqlService,
9619 20 => Self::GoogleManagedServiceNoPeering,
9620 21 => Self::CloudSqlInstanceNoIpAddress,
9621 22 => Self::CloudFunctionNotActive,
9622 23 => Self::VpcConnectorNotSet,
9623 24 => Self::VpcConnectorNotRunning,
9624 25 => Self::ForwardingRuleRegionMismatch,
9625 26 => Self::PscConnectionNotAccepted,
9626 27 => Self::GkeClusterNotRunning,
9627 28 => Self::CloudSqlInstanceNotRunning,
9628 29 => Self::CloudRunRevisionNotReady,
9629 30 => Self::GkeControlPlaneRegionMismatch,
9630 31 => Self::PublicGkeControlPlaneToPrivateDestination,
9631 32 => Self::GkeControlPlaneNoRoute,
9632 33 => Self::CloudSqlInstanceNotConfiguredForExternalTraffic,
9633 34 => Self::PublicCloudSqlInstanceToPrivateDestination,
9634 35 => Self::CloudSqlInstanceNoRoute,
9635 36 => Self::GkePscEndpointMissing,
9636 37 => Self::DroppedInsidePscServiceProducer,
9637 38 => Self::GoogleManagedServiceNoPscEndpoint,
9638 39 => Self::LoadBalancerHasNoProxySubnet,
9639 40 => Self::CloudNatNoAddresses,
9640 41 => Self::PscEndpointAccessedFromPeeredNetwork,
9641 42 => Self::RouteNextHopIpAddressNotResolved,
9642 43 => Self::RouteNextHopResourceNotFound,
9643 44 => Self::NoRouteFromInternetToPrivateIpv6Address,
9644 45 => Self::VpnTunnelLocalSelectorMismatch,
9645 46 => Self::VpnTunnelRemoteSelectorMismatch,
9646 47 => Self::PrivateGoogleAccessViaVpnTunnelUnsupported,
9647 48 => Self::PscNegProducerEndpointNoGlobalAccess,
9648 49 => Self::RouteNextHopInstanceWrongNetwork,
9649 50 => Self::RouteNextHopInstanceNonPrimaryIp,
9650 51 => Self::RouteNextHopForwardingRuleIpMismatch,
9651 52 => Self::RouteNextHopVpnTunnelNotEstablished,
9652 53 => Self::RouteNextHopForwardingRuleTypeInvalid,
9653 54 => Self::PscNegProducerForwardingRuleMultiplePorts,
9654 55 => Self::HybridNegNonDynamicRouteMatched,
9655 56 => Self::HybridNegNonLocalDynamicRouteMatched,
9656 57 => Self::NoNatSubnetsForPscServiceAttachment,
9657 58 => Self::CloudSqlPscNegUnsupported,
9658 59 => Self::RoutingLoop,
9659 60 => Self::VpcConnectorServerlessTrafficBlocked,
9660 61 => Self::VpcConnectorHealthCheckTrafficBlocked,
9661 62 => Self::DroppedInsideGoogleManagedService,
9662 63 => Self::CloudSqlConnectorRequired,
9663 64 => Self::PscTransitivityNotPropagated,
9664 65 => Self::LoadBalancerBackendInvalidNetwork,
9665 66 => Self::BackendServiceNamedPortNotDefined,
9666 67 => Self::DestinationIsPrivateNatIpRange,
9667 68 => Self::RedisInstanceNotRunning,
9668 69 => Self::RedisClusterNotRunning,
9669 70 => Self::DroppedInsideRedisInstanceService,
9670 71 => Self::RedisInstanceUnsupportedPort,
9671 72 => Self::RedisInstanceConnectingFromPupiAddress,
9672 73 => Self::RedisInstanceNoRouteToDestinationNetwork,
9673 74 => Self::RedisInstanceNoExternalIp,
9674 75 => Self::DroppedInsideRedisClusterService,
9675 76 => Self::RedisClusterUnsupportedPort,
9676 77 => Self::RedisClusterNoExternalIp,
9677 78 => Self::RedisInstanceUnsupportedProtocol,
9678 79 => Self::RedisClusterUnsupportedProtocol,
9679 80 => Self::NoAdvertisedRouteToGcpDestination,
9680 81 => Self::NoTrafficSelectorToGcpDestination,
9681 82 => Self::NoKnownRouteFromPeeredNetworkToDestination,
9682 83 => Self::PrivateNatToPscEndpointUnsupported,
9683 85 => Self::IngressFirewallTagsUnsupportedByDirectVpcEgress,
9684 86 => Self::PscPortMappingPortMismatch,
9685 87 => Self::PscPortMappingWithoutPscConnectionUnsupported,
9686 88 => Self::UnsupportedRouteMatchedForNat64Destination,
9687 89 => Self::TrafficFromHybridEndpointToInternetDisallowed,
9688 90 => Self::NoMatchingNat64Gateway,
9689 96 => Self::LoadBalancerBackendIpVersionMismatch,
9690 97 => Self::NoKnownRouteFromNccNetworkToDestination,
9691 98 => Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address,
9692 99 => Self::CloudNatProtocolUnsupported,
9693 100 => Self::L2InterconnectUnsupportedProtocol,
9694 101 => Self::L2InterconnectUnsupportedPort,
9695 102 => Self::L2InterconnectDestinationIpMismatch,
9696 104 => Self::NccRouteWithinHybridSubnetUnsupported,
9697 105 => Self::HybridSubnetRegionMismatch,
9698 _ => Self::UnknownValue(cause::UnknownValue(
9699 wkt::internal::UnknownEnumValue::Integer(value),
9700 )),
9701 }
9702 }
9703 }
9704
9705 impl std::convert::From<&str> for Cause {
9706 fn from(value: &str) -> Self {
9707 use std::string::ToString;
9708 match value {
9709 "CAUSE_UNSPECIFIED" => Self::Unspecified,
9710 "UNKNOWN_EXTERNAL_ADDRESS" => Self::UnknownExternalAddress,
9711 "FOREIGN_IP_DISALLOWED" => Self::ForeignIpDisallowed,
9712 "FIREWALL_RULE" => Self::FirewallRule,
9713 "NO_ROUTE" => Self::NoRoute,
9714 "ROUTE_BLACKHOLE" => Self::RouteBlackhole,
9715 "ROUTE_WRONG_NETWORK" => Self::RouteWrongNetwork,
9716 "ROUTE_NEXT_HOP_IP_ADDRESS_NOT_RESOLVED" => Self::RouteNextHopIpAddressNotResolved,
9717 "ROUTE_NEXT_HOP_RESOURCE_NOT_FOUND" => Self::RouteNextHopResourceNotFound,
9718 "ROUTE_NEXT_HOP_INSTANCE_WRONG_NETWORK" => Self::RouteNextHopInstanceWrongNetwork,
9719 "ROUTE_NEXT_HOP_INSTANCE_NON_PRIMARY_IP" => Self::RouteNextHopInstanceNonPrimaryIp,
9720 "ROUTE_NEXT_HOP_FORWARDING_RULE_IP_MISMATCH" => {
9721 Self::RouteNextHopForwardingRuleIpMismatch
9722 }
9723 "ROUTE_NEXT_HOP_VPN_TUNNEL_NOT_ESTABLISHED" => {
9724 Self::RouteNextHopVpnTunnelNotEstablished
9725 }
9726 "ROUTE_NEXT_HOP_FORWARDING_RULE_TYPE_INVALID" => {
9727 Self::RouteNextHopForwardingRuleTypeInvalid
9728 }
9729 "NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV6_ADDRESS" => {
9730 Self::NoRouteFromInternetToPrivateIpv6Address
9731 }
9732 "NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS" => {
9733 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address
9734 }
9735 "VPN_TUNNEL_LOCAL_SELECTOR_MISMATCH" => Self::VpnTunnelLocalSelectorMismatch,
9736 "VPN_TUNNEL_REMOTE_SELECTOR_MISMATCH" => Self::VpnTunnelRemoteSelectorMismatch,
9737 "PRIVATE_TRAFFIC_TO_INTERNET" => Self::PrivateTrafficToInternet,
9738 "PRIVATE_GOOGLE_ACCESS_DISALLOWED" => Self::PrivateGoogleAccessDisallowed,
9739 "PRIVATE_GOOGLE_ACCESS_VIA_VPN_TUNNEL_UNSUPPORTED" => {
9740 Self::PrivateGoogleAccessViaVpnTunnelUnsupported
9741 }
9742 "NO_EXTERNAL_ADDRESS" => Self::NoExternalAddress,
9743 "UNKNOWN_INTERNAL_ADDRESS" => Self::UnknownInternalAddress,
9744 "FORWARDING_RULE_MISMATCH" => Self::ForwardingRuleMismatch,
9745 "FORWARDING_RULE_NO_INSTANCES" => Self::ForwardingRuleNoInstances,
9746 "FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK" => {
9747 Self::FirewallBlockingLoadBalancerBackendHealthCheck
9748 }
9749 "INGRESS_FIREWALL_TAGS_UNSUPPORTED_BY_DIRECT_VPC_EGRESS" => {
9750 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress
9751 }
9752 "INSTANCE_NOT_RUNNING" => Self::InstanceNotRunning,
9753 "GKE_CLUSTER_NOT_RUNNING" => Self::GkeClusterNotRunning,
9754 "CLOUD_SQL_INSTANCE_NOT_RUNNING" => Self::CloudSqlInstanceNotRunning,
9755 "REDIS_INSTANCE_NOT_RUNNING" => Self::RedisInstanceNotRunning,
9756 "REDIS_CLUSTER_NOT_RUNNING" => Self::RedisClusterNotRunning,
9757 "TRAFFIC_TYPE_BLOCKED" => Self::TrafficTypeBlocked,
9758 "GKE_MASTER_UNAUTHORIZED_ACCESS" => Self::GkeMasterUnauthorizedAccess,
9759 "CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS" => {
9760 Self::CloudSqlInstanceUnauthorizedAccess
9761 }
9762 "DROPPED_INSIDE_GKE_SERVICE" => Self::DroppedInsideGkeService,
9763 "DROPPED_INSIDE_CLOUD_SQL_SERVICE" => Self::DroppedInsideCloudSqlService,
9764 "GOOGLE_MANAGED_SERVICE_NO_PEERING" => Self::GoogleManagedServiceNoPeering,
9765 "GOOGLE_MANAGED_SERVICE_NO_PSC_ENDPOINT" => Self::GoogleManagedServiceNoPscEndpoint,
9766 "GKE_PSC_ENDPOINT_MISSING" => Self::GkePscEndpointMissing,
9767 "CLOUD_SQL_INSTANCE_NO_IP_ADDRESS" => Self::CloudSqlInstanceNoIpAddress,
9768 "GKE_CONTROL_PLANE_REGION_MISMATCH" => Self::GkeControlPlaneRegionMismatch,
9769 "PUBLIC_GKE_CONTROL_PLANE_TO_PRIVATE_DESTINATION" => {
9770 Self::PublicGkeControlPlaneToPrivateDestination
9771 }
9772 "GKE_CONTROL_PLANE_NO_ROUTE" => Self::GkeControlPlaneNoRoute,
9773 "CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC" => {
9774 Self::CloudSqlInstanceNotConfiguredForExternalTraffic
9775 }
9776 "PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION" => {
9777 Self::PublicCloudSqlInstanceToPrivateDestination
9778 }
9779 "CLOUD_SQL_INSTANCE_NO_ROUTE" => Self::CloudSqlInstanceNoRoute,
9780 "CLOUD_SQL_CONNECTOR_REQUIRED" => Self::CloudSqlConnectorRequired,
9781 "CLOUD_FUNCTION_NOT_ACTIVE" => Self::CloudFunctionNotActive,
9782 "VPC_CONNECTOR_NOT_SET" => Self::VpcConnectorNotSet,
9783 "VPC_CONNECTOR_NOT_RUNNING" => Self::VpcConnectorNotRunning,
9784 "VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED" => {
9785 Self::VpcConnectorServerlessTrafficBlocked
9786 }
9787 "VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED" => {
9788 Self::VpcConnectorHealthCheckTrafficBlocked
9789 }
9790 "FORWARDING_RULE_REGION_MISMATCH" => Self::ForwardingRuleRegionMismatch,
9791 "PSC_CONNECTION_NOT_ACCEPTED" => Self::PscConnectionNotAccepted,
9792 "PSC_ENDPOINT_ACCESSED_FROM_PEERED_NETWORK" => {
9793 Self::PscEndpointAccessedFromPeeredNetwork
9794 }
9795 "PSC_NEG_PRODUCER_ENDPOINT_NO_GLOBAL_ACCESS" => {
9796 Self::PscNegProducerEndpointNoGlobalAccess
9797 }
9798 "PSC_NEG_PRODUCER_FORWARDING_RULE_MULTIPLE_PORTS" => {
9799 Self::PscNegProducerForwardingRuleMultiplePorts
9800 }
9801 "CLOUD_SQL_PSC_NEG_UNSUPPORTED" => Self::CloudSqlPscNegUnsupported,
9802 "NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT" => {
9803 Self::NoNatSubnetsForPscServiceAttachment
9804 }
9805 "PSC_TRANSITIVITY_NOT_PROPAGATED" => Self::PscTransitivityNotPropagated,
9806 "HYBRID_NEG_NON_DYNAMIC_ROUTE_MATCHED" => Self::HybridNegNonDynamicRouteMatched,
9807 "HYBRID_NEG_NON_LOCAL_DYNAMIC_ROUTE_MATCHED" => {
9808 Self::HybridNegNonLocalDynamicRouteMatched
9809 }
9810 "CLOUD_RUN_REVISION_NOT_READY" => Self::CloudRunRevisionNotReady,
9811 "DROPPED_INSIDE_PSC_SERVICE_PRODUCER" => Self::DroppedInsidePscServiceProducer,
9812 "LOAD_BALANCER_HAS_NO_PROXY_SUBNET" => Self::LoadBalancerHasNoProxySubnet,
9813 "CLOUD_NAT_NO_ADDRESSES" => Self::CloudNatNoAddresses,
9814 "ROUTING_LOOP" => Self::RoutingLoop,
9815 "DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE" => Self::DroppedInsideGoogleManagedService,
9816 "LOAD_BALANCER_BACKEND_INVALID_NETWORK" => Self::LoadBalancerBackendInvalidNetwork,
9817 "BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED" => Self::BackendServiceNamedPortNotDefined,
9818 "DESTINATION_IS_PRIVATE_NAT_IP_RANGE" => Self::DestinationIsPrivateNatIpRange,
9819 "DROPPED_INSIDE_REDIS_INSTANCE_SERVICE" => Self::DroppedInsideRedisInstanceService,
9820 "REDIS_INSTANCE_UNSUPPORTED_PORT" => Self::RedisInstanceUnsupportedPort,
9821 "REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS" => {
9822 Self::RedisInstanceConnectingFromPupiAddress
9823 }
9824 "REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK" => {
9825 Self::RedisInstanceNoRouteToDestinationNetwork
9826 }
9827 "REDIS_INSTANCE_NO_EXTERNAL_IP" => Self::RedisInstanceNoExternalIp,
9828 "REDIS_INSTANCE_UNSUPPORTED_PROTOCOL" => Self::RedisInstanceUnsupportedProtocol,
9829 "DROPPED_INSIDE_REDIS_CLUSTER_SERVICE" => Self::DroppedInsideRedisClusterService,
9830 "REDIS_CLUSTER_UNSUPPORTED_PORT" => Self::RedisClusterUnsupportedPort,
9831 "REDIS_CLUSTER_NO_EXTERNAL_IP" => Self::RedisClusterNoExternalIp,
9832 "REDIS_CLUSTER_UNSUPPORTED_PROTOCOL" => Self::RedisClusterUnsupportedProtocol,
9833 "NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION" => Self::NoAdvertisedRouteToGcpDestination,
9834 "NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION" => Self::NoTrafficSelectorToGcpDestination,
9835 "NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION" => {
9836 Self::NoKnownRouteFromPeeredNetworkToDestination
9837 }
9838 "PRIVATE_NAT_TO_PSC_ENDPOINT_UNSUPPORTED" => {
9839 Self::PrivateNatToPscEndpointUnsupported
9840 }
9841 "PSC_PORT_MAPPING_PORT_MISMATCH" => Self::PscPortMappingPortMismatch,
9842 "PSC_PORT_MAPPING_WITHOUT_PSC_CONNECTION_UNSUPPORTED" => {
9843 Self::PscPortMappingWithoutPscConnectionUnsupported
9844 }
9845 "UNSUPPORTED_ROUTE_MATCHED_FOR_NAT64_DESTINATION" => {
9846 Self::UnsupportedRouteMatchedForNat64Destination
9847 }
9848 "TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED" => {
9849 Self::TrafficFromHybridEndpointToInternetDisallowed
9850 }
9851 "NO_MATCHING_NAT64_GATEWAY" => Self::NoMatchingNat64Gateway,
9852 "LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH" => {
9853 Self::LoadBalancerBackendIpVersionMismatch
9854 }
9855 "NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION" => {
9856 Self::NoKnownRouteFromNccNetworkToDestination
9857 }
9858 "CLOUD_NAT_PROTOCOL_UNSUPPORTED" => Self::CloudNatProtocolUnsupported,
9859 "L2_INTERCONNECT_UNSUPPORTED_PROTOCOL" => Self::L2InterconnectUnsupportedProtocol,
9860 "L2_INTERCONNECT_UNSUPPORTED_PORT" => Self::L2InterconnectUnsupportedPort,
9861 "L2_INTERCONNECT_DESTINATION_IP_MISMATCH" => {
9862 Self::L2InterconnectDestinationIpMismatch
9863 }
9864 "NCC_ROUTE_WITHIN_HYBRID_SUBNET_UNSUPPORTED" => {
9865 Self::NccRouteWithinHybridSubnetUnsupported
9866 }
9867 "HYBRID_SUBNET_REGION_MISMATCH" => Self::HybridSubnetRegionMismatch,
9868 _ => Self::UnknownValue(cause::UnknownValue(
9869 wkt::internal::UnknownEnumValue::String(value.to_string()),
9870 )),
9871 }
9872 }
9873 }
9874
9875 impl serde::ser::Serialize for Cause {
9876 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9877 where
9878 S: serde::Serializer,
9879 {
9880 match self {
9881 Self::Unspecified => serializer.serialize_i32(0),
9882 Self::UnknownExternalAddress => serializer.serialize_i32(1),
9883 Self::ForeignIpDisallowed => serializer.serialize_i32(2),
9884 Self::FirewallRule => serializer.serialize_i32(3),
9885 Self::NoRoute => serializer.serialize_i32(4),
9886 Self::RouteBlackhole => serializer.serialize_i32(5),
9887 Self::RouteWrongNetwork => serializer.serialize_i32(6),
9888 Self::RouteNextHopIpAddressNotResolved => serializer.serialize_i32(42),
9889 Self::RouteNextHopResourceNotFound => serializer.serialize_i32(43),
9890 Self::RouteNextHopInstanceWrongNetwork => serializer.serialize_i32(49),
9891 Self::RouteNextHopInstanceNonPrimaryIp => serializer.serialize_i32(50),
9892 Self::RouteNextHopForwardingRuleIpMismatch => serializer.serialize_i32(51),
9893 Self::RouteNextHopVpnTunnelNotEstablished => serializer.serialize_i32(52),
9894 Self::RouteNextHopForwardingRuleTypeInvalid => serializer.serialize_i32(53),
9895 Self::NoRouteFromInternetToPrivateIpv6Address => serializer.serialize_i32(44),
9896 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
9897 serializer.serialize_i32(98)
9898 }
9899 Self::VpnTunnelLocalSelectorMismatch => serializer.serialize_i32(45),
9900 Self::VpnTunnelRemoteSelectorMismatch => serializer.serialize_i32(46),
9901 Self::PrivateTrafficToInternet => serializer.serialize_i32(7),
9902 Self::PrivateGoogleAccessDisallowed => serializer.serialize_i32(8),
9903 Self::PrivateGoogleAccessViaVpnTunnelUnsupported => serializer.serialize_i32(47),
9904 Self::NoExternalAddress => serializer.serialize_i32(9),
9905 Self::UnknownInternalAddress => serializer.serialize_i32(10),
9906 Self::ForwardingRuleMismatch => serializer.serialize_i32(11),
9907 Self::ForwardingRuleNoInstances => serializer.serialize_i32(12),
9908 Self::FirewallBlockingLoadBalancerBackendHealthCheck => {
9909 serializer.serialize_i32(13)
9910 }
9911 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => {
9912 serializer.serialize_i32(85)
9913 }
9914 Self::InstanceNotRunning => serializer.serialize_i32(14),
9915 Self::GkeClusterNotRunning => serializer.serialize_i32(27),
9916 Self::CloudSqlInstanceNotRunning => serializer.serialize_i32(28),
9917 Self::RedisInstanceNotRunning => serializer.serialize_i32(68),
9918 Self::RedisClusterNotRunning => serializer.serialize_i32(69),
9919 Self::TrafficTypeBlocked => serializer.serialize_i32(15),
9920 Self::GkeMasterUnauthorizedAccess => serializer.serialize_i32(16),
9921 Self::CloudSqlInstanceUnauthorizedAccess => serializer.serialize_i32(17),
9922 Self::DroppedInsideGkeService => serializer.serialize_i32(18),
9923 Self::DroppedInsideCloudSqlService => serializer.serialize_i32(19),
9924 Self::GoogleManagedServiceNoPeering => serializer.serialize_i32(20),
9925 Self::GoogleManagedServiceNoPscEndpoint => serializer.serialize_i32(38),
9926 Self::GkePscEndpointMissing => serializer.serialize_i32(36),
9927 Self::CloudSqlInstanceNoIpAddress => serializer.serialize_i32(21),
9928 Self::GkeControlPlaneRegionMismatch => serializer.serialize_i32(30),
9929 Self::PublicGkeControlPlaneToPrivateDestination => serializer.serialize_i32(31),
9930 Self::GkeControlPlaneNoRoute => serializer.serialize_i32(32),
9931 Self::CloudSqlInstanceNotConfiguredForExternalTraffic => {
9932 serializer.serialize_i32(33)
9933 }
9934 Self::PublicCloudSqlInstanceToPrivateDestination => serializer.serialize_i32(34),
9935 Self::CloudSqlInstanceNoRoute => serializer.serialize_i32(35),
9936 Self::CloudSqlConnectorRequired => serializer.serialize_i32(63),
9937 Self::CloudFunctionNotActive => serializer.serialize_i32(22),
9938 Self::VpcConnectorNotSet => serializer.serialize_i32(23),
9939 Self::VpcConnectorNotRunning => serializer.serialize_i32(24),
9940 Self::VpcConnectorServerlessTrafficBlocked => serializer.serialize_i32(60),
9941 Self::VpcConnectorHealthCheckTrafficBlocked => serializer.serialize_i32(61),
9942 Self::ForwardingRuleRegionMismatch => serializer.serialize_i32(25),
9943 Self::PscConnectionNotAccepted => serializer.serialize_i32(26),
9944 Self::PscEndpointAccessedFromPeeredNetwork => serializer.serialize_i32(41),
9945 Self::PscNegProducerEndpointNoGlobalAccess => serializer.serialize_i32(48),
9946 Self::PscNegProducerForwardingRuleMultiplePorts => serializer.serialize_i32(54),
9947 Self::CloudSqlPscNegUnsupported => serializer.serialize_i32(58),
9948 Self::NoNatSubnetsForPscServiceAttachment => serializer.serialize_i32(57),
9949 Self::PscTransitivityNotPropagated => serializer.serialize_i32(64),
9950 Self::HybridNegNonDynamicRouteMatched => serializer.serialize_i32(55),
9951 Self::HybridNegNonLocalDynamicRouteMatched => serializer.serialize_i32(56),
9952 Self::CloudRunRevisionNotReady => serializer.serialize_i32(29),
9953 Self::DroppedInsidePscServiceProducer => serializer.serialize_i32(37),
9954 Self::LoadBalancerHasNoProxySubnet => serializer.serialize_i32(39),
9955 Self::CloudNatNoAddresses => serializer.serialize_i32(40),
9956 Self::RoutingLoop => serializer.serialize_i32(59),
9957 Self::DroppedInsideGoogleManagedService => serializer.serialize_i32(62),
9958 Self::LoadBalancerBackendInvalidNetwork => serializer.serialize_i32(65),
9959 Self::BackendServiceNamedPortNotDefined => serializer.serialize_i32(66),
9960 Self::DestinationIsPrivateNatIpRange => serializer.serialize_i32(67),
9961 Self::DroppedInsideRedisInstanceService => serializer.serialize_i32(70),
9962 Self::RedisInstanceUnsupportedPort => serializer.serialize_i32(71),
9963 Self::RedisInstanceConnectingFromPupiAddress => serializer.serialize_i32(72),
9964 Self::RedisInstanceNoRouteToDestinationNetwork => serializer.serialize_i32(73),
9965 Self::RedisInstanceNoExternalIp => serializer.serialize_i32(74),
9966 Self::RedisInstanceUnsupportedProtocol => serializer.serialize_i32(78),
9967 Self::DroppedInsideRedisClusterService => serializer.serialize_i32(75),
9968 Self::RedisClusterUnsupportedPort => serializer.serialize_i32(76),
9969 Self::RedisClusterNoExternalIp => serializer.serialize_i32(77),
9970 Self::RedisClusterUnsupportedProtocol => serializer.serialize_i32(79),
9971 Self::NoAdvertisedRouteToGcpDestination => serializer.serialize_i32(80),
9972 Self::NoTrafficSelectorToGcpDestination => serializer.serialize_i32(81),
9973 Self::NoKnownRouteFromPeeredNetworkToDestination => serializer.serialize_i32(82),
9974 Self::PrivateNatToPscEndpointUnsupported => serializer.serialize_i32(83),
9975 Self::PscPortMappingPortMismatch => serializer.serialize_i32(86),
9976 Self::PscPortMappingWithoutPscConnectionUnsupported => serializer.serialize_i32(87),
9977 Self::UnsupportedRouteMatchedForNat64Destination => serializer.serialize_i32(88),
9978 Self::TrafficFromHybridEndpointToInternetDisallowed => serializer.serialize_i32(89),
9979 Self::NoMatchingNat64Gateway => serializer.serialize_i32(90),
9980 Self::LoadBalancerBackendIpVersionMismatch => serializer.serialize_i32(96),
9981 Self::NoKnownRouteFromNccNetworkToDestination => serializer.serialize_i32(97),
9982 Self::CloudNatProtocolUnsupported => serializer.serialize_i32(99),
9983 Self::L2InterconnectUnsupportedProtocol => serializer.serialize_i32(100),
9984 Self::L2InterconnectUnsupportedPort => serializer.serialize_i32(101),
9985 Self::L2InterconnectDestinationIpMismatch => serializer.serialize_i32(102),
9986 Self::NccRouteWithinHybridSubnetUnsupported => serializer.serialize_i32(104),
9987 Self::HybridSubnetRegionMismatch => serializer.serialize_i32(105),
9988 Self::UnknownValue(u) => u.0.serialize(serializer),
9989 }
9990 }
9991 }
9992
9993 impl<'de> serde::de::Deserialize<'de> for Cause {
9994 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9995 where
9996 D: serde::Deserializer<'de>,
9997 {
9998 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Cause>::new(
9999 ".google.cloud.networkmanagement.v1.DropInfo.Cause",
10000 ))
10001 }
10002 }
10003}
10004
10005#[derive(Clone, Default, PartialEq)]
10008#[non_exhaustive]
10009pub struct GKEMasterInfo {
10010 pub cluster_uri: std::string::String,
10012
10013 pub cluster_network_uri: std::string::String,
10015
10016 pub internal_ip: std::string::String,
10018
10019 pub external_ip: std::string::String,
10021
10022 pub dns_endpoint: std::string::String,
10024
10025 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10026}
10027
10028impl GKEMasterInfo {
10029 pub fn new() -> Self {
10030 std::default::Default::default()
10031 }
10032
10033 pub fn set_cluster_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10035 self.cluster_uri = v.into();
10036 self
10037 }
10038
10039 pub fn set_cluster_network_uri<T: std::convert::Into<std::string::String>>(
10041 mut self,
10042 v: T,
10043 ) -> Self {
10044 self.cluster_network_uri = v.into();
10045 self
10046 }
10047
10048 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10050 self.internal_ip = v.into();
10051 self
10052 }
10053
10054 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10056 self.external_ip = v.into();
10057 self
10058 }
10059
10060 pub fn set_dns_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10062 self.dns_endpoint = v.into();
10063 self
10064 }
10065}
10066
10067impl wkt::message::Message for GKEMasterInfo {
10068 fn typename() -> &'static str {
10069 "type.googleapis.com/google.cloud.networkmanagement.v1.GKEMasterInfo"
10070 }
10071}
10072
10073#[derive(Clone, Default, PartialEq)]
10075#[non_exhaustive]
10076pub struct CloudSQLInstanceInfo {
10077 pub display_name: std::string::String,
10079
10080 pub uri: std::string::String,
10082
10083 pub network_uri: std::string::String,
10086
10087 pub internal_ip: std::string::String,
10089
10090 pub external_ip: std::string::String,
10092
10093 pub region: std::string::String,
10095
10096 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10097}
10098
10099impl CloudSQLInstanceInfo {
10100 pub fn new() -> Self {
10101 std::default::Default::default()
10102 }
10103
10104 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10106 self.display_name = v.into();
10107 self
10108 }
10109
10110 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10112 self.uri = v.into();
10113 self
10114 }
10115
10116 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10118 self.network_uri = v.into();
10119 self
10120 }
10121
10122 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10124 self.internal_ip = v.into();
10125 self
10126 }
10127
10128 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10130 self.external_ip = v.into();
10131 self
10132 }
10133
10134 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10136 self.region = v.into();
10137 self
10138 }
10139}
10140
10141impl wkt::message::Message for CloudSQLInstanceInfo {
10142 fn typename() -> &'static str {
10143 "type.googleapis.com/google.cloud.networkmanagement.v1.CloudSQLInstanceInfo"
10144 }
10145}
10146
10147#[derive(Clone, Default, PartialEq)]
10149#[non_exhaustive]
10150pub struct RedisInstanceInfo {
10151 pub display_name: std::string::String,
10153
10154 pub uri: std::string::String,
10156
10157 pub network_uri: std::string::String,
10159
10160 pub primary_endpoint_ip: std::string::String,
10162
10163 pub read_endpoint_ip: std::string::String,
10165
10166 pub region: std::string::String,
10168
10169 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10170}
10171
10172impl RedisInstanceInfo {
10173 pub fn new() -> Self {
10174 std::default::Default::default()
10175 }
10176
10177 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10179 self.display_name = v.into();
10180 self
10181 }
10182
10183 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10185 self.uri = v.into();
10186 self
10187 }
10188
10189 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10191 self.network_uri = v.into();
10192 self
10193 }
10194
10195 pub fn set_primary_endpoint_ip<T: std::convert::Into<std::string::String>>(
10197 mut self,
10198 v: T,
10199 ) -> Self {
10200 self.primary_endpoint_ip = v.into();
10201 self
10202 }
10203
10204 pub fn set_read_endpoint_ip<T: std::convert::Into<std::string::String>>(
10206 mut self,
10207 v: T,
10208 ) -> Self {
10209 self.read_endpoint_ip = v.into();
10210 self
10211 }
10212
10213 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10215 self.region = v.into();
10216 self
10217 }
10218}
10219
10220impl wkt::message::Message for RedisInstanceInfo {
10221 fn typename() -> &'static str {
10222 "type.googleapis.com/google.cloud.networkmanagement.v1.RedisInstanceInfo"
10223 }
10224}
10225
10226#[derive(Clone, Default, PartialEq)]
10228#[non_exhaustive]
10229pub struct RedisClusterInfo {
10230 pub display_name: std::string::String,
10232
10233 pub uri: std::string::String,
10236
10237 pub network_uri: std::string::String,
10240
10241 pub discovery_endpoint_ip_address: std::string::String,
10243
10244 pub secondary_endpoint_ip_address: std::string::String,
10246
10247 pub location: std::string::String,
10250
10251 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10252}
10253
10254impl RedisClusterInfo {
10255 pub fn new() -> Self {
10256 std::default::Default::default()
10257 }
10258
10259 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10261 self.display_name = v.into();
10262 self
10263 }
10264
10265 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10267 self.uri = v.into();
10268 self
10269 }
10270
10271 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10273 self.network_uri = v.into();
10274 self
10275 }
10276
10277 pub fn set_discovery_endpoint_ip_address<T: std::convert::Into<std::string::String>>(
10279 mut self,
10280 v: T,
10281 ) -> Self {
10282 self.discovery_endpoint_ip_address = v.into();
10283 self
10284 }
10285
10286 pub fn set_secondary_endpoint_ip_address<T: std::convert::Into<std::string::String>>(
10288 mut self,
10289 v: T,
10290 ) -> Self {
10291 self.secondary_endpoint_ip_address = v.into();
10292 self
10293 }
10294
10295 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10297 self.location = v.into();
10298 self
10299 }
10300}
10301
10302impl wkt::message::Message for RedisClusterInfo {
10303 fn typename() -> &'static str {
10304 "type.googleapis.com/google.cloud.networkmanagement.v1.RedisClusterInfo"
10305 }
10306}
10307
10308#[derive(Clone, Default, PartialEq)]
10310#[non_exhaustive]
10311pub struct CloudFunctionInfo {
10312 pub display_name: std::string::String,
10314
10315 pub uri: std::string::String,
10317
10318 pub location: std::string::String,
10320
10321 pub version_id: i64,
10323
10324 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10325}
10326
10327impl CloudFunctionInfo {
10328 pub fn new() -> Self {
10329 std::default::Default::default()
10330 }
10331
10332 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10334 self.display_name = v.into();
10335 self
10336 }
10337
10338 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10340 self.uri = v.into();
10341 self
10342 }
10343
10344 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10346 self.location = v.into();
10347 self
10348 }
10349
10350 pub fn set_version_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10352 self.version_id = v.into();
10353 self
10354 }
10355}
10356
10357impl wkt::message::Message for CloudFunctionInfo {
10358 fn typename() -> &'static str {
10359 "type.googleapis.com/google.cloud.networkmanagement.v1.CloudFunctionInfo"
10360 }
10361}
10362
10363#[derive(Clone, Default, PartialEq)]
10365#[non_exhaustive]
10366pub struct CloudRunRevisionInfo {
10367 pub display_name: std::string::String,
10369
10370 pub uri: std::string::String,
10372
10373 pub location: std::string::String,
10375
10376 pub service_uri: std::string::String,
10378
10379 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10380}
10381
10382impl CloudRunRevisionInfo {
10383 pub fn new() -> Self {
10384 std::default::Default::default()
10385 }
10386
10387 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10389 self.display_name = v.into();
10390 self
10391 }
10392
10393 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10395 self.uri = v.into();
10396 self
10397 }
10398
10399 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10401 self.location = v.into();
10402 self
10403 }
10404
10405 pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10407 self.service_uri = v.into();
10408 self
10409 }
10410}
10411
10412impl wkt::message::Message for CloudRunRevisionInfo {
10413 fn typename() -> &'static str {
10414 "type.googleapis.com/google.cloud.networkmanagement.v1.CloudRunRevisionInfo"
10415 }
10416}
10417
10418#[derive(Clone, Default, PartialEq)]
10420#[non_exhaustive]
10421pub struct AppEngineVersionInfo {
10422 pub display_name: std::string::String,
10424
10425 pub uri: std::string::String,
10427
10428 pub runtime: std::string::String,
10430
10431 pub environment: std::string::String,
10433
10434 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10435}
10436
10437impl AppEngineVersionInfo {
10438 pub fn new() -> Self {
10439 std::default::Default::default()
10440 }
10441
10442 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10444 self.display_name = v.into();
10445 self
10446 }
10447
10448 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10450 self.uri = v.into();
10451 self
10452 }
10453
10454 pub fn set_runtime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10456 self.runtime = v.into();
10457 self
10458 }
10459
10460 pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10462 self.environment = v.into();
10463 self
10464 }
10465}
10466
10467impl wkt::message::Message for AppEngineVersionInfo {
10468 fn typename() -> &'static str {
10469 "type.googleapis.com/google.cloud.networkmanagement.v1.AppEngineVersionInfo"
10470 }
10471}
10472
10473#[derive(Clone, Default, PartialEq)]
10475#[non_exhaustive]
10476pub struct VpcConnectorInfo {
10477 pub display_name: std::string::String,
10479
10480 pub uri: std::string::String,
10482
10483 pub location: std::string::String,
10485
10486 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10487}
10488
10489impl VpcConnectorInfo {
10490 pub fn new() -> Self {
10491 std::default::Default::default()
10492 }
10493
10494 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10496 self.display_name = v.into();
10497 self
10498 }
10499
10500 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10502 self.uri = v.into();
10503 self
10504 }
10505
10506 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10508 self.location = v.into();
10509 self
10510 }
10511}
10512
10513impl wkt::message::Message for VpcConnectorInfo {
10514 fn typename() -> &'static str {
10515 "type.googleapis.com/google.cloud.networkmanagement.v1.VpcConnectorInfo"
10516 }
10517}
10518
10519#[derive(Clone, Default, PartialEq)]
10522#[non_exhaustive]
10523pub struct DirectVpcEgressConnectionInfo {
10524 pub network_uri: std::string::String,
10526
10527 pub subnetwork_uri: std::string::String,
10529
10530 pub selected_ip_range: std::string::String,
10532
10533 pub selected_ip_address: std::string::String,
10535
10536 pub region: std::string::String,
10538
10539 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10540}
10541
10542impl DirectVpcEgressConnectionInfo {
10543 pub fn new() -> Self {
10544 std::default::Default::default()
10545 }
10546
10547 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10549 self.network_uri = v.into();
10550 self
10551 }
10552
10553 pub fn set_subnetwork_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10555 self.subnetwork_uri = v.into();
10556 self
10557 }
10558
10559 pub fn set_selected_ip_range<T: std::convert::Into<std::string::String>>(
10561 mut self,
10562 v: T,
10563 ) -> Self {
10564 self.selected_ip_range = v.into();
10565 self
10566 }
10567
10568 pub fn set_selected_ip_address<T: std::convert::Into<std::string::String>>(
10570 mut self,
10571 v: T,
10572 ) -> Self {
10573 self.selected_ip_address = v.into();
10574 self
10575 }
10576
10577 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10579 self.region = v.into();
10580 self
10581 }
10582}
10583
10584impl wkt::message::Message for DirectVpcEgressConnectionInfo {
10585 fn typename() -> &'static str {
10586 "type.googleapis.com/google.cloud.networkmanagement.v1.DirectVpcEgressConnectionInfo"
10587 }
10588}
10589
10590#[derive(Clone, Default, PartialEq)]
10592#[non_exhaustive]
10593pub struct ServerlessExternalConnectionInfo {
10594 pub selected_ip_address: std::string::String,
10596
10597 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10598}
10599
10600impl ServerlessExternalConnectionInfo {
10601 pub fn new() -> Self {
10602 std::default::Default::default()
10603 }
10604
10605 pub fn set_selected_ip_address<T: std::convert::Into<std::string::String>>(
10607 mut self,
10608 v: T,
10609 ) -> Self {
10610 self.selected_ip_address = v.into();
10611 self
10612 }
10613}
10614
10615impl wkt::message::Message for ServerlessExternalConnectionInfo {
10616 fn typename() -> &'static str {
10617 "type.googleapis.com/google.cloud.networkmanagement.v1.ServerlessExternalConnectionInfo"
10618 }
10619}
10620
10621#[derive(Clone, Default, PartialEq)]
10623#[non_exhaustive]
10624pub struct NatInfo {
10625 pub r#type: crate::model::nat_info::Type,
10627
10628 pub protocol: std::string::String,
10630
10631 pub network_uri: std::string::String,
10633
10634 pub old_source_ip: std::string::String,
10636
10637 pub new_source_ip: std::string::String,
10639
10640 pub old_destination_ip: std::string::String,
10642
10643 pub new_destination_ip: std::string::String,
10645
10646 pub old_source_port: i32,
10648
10649 pub new_source_port: i32,
10651
10652 pub old_destination_port: i32,
10655
10656 pub new_destination_port: i32,
10659
10660 pub router_uri: std::string::String,
10662
10663 pub nat_gateway_name: std::string::String,
10665
10666 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10667}
10668
10669impl NatInfo {
10670 pub fn new() -> Self {
10671 std::default::Default::default()
10672 }
10673
10674 pub fn set_type<T: std::convert::Into<crate::model::nat_info::Type>>(mut self, v: T) -> Self {
10676 self.r#type = v.into();
10677 self
10678 }
10679
10680 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10682 self.protocol = v.into();
10683 self
10684 }
10685
10686 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10688 self.network_uri = v.into();
10689 self
10690 }
10691
10692 pub fn set_old_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10694 self.old_source_ip = v.into();
10695 self
10696 }
10697
10698 pub fn set_new_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10700 self.new_source_ip = v.into();
10701 self
10702 }
10703
10704 pub fn set_old_destination_ip<T: std::convert::Into<std::string::String>>(
10706 mut self,
10707 v: T,
10708 ) -> Self {
10709 self.old_destination_ip = v.into();
10710 self
10711 }
10712
10713 pub fn set_new_destination_ip<T: std::convert::Into<std::string::String>>(
10715 mut self,
10716 v: T,
10717 ) -> Self {
10718 self.new_destination_ip = v.into();
10719 self
10720 }
10721
10722 pub fn set_old_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10724 self.old_source_port = v.into();
10725 self
10726 }
10727
10728 pub fn set_new_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10730 self.new_source_port = v.into();
10731 self
10732 }
10733
10734 pub fn set_old_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10736 self.old_destination_port = v.into();
10737 self
10738 }
10739
10740 pub fn set_new_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10742 self.new_destination_port = v.into();
10743 self
10744 }
10745
10746 pub fn set_router_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10748 self.router_uri = v.into();
10749 self
10750 }
10751
10752 pub fn set_nat_gateway_name<T: std::convert::Into<std::string::String>>(
10754 mut self,
10755 v: T,
10756 ) -> Self {
10757 self.nat_gateway_name = v.into();
10758 self
10759 }
10760}
10761
10762impl wkt::message::Message for NatInfo {
10763 fn typename() -> &'static str {
10764 "type.googleapis.com/google.cloud.networkmanagement.v1.NatInfo"
10765 }
10766}
10767
10768pub mod nat_info {
10770 #[allow(unused_imports)]
10771 use super::*;
10772
10773 #[derive(Clone, Debug, PartialEq)]
10789 #[non_exhaustive]
10790 pub enum Type {
10791 Unspecified,
10793 InternalToExternal,
10795 ExternalToInternal,
10797 CloudNat,
10799 PrivateServiceConnect,
10801 GkePodIpMasquerading,
10803 UnknownValue(r#type::UnknownValue),
10808 }
10809
10810 #[doc(hidden)]
10811 pub mod r#type {
10812 #[allow(unused_imports)]
10813 use super::*;
10814 #[derive(Clone, Debug, PartialEq)]
10815 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10816 }
10817
10818 impl Type {
10819 pub fn value(&self) -> std::option::Option<i32> {
10824 match self {
10825 Self::Unspecified => std::option::Option::Some(0),
10826 Self::InternalToExternal => std::option::Option::Some(1),
10827 Self::ExternalToInternal => std::option::Option::Some(2),
10828 Self::CloudNat => std::option::Option::Some(3),
10829 Self::PrivateServiceConnect => std::option::Option::Some(4),
10830 Self::GkePodIpMasquerading => std::option::Option::Some(5),
10831 Self::UnknownValue(u) => u.0.value(),
10832 }
10833 }
10834
10835 pub fn name(&self) -> std::option::Option<&str> {
10840 match self {
10841 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
10842 Self::InternalToExternal => std::option::Option::Some("INTERNAL_TO_EXTERNAL"),
10843 Self::ExternalToInternal => std::option::Option::Some("EXTERNAL_TO_INTERNAL"),
10844 Self::CloudNat => std::option::Option::Some("CLOUD_NAT"),
10845 Self::PrivateServiceConnect => std::option::Option::Some("PRIVATE_SERVICE_CONNECT"),
10846 Self::GkePodIpMasquerading => std::option::Option::Some("GKE_POD_IP_MASQUERADING"),
10847 Self::UnknownValue(u) => u.0.name(),
10848 }
10849 }
10850 }
10851
10852 impl std::default::Default for Type {
10853 fn default() -> Self {
10854 use std::convert::From;
10855 Self::from(0)
10856 }
10857 }
10858
10859 impl std::fmt::Display for Type {
10860 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10861 wkt::internal::display_enum(f, self.name(), self.value())
10862 }
10863 }
10864
10865 impl std::convert::From<i32> for Type {
10866 fn from(value: i32) -> Self {
10867 match value {
10868 0 => Self::Unspecified,
10869 1 => Self::InternalToExternal,
10870 2 => Self::ExternalToInternal,
10871 3 => Self::CloudNat,
10872 4 => Self::PrivateServiceConnect,
10873 5 => Self::GkePodIpMasquerading,
10874 _ => Self::UnknownValue(r#type::UnknownValue(
10875 wkt::internal::UnknownEnumValue::Integer(value),
10876 )),
10877 }
10878 }
10879 }
10880
10881 impl std::convert::From<&str> for Type {
10882 fn from(value: &str) -> Self {
10883 use std::string::ToString;
10884 match value {
10885 "TYPE_UNSPECIFIED" => Self::Unspecified,
10886 "INTERNAL_TO_EXTERNAL" => Self::InternalToExternal,
10887 "EXTERNAL_TO_INTERNAL" => Self::ExternalToInternal,
10888 "CLOUD_NAT" => Self::CloudNat,
10889 "PRIVATE_SERVICE_CONNECT" => Self::PrivateServiceConnect,
10890 "GKE_POD_IP_MASQUERADING" => Self::GkePodIpMasquerading,
10891 _ => Self::UnknownValue(r#type::UnknownValue(
10892 wkt::internal::UnknownEnumValue::String(value.to_string()),
10893 )),
10894 }
10895 }
10896 }
10897
10898 impl serde::ser::Serialize for Type {
10899 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10900 where
10901 S: serde::Serializer,
10902 {
10903 match self {
10904 Self::Unspecified => serializer.serialize_i32(0),
10905 Self::InternalToExternal => serializer.serialize_i32(1),
10906 Self::ExternalToInternal => serializer.serialize_i32(2),
10907 Self::CloudNat => serializer.serialize_i32(3),
10908 Self::PrivateServiceConnect => serializer.serialize_i32(4),
10909 Self::GkePodIpMasquerading => serializer.serialize_i32(5),
10910 Self::UnknownValue(u) => u.0.serialize(serializer),
10911 }
10912 }
10913 }
10914
10915 impl<'de> serde::de::Deserialize<'de> for Type {
10916 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10917 where
10918 D: serde::Deserializer<'de>,
10919 {
10920 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
10921 ".google.cloud.networkmanagement.v1.NatInfo.Type",
10922 ))
10923 }
10924 }
10925}
10926
10927#[derive(Clone, Default, PartialEq)]
10929#[non_exhaustive]
10930pub struct ProxyConnectionInfo {
10931 pub protocol: std::string::String,
10933
10934 pub old_source_ip: std::string::String,
10936
10937 pub new_source_ip: std::string::String,
10939
10940 pub old_destination_ip: std::string::String,
10942
10943 pub new_destination_ip: std::string::String,
10945
10946 pub old_source_port: i32,
10949
10950 pub new_source_port: i32,
10952
10953 pub old_destination_port: i32,
10956
10957 pub new_destination_port: i32,
10960
10961 pub subnet_uri: std::string::String,
10963
10964 pub network_uri: std::string::String,
10966
10967 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10968}
10969
10970impl ProxyConnectionInfo {
10971 pub fn new() -> Self {
10972 std::default::Default::default()
10973 }
10974
10975 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10977 self.protocol = v.into();
10978 self
10979 }
10980
10981 pub fn set_old_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10983 self.old_source_ip = v.into();
10984 self
10985 }
10986
10987 pub fn set_new_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10989 self.new_source_ip = v.into();
10990 self
10991 }
10992
10993 pub fn set_old_destination_ip<T: std::convert::Into<std::string::String>>(
10995 mut self,
10996 v: T,
10997 ) -> Self {
10998 self.old_destination_ip = v.into();
10999 self
11000 }
11001
11002 pub fn set_new_destination_ip<T: std::convert::Into<std::string::String>>(
11004 mut self,
11005 v: T,
11006 ) -> Self {
11007 self.new_destination_ip = v.into();
11008 self
11009 }
11010
11011 pub fn set_old_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11013 self.old_source_port = v.into();
11014 self
11015 }
11016
11017 pub fn set_new_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11019 self.new_source_port = v.into();
11020 self
11021 }
11022
11023 pub fn set_old_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11025 self.old_destination_port = v.into();
11026 self
11027 }
11028
11029 pub fn set_new_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11031 self.new_destination_port = v.into();
11032 self
11033 }
11034
11035 pub fn set_subnet_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11037 self.subnet_uri = v.into();
11038 self
11039 }
11040
11041 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11043 self.network_uri = v.into();
11044 self
11045 }
11046}
11047
11048impl wkt::message::Message for ProxyConnectionInfo {
11049 fn typename() -> &'static str {
11050 "type.googleapis.com/google.cloud.networkmanagement.v1.ProxyConnectionInfo"
11051 }
11052}
11053
11054#[derive(Clone, Default, PartialEq)]
11056#[non_exhaustive]
11057pub struct LoadBalancerBackendInfo {
11058 pub name: std::string::String,
11062
11063 pub instance_uri: std::string::String,
11066
11067 pub backend_service_uri: std::string::String,
11069
11070 pub instance_group_uri: std::string::String,
11072
11073 pub network_endpoint_group_uri: std::string::String,
11075
11076 pub backend_bucket_uri: std::string::String,
11078
11079 pub psc_service_attachment_uri: std::string::String,
11082
11083 pub psc_google_api_target: std::string::String,
11085
11086 pub health_check_uri: std::string::String,
11088
11089 pub health_check_firewalls_config_state:
11096 crate::model::load_balancer_backend_info::HealthCheckFirewallsConfigState,
11097
11098 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11099}
11100
11101impl LoadBalancerBackendInfo {
11102 pub fn new() -> Self {
11103 std::default::Default::default()
11104 }
11105
11106 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11108 self.name = v.into();
11109 self
11110 }
11111
11112 pub fn set_instance_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11114 self.instance_uri = v.into();
11115 self
11116 }
11117
11118 pub fn set_backend_service_uri<T: std::convert::Into<std::string::String>>(
11120 mut self,
11121 v: T,
11122 ) -> Self {
11123 self.backend_service_uri = v.into();
11124 self
11125 }
11126
11127 pub fn set_instance_group_uri<T: std::convert::Into<std::string::String>>(
11129 mut self,
11130 v: T,
11131 ) -> Self {
11132 self.instance_group_uri = v.into();
11133 self
11134 }
11135
11136 pub fn set_network_endpoint_group_uri<T: std::convert::Into<std::string::String>>(
11138 mut self,
11139 v: T,
11140 ) -> Self {
11141 self.network_endpoint_group_uri = v.into();
11142 self
11143 }
11144
11145 pub fn set_backend_bucket_uri<T: std::convert::Into<std::string::String>>(
11147 mut self,
11148 v: T,
11149 ) -> Self {
11150 self.backend_bucket_uri = v.into();
11151 self
11152 }
11153
11154 pub fn set_psc_service_attachment_uri<T: std::convert::Into<std::string::String>>(
11156 mut self,
11157 v: T,
11158 ) -> Self {
11159 self.psc_service_attachment_uri = v.into();
11160 self
11161 }
11162
11163 pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
11165 mut self,
11166 v: T,
11167 ) -> Self {
11168 self.psc_google_api_target = v.into();
11169 self
11170 }
11171
11172 pub fn set_health_check_uri<T: std::convert::Into<std::string::String>>(
11174 mut self,
11175 v: T,
11176 ) -> Self {
11177 self.health_check_uri = v.into();
11178 self
11179 }
11180
11181 pub fn set_health_check_firewalls_config_state<
11183 T: std::convert::Into<
11184 crate::model::load_balancer_backend_info::HealthCheckFirewallsConfigState,
11185 >,
11186 >(
11187 mut self,
11188 v: T,
11189 ) -> Self {
11190 self.health_check_firewalls_config_state = v.into();
11191 self
11192 }
11193}
11194
11195impl wkt::message::Message for LoadBalancerBackendInfo {
11196 fn typename() -> &'static str {
11197 "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerBackendInfo"
11198 }
11199}
11200
11201pub mod load_balancer_backend_info {
11203 #[allow(unused_imports)]
11204 use super::*;
11205
11206 #[derive(Clone, Debug, PartialEq)]
11222 #[non_exhaustive]
11223 pub enum HealthCheckFirewallsConfigState {
11224 Unspecified,
11228 FirewallsConfigured,
11231 FirewallsPartiallyConfigured,
11234 FirewallsNotConfigured,
11237 FirewallsUnsupported,
11242 UnknownValue(health_check_firewalls_config_state::UnknownValue),
11247 }
11248
11249 #[doc(hidden)]
11250 pub mod health_check_firewalls_config_state {
11251 #[allow(unused_imports)]
11252 use super::*;
11253 #[derive(Clone, Debug, PartialEq)]
11254 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11255 }
11256
11257 impl HealthCheckFirewallsConfigState {
11258 pub fn value(&self) -> std::option::Option<i32> {
11263 match self {
11264 Self::Unspecified => std::option::Option::Some(0),
11265 Self::FirewallsConfigured => std::option::Option::Some(1),
11266 Self::FirewallsPartiallyConfigured => std::option::Option::Some(2),
11267 Self::FirewallsNotConfigured => std::option::Option::Some(3),
11268 Self::FirewallsUnsupported => std::option::Option::Some(4),
11269 Self::UnknownValue(u) => u.0.value(),
11270 }
11271 }
11272
11273 pub fn name(&self) -> std::option::Option<&str> {
11278 match self {
11279 Self::Unspecified => {
11280 std::option::Option::Some("HEALTH_CHECK_FIREWALLS_CONFIG_STATE_UNSPECIFIED")
11281 }
11282 Self::FirewallsConfigured => std::option::Option::Some("FIREWALLS_CONFIGURED"),
11283 Self::FirewallsPartiallyConfigured => {
11284 std::option::Option::Some("FIREWALLS_PARTIALLY_CONFIGURED")
11285 }
11286 Self::FirewallsNotConfigured => {
11287 std::option::Option::Some("FIREWALLS_NOT_CONFIGURED")
11288 }
11289 Self::FirewallsUnsupported => std::option::Option::Some("FIREWALLS_UNSUPPORTED"),
11290 Self::UnknownValue(u) => u.0.name(),
11291 }
11292 }
11293 }
11294
11295 impl std::default::Default for HealthCheckFirewallsConfigState {
11296 fn default() -> Self {
11297 use std::convert::From;
11298 Self::from(0)
11299 }
11300 }
11301
11302 impl std::fmt::Display for HealthCheckFirewallsConfigState {
11303 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11304 wkt::internal::display_enum(f, self.name(), self.value())
11305 }
11306 }
11307
11308 impl std::convert::From<i32> for HealthCheckFirewallsConfigState {
11309 fn from(value: i32) -> Self {
11310 match value {
11311 0 => Self::Unspecified,
11312 1 => Self::FirewallsConfigured,
11313 2 => Self::FirewallsPartiallyConfigured,
11314 3 => Self::FirewallsNotConfigured,
11315 4 => Self::FirewallsUnsupported,
11316 _ => Self::UnknownValue(health_check_firewalls_config_state::UnknownValue(
11317 wkt::internal::UnknownEnumValue::Integer(value),
11318 )),
11319 }
11320 }
11321 }
11322
11323 impl std::convert::From<&str> for HealthCheckFirewallsConfigState {
11324 fn from(value: &str) -> Self {
11325 use std::string::ToString;
11326 match value {
11327 "HEALTH_CHECK_FIREWALLS_CONFIG_STATE_UNSPECIFIED" => Self::Unspecified,
11328 "FIREWALLS_CONFIGURED" => Self::FirewallsConfigured,
11329 "FIREWALLS_PARTIALLY_CONFIGURED" => Self::FirewallsPartiallyConfigured,
11330 "FIREWALLS_NOT_CONFIGURED" => Self::FirewallsNotConfigured,
11331 "FIREWALLS_UNSUPPORTED" => Self::FirewallsUnsupported,
11332 _ => Self::UnknownValue(health_check_firewalls_config_state::UnknownValue(
11333 wkt::internal::UnknownEnumValue::String(value.to_string()),
11334 )),
11335 }
11336 }
11337 }
11338
11339 impl serde::ser::Serialize for HealthCheckFirewallsConfigState {
11340 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11341 where
11342 S: serde::Serializer,
11343 {
11344 match self {
11345 Self::Unspecified => serializer.serialize_i32(0),
11346 Self::FirewallsConfigured => serializer.serialize_i32(1),
11347 Self::FirewallsPartiallyConfigured => serializer.serialize_i32(2),
11348 Self::FirewallsNotConfigured => serializer.serialize_i32(3),
11349 Self::FirewallsUnsupported => serializer.serialize_i32(4),
11350 Self::UnknownValue(u) => u.0.serialize(serializer),
11351 }
11352 }
11353 }
11354
11355 impl<'de> serde::de::Deserialize<'de> for HealthCheckFirewallsConfigState {
11356 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11357 where
11358 D: serde::Deserializer<'de>,
11359 {
11360 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HealthCheckFirewallsConfigState>::new(
11361 ".google.cloud.networkmanagement.v1.LoadBalancerBackendInfo.HealthCheckFirewallsConfigState"))
11362 }
11363 }
11364}
11365
11366#[derive(Clone, Default, PartialEq)]
11368#[non_exhaustive]
11369pub struct StorageBucketInfo {
11370 pub bucket: std::string::String,
11372
11373 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11374}
11375
11376impl StorageBucketInfo {
11377 pub fn new() -> Self {
11378 std::default::Default::default()
11379 }
11380
11381 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11383 self.bucket = v.into();
11384 self
11385 }
11386}
11387
11388impl wkt::message::Message for StorageBucketInfo {
11389 fn typename() -> &'static str {
11390 "type.googleapis.com/google.cloud.networkmanagement.v1.StorageBucketInfo"
11391 }
11392}
11393
11394#[derive(Clone, Default, PartialEq)]
11397#[non_exhaustive]
11398pub struct ServerlessNegInfo {
11399 pub neg_uri: std::string::String,
11401
11402 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11403}
11404
11405impl ServerlessNegInfo {
11406 pub fn new() -> Self {
11407 std::default::Default::default()
11408 }
11409
11410 pub fn set_neg_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11412 self.neg_uri = v.into();
11413 self
11414 }
11415}
11416
11417impl wkt::message::Message for ServerlessNegInfo {
11418 fn typename() -> &'static str {
11419 "type.googleapis.com/google.cloud.networkmanagement.v1.ServerlessNegInfo"
11420 }
11421}
11422
11423#[derive(Clone, Default, PartialEq)]
11425#[non_exhaustive]
11426pub struct ListVpcFlowLogsConfigsRequest {
11427 pub parent: std::string::String,
11436
11437 pub page_size: i32,
11439
11440 pub page_token: std::string::String,
11443
11444 pub filter: std::string::String,
11448
11449 pub order_by: std::string::String,
11451
11452 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11453}
11454
11455impl ListVpcFlowLogsConfigsRequest {
11456 pub fn new() -> Self {
11457 std::default::Default::default()
11458 }
11459
11460 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11462 self.parent = v.into();
11463 self
11464 }
11465
11466 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11468 self.page_size = v.into();
11469 self
11470 }
11471
11472 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11474 self.page_token = v.into();
11475 self
11476 }
11477
11478 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11480 self.filter = v.into();
11481 self
11482 }
11483
11484 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11486 self.order_by = v.into();
11487 self
11488 }
11489}
11490
11491impl wkt::message::Message for ListVpcFlowLogsConfigsRequest {
11492 fn typename() -> &'static str {
11493 "type.googleapis.com/google.cloud.networkmanagement.v1.ListVpcFlowLogsConfigsRequest"
11494 }
11495}
11496
11497#[derive(Clone, Default, PartialEq)]
11499#[non_exhaustive]
11500pub struct ListVpcFlowLogsConfigsResponse {
11501 pub vpc_flow_logs_configs: std::vec::Vec<crate::model::VpcFlowLogsConfig>,
11503
11504 pub next_page_token: std::string::String,
11506
11507 pub unreachable: std::vec::Vec<std::string::String>,
11509
11510 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11511}
11512
11513impl ListVpcFlowLogsConfigsResponse {
11514 pub fn new() -> Self {
11515 std::default::Default::default()
11516 }
11517
11518 pub fn set_vpc_flow_logs_configs<T, V>(mut self, v: T) -> Self
11520 where
11521 T: std::iter::IntoIterator<Item = V>,
11522 V: std::convert::Into<crate::model::VpcFlowLogsConfig>,
11523 {
11524 use std::iter::Iterator;
11525 self.vpc_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
11526 self
11527 }
11528
11529 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11531 self.next_page_token = v.into();
11532 self
11533 }
11534
11535 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11537 where
11538 T: std::iter::IntoIterator<Item = V>,
11539 V: std::convert::Into<std::string::String>,
11540 {
11541 use std::iter::Iterator;
11542 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11543 self
11544 }
11545}
11546
11547impl wkt::message::Message for ListVpcFlowLogsConfigsResponse {
11548 fn typename() -> &'static str {
11549 "type.googleapis.com/google.cloud.networkmanagement.v1.ListVpcFlowLogsConfigsResponse"
11550 }
11551}
11552
11553#[doc(hidden)]
11554impl gax::paginator::internal::PageableResponse for ListVpcFlowLogsConfigsResponse {
11555 type PageItem = crate::model::VpcFlowLogsConfig;
11556
11557 fn items(self) -> std::vec::Vec<Self::PageItem> {
11558 self.vpc_flow_logs_configs
11559 }
11560
11561 fn next_page_token(&self) -> std::string::String {
11562 use std::clone::Clone;
11563 self.next_page_token.clone()
11564 }
11565}
11566
11567#[derive(Clone, Default, PartialEq)]
11569#[non_exhaustive]
11570pub struct GetVpcFlowLogsConfigRequest {
11571 pub name: std::string::String,
11581
11582 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11583}
11584
11585impl GetVpcFlowLogsConfigRequest {
11586 pub fn new() -> Self {
11587 std::default::Default::default()
11588 }
11589
11590 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11592 self.name = v.into();
11593 self
11594 }
11595}
11596
11597impl wkt::message::Message for GetVpcFlowLogsConfigRequest {
11598 fn typename() -> &'static str {
11599 "type.googleapis.com/google.cloud.networkmanagement.v1.GetVpcFlowLogsConfigRequest"
11600 }
11601}
11602
11603#[derive(Clone, Default, PartialEq)]
11605#[non_exhaustive]
11606pub struct CreateVpcFlowLogsConfigRequest {
11607 pub parent: std::string::String,
11616
11617 pub vpc_flow_logs_config_id: std::string::String,
11619
11620 pub vpc_flow_logs_config: std::option::Option<crate::model::VpcFlowLogsConfig>,
11622
11623 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11624}
11625
11626impl CreateVpcFlowLogsConfigRequest {
11627 pub fn new() -> Self {
11628 std::default::Default::default()
11629 }
11630
11631 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11633 self.parent = v.into();
11634 self
11635 }
11636
11637 pub fn set_vpc_flow_logs_config_id<T: std::convert::Into<std::string::String>>(
11639 mut self,
11640 v: T,
11641 ) -> Self {
11642 self.vpc_flow_logs_config_id = v.into();
11643 self
11644 }
11645
11646 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
11648 where
11649 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
11650 {
11651 self.vpc_flow_logs_config = std::option::Option::Some(v.into());
11652 self
11653 }
11654
11655 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
11657 where
11658 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
11659 {
11660 self.vpc_flow_logs_config = v.map(|x| x.into());
11661 self
11662 }
11663}
11664
11665impl wkt::message::Message for CreateVpcFlowLogsConfigRequest {
11666 fn typename() -> &'static str {
11667 "type.googleapis.com/google.cloud.networkmanagement.v1.CreateVpcFlowLogsConfigRequest"
11668 }
11669}
11670
11671#[derive(Clone, Default, PartialEq)]
11673#[non_exhaustive]
11674pub struct UpdateVpcFlowLogsConfigRequest {
11675 pub update_mask: std::option::Option<wkt::FieldMask>,
11684
11685 pub vpc_flow_logs_config: std::option::Option<crate::model::VpcFlowLogsConfig>,
11687
11688 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11689}
11690
11691impl UpdateVpcFlowLogsConfigRequest {
11692 pub fn new() -> Self {
11693 std::default::Default::default()
11694 }
11695
11696 pub fn set_update_mask<T>(mut self, v: T) -> Self
11698 where
11699 T: std::convert::Into<wkt::FieldMask>,
11700 {
11701 self.update_mask = std::option::Option::Some(v.into());
11702 self
11703 }
11704
11705 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11707 where
11708 T: std::convert::Into<wkt::FieldMask>,
11709 {
11710 self.update_mask = v.map(|x| x.into());
11711 self
11712 }
11713
11714 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
11716 where
11717 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
11718 {
11719 self.vpc_flow_logs_config = std::option::Option::Some(v.into());
11720 self
11721 }
11722
11723 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
11725 where
11726 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
11727 {
11728 self.vpc_flow_logs_config = v.map(|x| x.into());
11729 self
11730 }
11731}
11732
11733impl wkt::message::Message for UpdateVpcFlowLogsConfigRequest {
11734 fn typename() -> &'static str {
11735 "type.googleapis.com/google.cloud.networkmanagement.v1.UpdateVpcFlowLogsConfigRequest"
11736 }
11737}
11738
11739#[derive(Clone, Default, PartialEq)]
11741#[non_exhaustive]
11742pub struct DeleteVpcFlowLogsConfigRequest {
11743 pub name: std::string::String,
11753
11754 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11755}
11756
11757impl DeleteVpcFlowLogsConfigRequest {
11758 pub fn new() -> Self {
11759 std::default::Default::default()
11760 }
11761
11762 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11764 self.name = v.into();
11765 self
11766 }
11767}
11768
11769impl wkt::message::Message for DeleteVpcFlowLogsConfigRequest {
11770 fn typename() -> &'static str {
11771 "type.googleapis.com/google.cloud.networkmanagement.v1.DeleteVpcFlowLogsConfigRequest"
11772 }
11773}
11774
11775#[derive(Clone, Default, PartialEq)]
11777#[non_exhaustive]
11778pub struct QueryOrgVpcFlowLogsConfigsRequest {
11779 pub parent: std::string::String,
11782
11783 pub page_size: i32,
11785
11786 pub page_token: std::string::String,
11789
11790 pub filter: std::string::String,
11794
11795 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11796}
11797
11798impl QueryOrgVpcFlowLogsConfigsRequest {
11799 pub fn new() -> Self {
11800 std::default::Default::default()
11801 }
11802
11803 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11805 self.parent = v.into();
11806 self
11807 }
11808
11809 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11811 self.page_size = v.into();
11812 self
11813 }
11814
11815 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11817 self.page_token = v.into();
11818 self
11819 }
11820
11821 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11823 self.filter = v.into();
11824 self
11825 }
11826}
11827
11828impl wkt::message::Message for QueryOrgVpcFlowLogsConfigsRequest {
11829 fn typename() -> &'static str {
11830 "type.googleapis.com/google.cloud.networkmanagement.v1.QueryOrgVpcFlowLogsConfigsRequest"
11831 }
11832}
11833
11834#[derive(Clone, Default, PartialEq)]
11836#[non_exhaustive]
11837pub struct QueryOrgVpcFlowLogsConfigsResponse {
11838 pub vpc_flow_logs_configs: std::vec::Vec<crate::model::VpcFlowLogsConfig>,
11840
11841 pub next_page_token: std::string::String,
11843
11844 pub unreachable: std::vec::Vec<std::string::String>,
11846
11847 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11848}
11849
11850impl QueryOrgVpcFlowLogsConfigsResponse {
11851 pub fn new() -> Self {
11852 std::default::Default::default()
11853 }
11854
11855 pub fn set_vpc_flow_logs_configs<T, V>(mut self, v: T) -> Self
11857 where
11858 T: std::iter::IntoIterator<Item = V>,
11859 V: std::convert::Into<crate::model::VpcFlowLogsConfig>,
11860 {
11861 use std::iter::Iterator;
11862 self.vpc_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
11863 self
11864 }
11865
11866 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11868 self.next_page_token = v.into();
11869 self
11870 }
11871
11872 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11874 where
11875 T: std::iter::IntoIterator<Item = V>,
11876 V: std::convert::Into<std::string::String>,
11877 {
11878 use std::iter::Iterator;
11879 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11880 self
11881 }
11882}
11883
11884impl wkt::message::Message for QueryOrgVpcFlowLogsConfigsResponse {
11885 fn typename() -> &'static str {
11886 "type.googleapis.com/google.cloud.networkmanagement.v1.QueryOrgVpcFlowLogsConfigsResponse"
11887 }
11888}
11889
11890#[doc(hidden)]
11891impl gax::paginator::internal::PageableResponse for QueryOrgVpcFlowLogsConfigsResponse {
11892 type PageItem = crate::model::VpcFlowLogsConfig;
11893
11894 fn items(self) -> std::vec::Vec<Self::PageItem> {
11895 self.vpc_flow_logs_configs
11896 }
11897
11898 fn next_page_token(&self) -> std::string::String {
11899 use std::clone::Clone;
11900 self.next_page_token.clone()
11901 }
11902}
11903
11904#[derive(Clone, Default, PartialEq)]
11906#[non_exhaustive]
11907pub struct ShowEffectiveFlowLogsConfigsRequest {
11908 pub parent: std::string::String,
11911
11912 pub resource: std::string::String,
11917
11918 pub page_size: i32,
11920
11921 pub page_token: std::string::String,
11924
11925 pub filter: std::string::String,
11930
11931 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11932}
11933
11934impl ShowEffectiveFlowLogsConfigsRequest {
11935 pub fn new() -> Self {
11936 std::default::Default::default()
11937 }
11938
11939 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11941 self.parent = v.into();
11942 self
11943 }
11944
11945 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11947 self.resource = v.into();
11948 self
11949 }
11950
11951 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11953 self.page_size = v.into();
11954 self
11955 }
11956
11957 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11959 self.page_token = v.into();
11960 self
11961 }
11962
11963 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11965 self.filter = v.into();
11966 self
11967 }
11968}
11969
11970impl wkt::message::Message for ShowEffectiveFlowLogsConfigsRequest {
11971 fn typename() -> &'static str {
11972 "type.googleapis.com/google.cloud.networkmanagement.v1.ShowEffectiveFlowLogsConfigsRequest"
11973 }
11974}
11975
11976#[derive(Clone, Default, PartialEq)]
11978#[non_exhaustive]
11979pub struct ShowEffectiveFlowLogsConfigsResponse {
11980 pub effective_flow_logs_configs: std::vec::Vec<crate::model::EffectiveVpcFlowLogsConfig>,
11982
11983 pub next_page_token: std::string::String,
11985
11986 pub unreachable: std::vec::Vec<std::string::String>,
11988
11989 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11990}
11991
11992impl ShowEffectiveFlowLogsConfigsResponse {
11993 pub fn new() -> Self {
11994 std::default::Default::default()
11995 }
11996
11997 pub fn set_effective_flow_logs_configs<T, V>(mut self, v: T) -> Self
11999 where
12000 T: std::iter::IntoIterator<Item = V>,
12001 V: std::convert::Into<crate::model::EffectiveVpcFlowLogsConfig>,
12002 {
12003 use std::iter::Iterator;
12004 self.effective_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
12005 self
12006 }
12007
12008 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12010 self.next_page_token = v.into();
12011 self
12012 }
12013
12014 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12016 where
12017 T: std::iter::IntoIterator<Item = V>,
12018 V: std::convert::Into<std::string::String>,
12019 {
12020 use std::iter::Iterator;
12021 self.unreachable = v.into_iter().map(|i| i.into()).collect();
12022 self
12023 }
12024}
12025
12026impl wkt::message::Message for ShowEffectiveFlowLogsConfigsResponse {
12027 fn typename() -> &'static str {
12028 "type.googleapis.com/google.cloud.networkmanagement.v1.ShowEffectiveFlowLogsConfigsResponse"
12029 }
12030}
12031
12032#[doc(hidden)]
12033impl gax::paginator::internal::PageableResponse for ShowEffectiveFlowLogsConfigsResponse {
12034 type PageItem = crate::model::EffectiveVpcFlowLogsConfig;
12035
12036 fn items(self) -> std::vec::Vec<Self::PageItem> {
12037 self.effective_flow_logs_configs
12038 }
12039
12040 fn next_page_token(&self) -> std::string::String {
12041 use std::clone::Clone;
12042 self.next_page_token.clone()
12043 }
12044}
12045
12046#[derive(Clone, Default, PartialEq)]
12048#[non_exhaustive]
12049pub struct VpcFlowLogsConfig {
12050 pub name: std::string::String,
12060
12061 pub description: std::option::Option<std::string::String>,
12064
12065 pub state: std::option::Option<crate::model::vpc_flow_logs_config::State>,
12069
12070 pub aggregation_interval:
12073 std::option::Option<crate::model::vpc_flow_logs_config::AggregationInterval>,
12074
12075 pub flow_sampling: std::option::Option<f32>,
12080
12081 pub metadata: std::option::Option<crate::model::vpc_flow_logs_config::Metadata>,
12085
12086 pub metadata_fields: std::vec::Vec<std::string::String>,
12089
12090 pub filter_expr: std::option::Option<std::string::String>,
12093
12094 pub cross_project_metadata:
12098 std::option::Option<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
12099
12100 pub target_resource_state:
12103 std::option::Option<crate::model::vpc_flow_logs_config::TargetResourceState>,
12104
12105 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12107
12108 pub create_time: std::option::Option<wkt::Timestamp>,
12110
12111 pub update_time: std::option::Option<wkt::Timestamp>,
12113
12114 pub target_resource: std::option::Option<crate::model::vpc_flow_logs_config::TargetResource>,
12119
12120 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12121}
12122
12123impl VpcFlowLogsConfig {
12124 pub fn new() -> Self {
12125 std::default::Default::default()
12126 }
12127
12128 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12130 self.name = v.into();
12131 self
12132 }
12133
12134 pub fn set_description<T>(mut self, v: T) -> Self
12136 where
12137 T: std::convert::Into<std::string::String>,
12138 {
12139 self.description = std::option::Option::Some(v.into());
12140 self
12141 }
12142
12143 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
12145 where
12146 T: std::convert::Into<std::string::String>,
12147 {
12148 self.description = v.map(|x| x.into());
12149 self
12150 }
12151
12152 pub fn set_state<T>(mut self, v: T) -> Self
12154 where
12155 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
12156 {
12157 self.state = std::option::Option::Some(v.into());
12158 self
12159 }
12160
12161 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
12163 where
12164 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
12165 {
12166 self.state = v.map(|x| x.into());
12167 self
12168 }
12169
12170 pub fn set_aggregation_interval<T>(mut self, v: T) -> Self
12172 where
12173 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
12174 {
12175 self.aggregation_interval = std::option::Option::Some(v.into());
12176 self
12177 }
12178
12179 pub fn set_or_clear_aggregation_interval<T>(mut self, v: std::option::Option<T>) -> Self
12181 where
12182 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
12183 {
12184 self.aggregation_interval = v.map(|x| x.into());
12185 self
12186 }
12187
12188 pub fn set_flow_sampling<T>(mut self, v: T) -> Self
12190 where
12191 T: std::convert::Into<f32>,
12192 {
12193 self.flow_sampling = std::option::Option::Some(v.into());
12194 self
12195 }
12196
12197 pub fn set_or_clear_flow_sampling<T>(mut self, v: std::option::Option<T>) -> Self
12199 where
12200 T: std::convert::Into<f32>,
12201 {
12202 self.flow_sampling = v.map(|x| x.into());
12203 self
12204 }
12205
12206 pub fn set_metadata<T>(mut self, v: T) -> Self
12208 where
12209 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
12210 {
12211 self.metadata = std::option::Option::Some(v.into());
12212 self
12213 }
12214
12215 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12217 where
12218 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
12219 {
12220 self.metadata = v.map(|x| x.into());
12221 self
12222 }
12223
12224 pub fn set_metadata_fields<T, V>(mut self, v: T) -> Self
12226 where
12227 T: std::iter::IntoIterator<Item = V>,
12228 V: std::convert::Into<std::string::String>,
12229 {
12230 use std::iter::Iterator;
12231 self.metadata_fields = v.into_iter().map(|i| i.into()).collect();
12232 self
12233 }
12234
12235 pub fn set_filter_expr<T>(mut self, v: T) -> Self
12237 where
12238 T: std::convert::Into<std::string::String>,
12239 {
12240 self.filter_expr = std::option::Option::Some(v.into());
12241 self
12242 }
12243
12244 pub fn set_or_clear_filter_expr<T>(mut self, v: std::option::Option<T>) -> Self
12246 where
12247 T: std::convert::Into<std::string::String>,
12248 {
12249 self.filter_expr = v.map(|x| x.into());
12250 self
12251 }
12252
12253 pub fn set_cross_project_metadata<T>(mut self, v: T) -> Self
12255 where
12256 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
12257 {
12258 self.cross_project_metadata = std::option::Option::Some(v.into());
12259 self
12260 }
12261
12262 pub fn set_or_clear_cross_project_metadata<T>(mut self, v: std::option::Option<T>) -> Self
12264 where
12265 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
12266 {
12267 self.cross_project_metadata = v.map(|x| x.into());
12268 self
12269 }
12270
12271 pub fn set_target_resource_state<T>(mut self, v: T) -> Self
12273 where
12274 T: std::convert::Into<crate::model::vpc_flow_logs_config::TargetResourceState>,
12275 {
12276 self.target_resource_state = std::option::Option::Some(v.into());
12277 self
12278 }
12279
12280 pub fn set_or_clear_target_resource_state<T>(mut self, v: std::option::Option<T>) -> Self
12282 where
12283 T: std::convert::Into<crate::model::vpc_flow_logs_config::TargetResourceState>,
12284 {
12285 self.target_resource_state = v.map(|x| x.into());
12286 self
12287 }
12288
12289 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12291 where
12292 T: std::iter::IntoIterator<Item = (K, V)>,
12293 K: std::convert::Into<std::string::String>,
12294 V: std::convert::Into<std::string::String>,
12295 {
12296 use std::iter::Iterator;
12297 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12298 self
12299 }
12300
12301 pub fn set_create_time<T>(mut self, v: T) -> Self
12303 where
12304 T: std::convert::Into<wkt::Timestamp>,
12305 {
12306 self.create_time = std::option::Option::Some(v.into());
12307 self
12308 }
12309
12310 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12312 where
12313 T: std::convert::Into<wkt::Timestamp>,
12314 {
12315 self.create_time = v.map(|x| x.into());
12316 self
12317 }
12318
12319 pub fn set_update_time<T>(mut self, v: T) -> Self
12321 where
12322 T: std::convert::Into<wkt::Timestamp>,
12323 {
12324 self.update_time = std::option::Option::Some(v.into());
12325 self
12326 }
12327
12328 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12330 where
12331 T: std::convert::Into<wkt::Timestamp>,
12332 {
12333 self.update_time = v.map(|x| x.into());
12334 self
12335 }
12336
12337 pub fn set_target_resource<
12342 T: std::convert::Into<std::option::Option<crate::model::vpc_flow_logs_config::TargetResource>>,
12343 >(
12344 mut self,
12345 v: T,
12346 ) -> Self {
12347 self.target_resource = v.into();
12348 self
12349 }
12350
12351 pub fn network(&self) -> std::option::Option<&std::string::String> {
12355 #[allow(unreachable_patterns)]
12356 self.target_resource.as_ref().and_then(|v| match v {
12357 crate::model::vpc_flow_logs_config::TargetResource::Network(v) => {
12358 std::option::Option::Some(v)
12359 }
12360 _ => std::option::Option::None,
12361 })
12362 }
12363
12364 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12370 self.target_resource = std::option::Option::Some(
12371 crate::model::vpc_flow_logs_config::TargetResource::Network(v.into()),
12372 );
12373 self
12374 }
12375
12376 pub fn subnet(&self) -> std::option::Option<&std::string::String> {
12380 #[allow(unreachable_patterns)]
12381 self.target_resource.as_ref().and_then(|v| match v {
12382 crate::model::vpc_flow_logs_config::TargetResource::Subnet(v) => {
12383 std::option::Option::Some(v)
12384 }
12385 _ => std::option::Option::None,
12386 })
12387 }
12388
12389 pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12395 self.target_resource = std::option::Option::Some(
12396 crate::model::vpc_flow_logs_config::TargetResource::Subnet(v.into()),
12397 );
12398 self
12399 }
12400
12401 pub fn interconnect_attachment(&self) -> std::option::Option<&std::string::String> {
12405 #[allow(unreachable_patterns)]
12406 self.target_resource.as_ref().and_then(|v| match v {
12407 crate::model::vpc_flow_logs_config::TargetResource::InterconnectAttachment(v) => {
12408 std::option::Option::Some(v)
12409 }
12410 _ => std::option::Option::None,
12411 })
12412 }
12413
12414 pub fn set_interconnect_attachment<T: std::convert::Into<std::string::String>>(
12420 mut self,
12421 v: T,
12422 ) -> Self {
12423 self.target_resource = std::option::Option::Some(
12424 crate::model::vpc_flow_logs_config::TargetResource::InterconnectAttachment(v.into()),
12425 );
12426 self
12427 }
12428
12429 pub fn vpn_tunnel(&self) -> std::option::Option<&std::string::String> {
12433 #[allow(unreachable_patterns)]
12434 self.target_resource.as_ref().and_then(|v| match v {
12435 crate::model::vpc_flow_logs_config::TargetResource::VpnTunnel(v) => {
12436 std::option::Option::Some(v)
12437 }
12438 _ => std::option::Option::None,
12439 })
12440 }
12441
12442 pub fn set_vpn_tunnel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12448 self.target_resource = std::option::Option::Some(
12449 crate::model::vpc_flow_logs_config::TargetResource::VpnTunnel(v.into()),
12450 );
12451 self
12452 }
12453}
12454
12455impl wkt::message::Message for VpcFlowLogsConfig {
12456 fn typename() -> &'static str {
12457 "type.googleapis.com/google.cloud.networkmanagement.v1.VpcFlowLogsConfig"
12458 }
12459}
12460
12461pub mod vpc_flow_logs_config {
12463 #[allow(unused_imports)]
12464 use super::*;
12465
12466 #[derive(Clone, Debug, PartialEq)]
12482 #[non_exhaustive]
12483 pub enum State {
12484 Unspecified,
12486 Enabled,
12488 Disabled,
12490 UnknownValue(state::UnknownValue),
12495 }
12496
12497 #[doc(hidden)]
12498 pub mod state {
12499 #[allow(unused_imports)]
12500 use super::*;
12501 #[derive(Clone, Debug, PartialEq)]
12502 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12503 }
12504
12505 impl State {
12506 pub fn value(&self) -> std::option::Option<i32> {
12511 match self {
12512 Self::Unspecified => std::option::Option::Some(0),
12513 Self::Enabled => std::option::Option::Some(1),
12514 Self::Disabled => std::option::Option::Some(2),
12515 Self::UnknownValue(u) => u.0.value(),
12516 }
12517 }
12518
12519 pub fn name(&self) -> std::option::Option<&str> {
12524 match self {
12525 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12526 Self::Enabled => std::option::Option::Some("ENABLED"),
12527 Self::Disabled => std::option::Option::Some("DISABLED"),
12528 Self::UnknownValue(u) => u.0.name(),
12529 }
12530 }
12531 }
12532
12533 impl std::default::Default for State {
12534 fn default() -> Self {
12535 use std::convert::From;
12536 Self::from(0)
12537 }
12538 }
12539
12540 impl std::fmt::Display for State {
12541 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12542 wkt::internal::display_enum(f, self.name(), self.value())
12543 }
12544 }
12545
12546 impl std::convert::From<i32> for State {
12547 fn from(value: i32) -> Self {
12548 match value {
12549 0 => Self::Unspecified,
12550 1 => Self::Enabled,
12551 2 => Self::Disabled,
12552 _ => Self::UnknownValue(state::UnknownValue(
12553 wkt::internal::UnknownEnumValue::Integer(value),
12554 )),
12555 }
12556 }
12557 }
12558
12559 impl std::convert::From<&str> for State {
12560 fn from(value: &str) -> Self {
12561 use std::string::ToString;
12562 match value {
12563 "STATE_UNSPECIFIED" => Self::Unspecified,
12564 "ENABLED" => Self::Enabled,
12565 "DISABLED" => Self::Disabled,
12566 _ => Self::UnknownValue(state::UnknownValue(
12567 wkt::internal::UnknownEnumValue::String(value.to_string()),
12568 )),
12569 }
12570 }
12571 }
12572
12573 impl serde::ser::Serialize for State {
12574 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12575 where
12576 S: serde::Serializer,
12577 {
12578 match self {
12579 Self::Unspecified => serializer.serialize_i32(0),
12580 Self::Enabled => serializer.serialize_i32(1),
12581 Self::Disabled => serializer.serialize_i32(2),
12582 Self::UnknownValue(u) => u.0.serialize(serializer),
12583 }
12584 }
12585 }
12586
12587 impl<'de> serde::de::Deserialize<'de> for State {
12588 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12589 where
12590 D: serde::Deserializer<'de>,
12591 {
12592 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12593 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.State",
12594 ))
12595 }
12596 }
12597
12598 #[derive(Clone, Debug, PartialEq)]
12614 #[non_exhaustive]
12615 pub enum AggregationInterval {
12616 Unspecified,
12618 Interval5Sec,
12620 Interval30Sec,
12622 Interval1Min,
12624 Interval5Min,
12626 Interval10Min,
12628 Interval15Min,
12630 UnknownValue(aggregation_interval::UnknownValue),
12635 }
12636
12637 #[doc(hidden)]
12638 pub mod aggregation_interval {
12639 #[allow(unused_imports)]
12640 use super::*;
12641 #[derive(Clone, Debug, PartialEq)]
12642 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12643 }
12644
12645 impl AggregationInterval {
12646 pub fn value(&self) -> std::option::Option<i32> {
12651 match self {
12652 Self::Unspecified => std::option::Option::Some(0),
12653 Self::Interval5Sec => std::option::Option::Some(1),
12654 Self::Interval30Sec => std::option::Option::Some(2),
12655 Self::Interval1Min => std::option::Option::Some(3),
12656 Self::Interval5Min => std::option::Option::Some(4),
12657 Self::Interval10Min => std::option::Option::Some(5),
12658 Self::Interval15Min => std::option::Option::Some(6),
12659 Self::UnknownValue(u) => u.0.value(),
12660 }
12661 }
12662
12663 pub fn name(&self) -> std::option::Option<&str> {
12668 match self {
12669 Self::Unspecified => std::option::Option::Some("AGGREGATION_INTERVAL_UNSPECIFIED"),
12670 Self::Interval5Sec => std::option::Option::Some("INTERVAL_5_SEC"),
12671 Self::Interval30Sec => std::option::Option::Some("INTERVAL_30_SEC"),
12672 Self::Interval1Min => std::option::Option::Some("INTERVAL_1_MIN"),
12673 Self::Interval5Min => std::option::Option::Some("INTERVAL_5_MIN"),
12674 Self::Interval10Min => std::option::Option::Some("INTERVAL_10_MIN"),
12675 Self::Interval15Min => std::option::Option::Some("INTERVAL_15_MIN"),
12676 Self::UnknownValue(u) => u.0.name(),
12677 }
12678 }
12679 }
12680
12681 impl std::default::Default for AggregationInterval {
12682 fn default() -> Self {
12683 use std::convert::From;
12684 Self::from(0)
12685 }
12686 }
12687
12688 impl std::fmt::Display for AggregationInterval {
12689 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12690 wkt::internal::display_enum(f, self.name(), self.value())
12691 }
12692 }
12693
12694 impl std::convert::From<i32> for AggregationInterval {
12695 fn from(value: i32) -> Self {
12696 match value {
12697 0 => Self::Unspecified,
12698 1 => Self::Interval5Sec,
12699 2 => Self::Interval30Sec,
12700 3 => Self::Interval1Min,
12701 4 => Self::Interval5Min,
12702 5 => Self::Interval10Min,
12703 6 => Self::Interval15Min,
12704 _ => Self::UnknownValue(aggregation_interval::UnknownValue(
12705 wkt::internal::UnknownEnumValue::Integer(value),
12706 )),
12707 }
12708 }
12709 }
12710
12711 impl std::convert::From<&str> for AggregationInterval {
12712 fn from(value: &str) -> Self {
12713 use std::string::ToString;
12714 match value {
12715 "AGGREGATION_INTERVAL_UNSPECIFIED" => Self::Unspecified,
12716 "INTERVAL_5_SEC" => Self::Interval5Sec,
12717 "INTERVAL_30_SEC" => Self::Interval30Sec,
12718 "INTERVAL_1_MIN" => Self::Interval1Min,
12719 "INTERVAL_5_MIN" => Self::Interval5Min,
12720 "INTERVAL_10_MIN" => Self::Interval10Min,
12721 "INTERVAL_15_MIN" => Self::Interval15Min,
12722 _ => Self::UnknownValue(aggregation_interval::UnknownValue(
12723 wkt::internal::UnknownEnumValue::String(value.to_string()),
12724 )),
12725 }
12726 }
12727 }
12728
12729 impl serde::ser::Serialize for AggregationInterval {
12730 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12731 where
12732 S: serde::Serializer,
12733 {
12734 match self {
12735 Self::Unspecified => serializer.serialize_i32(0),
12736 Self::Interval5Sec => serializer.serialize_i32(1),
12737 Self::Interval30Sec => serializer.serialize_i32(2),
12738 Self::Interval1Min => serializer.serialize_i32(3),
12739 Self::Interval5Min => serializer.serialize_i32(4),
12740 Self::Interval10Min => serializer.serialize_i32(5),
12741 Self::Interval15Min => serializer.serialize_i32(6),
12742 Self::UnknownValue(u) => u.0.serialize(serializer),
12743 }
12744 }
12745 }
12746
12747 impl<'de> serde::de::Deserialize<'de> for AggregationInterval {
12748 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12749 where
12750 D: serde::Deserializer<'de>,
12751 {
12752 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AggregationInterval>::new(
12753 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.AggregationInterval",
12754 ))
12755 }
12756 }
12757
12758 #[derive(Clone, Debug, PartialEq)]
12774 #[non_exhaustive]
12775 pub enum Metadata {
12776 Unspecified,
12778 IncludeAllMetadata,
12780 ExcludeAllMetadata,
12782 CustomMetadata,
12784 UnknownValue(metadata::UnknownValue),
12789 }
12790
12791 #[doc(hidden)]
12792 pub mod metadata {
12793 #[allow(unused_imports)]
12794 use super::*;
12795 #[derive(Clone, Debug, PartialEq)]
12796 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12797 }
12798
12799 impl Metadata {
12800 pub fn value(&self) -> std::option::Option<i32> {
12805 match self {
12806 Self::Unspecified => std::option::Option::Some(0),
12807 Self::IncludeAllMetadata => std::option::Option::Some(1),
12808 Self::ExcludeAllMetadata => std::option::Option::Some(2),
12809 Self::CustomMetadata => std::option::Option::Some(3),
12810 Self::UnknownValue(u) => u.0.value(),
12811 }
12812 }
12813
12814 pub fn name(&self) -> std::option::Option<&str> {
12819 match self {
12820 Self::Unspecified => std::option::Option::Some("METADATA_UNSPECIFIED"),
12821 Self::IncludeAllMetadata => std::option::Option::Some("INCLUDE_ALL_METADATA"),
12822 Self::ExcludeAllMetadata => std::option::Option::Some("EXCLUDE_ALL_METADATA"),
12823 Self::CustomMetadata => std::option::Option::Some("CUSTOM_METADATA"),
12824 Self::UnknownValue(u) => u.0.name(),
12825 }
12826 }
12827 }
12828
12829 impl std::default::Default for Metadata {
12830 fn default() -> Self {
12831 use std::convert::From;
12832 Self::from(0)
12833 }
12834 }
12835
12836 impl std::fmt::Display for Metadata {
12837 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12838 wkt::internal::display_enum(f, self.name(), self.value())
12839 }
12840 }
12841
12842 impl std::convert::From<i32> for Metadata {
12843 fn from(value: i32) -> Self {
12844 match value {
12845 0 => Self::Unspecified,
12846 1 => Self::IncludeAllMetadata,
12847 2 => Self::ExcludeAllMetadata,
12848 3 => Self::CustomMetadata,
12849 _ => Self::UnknownValue(metadata::UnknownValue(
12850 wkt::internal::UnknownEnumValue::Integer(value),
12851 )),
12852 }
12853 }
12854 }
12855
12856 impl std::convert::From<&str> for Metadata {
12857 fn from(value: &str) -> Self {
12858 use std::string::ToString;
12859 match value {
12860 "METADATA_UNSPECIFIED" => Self::Unspecified,
12861 "INCLUDE_ALL_METADATA" => Self::IncludeAllMetadata,
12862 "EXCLUDE_ALL_METADATA" => Self::ExcludeAllMetadata,
12863 "CUSTOM_METADATA" => Self::CustomMetadata,
12864 _ => Self::UnknownValue(metadata::UnknownValue(
12865 wkt::internal::UnknownEnumValue::String(value.to_string()),
12866 )),
12867 }
12868 }
12869 }
12870
12871 impl serde::ser::Serialize for Metadata {
12872 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12873 where
12874 S: serde::Serializer,
12875 {
12876 match self {
12877 Self::Unspecified => serializer.serialize_i32(0),
12878 Self::IncludeAllMetadata => serializer.serialize_i32(1),
12879 Self::ExcludeAllMetadata => serializer.serialize_i32(2),
12880 Self::CustomMetadata => serializer.serialize_i32(3),
12881 Self::UnknownValue(u) => u.0.serialize(serializer),
12882 }
12883 }
12884 }
12885
12886 impl<'de> serde::de::Deserialize<'de> for Metadata {
12887 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12888 where
12889 D: serde::Deserializer<'de>,
12890 {
12891 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Metadata>::new(
12892 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.Metadata",
12893 ))
12894 }
12895 }
12896
12897 #[derive(Clone, Debug, PartialEq)]
12914 #[non_exhaustive]
12915 pub enum CrossProjectMetadata {
12916 Unspecified,
12918 Enabled,
12921 Disabled,
12924 UnknownValue(cross_project_metadata::UnknownValue),
12929 }
12930
12931 #[doc(hidden)]
12932 pub mod cross_project_metadata {
12933 #[allow(unused_imports)]
12934 use super::*;
12935 #[derive(Clone, Debug, PartialEq)]
12936 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12937 }
12938
12939 impl CrossProjectMetadata {
12940 pub fn value(&self) -> std::option::Option<i32> {
12945 match self {
12946 Self::Unspecified => std::option::Option::Some(0),
12947 Self::Enabled => std::option::Option::Some(1),
12948 Self::Disabled => std::option::Option::Some(2),
12949 Self::UnknownValue(u) => u.0.value(),
12950 }
12951 }
12952
12953 pub fn name(&self) -> std::option::Option<&str> {
12958 match self {
12959 Self::Unspecified => {
12960 std::option::Option::Some("CROSS_PROJECT_METADATA_UNSPECIFIED")
12961 }
12962 Self::Enabled => std::option::Option::Some("CROSS_PROJECT_METADATA_ENABLED"),
12963 Self::Disabled => std::option::Option::Some("CROSS_PROJECT_METADATA_DISABLED"),
12964 Self::UnknownValue(u) => u.0.name(),
12965 }
12966 }
12967 }
12968
12969 impl std::default::Default for CrossProjectMetadata {
12970 fn default() -> Self {
12971 use std::convert::From;
12972 Self::from(0)
12973 }
12974 }
12975
12976 impl std::fmt::Display for CrossProjectMetadata {
12977 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12978 wkt::internal::display_enum(f, self.name(), self.value())
12979 }
12980 }
12981
12982 impl std::convert::From<i32> for CrossProjectMetadata {
12983 fn from(value: i32) -> Self {
12984 match value {
12985 0 => Self::Unspecified,
12986 1 => Self::Enabled,
12987 2 => Self::Disabled,
12988 _ => Self::UnknownValue(cross_project_metadata::UnknownValue(
12989 wkt::internal::UnknownEnumValue::Integer(value),
12990 )),
12991 }
12992 }
12993 }
12994
12995 impl std::convert::From<&str> for CrossProjectMetadata {
12996 fn from(value: &str) -> Self {
12997 use std::string::ToString;
12998 match value {
12999 "CROSS_PROJECT_METADATA_UNSPECIFIED" => Self::Unspecified,
13000 "CROSS_PROJECT_METADATA_ENABLED" => Self::Enabled,
13001 "CROSS_PROJECT_METADATA_DISABLED" => Self::Disabled,
13002 _ => Self::UnknownValue(cross_project_metadata::UnknownValue(
13003 wkt::internal::UnknownEnumValue::String(value.to_string()),
13004 )),
13005 }
13006 }
13007 }
13008
13009 impl serde::ser::Serialize for CrossProjectMetadata {
13010 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13011 where
13012 S: serde::Serializer,
13013 {
13014 match self {
13015 Self::Unspecified => serializer.serialize_i32(0),
13016 Self::Enabled => serializer.serialize_i32(1),
13017 Self::Disabled => serializer.serialize_i32(2),
13018 Self::UnknownValue(u) => u.0.serialize(serializer),
13019 }
13020 }
13021 }
13022
13023 impl<'de> serde::de::Deserialize<'de> for CrossProjectMetadata {
13024 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13025 where
13026 D: serde::Deserializer<'de>,
13027 {
13028 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CrossProjectMetadata>::new(
13029 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.CrossProjectMetadata",
13030 ))
13031 }
13032 }
13033
13034 #[derive(Clone, Debug, PartialEq)]
13051 #[non_exhaustive]
13052 pub enum TargetResourceState {
13053 Unspecified,
13055 TargetResourceExists,
13057 TargetResourceDoesNotExist,
13059 UnknownValue(target_resource_state::UnknownValue),
13064 }
13065
13066 #[doc(hidden)]
13067 pub mod target_resource_state {
13068 #[allow(unused_imports)]
13069 use super::*;
13070 #[derive(Clone, Debug, PartialEq)]
13071 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13072 }
13073
13074 impl TargetResourceState {
13075 pub fn value(&self) -> std::option::Option<i32> {
13080 match self {
13081 Self::Unspecified => std::option::Option::Some(0),
13082 Self::TargetResourceExists => std::option::Option::Some(1),
13083 Self::TargetResourceDoesNotExist => std::option::Option::Some(2),
13084 Self::UnknownValue(u) => u.0.value(),
13085 }
13086 }
13087
13088 pub fn name(&self) -> std::option::Option<&str> {
13093 match self {
13094 Self::Unspecified => std::option::Option::Some("TARGET_RESOURCE_STATE_UNSPECIFIED"),
13095 Self::TargetResourceExists => std::option::Option::Some("TARGET_RESOURCE_EXISTS"),
13096 Self::TargetResourceDoesNotExist => {
13097 std::option::Option::Some("TARGET_RESOURCE_DOES_NOT_EXIST")
13098 }
13099 Self::UnknownValue(u) => u.0.name(),
13100 }
13101 }
13102 }
13103
13104 impl std::default::Default for TargetResourceState {
13105 fn default() -> Self {
13106 use std::convert::From;
13107 Self::from(0)
13108 }
13109 }
13110
13111 impl std::fmt::Display for TargetResourceState {
13112 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13113 wkt::internal::display_enum(f, self.name(), self.value())
13114 }
13115 }
13116
13117 impl std::convert::From<i32> for TargetResourceState {
13118 fn from(value: i32) -> Self {
13119 match value {
13120 0 => Self::Unspecified,
13121 1 => Self::TargetResourceExists,
13122 2 => Self::TargetResourceDoesNotExist,
13123 _ => Self::UnknownValue(target_resource_state::UnknownValue(
13124 wkt::internal::UnknownEnumValue::Integer(value),
13125 )),
13126 }
13127 }
13128 }
13129
13130 impl std::convert::From<&str> for TargetResourceState {
13131 fn from(value: &str) -> Self {
13132 use std::string::ToString;
13133 match value {
13134 "TARGET_RESOURCE_STATE_UNSPECIFIED" => Self::Unspecified,
13135 "TARGET_RESOURCE_EXISTS" => Self::TargetResourceExists,
13136 "TARGET_RESOURCE_DOES_NOT_EXIST" => Self::TargetResourceDoesNotExist,
13137 _ => Self::UnknownValue(target_resource_state::UnknownValue(
13138 wkt::internal::UnknownEnumValue::String(value.to_string()),
13139 )),
13140 }
13141 }
13142 }
13143
13144 impl serde::ser::Serialize for TargetResourceState {
13145 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13146 where
13147 S: serde::Serializer,
13148 {
13149 match self {
13150 Self::Unspecified => serializer.serialize_i32(0),
13151 Self::TargetResourceExists => serializer.serialize_i32(1),
13152 Self::TargetResourceDoesNotExist => serializer.serialize_i32(2),
13153 Self::UnknownValue(u) => u.0.serialize(serializer),
13154 }
13155 }
13156 }
13157
13158 impl<'de> serde::de::Deserialize<'de> for TargetResourceState {
13159 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13160 where
13161 D: serde::Deserializer<'de>,
13162 {
13163 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetResourceState>::new(
13164 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.TargetResourceState",
13165 ))
13166 }
13167 }
13168
13169 #[derive(Clone, Debug, PartialEq)]
13174 #[non_exhaustive]
13175 pub enum TargetResource {
13176 Network(std::string::String),
13180 Subnet(std::string::String),
13183 InterconnectAttachment(std::string::String),
13187 VpnTunnel(std::string::String),
13190 }
13191}
13192
13193#[derive(Clone, Default, PartialEq)]
13196#[non_exhaustive]
13197pub struct EffectiveVpcFlowLogsConfig {
13198 pub name: std::string::String,
13211
13212 pub state: std::option::Option<crate::model::vpc_flow_logs_config::State>,
13216
13217 pub aggregation_interval:
13219 std::option::Option<crate::model::vpc_flow_logs_config::AggregationInterval>,
13220
13221 pub flow_sampling: std::option::Option<f32>,
13227
13228 pub metadata: std::option::Option<crate::model::vpc_flow_logs_config::Metadata>,
13232
13233 pub metadata_fields: std::vec::Vec<std::string::String>,
13236
13237 pub filter_expr: std::option::Option<std::string::String>,
13239
13240 pub cross_project_metadata:
13244 std::option::Option<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
13245
13246 pub scope: std::option::Option<crate::model::effective_vpc_flow_logs_config::Scope>,
13248
13249 pub target_resource:
13254 std::option::Option<crate::model::effective_vpc_flow_logs_config::TargetResource>,
13255
13256 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13257}
13258
13259impl EffectiveVpcFlowLogsConfig {
13260 pub fn new() -> Self {
13261 std::default::Default::default()
13262 }
13263
13264 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13266 self.name = v.into();
13267 self
13268 }
13269
13270 pub fn set_state<T>(mut self, v: T) -> Self
13272 where
13273 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
13274 {
13275 self.state = std::option::Option::Some(v.into());
13276 self
13277 }
13278
13279 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
13281 where
13282 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
13283 {
13284 self.state = v.map(|x| x.into());
13285 self
13286 }
13287
13288 pub fn set_aggregation_interval<T>(mut self, v: T) -> Self
13290 where
13291 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
13292 {
13293 self.aggregation_interval = std::option::Option::Some(v.into());
13294 self
13295 }
13296
13297 pub fn set_or_clear_aggregation_interval<T>(mut self, v: std::option::Option<T>) -> Self
13299 where
13300 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
13301 {
13302 self.aggregation_interval = v.map(|x| x.into());
13303 self
13304 }
13305
13306 pub fn set_flow_sampling<T>(mut self, v: T) -> Self
13308 where
13309 T: std::convert::Into<f32>,
13310 {
13311 self.flow_sampling = std::option::Option::Some(v.into());
13312 self
13313 }
13314
13315 pub fn set_or_clear_flow_sampling<T>(mut self, v: std::option::Option<T>) -> Self
13317 where
13318 T: std::convert::Into<f32>,
13319 {
13320 self.flow_sampling = v.map(|x| x.into());
13321 self
13322 }
13323
13324 pub fn set_metadata<T>(mut self, v: T) -> Self
13326 where
13327 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
13328 {
13329 self.metadata = std::option::Option::Some(v.into());
13330 self
13331 }
13332
13333 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
13335 where
13336 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
13337 {
13338 self.metadata = v.map(|x| x.into());
13339 self
13340 }
13341
13342 pub fn set_metadata_fields<T, V>(mut self, v: T) -> Self
13344 where
13345 T: std::iter::IntoIterator<Item = V>,
13346 V: std::convert::Into<std::string::String>,
13347 {
13348 use std::iter::Iterator;
13349 self.metadata_fields = v.into_iter().map(|i| i.into()).collect();
13350 self
13351 }
13352
13353 pub fn set_filter_expr<T>(mut self, v: T) -> Self
13355 where
13356 T: std::convert::Into<std::string::String>,
13357 {
13358 self.filter_expr = std::option::Option::Some(v.into());
13359 self
13360 }
13361
13362 pub fn set_or_clear_filter_expr<T>(mut self, v: std::option::Option<T>) -> Self
13364 where
13365 T: std::convert::Into<std::string::String>,
13366 {
13367 self.filter_expr = v.map(|x| x.into());
13368 self
13369 }
13370
13371 pub fn set_cross_project_metadata<T>(mut self, v: T) -> Self
13373 where
13374 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
13375 {
13376 self.cross_project_metadata = std::option::Option::Some(v.into());
13377 self
13378 }
13379
13380 pub fn set_or_clear_cross_project_metadata<T>(mut self, v: std::option::Option<T>) -> Self
13382 where
13383 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
13384 {
13385 self.cross_project_metadata = v.map(|x| x.into());
13386 self
13387 }
13388
13389 pub fn set_scope<T>(mut self, v: T) -> Self
13391 where
13392 T: std::convert::Into<crate::model::effective_vpc_flow_logs_config::Scope>,
13393 {
13394 self.scope = std::option::Option::Some(v.into());
13395 self
13396 }
13397
13398 pub fn set_or_clear_scope<T>(mut self, v: std::option::Option<T>) -> Self
13400 where
13401 T: std::convert::Into<crate::model::effective_vpc_flow_logs_config::Scope>,
13402 {
13403 self.scope = v.map(|x| x.into());
13404 self
13405 }
13406
13407 pub fn set_target_resource<
13412 T: std::convert::Into<
13413 std::option::Option<crate::model::effective_vpc_flow_logs_config::TargetResource>,
13414 >,
13415 >(
13416 mut self,
13417 v: T,
13418 ) -> Self {
13419 self.target_resource = v.into();
13420 self
13421 }
13422
13423 pub fn network(&self) -> std::option::Option<&std::string::String> {
13427 #[allow(unreachable_patterns)]
13428 self.target_resource.as_ref().and_then(|v| match v {
13429 crate::model::effective_vpc_flow_logs_config::TargetResource::Network(v) => {
13430 std::option::Option::Some(v)
13431 }
13432 _ => std::option::Option::None,
13433 })
13434 }
13435
13436 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13442 self.target_resource = std::option::Option::Some(
13443 crate::model::effective_vpc_flow_logs_config::TargetResource::Network(v.into()),
13444 );
13445 self
13446 }
13447
13448 pub fn subnet(&self) -> std::option::Option<&std::string::String> {
13452 #[allow(unreachable_patterns)]
13453 self.target_resource.as_ref().and_then(|v| match v {
13454 crate::model::effective_vpc_flow_logs_config::TargetResource::Subnet(v) => {
13455 std::option::Option::Some(v)
13456 }
13457 _ => std::option::Option::None,
13458 })
13459 }
13460
13461 pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13467 self.target_resource = std::option::Option::Some(
13468 crate::model::effective_vpc_flow_logs_config::TargetResource::Subnet(v.into()),
13469 );
13470 self
13471 }
13472
13473 pub fn interconnect_attachment(&self) -> std::option::Option<&std::string::String> {
13477 #[allow(unreachable_patterns)]
13478 self.target_resource.as_ref().and_then(|v| match v {
13479 crate::model::effective_vpc_flow_logs_config::TargetResource::InterconnectAttachment(v) => std::option::Option::Some(v),
13480 _ => std::option::Option::None,
13481 })
13482 }
13483
13484 pub fn set_interconnect_attachment<T: std::convert::Into<std::string::String>>(
13490 mut self,
13491 v: T,
13492 ) -> Self {
13493 self.target_resource = std::option::Option::Some(
13494 crate::model::effective_vpc_flow_logs_config::TargetResource::InterconnectAttachment(
13495 v.into(),
13496 ),
13497 );
13498 self
13499 }
13500
13501 pub fn vpn_tunnel(&self) -> std::option::Option<&std::string::String> {
13505 #[allow(unreachable_patterns)]
13506 self.target_resource.as_ref().and_then(|v| match v {
13507 crate::model::effective_vpc_flow_logs_config::TargetResource::VpnTunnel(v) => {
13508 std::option::Option::Some(v)
13509 }
13510 _ => std::option::Option::None,
13511 })
13512 }
13513
13514 pub fn set_vpn_tunnel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13520 self.target_resource = std::option::Option::Some(
13521 crate::model::effective_vpc_flow_logs_config::TargetResource::VpnTunnel(v.into()),
13522 );
13523 self
13524 }
13525}
13526
13527impl wkt::message::Message for EffectiveVpcFlowLogsConfig {
13528 fn typename() -> &'static str {
13529 "type.googleapis.com/google.cloud.networkmanagement.v1.EffectiveVpcFlowLogsConfig"
13530 }
13531}
13532
13533pub mod effective_vpc_flow_logs_config {
13535 #[allow(unused_imports)]
13536 use super::*;
13537
13538 #[derive(Clone, Debug, PartialEq)]
13554 #[non_exhaustive]
13555 pub enum Scope {
13556 Unspecified,
13558 Subnet,
13560 ComputeApiSubnet,
13563 Network,
13565 VpnTunnel,
13567 InterconnectAttachment,
13569 Organization,
13571 UnknownValue(scope::UnknownValue),
13576 }
13577
13578 #[doc(hidden)]
13579 pub mod scope {
13580 #[allow(unused_imports)]
13581 use super::*;
13582 #[derive(Clone, Debug, PartialEq)]
13583 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13584 }
13585
13586 impl Scope {
13587 pub fn value(&self) -> std::option::Option<i32> {
13592 match self {
13593 Self::Unspecified => std::option::Option::Some(0),
13594 Self::Subnet => std::option::Option::Some(1),
13595 Self::ComputeApiSubnet => std::option::Option::Some(2),
13596 Self::Network => std::option::Option::Some(3),
13597 Self::VpnTunnel => std::option::Option::Some(4),
13598 Self::InterconnectAttachment => std::option::Option::Some(5),
13599 Self::Organization => std::option::Option::Some(6),
13600 Self::UnknownValue(u) => u.0.value(),
13601 }
13602 }
13603
13604 pub fn name(&self) -> std::option::Option<&str> {
13609 match self {
13610 Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
13611 Self::Subnet => std::option::Option::Some("SUBNET"),
13612 Self::ComputeApiSubnet => std::option::Option::Some("COMPUTE_API_SUBNET"),
13613 Self::Network => std::option::Option::Some("NETWORK"),
13614 Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
13615 Self::InterconnectAttachment => {
13616 std::option::Option::Some("INTERCONNECT_ATTACHMENT")
13617 }
13618 Self::Organization => std::option::Option::Some("ORGANIZATION"),
13619 Self::UnknownValue(u) => u.0.name(),
13620 }
13621 }
13622 }
13623
13624 impl std::default::Default for Scope {
13625 fn default() -> Self {
13626 use std::convert::From;
13627 Self::from(0)
13628 }
13629 }
13630
13631 impl std::fmt::Display for Scope {
13632 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13633 wkt::internal::display_enum(f, self.name(), self.value())
13634 }
13635 }
13636
13637 impl std::convert::From<i32> for Scope {
13638 fn from(value: i32) -> Self {
13639 match value {
13640 0 => Self::Unspecified,
13641 1 => Self::Subnet,
13642 2 => Self::ComputeApiSubnet,
13643 3 => Self::Network,
13644 4 => Self::VpnTunnel,
13645 5 => Self::InterconnectAttachment,
13646 6 => Self::Organization,
13647 _ => Self::UnknownValue(scope::UnknownValue(
13648 wkt::internal::UnknownEnumValue::Integer(value),
13649 )),
13650 }
13651 }
13652 }
13653
13654 impl std::convert::From<&str> for Scope {
13655 fn from(value: &str) -> Self {
13656 use std::string::ToString;
13657 match value {
13658 "SCOPE_UNSPECIFIED" => Self::Unspecified,
13659 "SUBNET" => Self::Subnet,
13660 "COMPUTE_API_SUBNET" => Self::ComputeApiSubnet,
13661 "NETWORK" => Self::Network,
13662 "VPN_TUNNEL" => Self::VpnTunnel,
13663 "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
13664 "ORGANIZATION" => Self::Organization,
13665 _ => Self::UnknownValue(scope::UnknownValue(
13666 wkt::internal::UnknownEnumValue::String(value.to_string()),
13667 )),
13668 }
13669 }
13670 }
13671
13672 impl serde::ser::Serialize for Scope {
13673 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13674 where
13675 S: serde::Serializer,
13676 {
13677 match self {
13678 Self::Unspecified => serializer.serialize_i32(0),
13679 Self::Subnet => serializer.serialize_i32(1),
13680 Self::ComputeApiSubnet => serializer.serialize_i32(2),
13681 Self::Network => serializer.serialize_i32(3),
13682 Self::VpnTunnel => serializer.serialize_i32(4),
13683 Self::InterconnectAttachment => serializer.serialize_i32(5),
13684 Self::Organization => serializer.serialize_i32(6),
13685 Self::UnknownValue(u) => u.0.serialize(serializer),
13686 }
13687 }
13688 }
13689
13690 impl<'de> serde::de::Deserialize<'de> for Scope {
13691 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13692 where
13693 D: serde::Deserializer<'de>,
13694 {
13695 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
13696 ".google.cloud.networkmanagement.v1.EffectiveVpcFlowLogsConfig.Scope",
13697 ))
13698 }
13699 }
13700
13701 #[derive(Clone, Debug, PartialEq)]
13706 #[non_exhaustive]
13707 pub enum TargetResource {
13708 Network(std::string::String),
13712 Subnet(std::string::String),
13715 InterconnectAttachment(std::string::String),
13719 VpnTunnel(std::string::String),
13722 }
13723}
13724
13725#[derive(Clone, Debug, PartialEq)]
13743#[non_exhaustive]
13744pub enum LoadBalancerType {
13745 Unspecified,
13748 HttpsAdvancedLoadBalancer,
13750 HttpsLoadBalancer,
13752 RegionalHttpsLoadBalancer,
13754 InternalHttpsLoadBalancer,
13756 SslProxyLoadBalancer,
13758 TcpProxyLoadBalancer,
13760 InternalTcpProxyLoadBalancer,
13762 NetworkLoadBalancer,
13764 LegacyNetworkLoadBalancer,
13766 TcpUdpInternalLoadBalancer,
13768 UnknownValue(load_balancer_type::UnknownValue),
13773}
13774
13775#[doc(hidden)]
13776pub mod load_balancer_type {
13777 #[allow(unused_imports)]
13778 use super::*;
13779 #[derive(Clone, Debug, PartialEq)]
13780 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13781}
13782
13783impl LoadBalancerType {
13784 pub fn value(&self) -> std::option::Option<i32> {
13789 match self {
13790 Self::Unspecified => std::option::Option::Some(0),
13791 Self::HttpsAdvancedLoadBalancer => std::option::Option::Some(1),
13792 Self::HttpsLoadBalancer => std::option::Option::Some(2),
13793 Self::RegionalHttpsLoadBalancer => std::option::Option::Some(3),
13794 Self::InternalHttpsLoadBalancer => std::option::Option::Some(4),
13795 Self::SslProxyLoadBalancer => std::option::Option::Some(5),
13796 Self::TcpProxyLoadBalancer => std::option::Option::Some(6),
13797 Self::InternalTcpProxyLoadBalancer => std::option::Option::Some(7),
13798 Self::NetworkLoadBalancer => std::option::Option::Some(8),
13799 Self::LegacyNetworkLoadBalancer => std::option::Option::Some(9),
13800 Self::TcpUdpInternalLoadBalancer => std::option::Option::Some(10),
13801 Self::UnknownValue(u) => u.0.value(),
13802 }
13803 }
13804
13805 pub fn name(&self) -> std::option::Option<&str> {
13810 match self {
13811 Self::Unspecified => std::option::Option::Some("LOAD_BALANCER_TYPE_UNSPECIFIED"),
13812 Self::HttpsAdvancedLoadBalancer => {
13813 std::option::Option::Some("HTTPS_ADVANCED_LOAD_BALANCER")
13814 }
13815 Self::HttpsLoadBalancer => std::option::Option::Some("HTTPS_LOAD_BALANCER"),
13816 Self::RegionalHttpsLoadBalancer => {
13817 std::option::Option::Some("REGIONAL_HTTPS_LOAD_BALANCER")
13818 }
13819 Self::InternalHttpsLoadBalancer => {
13820 std::option::Option::Some("INTERNAL_HTTPS_LOAD_BALANCER")
13821 }
13822 Self::SslProxyLoadBalancer => std::option::Option::Some("SSL_PROXY_LOAD_BALANCER"),
13823 Self::TcpProxyLoadBalancer => std::option::Option::Some("TCP_PROXY_LOAD_BALANCER"),
13824 Self::InternalTcpProxyLoadBalancer => {
13825 std::option::Option::Some("INTERNAL_TCP_PROXY_LOAD_BALANCER")
13826 }
13827 Self::NetworkLoadBalancer => std::option::Option::Some("NETWORK_LOAD_BALANCER"),
13828 Self::LegacyNetworkLoadBalancer => {
13829 std::option::Option::Some("LEGACY_NETWORK_LOAD_BALANCER")
13830 }
13831 Self::TcpUdpInternalLoadBalancer => {
13832 std::option::Option::Some("TCP_UDP_INTERNAL_LOAD_BALANCER")
13833 }
13834 Self::UnknownValue(u) => u.0.name(),
13835 }
13836 }
13837}
13838
13839impl std::default::Default for LoadBalancerType {
13840 fn default() -> Self {
13841 use std::convert::From;
13842 Self::from(0)
13843 }
13844}
13845
13846impl std::fmt::Display for LoadBalancerType {
13847 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13848 wkt::internal::display_enum(f, self.name(), self.value())
13849 }
13850}
13851
13852impl std::convert::From<i32> for LoadBalancerType {
13853 fn from(value: i32) -> Self {
13854 match value {
13855 0 => Self::Unspecified,
13856 1 => Self::HttpsAdvancedLoadBalancer,
13857 2 => Self::HttpsLoadBalancer,
13858 3 => Self::RegionalHttpsLoadBalancer,
13859 4 => Self::InternalHttpsLoadBalancer,
13860 5 => Self::SslProxyLoadBalancer,
13861 6 => Self::TcpProxyLoadBalancer,
13862 7 => Self::InternalTcpProxyLoadBalancer,
13863 8 => Self::NetworkLoadBalancer,
13864 9 => Self::LegacyNetworkLoadBalancer,
13865 10 => Self::TcpUdpInternalLoadBalancer,
13866 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
13867 wkt::internal::UnknownEnumValue::Integer(value),
13868 )),
13869 }
13870 }
13871}
13872
13873impl std::convert::From<&str> for LoadBalancerType {
13874 fn from(value: &str) -> Self {
13875 use std::string::ToString;
13876 match value {
13877 "LOAD_BALANCER_TYPE_UNSPECIFIED" => Self::Unspecified,
13878 "HTTPS_ADVANCED_LOAD_BALANCER" => Self::HttpsAdvancedLoadBalancer,
13879 "HTTPS_LOAD_BALANCER" => Self::HttpsLoadBalancer,
13880 "REGIONAL_HTTPS_LOAD_BALANCER" => Self::RegionalHttpsLoadBalancer,
13881 "INTERNAL_HTTPS_LOAD_BALANCER" => Self::InternalHttpsLoadBalancer,
13882 "SSL_PROXY_LOAD_BALANCER" => Self::SslProxyLoadBalancer,
13883 "TCP_PROXY_LOAD_BALANCER" => Self::TcpProxyLoadBalancer,
13884 "INTERNAL_TCP_PROXY_LOAD_BALANCER" => Self::InternalTcpProxyLoadBalancer,
13885 "NETWORK_LOAD_BALANCER" => Self::NetworkLoadBalancer,
13886 "LEGACY_NETWORK_LOAD_BALANCER" => Self::LegacyNetworkLoadBalancer,
13887 "TCP_UDP_INTERNAL_LOAD_BALANCER" => Self::TcpUdpInternalLoadBalancer,
13888 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
13889 wkt::internal::UnknownEnumValue::String(value.to_string()),
13890 )),
13891 }
13892 }
13893}
13894
13895impl serde::ser::Serialize for LoadBalancerType {
13896 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13897 where
13898 S: serde::Serializer,
13899 {
13900 match self {
13901 Self::Unspecified => serializer.serialize_i32(0),
13902 Self::HttpsAdvancedLoadBalancer => serializer.serialize_i32(1),
13903 Self::HttpsLoadBalancer => serializer.serialize_i32(2),
13904 Self::RegionalHttpsLoadBalancer => serializer.serialize_i32(3),
13905 Self::InternalHttpsLoadBalancer => serializer.serialize_i32(4),
13906 Self::SslProxyLoadBalancer => serializer.serialize_i32(5),
13907 Self::TcpProxyLoadBalancer => serializer.serialize_i32(6),
13908 Self::InternalTcpProxyLoadBalancer => serializer.serialize_i32(7),
13909 Self::NetworkLoadBalancer => serializer.serialize_i32(8),
13910 Self::LegacyNetworkLoadBalancer => serializer.serialize_i32(9),
13911 Self::TcpUdpInternalLoadBalancer => serializer.serialize_i32(10),
13912 Self::UnknownValue(u) => u.0.serialize(serializer),
13913 }
13914 }
13915}
13916
13917impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
13918 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13919 where
13920 D: serde::Deserializer<'de>,
13921 {
13922 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
13923 ".google.cloud.networkmanagement.v1.LoadBalancerType",
13924 ))
13925 }
13926}