google_cloud_networkmanagement_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate 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/// A Connectivity Test for a network reachability analysis.
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct ConnectivityTest {
46    /// Identifier. Unique name of the resource using the form:
47    /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
48    pub name: std::string::String,
49
50    /// The user-supplied description of the Connectivity Test.
51    /// Maximum of 512 characters.
52    pub description: std::string::String,
53
54    /// Required. Source specification of the Connectivity Test.
55    ///
56    /// You can use a combination of source IP address, URI of a supported
57    /// endpoint, project ID, or VPC network to identify the source location.
58    ///
59    /// Reachability analysis might proceed even if the source location is
60    /// ambiguous. However, the test result might include endpoints or use a source
61    /// that you don't intend to test.
62    pub source: std::option::Option<crate::model::Endpoint>,
63
64    /// Required. Destination specification of the Connectivity Test.
65    ///
66    /// You can use a combination of destination IP address, URI of a supported
67    /// endpoint, project ID, or VPC network to identify the destination location.
68    ///
69    /// Reachability analysis proceeds even if the destination location is
70    /// ambiguous. However, the test result might include endpoints or use a
71    /// destination that you don't intend to test.
72    pub destination: std::option::Option<crate::model::Endpoint>,
73
74    /// IP Protocol of the test. When not provided, "TCP" is assumed.
75    pub protocol: std::string::String,
76
77    /// Other projects that may be relevant for reachability analysis.
78    /// This is applicable to scenarios where a test can cross project boundaries.
79    pub related_projects: std::vec::Vec<std::string::String>,
80
81    /// Output only. The display name of a Connectivity Test.
82    pub display_name: std::string::String,
83
84    /// Resource labels to represent user-provided metadata.
85    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
86
87    /// Output only. The time the test was created.
88    pub create_time: std::option::Option<wkt::Timestamp>,
89
90    /// Output only. The time the test's configuration was updated.
91    pub update_time: std::option::Option<wkt::Timestamp>,
92
93    /// Output only. The reachability details of this test from the latest run.
94    /// The details are updated when creating a new test, updating an
95    /// existing test, or triggering a one-time rerun of an existing test.
96    pub reachability_details: std::option::Option<crate::model::ReachabilityDetails>,
97
98    /// Output only. The probing details of this test from the latest run, present
99    /// for applicable tests only. The details are updated when creating a new
100    /// test, updating an existing test, or triggering a one-time rerun of an
101    /// existing test.
102    pub probing_details: std::option::Option<crate::model::ProbingDetails>,
103
104    /// Whether run analysis for the return path from destination to source.
105    /// Default value is false.
106    pub round_trip: bool,
107
108    /// Output only. The reachability details of this test from the latest run for
109    /// the return path. The details are updated when creating a new test,
110    /// updating an existing test, or triggering a one-time rerun of an existing
111    /// test.
112    pub return_reachability_details: std::option::Option<crate::model::ReachabilityDetails>,
113
114    /// Whether the analysis should skip firewall checking. Default value is false.
115    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    /// Sets the value of [name][crate::model::ConnectivityTest::name].
126    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    /// Sets the value of [description][crate::model::ConnectivityTest::description].
132    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    /// Sets the value of [source][crate::model::ConnectivityTest::source].
138    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    /// Sets or clears the value of [source][crate::model::ConnectivityTest::source].
147    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    /// Sets the value of [destination][crate::model::ConnectivityTest::destination].
156    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    /// Sets or clears the value of [destination][crate::model::ConnectivityTest::destination].
165    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    /// Sets the value of [protocol][crate::model::ConnectivityTest::protocol].
174    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    /// Sets the value of [related_projects][crate::model::ConnectivityTest::related_projects].
180    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    /// Sets the value of [display_name][crate::model::ConnectivityTest::display_name].
191    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    /// Sets the value of [labels][crate::model::ConnectivityTest::labels].
197    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    /// Sets the value of [create_time][crate::model::ConnectivityTest::create_time].
209    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    /// Sets or clears the value of [create_time][crate::model::ConnectivityTest::create_time].
218    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    /// Sets the value of [update_time][crate::model::ConnectivityTest::update_time].
227    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    /// Sets or clears the value of [update_time][crate::model::ConnectivityTest::update_time].
236    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    /// Sets the value of [reachability_details][crate::model::ConnectivityTest::reachability_details].
245    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    /// Sets or clears the value of [reachability_details][crate::model::ConnectivityTest::reachability_details].
254    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    /// Sets the value of [probing_details][crate::model::ConnectivityTest::probing_details].
263    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    /// Sets or clears the value of [probing_details][crate::model::ConnectivityTest::probing_details].
272    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    /// Sets the value of [round_trip][crate::model::ConnectivityTest::round_trip].
281    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    /// Sets the value of [return_reachability_details][crate::model::ConnectivityTest::return_reachability_details].
287    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    /// Sets or clears the value of [return_reachability_details][crate::model::ConnectivityTest::return_reachability_details].
296    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    /// Sets the value of [bypass_firewall_checks][crate::model::ConnectivityTest::bypass_firewall_checks].
305    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/// Source or destination of the Connectivity Test.
318#[derive(Clone, Default, PartialEq)]
319#[non_exhaustive]
320pub struct Endpoint {
321    /// The IP address of the endpoint, which can be an external or internal IP.
322    pub ip_address: std::string::String,
323
324    /// The IP protocol port of the endpoint.
325    /// Only applicable when protocol is TCP or UDP.
326    pub port: i32,
327
328    /// A Compute Engine instance URI.
329    pub instance: std::string::String,
330
331    /// A forwarding rule and its corresponding IP address represent the frontend
332    /// configuration of a Google Cloud load balancer. Forwarding rules are also
333    /// used for protocol forwarding, Private Service Connect and other network
334    /// services to provide forwarding information in the control plane. Applicable
335    /// only to destination endpoint. Format:
336    /// `projects/{project}/global/forwardingRules/{id}` or
337    /// `projects/{project}/regions/{region}/forwardingRules/{id}`
338    pub forwarding_rule: std::string::String,
339
340    /// Output only. Specifies the type of the target of the forwarding rule.
341    pub forwarding_rule_target: std::option::Option<crate::model::endpoint::ForwardingRuleTarget>,
342
343    /// Output only. ID of the load balancer the forwarding rule points to. Empty
344    /// for forwarding rules not related to load balancers.
345    pub load_balancer_id: std::option::Option<std::string::String>,
346
347    /// Output only. Type of the load balancer the forwarding rule points to.
348    pub load_balancer_type: std::option::Option<crate::model::LoadBalancerType>,
349
350    /// A cluster URI for [Google Kubernetes Engine cluster control
351    /// plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
352    pub gke_master_cluster: std::string::String,
353
354    /// DNS endpoint of [Google Kubernetes Engine cluster control
355    /// plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
356    /// Requires gke_master_cluster to be set, can't be used simultaneoulsly with
357    /// ip_address or network. Applicable only to destination endpoint.
358    pub fqdn: std::string::String,
359
360    /// A [Cloud SQL](https://cloud.google.com/sql) instance URI.
361    pub cloud_sql_instance: std::string::String,
362
363    /// A [Redis Instance](https://cloud.google.com/memorystore/docs/redis) URI.
364    /// Applicable only to destination endpoint.
365    pub redis_instance: std::string::String,
366
367    /// A [Redis Cluster](https://cloud.google.com/memorystore/docs/cluster) URI.
368    /// Applicable only to destination endpoint.
369    pub redis_cluster: std::string::String,
370
371    /// A [Cloud Function](https://cloud.google.com/functions). Applicable only to
372    /// source endpoint.
373    pub cloud_function: std::option::Option<crate::model::endpoint::CloudFunctionEndpoint>,
374
375    /// An [App Engine](https://cloud.google.com/appengine) [service
376    /// version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions).
377    /// Applicable only to source endpoint.
378    pub app_engine_version: std::option::Option<crate::model::endpoint::AppEngineVersionEndpoint>,
379
380    /// A [Cloud Run](https://cloud.google.com/run)
381    /// [revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get)
382    /// Applicable only to source endpoint.
383    pub cloud_run_revision: std::option::Option<crate::model::endpoint::CloudRunRevisionEndpoint>,
384
385    /// A VPC network URI.
386    pub network: std::string::String,
387
388    /// Type of the network where the endpoint is located.
389    /// Applicable only to source endpoint, as destination network type can be
390    /// inferred from the source.
391    pub network_type: crate::model::endpoint::NetworkType,
392
393    /// Project ID where the endpoint is located.
394    /// The project ID can be derived from the URI if you provide a endpoint or
395    /// network URI.
396    /// The following are two cases where you may need to provide the project ID:
397    ///
398    /// 1. Only the IP address is specified, and the IP address is within a Google
399    ///    Cloud project.
400    /// 1. When you are using Shared VPC and the IP address that you provide is
401    ///    from the service project. In this case, the network that the IP address
402    ///    resides in is defined in the host project.
403    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    /// Sets the value of [ip_address][crate::model::Endpoint::ip_address].
414    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    /// Sets the value of [port][crate::model::Endpoint::port].
420    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
421        self.port = v.into();
422        self
423    }
424
425    /// Sets the value of [instance][crate::model::Endpoint::instance].
426    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    /// Sets the value of [forwarding_rule][crate::model::Endpoint::forwarding_rule].
432    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    /// Sets the value of [forwarding_rule_target][crate::model::Endpoint::forwarding_rule_target].
438    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    /// Sets or clears the value of [forwarding_rule_target][crate::model::Endpoint::forwarding_rule_target].
447    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    /// Sets the value of [load_balancer_id][crate::model::Endpoint::load_balancer_id].
456    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    /// Sets or clears the value of [load_balancer_id][crate::model::Endpoint::load_balancer_id].
465    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    /// Sets the value of [load_balancer_type][crate::model::Endpoint::load_balancer_type].
474    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    /// Sets or clears the value of [load_balancer_type][crate::model::Endpoint::load_balancer_type].
483    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    /// Sets the value of [gke_master_cluster][crate::model::Endpoint::gke_master_cluster].
492    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    /// Sets the value of [fqdn][crate::model::Endpoint::fqdn].
501    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    /// Sets the value of [cloud_sql_instance][crate::model::Endpoint::cloud_sql_instance].
507    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    /// Sets the value of [redis_instance][crate::model::Endpoint::redis_instance].
516    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    /// Sets the value of [redis_cluster][crate::model::Endpoint::redis_cluster].
522    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    /// Sets the value of [cloud_function][crate::model::Endpoint::cloud_function].
528    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    /// Sets or clears the value of [cloud_function][crate::model::Endpoint::cloud_function].
537    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    /// Sets the value of [app_engine_version][crate::model::Endpoint::app_engine_version].
546    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    /// Sets or clears the value of [app_engine_version][crate::model::Endpoint::app_engine_version].
555    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    /// Sets the value of [cloud_run_revision][crate::model::Endpoint::cloud_run_revision].
564    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    /// Sets or clears the value of [cloud_run_revision][crate::model::Endpoint::cloud_run_revision].
573    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    /// Sets the value of [network][crate::model::Endpoint::network].
582    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    /// Sets the value of [network_type][crate::model::Endpoint::network_type].
588    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    /// Sets the value of [project_id][crate::model::Endpoint::project_id].
597    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
609/// Defines additional types related to [Endpoint].
610pub mod endpoint {
611    #[allow(unused_imports)]
612    use super::*;
613
614    /// Wrapper for Cloud Function attributes.
615    #[derive(Clone, Default, PartialEq)]
616    #[non_exhaustive]
617    pub struct CloudFunctionEndpoint {
618        /// A [Cloud Function](https://cloud.google.com/functions) name.
619        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        /// Sets the value of [uri][crate::model::endpoint::CloudFunctionEndpoint::uri].
630        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    /// Wrapper for the App Engine service version attributes.
643    #[derive(Clone, Default, PartialEq)]
644    #[non_exhaustive]
645    pub struct AppEngineVersionEndpoint {
646        /// An [App Engine](https://cloud.google.com/appengine) [service
647        /// version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions)
648        /// name.
649        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        /// Sets the value of [uri][crate::model::endpoint::AppEngineVersionEndpoint::uri].
660        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    /// Wrapper for Cloud Run revision attributes.
673    #[derive(Clone, Default, PartialEq)]
674    #[non_exhaustive]
675    pub struct CloudRunRevisionEndpoint {
676        /// A [Cloud Run](https://cloud.google.com/run)
677        /// [revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get)
678        /// URI. The format is:
679        /// projects/{project}/locations/{location}/revisions/{revision}
680        pub uri: std::string::String,
681
682        /// Output only. The URI of the Cloud Run service that the revision belongs
683        /// to. The format is:
684        /// projects/{project}/locations/{location}/services/{service}
685        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        /// Sets the value of [uri][crate::model::endpoint::CloudRunRevisionEndpoint::uri].
696        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        /// Sets the value of [service_uri][crate::model::endpoint::CloudRunRevisionEndpoint::service_uri].
702        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    /// The type definition of an endpoint's network. Use one of the
715    /// following choices:
716    ///
717    /// # Working with unknown values
718    ///
719    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
720    /// additional enum variants at any time. Adding new variants is not considered
721    /// a breaking change. Applications should write their code in anticipation of:
722    ///
723    /// - New values appearing in future releases of the client library, **and**
724    /// - New values received dynamically, without application changes.
725    ///
726    /// Please consult the [Working with enums] section in the user guide for some
727    /// guidelines.
728    ///
729    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
730    #[derive(Clone, Debug, PartialEq)]
731    #[non_exhaustive]
732    pub enum NetworkType {
733        /// Default type if unspecified.
734        Unspecified,
735        /// A network hosted within Google Cloud.
736        /// To receive more detailed output, specify the URI for the source or
737        /// destination network.
738        GcpNetwork,
739        /// A network hosted outside of Google Cloud.
740        /// This can be an on-premises network, an internet resource or a network
741        /// hosted by another cloud provider.
742        NonGcpNetwork,
743        /// If set, the enum was initialized with an unknown value.
744        ///
745        /// Applications can examine the value using [NetworkType::value] or
746        /// [NetworkType::name].
747        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        /// Gets the enum value.
760        ///
761        /// Returns `None` if the enum contains an unknown value deserialized from
762        /// the string representation of enums.
763        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        /// Gets the enum value as a string.
773        ///
774        /// Returns `None` if the enum contains an unknown value deserialized from
775        /// the integer representation of enums.
776        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    /// Type of the target of a forwarding rule.
852    ///
853    /// # Working with unknown values
854    ///
855    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
856    /// additional enum variants at any time. Adding new variants is not considered
857    /// a breaking change. Applications should write their code in anticipation of:
858    ///
859    /// - New values appearing in future releases of the client library, **and**
860    /// - New values received dynamically, without application changes.
861    ///
862    /// Please consult the [Working with enums] section in the user guide for some
863    /// guidelines.
864    ///
865    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
866    #[derive(Clone, Debug, PartialEq)]
867    #[non_exhaustive]
868    pub enum ForwardingRuleTarget {
869        /// Forwarding rule target is unknown.
870        Unspecified,
871        /// Compute Engine instance for protocol forwarding.
872        Instance,
873        /// Load Balancer. The specific type can be found from [load_balancer_type]
874        /// [google.cloud.networkmanagement.v1.Endpoint.load_balancer_type].
875        LoadBalancer,
876        /// Classic Cloud VPN Gateway.
877        VpnGateway,
878        /// Forwarding Rule is a Private Service Connect endpoint.
879        Psc,
880        /// If set, the enum was initialized with an unknown value.
881        ///
882        /// Applications can examine the value using [ForwardingRuleTarget::value] or
883        /// [ForwardingRuleTarget::name].
884        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        /// Gets the enum value.
897        ///
898        /// Returns `None` if the enum contains an unknown value deserialized from
899        /// the string representation of enums.
900        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        /// Gets the enum value as a string.
912        ///
913        /// Returns `None` if the enum contains an unknown value deserialized from
914        /// the integer representation of enums.
915        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/// Results of the configuration analysis from the last run of the test.
1002#[derive(Clone, Default, PartialEq)]
1003#[non_exhaustive]
1004pub struct ReachabilityDetails {
1005    /// The overall result of the test's configuration analysis.
1006    pub result: crate::model::reachability_details::Result,
1007
1008    /// The time of the configuration analysis.
1009    pub verify_time: std::option::Option<wkt::Timestamp>,
1010
1011    /// The details of a failure or a cancellation of reachability analysis.
1012    pub error: std::option::Option<rpc::model::Status>,
1013
1014    /// Result may contain a list of traces if a test has multiple possible
1015    /// paths in the network, such as when destination endpoint is a load balancer
1016    /// with multiple backends.
1017    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    /// Sets the value of [result][crate::model::ReachabilityDetails::result].
1028    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    /// Sets the value of [verify_time][crate::model::ReachabilityDetails::verify_time].
1037    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    /// Sets or clears the value of [verify_time][crate::model::ReachabilityDetails::verify_time].
1046    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    /// Sets the value of [error][crate::model::ReachabilityDetails::error].
1055    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    /// Sets or clears the value of [error][crate::model::ReachabilityDetails::error].
1064    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    /// Sets the value of [traces][crate::model::ReachabilityDetails::traces].
1073    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
1090/// Defines additional types related to [ReachabilityDetails].
1091pub mod reachability_details {
1092    #[allow(unused_imports)]
1093    use super::*;
1094
1095    /// The overall result of the test's configuration analysis.
1096    ///
1097    /// # Working with unknown values
1098    ///
1099    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1100    /// additional enum variants at any time. Adding new variants is not considered
1101    /// a breaking change. Applications should write their code in anticipation of:
1102    ///
1103    /// - New values appearing in future releases of the client library, **and**
1104    /// - New values received dynamically, without application changes.
1105    ///
1106    /// Please consult the [Working with enums] section in the user guide for some
1107    /// guidelines.
1108    ///
1109    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1110    #[derive(Clone, Debug, PartialEq)]
1111    #[non_exhaustive]
1112    pub enum Result {
1113        /// No result was specified.
1114        Unspecified,
1115        /// Possible scenarios are:
1116        ///
1117        /// * The configuration analysis determined that a packet originating from
1118        ///   the source is expected to reach the destination.
1119        /// * The analysis didn't complete because the user lacks permission for
1120        ///   some of the resources in the trace. However, at the time the user's
1121        ///   permission became insufficient, the trace had been successful so far.
1122        Reachable,
1123        /// A packet originating from the source is expected to be dropped before
1124        /// reaching the destination.
1125        Unreachable,
1126        /// The source and destination endpoints do not uniquely identify
1127        /// the test location in the network, and the reachability result contains
1128        /// multiple traces. For some traces, a packet could be delivered, and for
1129        /// others, it would not be. This result is also assigned to
1130        /// configuration analysis of return path if on its own it should be
1131        /// REACHABLE, but configuration analysis of forward path is AMBIGUOUS.
1132        Ambiguous,
1133        /// The configuration analysis did not complete. Possible reasons are:
1134        ///
1135        /// * A permissions error occurred--for example, the user might not have
1136        ///   read permission for all of the resources named in the test.
1137        /// * An internal error occurred.
1138        /// * The analyzer received an invalid or unsupported argument or was unable
1139        ///   to identify a known endpoint.
1140        Undetermined,
1141        /// If set, the enum was initialized with an unknown value.
1142        ///
1143        /// Applications can examine the value using [Result::value] or
1144        /// [Result::name].
1145        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        /// Gets the enum value.
1158        ///
1159        /// Returns `None` if the enum contains an unknown value deserialized from
1160        /// the string representation of enums.
1161        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        /// Gets the enum value as a string.
1173        ///
1174        /// Returns `None` if the enum contains an unknown value deserialized from
1175        /// the integer representation of enums.
1176        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/// Latency percentile rank and value.
1261#[derive(Clone, Default, PartialEq)]
1262#[non_exhaustive]
1263pub struct LatencyPercentile {
1264    /// Percentage of samples this data point applies to.
1265    pub percent: i32,
1266
1267    /// percent-th percentile of latency observed, in microseconds.
1268    /// Fraction of percent/100 of samples have latency lower or
1269    /// equal to the value of this field.
1270    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    /// Sets the value of [percent][crate::model::LatencyPercentile::percent].
1281    pub fn set_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1282        self.percent = v.into();
1283        self
1284    }
1285
1286    /// Sets the value of [latency_micros][crate::model::LatencyPercentile::latency_micros].
1287    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/// Describes measured latency distribution.
1300#[derive(Clone, Default, PartialEq)]
1301#[non_exhaustive]
1302pub struct LatencyDistribution {
1303    /// Representative latency percentiles.
1304    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    /// Sets the value of [latency_percentiles][crate::model::LatencyDistribution::latency_percentiles].
1315    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/// Results of active probing from the last run of the test.
1333#[derive(Clone, Default, PartialEq)]
1334#[non_exhaustive]
1335pub struct ProbingDetails {
1336    /// The overall result of active probing.
1337    pub result: crate::model::probing_details::ProbingResult,
1338
1339    /// The time that reachability was assessed through active probing.
1340    pub verify_time: std::option::Option<wkt::Timestamp>,
1341
1342    /// Details about an internal failure or the cancellation of active probing.
1343    pub error: std::option::Option<rpc::model::Status>,
1344
1345    /// The reason probing was aborted.
1346    pub abort_cause: crate::model::probing_details::ProbingAbortCause,
1347
1348    /// Number of probes sent.
1349    pub sent_probe_count: i32,
1350
1351    /// Number of probes that reached the destination.
1352    pub successful_probe_count: i32,
1353
1354    /// The source and destination endpoints derived from the test input and used
1355    /// for active probing.
1356    pub endpoint_info: std::option::Option<crate::model::EndpointInfo>,
1357
1358    /// Latency as measured by active probing in one direction:
1359    /// from the source to the destination endpoint.
1360    pub probing_latency: std::option::Option<crate::model::LatencyDistribution>,
1361
1362    /// The EdgeLocation from which a packet, destined to the internet, will egress
1363    /// the Google network.
1364    /// This will only be populated for a connectivity test which has an internet
1365    /// destination address.
1366    /// The absence of this field *must not* be used as an indication that the
1367    /// destination is part of the Google network.
1368    pub destination_egress_location:
1369        std::option::Option<crate::model::probing_details::EdgeLocation>,
1370
1371    /// Probing results for all edge devices.
1372    pub edge_responses: std::vec::Vec<crate::model::probing_details::SingleEdgeResponse>,
1373
1374    /// Whether all relevant edge devices were probed.
1375    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    /// Sets the value of [result][crate::model::ProbingDetails::result].
1386    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    /// Sets the value of [verify_time][crate::model::ProbingDetails::verify_time].
1395    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    /// Sets or clears the value of [verify_time][crate::model::ProbingDetails::verify_time].
1404    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    /// Sets the value of [error][crate::model::ProbingDetails::error].
1413    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    /// Sets or clears the value of [error][crate::model::ProbingDetails::error].
1422    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    /// Sets the value of [abort_cause][crate::model::ProbingDetails::abort_cause].
1431    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    /// Sets the value of [sent_probe_count][crate::model::ProbingDetails::sent_probe_count].
1442    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    /// Sets the value of [successful_probe_count][crate::model::ProbingDetails::successful_probe_count].
1448    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    /// Sets the value of [endpoint_info][crate::model::ProbingDetails::endpoint_info].
1454    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    /// Sets or clears the value of [endpoint_info][crate::model::ProbingDetails::endpoint_info].
1463    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    /// Sets the value of [probing_latency][crate::model::ProbingDetails::probing_latency].
1472    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    /// Sets or clears the value of [probing_latency][crate::model::ProbingDetails::probing_latency].
1481    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    /// Sets the value of [destination_egress_location][crate::model::ProbingDetails::destination_egress_location].
1490    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    /// Sets or clears the value of [destination_egress_location][crate::model::ProbingDetails::destination_egress_location].
1499    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    /// Sets the value of [edge_responses][crate::model::ProbingDetails::edge_responses].
1508    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    /// Sets the value of [probed_all_devices][crate::model::ProbingDetails::probed_all_devices].
1519    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
1531/// Defines additional types related to [ProbingDetails].
1532pub mod probing_details {
1533    #[allow(unused_imports)]
1534    use super::*;
1535
1536    /// Representation of a network edge location as per
1537    /// <https://cloud.google.com/vpc/docs/edge-locations>.
1538    #[derive(Clone, Default, PartialEq)]
1539    #[non_exhaustive]
1540    pub struct EdgeLocation {
1541        /// Name of the metropolitan area.
1542        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        /// Sets the value of [metropolitan_area][crate::model::probing_details::EdgeLocation::metropolitan_area].
1553        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    /// Probing results for a single edge device.
1569    #[derive(Clone, Default, PartialEq)]
1570    #[non_exhaustive]
1571    pub struct SingleEdgeResponse {
1572        /// The overall result of active probing for this egress device.
1573        pub result: crate::model::probing_details::ProbingResult,
1574
1575        /// Number of probes sent.
1576        pub sent_probe_count: i32,
1577
1578        /// Number of probes that reached the destination.
1579        pub successful_probe_count: i32,
1580
1581        /// Latency as measured by active probing in one direction: from the source
1582        /// to the destination endpoint.
1583        pub probing_latency: std::option::Option<crate::model::LatencyDistribution>,
1584
1585        /// The EdgeLocation from which a packet, destined to the internet, will
1586        /// egress the Google network.
1587        /// This will only be populated for a connectivity test which has an internet
1588        /// destination address.
1589        /// The absence of this field *must not* be used as an indication that the
1590        /// destination is part of the Google network.
1591        pub destination_egress_location:
1592            std::option::Option<crate::model::probing_details::EdgeLocation>,
1593
1594        /// Router name in the format '{router}.{metroshard}'. For example:
1595        /// pf01.aaa01, pr02.aaa01.
1596        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        /// Sets the value of [result][crate::model::probing_details::SingleEdgeResponse::result].
1607        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        /// Sets the value of [sent_probe_count][crate::model::probing_details::SingleEdgeResponse::sent_probe_count].
1616        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        /// Sets the value of [successful_probe_count][crate::model::probing_details::SingleEdgeResponse::successful_probe_count].
1622        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        /// Sets the value of [probing_latency][crate::model::probing_details::SingleEdgeResponse::probing_latency].
1628        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        /// Sets or clears the value of [probing_latency][crate::model::probing_details::SingleEdgeResponse::probing_latency].
1637        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        /// Sets the value of [destination_egress_location][crate::model::probing_details::SingleEdgeResponse::destination_egress_location].
1646        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        /// Sets or clears the value of [destination_egress_location][crate::model::probing_details::SingleEdgeResponse::destination_egress_location].
1655        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        /// Sets the value of [destination_router][crate::model::probing_details::SingleEdgeResponse::destination_router].
1667        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    /// Overall probing result of the test.
1683    ///
1684    /// # Working with unknown values
1685    ///
1686    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1687    /// additional enum variants at any time. Adding new variants is not considered
1688    /// a breaking change. Applications should write their code in anticipation of:
1689    ///
1690    /// - New values appearing in future releases of the client library, **and**
1691    /// - New values received dynamically, without application changes.
1692    ///
1693    /// Please consult the [Working with enums] section in the user guide for some
1694    /// guidelines.
1695    ///
1696    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1697    #[derive(Clone, Debug, PartialEq)]
1698    #[non_exhaustive]
1699    pub enum ProbingResult {
1700        /// No result was specified.
1701        Unspecified,
1702        /// At least 95% of packets reached the destination.
1703        Reachable,
1704        /// No packets reached the destination.
1705        Unreachable,
1706        /// Less than 95% of packets reached the destination.
1707        ReachabilityInconsistent,
1708        /// Reachability could not be determined. Possible reasons are:
1709        ///
1710        /// * The user lacks permission to access some of the network resources
1711        ///   required to run the test.
1712        /// * No valid source endpoint could be derived from the request.
1713        /// * An internal error occurred.
1714        Undetermined,
1715        /// If set, the enum was initialized with an unknown value.
1716        ///
1717        /// Applications can examine the value using [ProbingResult::value] or
1718        /// [ProbingResult::name].
1719        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        /// Gets the enum value.
1732        ///
1733        /// Returns `None` if the enum contains an unknown value deserialized from
1734        /// the string representation of enums.
1735        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        /// Gets the enum value as a string.
1747        ///
1748        /// Returns `None` if the enum contains an unknown value deserialized from
1749        /// the integer representation of enums.
1750        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    /// Abort cause types.
1836    ///
1837    /// # Working with unknown values
1838    ///
1839    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1840    /// additional enum variants at any time. Adding new variants is not considered
1841    /// a breaking change. Applications should write their code in anticipation of:
1842    ///
1843    /// - New values appearing in future releases of the client library, **and**
1844    /// - New values received dynamically, without application changes.
1845    ///
1846    /// Please consult the [Working with enums] section in the user guide for some
1847    /// guidelines.
1848    ///
1849    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1850    #[derive(Clone, Debug, PartialEq)]
1851    #[non_exhaustive]
1852    pub enum ProbingAbortCause {
1853        /// No reason was specified.
1854        Unspecified,
1855        /// The user lacks permission to access some of the
1856        /// network resources required to run the test.
1857        PermissionDenied,
1858        /// No valid source endpoint could be derived from the request.
1859        NoSourceLocation,
1860        /// If set, the enum was initialized with an unknown value.
1861        ///
1862        /// Applications can examine the value using [ProbingAbortCause::value] or
1863        /// [ProbingAbortCause::name].
1864        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        /// Gets the enum value.
1877        ///
1878        /// Returns `None` if the enum contains an unknown value deserialized from
1879        /// the string representation of enums.
1880        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        /// Gets the enum value as a string.
1890        ///
1891        /// Returns `None` if the enum contains an unknown value deserialized from
1892        /// the integer representation of enums.
1893        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/// Request for the `ListConnectivityTests` method.
1970#[derive(Clone, Default, PartialEq)]
1971#[non_exhaustive]
1972pub struct ListConnectivityTestsRequest {
1973    /// Required. The parent resource of the Connectivity Tests:
1974    /// `projects/{project_id}/locations/global`
1975    pub parent: std::string::String,
1976
1977    /// Number of `ConnectivityTests` to return.
1978    pub page_size: i32,
1979
1980    /// Page token from an earlier query, as returned in `next_page_token`.
1981    pub page_token: std::string::String,
1982
1983    /// Lists the `ConnectivityTests` that match the filter expression. A filter
1984    /// expression filters the resources listed in the response. The expression
1985    /// must be of the form `<field> <operator> <value>` where operators: `<`, `>`,
1986    /// `<=`,
1987    /// `>=`,
1988    /// `!=`, `=`, `:` are supported (colon `:` represents a HAS operator which is
1989    /// roughly synonymous with equality). \<field\> can refer to a proto or JSON
1990    /// field, or a synthetic field. Field names can be camelCase or snake_case.
1991    ///
1992    /// Examples:
1993    ///
1994    /// - Filter by name:
1995    ///   name = "projects/proj-1/locations/global/connectivityTests/test-1
1996    ///
1997    /// - Filter by labels:
1998    ///
1999    ///   - Resources that have a key called `foo`
2000    ///     labels.foo:*
2001    ///   - Resources that have a key called `foo` whose value is `bar`
2002    ///     labels.foo = bar
2003    pub filter: std::string::String,
2004
2005    /// Field to use to sort the list.
2006    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    /// Sets the value of [parent][crate::model::ListConnectivityTestsRequest::parent].
2017    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    /// Sets the value of [page_size][crate::model::ListConnectivityTestsRequest::page_size].
2023    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    /// Sets the value of [page_token][crate::model::ListConnectivityTestsRequest::page_token].
2029    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    /// Sets the value of [filter][crate::model::ListConnectivityTestsRequest::filter].
2035    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    /// Sets the value of [order_by][crate::model::ListConnectivityTestsRequest::order_by].
2041    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/// Response for the `ListConnectivityTests` method.
2054#[derive(Clone, Default, PartialEq)]
2055#[non_exhaustive]
2056pub struct ListConnectivityTestsResponse {
2057    /// List of Connectivity Tests.
2058    pub resources: std::vec::Vec<crate::model::ConnectivityTest>,
2059
2060    /// Page token to fetch the next set of Connectivity Tests.
2061    pub next_page_token: std::string::String,
2062
2063    /// Locations that could not be reached (when querying all locations with `-`).
2064    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    /// Sets the value of [resources][crate::model::ListConnectivityTestsResponse::resources].
2075    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    /// Sets the value of [next_page_token][crate::model::ListConnectivityTestsResponse::next_page_token].
2086    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    /// Sets the value of [unreachable][crate::model::ListConnectivityTestsResponse::unreachable].
2092    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/// Request for the `GetConnectivityTest` method.
2124#[derive(Clone, Default, PartialEq)]
2125#[non_exhaustive]
2126pub struct GetConnectivityTestRequest {
2127    /// Required. `ConnectivityTest` resource name using the form:
2128    /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
2129    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    /// Sets the value of [name][crate::model::GetConnectivityTestRequest::name].
2140    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/// Request for the `CreateConnectivityTest` method.
2153#[derive(Clone, Default, PartialEq)]
2154#[non_exhaustive]
2155pub struct CreateConnectivityTestRequest {
2156    /// Required. The parent resource of the Connectivity Test to create:
2157    /// `projects/{project_id}/locations/global`
2158    pub parent: std::string::String,
2159
2160    /// Required. The logical name of the Connectivity Test in your project
2161    /// with the following restrictions:
2162    ///
2163    /// * Must contain only lowercase letters, numbers, and hyphens.
2164    /// * Must start with a letter.
2165    /// * Must be between 1-40 characters.
2166    /// * Must end with a number or a letter.
2167    /// * Must be unique within the customer project
2168    pub test_id: std::string::String,
2169
2170    /// Required. A `ConnectivityTest` resource
2171    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    /// Sets the value of [parent][crate::model::CreateConnectivityTestRequest::parent].
2182    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    /// Sets the value of [test_id][crate::model::CreateConnectivityTestRequest::test_id].
2188    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    /// Sets the value of [resource][crate::model::CreateConnectivityTestRequest::resource].
2194    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    /// Sets or clears the value of [resource][crate::model::CreateConnectivityTestRequest::resource].
2203    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/// Request for the `UpdateConnectivityTest` method.
2219#[derive(Clone, Default, PartialEq)]
2220#[non_exhaustive]
2221pub struct UpdateConnectivityTestRequest {
2222    /// Required. Mask of fields to update. At least one path must be supplied in
2223    /// this field.
2224    pub update_mask: std::option::Option<wkt::FieldMask>,
2225
2226    /// Required. Only fields specified in update_mask are updated.
2227    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    /// Sets the value of [update_mask][crate::model::UpdateConnectivityTestRequest::update_mask].
2238    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    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectivityTestRequest::update_mask].
2247    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    /// Sets the value of [resource][crate::model::UpdateConnectivityTestRequest::resource].
2256    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    /// Sets or clears the value of [resource][crate::model::UpdateConnectivityTestRequest::resource].
2265    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/// Request for the `DeleteConnectivityTest` method.
2281#[derive(Clone, Default, PartialEq)]
2282#[non_exhaustive]
2283pub struct DeleteConnectivityTestRequest {
2284    /// Required. Connectivity Test resource name using the form:
2285    /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
2286    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    /// Sets the value of [name][crate::model::DeleteConnectivityTestRequest::name].
2297    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/// Request for the `RerunConnectivityTest` method.
2310#[derive(Clone, Default, PartialEq)]
2311#[non_exhaustive]
2312pub struct RerunConnectivityTestRequest {
2313    /// Required. Connectivity Test resource name using the form:
2314    /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
2315    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    /// Sets the value of [name][crate::model::RerunConnectivityTestRequest::name].
2326    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/// Metadata describing an [Operation][google.longrunning.Operation]
2339///
2340/// [google.longrunning.Operation]: longrunning::model::Operation
2341#[derive(Clone, Default, PartialEq)]
2342#[non_exhaustive]
2343pub struct OperationMetadata {
2344    /// The time the operation was created.
2345    pub create_time: std::option::Option<wkt::Timestamp>,
2346
2347    /// The time the operation finished running.
2348    pub end_time: std::option::Option<wkt::Timestamp>,
2349
2350    /// Target of the operation - for example
2351    /// projects/project-1/locations/global/connectivityTests/test-1
2352    pub target: std::string::String,
2353
2354    /// Name of the verb executed by the operation.
2355    pub verb: std::string::String,
2356
2357    /// Human-readable status of the operation, if any.
2358    pub status_detail: std::string::String,
2359
2360    /// Specifies if cancellation was requested for the operation.
2361    pub cancel_requested: bool,
2362
2363    /// API version.
2364    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    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2375    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    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
2384    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    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2393    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    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
2402    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    /// Sets the value of [target][crate::model::OperationMetadata::target].
2411    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    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2417    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    /// Sets the value of [status_detail][crate::model::OperationMetadata::status_detail].
2423    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    /// Sets the value of [cancel_requested][crate::model::OperationMetadata::cancel_requested].
2429    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    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2435    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/// Trace represents one simulated packet forwarding path.
2448///
2449/// * Each trace contains multiple ordered steps.
2450/// * Each step is in a particular state with associated configuration.
2451/// * State is categorized as final or non-final states.
2452/// * Each final state has a reason associated.
2453/// * Each trace must end with a final state (the last step).
2454///
2455/// ```norust
2456///   |---------------------Trace----------------------|
2457///   Step1(State) Step2(State) ---  StepN(State(final))
2458/// ```
2459#[derive(Clone, Default, PartialEq)]
2460#[non_exhaustive]
2461pub struct Trace {
2462    /// Derived from the source and destination endpoints definition specified by
2463    /// user request, and validated by the data plane model.
2464    /// If there are multiple traces starting from different source locations, then
2465    /// the endpoint_info may be different between traces.
2466    pub endpoint_info: std::option::Option<crate::model::EndpointInfo>,
2467
2468    /// A trace of a test contains multiple steps from the initial state to the
2469    /// final state (delivered, dropped, forwarded, or aborted).
2470    ///
2471    /// The steps are ordered by the processing sequence within the simulated
2472    /// network state machine. It is critical to preserve the order of the steps
2473    /// and avoid reordering or sorting them.
2474    pub steps: std::vec::Vec<crate::model::Step>,
2475
2476    /// ID of trace. For forward traces, this ID is unique for each trace. For
2477    /// return traces, it matches ID of associated forward trace. A single forward
2478    /// trace can be associated with none, one or more than one return trace.
2479    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    /// Sets the value of [endpoint_info][crate::model::Trace::endpoint_info].
2490    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    /// Sets or clears the value of [endpoint_info][crate::model::Trace::endpoint_info].
2499    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    /// Sets the value of [steps][crate::model::Trace::steps].
2508    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    /// Sets the value of [forward_trace_id][crate::model::Trace::forward_trace_id].
2519    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/// A simulated forwarding path is composed of multiple steps.
2532/// Each step has a well-defined state and an associated configuration.
2533#[derive(Clone, Default, PartialEq)]
2534#[non_exhaustive]
2535pub struct Step {
2536    /// A description of the step. Usually this is a summary of the state.
2537    pub description: std::string::String,
2538
2539    /// Each step is in one of the pre-defined states.
2540    pub state: crate::model::step::State,
2541
2542    /// This is a step that leads to the final state Drop.
2543    pub causes_drop: bool,
2544
2545    /// Project ID that contains the configuration this step is validating.
2546    pub project_id: std::string::String,
2547
2548    /// Configuration or metadata associated with each step.
2549    /// The configuration is filtered based on viewer's permission. If a viewer
2550    /// has no permission to view the configuration in this step, for non-final
2551    /// states a special state is populated (VIEWER_PERMISSION_MISSING), and for
2552    /// final state the configuration is cleared.
2553    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    /// Sets the value of [description][crate::model::Step::description].
2564    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    /// Sets the value of [state][crate::model::Step::state].
2570    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    /// Sets the value of [causes_drop][crate::model::Step::causes_drop].
2576    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    /// Sets the value of [project_id][crate::model::Step::project_id].
2582    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    /// Sets the value of [step_info][crate::model::Step::step_info].
2588    ///
2589    /// Note that all the setters affecting `step_info` are mutually
2590    /// exclusive.
2591    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    /// The value of [step_info][crate::model::Step::step_info]
2602    /// if it holds a `Instance`, `None` if the field is not set or
2603    /// holds a different branch.
2604    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    /// Sets the value of [step_info][crate::model::Step::step_info]
2613    /// to hold a `Instance`.
2614    ///
2615    /// Note that all the setters affecting `step_info` are
2616    /// mutually exclusive.
2617    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    /// The value of [step_info][crate::model::Step::step_info]
2627    /// if it holds a `Firewall`, `None` if the field is not set or
2628    /// holds a different branch.
2629    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    /// Sets the value of [step_info][crate::model::Step::step_info]
2638    /// to hold a `Firewall`.
2639    ///
2640    /// Note that all the setters affecting `step_info` are
2641    /// mutually exclusive.
2642    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    /// The value of [step_info][crate::model::Step::step_info]
2652    /// if it holds a `Route`, `None` if the field is not set or
2653    /// holds a different branch.
2654    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    /// Sets the value of [step_info][crate::model::Step::step_info]
2663    /// to hold a `Route`.
2664    ///
2665    /// Note that all the setters affecting `step_info` are
2666    /// mutually exclusive.
2667    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    /// The value of [step_info][crate::model::Step::step_info]
2676    /// if it holds a `Endpoint`, `None` if the field is not set or
2677    /// holds a different branch.
2678    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    /// Sets the value of [step_info][crate::model::Step::step_info]
2687    /// to hold a `Endpoint`.
2688    ///
2689    /// Note that all the setters affecting `step_info` are
2690    /// mutually exclusive.
2691    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    /// The value of [step_info][crate::model::Step::step_info]
2701    /// if it holds a `GoogleService`, `None` if the field is not set or
2702    /// holds a different branch.
2703    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    /// Sets the value of [step_info][crate::model::Step::step_info]
2714    /// to hold a `GoogleService`.
2715    ///
2716    /// Note that all the setters affecting `step_info` are
2717    /// mutually exclusive.
2718    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    /// The value of [step_info][crate::model::Step::step_info]
2730    /// if it holds a `ForwardingRule`, `None` if the field is not set or
2731    /// holds a different branch.
2732    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    /// Sets the value of [step_info][crate::model::Step::step_info]
2743    /// to hold a `ForwardingRule`.
2744    ///
2745    /// Note that all the setters affecting `step_info` are
2746    /// mutually exclusive.
2747    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    /// The value of [step_info][crate::model::Step::step_info]
2759    /// if it holds a `HybridSubnet`, `None` if the field is not set or
2760    /// holds a different branch.
2761    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    /// Sets the value of [step_info][crate::model::Step::step_info]
2772    /// to hold a `HybridSubnet`.
2773    ///
2774    /// Note that all the setters affecting `step_info` are
2775    /// mutually exclusive.
2776    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    /// The value of [step_info][crate::model::Step::step_info]
2788    /// if it holds a `VpnGateway`, `None` if the field is not set or
2789    /// holds a different branch.
2790    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    /// Sets the value of [step_info][crate::model::Step::step_info]
2801    /// to hold a `VpnGateway`.
2802    ///
2803    /// Note that all the setters affecting `step_info` are
2804    /// mutually exclusive.
2805    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    /// The value of [step_info][crate::model::Step::step_info]
2815    /// if it holds a `VpnTunnel`, `None` if the field is not set or
2816    /// holds a different branch.
2817    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    /// Sets the value of [step_info][crate::model::Step::step_info]
2826    /// to hold a `VpnTunnel`.
2827    ///
2828    /// Note that all the setters affecting `step_info` are
2829    /// mutually exclusive.
2830    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    /// The value of [step_info][crate::model::Step::step_info]
2840    /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
2841    /// holds a different branch.
2842    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    /// Sets the value of [step_info][crate::model::Step::step_info]
2853    /// to hold a `InterconnectAttachment`.
2854    ///
2855    /// Note that all the setters affecting `step_info` are
2856    /// mutually exclusive.
2857    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    /// The value of [step_info][crate::model::Step::step_info]
2870    /// if it holds a `VpcConnector`, `None` if the field is not set or
2871    /// holds a different branch.
2872    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    /// Sets the value of [step_info][crate::model::Step::step_info]
2883    /// to hold a `VpcConnector`.
2884    ///
2885    /// Note that all the setters affecting `step_info` are
2886    /// mutually exclusive.
2887    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    /// The value of [step_info][crate::model::Step::step_info]
2899    /// if it holds a `DirectVpcEgressConnection`, `None` if the field is not set or
2900    /// holds a different branch.
2901    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    /// Sets the value of [step_info][crate::model::Step::step_info]
2914    /// to hold a `DirectVpcEgressConnection`.
2915    ///
2916    /// Note that all the setters affecting `step_info` are
2917    /// mutually exclusive.
2918    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    /// The value of [step_info][crate::model::Step::step_info]
2931    /// if it holds a `ServerlessExternalConnection`, `None` if the field is not set or
2932    /// holds a different branch.
2933    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    /// Sets the value of [step_info][crate::model::Step::step_info]
2946    /// to hold a `ServerlessExternalConnection`.
2947    ///
2948    /// Note that all the setters affecting `step_info` are
2949    /// mutually exclusive.
2950    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    /// The value of [step_info][crate::model::Step::step_info]
2963    /// if it holds a `Deliver`, `None` if the field is not set or
2964    /// holds a different branch.
2965    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    /// Sets the value of [step_info][crate::model::Step::step_info]
2974    /// to hold a `Deliver`.
2975    ///
2976    /// Note that all the setters affecting `step_info` are
2977    /// mutually exclusive.
2978    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    /// The value of [step_info][crate::model::Step::step_info]
2987    /// if it holds a `Forward`, `None` if the field is not set or
2988    /// holds a different branch.
2989    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    /// Sets the value of [step_info][crate::model::Step::step_info]
2998    /// to hold a `Forward`.
2999    ///
3000    /// Note that all the setters affecting `step_info` are
3001    /// mutually exclusive.
3002    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    /// The value of [step_info][crate::model::Step::step_info]
3011    /// if it holds a `Abort`, `None` if the field is not set or
3012    /// holds a different branch.
3013    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    /// Sets the value of [step_info][crate::model::Step::step_info]
3022    /// to hold a `Abort`.
3023    ///
3024    /// Note that all the setters affecting `step_info` are
3025    /// mutually exclusive.
3026    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    /// The value of [step_info][crate::model::Step::step_info]
3035    /// if it holds a `Drop`, `None` if the field is not set or
3036    /// holds a different branch.
3037    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    /// Sets the value of [step_info][crate::model::Step::step_info]
3046    /// to hold a `Drop`.
3047    ///
3048    /// Note that all the setters affecting `step_info` are
3049    /// mutually exclusive.
3050    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    /// The value of [step_info][crate::model::Step::step_info]
3059    /// if it holds a `LoadBalancer`, `None` if the field is not set or
3060    /// holds a different branch.
3061    #[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    /// Sets the value of [step_info][crate::model::Step::step_info]
3073    /// to hold a `LoadBalancer`.
3074    ///
3075    /// Note that all the setters affecting `step_info` are
3076    /// mutually exclusive.
3077    #[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    /// The value of [step_info][crate::model::Step::step_info]
3090    /// if it holds a `Network`, `None` if the field is not set or
3091    /// holds a different branch.
3092    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    /// Sets the value of [step_info][crate::model::Step::step_info]
3101    /// to hold a `Network`.
3102    ///
3103    /// Note that all the setters affecting `step_info` are
3104    /// mutually exclusive.
3105    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    /// The value of [step_info][crate::model::Step::step_info]
3114    /// if it holds a `GkeMaster`, `None` if the field is not set or
3115    /// holds a different branch.
3116    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    /// Sets the value of [step_info][crate::model::Step::step_info]
3125    /// to hold a `GkeMaster`.
3126    ///
3127    /// Note that all the setters affecting `step_info` are
3128    /// mutually exclusive.
3129    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    /// The value of [step_info][crate::model::Step::step_info]
3139    /// if it holds a `CloudSqlInstance`, `None` if the field is not set or
3140    /// holds a different branch.
3141    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    /// Sets the value of [step_info][crate::model::Step::step_info]
3152    /// to hold a `CloudSqlInstance`.
3153    ///
3154    /// Note that all the setters affecting `step_info` are
3155    /// mutually exclusive.
3156    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    /// The value of [step_info][crate::model::Step::step_info]
3168    /// if it holds a `RedisInstance`, `None` if the field is not set or
3169    /// holds a different branch.
3170    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    /// Sets the value of [step_info][crate::model::Step::step_info]
3181    /// to hold a `RedisInstance`.
3182    ///
3183    /// Note that all the setters affecting `step_info` are
3184    /// mutually exclusive.
3185    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    /// The value of [step_info][crate::model::Step::step_info]
3197    /// if it holds a `RedisCluster`, `None` if the field is not set or
3198    /// holds a different branch.
3199    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    /// Sets the value of [step_info][crate::model::Step::step_info]
3210    /// to hold a `RedisCluster`.
3211    ///
3212    /// Note that all the setters affecting `step_info` are
3213    /// mutually exclusive.
3214    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    /// The value of [step_info][crate::model::Step::step_info]
3226    /// if it holds a `CloudFunction`, `None` if the field is not set or
3227    /// holds a different branch.
3228    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    /// Sets the value of [step_info][crate::model::Step::step_info]
3239    /// to hold a `CloudFunction`.
3240    ///
3241    /// Note that all the setters affecting `step_info` are
3242    /// mutually exclusive.
3243    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    /// The value of [step_info][crate::model::Step::step_info]
3255    /// if it holds a `AppEngineVersion`, `None` if the field is not set or
3256    /// holds a different branch.
3257    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    /// Sets the value of [step_info][crate::model::Step::step_info]
3268    /// to hold a `AppEngineVersion`.
3269    ///
3270    /// Note that all the setters affecting `step_info` are
3271    /// mutually exclusive.
3272    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    /// The value of [step_info][crate::model::Step::step_info]
3284    /// if it holds a `CloudRunRevision`, `None` if the field is not set or
3285    /// holds a different branch.
3286    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    /// Sets the value of [step_info][crate::model::Step::step_info]
3297    /// to hold a `CloudRunRevision`.
3298    ///
3299    /// Note that all the setters affecting `step_info` are
3300    /// mutually exclusive.
3301    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    /// The value of [step_info][crate::model::Step::step_info]
3313    /// if it holds a `Nat`, `None` if the field is not set or
3314    /// holds a different branch.
3315    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    /// Sets the value of [step_info][crate::model::Step::step_info]
3324    /// to hold a `Nat`.
3325    ///
3326    /// Note that all the setters affecting `step_info` are
3327    /// mutually exclusive.
3328    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    /// The value of [step_info][crate::model::Step::step_info]
3337    /// if it holds a `ProxyConnection`, `None` if the field is not set or
3338    /// holds a different branch.
3339    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    /// Sets the value of [step_info][crate::model::Step::step_info]
3350    /// to hold a `ProxyConnection`.
3351    ///
3352    /// Note that all the setters affecting `step_info` are
3353    /// mutually exclusive.
3354    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    /// The value of [step_info][crate::model::Step::step_info]
3366    /// if it holds a `LoadBalancerBackendInfo`, `None` if the field is not set or
3367    /// holds a different branch.
3368    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    /// Sets the value of [step_info][crate::model::Step::step_info]
3381    /// to hold a `LoadBalancerBackendInfo`.
3382    ///
3383    /// Note that all the setters affecting `step_info` are
3384    /// mutually exclusive.
3385    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    /// The value of [step_info][crate::model::Step::step_info]
3398    /// if it holds a `StorageBucket`, `None` if the field is not set or
3399    /// holds a different branch.
3400    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    /// Sets the value of [step_info][crate::model::Step::step_info]
3411    /// to hold a `StorageBucket`.
3412    ///
3413    /// Note that all the setters affecting `step_info` are
3414    /// mutually exclusive.
3415    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    /// The value of [step_info][crate::model::Step::step_info]
3427    /// if it holds a `ServerlessNeg`, `None` if the field is not set or
3428    /// holds a different branch.
3429    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    /// Sets the value of [step_info][crate::model::Step::step_info]
3440    /// to hold a `ServerlessNeg`.
3441    ///
3442    /// Note that all the setters affecting `step_info` are
3443    /// mutually exclusive.
3444    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
3462/// Defines additional types related to [Step].
3463pub mod step {
3464    #[allow(unused_imports)]
3465    use super::*;
3466
3467    /// Type of states that are defined in the network state machine.
3468    /// Each step in the packet trace is in a specific state.
3469    ///
3470    /// # Working with unknown values
3471    ///
3472    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3473    /// additional enum variants at any time. Adding new variants is not considered
3474    /// a breaking change. Applications should write their code in anticipation of:
3475    ///
3476    /// - New values appearing in future releases of the client library, **and**
3477    /// - New values received dynamically, without application changes.
3478    ///
3479    /// Please consult the [Working with enums] section in the user guide for some
3480    /// guidelines.
3481    ///
3482    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3483    #[derive(Clone, Debug, PartialEq)]
3484    #[non_exhaustive]
3485    pub enum State {
3486        /// Unspecified state.
3487        Unspecified,
3488        /// Initial state: packet originating from a Compute Engine instance.
3489        /// An InstanceInfo is populated with starting instance information.
3490        StartFromInstance,
3491        /// Initial state: packet originating from the internet.
3492        /// The endpoint information is populated.
3493        StartFromInternet,
3494        /// Initial state: packet originating from a Google service.
3495        /// The google_service information is populated.
3496        StartFromGoogleService,
3497        /// Initial state: packet originating from a VPC or on-premises network
3498        /// with internal source IP.
3499        /// If the source is a VPC network visible to the user, a NetworkInfo
3500        /// is populated with details of the network.
3501        StartFromPrivateNetwork,
3502        /// Initial state: packet originating from a Google Kubernetes Engine cluster
3503        /// master. A GKEMasterInfo is populated with starting instance information.
3504        StartFromGkeMaster,
3505        /// Initial state: packet originating from a Cloud SQL instance.
3506        /// A CloudSQLInstanceInfo is populated with starting instance information.
3507        StartFromCloudSqlInstance,
3508        /// Initial state: packet originating from a Redis instance.
3509        /// A RedisInstanceInfo is populated with starting instance information.
3510        StartFromRedisInstance,
3511        /// Initial state: packet originating from a Redis Cluster.
3512        /// A RedisClusterInfo is populated with starting Cluster information.
3513        StartFromRedisCluster,
3514        /// Initial state: packet originating from a Cloud Function.
3515        /// A CloudFunctionInfo is populated with starting function information.
3516        StartFromCloudFunction,
3517        /// Initial state: packet originating from an App Engine service version.
3518        /// An AppEngineVersionInfo is populated with starting version information.
3519        StartFromAppEngineVersion,
3520        /// Initial state: packet originating from a Cloud Run revision.
3521        /// A CloudRunRevisionInfo is populated with starting revision information.
3522        StartFromCloudRunRevision,
3523        /// Initial state: packet originating from a Storage Bucket. Used only for
3524        /// return traces.
3525        /// The storage_bucket information is populated.
3526        StartFromStorageBucket,
3527        /// Initial state: packet originating from a published service that uses
3528        /// Private Service Connect. Used only for return traces.
3529        StartFromPscPublishedService,
3530        /// Initial state: packet originating from a serverless network endpoint
3531        /// group backend. Used only for return traces.
3532        /// The serverless_neg information is populated.
3533        StartFromServerlessNeg,
3534        /// Config checking state: verify ingress firewall rule.
3535        ApplyIngressFirewallRule,
3536        /// Config checking state: verify egress firewall rule.
3537        ApplyEgressFirewallRule,
3538        /// Config checking state: verify route.
3539        ApplyRoute,
3540        /// Config checking state: match forwarding rule.
3541        ApplyForwardingRule,
3542        /// Config checking state: verify load balancer backend configuration.
3543        AnalyzeLoadBalancerBackend,
3544        /// Config checking state: packet sent or received under foreign IP
3545        /// address and allowed.
3546        SpoofingApproved,
3547        /// Forwarding state: arriving at a Compute Engine instance.
3548        ArriveAtInstance,
3549        /// Forwarding state: arriving at a Compute Engine internal load balancer.
3550        #[deprecated]
3551        ArriveAtInternalLoadBalancer,
3552        /// Forwarding state: arriving at a Compute Engine external load balancer.
3553        #[deprecated]
3554        ArriveAtExternalLoadBalancer,
3555        /// Forwarding state: arriving at a hybrid subnet. Appropriate routing
3556        /// configuration will be determined here.
3557        ArriveAtHybridSubnet,
3558        /// Forwarding state: arriving at a Cloud VPN gateway.
3559        ArriveAtVpnGateway,
3560        /// Forwarding state: arriving at a Cloud VPN tunnel.
3561        ArriveAtVpnTunnel,
3562        /// Forwarding state: arriving at an interconnect attachment.
3563        ArriveAtInterconnectAttachment,
3564        /// Forwarding state: arriving at a VPC connector.
3565        ArriveAtVpcConnector,
3566        /// Forwarding state: for packets originating from a serverless endpoint
3567        /// forwarded through Direct VPC egress.
3568        DirectVpcEgressConnection,
3569        /// Forwarding state: for packets originating from a serverless endpoint
3570        /// forwarded through public (external) connectivity.
3571        ServerlessExternalConnection,
3572        /// Transition state: packet header translated. The `nat` field is populated
3573        /// with the translation information.
3574        Nat,
3575        /// Transition state: original connection is terminated and a new proxied
3576        /// connection is initiated.
3577        ProxyConnection,
3578        /// Final state: packet could be delivered.
3579        Deliver,
3580        /// Final state: packet could be dropped.
3581        Drop,
3582        /// Final state: packet could be forwarded to a network with an unknown
3583        /// configuration.
3584        Forward,
3585        /// Final state: analysis is aborted.
3586        Abort,
3587        /// Special state: viewer of the test result does not have permission to
3588        /// see the configuration in this step.
3589        ViewerPermissionMissing,
3590        /// If set, the enum was initialized with an unknown value.
3591        ///
3592        /// Applications can examine the value using [State::value] or
3593        /// [State::name].
3594        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        /// Gets the enum value.
3607        ///
3608        /// Returns `None` if the enum contains an unknown value deserialized from
3609        /// the string representation of enums.
3610        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        /// Gets the enum value as a string.
3655        ///
3656        /// Returns `None` if the enum contains an unknown value deserialized from
3657        /// the integer representation of enums.
3658        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    /// Configuration or metadata associated with each step.
3914    /// The configuration is filtered based on viewer's permission. If a viewer
3915    /// has no permission to view the configuration in this step, for non-final
3916    /// states a special state is populated (VIEWER_PERMISSION_MISSING), and for
3917    /// final state the configuration is cleared.
3918    #[derive(Clone, Debug, PartialEq)]
3919    #[non_exhaustive]
3920    pub enum StepInfo {
3921        /// Display information of a Compute Engine instance.
3922        Instance(std::boxed::Box<crate::model::InstanceInfo>),
3923        /// Display information of a Compute Engine firewall rule.
3924        Firewall(std::boxed::Box<crate::model::FirewallInfo>),
3925        /// Display information of a Compute Engine route.
3926        Route(std::boxed::Box<crate::model::RouteInfo>),
3927        /// Display information of the source and destination under analysis.
3928        /// The endpoint information in an intermediate state may differ with the
3929        /// initial input, as it might be modified by state like NAT,
3930        /// or Connection Proxy.
3931        Endpoint(std::boxed::Box<crate::model::EndpointInfo>),
3932        /// Display information of a Google service
3933        GoogleService(std::boxed::Box<crate::model::GoogleServiceInfo>),
3934        /// Display information of a Compute Engine forwarding rule.
3935        ForwardingRule(std::boxed::Box<crate::model::ForwardingRuleInfo>),
3936        /// Display information of a hybrid subnet.
3937        HybridSubnet(std::boxed::Box<crate::model::HybridSubnetInfo>),
3938        /// Display information of a Compute Engine VPN gateway.
3939        VpnGateway(std::boxed::Box<crate::model::VpnGatewayInfo>),
3940        /// Display information of a Compute Engine VPN tunnel.
3941        VpnTunnel(std::boxed::Box<crate::model::VpnTunnelInfo>),
3942        /// Display information of an interconnect attachment.
3943        InterconnectAttachment(std::boxed::Box<crate::model::InterconnectAttachmentInfo>),
3944        /// Display information of a VPC connector.
3945        VpcConnector(std::boxed::Box<crate::model::VpcConnectorInfo>),
3946        /// Display information of a serverless direct VPC egress connection.
3947        DirectVpcEgressConnection(std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>),
3948        /// Display information of a serverless public (external) connection.
3949        ServerlessExternalConnection(
3950            std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>,
3951        ),
3952        /// Display information of the final state "deliver" and reason.
3953        Deliver(std::boxed::Box<crate::model::DeliverInfo>),
3954        /// Display information of the final state "forward" and reason.
3955        Forward(std::boxed::Box<crate::model::ForwardInfo>),
3956        /// Display information of the final state "abort" and reason.
3957        Abort(std::boxed::Box<crate::model::AbortInfo>),
3958        /// Display information of the final state "drop" and reason.
3959        Drop(std::boxed::Box<crate::model::DropInfo>),
3960        /// Display information of the load balancers. Deprecated in favor of the
3961        /// `load_balancer_backend_info` field, not used in new tests.
3962        #[deprecated]
3963        LoadBalancer(std::boxed::Box<crate::model::LoadBalancerInfo>),
3964        /// Display information of a Google Cloud network.
3965        Network(std::boxed::Box<crate::model::NetworkInfo>),
3966        /// Display information of a Google Kubernetes Engine cluster master.
3967        GkeMaster(std::boxed::Box<crate::model::GKEMasterInfo>),
3968        /// Display information of a Cloud SQL instance.
3969        CloudSqlInstance(std::boxed::Box<crate::model::CloudSQLInstanceInfo>),
3970        /// Display information of a Redis Instance.
3971        RedisInstance(std::boxed::Box<crate::model::RedisInstanceInfo>),
3972        /// Display information of a Redis Cluster.
3973        RedisCluster(std::boxed::Box<crate::model::RedisClusterInfo>),
3974        /// Display information of a Cloud Function.
3975        CloudFunction(std::boxed::Box<crate::model::CloudFunctionInfo>),
3976        /// Display information of an App Engine service version.
3977        AppEngineVersion(std::boxed::Box<crate::model::AppEngineVersionInfo>),
3978        /// Display information of a Cloud Run revision.
3979        CloudRunRevision(std::boxed::Box<crate::model::CloudRunRevisionInfo>),
3980        /// Display information of a NAT.
3981        Nat(std::boxed::Box<crate::model::NatInfo>),
3982        /// Display information of a ProxyConnection.
3983        ProxyConnection(std::boxed::Box<crate::model::ProxyConnectionInfo>),
3984        /// Display information of a specific load balancer backend.
3985        LoadBalancerBackendInfo(std::boxed::Box<crate::model::LoadBalancerBackendInfo>),
3986        /// Display information of a Storage Bucket. Used only for return traces.
3987        StorageBucket(std::boxed::Box<crate::model::StorageBucketInfo>),
3988        /// Display information of a Serverless network endpoint group backend. Used
3989        /// only for return traces.
3990        ServerlessNeg(std::boxed::Box<crate::model::ServerlessNegInfo>),
3991    }
3992}
3993
3994/// For display only. Metadata associated with a Compute Engine instance.
3995#[derive(Clone, Default, PartialEq)]
3996#[non_exhaustive]
3997pub struct InstanceInfo {
3998    /// Name of a Compute Engine instance.
3999    pub display_name: std::string::String,
4000
4001    /// URI of a Compute Engine instance.
4002    pub uri: std::string::String,
4003
4004    /// Name of the network interface of a Compute Engine instance.
4005    pub interface: std::string::String,
4006
4007    /// URI of a Compute Engine network.
4008    pub network_uri: std::string::String,
4009
4010    /// Internal IP address of the network interface.
4011    pub internal_ip: std::string::String,
4012
4013    /// External IP address of the network interface.
4014    pub external_ip: std::string::String,
4015
4016    /// Network tags configured on the instance.
4017    pub network_tags: std::vec::Vec<std::string::String>,
4018
4019    /// Service account authorized for the instance.
4020    #[deprecated]
4021    pub service_account: std::string::String,
4022
4023    /// URI of the PSC network attachment the NIC is attached to (if relevant).
4024    pub psc_network_attachment_uri: std::string::String,
4025
4026    /// Indicates whether the Compute Engine instance is running.
4027    /// Deprecated: use the `status` field instead.
4028    #[deprecated]
4029    pub running: bool,
4030
4031    /// The status of the instance.
4032    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    /// Sets the value of [display_name][crate::model::InstanceInfo::display_name].
4043    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    /// Sets the value of [uri][crate::model::InstanceInfo::uri].
4049    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    /// Sets the value of [interface][crate::model::InstanceInfo::interface].
4055    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    /// Sets the value of [network_uri][crate::model::InstanceInfo::network_uri].
4061    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    /// Sets the value of [internal_ip][crate::model::InstanceInfo::internal_ip].
4067    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    /// Sets the value of [external_ip][crate::model::InstanceInfo::external_ip].
4073    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    /// Sets the value of [network_tags][crate::model::InstanceInfo::network_tags].
4079    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    /// Sets the value of [service_account][crate::model::InstanceInfo::service_account].
4090    #[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    /// Sets the value of [psc_network_attachment_uri][crate::model::InstanceInfo::psc_network_attachment_uri].
4097    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    /// Sets the value of [running][crate::model::InstanceInfo::running].
4106    #[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    /// Sets the value of [status][crate::model::InstanceInfo::status].
4113    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
4128/// Defines additional types related to [InstanceInfo].
4129pub mod instance_info {
4130    #[allow(unused_imports)]
4131    use super::*;
4132
4133    /// The status of the instance. We treat all states other than "RUNNING" as
4134    /// not running.
4135    ///
4136    /// # Working with unknown values
4137    ///
4138    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4139    /// additional enum variants at any time. Adding new variants is not considered
4140    /// a breaking change. Applications should write their code in anticipation of:
4141    ///
4142    /// - New values appearing in future releases of the client library, **and**
4143    /// - New values received dynamically, without application changes.
4144    ///
4145    /// Please consult the [Working with enums] section in the user guide for some
4146    /// guidelines.
4147    ///
4148    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4149    #[derive(Clone, Debug, PartialEq)]
4150    #[non_exhaustive]
4151    pub enum Status {
4152        /// Default unspecified value.
4153        Unspecified,
4154        /// The instance is running.
4155        Running,
4156        /// The instance has any status other than "RUNNING".
4157        NotRunning,
4158        /// If set, the enum was initialized with an unknown value.
4159        ///
4160        /// Applications can examine the value using [Status::value] or
4161        /// [Status::name].
4162        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        /// Gets the enum value.
4175        ///
4176        /// Returns `None` if the enum contains an unknown value deserialized from
4177        /// the string representation of enums.
4178        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        /// Gets the enum value as a string.
4188        ///
4189        /// Returns `None` if the enum contains an unknown value deserialized from
4190        /// the integer representation of enums.
4191        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/// For display only. Metadata associated with a Compute Engine network.
4268#[derive(Clone, Default, PartialEq)]
4269#[non_exhaustive]
4270pub struct NetworkInfo {
4271    /// Name of a Compute Engine network.
4272    pub display_name: std::string::String,
4273
4274    /// URI of a Compute Engine network.
4275    pub uri: std::string::String,
4276
4277    /// URI of the subnet matching the source IP address of the test.
4278    pub matched_subnet_uri: std::string::String,
4279
4280    /// The IP range of the subnet matching the source IP address of the test.
4281    pub matched_ip_range: std::string::String,
4282
4283    /// The region of the subnet matching the source IP address of the test.
4284    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    /// Sets the value of [display_name][crate::model::NetworkInfo::display_name].
4295    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    /// Sets the value of [uri][crate::model::NetworkInfo::uri].
4301    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    /// Sets the value of [matched_subnet_uri][crate::model::NetworkInfo::matched_subnet_uri].
4307    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    /// Sets the value of [matched_ip_range][crate::model::NetworkInfo::matched_ip_range].
4316    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    /// Sets the value of [region][crate::model::NetworkInfo::region].
4325    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/// For display only. Metadata associated with a VPC firewall rule, an implied
4338/// VPC firewall rule, or a firewall policy rule.
4339#[derive(Clone, Default, PartialEq)]
4340#[non_exhaustive]
4341pub struct FirewallInfo {
4342    /// The display name of the firewall rule. This field might be empty for
4343    /// firewall policy rules.
4344    pub display_name: std::string::String,
4345
4346    /// The URI of the firewall rule. This field is not applicable to implied
4347    /// VPC firewall rules.
4348    pub uri: std::string::String,
4349
4350    /// Possible values: INGRESS, EGRESS
4351    pub direction: std::string::String,
4352
4353    /// Possible values: ALLOW, DENY, APPLY_SECURITY_PROFILE_GROUP
4354    pub action: std::string::String,
4355
4356    /// The priority of the firewall rule.
4357    pub priority: i32,
4358
4359    /// The URI of the VPC network that the firewall rule is associated with.
4360    /// This field is not applicable to hierarchical firewall policy rules.
4361    pub network_uri: std::string::String,
4362
4363    /// The target tags defined by the VPC firewall rule. This field is not
4364    /// applicable to firewall policy rules.
4365    pub target_tags: std::vec::Vec<std::string::String>,
4366
4367    /// The target service accounts specified by the firewall rule.
4368    pub target_service_accounts: std::vec::Vec<std::string::String>,
4369
4370    /// The name of the firewall policy that this rule is associated with.
4371    /// This field is not applicable to VPC firewall rules and implied VPC firewall
4372    /// rules.
4373    pub policy: std::string::String,
4374
4375    /// The URI of the firewall policy that this rule is associated with.
4376    /// This field is not applicable to VPC firewall rules and implied VPC firewall
4377    /// rules.
4378    pub policy_uri: std::string::String,
4379
4380    /// The firewall rule's type.
4381    pub firewall_rule_type: crate::model::firewall_info::FirewallRuleType,
4382
4383    /// The priority of the firewall policy that this rule is associated with.
4384    /// This field is not applicable to VPC firewall rules and implied VPC firewall
4385    /// rules.
4386    pub policy_priority: i32,
4387
4388    /// Target type of the firewall rule.
4389    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    /// Sets the value of [display_name][crate::model::FirewallInfo::display_name].
4400    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    /// Sets the value of [uri][crate::model::FirewallInfo::uri].
4406    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    /// Sets the value of [direction][crate::model::FirewallInfo::direction].
4412    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    /// Sets the value of [action][crate::model::FirewallInfo::action].
4418    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    /// Sets the value of [priority][crate::model::FirewallInfo::priority].
4424    pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4425        self.priority = v.into();
4426        self
4427    }
4428
4429    /// Sets the value of [network_uri][crate::model::FirewallInfo::network_uri].
4430    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    /// Sets the value of [target_tags][crate::model::FirewallInfo::target_tags].
4436    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    /// Sets the value of [target_service_accounts][crate::model::FirewallInfo::target_service_accounts].
4447    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    /// Sets the value of [policy][crate::model::FirewallInfo::policy].
4458    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    /// Sets the value of [policy_uri][crate::model::FirewallInfo::policy_uri].
4464    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    /// Sets the value of [firewall_rule_type][crate::model::FirewallInfo::firewall_rule_type].
4470    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    /// Sets the value of [policy_priority][crate::model::FirewallInfo::policy_priority].
4481    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    /// Sets the value of [target_type][crate::model::FirewallInfo::target_type].
4487    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
4502/// Defines additional types related to [FirewallInfo].
4503pub mod firewall_info {
4504    #[allow(unused_imports)]
4505    use super::*;
4506
4507    /// The firewall rule's type.
4508    ///
4509    /// # Working with unknown values
4510    ///
4511    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4512    /// additional enum variants at any time. Adding new variants is not considered
4513    /// a breaking change. Applications should write their code in anticipation of:
4514    ///
4515    /// - New values appearing in future releases of the client library, **and**
4516    /// - New values received dynamically, without application changes.
4517    ///
4518    /// Please consult the [Working with enums] section in the user guide for some
4519    /// guidelines.
4520    ///
4521    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4522    #[derive(Clone, Debug, PartialEq)]
4523    #[non_exhaustive]
4524    pub enum FirewallRuleType {
4525        /// Unspecified type.
4526        Unspecified,
4527        /// Hierarchical firewall policy rule. For details, see
4528        /// [Hierarchical firewall policies
4529        /// overview](https://cloud.google.com/vpc/docs/firewall-policies).
4530        HierarchicalFirewallPolicyRule,
4531        /// VPC firewall rule. For details, see
4532        /// [VPC firewall rules
4533        /// overview](https://cloud.google.com/vpc/docs/firewalls).
4534        VpcFirewallRule,
4535        /// Implied VPC firewall rule. For details, see
4536        /// [Implied
4537        /// rules](https://cloud.google.com/vpc/docs/firewalls#default_firewall_rules).
4538        ImpliedVpcFirewallRule,
4539        /// Implicit firewall rules that are managed by serverless VPC access to
4540        /// allow ingress access. They are not visible in the Google Cloud console.
4541        /// For details, see [VPC connector's implicit
4542        /// rules](https://cloud.google.com/functions/docs/networking/connecting-vpc#restrict-access).
4543        ServerlessVpcAccessManagedFirewallRule,
4544        /// Global network firewall policy rule.
4545        /// For details, see [Network firewall
4546        /// policies](https://cloud.google.com/vpc/docs/network-firewall-policies).
4547        NetworkFirewallPolicyRule,
4548        /// Regional network firewall policy rule.
4549        /// For details, see [Regional network firewall
4550        /// policies](https://cloud.google.com/firewall/docs/regional-firewall-policies).
4551        NetworkRegionalFirewallPolicyRule,
4552        /// Firewall policy rule containing attributes not yet supported in
4553        /// Connectivity tests. Firewall analysis is skipped if such a rule can
4554        /// potentially be matched. Please see the [list of unsupported
4555        /// configurations](https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/concepts/overview#unsupported-configs).
4556        UnsupportedFirewallPolicyRule,
4557        /// Tracking state for response traffic created when request traffic goes
4558        /// through allow firewall rule.
4559        /// For details, see [firewall rules
4560        /// specifications](https://cloud.google.com/firewall/docs/firewalls#specifications)
4561        TrackingState,
4562        /// Firewall analysis was skipped due to executing Connectivity Test in the
4563        /// BypassFirewallChecks mode
4564        AnalysisSkipped,
4565        /// If set, the enum was initialized with an unknown value.
4566        ///
4567        /// Applications can examine the value using [FirewallRuleType::value] or
4568        /// [FirewallRuleType::name].
4569        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        /// Gets the enum value.
4582        ///
4583        /// Returns `None` if the enum contains an unknown value deserialized from
4584        /// the string representation of enums.
4585        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        /// Gets the enum value as a string.
4602        ///
4603        /// Returns `None` if the enum contains an unknown value deserialized from
4604        /// the integer representation of enums.
4605        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    /// Target type of the firewall rule.
4723    ///
4724    /// # Working with unknown values
4725    ///
4726    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4727    /// additional enum variants at any time. Adding new variants is not considered
4728    /// a breaking change. Applications should write their code in anticipation of:
4729    ///
4730    /// - New values appearing in future releases of the client library, **and**
4731    /// - New values received dynamically, without application changes.
4732    ///
4733    /// Please consult the [Working with enums] section in the user guide for some
4734    /// guidelines.
4735    ///
4736    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4737    #[derive(Clone, Debug, PartialEq)]
4738    #[non_exhaustive]
4739    pub enum TargetType {
4740        /// Target type is not specified. In this case we treat the rule as applying
4741        /// to INSTANCES target type.
4742        Unspecified,
4743        /// Firewall rule applies to instances.
4744        Instances,
4745        /// Firewall rule applies to internal managed load balancers.
4746        InternalManagedLb,
4747        /// If set, the enum was initialized with an unknown value.
4748        ///
4749        /// Applications can examine the value using [TargetType::value] or
4750        /// [TargetType::name].
4751        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        /// Gets the enum value.
4764        ///
4765        /// Returns `None` if the enum contains an unknown value deserialized from
4766        /// the string representation of enums.
4767        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        /// Gets the enum value as a string.
4777        ///
4778        /// Returns `None` if the enum contains an unknown value deserialized from
4779        /// the integer representation of enums.
4780        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/// For display only. Metadata associated with a Compute Engine route.
4857#[derive(Clone, Default, PartialEq)]
4858#[non_exhaustive]
4859pub struct RouteInfo {
4860    /// Type of route.
4861    pub route_type: crate::model::route_info::RouteType,
4862
4863    /// Type of next hop.
4864    pub next_hop_type: crate::model::route_info::NextHopType,
4865
4866    /// Indicates where route is applicable. Deprecated, routes with NCC_HUB scope
4867    /// are not included in the trace in new tests.
4868    #[deprecated]
4869    pub route_scope: crate::model::route_info::RouteScope,
4870
4871    /// Name of a route.
4872    pub display_name: std::string::String,
4873
4874    /// URI of a route. SUBNET, STATIC, PEERING_SUBNET (only for peering network)
4875    /// and POLICY_BASED routes only.
4876    pub uri: std::string::String,
4877
4878    /// Region of the route. DYNAMIC, PEERING_DYNAMIC, POLICY_BASED and ADVERTISED
4879    /// routes only. If set for POLICY_BASED route, this is a region of VLAN
4880    /// attachments for Cloud Interconnect the route applies to.
4881    pub region: std::string::String,
4882
4883    /// Destination IP range of the route.
4884    pub dest_ip_range: std::string::String,
4885
4886    /// String type of the next hop of the route (for example, "VPN tunnel").
4887    /// Deprecated in favor of the next_hop_type and next_hop_uri fields, not used
4888    /// in new tests.
4889    #[deprecated]
4890    pub next_hop: std::string::String,
4891
4892    /// URI of a VPC network where route is located.
4893    pub network_uri: std::string::String,
4894
4895    /// Priority of the route.
4896    pub priority: i32,
4897
4898    /// Instance tags of the route.
4899    pub instance_tags: std::vec::Vec<std::string::String>,
4900
4901    /// Source IP address range of the route. POLICY_BASED routes only.
4902    pub src_ip_range: std::string::String,
4903
4904    /// Destination port ranges of the route. POLICY_BASED routes only.
4905    pub dest_port_ranges: std::vec::Vec<std::string::String>,
4906
4907    /// Source port ranges of the route. POLICY_BASED routes only.
4908    pub src_port_ranges: std::vec::Vec<std::string::String>,
4909
4910    /// Protocols of the route. POLICY_BASED routes only.
4911    pub protocols: std::vec::Vec<std::string::String>,
4912
4913    /// URI of the NCC Hub the route is advertised by. PEERING_SUBNET and
4914    /// PEERING_DYNAMIC routes that are advertised by NCC Hub only.
4915    pub ncc_hub_uri: std::option::Option<std::string::String>,
4916
4917    /// URI of the destination NCC Spoke. PEERING_SUBNET and PEERING_DYNAMIC routes
4918    /// that are advertised by NCC Hub only.
4919    pub ncc_spoke_uri: std::option::Option<std::string::String>,
4920
4921    /// For ADVERTISED dynamic routes, the URI of the Cloud Router that advertised
4922    /// the corresponding IP prefix.
4923    pub advertised_route_source_router_uri: std::option::Option<std::string::String>,
4924
4925    /// For ADVERTISED routes, the URI of their next hop, i.e. the URI of the
4926    /// hybrid endpoint (VPN tunnel, Interconnect attachment, NCC router appliance)
4927    /// the advertised prefix is advertised through, or URI of the source peered
4928    /// network. Deprecated in favor of the next_hop_uri field, not used in new
4929    /// tests.
4930    #[deprecated]
4931    pub advertised_route_next_hop_uri: std::option::Option<std::string::String>,
4932
4933    /// URI of the next hop resource.
4934    pub next_hop_uri: std::string::String,
4935
4936    /// URI of a VPC network where the next hop resource is located.
4937    pub next_hop_network_uri: std::string::String,
4938
4939    /// For PEERING_SUBNET and PEERING_STATIC routes, the URI of the originating
4940    /// SUBNET/STATIC route.
4941    pub originating_route_uri: std::string::String,
4942
4943    /// For PEERING_SUBNET, PEERING_STATIC and PEERING_DYNAMIC routes, the name of
4944    /// the originating SUBNET/STATIC/DYNAMIC route.
4945    pub originating_route_display_name: std::string::String,
4946
4947    /// For PEERING_SUBNET and PEERING_DYNAMIC routes that are advertised by NCC
4948    /// Hub, the URI of the corresponding route in NCC Hub's routing table.
4949    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    /// Sets the value of [route_type][crate::model::RouteInfo::route_type].
4960    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    /// Sets the value of [next_hop_type][crate::model::RouteInfo::next_hop_type].
4969    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    /// Sets the value of [route_scope][crate::model::RouteInfo::route_scope].
4978    #[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    /// Sets the value of [display_name][crate::model::RouteInfo::display_name].
4988    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    /// Sets the value of [uri][crate::model::RouteInfo::uri].
4994    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    /// Sets the value of [region][crate::model::RouteInfo::region].
5000    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    /// Sets the value of [dest_ip_range][crate::model::RouteInfo::dest_ip_range].
5006    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    /// Sets the value of [next_hop][crate::model::RouteInfo::next_hop].
5012    #[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    /// Sets the value of [network_uri][crate::model::RouteInfo::network_uri].
5019    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    /// Sets the value of [priority][crate::model::RouteInfo::priority].
5025    pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5026        self.priority = v.into();
5027        self
5028    }
5029
5030    /// Sets the value of [instance_tags][crate::model::RouteInfo::instance_tags].
5031    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    /// Sets the value of [src_ip_range][crate::model::RouteInfo::src_ip_range].
5042    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    /// Sets the value of [dest_port_ranges][crate::model::RouteInfo::dest_port_ranges].
5048    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    /// Sets the value of [src_port_ranges][crate::model::RouteInfo::src_port_ranges].
5059    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    /// Sets the value of [protocols][crate::model::RouteInfo::protocols].
5070    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    /// Sets the value of [ncc_hub_uri][crate::model::RouteInfo::ncc_hub_uri].
5081    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    /// Sets or clears the value of [ncc_hub_uri][crate::model::RouteInfo::ncc_hub_uri].
5090    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    /// Sets the value of [ncc_spoke_uri][crate::model::RouteInfo::ncc_spoke_uri].
5099    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    /// Sets or clears the value of [ncc_spoke_uri][crate::model::RouteInfo::ncc_spoke_uri].
5108    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    /// Sets the value of [advertised_route_source_router_uri][crate::model::RouteInfo::advertised_route_source_router_uri].
5117    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    /// Sets or clears the value of [advertised_route_source_router_uri][crate::model::RouteInfo::advertised_route_source_router_uri].
5126    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    /// Sets the value of [advertised_route_next_hop_uri][crate::model::RouteInfo::advertised_route_next_hop_uri].
5138    #[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    /// Sets or clears the value of [advertised_route_next_hop_uri][crate::model::RouteInfo::advertised_route_next_hop_uri].
5148    #[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    /// Sets the value of [next_hop_uri][crate::model::RouteInfo::next_hop_uri].
5161    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    /// Sets the value of [next_hop_network_uri][crate::model::RouteInfo::next_hop_network_uri].
5167    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    /// Sets the value of [originating_route_uri][crate::model::RouteInfo::originating_route_uri].
5176    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    /// Sets the value of [originating_route_display_name][crate::model::RouteInfo::originating_route_display_name].
5185    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    /// Sets the value of [ncc_hub_route_uri][crate::model::RouteInfo::ncc_hub_route_uri].
5194    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
5209/// Defines additional types related to [RouteInfo].
5210pub mod route_info {
5211    #[allow(unused_imports)]
5212    use super::*;
5213
5214    /// Type of route:
5215    ///
5216    /// # Working with unknown values
5217    ///
5218    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5219    /// additional enum variants at any time. Adding new variants is not considered
5220    /// a breaking change. Applications should write their code in anticipation of:
5221    ///
5222    /// - New values appearing in future releases of the client library, **and**
5223    /// - New values received dynamically, without application changes.
5224    ///
5225    /// Please consult the [Working with enums] section in the user guide for some
5226    /// guidelines.
5227    ///
5228    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5229    #[derive(Clone, Debug, PartialEq)]
5230    #[non_exhaustive]
5231    pub enum RouteType {
5232        /// Unspecified type. Default value.
5233        Unspecified,
5234        /// Route is a subnet route automatically created by the system.
5235        Subnet,
5236        /// Static route created by the user, including the default route to the
5237        /// internet.
5238        Static,
5239        /// Dynamic route exchanged between BGP peers.
5240        Dynamic,
5241        /// A subnet route received from peering network or NCC Hub.
5242        PeeringSubnet,
5243        /// A static route received from peering network.
5244        PeeringStatic,
5245        /// A dynamic route received from peering network or NCC Hub.
5246        PeeringDynamic,
5247        /// Policy based route.
5248        PolicyBased,
5249        /// Advertised route. Synthetic route which is used to transition from the
5250        /// StartFromPrivateNetwork state in Connectivity tests.
5251        Advertised,
5252        /// If set, the enum was initialized with an unknown value.
5253        ///
5254        /// Applications can examine the value using [RouteType::value] or
5255        /// [RouteType::name].
5256        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        /// Gets the enum value.
5269        ///
5270        /// Returns `None` if the enum contains an unknown value deserialized from
5271        /// the string representation of enums.
5272        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        /// Gets the enum value as a string.
5288        ///
5289        /// Returns `None` if the enum contains an unknown value deserialized from
5290        /// the integer representation of enums.
5291        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    /// Type of next hop:
5391    ///
5392    /// # Working with unknown values
5393    ///
5394    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5395    /// additional enum variants at any time. Adding new variants is not considered
5396    /// a breaking change. Applications should write their code in anticipation of:
5397    ///
5398    /// - New values appearing in future releases of the client library, **and**
5399    /// - New values received dynamically, without application changes.
5400    ///
5401    /// Please consult the [Working with enums] section in the user guide for some
5402    /// guidelines.
5403    ///
5404    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5405    #[derive(Clone, Debug, PartialEq)]
5406    #[non_exhaustive]
5407    pub enum NextHopType {
5408        /// Unspecified type. Default value.
5409        Unspecified,
5410        /// Next hop is an IP address.
5411        NextHopIp,
5412        /// Next hop is a Compute Engine instance.
5413        NextHopInstance,
5414        /// Next hop is a VPC network gateway.
5415        NextHopNetwork,
5416        /// Next hop is a peering VPC. This scenario only happens when the user
5417        /// doesn't have permissions to the project where the next hop resource is
5418        /// located.
5419        NextHopPeering,
5420        /// Next hop is an interconnect.
5421        NextHopInterconnect,
5422        /// Next hop is a VPN tunnel.
5423        NextHopVpnTunnel,
5424        /// Next hop is a VPN gateway. This scenario only happens when tracing
5425        /// connectivity from an on-premises network to Google Cloud through a VPN.
5426        /// The analysis simulates a packet departing from the on-premises network
5427        /// through a VPN tunnel and arriving at a Cloud VPN gateway.
5428        NextHopVpnGateway,
5429        /// Next hop is an internet gateway.
5430        NextHopInternetGateway,
5431        /// Next hop is blackhole; that is, the next hop either does not exist or is
5432        /// unusable.
5433        NextHopBlackhole,
5434        /// Next hop is the forwarding rule of an Internal Load Balancer.
5435        NextHopIlb,
5436        /// Next hop is a
5437        /// [router appliance
5438        /// instance](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/ra-overview).
5439        NextHopRouterAppliance,
5440        /// Next hop is an NCC hub. This scenario only happens when the user doesn't
5441        /// have permissions to the project where the next hop resource is located.
5442        NextHopNccHub,
5443        /// Next hop is Secure Web Proxy Gateway.
5444        SecureWebProxyGateway,
5445        /// If set, the enum was initialized with an unknown value.
5446        ///
5447        /// Applications can examine the value using [NextHopType::value] or
5448        /// [NextHopType::name].
5449        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        /// Gets the enum value.
5462        ///
5463        /// Returns `None` if the enum contains an unknown value deserialized from
5464        /// the string representation of enums.
5465        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        /// Gets the enum value as a string.
5486        ///
5487        /// Returns `None` if the enum contains an unknown value deserialized from
5488        /// the integer representation of enums.
5489        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    /// Indicates where routes are applicable.
5615    ///
5616    /// # Working with unknown values
5617    ///
5618    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5619    /// additional enum variants at any time. Adding new variants is not considered
5620    /// a breaking change. Applications should write their code in anticipation of:
5621    ///
5622    /// - New values appearing in future releases of the client library, **and**
5623    /// - New values received dynamically, without application changes.
5624    ///
5625    /// Please consult the [Working with enums] section in the user guide for some
5626    /// guidelines.
5627    ///
5628    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5629    #[derive(Clone, Debug, PartialEq)]
5630    #[non_exhaustive]
5631    pub enum RouteScope {
5632        /// Unspecified scope. Default value.
5633        Unspecified,
5634        /// Route is applicable to packets in Network.
5635        Network,
5636        /// Route is applicable to packets using NCC Hub's routing table.
5637        NccHub,
5638        /// If set, the enum was initialized with an unknown value.
5639        ///
5640        /// Applications can examine the value using [RouteScope::value] or
5641        /// [RouteScope::name].
5642        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        /// Gets the enum value.
5655        ///
5656        /// Returns `None` if the enum contains an unknown value deserialized from
5657        /// the string representation of enums.
5658        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        /// Gets the enum value as a string.
5668        ///
5669        /// Returns `None` if the enum contains an unknown value deserialized from
5670        /// the integer representation of enums.
5671        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/// For display only. Details of a Google Service sending packets to a
5748/// VPC network. Although the source IP might be a publicly routable address,
5749/// some Google Services use special routes within Google production
5750/// infrastructure to reach Compute Engine Instances.
5751/// <https://cloud.google.com/vpc/docs/routes#special_return_paths>
5752#[derive(Clone, Default, PartialEq)]
5753#[non_exhaustive]
5754pub struct GoogleServiceInfo {
5755    /// Source IP address.
5756    pub source_ip: std::string::String,
5757
5758    /// Recognized type of a Google Service.
5759    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    /// Sets the value of [source_ip][crate::model::GoogleServiceInfo::source_ip].
5770    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    /// Sets the value of [google_service_type][crate::model::GoogleServiceInfo::google_service_type].
5776    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
5793/// Defines additional types related to [GoogleServiceInfo].
5794pub mod google_service_info {
5795    #[allow(unused_imports)]
5796    use super::*;
5797
5798    /// Recognized type of a Google Service.
5799    ///
5800    /// # Working with unknown values
5801    ///
5802    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5803    /// additional enum variants at any time. Adding new variants is not considered
5804    /// a breaking change. Applications should write their code in anticipation of:
5805    ///
5806    /// - New values appearing in future releases of the client library, **and**
5807    /// - New values received dynamically, without application changes.
5808    ///
5809    /// Please consult the [Working with enums] section in the user guide for some
5810    /// guidelines.
5811    ///
5812    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5813    #[derive(Clone, Debug, PartialEq)]
5814    #[non_exhaustive]
5815    pub enum GoogleServiceType {
5816        /// Unspecified Google Service.
5817        Unspecified,
5818        /// Identity aware proxy.
5819        /// <https://cloud.google.com/iap/docs/using-tcp-forwarding>
5820        Iap,
5821        /// One of two services sharing IP ranges:
5822        ///
5823        /// * Load Balancer proxy
5824        /// * Centralized Health Check prober
5825        ///   <https://cloud.google.com/load-balancing/docs/firewall-rules>
5826        GfeProxyOrHealthCheckProber,
5827        /// Connectivity from Cloud DNS to forwarding targets or alternate name
5828        /// servers that use private routing.
5829        /// <https://cloud.google.com/dns/docs/zones/forwarding-zones#firewall-rules>
5830        /// <https://cloud.google.com/dns/docs/policies#firewall-rules>
5831        CloudDns,
5832        /// private.googleapis.com and restricted.googleapis.com
5833        GoogleApi,
5834        /// Google API via Private Service Connect.
5835        /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
5836        GoogleApiPsc,
5837        /// Google API via VPC Service Controls.
5838        /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
5839        GoogleApiVpcSc,
5840        /// Google API via Serverless VPC Access.
5841        /// <https://cloud.google.com/vpc/docs/serverless-vpc-access>
5842        ServerlessVpcAccess,
5843        /// If set, the enum was initialized with an unknown value.
5844        ///
5845        /// Applications can examine the value using [GoogleServiceType::value] or
5846        /// [GoogleServiceType::name].
5847        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        /// Gets the enum value.
5860        ///
5861        /// Returns `None` if the enum contains an unknown value deserialized from
5862        /// the string representation of enums.
5863        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        /// Gets the enum value as a string.
5878        ///
5879        /// Returns `None` if the enum contains an unknown value deserialized from
5880        /// the integer representation of enums.
5881        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/// For display only. Metadata associated with a Compute Engine forwarding rule.
5980#[derive(Clone, Default, PartialEq)]
5981#[non_exhaustive]
5982pub struct ForwardingRuleInfo {
5983    /// Name of the forwarding rule.
5984    pub display_name: std::string::String,
5985
5986    /// URI of the forwarding rule.
5987    pub uri: std::string::String,
5988
5989    /// Protocol defined in the forwarding rule that matches the packet.
5990    pub matched_protocol: std::string::String,
5991
5992    /// Port range defined in the forwarding rule that matches the packet.
5993    pub matched_port_range: std::string::String,
5994
5995    /// VIP of the forwarding rule.
5996    pub vip: std::string::String,
5997
5998    /// Target type of the forwarding rule.
5999    pub target: std::string::String,
6000
6001    /// Network URI.
6002    pub network_uri: std::string::String,
6003
6004    /// Region of the forwarding rule. Set only for regional forwarding rules.
6005    pub region: std::string::String,
6006
6007    /// Name of the load balancer the forwarding rule belongs to. Empty for
6008    /// forwarding rules not related to load balancers (like PSC forwarding rules).
6009    pub load_balancer_name: std::string::String,
6010
6011    /// URI of the PSC service attachment this forwarding rule targets (if
6012    /// applicable).
6013    pub psc_service_attachment_uri: std::string::String,
6014
6015    /// PSC Google API target this forwarding rule targets (if applicable).
6016    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    /// Sets the value of [display_name][crate::model::ForwardingRuleInfo::display_name].
6027    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    /// Sets the value of [uri][crate::model::ForwardingRuleInfo::uri].
6033    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    /// Sets the value of [matched_protocol][crate::model::ForwardingRuleInfo::matched_protocol].
6039    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    /// Sets the value of [matched_port_range][crate::model::ForwardingRuleInfo::matched_port_range].
6048    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    /// Sets the value of [vip][crate::model::ForwardingRuleInfo::vip].
6057    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    /// Sets the value of [target][crate::model::ForwardingRuleInfo::target].
6063    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    /// Sets the value of [network_uri][crate::model::ForwardingRuleInfo::network_uri].
6069    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    /// Sets the value of [region][crate::model::ForwardingRuleInfo::region].
6075    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    /// Sets the value of [load_balancer_name][crate::model::ForwardingRuleInfo::load_balancer_name].
6081    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    /// Sets the value of [psc_service_attachment_uri][crate::model::ForwardingRuleInfo::psc_service_attachment_uri].
6090    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    /// Sets the value of [psc_google_api_target][crate::model::ForwardingRuleInfo::psc_google_api_target].
6099    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/// For display only. Metadata associated with a load balancer.
6115#[derive(Clone, Default, PartialEq)]
6116#[non_exhaustive]
6117pub struct LoadBalancerInfo {
6118    /// Type of the load balancer.
6119    pub load_balancer_type: crate::model::load_balancer_info::LoadBalancerType,
6120
6121    /// URI of the health check for the load balancer. Deprecated and no longer
6122    /// populated as different load balancer backends might have different health
6123    /// checks.
6124    #[deprecated]
6125    pub health_check_uri: std::string::String,
6126
6127    /// Information for the loadbalancer backends.
6128    pub backends: std::vec::Vec<crate::model::LoadBalancerBackend>,
6129
6130    /// Type of load balancer's backend configuration.
6131    pub backend_type: crate::model::load_balancer_info::BackendType,
6132
6133    /// Backend configuration URI.
6134    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    /// Sets the value of [load_balancer_type][crate::model::LoadBalancerInfo::load_balancer_type].
6145    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    /// Sets the value of [health_check_uri][crate::model::LoadBalancerInfo::health_check_uri].
6156    #[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    /// Sets the value of [backends][crate::model::LoadBalancerInfo::backends].
6166    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    /// Sets the value of [backend_type][crate::model::LoadBalancerInfo::backend_type].
6177    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    /// Sets the value of [backend_uri][crate::model::LoadBalancerInfo::backend_uri].
6188    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
6200/// Defines additional types related to [LoadBalancerInfo].
6201pub mod load_balancer_info {
6202    #[allow(unused_imports)]
6203    use super::*;
6204
6205    /// The type definition for a load balancer:
6206    ///
6207    /// # Working with unknown values
6208    ///
6209    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6210    /// additional enum variants at any time. Adding new variants is not considered
6211    /// a breaking change. Applications should write their code in anticipation of:
6212    ///
6213    /// - New values appearing in future releases of the client library, **and**
6214    /// - New values received dynamically, without application changes.
6215    ///
6216    /// Please consult the [Working with enums] section in the user guide for some
6217    /// guidelines.
6218    ///
6219    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6220    #[derive(Clone, Debug, PartialEq)]
6221    #[non_exhaustive]
6222    pub enum LoadBalancerType {
6223        /// Type is unspecified.
6224        Unspecified,
6225        /// Internal TCP/UDP load balancer.
6226        InternalTcpUdp,
6227        /// Network TCP/UDP load balancer.
6228        NetworkTcpUdp,
6229        /// HTTP(S) proxy load balancer.
6230        HttpProxy,
6231        /// TCP proxy load balancer.
6232        TcpProxy,
6233        /// SSL proxy load balancer.
6234        SslProxy,
6235        /// If set, the enum was initialized with an unknown value.
6236        ///
6237        /// Applications can examine the value using [LoadBalancerType::value] or
6238        /// [LoadBalancerType::name].
6239        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        /// Gets the enum value.
6252        ///
6253        /// Returns `None` if the enum contains an unknown value deserialized from
6254        /// the string representation of enums.
6255        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        /// Gets the enum value as a string.
6268        ///
6269        /// Returns `None` if the enum contains an unknown value deserialized from
6270        /// the integer representation of enums.
6271        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    /// The type definition for a load balancer backend configuration:
6359    ///
6360    /// # Working with unknown values
6361    ///
6362    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6363    /// additional enum variants at any time. Adding new variants is not considered
6364    /// a breaking change. Applications should write their code in anticipation of:
6365    ///
6366    /// - New values appearing in future releases of the client library, **and**
6367    /// - New values received dynamically, without application changes.
6368    ///
6369    /// Please consult the [Working with enums] section in the user guide for some
6370    /// guidelines.
6371    ///
6372    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6373    #[derive(Clone, Debug, PartialEq)]
6374    #[non_exhaustive]
6375    pub enum BackendType {
6376        /// Type is unspecified.
6377        Unspecified,
6378        /// Backend Service as the load balancer's backend.
6379        BackendService,
6380        /// Target Pool as the load balancer's backend.
6381        TargetPool,
6382        /// Target Instance as the load balancer's backend.
6383        TargetInstance,
6384        /// If set, the enum was initialized with an unknown value.
6385        ///
6386        /// Applications can examine the value using [BackendType::value] or
6387        /// [BackendType::name].
6388        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        /// Gets the enum value.
6401        ///
6402        /// Returns `None` if the enum contains an unknown value deserialized from
6403        /// the string representation of enums.
6404        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        /// Gets the enum value as a string.
6415        ///
6416        /// Returns `None` if the enum contains an unknown value deserialized from
6417        /// the integer representation of enums.
6418        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/// For display only. Metadata associated with a specific load balancer backend.
6499#[derive(Clone, Default, PartialEq)]
6500#[non_exhaustive]
6501pub struct LoadBalancerBackend {
6502    /// Name of a Compute Engine instance or network endpoint.
6503    pub display_name: std::string::String,
6504
6505    /// URI of a Compute Engine instance or network endpoint.
6506    pub uri: std::string::String,
6507
6508    /// State of the health check firewall configuration.
6509    pub health_check_firewall_state: crate::model::load_balancer_backend::HealthCheckFirewallState,
6510
6511    /// A list of firewall rule URIs allowing probes from health check IP ranges.
6512    pub health_check_allowing_firewall_rules: std::vec::Vec<std::string::String>,
6513
6514    /// A list of firewall rule URIs blocking probes from health check IP ranges.
6515    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    /// Sets the value of [display_name][crate::model::LoadBalancerBackend::display_name].
6526    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    /// Sets the value of [uri][crate::model::LoadBalancerBackend::uri].
6532    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    /// Sets the value of [health_check_firewall_state][crate::model::LoadBalancerBackend::health_check_firewall_state].
6538    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    /// Sets the value of [health_check_allowing_firewall_rules][crate::model::LoadBalancerBackend::health_check_allowing_firewall_rules].
6549    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    /// Sets the value of [health_check_blocking_firewall_rules][crate::model::LoadBalancerBackend::health_check_blocking_firewall_rules].
6560    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
6577/// Defines additional types related to [LoadBalancerBackend].
6578pub mod load_balancer_backend {
6579    #[allow(unused_imports)]
6580    use super::*;
6581
6582    /// State of a health check firewall configuration:
6583    ///
6584    /// # Working with unknown values
6585    ///
6586    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6587    /// additional enum variants at any time. Adding new variants is not considered
6588    /// a breaking change. Applications should write their code in anticipation of:
6589    ///
6590    /// - New values appearing in future releases of the client library, **and**
6591    /// - New values received dynamically, without application changes.
6592    ///
6593    /// Please consult the [Working with enums] section in the user guide for some
6594    /// guidelines.
6595    ///
6596    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6597    #[derive(Clone, Debug, PartialEq)]
6598    #[non_exhaustive]
6599    pub enum HealthCheckFirewallState {
6600        /// State is unspecified. Default state if not populated.
6601        Unspecified,
6602        /// There are configured firewall rules to allow health check probes to the
6603        /// backend.
6604        Configured,
6605        /// There are firewall rules configured to allow partial health check ranges
6606        /// or block all health check ranges.
6607        /// If a health check probe is sent from denied IP ranges,
6608        /// the health check to the backend will fail. Then, the backend will be
6609        /// marked unhealthy and will not receive traffic sent to the load balancer.
6610        Misconfigured,
6611        /// If set, the enum was initialized with an unknown value.
6612        ///
6613        /// Applications can examine the value using [HealthCheckFirewallState::value] or
6614        /// [HealthCheckFirewallState::name].
6615        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        /// Gets the enum value.
6628        ///
6629        /// Returns `None` if the enum contains an unknown value deserialized from
6630        /// the string representation of enums.
6631        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        /// Gets the enum value as a string.
6641        ///
6642        /// Returns `None` if the enum contains an unknown value deserialized from
6643        /// the integer representation of enums.
6644        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/// For display only. Metadata associated with a hybrid subnet.
6722#[derive(Clone, Default, PartialEq)]
6723#[non_exhaustive]
6724pub struct HybridSubnetInfo {
6725    /// Name of a hybrid subnet.
6726    pub display_name: std::string::String,
6727
6728    /// URI of a hybrid subnet.
6729    pub uri: std::string::String,
6730
6731    /// Name of a Google Cloud region where the hybrid subnet is configured.
6732    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    /// Sets the value of [display_name][crate::model::HybridSubnetInfo::display_name].
6743    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    /// Sets the value of [uri][crate::model::HybridSubnetInfo::uri].
6749    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    /// Sets the value of [region][crate::model::HybridSubnetInfo::region].
6755    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/// For display only. Metadata associated with a Compute Engine VPN gateway.
6768#[derive(Clone, Default, PartialEq)]
6769#[non_exhaustive]
6770pub struct VpnGatewayInfo {
6771    /// Name of a VPN gateway.
6772    pub display_name: std::string::String,
6773
6774    /// URI of a VPN gateway.
6775    pub uri: std::string::String,
6776
6777    /// URI of a Compute Engine network where the VPN gateway is configured.
6778    pub network_uri: std::string::String,
6779
6780    /// IP address of the VPN gateway.
6781    pub ip_address: std::string::String,
6782
6783    /// A VPN tunnel that is associated with this VPN gateway.
6784    /// There may be multiple VPN tunnels configured on a VPN gateway, and only
6785    /// the one relevant to the test is displayed.
6786    pub vpn_tunnel_uri: std::string::String,
6787
6788    /// Name of a Google Cloud region where this VPN gateway is configured.
6789    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    /// Sets the value of [display_name][crate::model::VpnGatewayInfo::display_name].
6800    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    /// Sets the value of [uri][crate::model::VpnGatewayInfo::uri].
6806    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    /// Sets the value of [network_uri][crate::model::VpnGatewayInfo::network_uri].
6812    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    /// Sets the value of [ip_address][crate::model::VpnGatewayInfo::ip_address].
6818    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    /// Sets the value of [vpn_tunnel_uri][crate::model::VpnGatewayInfo::vpn_tunnel_uri].
6824    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    /// Sets the value of [region][crate::model::VpnGatewayInfo::region].
6830    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/// For display only. Metadata associated with a Compute Engine VPN tunnel.
6843#[derive(Clone, Default, PartialEq)]
6844#[non_exhaustive]
6845pub struct VpnTunnelInfo {
6846    /// Name of a VPN tunnel.
6847    pub display_name: std::string::String,
6848
6849    /// URI of a VPN tunnel.
6850    pub uri: std::string::String,
6851
6852    /// URI of the VPN gateway at local end of the tunnel.
6853    pub source_gateway: std::string::String,
6854
6855    /// URI of a VPN gateway at remote end of the tunnel.
6856    pub remote_gateway: std::string::String,
6857
6858    /// Remote VPN gateway's IP address.
6859    pub remote_gateway_ip: std::string::String,
6860
6861    /// Local VPN gateway's IP address.
6862    pub source_gateway_ip: std::string::String,
6863
6864    /// URI of a Compute Engine network where the VPN tunnel is configured.
6865    pub network_uri: std::string::String,
6866
6867    /// Name of a Google Cloud region where this VPN tunnel is configured.
6868    pub region: std::string::String,
6869
6870    /// Type of the routing policy.
6871    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    /// Sets the value of [display_name][crate::model::VpnTunnelInfo::display_name].
6882    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    /// Sets the value of [uri][crate::model::VpnTunnelInfo::uri].
6888    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    /// Sets the value of [source_gateway][crate::model::VpnTunnelInfo::source_gateway].
6894    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    /// Sets the value of [remote_gateway][crate::model::VpnTunnelInfo::remote_gateway].
6900    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    /// Sets the value of [remote_gateway_ip][crate::model::VpnTunnelInfo::remote_gateway_ip].
6906    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    /// Sets the value of [source_gateway_ip][crate::model::VpnTunnelInfo::source_gateway_ip].
6915    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    /// Sets the value of [network_uri][crate::model::VpnTunnelInfo::network_uri].
6924    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    /// Sets the value of [region][crate::model::VpnTunnelInfo::region].
6930    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    /// Sets the value of [routing_type][crate::model::VpnTunnelInfo::routing_type].
6936    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
6951/// Defines additional types related to [VpnTunnelInfo].
6952pub mod vpn_tunnel_info {
6953    #[allow(unused_imports)]
6954    use super::*;
6955
6956    /// Types of VPN routing policy. For details, refer to [Networks and Tunnel
6957    /// routing](https://cloud.google.com/network-connectivity/docs/vpn/concepts/choosing-networks-routing/).
6958    ///
6959    /// # Working with unknown values
6960    ///
6961    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6962    /// additional enum variants at any time. Adding new variants is not considered
6963    /// a breaking change. Applications should write their code in anticipation of:
6964    ///
6965    /// - New values appearing in future releases of the client library, **and**
6966    /// - New values received dynamically, without application changes.
6967    ///
6968    /// Please consult the [Working with enums] section in the user guide for some
6969    /// guidelines.
6970    ///
6971    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6972    #[derive(Clone, Debug, PartialEq)]
6973    #[non_exhaustive]
6974    pub enum RoutingType {
6975        /// Unspecified type. Default value.
6976        Unspecified,
6977        /// Route based VPN.
6978        RouteBased,
6979        /// Policy based routing.
6980        PolicyBased,
6981        /// Dynamic (BGP) routing.
6982        Dynamic,
6983        /// If set, the enum was initialized with an unknown value.
6984        ///
6985        /// Applications can examine the value using [RoutingType::value] or
6986        /// [RoutingType::name].
6987        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        /// Gets the enum value.
7000        ///
7001        /// Returns `None` if the enum contains an unknown value deserialized from
7002        /// the string representation of enums.
7003        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        /// Gets the enum value as a string.
7014        ///
7015        /// Returns `None` if the enum contains an unknown value deserialized from
7016        /// the integer representation of enums.
7017        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/// For display only. Metadata associated with an Interconnect attachment.
7098#[derive(Clone, Default, PartialEq)]
7099#[non_exhaustive]
7100pub struct InterconnectAttachmentInfo {
7101    /// Name of an Interconnect attachment.
7102    pub display_name: std::string::String,
7103
7104    /// URI of an Interconnect attachment.
7105    pub uri: std::string::String,
7106
7107    /// URI of the Interconnect where the Interconnect attachment is
7108    /// configured.
7109    pub interconnect_uri: std::string::String,
7110
7111    /// Name of a Google Cloud region where the Interconnect attachment is
7112    /// configured.
7113    pub region: std::string::String,
7114
7115    /// URI of the Cloud Router to be used for dynamic routing.
7116    pub cloud_router_uri: std::string::String,
7117
7118    /// The type of interconnect attachment this is.
7119    pub r#type: crate::model::interconnect_attachment_info::Type,
7120
7121    /// Appliance IP address that was matched for L2_DEDICATED attachments.
7122    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    /// Sets the value of [display_name][crate::model::InterconnectAttachmentInfo::display_name].
7133    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    /// Sets the value of [uri][crate::model::InterconnectAttachmentInfo::uri].
7139    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    /// Sets the value of [interconnect_uri][crate::model::InterconnectAttachmentInfo::interconnect_uri].
7145    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    /// Sets the value of [region][crate::model::InterconnectAttachmentInfo::region].
7154    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    /// Sets the value of [cloud_router_uri][crate::model::InterconnectAttachmentInfo::cloud_router_uri].
7160    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    /// Sets the value of [r#type][crate::model::InterconnectAttachmentInfo::type].
7169    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    /// Sets the value of [l2_attachment_matched_ip_address][crate::model::InterconnectAttachmentInfo::l2_attachment_matched_ip_address].
7178    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
7193/// Defines additional types related to [InterconnectAttachmentInfo].
7194pub mod interconnect_attachment_info {
7195    #[allow(unused_imports)]
7196    use super::*;
7197
7198    /// What type of interconnect attachment this is.
7199    ///
7200    /// # Working with unknown values
7201    ///
7202    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7203    /// additional enum variants at any time. Adding new variants is not considered
7204    /// a breaking change. Applications should write their code in anticipation of:
7205    ///
7206    /// - New values appearing in future releases of the client library, **and**
7207    /// - New values received dynamically, without application changes.
7208    ///
7209    /// Please consult the [Working with enums] section in the user guide for some
7210    /// guidelines.
7211    ///
7212    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7213    #[derive(Clone, Debug, PartialEq)]
7214    #[non_exhaustive]
7215    pub enum Type {
7216        /// Unspecified type.
7217        Unspecified,
7218        /// Attachment to a dedicated interconnect.
7219        Dedicated,
7220        /// Attachment to a partner interconnect, created by the customer.
7221        Partner,
7222        /// Attachment to a partner interconnect, created by the partner.
7223        PartnerProvider,
7224        /// Attachment to a L2 interconnect, created by the customer.
7225        L2Dedicated,
7226        /// If set, the enum was initialized with an unknown value.
7227        ///
7228        /// Applications can examine the value using [Type::value] or
7229        /// [Type::name].
7230        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        /// Gets the enum value.
7243        ///
7244        /// Returns `None` if the enum contains an unknown value deserialized from
7245        /// the string representation of enums.
7246        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        /// Gets the enum value as a string.
7258        ///
7259        /// Returns `None` if the enum contains an unknown value deserialized from
7260        /// the integer representation of enums.
7261        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/// For display only. The specification of the endpoints for the test.
7346/// EndpointInfo is derived from source and destination Endpoint and validated
7347/// by the backend data plane model.
7348#[derive(Clone, Default, PartialEq)]
7349#[non_exhaustive]
7350pub struct EndpointInfo {
7351    /// Source IP address.
7352    pub source_ip: std::string::String,
7353
7354    /// Destination IP address.
7355    pub destination_ip: std::string::String,
7356
7357    /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
7358    pub protocol: std::string::String,
7359
7360    /// Source port. Only valid when protocol is TCP or UDP.
7361    pub source_port: i32,
7362
7363    /// Destination port. Only valid when protocol is TCP or UDP.
7364    pub destination_port: i32,
7365
7366    /// URI of the network where this packet originates from.
7367    pub source_network_uri: std::string::String,
7368
7369    /// URI of the network where this packet is sent to.
7370    pub destination_network_uri: std::string::String,
7371
7372    /// URI of the source telemetry agent this packet originates from.
7373    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    /// Sets the value of [source_ip][crate::model::EndpointInfo::source_ip].
7384    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    /// Sets the value of [destination_ip][crate::model::EndpointInfo::destination_ip].
7390    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    /// Sets the value of [protocol][crate::model::EndpointInfo::protocol].
7396    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    /// Sets the value of [source_port][crate::model::EndpointInfo::source_port].
7402    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    /// Sets the value of [destination_port][crate::model::EndpointInfo::destination_port].
7408    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    /// Sets the value of [source_network_uri][crate::model::EndpointInfo::source_network_uri].
7414    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    /// Sets the value of [destination_network_uri][crate::model::EndpointInfo::destination_network_uri].
7423    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    /// Sets the value of [source_agent_uri][crate::model::EndpointInfo::source_agent_uri].
7432    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/// Details of the final state "deliver" and associated resource.
7448#[derive(Clone, Default, PartialEq)]
7449#[non_exhaustive]
7450pub struct DeliverInfo {
7451    /// Target type where the packet is delivered to.
7452    pub target: crate::model::deliver_info::Target,
7453
7454    /// URI of the resource that the packet is delivered to.
7455    pub resource_uri: std::string::String,
7456
7457    /// IP address of the target (if applicable).
7458    pub ip_address: std::string::String,
7459
7460    /// Name of the Cloud Storage Bucket the packet is delivered to (if
7461    /// applicable).
7462    pub storage_bucket: std::string::String,
7463
7464    /// PSC Google API target the packet is delivered to (if applicable).
7465    pub psc_google_api_target: std::string::String,
7466
7467    /// Recognized type of a Google Service the packet is delivered to (if
7468    /// applicable).
7469    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    /// Sets the value of [target][crate::model::DeliverInfo::target].
7480    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    /// Sets the value of [resource_uri][crate::model::DeliverInfo::resource_uri].
7489    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    /// Sets the value of [ip_address][crate::model::DeliverInfo::ip_address].
7495    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    /// Sets the value of [storage_bucket][crate::model::DeliverInfo::storage_bucket].
7501    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    /// Sets the value of [psc_google_api_target][crate::model::DeliverInfo::psc_google_api_target].
7507    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    /// Sets the value of [google_service_type][crate::model::DeliverInfo::google_service_type].
7516    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
7533/// Defines additional types related to [DeliverInfo].
7534pub mod deliver_info {
7535    #[allow(unused_imports)]
7536    use super::*;
7537
7538    /// Deliver target types:
7539    ///
7540    /// # Working with unknown values
7541    ///
7542    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7543    /// additional enum variants at any time. Adding new variants is not considered
7544    /// a breaking change. Applications should write their code in anticipation of:
7545    ///
7546    /// - New values appearing in future releases of the client library, **and**
7547    /// - New values received dynamically, without application changes.
7548    ///
7549    /// Please consult the [Working with enums] section in the user guide for some
7550    /// guidelines.
7551    ///
7552    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7553    #[derive(Clone, Debug, PartialEq)]
7554    #[non_exhaustive]
7555    pub enum Target {
7556        /// Target not specified.
7557        Unspecified,
7558        /// Target is a Compute Engine instance.
7559        Instance,
7560        /// Target is the internet.
7561        Internet,
7562        /// Target is a Google API.
7563        GoogleApi,
7564        /// Target is a Google Kubernetes Engine cluster master.
7565        GkeMaster,
7566        /// Target is a Cloud SQL instance.
7567        CloudSqlInstance,
7568        /// Target is a published service that uses [Private Service
7569        /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
7570        PscPublishedService,
7571        /// Target is Google APIs that use [Private Service
7572        /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-apis).
7573        PscGoogleApi,
7574        /// Target is a VPC-SC that uses [Private Service
7575        /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-apis).
7576        PscVpcSc,
7577        /// Target is a serverless network endpoint group.
7578        ServerlessNeg,
7579        /// Target is a Cloud Storage bucket.
7580        StorageBucket,
7581        /// Target is a private network. Used only for return traces.
7582        PrivateNetwork,
7583        /// Target is a Cloud Function. Used only for return traces.
7584        CloudFunction,
7585        /// Target is a App Engine service version. Used only for return traces.
7586        AppEngineVersion,
7587        /// Target is a Cloud Run revision. Used only for return traces.
7588        CloudRunRevision,
7589        /// Target is a Google-managed service. Used only for return traces.
7590        GoogleManagedService,
7591        /// Target is a Redis Instance.
7592        RedisInstance,
7593        /// Target is a Redis Cluster.
7594        RedisCluster,
7595        /// If set, the enum was initialized with an unknown value.
7596        ///
7597        /// Applications can examine the value using [Target::value] or
7598        /// [Target::name].
7599        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        /// Gets the enum value.
7612        ///
7613        /// Returns `None` if the enum contains an unknown value deserialized from
7614        /// the string representation of enums.
7615        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        /// Gets the enum value as a string.
7640        ///
7641        /// Returns `None` if the enum contains an unknown value deserialized from
7642        /// the integer representation of enums.
7643        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    /// Recognized type of a Google Service.
7779    ///
7780    /// # Working with unknown values
7781    ///
7782    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7783    /// additional enum variants at any time. Adding new variants is not considered
7784    /// a breaking change. Applications should write their code in anticipation of:
7785    ///
7786    /// - New values appearing in future releases of the client library, **and**
7787    /// - New values received dynamically, without application changes.
7788    ///
7789    /// Please consult the [Working with enums] section in the user guide for some
7790    /// guidelines.
7791    ///
7792    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7793    #[derive(Clone, Debug, PartialEq)]
7794    #[non_exhaustive]
7795    pub enum GoogleServiceType {
7796        /// Unspecified Google Service.
7797        Unspecified,
7798        /// Identity aware proxy.
7799        /// <https://cloud.google.com/iap/docs/using-tcp-forwarding>
7800        Iap,
7801        /// One of two services sharing IP ranges:
7802        ///
7803        /// * Load Balancer proxy
7804        /// * Centralized Health Check prober
7805        ///   <https://cloud.google.com/load-balancing/docs/firewall-rules>
7806        GfeProxyOrHealthCheckProber,
7807        /// Connectivity from Cloud DNS to forwarding targets or alternate name
7808        /// servers that use private routing.
7809        /// <https://cloud.google.com/dns/docs/zones/forwarding-zones#firewall-rules>
7810        /// <https://cloud.google.com/dns/docs/policies#firewall-rules>
7811        CloudDns,
7812        /// private.googleapis.com and restricted.googleapis.com
7813        PrivateGoogleAccess,
7814        /// Google API via Private Service Connect.
7815        /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
7816        /// Google API via Serverless VPC Access.
7817        /// <https://cloud.google.com/vpc/docs/serverless-vpc-access>
7818        ServerlessVpcAccess,
7819        /// If set, the enum was initialized with an unknown value.
7820        ///
7821        /// Applications can examine the value using [GoogleServiceType::value] or
7822        /// [GoogleServiceType::name].
7823        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        /// Gets the enum value.
7836        ///
7837        /// Returns `None` if the enum contains an unknown value deserialized from
7838        /// the string representation of enums.
7839        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        /// Gets the enum value as a string.
7852        ///
7853        /// Returns `None` if the enum contains an unknown value deserialized from
7854        /// the integer representation of enums.
7855        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/// Details of the final state "forward" and associated resource.
7946#[derive(Clone, Default, PartialEq)]
7947#[non_exhaustive]
7948pub struct ForwardInfo {
7949    /// Target type where this packet is forwarded to.
7950    pub target: crate::model::forward_info::Target,
7951
7952    /// URI of the resource that the packet is forwarded to.
7953    pub resource_uri: std::string::String,
7954
7955    /// IP address of the target (if applicable).
7956    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    /// Sets the value of [target][crate::model::ForwardInfo::target].
7967    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    /// Sets the value of [resource_uri][crate::model::ForwardInfo::resource_uri].
7976    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    /// Sets the value of [ip_address][crate::model::ForwardInfo::ip_address].
7982    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
7994/// Defines additional types related to [ForwardInfo].
7995pub mod forward_info {
7996    #[allow(unused_imports)]
7997    use super::*;
7998
7999    /// Forward target types.
8000    ///
8001    /// # Working with unknown values
8002    ///
8003    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8004    /// additional enum variants at any time. Adding new variants is not considered
8005    /// a breaking change. Applications should write their code in anticipation of:
8006    ///
8007    /// - New values appearing in future releases of the client library, **and**
8008    /// - New values received dynamically, without application changes.
8009    ///
8010    /// Please consult the [Working with enums] section in the user guide for some
8011    /// guidelines.
8012    ///
8013    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8014    #[derive(Clone, Debug, PartialEq)]
8015    #[non_exhaustive]
8016    pub enum Target {
8017        /// Target not specified.
8018        Unspecified,
8019        /// Forwarded to a VPC peering network.
8020        PeeringVpc,
8021        /// Forwarded to a Cloud VPN gateway.
8022        VpnGateway,
8023        /// Forwarded to a Cloud Interconnect connection.
8024        Interconnect,
8025        /// Forwarded to a Google Kubernetes Engine Container cluster master.
8026        #[deprecated]
8027        GkeMaster,
8028        /// Forwarded to the next hop of a custom route imported from a peering VPC.
8029        ImportedCustomRouteNextHop,
8030        /// Forwarded to a Cloud SQL instance.
8031        #[deprecated]
8032        CloudSqlInstance,
8033        /// Forwarded to a VPC network in another project.
8034        AnotherProject,
8035        /// Forwarded to an NCC Hub.
8036        NccHub,
8037        /// Forwarded to a router appliance.
8038        RouterAppliance,
8039        /// Forwarded to a Secure Web Proxy Gateway.
8040        SecureWebProxyGateway,
8041        /// If set, the enum was initialized with an unknown value.
8042        ///
8043        /// Applications can examine the value using [Target::value] or
8044        /// [Target::name].
8045        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        /// Gets the enum value.
8058        ///
8059        /// Returns `None` if the enum contains an unknown value deserialized from
8060        /// the string representation of enums.
8061        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        /// Gets the enum value as a string.
8079        ///
8080        /// Returns `None` if the enum contains an unknown value deserialized from
8081        /// the integer representation of enums.
8082        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/// Details of the final state "abort" and associated resource.
8195#[derive(Clone, Default, PartialEq)]
8196#[non_exhaustive]
8197pub struct AbortInfo {
8198    /// Causes that the analysis is aborted.
8199    pub cause: crate::model::abort_info::Cause,
8200
8201    /// URI of the resource that caused the abort.
8202    pub resource_uri: std::string::String,
8203
8204    /// IP address that caused the abort.
8205    pub ip_address: std::string::String,
8206
8207    /// List of project IDs the user specified in the request but lacks access to.
8208    /// In this case, analysis is aborted with the PERMISSION_DENIED cause.
8209    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    /// Sets the value of [cause][crate::model::AbortInfo::cause].
8220    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    /// Sets the value of [resource_uri][crate::model::AbortInfo::resource_uri].
8229    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    /// Sets the value of [ip_address][crate::model::AbortInfo::ip_address].
8235    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    /// Sets the value of [projects_missing_permission][crate::model::AbortInfo::projects_missing_permission].
8241    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
8258/// Defines additional types related to [AbortInfo].
8259pub mod abort_info {
8260    #[allow(unused_imports)]
8261    use super::*;
8262
8263    /// Abort cause types:
8264    ///
8265    /// # Working with unknown values
8266    ///
8267    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8268    /// additional enum variants at any time. Adding new variants is not considered
8269    /// a breaking change. Applications should write their code in anticipation of:
8270    ///
8271    /// - New values appearing in future releases of the client library, **and**
8272    /// - New values received dynamically, without application changes.
8273    ///
8274    /// Please consult the [Working with enums] section in the user guide for some
8275    /// guidelines.
8276    ///
8277    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8278    #[derive(Clone, Debug, PartialEq)]
8279    #[non_exhaustive]
8280    pub enum Cause {
8281        /// Cause is unspecified.
8282        Unspecified,
8283        /// Aborted due to unknown network. Deprecated, not used in the new tests.
8284        #[deprecated]
8285        UnknownNetwork,
8286        /// Aborted because no project information can be derived from the test
8287        /// input. Deprecated, not used in the new tests.
8288        #[deprecated]
8289        UnknownProject,
8290        /// Aborted because traffic is sent from a public IP to an instance without
8291        /// an external IP. Deprecated, not used in the new tests.
8292        #[deprecated]
8293        NoExternalIp,
8294        /// Aborted because none of the traces matches destination information
8295        /// specified in the input test request. Deprecated, not used in the new
8296        /// tests.
8297        #[deprecated]
8298        UnintendedDestination,
8299        /// Aborted because the source endpoint could not be found. Deprecated, not
8300        /// used in the new tests.
8301        #[deprecated]
8302        SourceEndpointNotFound,
8303        /// Aborted because the source network does not match the source endpoint.
8304        /// Deprecated, not used in the new tests.
8305        #[deprecated]
8306        MismatchedSourceNetwork,
8307        /// Aborted because the destination endpoint could not be found. Deprecated,
8308        /// not used in the new tests.
8309        #[deprecated]
8310        DestinationEndpointNotFound,
8311        /// Aborted because the destination network does not match the destination
8312        /// endpoint. Deprecated, not used in the new tests.
8313        #[deprecated]
8314        MismatchedDestinationNetwork,
8315        /// Aborted because no endpoint with the packet's destination IP address is
8316        /// found.
8317        UnknownIp,
8318        /// Aborted because no endpoint with the packet's destination IP is found in
8319        /// the Google-managed project.
8320        GoogleManagedServiceUnknownIp,
8321        /// Aborted because the source IP address doesn't belong to any of the
8322        /// subnets of the source VPC network.
8323        SourceIpAddressNotInSourceNetwork,
8324        /// Aborted because user lacks permission to access all or part of the
8325        /// network configurations required to run the test.
8326        PermissionDenied,
8327        /// Aborted because user lacks permission to access Cloud NAT configs
8328        /// required to run the test.
8329        PermissionDeniedNoCloudNatConfigs,
8330        /// Aborted because user lacks permission to access Network endpoint group
8331        /// endpoint configs required to run the test.
8332        PermissionDeniedNoNegEndpointConfigs,
8333        /// Aborted because user lacks permission to access Cloud Router configs
8334        /// required to run the test.
8335        PermissionDeniedNoCloudRouterConfigs,
8336        /// Aborted because no valid source or destination endpoint is derived from
8337        /// the input test request.
8338        NoSourceLocation,
8339        /// Aborted because the source or destination endpoint specified in
8340        /// the request is invalid. Some examples:
8341        ///
8342        /// - The request might contain malformed resource URI, project ID, or IP
8343        ///   address.
8344        /// - The request might contain inconsistent information (for example, the
8345        ///   request might include both the instance and the network, but the instance
8346        ///   might not have a NIC in that network).
8347        InvalidArgument,
8348        /// Aborted because the number of steps in the trace exceeds a certain
8349        /// limit. It might be caused by a routing loop.
8350        TraceTooLong,
8351        /// Aborted due to internal server error.
8352        InternalError,
8353        /// Aborted because the test scenario is not supported.
8354        Unsupported,
8355        /// Aborted because the source and destination resources have no common IP
8356        /// version.
8357        MismatchedIpVersion,
8358        /// Aborted because the connection between the control plane and the node of
8359        /// the source cluster is initiated by the node and managed by the
8360        /// Konnectivity proxy.
8361        GkeKonnectivityProxyUnsupported,
8362        /// Aborted because expected resource configuration was missing.
8363        ResourceConfigNotFound,
8364        /// Aborted because expected VM instance configuration was missing.
8365        VmInstanceConfigNotFound,
8366        /// Aborted because expected network configuration was missing.
8367        NetworkConfigNotFound,
8368        /// Aborted because expected firewall configuration was missing.
8369        FirewallConfigNotFound,
8370        /// Aborted because expected route configuration was missing.
8371        RouteConfigNotFound,
8372        /// Aborted because PSC endpoint selection for the Google-managed service
8373        /// is ambiguous (several PSC endpoints satisfy test input).
8374        GoogleManagedServiceAmbiguousPscEndpoint,
8375        /// Aborted because endpoint selection for the Google-managed service is
8376        /// ambiguous (several endpoints satisfy test input).
8377        GoogleManagedServiceAmbiguousEndpoint,
8378        /// Aborted because tests with a PSC-based Cloud SQL instance as a source are
8379        /// not supported.
8380        SourcePscCloudSqlUnsupported,
8381        /// Aborted because tests with a Redis Cluster as a source are not supported.
8382        SourceRedisClusterUnsupported,
8383        /// Aborted because tests with a Redis Instance as a source are not
8384        /// supported.
8385        SourceRedisInstanceUnsupported,
8386        /// Aborted because tests with a forwarding rule as a source are not
8387        /// supported.
8388        SourceForwardingRuleUnsupported,
8389        /// Aborted because one of the endpoints is a non-routable IP address
8390        /// (loopback, link-local, etc).
8391        NonRoutableIpAddress,
8392        /// Aborted due to an unknown issue in the Google-managed project.
8393        UnknownIssueInGoogleManagedProject,
8394        /// Aborted due to an unsupported configuration of the Google-managed
8395        /// project.
8396        UnsupportedGoogleManagedProjectConfig,
8397        /// Aborted because the source endpoint is a Cloud Run revision with direct
8398        /// VPC access enabled, but there are no reserved serverless IP ranges.
8399        NoServerlessIpRanges,
8400        /// Aborted because the used protocol is not supported for the used IP
8401        /// version.
8402        IpVersionProtocolMismatch,
8403        /// If set, the enum was initialized with an unknown value.
8404        ///
8405        /// Applications can examine the value using [Cause::value] or
8406        /// [Cause::name].
8407        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        /// Gets the enum value.
8420        ///
8421        /// Returns `None` if the enum contains an unknown value deserialized from
8422        /// the string representation of enums.
8423        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        /// Gets the enum value as a string.
8469        ///
8470        /// Returns `None` if the enum contains an unknown value deserialized from
8471        /// the integer representation of enums.
8472        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/// Details of the final state "drop" and associated resource.
8753#[derive(Clone, Default, PartialEq)]
8754#[non_exhaustive]
8755pub struct DropInfo {
8756    /// Cause that the packet is dropped.
8757    pub cause: crate::model::drop_info::Cause,
8758
8759    /// URI of the resource that caused the drop.
8760    pub resource_uri: std::string::String,
8761
8762    /// Source IP address of the dropped packet (if relevant).
8763    pub source_ip: std::string::String,
8764
8765    /// Destination IP address of the dropped packet (if relevant).
8766    pub destination_ip: std::string::String,
8767
8768    /// Region of the dropped packet (if relevant).
8769    pub region: std::string::String,
8770
8771    /// Geolocation (region code) of the source IP address (if relevant).
8772    pub source_geolocation_code: std::string::String,
8773
8774    /// Geolocation (region code) of the destination IP address (if relevant).
8775    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    /// Sets the value of [cause][crate::model::DropInfo::cause].
8786    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    /// Sets the value of [resource_uri][crate::model::DropInfo::resource_uri].
8795    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    /// Sets the value of [source_ip][crate::model::DropInfo::source_ip].
8801    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    /// Sets the value of [destination_ip][crate::model::DropInfo::destination_ip].
8807    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    /// Sets the value of [region][crate::model::DropInfo::region].
8813    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    /// Sets the value of [source_geolocation_code][crate::model::DropInfo::source_geolocation_code].
8819    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    /// Sets the value of [destination_geolocation_code][crate::model::DropInfo::destination_geolocation_code].
8828    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
8843/// Defines additional types related to [DropInfo].
8844pub mod drop_info {
8845    #[allow(unused_imports)]
8846    use super::*;
8847
8848    /// Drop cause types:
8849    ///
8850    /// # Working with unknown values
8851    ///
8852    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8853    /// additional enum variants at any time. Adding new variants is not considered
8854    /// a breaking change. Applications should write their code in anticipation of:
8855    ///
8856    /// - New values appearing in future releases of the client library, **and**
8857    /// - New values received dynamically, without application changes.
8858    ///
8859    /// Please consult the [Working with enums] section in the user guide for some
8860    /// guidelines.
8861    ///
8862    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8863    #[derive(Clone, Debug, PartialEq)]
8864    #[non_exhaustive]
8865    pub enum Cause {
8866        /// Cause is unspecified.
8867        Unspecified,
8868        /// Destination external address cannot be resolved to a known target. If
8869        /// the address is used in a Google Cloud project, provide the project ID
8870        /// as test input.
8871        UnknownExternalAddress,
8872        /// A Compute Engine instance can only send or receive a packet with a
8873        /// foreign IP address if ip_forward is enabled.
8874        ForeignIpDisallowed,
8875        /// Dropped due to a firewall rule, unless allowed due to connection
8876        /// tracking.
8877        FirewallRule,
8878        /// Dropped due to no matching routes.
8879        NoRoute,
8880        /// Dropped due to invalid route. Route's next hop is a blackhole.
8881        RouteBlackhole,
8882        /// Packet is sent to a wrong (unintended) network. Example: you trace a
8883        /// packet from VM1:Network1 to VM2:Network2, however, the route configured
8884        /// in Network1 sends the packet destined for VM2's IP address to Network3.
8885        RouteWrongNetwork,
8886        /// Route's next hop IP address cannot be resolved to a GCP resource.
8887        RouteNextHopIpAddressNotResolved,
8888        /// Route's next hop resource is not found.
8889        RouteNextHopResourceNotFound,
8890        /// Route's next hop instance doesn't have a NIC in the route's network.
8891        RouteNextHopInstanceWrongNetwork,
8892        /// Route's next hop IP address is not a primary IP address of the next hop
8893        /// instance.
8894        RouteNextHopInstanceNonPrimaryIp,
8895        /// Route's next hop forwarding rule doesn't match next hop IP address.
8896        RouteNextHopForwardingRuleIpMismatch,
8897        /// Route's next hop VPN tunnel is down (does not have valid IKE SAs).
8898        RouteNextHopVpnTunnelNotEstablished,
8899        /// Route's next hop forwarding rule type is invalid (it's not a forwarding
8900        /// rule of the internal passthrough load balancer).
8901        RouteNextHopForwardingRuleTypeInvalid,
8902        /// Packet is sent from the Internet or Google service to the private IPv6
8903        /// address.
8904        NoRouteFromInternetToPrivateIpv6Address,
8905        /// Packet is sent from the external IPv6 source address of an instance to
8906        /// the private IPv6 address of an instance.
8907        NoRouteFromExternalIpv6SourceToPrivateIpv6Address,
8908        /// The packet does not match a policy-based VPN tunnel local selector.
8909        VpnTunnelLocalSelectorMismatch,
8910        /// The packet does not match a policy-based VPN tunnel remote selector.
8911        VpnTunnelRemoteSelectorMismatch,
8912        /// Packet with internal destination address sent to the internet gateway.
8913        PrivateTrafficToInternet,
8914        /// Endpoint with only an internal IP address tries to access Google API and
8915        /// services, but Private Google Access is not enabled in the subnet or is
8916        /// not applicable.
8917        PrivateGoogleAccessDisallowed,
8918        /// Source endpoint tries to access Google API and services through the VPN
8919        /// tunnel to another network, but Private Google Access needs to be enabled
8920        /// in the source endpoint network.
8921        PrivateGoogleAccessViaVpnTunnelUnsupported,
8922        /// Endpoint with only an internal IP address tries to access external hosts,
8923        /// but there is no matching Cloud NAT gateway in the subnet.
8924        NoExternalAddress,
8925        /// Destination internal address cannot be resolved to a known target. If
8926        /// this is a shared VPC scenario, verify if the service project ID is
8927        /// provided as test input. Otherwise, verify if the IP address is being
8928        /// used in the project.
8929        UnknownInternalAddress,
8930        /// Forwarding rule's protocol and ports do not match the packet header.
8931        ForwardingRuleMismatch,
8932        /// Forwarding rule does not have backends configured.
8933        ForwardingRuleNoInstances,
8934        /// Firewalls block the health check probes to the backends and cause
8935        /// the backends to be unavailable for traffic from the load balancer.
8936        /// For more details, see [Health check firewall
8937        /// rules](https://cloud.google.com/load-balancing/docs/health-checks#firewall_rules).
8938        FirewallBlockingLoadBalancerBackendHealthCheck,
8939        /// Matching ingress firewall rules by network tags for packets sent via
8940        /// serverless VPC direct egress is unsupported. Behavior is undefined.
8941        /// <https://cloud.google.com/run/docs/configuring/vpc-direct-vpc#limitations>
8942        IngressFirewallTagsUnsupportedByDirectVpcEgress,
8943        /// Packet is sent from or to a Compute Engine instance that is not in a
8944        /// running state.
8945        InstanceNotRunning,
8946        /// Packet sent from or to a GKE cluster that is not in running state.
8947        GkeClusterNotRunning,
8948        /// Packet sent from or to a Cloud SQL instance that is not in running state.
8949        CloudSqlInstanceNotRunning,
8950        /// Packet sent from or to a Redis Instance that is not in running state.
8951        RedisInstanceNotRunning,
8952        /// Packet sent from or to a Redis Cluster that is not in running state.
8953        RedisClusterNotRunning,
8954        /// The type of traffic is blocked and the user cannot configure a firewall
8955        /// rule to enable it. See [Always blocked
8956        /// traffic](https://cloud.google.com/vpc/docs/firewalls#blockedtraffic) for
8957        /// more details.
8958        TrafficTypeBlocked,
8959        /// Access to Google Kubernetes Engine cluster master's endpoint is not
8960        /// authorized. See [Access to the cluster
8961        /// endpoints](https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#access_to_the_cluster_endpoints)
8962        /// for more details.
8963        GkeMasterUnauthorizedAccess,
8964        /// Access to the Cloud SQL instance endpoint is not authorized.
8965        /// See [Authorizing with authorized
8966        /// networks](https://cloud.google.com/sql/docs/mysql/authorize-networks) for
8967        /// more details.
8968        CloudSqlInstanceUnauthorizedAccess,
8969        /// Packet was dropped inside Google Kubernetes Engine Service.
8970        DroppedInsideGkeService,
8971        /// Packet was dropped inside Cloud SQL Service.
8972        DroppedInsideCloudSqlService,
8973        /// Packet was dropped because there is no peering between the originating
8974        /// network and the Google Managed Services Network.
8975        GoogleManagedServiceNoPeering,
8976        /// Packet was dropped because the Google-managed service uses Private
8977        /// Service Connect (PSC), but the PSC endpoint is not found in the project.
8978        GoogleManagedServiceNoPscEndpoint,
8979        /// Packet was dropped because the GKE cluster uses Private Service Connect
8980        /// (PSC), but the PSC endpoint is not found in the project.
8981        GkePscEndpointMissing,
8982        /// Packet was dropped because the Cloud SQL instance has neither a private
8983        /// nor a public IP address.
8984        CloudSqlInstanceNoIpAddress,
8985        /// Packet was dropped because a GKE cluster private endpoint is
8986        /// unreachable from a region different from the cluster's region.
8987        GkeControlPlaneRegionMismatch,
8988        /// Packet sent from a public GKE cluster control plane to a private
8989        /// IP address.
8990        PublicGkeControlPlaneToPrivateDestination,
8991        /// Packet was dropped because there is no route from a GKE cluster
8992        /// control plane to a destination network.
8993        GkeControlPlaneNoRoute,
8994        /// Packet sent from a Cloud SQL instance to an external IP address is not
8995        /// allowed. The Cloud SQL instance is not configured to send packets to
8996        /// external IP addresses.
8997        CloudSqlInstanceNotConfiguredForExternalTraffic,
8998        /// Packet sent from a Cloud SQL instance with only a public IP address to a
8999        /// private IP address.
9000        PublicCloudSqlInstanceToPrivateDestination,
9001        /// Packet was dropped because there is no route from a Cloud SQL
9002        /// instance to a destination network.
9003        CloudSqlInstanceNoRoute,
9004        /// Packet was dropped because the Cloud SQL instance requires all
9005        /// connections to use Cloud SQL connectors and to target the Cloud SQL proxy
9006        /// port (3307).
9007        CloudSqlConnectorRequired,
9008        /// Packet could be dropped because the Cloud Function is not in an active
9009        /// status.
9010        CloudFunctionNotActive,
9011        /// Packet could be dropped because no VPC connector is set.
9012        VpcConnectorNotSet,
9013        /// Packet could be dropped because the VPC connector is not in a running
9014        /// state.
9015        VpcConnectorNotRunning,
9016        /// Packet could be dropped because the traffic from the serverless service
9017        /// to the VPC connector is not allowed.
9018        VpcConnectorServerlessTrafficBlocked,
9019        /// Packet could be dropped because the health check traffic to the VPC
9020        /// connector is not allowed.
9021        VpcConnectorHealthCheckTrafficBlocked,
9022        /// Packet could be dropped because it was sent from a different region
9023        /// to a regional forwarding without global access.
9024        ForwardingRuleRegionMismatch,
9025        /// The Private Service Connect endpoint is in a project that is not approved
9026        /// to connect to the service.
9027        PscConnectionNotAccepted,
9028        /// The packet is sent to the Private Service Connect endpoint over the
9029        /// peering, but [it's not
9030        /// supported](https://cloud.google.com/vpc/docs/configure-private-service-connect-services#on-premises).
9031        PscEndpointAccessedFromPeeredNetwork,
9032        /// The packet is sent to the Private Service Connect backend (network
9033        /// endpoint group), but the producer PSC forwarding rule does not have
9034        /// global access enabled.
9035        PscNegProducerEndpointNoGlobalAccess,
9036        /// The packet is sent to the Private Service Connect backend (network
9037        /// endpoint group), but the producer PSC forwarding rule has multiple ports
9038        /// specified.
9039        PscNegProducerForwardingRuleMultiplePorts,
9040        /// The packet is sent to the Private Service Connect backend (network
9041        /// endpoint group) targeting a Cloud SQL service attachment, but this
9042        /// configuration is not supported.
9043        CloudSqlPscNegUnsupported,
9044        /// No NAT subnets are defined for the PSC service attachment.
9045        NoNatSubnetsForPscServiceAttachment,
9046        /// PSC endpoint is accessed via NCC, but PSC transitivity configuration is
9047        /// not yet propagated.
9048        PscTransitivityNotPropagated,
9049        /// The packet sent from the hybrid NEG proxy matches a non-dynamic route,
9050        /// but such a configuration is not supported.
9051        HybridNegNonDynamicRouteMatched,
9052        /// The packet sent from the hybrid NEG proxy matches a dynamic route with a
9053        /// next hop in a different region, but such a configuration is not
9054        /// supported.
9055        HybridNegNonLocalDynamicRouteMatched,
9056        /// Packet sent from a Cloud Run revision that is not ready.
9057        CloudRunRevisionNotReady,
9058        /// Packet was dropped inside Private Service Connect service producer.
9059        DroppedInsidePscServiceProducer,
9060        /// Packet sent to a load balancer, which requires a proxy-only subnet and
9061        /// the subnet is not found.
9062        LoadBalancerHasNoProxySubnet,
9063        /// Packet sent to Cloud Nat without active NAT IPs.
9064        CloudNatNoAddresses,
9065        /// Packet is stuck in a routing loop.
9066        RoutingLoop,
9067        /// Packet is dropped inside a Google-managed service due to being delivered
9068        /// in return trace to an endpoint that doesn't match the endpoint the packet
9069        /// was sent from in forward trace. Used only for return traces.
9070        DroppedInsideGoogleManagedService,
9071        /// Packet is dropped due to a load balancer backend instance not having a
9072        /// network interface in the network expected by the load balancer.
9073        LoadBalancerBackendInvalidNetwork,
9074        /// Packet is dropped due to a backend service named port not being defined
9075        /// on the instance group level.
9076        BackendServiceNamedPortNotDefined,
9077        /// Packet is dropped due to a destination IP range being part of a Private
9078        /// NAT IP range.
9079        DestinationIsPrivateNatIpRange,
9080        /// Generic drop cause for a packet being dropped inside a Redis Instance
9081        /// service project.
9082        DroppedInsideRedisInstanceService,
9083        /// Packet is dropped due to an unsupported port being used to connect to a
9084        /// Redis Instance. Port 6379 should be used to connect to a Redis Instance.
9085        RedisInstanceUnsupportedPort,
9086        /// Packet is dropped due to connecting from PUPI address to a PSA based
9087        /// Redis Instance.
9088        RedisInstanceConnectingFromPupiAddress,
9089        /// Packet is dropped due to no route to the destination network.
9090        RedisInstanceNoRouteToDestinationNetwork,
9091        /// Redis Instance does not have an external IP address.
9092        RedisInstanceNoExternalIp,
9093        /// Packet is dropped due to an unsupported protocol being used to connect to
9094        /// a Redis Instance. Only TCP connections are accepted by a Redis Instance.
9095        RedisInstanceUnsupportedProtocol,
9096        /// Generic drop cause for a packet being dropped inside a Redis Cluster
9097        /// service project.
9098        DroppedInsideRedisClusterService,
9099        /// Packet is dropped due to an unsupported port being used to connect to a
9100        /// Redis Cluster. Ports 6379 and 11000 to 13047 should be used to connect to
9101        /// a Redis Cluster.
9102        RedisClusterUnsupportedPort,
9103        /// Redis Cluster does not have an external IP address.
9104        RedisClusterNoExternalIp,
9105        /// Packet is dropped due to an unsupported protocol being used to connect to
9106        /// a Redis Cluster. Only TCP connections are accepted by a Redis Cluster.
9107        RedisClusterUnsupportedProtocol,
9108        /// Packet from the non-GCP (on-prem) or unknown GCP network is dropped due
9109        /// to the destination IP address not belonging to any IP prefix advertised
9110        /// via BGP by the Cloud Router.
9111        NoAdvertisedRouteToGcpDestination,
9112        /// Packet from the non-GCP (on-prem) or unknown GCP network is dropped due
9113        /// to the destination IP address not belonging to any IP prefix included to
9114        /// the local traffic selector of the VPN tunnel.
9115        NoTrafficSelectorToGcpDestination,
9116        /// Packet from the unknown peered network is dropped due to no known route
9117        /// from the source network to the destination IP address.
9118        NoKnownRouteFromPeeredNetworkToDestination,
9119        /// Sending packets processed by the Private NAT Gateways to the Private
9120        /// Service Connect endpoints is not supported.
9121        PrivateNatToPscEndpointUnsupported,
9122        /// Packet is sent to the PSC port mapping service, but its destination port
9123        /// does not match any port mapping rules.
9124        PscPortMappingPortMismatch,
9125        /// Sending packets directly to the PSC port mapping service without going
9126        /// through the PSC connection is not supported.
9127        PscPortMappingWithoutPscConnectionUnsupported,
9128        /// Packet with destination IP address within the reserved NAT64 range is
9129        /// dropped due to matching a route of an unsupported type.
9130        UnsupportedRouteMatchedForNat64Destination,
9131        /// Packet could be dropped because hybrid endpoint like a VPN gateway or
9132        /// Interconnect is not allowed to send traffic to the Internet.
9133        TrafficFromHybridEndpointToInternetDisallowed,
9134        /// Packet with destination IP address within the reserved NAT64 range is
9135        /// dropped due to no matching NAT gateway in the subnet.
9136        NoMatchingNat64Gateway,
9137        /// Packet is dropped due to being sent to a backend of a passthrough load
9138        /// balancer that doesn't use the same IP version as the frontend.
9139        LoadBalancerBackendIpVersionMismatch,
9140        /// Packet from the unknown NCC network is dropped due to no known route
9141        /// from the source network to the destination IP address.
9142        NoKnownRouteFromNccNetworkToDestination,
9143        /// Packet is dropped by Cloud NAT due to using an unsupported protocol.
9144        CloudNatProtocolUnsupported,
9145        /// Packet is dropped due to using an unsupported protocol (any other than
9146        /// UDP) for L2 Interconnect.
9147        L2InterconnectUnsupportedProtocol,
9148        /// Packet is dropped due to using an unsupported port (any other than
9149        /// 6081) for L2 Interconnect.
9150        L2InterconnectUnsupportedPort,
9151        /// Packet is dropped due to destination IP not matching the appliance
9152        /// mapping IPs configured on the L2 Interconnect attachment.
9153        L2InterconnectDestinationIpMismatch,
9154        /// Packet could be dropped because it matches a route associated with an NCC
9155        /// spoke in the hybrid subnet context, but such a configuration is not
9156        /// supported.
9157        NccRouteWithinHybridSubnetUnsupported,
9158        /// Packet is dropped because the region of the hybrid subnet is different
9159        /// from the region of the next hop of the route matched within this hybrid
9160        /// subnet.
9161        HybridSubnetRegionMismatch,
9162        /// If set, the enum was initialized with an unknown value.
9163        ///
9164        /// Applications can examine the value using [Cause::value] or
9165        /// [Cause::name].
9166        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        /// Gets the enum value.
9179        ///
9180        /// Returns `None` if the enum contains an unknown value deserialized from
9181        /// the string representation of enums.
9182        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        /// Gets the enum value as a string.
9300        ///
9301        /// Returns `None` if the enum contains an unknown value deserialized from
9302        /// the integer representation of enums.
9303        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/// For display only. Metadata associated with a Google Kubernetes Engine (GKE)
10006/// cluster master.
10007#[derive(Clone, Default, PartialEq)]
10008#[non_exhaustive]
10009pub struct GKEMasterInfo {
10010    /// URI of a GKE cluster.
10011    pub cluster_uri: std::string::String,
10012
10013    /// URI of a GKE cluster network.
10014    pub cluster_network_uri: std::string::String,
10015
10016    /// Internal IP address of a GKE cluster control plane.
10017    pub internal_ip: std::string::String,
10018
10019    /// External IP address of a GKE cluster control plane.
10020    pub external_ip: std::string::String,
10021
10022    /// DNS endpoint of a GKE cluster control plane.
10023    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    /// Sets the value of [cluster_uri][crate::model::GKEMasterInfo::cluster_uri].
10034    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    /// Sets the value of [cluster_network_uri][crate::model::GKEMasterInfo::cluster_network_uri].
10040    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    /// Sets the value of [internal_ip][crate::model::GKEMasterInfo::internal_ip].
10049    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    /// Sets the value of [external_ip][crate::model::GKEMasterInfo::external_ip].
10055    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    /// Sets the value of [dns_endpoint][crate::model::GKEMasterInfo::dns_endpoint].
10061    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/// For display only. Metadata associated with a Cloud SQL instance.
10074#[derive(Clone, Default, PartialEq)]
10075#[non_exhaustive]
10076pub struct CloudSQLInstanceInfo {
10077    /// Name of a Cloud SQL instance.
10078    pub display_name: std::string::String,
10079
10080    /// URI of a Cloud SQL instance.
10081    pub uri: std::string::String,
10082
10083    /// URI of a Cloud SQL instance network or empty string if the instance does
10084    /// not have one.
10085    pub network_uri: std::string::String,
10086
10087    /// Internal IP address of a Cloud SQL instance.
10088    pub internal_ip: std::string::String,
10089
10090    /// External IP address of a Cloud SQL instance.
10091    pub external_ip: std::string::String,
10092
10093    /// Region in which the Cloud SQL instance is running.
10094    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    /// Sets the value of [display_name][crate::model::CloudSQLInstanceInfo::display_name].
10105    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    /// Sets the value of [uri][crate::model::CloudSQLInstanceInfo::uri].
10111    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    /// Sets the value of [network_uri][crate::model::CloudSQLInstanceInfo::network_uri].
10117    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    /// Sets the value of [internal_ip][crate::model::CloudSQLInstanceInfo::internal_ip].
10123    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    /// Sets the value of [external_ip][crate::model::CloudSQLInstanceInfo::external_ip].
10129    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    /// Sets the value of [region][crate::model::CloudSQLInstanceInfo::region].
10135    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/// For display only. Metadata associated with a Cloud Redis Instance.
10148#[derive(Clone, Default, PartialEq)]
10149#[non_exhaustive]
10150pub struct RedisInstanceInfo {
10151    /// Name of a Cloud Redis Instance.
10152    pub display_name: std::string::String,
10153
10154    /// URI of a Cloud Redis Instance.
10155    pub uri: std::string::String,
10156
10157    /// URI of a Cloud Redis Instance network.
10158    pub network_uri: std::string::String,
10159
10160    /// Primary endpoint IP address of a Cloud Redis Instance.
10161    pub primary_endpoint_ip: std::string::String,
10162
10163    /// Read endpoint IP address of a Cloud Redis Instance (if applicable).
10164    pub read_endpoint_ip: std::string::String,
10165
10166    /// Region in which the Cloud Redis Instance is defined.
10167    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    /// Sets the value of [display_name][crate::model::RedisInstanceInfo::display_name].
10178    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    /// Sets the value of [uri][crate::model::RedisInstanceInfo::uri].
10184    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    /// Sets the value of [network_uri][crate::model::RedisInstanceInfo::network_uri].
10190    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    /// Sets the value of [primary_endpoint_ip][crate::model::RedisInstanceInfo::primary_endpoint_ip].
10196    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    /// Sets the value of [read_endpoint_ip][crate::model::RedisInstanceInfo::read_endpoint_ip].
10205    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    /// Sets the value of [region][crate::model::RedisInstanceInfo::region].
10214    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/// For display only. Metadata associated with a Redis Cluster.
10227#[derive(Clone, Default, PartialEq)]
10228#[non_exhaustive]
10229pub struct RedisClusterInfo {
10230    /// Name of a Redis Cluster.
10231    pub display_name: std::string::String,
10232
10233    /// URI of a Redis Cluster in format
10234    /// "projects/{project_id}/locations/{location}/clusters/{cluster_id}"
10235    pub uri: std::string::String,
10236
10237    /// URI of the network containing the Redis Cluster endpoints in format
10238    /// "projects/{project_id}/global/networks/{network_id}".
10239    pub network_uri: std::string::String,
10240
10241    /// Discovery endpoint IP address of a Redis Cluster.
10242    pub discovery_endpoint_ip_address: std::string::String,
10243
10244    /// Secondary endpoint IP address of a Redis Cluster.
10245    pub secondary_endpoint_ip_address: std::string::String,
10246
10247    /// Name of the region in which the Redis Cluster is defined. For example,
10248    /// "us-central1".
10249    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    /// Sets the value of [display_name][crate::model::RedisClusterInfo::display_name].
10260    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    /// Sets the value of [uri][crate::model::RedisClusterInfo::uri].
10266    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    /// Sets the value of [network_uri][crate::model::RedisClusterInfo::network_uri].
10272    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    /// Sets the value of [discovery_endpoint_ip_address][crate::model::RedisClusterInfo::discovery_endpoint_ip_address].
10278    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    /// Sets the value of [secondary_endpoint_ip_address][crate::model::RedisClusterInfo::secondary_endpoint_ip_address].
10287    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    /// Sets the value of [location][crate::model::RedisClusterInfo::location].
10296    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/// For display only. Metadata associated with a Cloud Function.
10309#[derive(Clone, Default, PartialEq)]
10310#[non_exhaustive]
10311pub struct CloudFunctionInfo {
10312    /// Name of a Cloud Function.
10313    pub display_name: std::string::String,
10314
10315    /// URI of a Cloud Function.
10316    pub uri: std::string::String,
10317
10318    /// Location in which the Cloud Function is deployed.
10319    pub location: std::string::String,
10320
10321    /// Latest successfully deployed version id of the Cloud Function.
10322    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    /// Sets the value of [display_name][crate::model::CloudFunctionInfo::display_name].
10333    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    /// Sets the value of [uri][crate::model::CloudFunctionInfo::uri].
10339    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    /// Sets the value of [location][crate::model::CloudFunctionInfo::location].
10345    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    /// Sets the value of [version_id][crate::model::CloudFunctionInfo::version_id].
10351    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/// For display only. Metadata associated with a Cloud Run revision.
10364#[derive(Clone, Default, PartialEq)]
10365#[non_exhaustive]
10366pub struct CloudRunRevisionInfo {
10367    /// Name of a Cloud Run revision.
10368    pub display_name: std::string::String,
10369
10370    /// URI of a Cloud Run revision.
10371    pub uri: std::string::String,
10372
10373    /// Location in which this revision is deployed.
10374    pub location: std::string::String,
10375
10376    /// URI of Cloud Run service this revision belongs to.
10377    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    /// Sets the value of [display_name][crate::model::CloudRunRevisionInfo::display_name].
10388    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    /// Sets the value of [uri][crate::model::CloudRunRevisionInfo::uri].
10394    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    /// Sets the value of [location][crate::model::CloudRunRevisionInfo::location].
10400    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    /// Sets the value of [service_uri][crate::model::CloudRunRevisionInfo::service_uri].
10406    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/// For display only. Metadata associated with an App Engine version.
10419#[derive(Clone, Default, PartialEq)]
10420#[non_exhaustive]
10421pub struct AppEngineVersionInfo {
10422    /// Name of an App Engine version.
10423    pub display_name: std::string::String,
10424
10425    /// URI of an App Engine version.
10426    pub uri: std::string::String,
10427
10428    /// Runtime of the App Engine version.
10429    pub runtime: std::string::String,
10430
10431    /// App Engine execution environment for a version.
10432    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    /// Sets the value of [display_name][crate::model::AppEngineVersionInfo::display_name].
10443    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    /// Sets the value of [uri][crate::model::AppEngineVersionInfo::uri].
10449    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    /// Sets the value of [runtime][crate::model::AppEngineVersionInfo::runtime].
10455    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    /// Sets the value of [environment][crate::model::AppEngineVersionInfo::environment].
10461    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/// For display only. Metadata associated with a VPC connector.
10474#[derive(Clone, Default, PartialEq)]
10475#[non_exhaustive]
10476pub struct VpcConnectorInfo {
10477    /// Name of a VPC connector.
10478    pub display_name: std::string::String,
10479
10480    /// URI of a VPC connector.
10481    pub uri: std::string::String,
10482
10483    /// Location in which the VPC connector is deployed.
10484    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    /// Sets the value of [display_name][crate::model::VpcConnectorInfo::display_name].
10495    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    /// Sets the value of [uri][crate::model::VpcConnectorInfo::uri].
10501    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    /// Sets the value of [location][crate::model::VpcConnectorInfo::location].
10507    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/// For display only. Metadata associated with a serverless direct VPC egress
10520/// connection.
10521#[derive(Clone, Default, PartialEq)]
10522#[non_exhaustive]
10523pub struct DirectVpcEgressConnectionInfo {
10524    /// URI of direct access network.
10525    pub network_uri: std::string::String,
10526
10527    /// URI of direct access subnetwork.
10528    pub subnetwork_uri: std::string::String,
10529
10530    /// Selected IP range.
10531    pub selected_ip_range: std::string::String,
10532
10533    /// Selected starting IP address, from the selected IP range.
10534    pub selected_ip_address: std::string::String,
10535
10536    /// Region in which the Direct VPC egress is deployed.
10537    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    /// Sets the value of [network_uri][crate::model::DirectVpcEgressConnectionInfo::network_uri].
10548    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    /// Sets the value of [subnetwork_uri][crate::model::DirectVpcEgressConnectionInfo::subnetwork_uri].
10554    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    /// Sets the value of [selected_ip_range][crate::model::DirectVpcEgressConnectionInfo::selected_ip_range].
10560    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    /// Sets the value of [selected_ip_address][crate::model::DirectVpcEgressConnectionInfo::selected_ip_address].
10569    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    /// Sets the value of [region][crate::model::DirectVpcEgressConnectionInfo::region].
10578    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/// For display only. Metadata associated with a serverless public connection.
10591#[derive(Clone, Default, PartialEq)]
10592#[non_exhaustive]
10593pub struct ServerlessExternalConnectionInfo {
10594    /// Selected starting IP address, from the Google dynamic address pool.
10595    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    /// Sets the value of [selected_ip_address][crate::model::ServerlessExternalConnectionInfo::selected_ip_address].
10606    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/// For display only. Metadata associated with NAT.
10622#[derive(Clone, Default, PartialEq)]
10623#[non_exhaustive]
10624pub struct NatInfo {
10625    /// Type of NAT.
10626    pub r#type: crate::model::nat_info::Type,
10627
10628    /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
10629    pub protocol: std::string::String,
10630
10631    /// URI of the network where NAT translation takes place.
10632    pub network_uri: std::string::String,
10633
10634    /// Source IP address before NAT translation.
10635    pub old_source_ip: std::string::String,
10636
10637    /// Source IP address after NAT translation.
10638    pub new_source_ip: std::string::String,
10639
10640    /// Destination IP address before NAT translation.
10641    pub old_destination_ip: std::string::String,
10642
10643    /// Destination IP address after NAT translation.
10644    pub new_destination_ip: std::string::String,
10645
10646    /// Source port before NAT translation. Only valid when protocol is TCP or UDP.
10647    pub old_source_port: i32,
10648
10649    /// Source port after NAT translation. Only valid when protocol is TCP or UDP.
10650    pub new_source_port: i32,
10651
10652    /// Destination port before NAT translation. Only valid when protocol is TCP or
10653    /// UDP.
10654    pub old_destination_port: i32,
10655
10656    /// Destination port after NAT translation. Only valid when protocol is TCP or
10657    /// UDP.
10658    pub new_destination_port: i32,
10659
10660    /// Uri of the Cloud Router. Only valid when type is CLOUD_NAT.
10661    pub router_uri: std::string::String,
10662
10663    /// The name of Cloud NAT Gateway. Only valid when type is CLOUD_NAT.
10664    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    /// Sets the value of [r#type][crate::model::NatInfo::type].
10675    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    /// Sets the value of [protocol][crate::model::NatInfo::protocol].
10681    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    /// Sets the value of [network_uri][crate::model::NatInfo::network_uri].
10687    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    /// Sets the value of [old_source_ip][crate::model::NatInfo::old_source_ip].
10693    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    /// Sets the value of [new_source_ip][crate::model::NatInfo::new_source_ip].
10699    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    /// Sets the value of [old_destination_ip][crate::model::NatInfo::old_destination_ip].
10705    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    /// Sets the value of [new_destination_ip][crate::model::NatInfo::new_destination_ip].
10714    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    /// Sets the value of [old_source_port][crate::model::NatInfo::old_source_port].
10723    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    /// Sets the value of [new_source_port][crate::model::NatInfo::new_source_port].
10729    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    /// Sets the value of [old_destination_port][crate::model::NatInfo::old_destination_port].
10735    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    /// Sets the value of [new_destination_port][crate::model::NatInfo::new_destination_port].
10741    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    /// Sets the value of [router_uri][crate::model::NatInfo::router_uri].
10747    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    /// Sets the value of [nat_gateway_name][crate::model::NatInfo::nat_gateway_name].
10753    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
10768/// Defines additional types related to [NatInfo].
10769pub mod nat_info {
10770    #[allow(unused_imports)]
10771    use super::*;
10772
10773    /// Types of NAT.
10774    ///
10775    /// # Working with unknown values
10776    ///
10777    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10778    /// additional enum variants at any time. Adding new variants is not considered
10779    /// a breaking change. Applications should write their code in anticipation of:
10780    ///
10781    /// - New values appearing in future releases of the client library, **and**
10782    /// - New values received dynamically, without application changes.
10783    ///
10784    /// Please consult the [Working with enums] section in the user guide for some
10785    /// guidelines.
10786    ///
10787    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10788    #[derive(Clone, Debug, PartialEq)]
10789    #[non_exhaustive]
10790    pub enum Type {
10791        /// Type is unspecified.
10792        Unspecified,
10793        /// From Compute Engine instance's internal address to external address.
10794        InternalToExternal,
10795        /// From Compute Engine instance's external address to internal address.
10796        ExternalToInternal,
10797        /// Cloud NAT Gateway.
10798        CloudNat,
10799        /// Private service connect NAT.
10800        PrivateServiceConnect,
10801        /// GKE Pod IP address masquerading.
10802        GkePodIpMasquerading,
10803        /// If set, the enum was initialized with an unknown value.
10804        ///
10805        /// Applications can examine the value using [Type::value] or
10806        /// [Type::name].
10807        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        /// Gets the enum value.
10820        ///
10821        /// Returns `None` if the enum contains an unknown value deserialized from
10822        /// the string representation of enums.
10823        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        /// Gets the enum value as a string.
10836        ///
10837        /// Returns `None` if the enum contains an unknown value deserialized from
10838        /// the integer representation of enums.
10839        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/// For display only. Metadata associated with ProxyConnection.
10928#[derive(Clone, Default, PartialEq)]
10929#[non_exhaustive]
10930pub struct ProxyConnectionInfo {
10931    /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
10932    pub protocol: std::string::String,
10933
10934    /// Source IP address of an original connection.
10935    pub old_source_ip: std::string::String,
10936
10937    /// Source IP address of a new connection.
10938    pub new_source_ip: std::string::String,
10939
10940    /// Destination IP address of an original connection
10941    pub old_destination_ip: std::string::String,
10942
10943    /// Destination IP address of a new connection.
10944    pub new_destination_ip: std::string::String,
10945
10946    /// Source port of an original connection. Only valid when protocol is TCP or
10947    /// UDP.
10948    pub old_source_port: i32,
10949
10950    /// Source port of a new connection. Only valid when protocol is TCP or UDP.
10951    pub new_source_port: i32,
10952
10953    /// Destination port of an original connection. Only valid when protocol is TCP
10954    /// or UDP.
10955    pub old_destination_port: i32,
10956
10957    /// Destination port of a new connection. Only valid when protocol is TCP or
10958    /// UDP.
10959    pub new_destination_port: i32,
10960
10961    /// Uri of proxy subnet.
10962    pub subnet_uri: std::string::String,
10963
10964    /// URI of the network where connection is proxied.
10965    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    /// Sets the value of [protocol][crate::model::ProxyConnectionInfo::protocol].
10976    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    /// Sets the value of [old_source_ip][crate::model::ProxyConnectionInfo::old_source_ip].
10982    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    /// Sets the value of [new_source_ip][crate::model::ProxyConnectionInfo::new_source_ip].
10988    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    /// Sets the value of [old_destination_ip][crate::model::ProxyConnectionInfo::old_destination_ip].
10994    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    /// Sets the value of [new_destination_ip][crate::model::ProxyConnectionInfo::new_destination_ip].
11003    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    /// Sets the value of [old_source_port][crate::model::ProxyConnectionInfo::old_source_port].
11012    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    /// Sets the value of [new_source_port][crate::model::ProxyConnectionInfo::new_source_port].
11018    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    /// Sets the value of [old_destination_port][crate::model::ProxyConnectionInfo::old_destination_port].
11024    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    /// Sets the value of [new_destination_port][crate::model::ProxyConnectionInfo::new_destination_port].
11030    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    /// Sets the value of [subnet_uri][crate::model::ProxyConnectionInfo::subnet_uri].
11036    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    /// Sets the value of [network_uri][crate::model::ProxyConnectionInfo::network_uri].
11042    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/// For display only. Metadata associated with the load balancer backend.
11055#[derive(Clone, Default, PartialEq)]
11056#[non_exhaustive]
11057pub struct LoadBalancerBackendInfo {
11058    /// Display name of the backend. For example, it might be an instance name for
11059    /// the instance group backends, or an IP address and port for zonal network
11060    /// endpoint group backends.
11061    pub name: std::string::String,
11062
11063    /// URI of the backend instance (if applicable). Populated for instance group
11064    /// backends, and zonal NEG backends.
11065    pub instance_uri: std::string::String,
11066
11067    /// URI of the backend service this backend belongs to (if applicable).
11068    pub backend_service_uri: std::string::String,
11069
11070    /// URI of the instance group this backend belongs to (if applicable).
11071    pub instance_group_uri: std::string::String,
11072
11073    /// URI of the network endpoint group this backend belongs to (if applicable).
11074    pub network_endpoint_group_uri: std::string::String,
11075
11076    /// URI of the backend bucket this backend targets (if applicable).
11077    pub backend_bucket_uri: std::string::String,
11078
11079    /// URI of the PSC service attachment this PSC NEG backend targets (if
11080    /// applicable).
11081    pub psc_service_attachment_uri: std::string::String,
11082
11083    /// PSC Google API target this PSC NEG backend targets (if applicable).
11084    pub psc_google_api_target: std::string::String,
11085
11086    /// URI of the health check attached to this backend (if applicable).
11087    pub health_check_uri: std::string::String,
11088
11089    /// Output only. Health check firewalls configuration state for the backend.
11090    /// This is a result of the static firewall analysis (verifying that health
11091    /// check traffic from required IP ranges to the backend is allowed or not).
11092    /// The backend might still be unhealthy even if these firewalls are
11093    /// configured. Please refer to the documentation for more information:
11094    /// <https://cloud.google.com/load-balancing/docs/firewall-rules>
11095    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    /// Sets the value of [name][crate::model::LoadBalancerBackendInfo::name].
11107    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    /// Sets the value of [instance_uri][crate::model::LoadBalancerBackendInfo::instance_uri].
11113    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    /// Sets the value of [backend_service_uri][crate::model::LoadBalancerBackendInfo::backend_service_uri].
11119    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    /// Sets the value of [instance_group_uri][crate::model::LoadBalancerBackendInfo::instance_group_uri].
11128    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    /// Sets the value of [network_endpoint_group_uri][crate::model::LoadBalancerBackendInfo::network_endpoint_group_uri].
11137    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    /// Sets the value of [backend_bucket_uri][crate::model::LoadBalancerBackendInfo::backend_bucket_uri].
11146    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    /// Sets the value of [psc_service_attachment_uri][crate::model::LoadBalancerBackendInfo::psc_service_attachment_uri].
11155    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    /// Sets the value of [psc_google_api_target][crate::model::LoadBalancerBackendInfo::psc_google_api_target].
11164    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    /// Sets the value of [health_check_uri][crate::model::LoadBalancerBackendInfo::health_check_uri].
11173    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    /// Sets the value of [health_check_firewalls_config_state][crate::model::LoadBalancerBackendInfo::health_check_firewalls_config_state].
11182    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
11201/// Defines additional types related to [LoadBalancerBackendInfo].
11202pub mod load_balancer_backend_info {
11203    #[allow(unused_imports)]
11204    use super::*;
11205
11206    /// Health check firewalls configuration state enum.
11207    ///
11208    /// # Working with unknown values
11209    ///
11210    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11211    /// additional enum variants at any time. Adding new variants is not considered
11212    /// a breaking change. Applications should write their code in anticipation of:
11213    ///
11214    /// - New values appearing in future releases of the client library, **and**
11215    /// - New values received dynamically, without application changes.
11216    ///
11217    /// Please consult the [Working with enums] section in the user guide for some
11218    /// guidelines.
11219    ///
11220    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11221    #[derive(Clone, Debug, PartialEq)]
11222    #[non_exhaustive]
11223    pub enum HealthCheckFirewallsConfigState {
11224        /// Configuration state unspecified. It usually means that the backend has
11225        /// no health check attached, or there was an unexpected configuration error
11226        /// preventing Connectivity tests from verifying health check configuration.
11227        Unspecified,
11228        /// Firewall rules (policies) allowing health check traffic from all required
11229        /// IP ranges to the backend are configured.
11230        FirewallsConfigured,
11231        /// Firewall rules (policies) allow health check traffic only from a part of
11232        /// required IP ranges.
11233        FirewallsPartiallyConfigured,
11234        /// Firewall rules (policies) deny health check traffic from all required
11235        /// IP ranges to the backend.
11236        FirewallsNotConfigured,
11237        /// The network contains firewall rules of unsupported types, so Connectivity
11238        /// tests were not able to verify health check configuration status. Please
11239        /// refer to the documentation for the list of unsupported configurations:
11240        /// <https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/concepts/overview#unsupported-configs>
11241        FirewallsUnsupported,
11242        /// If set, the enum was initialized with an unknown value.
11243        ///
11244        /// Applications can examine the value using [HealthCheckFirewallsConfigState::value] or
11245        /// [HealthCheckFirewallsConfigState::name].
11246        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        /// Gets the enum value.
11259        ///
11260        /// Returns `None` if the enum contains an unknown value deserialized from
11261        /// the string representation of enums.
11262        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        /// Gets the enum value as a string.
11274        ///
11275        /// Returns `None` if the enum contains an unknown value deserialized from
11276        /// the integer representation of enums.
11277        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/// For display only. Metadata associated with Storage Bucket.
11367#[derive(Clone, Default, PartialEq)]
11368#[non_exhaustive]
11369pub struct StorageBucketInfo {
11370    /// Cloud Storage Bucket name.
11371    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    /// Sets the value of [bucket][crate::model::StorageBucketInfo::bucket].
11382    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/// For display only. Metadata associated with the serverless network endpoint
11395/// group backend.
11396#[derive(Clone, Default, PartialEq)]
11397#[non_exhaustive]
11398pub struct ServerlessNegInfo {
11399    /// URI of the serverless network endpoint group.
11400    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    /// Sets the value of [neg_uri][crate::model::ServerlessNegInfo::neg_uri].
11411    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/// Request for the `ListVpcFlowLogsConfigs` method.
11424#[derive(Clone, Default, PartialEq)]
11425#[non_exhaustive]
11426pub struct ListVpcFlowLogsConfigsRequest {
11427    /// Required. The parent resource of the VpcFlowLogsConfig,
11428    /// in one of the following formats:
11429    ///
11430    /// - For project-level resourcs: `projects/{project_id}/locations/global`
11431    ///
11432    /// - For organization-level resources:
11433    ///   `organizations/{organization_id}/locations/global`
11434    ///
11435    pub parent: std::string::String,
11436
11437    /// Optional. Number of `VpcFlowLogsConfigs` to return.
11438    pub page_size: i32,
11439
11440    /// Optional. Page token from an earlier query, as returned in
11441    /// `next_page_token`.
11442    pub page_token: std::string::String,
11443
11444    /// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
11445    /// A filter expression must use the supported [CEL logic operators]
11446    /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
11447    pub filter: std::string::String,
11448
11449    /// Optional. Field to use to sort the list.
11450    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    /// Sets the value of [parent][crate::model::ListVpcFlowLogsConfigsRequest::parent].
11461    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    /// Sets the value of [page_size][crate::model::ListVpcFlowLogsConfigsRequest::page_size].
11467    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    /// Sets the value of [page_token][crate::model::ListVpcFlowLogsConfigsRequest::page_token].
11473    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    /// Sets the value of [filter][crate::model::ListVpcFlowLogsConfigsRequest::filter].
11479    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    /// Sets the value of [order_by][crate::model::ListVpcFlowLogsConfigsRequest::order_by].
11485    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/// Response for the `ListVpcFlowLogsConfigs` method.
11498#[derive(Clone, Default, PartialEq)]
11499#[non_exhaustive]
11500pub struct ListVpcFlowLogsConfigsResponse {
11501    /// List of VPC Flow Log configurations.
11502    pub vpc_flow_logs_configs: std::vec::Vec<crate::model::VpcFlowLogsConfig>,
11503
11504    /// Page token to fetch the next set of configurations.
11505    pub next_page_token: std::string::String,
11506
11507    /// Locations that could not be reached (when querying all locations with `-`).
11508    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    /// Sets the value of [vpc_flow_logs_configs][crate::model::ListVpcFlowLogsConfigsResponse::vpc_flow_logs_configs].
11519    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    /// Sets the value of [next_page_token][crate::model::ListVpcFlowLogsConfigsResponse::next_page_token].
11530    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    /// Sets the value of [unreachable][crate::model::ListVpcFlowLogsConfigsResponse::unreachable].
11536    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/// Request for the `GetVpcFlowLogsConfig` method.
11568#[derive(Clone, Default, PartialEq)]
11569#[non_exhaustive]
11570pub struct GetVpcFlowLogsConfigRequest {
11571    /// Required. The resource name of the VpcFlowLogsConfig,
11572    /// in one of the following formats:
11573    ///
11574    /// - For project-level resources:
11575    ///   `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
11576    ///
11577    /// - For organization-level resources:
11578    ///   `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
11579    ///
11580    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    /// Sets the value of [name][crate::model::GetVpcFlowLogsConfigRequest::name].
11591    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/// Request for the `CreateVpcFlowLogsConfig` method.
11604#[derive(Clone, Default, PartialEq)]
11605#[non_exhaustive]
11606pub struct CreateVpcFlowLogsConfigRequest {
11607    /// Required. The parent resource of the VpcFlowLogsConfig to create,
11608    /// in one of the following formats:
11609    ///
11610    /// - For project-level resources: `projects/{project_id}/locations/global`
11611    ///
11612    /// - For organization-level resources:
11613    ///   `organizations/{organization_id}/locations/global`
11614    ///
11615    pub parent: std::string::String,
11616
11617    /// Required. ID of the `VpcFlowLogsConfig`.
11618    pub vpc_flow_logs_config_id: std::string::String,
11619
11620    /// Required. A `VpcFlowLogsConfig` resource
11621    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    /// Sets the value of [parent][crate::model::CreateVpcFlowLogsConfigRequest::parent].
11632    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    /// Sets the value of [vpc_flow_logs_config_id][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config_id].
11638    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    /// Sets the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
11647    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    /// Sets or clears the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
11656    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/// Request for the `UpdateVpcFlowLogsConfig` method.
11672#[derive(Clone, Default, PartialEq)]
11673#[non_exhaustive]
11674pub struct UpdateVpcFlowLogsConfigRequest {
11675    /// Required. Mask of fields to update. At least one path must be supplied in
11676    /// this field.
11677    /// For example, to change the state of the configuration to ENABLED, specify
11678    /// `update_mask` = `"state"`, and the `vpc_flow_logs_config` would be:
11679    /// `vpc_flow_logs_config = {
11680    /// name =
11681    /// "projects/my-project/locations/global/vpcFlowLogsConfigs/my-config"
11682    /// state = "ENABLED" }`
11683    pub update_mask: std::option::Option<wkt::FieldMask>,
11684
11685    /// Required. Only fields specified in update_mask are updated.
11686    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    /// Sets the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
11697    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    /// Sets or clears the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
11706    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    /// Sets the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
11715    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    /// Sets or clears the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
11724    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/// Request for the `DeleteVpcFlowLogsConfig` method.
11740#[derive(Clone, Default, PartialEq)]
11741#[non_exhaustive]
11742pub struct DeleteVpcFlowLogsConfigRequest {
11743    /// Required. The resource name of the VpcFlowLogsConfig,
11744    /// in one of the following formats:
11745    ///
11746    /// - For a project-level resource:
11747    ///   `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
11748    ///
11749    /// - For an organization-level resource:
11750    ///   `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
11751    ///
11752    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    /// Sets the value of [name][crate::model::DeleteVpcFlowLogsConfigRequest::name].
11763    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/// Request for the `QueryOrgVpcFlowLogsConfigs` method.
11776#[derive(Clone, Default, PartialEq)]
11777#[non_exhaustive]
11778pub struct QueryOrgVpcFlowLogsConfigsRequest {
11779    /// Required. The parent resource of the VpcFlowLogsConfig, specified in
11780    /// the following format: `projects/{project_id}/locations/global`
11781    pub parent: std::string::String,
11782
11783    /// Optional. Number of `VpcFlowLogsConfigs` to return.
11784    pub page_size: i32,
11785
11786    /// Optional. Page token from an earlier query, as returned in
11787    /// `next_page_token`.
11788    pub page_token: std::string::String,
11789
11790    /// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
11791    /// A filter expression must use the supported [CEL logic operators]
11792    /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
11793    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    /// Sets the value of [parent][crate::model::QueryOrgVpcFlowLogsConfigsRequest::parent].
11804    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    /// Sets the value of [page_size][crate::model::QueryOrgVpcFlowLogsConfigsRequest::page_size].
11810    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    /// Sets the value of [page_token][crate::model::QueryOrgVpcFlowLogsConfigsRequest::page_token].
11816    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    /// Sets the value of [filter][crate::model::QueryOrgVpcFlowLogsConfigsRequest::filter].
11822    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/// Response for the `QueryVpcFlowLogsConfigs` method.
11835#[derive(Clone, Default, PartialEq)]
11836#[non_exhaustive]
11837pub struct QueryOrgVpcFlowLogsConfigsResponse {
11838    /// List of VPC Flow Log configurations.
11839    pub vpc_flow_logs_configs: std::vec::Vec<crate::model::VpcFlowLogsConfig>,
11840
11841    /// Page token to fetch the next set of configurations.
11842    pub next_page_token: std::string::String,
11843
11844    /// Locations that could not be reached (when querying all locations with `-`).
11845    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    /// Sets the value of [vpc_flow_logs_configs][crate::model::QueryOrgVpcFlowLogsConfigsResponse::vpc_flow_logs_configs].
11856    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    /// Sets the value of [next_page_token][crate::model::QueryOrgVpcFlowLogsConfigsResponse::next_page_token].
11867    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    /// Sets the value of [unreachable][crate::model::QueryOrgVpcFlowLogsConfigsResponse::unreachable].
11873    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/// Request for the `ShowEffectiveFlowLogsConfigs` method.
11905#[derive(Clone, Default, PartialEq)]
11906#[non_exhaustive]
11907pub struct ShowEffectiveFlowLogsConfigsRequest {
11908    /// Required. The parent resource of the VpcFlowLogsConfig, specified in
11909    /// the following format: `projects/{project_id}/locations/global`
11910    pub parent: std::string::String,
11911
11912    /// Required. The resource to get the effective VPC Flow Logs configuration
11913    /// for. The resource must belong to the same project as the parent. The
11914    /// resource must be a network, subnetwork, interconnect attachment, VPN
11915    /// tunnel, or a project.
11916    pub resource: std::string::String,
11917
11918    /// Optional. Number of `EffectiveVpcFlowLogsConfigs` to return. Default is 30.
11919    pub page_size: i32,
11920
11921    /// Optional. Page token from an earlier query, as returned in
11922    /// `next_page_token`.
11923    pub page_token: std::string::String,
11924
11925    /// Optional. Lists the `EffectiveVpcFlowLogsConfigs` that match the filter
11926    /// expression. A filter expression must use the supported [CEL logic
11927    /// operators]
11928    /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
11929    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    /// Sets the value of [parent][crate::model::ShowEffectiveFlowLogsConfigsRequest::parent].
11940    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    /// Sets the value of [resource][crate::model::ShowEffectiveFlowLogsConfigsRequest::resource].
11946    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    /// Sets the value of [page_size][crate::model::ShowEffectiveFlowLogsConfigsRequest::page_size].
11952    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    /// Sets the value of [page_token][crate::model::ShowEffectiveFlowLogsConfigsRequest::page_token].
11958    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    /// Sets the value of [filter][crate::model::ShowEffectiveFlowLogsConfigsRequest::filter].
11964    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/// Response for the `ShowEffectiveFlowLogsConfigs` method.
11977#[derive(Clone, Default, PartialEq)]
11978#[non_exhaustive]
11979pub struct ShowEffectiveFlowLogsConfigsResponse {
11980    /// List of Effective Vpc Flow Logs configurations.
11981    pub effective_flow_logs_configs: std::vec::Vec<crate::model::EffectiveVpcFlowLogsConfig>,
11982
11983    /// Page token to fetch the next set of configurations.
11984    pub next_page_token: std::string::String,
11985
11986    /// Locations that could not be reached (when querying all locations with `-`).
11987    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    /// Sets the value of [effective_flow_logs_configs][crate::model::ShowEffectiveFlowLogsConfigsResponse::effective_flow_logs_configs].
11998    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    /// Sets the value of [next_page_token][crate::model::ShowEffectiveFlowLogsConfigsResponse::next_page_token].
12009    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    /// Sets the value of [unreachable][crate::model::ShowEffectiveFlowLogsConfigsResponse::unreachable].
12015    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/// A configuration to generate VPC Flow Logs.
12047#[derive(Clone, Default, PartialEq)]
12048#[non_exhaustive]
12049pub struct VpcFlowLogsConfig {
12050    /// Identifier. Unique name of the configuration. The name can have one of the
12051    /// following forms:
12052    ///
12053    /// - For project-level configurations:
12054    ///   `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
12055    ///
12056    /// - For organization-level configurations:
12057    ///   `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
12058    ///
12059    pub name: std::string::String,
12060
12061    /// Optional. The user-supplied description of the VPC Flow Logs configuration.
12062    /// Maximum of 512 characters.
12063    pub description: std::option::Option<std::string::String>,
12064
12065    /// Optional. The state of the VPC Flow Log configuration. Default value is
12066    /// ENABLED. When creating a new configuration, it must be enabled. Setting
12067    /// state=DISABLED will pause the log generation for this config.
12068    pub state: std::option::Option<crate::model::vpc_flow_logs_config::State>,
12069
12070    /// Optional. The aggregation interval for the logs. Default value is
12071    /// INTERVAL_5_SEC.
12072    pub aggregation_interval:
12073        std::option::Option<crate::model::vpc_flow_logs_config::AggregationInterval>,
12074
12075    /// Optional. The value of the field must be in (0, 1]. The sampling rate of
12076    /// VPC Flow Logs where 1.0 means all collected logs are reported. Setting the
12077    /// sampling rate to 0.0 is not allowed. If you want to disable VPC Flow Logs,
12078    /// use the state field instead. Default value is 1.0.
12079    pub flow_sampling: std::option::Option<f32>,
12080
12081    /// Optional. Configures whether all, none or a subset of metadata fields
12082    /// should be added to the reported VPC flow logs. Default value is
12083    /// INCLUDE_ALL_METADATA.
12084    pub metadata: std::option::Option<crate::model::vpc_flow_logs_config::Metadata>,
12085
12086    /// Optional. Custom metadata fields to include in the reported VPC flow logs.
12087    /// Can only be specified if "metadata" was set to CUSTOM_METADATA.
12088    pub metadata_fields: std::vec::Vec<std::string::String>,
12089
12090    /// Optional. Export filter used to define which VPC Flow Logs should be
12091    /// logged.
12092    pub filter_expr: std::option::Option<std::string::String>,
12093
12094    /// Optional. Determines whether to include cross project annotations in the
12095    /// logs. This field is available only for organization configurations. If not
12096    /// specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
12097    pub cross_project_metadata:
12098        std::option::Option<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
12099
12100    /// Output only. Describes the state of the configured target resource for
12101    /// diagnostic purposes.
12102    pub target_resource_state:
12103        std::option::Option<crate::model::vpc_flow_logs_config::TargetResourceState>,
12104
12105    /// Optional. Resource labels to represent user-provided metadata.
12106    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12107
12108    /// Output only. The time the config was created.
12109    pub create_time: std::option::Option<wkt::Timestamp>,
12110
12111    /// Output only. The time the config was updated.
12112    pub update_time: std::option::Option<wkt::Timestamp>,
12113
12114    /// Reference to the resource of the config scope. That is, the scope from
12115    /// which traffic is logged. The target resource must belong to the same
12116    /// project as the configuration.
12117    /// This field is not supported for organization level configurations.
12118    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    /// Sets the value of [name][crate::model::VpcFlowLogsConfig::name].
12129    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    /// Sets the value of [description][crate::model::VpcFlowLogsConfig::description].
12135    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    /// Sets or clears the value of [description][crate::model::VpcFlowLogsConfig::description].
12144    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    /// Sets the value of [state][crate::model::VpcFlowLogsConfig::state].
12153    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    /// Sets or clears the value of [state][crate::model::VpcFlowLogsConfig::state].
12162    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    /// Sets the value of [aggregation_interval][crate::model::VpcFlowLogsConfig::aggregation_interval].
12171    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    /// Sets or clears the value of [aggregation_interval][crate::model::VpcFlowLogsConfig::aggregation_interval].
12180    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    /// Sets the value of [flow_sampling][crate::model::VpcFlowLogsConfig::flow_sampling].
12189    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    /// Sets or clears the value of [flow_sampling][crate::model::VpcFlowLogsConfig::flow_sampling].
12198    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    /// Sets the value of [metadata][crate::model::VpcFlowLogsConfig::metadata].
12207    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    /// Sets or clears the value of [metadata][crate::model::VpcFlowLogsConfig::metadata].
12216    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    /// Sets the value of [metadata_fields][crate::model::VpcFlowLogsConfig::metadata_fields].
12225    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    /// Sets the value of [filter_expr][crate::model::VpcFlowLogsConfig::filter_expr].
12236    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    /// Sets or clears the value of [filter_expr][crate::model::VpcFlowLogsConfig::filter_expr].
12245    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    /// Sets the value of [cross_project_metadata][crate::model::VpcFlowLogsConfig::cross_project_metadata].
12254    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    /// Sets or clears the value of [cross_project_metadata][crate::model::VpcFlowLogsConfig::cross_project_metadata].
12263    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    /// Sets the value of [target_resource_state][crate::model::VpcFlowLogsConfig::target_resource_state].
12272    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    /// Sets or clears the value of [target_resource_state][crate::model::VpcFlowLogsConfig::target_resource_state].
12281    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    /// Sets the value of [labels][crate::model::VpcFlowLogsConfig::labels].
12290    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    /// Sets the value of [create_time][crate::model::VpcFlowLogsConfig::create_time].
12302    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    /// Sets or clears the value of [create_time][crate::model::VpcFlowLogsConfig::create_time].
12311    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    /// Sets the value of [update_time][crate::model::VpcFlowLogsConfig::update_time].
12320    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    /// Sets or clears the value of [update_time][crate::model::VpcFlowLogsConfig::update_time].
12329    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    /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource].
12338    ///
12339    /// Note that all the setters affecting `target_resource` are mutually
12340    /// exclusive.
12341    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    /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
12352    /// if it holds a `Network`, `None` if the field is not set or
12353    /// holds a different branch.
12354    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    /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
12365    /// to hold a `Network`.
12366    ///
12367    /// Note that all the setters affecting `target_resource` are
12368    /// mutually exclusive.
12369    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    /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
12377    /// if it holds a `Subnet`, `None` if the field is not set or
12378    /// holds a different branch.
12379    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    /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
12390    /// to hold a `Subnet`.
12391    ///
12392    /// Note that all the setters affecting `target_resource` are
12393    /// mutually exclusive.
12394    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    /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
12402    /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
12403    /// holds a different branch.
12404    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    /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
12415    /// to hold a `InterconnectAttachment`.
12416    ///
12417    /// Note that all the setters affecting `target_resource` are
12418    /// mutually exclusive.
12419    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    /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
12430    /// if it holds a `VpnTunnel`, `None` if the field is not set or
12431    /// holds a different branch.
12432    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    /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
12443    /// to hold a `VpnTunnel`.
12444    ///
12445    /// Note that all the setters affecting `target_resource` are
12446    /// mutually exclusive.
12447    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
12461/// Defines additional types related to [VpcFlowLogsConfig].
12462pub mod vpc_flow_logs_config {
12463    #[allow(unused_imports)]
12464    use super::*;
12465
12466    /// Determines whether this configuration will be generating logs.
12467    ///
12468    /// # Working with unknown values
12469    ///
12470    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12471    /// additional enum variants at any time. Adding new variants is not considered
12472    /// a breaking change. Applications should write their code in anticipation of:
12473    ///
12474    /// - New values appearing in future releases of the client library, **and**
12475    /// - New values received dynamically, without application changes.
12476    ///
12477    /// Please consult the [Working with enums] section in the user guide for some
12478    /// guidelines.
12479    ///
12480    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12481    #[derive(Clone, Debug, PartialEq)]
12482    #[non_exhaustive]
12483    pub enum State {
12484        /// If not specified, will default to ENABLED.
12485        Unspecified,
12486        /// When ENABLED, this configuration will generate logs.
12487        Enabled,
12488        /// When DISABLED, this configuration will not generate logs.
12489        Disabled,
12490        /// If set, the enum was initialized with an unknown value.
12491        ///
12492        /// Applications can examine the value using [State::value] or
12493        /// [State::name].
12494        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        /// Gets the enum value.
12507        ///
12508        /// Returns `None` if the enum contains an unknown value deserialized from
12509        /// the string representation of enums.
12510        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        /// Gets the enum value as a string.
12520        ///
12521        /// Returns `None` if the enum contains an unknown value deserialized from
12522        /// the integer representation of enums.
12523        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    /// Toggles the aggregation interval for collecting flow logs by 5-tuple.
12599    ///
12600    /// # Working with unknown values
12601    ///
12602    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12603    /// additional enum variants at any time. Adding new variants is not considered
12604    /// a breaking change. Applications should write their code in anticipation of:
12605    ///
12606    /// - New values appearing in future releases of the client library, **and**
12607    /// - New values received dynamically, without application changes.
12608    ///
12609    /// Please consult the [Working with enums] section in the user guide for some
12610    /// guidelines.
12611    ///
12612    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12613    #[derive(Clone, Debug, PartialEq)]
12614    #[non_exhaustive]
12615    pub enum AggregationInterval {
12616        /// If not specified, will default to INTERVAL_5_SEC.
12617        Unspecified,
12618        /// Aggregate logs in 5s intervals.
12619        Interval5Sec,
12620        /// Aggregate logs in 30s intervals.
12621        Interval30Sec,
12622        /// Aggregate logs in 1m intervals.
12623        Interval1Min,
12624        /// Aggregate logs in 5m intervals.
12625        Interval5Min,
12626        /// Aggregate logs in 10m intervals.
12627        Interval10Min,
12628        /// Aggregate logs in 15m intervals.
12629        Interval15Min,
12630        /// If set, the enum was initialized with an unknown value.
12631        ///
12632        /// Applications can examine the value using [AggregationInterval::value] or
12633        /// [AggregationInterval::name].
12634        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        /// Gets the enum value.
12647        ///
12648        /// Returns `None` if the enum contains an unknown value deserialized from
12649        /// the string representation of enums.
12650        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        /// Gets the enum value as a string.
12664        ///
12665        /// Returns `None` if the enum contains an unknown value deserialized from
12666        /// the integer representation of enums.
12667        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    /// Configures which log fields would be included.
12759    ///
12760    /// # Working with unknown values
12761    ///
12762    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12763    /// additional enum variants at any time. Adding new variants is not considered
12764    /// a breaking change. Applications should write their code in anticipation of:
12765    ///
12766    /// - New values appearing in future releases of the client library, **and**
12767    /// - New values received dynamically, without application changes.
12768    ///
12769    /// Please consult the [Working with enums] section in the user guide for some
12770    /// guidelines.
12771    ///
12772    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12773    #[derive(Clone, Debug, PartialEq)]
12774    #[non_exhaustive]
12775    pub enum Metadata {
12776        /// If not specified, will default to INCLUDE_ALL_METADATA.
12777        Unspecified,
12778        /// Include all metadata fields.
12779        IncludeAllMetadata,
12780        /// Exclude all metadata fields.
12781        ExcludeAllMetadata,
12782        /// Include only custom fields (specified in metadata_fields).
12783        CustomMetadata,
12784        /// If set, the enum was initialized with an unknown value.
12785        ///
12786        /// Applications can examine the value using [Metadata::value] or
12787        /// [Metadata::name].
12788        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        /// Gets the enum value.
12801        ///
12802        /// Returns `None` if the enum contains an unknown value deserialized from
12803        /// the string representation of enums.
12804        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        /// Gets the enum value as a string.
12815        ///
12816        /// Returns `None` if the enum contains an unknown value deserialized from
12817        /// the integer representation of enums.
12818        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    /// Determines whether to include cross project annotations in the logs.
12898    /// Project configurations will always have CROSS_PROJECT_METADATA_DISABLED.
12899    ///
12900    /// # Working with unknown values
12901    ///
12902    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12903    /// additional enum variants at any time. Adding new variants is not considered
12904    /// a breaking change. Applications should write their code in anticipation of:
12905    ///
12906    /// - New values appearing in future releases of the client library, **and**
12907    /// - New values received dynamically, without application changes.
12908    ///
12909    /// Please consult the [Working with enums] section in the user guide for some
12910    /// guidelines.
12911    ///
12912    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12913    #[derive(Clone, Debug, PartialEq)]
12914    #[non_exhaustive]
12915    pub enum CrossProjectMetadata {
12916        /// If not specified, the default is CROSS_PROJECT_METADATA_ENABLED.
12917        Unspecified,
12918        /// When CROSS_PROJECT_METADATA_ENABLED, metadata from other projects will be
12919        /// included in the logs.
12920        Enabled,
12921        /// When CROSS_PROJECT_METADATA_DISABLED, metadata from other projects will
12922        /// not be included in the logs.
12923        Disabled,
12924        /// If set, the enum was initialized with an unknown value.
12925        ///
12926        /// Applications can examine the value using [CrossProjectMetadata::value] or
12927        /// [CrossProjectMetadata::name].
12928        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        /// Gets the enum value.
12941        ///
12942        /// Returns `None` if the enum contains an unknown value deserialized from
12943        /// the string representation of enums.
12944        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        /// Gets the enum value as a string.
12954        ///
12955        /// Returns `None` if the enum contains an unknown value deserialized from
12956        /// the integer representation of enums.
12957        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    /// Output only. Indicates whether the target resource exists, for diagnostic
13035    /// purposes.
13036    ///
13037    /// # Working with unknown values
13038    ///
13039    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13040    /// additional enum variants at any time. Adding new variants is not considered
13041    /// a breaking change. Applications should write their code in anticipation of:
13042    ///
13043    /// - New values appearing in future releases of the client library, **and**
13044    /// - New values received dynamically, without application changes.
13045    ///
13046    /// Please consult the [Working with enums] section in the user guide for some
13047    /// guidelines.
13048    ///
13049    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13050    #[derive(Clone, Debug, PartialEq)]
13051    #[non_exhaustive]
13052    pub enum TargetResourceState {
13053        /// Unspecified target resource state.
13054        Unspecified,
13055        /// Indicates that the target resource exists.
13056        TargetResourceExists,
13057        /// Indicates that the target resource does not exist.
13058        TargetResourceDoesNotExist,
13059        /// If set, the enum was initialized with an unknown value.
13060        ///
13061        /// Applications can examine the value using [TargetResourceState::value] or
13062        /// [TargetResourceState::name].
13063        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        /// Gets the enum value.
13076        ///
13077        /// Returns `None` if the enum contains an unknown value deserialized from
13078        /// the string representation of enums.
13079        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        /// Gets the enum value as a string.
13089        ///
13090        /// Returns `None` if the enum contains an unknown value deserialized from
13091        /// the integer representation of enums.
13092        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    /// Reference to the resource of the config scope. That is, the scope from
13170    /// which traffic is logged. The target resource must belong to the same
13171    /// project as the configuration.
13172    /// This field is not supported for organization level configurations.
13173    #[derive(Clone, Debug, PartialEq)]
13174    #[non_exhaustive]
13175    pub enum TargetResource {
13176        /// Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
13177        /// within the network.
13178        /// Format: projects/{project_id}/global/networks/{name}
13179        Network(std::string::String),
13180        /// Traffic will be logged from VMs within the subnetwork.
13181        /// Format: projects/{project_id}/regions/{region}/subnetworks/{name}
13182        Subnet(std::string::String),
13183        /// Traffic will be logged from the Interconnect Attachment.
13184        /// Format:
13185        /// projects/{project_id}/regions/{region}/interconnectAttachments/{name}
13186        InterconnectAttachment(std::string::String),
13187        /// Traffic will be logged from the VPN Tunnel.
13188        /// Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
13189        VpnTunnel(std::string::String),
13190    }
13191}
13192
13193/// A configuration to generate a response for GetEffectiveVpcFlowLogsConfig
13194/// request.
13195#[derive(Clone, Default, PartialEq)]
13196#[non_exhaustive]
13197pub struct EffectiveVpcFlowLogsConfig {
13198    /// Unique name of the configuration. The name can have one of the following
13199    /// forms:
13200    ///
13201    /// - For project-level configurations:
13202    ///   `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
13203    ///
13204    /// - For organization-level configurations:
13205    ///   `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
13206    ///
13207    /// - For a Compute config, the name will be the path of the subnet:
13208    ///   `projects/{project_id}/regions/{region}/subnetworks/{subnet_id}`
13209    ///
13210    pub name: std::string::String,
13211
13212    /// The state of the VPC Flow Log configuration. Default value is ENABLED.
13213    /// When creating a new configuration, it must be enabled.
13214    /// Setting state=DISABLED will pause the log generation for this config.
13215    pub state: std::option::Option<crate::model::vpc_flow_logs_config::State>,
13216
13217    /// The aggregation interval for the logs. Default value is INTERVAL_5_SEC.
13218    pub aggregation_interval:
13219        std::option::Option<crate::model::vpc_flow_logs_config::AggregationInterval>,
13220
13221    /// The value of the field must be in (0, 1]. The sampling rate of VPC Flow
13222    /// Logs where 1.0 means all collected logs are reported.
13223    /// Setting the sampling rate to 0.0 is not allowed. If you want to disable VPC
13224    /// Flow Logs, use the state field instead.
13225    /// Default value is 1.0.
13226    pub flow_sampling: std::option::Option<f32>,
13227
13228    /// Configures whether all, none or a subset of metadata fields should be
13229    /// added to the reported VPC flow logs.
13230    /// Default value is INCLUDE_ALL_METADATA.
13231    pub metadata: std::option::Option<crate::model::vpc_flow_logs_config::Metadata>,
13232
13233    /// Custom metadata fields to include in the reported VPC flow logs.
13234    /// Can only be specified if "metadata" was set to CUSTOM_METADATA.
13235    pub metadata_fields: std::vec::Vec<std::string::String>,
13236
13237    /// Export filter used to define which VPC Flow Logs should be logged.
13238    pub filter_expr: std::option::Option<std::string::String>,
13239
13240    /// Determines whether to include cross project annotations in the logs.
13241    /// This field is available only for organization configurations. If not
13242    /// specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
13243    pub cross_project_metadata:
13244        std::option::Option<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
13245
13246    /// Specifies the scope of the config (e.g., SUBNET, NETWORK, ORGANIZATION..).
13247    pub scope: std::option::Option<crate::model::effective_vpc_flow_logs_config::Scope>,
13248
13249    /// Reference to the resource of the config scope. That is, the scope from
13250    /// which traffic is logged. The target resource must belong to the same
13251    /// project as the configuration.
13252    /// This field is not supported for organization level configurations.
13253    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    /// Sets the value of [name][crate::model::EffectiveVpcFlowLogsConfig::name].
13265    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    /// Sets the value of [state][crate::model::EffectiveVpcFlowLogsConfig::state].
13271    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    /// Sets or clears the value of [state][crate::model::EffectiveVpcFlowLogsConfig::state].
13280    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    /// Sets the value of [aggregation_interval][crate::model::EffectiveVpcFlowLogsConfig::aggregation_interval].
13289    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    /// Sets or clears the value of [aggregation_interval][crate::model::EffectiveVpcFlowLogsConfig::aggregation_interval].
13298    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    /// Sets the value of [flow_sampling][crate::model::EffectiveVpcFlowLogsConfig::flow_sampling].
13307    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    /// Sets or clears the value of [flow_sampling][crate::model::EffectiveVpcFlowLogsConfig::flow_sampling].
13316    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    /// Sets the value of [metadata][crate::model::EffectiveVpcFlowLogsConfig::metadata].
13325    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    /// Sets or clears the value of [metadata][crate::model::EffectiveVpcFlowLogsConfig::metadata].
13334    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    /// Sets the value of [metadata_fields][crate::model::EffectiveVpcFlowLogsConfig::metadata_fields].
13343    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    /// Sets the value of [filter_expr][crate::model::EffectiveVpcFlowLogsConfig::filter_expr].
13354    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    /// Sets or clears the value of [filter_expr][crate::model::EffectiveVpcFlowLogsConfig::filter_expr].
13363    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    /// Sets the value of [cross_project_metadata][crate::model::EffectiveVpcFlowLogsConfig::cross_project_metadata].
13372    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    /// Sets or clears the value of [cross_project_metadata][crate::model::EffectiveVpcFlowLogsConfig::cross_project_metadata].
13381    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    /// Sets the value of [scope][crate::model::EffectiveVpcFlowLogsConfig::scope].
13390    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    /// Sets or clears the value of [scope][crate::model::EffectiveVpcFlowLogsConfig::scope].
13399    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    /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource].
13408    ///
13409    /// Note that all the setters affecting `target_resource` are mutually
13410    /// exclusive.
13411    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    /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
13424    /// if it holds a `Network`, `None` if the field is not set or
13425    /// holds a different branch.
13426    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    /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
13437    /// to hold a `Network`.
13438    ///
13439    /// Note that all the setters affecting `target_resource` are
13440    /// mutually exclusive.
13441    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    /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
13449    /// if it holds a `Subnet`, `None` if the field is not set or
13450    /// holds a different branch.
13451    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    /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
13462    /// to hold a `Subnet`.
13463    ///
13464    /// Note that all the setters affecting `target_resource` are
13465    /// mutually exclusive.
13466    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    /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
13474    /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
13475    /// holds a different branch.
13476    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    /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
13485    /// to hold a `InterconnectAttachment`.
13486    ///
13487    /// Note that all the setters affecting `target_resource` are
13488    /// mutually exclusive.
13489    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    /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
13502    /// if it holds a `VpnTunnel`, `None` if the field is not set or
13503    /// holds a different branch.
13504    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    /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
13515    /// to hold a `VpnTunnel`.
13516    ///
13517    /// Note that all the setters affecting `target_resource` are
13518    /// mutually exclusive.
13519    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
13533/// Defines additional types related to [EffectiveVpcFlowLogsConfig].
13534pub mod effective_vpc_flow_logs_config {
13535    #[allow(unused_imports)]
13536    use super::*;
13537
13538    /// The scope for this flow log configuration.
13539    ///
13540    /// # Working with unknown values
13541    ///
13542    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13543    /// additional enum variants at any time. Adding new variants is not considered
13544    /// a breaking change. Applications should write their code in anticipation of:
13545    ///
13546    /// - New values appearing in future releases of the client library, **and**
13547    /// - New values received dynamically, without application changes.
13548    ///
13549    /// Please consult the [Working with enums] section in the user guide for some
13550    /// guidelines.
13551    ///
13552    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13553    #[derive(Clone, Debug, PartialEq)]
13554    #[non_exhaustive]
13555    pub enum Scope {
13556        /// Scope is unspecified.
13557        Unspecified,
13558        /// Target resource is a subnet (Network Management API).
13559        Subnet,
13560        /// Target resource is a subnet, and the config originates from the Compute
13561        /// API.
13562        ComputeApiSubnet,
13563        /// Target resource is a network.
13564        Network,
13565        /// Target resource is a VPN tunnel.
13566        VpnTunnel,
13567        /// Target resource is an interconnect attachment.
13568        InterconnectAttachment,
13569        /// Configuration applies to an entire organization.
13570        Organization,
13571        /// If set, the enum was initialized with an unknown value.
13572        ///
13573        /// Applications can examine the value using [Scope::value] or
13574        /// [Scope::name].
13575        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        /// Gets the enum value.
13588        ///
13589        /// Returns `None` if the enum contains an unknown value deserialized from
13590        /// the string representation of enums.
13591        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        /// Gets the enum value as a string.
13605        ///
13606        /// Returns `None` if the enum contains an unknown value deserialized from
13607        /// the integer representation of enums.
13608        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    /// Reference to the resource of the config scope. That is, the scope from
13702    /// which traffic is logged. The target resource must belong to the same
13703    /// project as the configuration.
13704    /// This field is not supported for organization level configurations.
13705    #[derive(Clone, Debug, PartialEq)]
13706    #[non_exhaustive]
13707    pub enum TargetResource {
13708        /// Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
13709        /// within the network.
13710        /// Format: projects/{project_id}/global/networks/{name}
13711        Network(std::string::String),
13712        /// Traffic will be logged from VMs within the subnetwork.
13713        /// Format: projects/{project_id}/regions/{region}/subnetworks/{name}
13714        Subnet(std::string::String),
13715        /// Traffic will be logged from the Interconnect Attachment.
13716        /// Format:
13717        /// projects/{project_id}/regions/{region}/interconnectAttachments/{name}
13718        InterconnectAttachment(std::string::String),
13719        /// Traffic will be logged from the VPN Tunnel.
13720        /// Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
13721        VpnTunnel(std::string::String),
13722    }
13723}
13724
13725/// Type of a load balancer. For more information, see [Summary of Google Cloud
13726/// load
13727/// balancers](https://cloud.google.com/load-balancing/docs/load-balancing-overview#summary-of-google-cloud-load-balancers).
13728///
13729/// # Working with unknown values
13730///
13731/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13732/// additional enum variants at any time. Adding new variants is not considered
13733/// a breaking change. Applications should write their code in anticipation of:
13734///
13735/// - New values appearing in future releases of the client library, **and**
13736/// - New values received dynamically, without application changes.
13737///
13738/// Please consult the [Working with enums] section in the user guide for some
13739/// guidelines.
13740///
13741/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13742#[derive(Clone, Debug, PartialEq)]
13743#[non_exhaustive]
13744pub enum LoadBalancerType {
13745    /// Forwarding rule points to a different target than a load balancer or a
13746    /// load balancer type is unknown.
13747    Unspecified,
13748    /// Global external HTTP(S) load balancer.
13749    HttpsAdvancedLoadBalancer,
13750    /// Global external HTTP(S) load balancer (classic)
13751    HttpsLoadBalancer,
13752    /// Regional external HTTP(S) load balancer.
13753    RegionalHttpsLoadBalancer,
13754    /// Internal HTTP(S) load balancer.
13755    InternalHttpsLoadBalancer,
13756    /// External SSL proxy load balancer.
13757    SslProxyLoadBalancer,
13758    /// External TCP proxy load balancer.
13759    TcpProxyLoadBalancer,
13760    /// Internal regional TCP proxy load balancer.
13761    InternalTcpProxyLoadBalancer,
13762    /// External TCP/UDP Network load balancer.
13763    NetworkLoadBalancer,
13764    /// Target-pool based external TCP/UDP Network load balancer.
13765    LegacyNetworkLoadBalancer,
13766    /// Internal TCP/UDP load balancer.
13767    TcpUdpInternalLoadBalancer,
13768    /// If set, the enum was initialized with an unknown value.
13769    ///
13770    /// Applications can examine the value using [LoadBalancerType::value] or
13771    /// [LoadBalancerType::name].
13772    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    /// Gets the enum value.
13785    ///
13786    /// Returns `None` if the enum contains an unknown value deserialized from
13787    /// the string representation of enums.
13788    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    /// Gets the enum value as a string.
13806    ///
13807    /// Returns `None` if the enum contains an unknown value deserialized from
13808    /// the integer representation of enums.
13809    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}