Skip to main content

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 gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_rpc;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// A Connectivity Test for a network reachability analysis.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct ConnectivityTest {
44    /// Identifier. Unique name of the resource using the form:
45    /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
46    pub name: std::string::String,
47
48    /// The user-supplied description of the Connectivity Test.
49    /// Maximum of 512 characters.
50    pub description: std::string::String,
51
52    /// Required. Source specification of the Connectivity Test.
53    ///
54    /// You can use a combination of source IP address, URI of a supported
55    /// endpoint, project ID, or VPC network to identify the source location.
56    ///
57    /// Reachability analysis might proceed even if the source location is
58    /// ambiguous. However, the test result might include endpoints or use a source
59    /// that you don't intend to test.
60    pub source: std::option::Option<crate::model::Endpoint>,
61
62    /// Required. Destination specification of the Connectivity Test.
63    ///
64    /// You can use a combination of destination IP address, URI of a supported
65    /// endpoint, project ID, or VPC network to identify the destination location.
66    ///
67    /// Reachability analysis proceeds even if the destination location is
68    /// ambiguous. However, the test result might include endpoints or use a
69    /// destination that you don't intend to test.
70    pub destination: std::option::Option<crate::model::Endpoint>,
71
72    /// IP Protocol of the test. When not provided, "TCP" is assumed.
73    pub protocol: std::string::String,
74
75    /// Other projects that may be relevant for reachability analysis.
76    /// This is applicable to scenarios where a test can cross project boundaries.
77    pub related_projects: std::vec::Vec<std::string::String>,
78
79    /// Output only. The display name of a Connectivity Test.
80    pub display_name: std::string::String,
81
82    /// Resource labels to represent user-provided metadata.
83    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
84
85    /// Output only. The time the test was created.
86    pub create_time: std::option::Option<wkt::Timestamp>,
87
88    /// Output only. The time the test's configuration was updated.
89    pub update_time: std::option::Option<wkt::Timestamp>,
90
91    /// Output only. The reachability details of this test from the latest run.
92    /// The details are updated when creating a new test, updating an
93    /// existing test, or triggering a one-time rerun of an existing test.
94    pub reachability_details: std::option::Option<crate::model::ReachabilityDetails>,
95
96    /// Output only. The probing details of this test from the latest run, present
97    /// for applicable tests only. The details are updated when creating a new
98    /// test, updating an existing test, or triggering a one-time rerun of an
99    /// existing test.
100    pub probing_details: std::option::Option<crate::model::ProbingDetails>,
101
102    /// Whether run analysis for the return path from destination to source.
103    /// Default value is false.
104    pub round_trip: bool,
105
106    /// Output only. The reachability details of this test from the latest run for
107    /// the return path. The details are updated when creating a new test,
108    /// updating an existing test, or triggering a one-time rerun of an existing
109    /// test.
110    pub return_reachability_details: std::option::Option<crate::model::ReachabilityDetails>,
111
112    /// Whether the analysis should skip firewall checking. Default value is false.
113    pub bypass_firewall_checks: bool,
114
115    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
116}
117
118impl ConnectivityTest {
119    pub fn new() -> Self {
120        std::default::Default::default()
121    }
122
123    /// Sets the value of [name][crate::model::ConnectivityTest::name].
124    ///
125    /// # Example
126    /// ```ignore,no_run
127    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
128    /// let x = ConnectivityTest::new().set_name("example");
129    /// ```
130    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
131        self.name = v.into();
132        self
133    }
134
135    /// Sets the value of [description][crate::model::ConnectivityTest::description].
136    ///
137    /// # Example
138    /// ```ignore,no_run
139    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
140    /// let x = ConnectivityTest::new().set_description("example");
141    /// ```
142    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
143        self.description = v.into();
144        self
145    }
146
147    /// Sets the value of [source][crate::model::ConnectivityTest::source].
148    ///
149    /// # Example
150    /// ```ignore,no_run
151    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
152    /// use google_cloud_networkmanagement_v1::model::Endpoint;
153    /// let x = ConnectivityTest::new().set_source(Endpoint::default()/* use setters */);
154    /// ```
155    pub fn set_source<T>(mut self, v: T) -> Self
156    where
157        T: std::convert::Into<crate::model::Endpoint>,
158    {
159        self.source = std::option::Option::Some(v.into());
160        self
161    }
162
163    /// Sets or clears the value of [source][crate::model::ConnectivityTest::source].
164    ///
165    /// # Example
166    /// ```ignore,no_run
167    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
168    /// use google_cloud_networkmanagement_v1::model::Endpoint;
169    /// let x = ConnectivityTest::new().set_or_clear_source(Some(Endpoint::default()/* use setters */));
170    /// let x = ConnectivityTest::new().set_or_clear_source(None::<Endpoint>);
171    /// ```
172    pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
173    where
174        T: std::convert::Into<crate::model::Endpoint>,
175    {
176        self.source = v.map(|x| x.into());
177        self
178    }
179
180    /// Sets the value of [destination][crate::model::ConnectivityTest::destination].
181    ///
182    /// # Example
183    /// ```ignore,no_run
184    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
185    /// use google_cloud_networkmanagement_v1::model::Endpoint;
186    /// let x = ConnectivityTest::new().set_destination(Endpoint::default()/* use setters */);
187    /// ```
188    pub fn set_destination<T>(mut self, v: T) -> Self
189    where
190        T: std::convert::Into<crate::model::Endpoint>,
191    {
192        self.destination = std::option::Option::Some(v.into());
193        self
194    }
195
196    /// Sets or clears the value of [destination][crate::model::ConnectivityTest::destination].
197    ///
198    /// # Example
199    /// ```ignore,no_run
200    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
201    /// use google_cloud_networkmanagement_v1::model::Endpoint;
202    /// let x = ConnectivityTest::new().set_or_clear_destination(Some(Endpoint::default()/* use setters */));
203    /// let x = ConnectivityTest::new().set_or_clear_destination(None::<Endpoint>);
204    /// ```
205    pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
206    where
207        T: std::convert::Into<crate::model::Endpoint>,
208    {
209        self.destination = v.map(|x| x.into());
210        self
211    }
212
213    /// Sets the value of [protocol][crate::model::ConnectivityTest::protocol].
214    ///
215    /// # Example
216    /// ```ignore,no_run
217    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
218    /// let x = ConnectivityTest::new().set_protocol("example");
219    /// ```
220    pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
221        self.protocol = v.into();
222        self
223    }
224
225    /// Sets the value of [related_projects][crate::model::ConnectivityTest::related_projects].
226    ///
227    /// # Example
228    /// ```ignore,no_run
229    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
230    /// let x = ConnectivityTest::new().set_related_projects(["a", "b", "c"]);
231    /// ```
232    pub fn set_related_projects<T, V>(mut self, v: T) -> Self
233    where
234        T: std::iter::IntoIterator<Item = V>,
235        V: std::convert::Into<std::string::String>,
236    {
237        use std::iter::Iterator;
238        self.related_projects = v.into_iter().map(|i| i.into()).collect();
239        self
240    }
241
242    /// Sets the value of [display_name][crate::model::ConnectivityTest::display_name].
243    ///
244    /// # Example
245    /// ```ignore,no_run
246    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
247    /// let x = ConnectivityTest::new().set_display_name("example");
248    /// ```
249    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
250        self.display_name = v.into();
251        self
252    }
253
254    /// Sets the value of [labels][crate::model::ConnectivityTest::labels].
255    ///
256    /// # Example
257    /// ```ignore,no_run
258    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
259    /// let x = ConnectivityTest::new().set_labels([
260    ///     ("key0", "abc"),
261    ///     ("key1", "xyz"),
262    /// ]);
263    /// ```
264    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
265    where
266        T: std::iter::IntoIterator<Item = (K, V)>,
267        K: std::convert::Into<std::string::String>,
268        V: std::convert::Into<std::string::String>,
269    {
270        use std::iter::Iterator;
271        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
272        self
273    }
274
275    /// Sets the value of [create_time][crate::model::ConnectivityTest::create_time].
276    ///
277    /// # Example
278    /// ```ignore,no_run
279    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
280    /// use wkt::Timestamp;
281    /// let x = ConnectivityTest::new().set_create_time(Timestamp::default()/* use setters */);
282    /// ```
283    pub fn set_create_time<T>(mut self, v: T) -> Self
284    where
285        T: std::convert::Into<wkt::Timestamp>,
286    {
287        self.create_time = std::option::Option::Some(v.into());
288        self
289    }
290
291    /// Sets or clears the value of [create_time][crate::model::ConnectivityTest::create_time].
292    ///
293    /// # Example
294    /// ```ignore,no_run
295    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
296    /// use wkt::Timestamp;
297    /// let x = ConnectivityTest::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
298    /// let x = ConnectivityTest::new().set_or_clear_create_time(None::<Timestamp>);
299    /// ```
300    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
301    where
302        T: std::convert::Into<wkt::Timestamp>,
303    {
304        self.create_time = v.map(|x| x.into());
305        self
306    }
307
308    /// Sets the value of [update_time][crate::model::ConnectivityTest::update_time].
309    ///
310    /// # Example
311    /// ```ignore,no_run
312    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
313    /// use wkt::Timestamp;
314    /// let x = ConnectivityTest::new().set_update_time(Timestamp::default()/* use setters */);
315    /// ```
316    pub fn set_update_time<T>(mut self, v: T) -> Self
317    where
318        T: std::convert::Into<wkt::Timestamp>,
319    {
320        self.update_time = std::option::Option::Some(v.into());
321        self
322    }
323
324    /// Sets or clears the value of [update_time][crate::model::ConnectivityTest::update_time].
325    ///
326    /// # Example
327    /// ```ignore,no_run
328    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
329    /// use wkt::Timestamp;
330    /// let x = ConnectivityTest::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
331    /// let x = ConnectivityTest::new().set_or_clear_update_time(None::<Timestamp>);
332    /// ```
333    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
334    where
335        T: std::convert::Into<wkt::Timestamp>,
336    {
337        self.update_time = v.map(|x| x.into());
338        self
339    }
340
341    /// Sets the value of [reachability_details][crate::model::ConnectivityTest::reachability_details].
342    ///
343    /// # Example
344    /// ```ignore,no_run
345    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
346    /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
347    /// let x = ConnectivityTest::new().set_reachability_details(ReachabilityDetails::default()/* use setters */);
348    /// ```
349    pub fn set_reachability_details<T>(mut self, v: T) -> Self
350    where
351        T: std::convert::Into<crate::model::ReachabilityDetails>,
352    {
353        self.reachability_details = std::option::Option::Some(v.into());
354        self
355    }
356
357    /// Sets or clears the value of [reachability_details][crate::model::ConnectivityTest::reachability_details].
358    ///
359    /// # Example
360    /// ```ignore,no_run
361    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
362    /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
363    /// let x = ConnectivityTest::new().set_or_clear_reachability_details(Some(ReachabilityDetails::default()/* use setters */));
364    /// let x = ConnectivityTest::new().set_or_clear_reachability_details(None::<ReachabilityDetails>);
365    /// ```
366    pub fn set_or_clear_reachability_details<T>(mut self, v: std::option::Option<T>) -> Self
367    where
368        T: std::convert::Into<crate::model::ReachabilityDetails>,
369    {
370        self.reachability_details = v.map(|x| x.into());
371        self
372    }
373
374    /// Sets the value of [probing_details][crate::model::ConnectivityTest::probing_details].
375    ///
376    /// # Example
377    /// ```ignore,no_run
378    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
379    /// use google_cloud_networkmanagement_v1::model::ProbingDetails;
380    /// let x = ConnectivityTest::new().set_probing_details(ProbingDetails::default()/* use setters */);
381    /// ```
382    pub fn set_probing_details<T>(mut self, v: T) -> Self
383    where
384        T: std::convert::Into<crate::model::ProbingDetails>,
385    {
386        self.probing_details = std::option::Option::Some(v.into());
387        self
388    }
389
390    /// Sets or clears the value of [probing_details][crate::model::ConnectivityTest::probing_details].
391    ///
392    /// # Example
393    /// ```ignore,no_run
394    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
395    /// use google_cloud_networkmanagement_v1::model::ProbingDetails;
396    /// let x = ConnectivityTest::new().set_or_clear_probing_details(Some(ProbingDetails::default()/* use setters */));
397    /// let x = ConnectivityTest::new().set_or_clear_probing_details(None::<ProbingDetails>);
398    /// ```
399    pub fn set_or_clear_probing_details<T>(mut self, v: std::option::Option<T>) -> Self
400    where
401        T: std::convert::Into<crate::model::ProbingDetails>,
402    {
403        self.probing_details = v.map(|x| x.into());
404        self
405    }
406
407    /// Sets the value of [round_trip][crate::model::ConnectivityTest::round_trip].
408    ///
409    /// # Example
410    /// ```ignore,no_run
411    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
412    /// let x = ConnectivityTest::new().set_round_trip(true);
413    /// ```
414    pub fn set_round_trip<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
415        self.round_trip = v.into();
416        self
417    }
418
419    /// Sets the value of [return_reachability_details][crate::model::ConnectivityTest::return_reachability_details].
420    ///
421    /// # Example
422    /// ```ignore,no_run
423    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
424    /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
425    /// let x = ConnectivityTest::new().set_return_reachability_details(ReachabilityDetails::default()/* use setters */);
426    /// ```
427    pub fn set_return_reachability_details<T>(mut self, v: T) -> Self
428    where
429        T: std::convert::Into<crate::model::ReachabilityDetails>,
430    {
431        self.return_reachability_details = std::option::Option::Some(v.into());
432        self
433    }
434
435    /// Sets or clears the value of [return_reachability_details][crate::model::ConnectivityTest::return_reachability_details].
436    ///
437    /// # Example
438    /// ```ignore,no_run
439    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
440    /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
441    /// let x = ConnectivityTest::new().set_or_clear_return_reachability_details(Some(ReachabilityDetails::default()/* use setters */));
442    /// let x = ConnectivityTest::new().set_or_clear_return_reachability_details(None::<ReachabilityDetails>);
443    /// ```
444    pub fn set_or_clear_return_reachability_details<T>(mut self, v: std::option::Option<T>) -> Self
445    where
446        T: std::convert::Into<crate::model::ReachabilityDetails>,
447    {
448        self.return_reachability_details = v.map(|x| x.into());
449        self
450    }
451
452    /// Sets the value of [bypass_firewall_checks][crate::model::ConnectivityTest::bypass_firewall_checks].
453    ///
454    /// # Example
455    /// ```ignore,no_run
456    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
457    /// let x = ConnectivityTest::new().set_bypass_firewall_checks(true);
458    /// ```
459    pub fn set_bypass_firewall_checks<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
460        self.bypass_firewall_checks = v.into();
461        self
462    }
463}
464
465impl wkt::message::Message for ConnectivityTest {
466    fn typename() -> &'static str {
467        "type.googleapis.com/google.cloud.networkmanagement.v1.ConnectivityTest"
468    }
469}
470
471/// Source or destination of the Connectivity Test.
472#[derive(Clone, Default, PartialEq)]
473#[non_exhaustive]
474pub struct Endpoint {
475    /// The IP address of the endpoint, which can be an external or internal IP.
476    pub ip_address: std::string::String,
477
478    /// The IP protocol port of the endpoint.
479    /// Only applicable when protocol is TCP or UDP.
480    pub port: i32,
481
482    /// A Compute Engine instance URI.
483    pub instance: std::string::String,
484
485    /// A forwarding rule and its corresponding IP address represent the frontend
486    /// configuration of a Google Cloud load balancer. Forwarding rules are also
487    /// used for protocol forwarding, Private Service Connect and other network
488    /// services to provide forwarding information in the control plane. Applicable
489    /// only to destination endpoint. Format:
490    /// `projects/{project}/global/forwardingRules/{id}` or
491    /// `projects/{project}/regions/{region}/forwardingRules/{id}`
492    pub forwarding_rule: std::string::String,
493
494    /// Output only. Specifies the type of the target of the forwarding rule.
495    pub forwarding_rule_target: std::option::Option<crate::model::endpoint::ForwardingRuleTarget>,
496
497    /// Output only. ID of the load balancer the forwarding rule points to. Empty
498    /// for forwarding rules not related to load balancers.
499    pub load_balancer_id: std::option::Option<std::string::String>,
500
501    /// Output only. Type of the load balancer the forwarding rule points to.
502    pub load_balancer_type: std::option::Option<crate::model::LoadBalancerType>,
503
504    /// A cluster URI for [Google Kubernetes Engine cluster control
505    /// plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
506    pub gke_master_cluster: std::string::String,
507
508    /// DNS endpoint of [Google Kubernetes Engine cluster control
509    /// plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
510    /// Requires gke_master_cluster to be set, can't be used simultaneoulsly with
511    /// ip_address or network. Applicable only to destination endpoint.
512    pub fqdn: std::string::String,
513
514    /// A [Cloud SQL](https://cloud.google.com/sql) instance URI.
515    pub cloud_sql_instance: std::string::String,
516
517    /// A [Redis Instance](https://cloud.google.com/memorystore/docs/redis) URI.
518    /// Applicable only to destination endpoint.
519    pub redis_instance: std::string::String,
520
521    /// A [Redis Cluster](https://cloud.google.com/memorystore/docs/cluster) URI.
522    /// Applicable only to destination endpoint.
523    pub redis_cluster: std::string::String,
524
525    /// A [GKE Pod](https://cloud.google.com/kubernetes-engine/docs/concepts/pod)
526    /// URI.
527    pub gke_pod: std::string::String,
528
529    /// A [Cloud Function](https://cloud.google.com/functions). Applicable only to
530    /// source endpoint.
531    pub cloud_function: std::option::Option<crate::model::endpoint::CloudFunctionEndpoint>,
532
533    /// An [App Engine](https://cloud.google.com/appengine) [service
534    /// version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions).
535    /// Applicable only to source endpoint.
536    pub app_engine_version: std::option::Option<crate::model::endpoint::AppEngineVersionEndpoint>,
537
538    /// A [Cloud Run](https://cloud.google.com/run)
539    /// [revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get)
540    /// Applicable only to source endpoint.
541    pub cloud_run_revision: std::option::Option<crate::model::endpoint::CloudRunRevisionEndpoint>,
542
543    /// A VPC network URI. For source endpoints, used according to the
544    /// `network_type`. For destination endpoints, used only when the source is an
545    /// external IP address endpoint, and the destination is an internal IP address
546    /// endpoint.
547    pub network: std::string::String,
548
549    /// For source endpoints, type of the network where the endpoint is located.
550    /// Not relevant for destination endpoints.
551    pub network_type: crate::model::endpoint::NetworkType,
552
553    /// For source endpoints, endpoint project ID. Used according to the
554    /// `network_type`. Not relevant for destination endpoints.
555    pub project_id: std::string::String,
556
557    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
558}
559
560impl Endpoint {
561    pub fn new() -> Self {
562        std::default::Default::default()
563    }
564
565    /// Sets the value of [ip_address][crate::model::Endpoint::ip_address].
566    ///
567    /// # Example
568    /// ```ignore,no_run
569    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
570    /// let x = Endpoint::new().set_ip_address("example");
571    /// ```
572    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
573        self.ip_address = v.into();
574        self
575    }
576
577    /// Sets the value of [port][crate::model::Endpoint::port].
578    ///
579    /// # Example
580    /// ```ignore,no_run
581    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
582    /// let x = Endpoint::new().set_port(42);
583    /// ```
584    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
585        self.port = v.into();
586        self
587    }
588
589    /// Sets the value of [instance][crate::model::Endpoint::instance].
590    ///
591    /// # Example
592    /// ```ignore,no_run
593    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
594    /// let x = Endpoint::new().set_instance("example");
595    /// ```
596    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
597        self.instance = v.into();
598        self
599    }
600
601    /// Sets the value of [forwarding_rule][crate::model::Endpoint::forwarding_rule].
602    ///
603    /// # Example
604    /// ```ignore,no_run
605    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
606    /// let x = Endpoint::new().set_forwarding_rule("example");
607    /// ```
608    pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
609        self.forwarding_rule = v.into();
610        self
611    }
612
613    /// Sets the value of [forwarding_rule_target][crate::model::Endpoint::forwarding_rule_target].
614    ///
615    /// # Example
616    /// ```ignore,no_run
617    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
618    /// use google_cloud_networkmanagement_v1::model::endpoint::ForwardingRuleTarget;
619    /// let x0 = Endpoint::new().set_forwarding_rule_target(ForwardingRuleTarget::Instance);
620    /// let x1 = Endpoint::new().set_forwarding_rule_target(ForwardingRuleTarget::LoadBalancer);
621    /// let x2 = Endpoint::new().set_forwarding_rule_target(ForwardingRuleTarget::VpnGateway);
622    /// ```
623    pub fn set_forwarding_rule_target<T>(mut self, v: T) -> Self
624    where
625        T: std::convert::Into<crate::model::endpoint::ForwardingRuleTarget>,
626    {
627        self.forwarding_rule_target = std::option::Option::Some(v.into());
628        self
629    }
630
631    /// Sets or clears the value of [forwarding_rule_target][crate::model::Endpoint::forwarding_rule_target].
632    ///
633    /// # Example
634    /// ```ignore,no_run
635    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
636    /// use google_cloud_networkmanagement_v1::model::endpoint::ForwardingRuleTarget;
637    /// let x0 = Endpoint::new().set_or_clear_forwarding_rule_target(Some(ForwardingRuleTarget::Instance));
638    /// let x1 = Endpoint::new().set_or_clear_forwarding_rule_target(Some(ForwardingRuleTarget::LoadBalancer));
639    /// let x2 = Endpoint::new().set_or_clear_forwarding_rule_target(Some(ForwardingRuleTarget::VpnGateway));
640    /// let x_none = Endpoint::new().set_or_clear_forwarding_rule_target(None::<ForwardingRuleTarget>);
641    /// ```
642    pub fn set_or_clear_forwarding_rule_target<T>(mut self, v: std::option::Option<T>) -> Self
643    where
644        T: std::convert::Into<crate::model::endpoint::ForwardingRuleTarget>,
645    {
646        self.forwarding_rule_target = v.map(|x| x.into());
647        self
648    }
649
650    /// Sets the value of [load_balancer_id][crate::model::Endpoint::load_balancer_id].
651    ///
652    /// # Example
653    /// ```ignore,no_run
654    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
655    /// let x = Endpoint::new().set_load_balancer_id("example");
656    /// ```
657    pub fn set_load_balancer_id<T>(mut self, v: T) -> Self
658    where
659        T: std::convert::Into<std::string::String>,
660    {
661        self.load_balancer_id = std::option::Option::Some(v.into());
662        self
663    }
664
665    /// Sets or clears the value of [load_balancer_id][crate::model::Endpoint::load_balancer_id].
666    ///
667    /// # Example
668    /// ```ignore,no_run
669    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
670    /// let x = Endpoint::new().set_or_clear_load_balancer_id(Some("example"));
671    /// let x = Endpoint::new().set_or_clear_load_balancer_id(None::<String>);
672    /// ```
673    pub fn set_or_clear_load_balancer_id<T>(mut self, v: std::option::Option<T>) -> Self
674    where
675        T: std::convert::Into<std::string::String>,
676    {
677        self.load_balancer_id = v.map(|x| x.into());
678        self
679    }
680
681    /// Sets the value of [load_balancer_type][crate::model::Endpoint::load_balancer_type].
682    ///
683    /// # Example
684    /// ```ignore,no_run
685    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
686    /// use google_cloud_networkmanagement_v1::model::LoadBalancerType;
687    /// let x0 = Endpoint::new().set_load_balancer_type(LoadBalancerType::HttpsAdvancedLoadBalancer);
688    /// let x1 = Endpoint::new().set_load_balancer_type(LoadBalancerType::HttpsLoadBalancer);
689    /// let x2 = Endpoint::new().set_load_balancer_type(LoadBalancerType::RegionalHttpsLoadBalancer);
690    /// ```
691    pub fn set_load_balancer_type<T>(mut self, v: T) -> Self
692    where
693        T: std::convert::Into<crate::model::LoadBalancerType>,
694    {
695        self.load_balancer_type = std::option::Option::Some(v.into());
696        self
697    }
698
699    /// Sets or clears the value of [load_balancer_type][crate::model::Endpoint::load_balancer_type].
700    ///
701    /// # Example
702    /// ```ignore,no_run
703    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
704    /// use google_cloud_networkmanagement_v1::model::LoadBalancerType;
705    /// let x0 = Endpoint::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::HttpsAdvancedLoadBalancer));
706    /// let x1 = Endpoint::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::HttpsLoadBalancer));
707    /// let x2 = Endpoint::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::RegionalHttpsLoadBalancer));
708    /// let x_none = Endpoint::new().set_or_clear_load_balancer_type(None::<LoadBalancerType>);
709    /// ```
710    pub fn set_or_clear_load_balancer_type<T>(mut self, v: std::option::Option<T>) -> Self
711    where
712        T: std::convert::Into<crate::model::LoadBalancerType>,
713    {
714        self.load_balancer_type = v.map(|x| x.into());
715        self
716    }
717
718    /// Sets the value of [gke_master_cluster][crate::model::Endpoint::gke_master_cluster].
719    ///
720    /// # Example
721    /// ```ignore,no_run
722    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
723    /// let x = Endpoint::new().set_gke_master_cluster("example");
724    /// ```
725    pub fn set_gke_master_cluster<T: std::convert::Into<std::string::String>>(
726        mut self,
727        v: T,
728    ) -> Self {
729        self.gke_master_cluster = v.into();
730        self
731    }
732
733    /// Sets the value of [fqdn][crate::model::Endpoint::fqdn].
734    ///
735    /// # Example
736    /// ```ignore,no_run
737    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
738    /// let x = Endpoint::new().set_fqdn("example");
739    /// ```
740    pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
741        self.fqdn = v.into();
742        self
743    }
744
745    /// Sets the value of [cloud_sql_instance][crate::model::Endpoint::cloud_sql_instance].
746    ///
747    /// # Example
748    /// ```ignore,no_run
749    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
750    /// let x = Endpoint::new().set_cloud_sql_instance("example");
751    /// ```
752    pub fn set_cloud_sql_instance<T: std::convert::Into<std::string::String>>(
753        mut self,
754        v: T,
755    ) -> Self {
756        self.cloud_sql_instance = v.into();
757        self
758    }
759
760    /// Sets the value of [redis_instance][crate::model::Endpoint::redis_instance].
761    ///
762    /// # Example
763    /// ```ignore,no_run
764    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
765    /// let x = Endpoint::new().set_redis_instance("example");
766    /// ```
767    pub fn set_redis_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
768        self.redis_instance = v.into();
769        self
770    }
771
772    /// Sets the value of [redis_cluster][crate::model::Endpoint::redis_cluster].
773    ///
774    /// # Example
775    /// ```ignore,no_run
776    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
777    /// let x = Endpoint::new().set_redis_cluster("example");
778    /// ```
779    pub fn set_redis_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
780        self.redis_cluster = v.into();
781        self
782    }
783
784    /// Sets the value of [gke_pod][crate::model::Endpoint::gke_pod].
785    ///
786    /// # Example
787    /// ```ignore,no_run
788    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
789    /// let x = Endpoint::new().set_gke_pod("example");
790    /// ```
791    pub fn set_gke_pod<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
792        self.gke_pod = v.into();
793        self
794    }
795
796    /// Sets the value of [cloud_function][crate::model::Endpoint::cloud_function].
797    ///
798    /// # Example
799    /// ```ignore,no_run
800    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
801    /// use google_cloud_networkmanagement_v1::model::endpoint::CloudFunctionEndpoint;
802    /// let x = Endpoint::new().set_cloud_function(CloudFunctionEndpoint::default()/* use setters */);
803    /// ```
804    pub fn set_cloud_function<T>(mut self, v: T) -> Self
805    where
806        T: std::convert::Into<crate::model::endpoint::CloudFunctionEndpoint>,
807    {
808        self.cloud_function = std::option::Option::Some(v.into());
809        self
810    }
811
812    /// Sets or clears the value of [cloud_function][crate::model::Endpoint::cloud_function].
813    ///
814    /// # Example
815    /// ```ignore,no_run
816    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
817    /// use google_cloud_networkmanagement_v1::model::endpoint::CloudFunctionEndpoint;
818    /// let x = Endpoint::new().set_or_clear_cloud_function(Some(CloudFunctionEndpoint::default()/* use setters */));
819    /// let x = Endpoint::new().set_or_clear_cloud_function(None::<CloudFunctionEndpoint>);
820    /// ```
821    pub fn set_or_clear_cloud_function<T>(mut self, v: std::option::Option<T>) -> Self
822    where
823        T: std::convert::Into<crate::model::endpoint::CloudFunctionEndpoint>,
824    {
825        self.cloud_function = v.map(|x| x.into());
826        self
827    }
828
829    /// Sets the value of [app_engine_version][crate::model::Endpoint::app_engine_version].
830    ///
831    /// # Example
832    /// ```ignore,no_run
833    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
834    /// use google_cloud_networkmanagement_v1::model::endpoint::AppEngineVersionEndpoint;
835    /// let x = Endpoint::new().set_app_engine_version(AppEngineVersionEndpoint::default()/* use setters */);
836    /// ```
837    pub fn set_app_engine_version<T>(mut self, v: T) -> Self
838    where
839        T: std::convert::Into<crate::model::endpoint::AppEngineVersionEndpoint>,
840    {
841        self.app_engine_version = std::option::Option::Some(v.into());
842        self
843    }
844
845    /// Sets or clears the value of [app_engine_version][crate::model::Endpoint::app_engine_version].
846    ///
847    /// # Example
848    /// ```ignore,no_run
849    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
850    /// use google_cloud_networkmanagement_v1::model::endpoint::AppEngineVersionEndpoint;
851    /// let x = Endpoint::new().set_or_clear_app_engine_version(Some(AppEngineVersionEndpoint::default()/* use setters */));
852    /// let x = Endpoint::new().set_or_clear_app_engine_version(None::<AppEngineVersionEndpoint>);
853    /// ```
854    pub fn set_or_clear_app_engine_version<T>(mut self, v: std::option::Option<T>) -> Self
855    where
856        T: std::convert::Into<crate::model::endpoint::AppEngineVersionEndpoint>,
857    {
858        self.app_engine_version = v.map(|x| x.into());
859        self
860    }
861
862    /// Sets the value of [cloud_run_revision][crate::model::Endpoint::cloud_run_revision].
863    ///
864    /// # Example
865    /// ```ignore,no_run
866    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
867    /// use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
868    /// let x = Endpoint::new().set_cloud_run_revision(CloudRunRevisionEndpoint::default()/* use setters */);
869    /// ```
870    pub fn set_cloud_run_revision<T>(mut self, v: T) -> Self
871    where
872        T: std::convert::Into<crate::model::endpoint::CloudRunRevisionEndpoint>,
873    {
874        self.cloud_run_revision = std::option::Option::Some(v.into());
875        self
876    }
877
878    /// Sets or clears the value of [cloud_run_revision][crate::model::Endpoint::cloud_run_revision].
879    ///
880    /// # Example
881    /// ```ignore,no_run
882    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
883    /// use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
884    /// let x = Endpoint::new().set_or_clear_cloud_run_revision(Some(CloudRunRevisionEndpoint::default()/* use setters */));
885    /// let x = Endpoint::new().set_or_clear_cloud_run_revision(None::<CloudRunRevisionEndpoint>);
886    /// ```
887    pub fn set_or_clear_cloud_run_revision<T>(mut self, v: std::option::Option<T>) -> Self
888    where
889        T: std::convert::Into<crate::model::endpoint::CloudRunRevisionEndpoint>,
890    {
891        self.cloud_run_revision = v.map(|x| x.into());
892        self
893    }
894
895    /// Sets the value of [network][crate::model::Endpoint::network].
896    ///
897    /// # Example
898    /// ```ignore,no_run
899    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
900    /// let x = Endpoint::new().set_network("example");
901    /// ```
902    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
903        self.network = v.into();
904        self
905    }
906
907    /// Sets the value of [network_type][crate::model::Endpoint::network_type].
908    ///
909    /// # Example
910    /// ```ignore,no_run
911    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
912    /// use google_cloud_networkmanagement_v1::model::endpoint::NetworkType;
913    /// let x0 = Endpoint::new().set_network_type(NetworkType::GcpNetwork);
914    /// let x1 = Endpoint::new().set_network_type(NetworkType::NonGcpNetwork);
915    /// let x2 = Endpoint::new().set_network_type(NetworkType::Internet);
916    /// ```
917    pub fn set_network_type<T: std::convert::Into<crate::model::endpoint::NetworkType>>(
918        mut self,
919        v: T,
920    ) -> Self {
921        self.network_type = v.into();
922        self
923    }
924
925    /// Sets the value of [project_id][crate::model::Endpoint::project_id].
926    ///
927    /// # Example
928    /// ```ignore,no_run
929    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
930    /// let x = Endpoint::new().set_project_id("example");
931    /// ```
932    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
933        self.project_id = v.into();
934        self
935    }
936}
937
938impl wkt::message::Message for Endpoint {
939    fn typename() -> &'static str {
940        "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint"
941    }
942}
943
944/// Defines additional types related to [Endpoint].
945pub mod endpoint {
946    #[allow(unused_imports)]
947    use super::*;
948
949    /// Wrapper for Cloud Function attributes.
950    #[derive(Clone, Default, PartialEq)]
951    #[non_exhaustive]
952    pub struct CloudFunctionEndpoint {
953        /// A [Cloud Function](https://cloud.google.com/functions) name.
954        pub uri: std::string::String,
955
956        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
957    }
958
959    impl CloudFunctionEndpoint {
960        pub fn new() -> Self {
961            std::default::Default::default()
962        }
963
964        /// Sets the value of [uri][crate::model::endpoint::CloudFunctionEndpoint::uri].
965        ///
966        /// # Example
967        /// ```ignore,no_run
968        /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudFunctionEndpoint;
969        /// let x = CloudFunctionEndpoint::new().set_uri("example");
970        /// ```
971        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
972            self.uri = v.into();
973            self
974        }
975    }
976
977    impl wkt::message::Message for CloudFunctionEndpoint {
978        fn typename() -> &'static str {
979            "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.CloudFunctionEndpoint"
980        }
981    }
982
983    /// Wrapper for the App Engine service version attributes.
984    #[derive(Clone, Default, PartialEq)]
985    #[non_exhaustive]
986    pub struct AppEngineVersionEndpoint {
987        /// An [App Engine](https://cloud.google.com/appengine) [service
988        /// version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions)
989        /// name.
990        pub uri: std::string::String,
991
992        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
993    }
994
995    impl AppEngineVersionEndpoint {
996        pub fn new() -> Self {
997            std::default::Default::default()
998        }
999
1000        /// Sets the value of [uri][crate::model::endpoint::AppEngineVersionEndpoint::uri].
1001        ///
1002        /// # Example
1003        /// ```ignore,no_run
1004        /// # use google_cloud_networkmanagement_v1::model::endpoint::AppEngineVersionEndpoint;
1005        /// let x = AppEngineVersionEndpoint::new().set_uri("example");
1006        /// ```
1007        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1008            self.uri = v.into();
1009            self
1010        }
1011    }
1012
1013    impl wkt::message::Message for AppEngineVersionEndpoint {
1014        fn typename() -> &'static str {
1015            "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.AppEngineVersionEndpoint"
1016        }
1017    }
1018
1019    /// Wrapper for Cloud Run revision attributes.
1020    #[derive(Clone, Default, PartialEq)]
1021    #[non_exhaustive]
1022    pub struct CloudRunRevisionEndpoint {
1023        /// A [Cloud Run](https://cloud.google.com/run)
1024        /// [revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get)
1025        /// URI. The format is:
1026        /// projects/{project}/locations/{location}/revisions/{revision}
1027        pub uri: std::string::String,
1028
1029        /// Output only. The URI of the Cloud Run service that the revision belongs
1030        /// to. The format is:
1031        /// projects/{project}/locations/{location}/services/{service}
1032        pub service_uri: std::string::String,
1033
1034        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1035    }
1036
1037    impl CloudRunRevisionEndpoint {
1038        pub fn new() -> Self {
1039            std::default::Default::default()
1040        }
1041
1042        /// Sets the value of [uri][crate::model::endpoint::CloudRunRevisionEndpoint::uri].
1043        ///
1044        /// # Example
1045        /// ```ignore,no_run
1046        /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
1047        /// let x = CloudRunRevisionEndpoint::new().set_uri("example");
1048        /// ```
1049        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1050            self.uri = v.into();
1051            self
1052        }
1053
1054        /// Sets the value of [service_uri][crate::model::endpoint::CloudRunRevisionEndpoint::service_uri].
1055        ///
1056        /// # Example
1057        /// ```ignore,no_run
1058        /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
1059        /// let x = CloudRunRevisionEndpoint::new().set_service_uri("example");
1060        /// ```
1061        pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1062            self.service_uri = v.into();
1063            self
1064        }
1065    }
1066
1067    impl wkt::message::Message for CloudRunRevisionEndpoint {
1068        fn typename() -> &'static str {
1069            "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.CloudRunRevisionEndpoint"
1070        }
1071    }
1072
1073    /// The type of the network of the IP address endpoint. Relevant for the source
1074    /// IP address endpoints.
1075    ///
1076    /// # Working with unknown values
1077    ///
1078    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1079    /// additional enum variants at any time. Adding new variants is not considered
1080    /// a breaking change. Applications should write their code in anticipation of:
1081    ///
1082    /// - New values appearing in future releases of the client library, **and**
1083    /// - New values received dynamically, without application changes.
1084    ///
1085    /// Please consult the [Working with enums] section in the user guide for some
1086    /// guidelines.
1087    ///
1088    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1089    #[derive(Clone, Debug, PartialEq)]
1090    #[non_exhaustive]
1091    pub enum NetworkType {
1092        /// Unspecified. The test will analyze all possible IP address locations.
1093        /// This might take longer and produce inaccurate or ambiguous results, so
1094        /// prefer specifying an explicit network type.
1095        ///
1096        /// The `project_id` field should be set to the project where the GCP
1097        /// endpoint is located, or where the non-GCP endpoint should be reachable
1098        /// from (via routes to non-GCP networks). The project might also be inferred
1099        /// from the Connectivity Test project or other projects referenced in the
1100        /// request.
1101        Unspecified,
1102        /// A VPC network. Should be used for internal IP addresses in VPC networks.
1103        /// The `network` field should be set to the URI of this network. Only
1104        /// endpoints within this network will be considered.
1105        GcpNetwork,
1106        /// A non-GCP network (for example, an on-premises network or another cloud
1107        /// provider network). Should be used for internal IP addresses outside of
1108        /// Google Cloud. The `network` field should be set to the URI of the VPC
1109        /// network containing a corresponding Cloud VPN tunnel, Cloud Interconnect
1110        /// VLAN attachment, or a router appliance instance. Only endpoints reachable
1111        /// from the provided VPC network via the routes to non-GCP networks will be
1112        /// considered.
1113        NonGcpNetwork,
1114        /// Internet. Should be used for internet-routable external IP addresses or
1115        /// IP addresses for global Google APIs and services.
1116        Internet,
1117        /// If set, the enum was initialized with an unknown value.
1118        ///
1119        /// Applications can examine the value using [NetworkType::value] or
1120        /// [NetworkType::name].
1121        UnknownValue(network_type::UnknownValue),
1122    }
1123
1124    #[doc(hidden)]
1125    pub mod network_type {
1126        #[allow(unused_imports)]
1127        use super::*;
1128        #[derive(Clone, Debug, PartialEq)]
1129        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1130    }
1131
1132    impl NetworkType {
1133        /// Gets the enum value.
1134        ///
1135        /// Returns `None` if the enum contains an unknown value deserialized from
1136        /// the string representation of enums.
1137        pub fn value(&self) -> std::option::Option<i32> {
1138            match self {
1139                Self::Unspecified => std::option::Option::Some(0),
1140                Self::GcpNetwork => std::option::Option::Some(1),
1141                Self::NonGcpNetwork => std::option::Option::Some(2),
1142                Self::Internet => std::option::Option::Some(3),
1143                Self::UnknownValue(u) => u.0.value(),
1144            }
1145        }
1146
1147        /// Gets the enum value as a string.
1148        ///
1149        /// Returns `None` if the enum contains an unknown value deserialized from
1150        /// the integer representation of enums.
1151        pub fn name(&self) -> std::option::Option<&str> {
1152            match self {
1153                Self::Unspecified => std::option::Option::Some("NETWORK_TYPE_UNSPECIFIED"),
1154                Self::GcpNetwork => std::option::Option::Some("GCP_NETWORK"),
1155                Self::NonGcpNetwork => std::option::Option::Some("NON_GCP_NETWORK"),
1156                Self::Internet => std::option::Option::Some("INTERNET"),
1157                Self::UnknownValue(u) => u.0.name(),
1158            }
1159        }
1160    }
1161
1162    impl std::default::Default for NetworkType {
1163        fn default() -> Self {
1164            use std::convert::From;
1165            Self::from(0)
1166        }
1167    }
1168
1169    impl std::fmt::Display for NetworkType {
1170        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1171            wkt::internal::display_enum(f, self.name(), self.value())
1172        }
1173    }
1174
1175    impl std::convert::From<i32> for NetworkType {
1176        fn from(value: i32) -> Self {
1177            match value {
1178                0 => Self::Unspecified,
1179                1 => Self::GcpNetwork,
1180                2 => Self::NonGcpNetwork,
1181                3 => Self::Internet,
1182                _ => Self::UnknownValue(network_type::UnknownValue(
1183                    wkt::internal::UnknownEnumValue::Integer(value),
1184                )),
1185            }
1186        }
1187    }
1188
1189    impl std::convert::From<&str> for NetworkType {
1190        fn from(value: &str) -> Self {
1191            use std::string::ToString;
1192            match value {
1193                "NETWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
1194                "GCP_NETWORK" => Self::GcpNetwork,
1195                "NON_GCP_NETWORK" => Self::NonGcpNetwork,
1196                "INTERNET" => Self::Internet,
1197                _ => Self::UnknownValue(network_type::UnknownValue(
1198                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1199                )),
1200            }
1201        }
1202    }
1203
1204    impl serde::ser::Serialize for NetworkType {
1205        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1206        where
1207            S: serde::Serializer,
1208        {
1209            match self {
1210                Self::Unspecified => serializer.serialize_i32(0),
1211                Self::GcpNetwork => serializer.serialize_i32(1),
1212                Self::NonGcpNetwork => serializer.serialize_i32(2),
1213                Self::Internet => serializer.serialize_i32(3),
1214                Self::UnknownValue(u) => u.0.serialize(serializer),
1215            }
1216        }
1217    }
1218
1219    impl<'de> serde::de::Deserialize<'de> for NetworkType {
1220        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1221        where
1222            D: serde::Deserializer<'de>,
1223        {
1224            deserializer.deserialize_any(wkt::internal::EnumVisitor::<NetworkType>::new(
1225                ".google.cloud.networkmanagement.v1.Endpoint.NetworkType",
1226            ))
1227        }
1228    }
1229
1230    /// Type of the target of a forwarding rule.
1231    ///
1232    /// # Working with unknown values
1233    ///
1234    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1235    /// additional enum variants at any time. Adding new variants is not considered
1236    /// a breaking change. Applications should write their code in anticipation of:
1237    ///
1238    /// - New values appearing in future releases of the client library, **and**
1239    /// - New values received dynamically, without application changes.
1240    ///
1241    /// Please consult the [Working with enums] section in the user guide for some
1242    /// guidelines.
1243    ///
1244    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1245    #[derive(Clone, Debug, PartialEq)]
1246    #[non_exhaustive]
1247    pub enum ForwardingRuleTarget {
1248        /// Forwarding rule target is unknown.
1249        Unspecified,
1250        /// Compute Engine instance for protocol forwarding.
1251        Instance,
1252        /// Load Balancer. The specific type can be found from [load_balancer_type]
1253        /// [google.cloud.networkmanagement.v1.Endpoint.load_balancer_type].
1254        LoadBalancer,
1255        /// Classic Cloud VPN Gateway.
1256        VpnGateway,
1257        /// Forwarding Rule is a Private Service Connect endpoint.
1258        Psc,
1259        /// If set, the enum was initialized with an unknown value.
1260        ///
1261        /// Applications can examine the value using [ForwardingRuleTarget::value] or
1262        /// [ForwardingRuleTarget::name].
1263        UnknownValue(forwarding_rule_target::UnknownValue),
1264    }
1265
1266    #[doc(hidden)]
1267    pub mod forwarding_rule_target {
1268        #[allow(unused_imports)]
1269        use super::*;
1270        #[derive(Clone, Debug, PartialEq)]
1271        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1272    }
1273
1274    impl ForwardingRuleTarget {
1275        /// Gets the enum value.
1276        ///
1277        /// Returns `None` if the enum contains an unknown value deserialized from
1278        /// the string representation of enums.
1279        pub fn value(&self) -> std::option::Option<i32> {
1280            match self {
1281                Self::Unspecified => std::option::Option::Some(0),
1282                Self::Instance => std::option::Option::Some(1),
1283                Self::LoadBalancer => std::option::Option::Some(2),
1284                Self::VpnGateway => std::option::Option::Some(3),
1285                Self::Psc => std::option::Option::Some(4),
1286                Self::UnknownValue(u) => u.0.value(),
1287            }
1288        }
1289
1290        /// Gets the enum value as a string.
1291        ///
1292        /// Returns `None` if the enum contains an unknown value deserialized from
1293        /// the integer representation of enums.
1294        pub fn name(&self) -> std::option::Option<&str> {
1295            match self {
1296                Self::Unspecified => {
1297                    std::option::Option::Some("FORWARDING_RULE_TARGET_UNSPECIFIED")
1298                }
1299                Self::Instance => std::option::Option::Some("INSTANCE"),
1300                Self::LoadBalancer => std::option::Option::Some("LOAD_BALANCER"),
1301                Self::VpnGateway => std::option::Option::Some("VPN_GATEWAY"),
1302                Self::Psc => std::option::Option::Some("PSC"),
1303                Self::UnknownValue(u) => u.0.name(),
1304            }
1305        }
1306    }
1307
1308    impl std::default::Default for ForwardingRuleTarget {
1309        fn default() -> Self {
1310            use std::convert::From;
1311            Self::from(0)
1312        }
1313    }
1314
1315    impl std::fmt::Display for ForwardingRuleTarget {
1316        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1317            wkt::internal::display_enum(f, self.name(), self.value())
1318        }
1319    }
1320
1321    impl std::convert::From<i32> for ForwardingRuleTarget {
1322        fn from(value: i32) -> Self {
1323            match value {
1324                0 => Self::Unspecified,
1325                1 => Self::Instance,
1326                2 => Self::LoadBalancer,
1327                3 => Self::VpnGateway,
1328                4 => Self::Psc,
1329                _ => Self::UnknownValue(forwarding_rule_target::UnknownValue(
1330                    wkt::internal::UnknownEnumValue::Integer(value),
1331                )),
1332            }
1333        }
1334    }
1335
1336    impl std::convert::From<&str> for ForwardingRuleTarget {
1337        fn from(value: &str) -> Self {
1338            use std::string::ToString;
1339            match value {
1340                "FORWARDING_RULE_TARGET_UNSPECIFIED" => Self::Unspecified,
1341                "INSTANCE" => Self::Instance,
1342                "LOAD_BALANCER" => Self::LoadBalancer,
1343                "VPN_GATEWAY" => Self::VpnGateway,
1344                "PSC" => Self::Psc,
1345                _ => Self::UnknownValue(forwarding_rule_target::UnknownValue(
1346                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1347                )),
1348            }
1349        }
1350    }
1351
1352    impl serde::ser::Serialize for ForwardingRuleTarget {
1353        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1354        where
1355            S: serde::Serializer,
1356        {
1357            match self {
1358                Self::Unspecified => serializer.serialize_i32(0),
1359                Self::Instance => serializer.serialize_i32(1),
1360                Self::LoadBalancer => serializer.serialize_i32(2),
1361                Self::VpnGateway => serializer.serialize_i32(3),
1362                Self::Psc => serializer.serialize_i32(4),
1363                Self::UnknownValue(u) => u.0.serialize(serializer),
1364            }
1365        }
1366    }
1367
1368    impl<'de> serde::de::Deserialize<'de> for ForwardingRuleTarget {
1369        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1370        where
1371            D: serde::Deserializer<'de>,
1372        {
1373            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ForwardingRuleTarget>::new(
1374                ".google.cloud.networkmanagement.v1.Endpoint.ForwardingRuleTarget",
1375            ))
1376        }
1377    }
1378}
1379
1380/// Results of the configuration analysis from the last run of the test.
1381#[derive(Clone, Default, PartialEq)]
1382#[non_exhaustive]
1383pub struct ReachabilityDetails {
1384    /// The overall result of the test's configuration analysis.
1385    pub result: crate::model::reachability_details::Result,
1386
1387    /// The time of the configuration analysis.
1388    pub verify_time: std::option::Option<wkt::Timestamp>,
1389
1390    /// The details of a failure or a cancellation of reachability analysis.
1391    pub error: std::option::Option<google_cloud_rpc::model::Status>,
1392
1393    /// Result may contain a list of traces if a test has multiple possible
1394    /// paths in the network, such as when destination endpoint is a load balancer
1395    /// with multiple backends.
1396    pub traces: std::vec::Vec<crate::model::Trace>,
1397
1398    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1399}
1400
1401impl ReachabilityDetails {
1402    pub fn new() -> Self {
1403        std::default::Default::default()
1404    }
1405
1406    /// Sets the value of [result][crate::model::ReachabilityDetails::result].
1407    ///
1408    /// # Example
1409    /// ```ignore,no_run
1410    /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1411    /// use google_cloud_networkmanagement_v1::model::reachability_details::Result;
1412    /// let x0 = ReachabilityDetails::new().set_result(Result::Reachable);
1413    /// let x1 = ReachabilityDetails::new().set_result(Result::Unreachable);
1414    /// let x2 = ReachabilityDetails::new().set_result(Result::Ambiguous);
1415    /// ```
1416    pub fn set_result<T: std::convert::Into<crate::model::reachability_details::Result>>(
1417        mut self,
1418        v: T,
1419    ) -> Self {
1420        self.result = v.into();
1421        self
1422    }
1423
1424    /// Sets the value of [verify_time][crate::model::ReachabilityDetails::verify_time].
1425    ///
1426    /// # Example
1427    /// ```ignore,no_run
1428    /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1429    /// use wkt::Timestamp;
1430    /// let x = ReachabilityDetails::new().set_verify_time(Timestamp::default()/* use setters */);
1431    /// ```
1432    pub fn set_verify_time<T>(mut self, v: T) -> Self
1433    where
1434        T: std::convert::Into<wkt::Timestamp>,
1435    {
1436        self.verify_time = std::option::Option::Some(v.into());
1437        self
1438    }
1439
1440    /// Sets or clears the value of [verify_time][crate::model::ReachabilityDetails::verify_time].
1441    ///
1442    /// # Example
1443    /// ```ignore,no_run
1444    /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1445    /// use wkt::Timestamp;
1446    /// let x = ReachabilityDetails::new().set_or_clear_verify_time(Some(Timestamp::default()/* use setters */));
1447    /// let x = ReachabilityDetails::new().set_or_clear_verify_time(None::<Timestamp>);
1448    /// ```
1449    pub fn set_or_clear_verify_time<T>(mut self, v: std::option::Option<T>) -> Self
1450    where
1451        T: std::convert::Into<wkt::Timestamp>,
1452    {
1453        self.verify_time = v.map(|x| x.into());
1454        self
1455    }
1456
1457    /// Sets the value of [error][crate::model::ReachabilityDetails::error].
1458    ///
1459    /// # Example
1460    /// ```ignore,no_run
1461    /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1462    /// use google_cloud_rpc::model::Status;
1463    /// let x = ReachabilityDetails::new().set_error(Status::default()/* use setters */);
1464    /// ```
1465    pub fn set_error<T>(mut self, v: T) -> Self
1466    where
1467        T: std::convert::Into<google_cloud_rpc::model::Status>,
1468    {
1469        self.error = std::option::Option::Some(v.into());
1470        self
1471    }
1472
1473    /// Sets or clears the value of [error][crate::model::ReachabilityDetails::error].
1474    ///
1475    /// # Example
1476    /// ```ignore,no_run
1477    /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1478    /// use google_cloud_rpc::model::Status;
1479    /// let x = ReachabilityDetails::new().set_or_clear_error(Some(Status::default()/* use setters */));
1480    /// let x = ReachabilityDetails::new().set_or_clear_error(None::<Status>);
1481    /// ```
1482    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1483    where
1484        T: std::convert::Into<google_cloud_rpc::model::Status>,
1485    {
1486        self.error = v.map(|x| x.into());
1487        self
1488    }
1489
1490    /// Sets the value of [traces][crate::model::ReachabilityDetails::traces].
1491    ///
1492    /// # Example
1493    /// ```ignore,no_run
1494    /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1495    /// use google_cloud_networkmanagement_v1::model::Trace;
1496    /// let x = ReachabilityDetails::new()
1497    ///     .set_traces([
1498    ///         Trace::default()/* use setters */,
1499    ///         Trace::default()/* use (different) setters */,
1500    ///     ]);
1501    /// ```
1502    pub fn set_traces<T, V>(mut self, v: T) -> Self
1503    where
1504        T: std::iter::IntoIterator<Item = V>,
1505        V: std::convert::Into<crate::model::Trace>,
1506    {
1507        use std::iter::Iterator;
1508        self.traces = v.into_iter().map(|i| i.into()).collect();
1509        self
1510    }
1511}
1512
1513impl wkt::message::Message for ReachabilityDetails {
1514    fn typename() -> &'static str {
1515        "type.googleapis.com/google.cloud.networkmanagement.v1.ReachabilityDetails"
1516    }
1517}
1518
1519/// Defines additional types related to [ReachabilityDetails].
1520pub mod reachability_details {
1521    #[allow(unused_imports)]
1522    use super::*;
1523
1524    /// The overall result of the test's configuration analysis.
1525    ///
1526    /// # Working with unknown values
1527    ///
1528    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1529    /// additional enum variants at any time. Adding new variants is not considered
1530    /// a breaking change. Applications should write their code in anticipation of:
1531    ///
1532    /// - New values appearing in future releases of the client library, **and**
1533    /// - New values received dynamically, without application changes.
1534    ///
1535    /// Please consult the [Working with enums] section in the user guide for some
1536    /// guidelines.
1537    ///
1538    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1539    #[derive(Clone, Debug, PartialEq)]
1540    #[non_exhaustive]
1541    pub enum Result {
1542        /// No result was specified.
1543        Unspecified,
1544        /// Possible scenarios are:
1545        ///
1546        /// * The configuration analysis determined that a packet originating from
1547        ///   the source is expected to reach the destination.
1548        /// * The analysis didn't complete because the user lacks permission for
1549        ///   some of the resources in the trace. However, at the time the user's
1550        ///   permission became insufficient, the trace had been successful so far.
1551        Reachable,
1552        /// A packet originating from the source is expected to be dropped before
1553        /// reaching the destination.
1554        Unreachable,
1555        /// The source and destination endpoints do not uniquely identify
1556        /// the test location in the network, and the reachability result contains
1557        /// multiple traces. For some traces, a packet could be delivered, and for
1558        /// others, it would not be. This result is also assigned to
1559        /// configuration analysis of return path if on its own it should be
1560        /// REACHABLE, but configuration analysis of forward path is AMBIGUOUS.
1561        Ambiguous,
1562        /// The configuration analysis did not complete. Possible reasons are:
1563        ///
1564        /// * A permissions error occurred--for example, the user might not have
1565        ///   read permission for all of the resources named in the test.
1566        /// * An internal error occurred.
1567        /// * The analyzer received an invalid or unsupported argument or was unable
1568        ///   to identify a known endpoint.
1569        Undetermined,
1570        /// If set, the enum was initialized with an unknown value.
1571        ///
1572        /// Applications can examine the value using [Result::value] or
1573        /// [Result::name].
1574        UnknownValue(result::UnknownValue),
1575    }
1576
1577    #[doc(hidden)]
1578    pub mod result {
1579        #[allow(unused_imports)]
1580        use super::*;
1581        #[derive(Clone, Debug, PartialEq)]
1582        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1583    }
1584
1585    impl Result {
1586        /// Gets the enum value.
1587        ///
1588        /// Returns `None` if the enum contains an unknown value deserialized from
1589        /// the string representation of enums.
1590        pub fn value(&self) -> std::option::Option<i32> {
1591            match self {
1592                Self::Unspecified => std::option::Option::Some(0),
1593                Self::Reachable => std::option::Option::Some(1),
1594                Self::Unreachable => std::option::Option::Some(2),
1595                Self::Ambiguous => std::option::Option::Some(4),
1596                Self::Undetermined => std::option::Option::Some(5),
1597                Self::UnknownValue(u) => u.0.value(),
1598            }
1599        }
1600
1601        /// Gets the enum value as a string.
1602        ///
1603        /// Returns `None` if the enum contains an unknown value deserialized from
1604        /// the integer representation of enums.
1605        pub fn name(&self) -> std::option::Option<&str> {
1606            match self {
1607                Self::Unspecified => std::option::Option::Some("RESULT_UNSPECIFIED"),
1608                Self::Reachable => std::option::Option::Some("REACHABLE"),
1609                Self::Unreachable => std::option::Option::Some("UNREACHABLE"),
1610                Self::Ambiguous => std::option::Option::Some("AMBIGUOUS"),
1611                Self::Undetermined => std::option::Option::Some("UNDETERMINED"),
1612                Self::UnknownValue(u) => u.0.name(),
1613            }
1614        }
1615    }
1616
1617    impl std::default::Default for Result {
1618        fn default() -> Self {
1619            use std::convert::From;
1620            Self::from(0)
1621        }
1622    }
1623
1624    impl std::fmt::Display for Result {
1625        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1626            wkt::internal::display_enum(f, self.name(), self.value())
1627        }
1628    }
1629
1630    impl std::convert::From<i32> for Result {
1631        fn from(value: i32) -> Self {
1632            match value {
1633                0 => Self::Unspecified,
1634                1 => Self::Reachable,
1635                2 => Self::Unreachable,
1636                4 => Self::Ambiguous,
1637                5 => Self::Undetermined,
1638                _ => Self::UnknownValue(result::UnknownValue(
1639                    wkt::internal::UnknownEnumValue::Integer(value),
1640                )),
1641            }
1642        }
1643    }
1644
1645    impl std::convert::From<&str> for Result {
1646        fn from(value: &str) -> Self {
1647            use std::string::ToString;
1648            match value {
1649                "RESULT_UNSPECIFIED" => Self::Unspecified,
1650                "REACHABLE" => Self::Reachable,
1651                "UNREACHABLE" => Self::Unreachable,
1652                "AMBIGUOUS" => Self::Ambiguous,
1653                "UNDETERMINED" => Self::Undetermined,
1654                _ => Self::UnknownValue(result::UnknownValue(
1655                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1656                )),
1657            }
1658        }
1659    }
1660
1661    impl serde::ser::Serialize for Result {
1662        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1663        where
1664            S: serde::Serializer,
1665        {
1666            match self {
1667                Self::Unspecified => serializer.serialize_i32(0),
1668                Self::Reachable => serializer.serialize_i32(1),
1669                Self::Unreachable => serializer.serialize_i32(2),
1670                Self::Ambiguous => serializer.serialize_i32(4),
1671                Self::Undetermined => serializer.serialize_i32(5),
1672                Self::UnknownValue(u) => u.0.serialize(serializer),
1673            }
1674        }
1675    }
1676
1677    impl<'de> serde::de::Deserialize<'de> for Result {
1678        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1679        where
1680            D: serde::Deserializer<'de>,
1681        {
1682            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Result>::new(
1683                ".google.cloud.networkmanagement.v1.ReachabilityDetails.Result",
1684            ))
1685        }
1686    }
1687}
1688
1689/// Latency percentile rank and value.
1690#[derive(Clone, Default, PartialEq)]
1691#[non_exhaustive]
1692pub struct LatencyPercentile {
1693    /// Percentage of samples this data point applies to.
1694    pub percent: i32,
1695
1696    /// percent-th percentile of latency observed, in microseconds.
1697    /// Fraction of percent/100 of samples have latency lower or
1698    /// equal to the value of this field.
1699    pub latency_micros: i64,
1700
1701    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1702}
1703
1704impl LatencyPercentile {
1705    pub fn new() -> Self {
1706        std::default::Default::default()
1707    }
1708
1709    /// Sets the value of [percent][crate::model::LatencyPercentile::percent].
1710    ///
1711    /// # Example
1712    /// ```ignore,no_run
1713    /// # use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1714    /// let x = LatencyPercentile::new().set_percent(42);
1715    /// ```
1716    pub fn set_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1717        self.percent = v.into();
1718        self
1719    }
1720
1721    /// Sets the value of [latency_micros][crate::model::LatencyPercentile::latency_micros].
1722    ///
1723    /// # Example
1724    /// ```ignore,no_run
1725    /// # use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1726    /// let x = LatencyPercentile::new().set_latency_micros(42);
1727    /// ```
1728    pub fn set_latency_micros<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1729        self.latency_micros = v.into();
1730        self
1731    }
1732}
1733
1734impl wkt::message::Message for LatencyPercentile {
1735    fn typename() -> &'static str {
1736        "type.googleapis.com/google.cloud.networkmanagement.v1.LatencyPercentile"
1737    }
1738}
1739
1740/// Describes measured latency distribution.
1741#[derive(Clone, Default, PartialEq)]
1742#[non_exhaustive]
1743pub struct LatencyDistribution {
1744    /// Representative latency percentiles.
1745    pub latency_percentiles: std::vec::Vec<crate::model::LatencyPercentile>,
1746
1747    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1748}
1749
1750impl LatencyDistribution {
1751    pub fn new() -> Self {
1752        std::default::Default::default()
1753    }
1754
1755    /// Sets the value of [latency_percentiles][crate::model::LatencyDistribution::latency_percentiles].
1756    ///
1757    /// # Example
1758    /// ```ignore,no_run
1759    /// # use google_cloud_networkmanagement_v1::model::LatencyDistribution;
1760    /// use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1761    /// let x = LatencyDistribution::new()
1762    ///     .set_latency_percentiles([
1763    ///         LatencyPercentile::default()/* use setters */,
1764    ///         LatencyPercentile::default()/* use (different) setters */,
1765    ///     ]);
1766    /// ```
1767    pub fn set_latency_percentiles<T, V>(mut self, v: T) -> Self
1768    where
1769        T: std::iter::IntoIterator<Item = V>,
1770        V: std::convert::Into<crate::model::LatencyPercentile>,
1771    {
1772        use std::iter::Iterator;
1773        self.latency_percentiles = v.into_iter().map(|i| i.into()).collect();
1774        self
1775    }
1776}
1777
1778impl wkt::message::Message for LatencyDistribution {
1779    fn typename() -> &'static str {
1780        "type.googleapis.com/google.cloud.networkmanagement.v1.LatencyDistribution"
1781    }
1782}
1783
1784/// Results of active probing from the last run of the test.
1785#[derive(Clone, Default, PartialEq)]
1786#[non_exhaustive]
1787pub struct ProbingDetails {
1788    /// The overall result of active probing.
1789    pub result: crate::model::probing_details::ProbingResult,
1790
1791    /// The time that reachability was assessed through active probing.
1792    pub verify_time: std::option::Option<wkt::Timestamp>,
1793
1794    /// Details about an internal failure or the cancellation of active probing.
1795    pub error: std::option::Option<google_cloud_rpc::model::Status>,
1796
1797    /// The reason probing was aborted.
1798    pub abort_cause: crate::model::probing_details::ProbingAbortCause,
1799
1800    /// Number of probes sent.
1801    pub sent_probe_count: i32,
1802
1803    /// Number of probes that reached the destination.
1804    pub successful_probe_count: i32,
1805
1806    /// The source and destination endpoints derived from the test input and used
1807    /// for active probing.
1808    pub endpoint_info: std::option::Option<crate::model::EndpointInfo>,
1809
1810    /// Latency as measured by active probing in one direction:
1811    /// from the source to the destination endpoint.
1812    pub probing_latency: std::option::Option<crate::model::LatencyDistribution>,
1813
1814    /// The EdgeLocation from which a packet, destined to the internet, will egress
1815    /// the Google network.
1816    /// This will only be populated for a connectivity test which has an internet
1817    /// destination address.
1818    /// The absence of this field *must not* be used as an indication that the
1819    /// destination is part of the Google network.
1820    pub destination_egress_location:
1821        std::option::Option<crate::model::probing_details::EdgeLocation>,
1822
1823    /// Probing results for all edge devices.
1824    pub edge_responses: std::vec::Vec<crate::model::probing_details::SingleEdgeResponse>,
1825
1826    /// Whether all relevant edge devices were probed.
1827    pub probed_all_devices: bool,
1828
1829    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1830}
1831
1832impl ProbingDetails {
1833    pub fn new() -> Self {
1834        std::default::Default::default()
1835    }
1836
1837    /// Sets the value of [result][crate::model::ProbingDetails::result].
1838    ///
1839    /// # Example
1840    /// ```ignore,no_run
1841    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1842    /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingResult;
1843    /// let x0 = ProbingDetails::new().set_result(ProbingResult::Reachable);
1844    /// let x1 = ProbingDetails::new().set_result(ProbingResult::Unreachable);
1845    /// let x2 = ProbingDetails::new().set_result(ProbingResult::ReachabilityInconsistent);
1846    /// ```
1847    pub fn set_result<T: std::convert::Into<crate::model::probing_details::ProbingResult>>(
1848        mut self,
1849        v: T,
1850    ) -> Self {
1851        self.result = v.into();
1852        self
1853    }
1854
1855    /// Sets the value of [verify_time][crate::model::ProbingDetails::verify_time].
1856    ///
1857    /// # Example
1858    /// ```ignore,no_run
1859    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1860    /// use wkt::Timestamp;
1861    /// let x = ProbingDetails::new().set_verify_time(Timestamp::default()/* use setters */);
1862    /// ```
1863    pub fn set_verify_time<T>(mut self, v: T) -> Self
1864    where
1865        T: std::convert::Into<wkt::Timestamp>,
1866    {
1867        self.verify_time = std::option::Option::Some(v.into());
1868        self
1869    }
1870
1871    /// Sets or clears the value of [verify_time][crate::model::ProbingDetails::verify_time].
1872    ///
1873    /// # Example
1874    /// ```ignore,no_run
1875    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1876    /// use wkt::Timestamp;
1877    /// let x = ProbingDetails::new().set_or_clear_verify_time(Some(Timestamp::default()/* use setters */));
1878    /// let x = ProbingDetails::new().set_or_clear_verify_time(None::<Timestamp>);
1879    /// ```
1880    pub fn set_or_clear_verify_time<T>(mut self, v: std::option::Option<T>) -> Self
1881    where
1882        T: std::convert::Into<wkt::Timestamp>,
1883    {
1884        self.verify_time = v.map(|x| x.into());
1885        self
1886    }
1887
1888    /// Sets the value of [error][crate::model::ProbingDetails::error].
1889    ///
1890    /// # Example
1891    /// ```ignore,no_run
1892    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1893    /// use google_cloud_rpc::model::Status;
1894    /// let x = ProbingDetails::new().set_error(Status::default()/* use setters */);
1895    /// ```
1896    pub fn set_error<T>(mut self, v: T) -> Self
1897    where
1898        T: std::convert::Into<google_cloud_rpc::model::Status>,
1899    {
1900        self.error = std::option::Option::Some(v.into());
1901        self
1902    }
1903
1904    /// Sets or clears the value of [error][crate::model::ProbingDetails::error].
1905    ///
1906    /// # Example
1907    /// ```ignore,no_run
1908    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1909    /// use google_cloud_rpc::model::Status;
1910    /// let x = ProbingDetails::new().set_or_clear_error(Some(Status::default()/* use setters */));
1911    /// let x = ProbingDetails::new().set_or_clear_error(None::<Status>);
1912    /// ```
1913    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1914    where
1915        T: std::convert::Into<google_cloud_rpc::model::Status>,
1916    {
1917        self.error = v.map(|x| x.into());
1918        self
1919    }
1920
1921    /// Sets the value of [abort_cause][crate::model::ProbingDetails::abort_cause].
1922    ///
1923    /// # Example
1924    /// ```ignore,no_run
1925    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1926    /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingAbortCause;
1927    /// let x0 = ProbingDetails::new().set_abort_cause(ProbingAbortCause::PermissionDenied);
1928    /// let x1 = ProbingDetails::new().set_abort_cause(ProbingAbortCause::NoSourceLocation);
1929    /// ```
1930    pub fn set_abort_cause<
1931        T: std::convert::Into<crate::model::probing_details::ProbingAbortCause>,
1932    >(
1933        mut self,
1934        v: T,
1935    ) -> Self {
1936        self.abort_cause = v.into();
1937        self
1938    }
1939
1940    /// Sets the value of [sent_probe_count][crate::model::ProbingDetails::sent_probe_count].
1941    ///
1942    /// # Example
1943    /// ```ignore,no_run
1944    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1945    /// let x = ProbingDetails::new().set_sent_probe_count(42);
1946    /// ```
1947    pub fn set_sent_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1948        self.sent_probe_count = v.into();
1949        self
1950    }
1951
1952    /// Sets the value of [successful_probe_count][crate::model::ProbingDetails::successful_probe_count].
1953    ///
1954    /// # Example
1955    /// ```ignore,no_run
1956    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1957    /// let x = ProbingDetails::new().set_successful_probe_count(42);
1958    /// ```
1959    pub fn set_successful_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1960        self.successful_probe_count = v.into();
1961        self
1962    }
1963
1964    /// Sets the value of [endpoint_info][crate::model::ProbingDetails::endpoint_info].
1965    ///
1966    /// # Example
1967    /// ```ignore,no_run
1968    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1969    /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
1970    /// let x = ProbingDetails::new().set_endpoint_info(EndpointInfo::default()/* use setters */);
1971    /// ```
1972    pub fn set_endpoint_info<T>(mut self, v: T) -> Self
1973    where
1974        T: std::convert::Into<crate::model::EndpointInfo>,
1975    {
1976        self.endpoint_info = std::option::Option::Some(v.into());
1977        self
1978    }
1979
1980    /// Sets or clears the value of [endpoint_info][crate::model::ProbingDetails::endpoint_info].
1981    ///
1982    /// # Example
1983    /// ```ignore,no_run
1984    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1985    /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
1986    /// let x = ProbingDetails::new().set_or_clear_endpoint_info(Some(EndpointInfo::default()/* use setters */));
1987    /// let x = ProbingDetails::new().set_or_clear_endpoint_info(None::<EndpointInfo>);
1988    /// ```
1989    pub fn set_or_clear_endpoint_info<T>(mut self, v: std::option::Option<T>) -> Self
1990    where
1991        T: std::convert::Into<crate::model::EndpointInfo>,
1992    {
1993        self.endpoint_info = v.map(|x| x.into());
1994        self
1995    }
1996
1997    /// Sets the value of [probing_latency][crate::model::ProbingDetails::probing_latency].
1998    ///
1999    /// # Example
2000    /// ```ignore,no_run
2001    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2002    /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2003    /// let x = ProbingDetails::new().set_probing_latency(LatencyDistribution::default()/* use setters */);
2004    /// ```
2005    pub fn set_probing_latency<T>(mut self, v: T) -> Self
2006    where
2007        T: std::convert::Into<crate::model::LatencyDistribution>,
2008    {
2009        self.probing_latency = std::option::Option::Some(v.into());
2010        self
2011    }
2012
2013    /// Sets or clears the value of [probing_latency][crate::model::ProbingDetails::probing_latency].
2014    ///
2015    /// # Example
2016    /// ```ignore,no_run
2017    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2018    /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2019    /// let x = ProbingDetails::new().set_or_clear_probing_latency(Some(LatencyDistribution::default()/* use setters */));
2020    /// let x = ProbingDetails::new().set_or_clear_probing_latency(None::<LatencyDistribution>);
2021    /// ```
2022    pub fn set_or_clear_probing_latency<T>(mut self, v: std::option::Option<T>) -> Self
2023    where
2024        T: std::convert::Into<crate::model::LatencyDistribution>,
2025    {
2026        self.probing_latency = v.map(|x| x.into());
2027        self
2028    }
2029
2030    /// Sets the value of [destination_egress_location][crate::model::ProbingDetails::destination_egress_location].
2031    ///
2032    /// # Example
2033    /// ```ignore,no_run
2034    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2035    /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2036    /// let x = ProbingDetails::new().set_destination_egress_location(EdgeLocation::default()/* use setters */);
2037    /// ```
2038    pub fn set_destination_egress_location<T>(mut self, v: T) -> Self
2039    where
2040        T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2041    {
2042        self.destination_egress_location = std::option::Option::Some(v.into());
2043        self
2044    }
2045
2046    /// Sets or clears the value of [destination_egress_location][crate::model::ProbingDetails::destination_egress_location].
2047    ///
2048    /// # Example
2049    /// ```ignore,no_run
2050    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2051    /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2052    /// let x = ProbingDetails::new().set_or_clear_destination_egress_location(Some(EdgeLocation::default()/* use setters */));
2053    /// let x = ProbingDetails::new().set_or_clear_destination_egress_location(None::<EdgeLocation>);
2054    /// ```
2055    pub fn set_or_clear_destination_egress_location<T>(mut self, v: std::option::Option<T>) -> Self
2056    where
2057        T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2058    {
2059        self.destination_egress_location = v.map(|x| x.into());
2060        self
2061    }
2062
2063    /// Sets the value of [edge_responses][crate::model::ProbingDetails::edge_responses].
2064    ///
2065    /// # Example
2066    /// ```ignore,no_run
2067    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2068    /// use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2069    /// let x = ProbingDetails::new()
2070    ///     .set_edge_responses([
2071    ///         SingleEdgeResponse::default()/* use setters */,
2072    ///         SingleEdgeResponse::default()/* use (different) setters */,
2073    ///     ]);
2074    /// ```
2075    pub fn set_edge_responses<T, V>(mut self, v: T) -> Self
2076    where
2077        T: std::iter::IntoIterator<Item = V>,
2078        V: std::convert::Into<crate::model::probing_details::SingleEdgeResponse>,
2079    {
2080        use std::iter::Iterator;
2081        self.edge_responses = v.into_iter().map(|i| i.into()).collect();
2082        self
2083    }
2084
2085    /// Sets the value of [probed_all_devices][crate::model::ProbingDetails::probed_all_devices].
2086    ///
2087    /// # Example
2088    /// ```ignore,no_run
2089    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2090    /// let x = ProbingDetails::new().set_probed_all_devices(true);
2091    /// ```
2092    pub fn set_probed_all_devices<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2093        self.probed_all_devices = v.into();
2094        self
2095    }
2096}
2097
2098impl wkt::message::Message for ProbingDetails {
2099    fn typename() -> &'static str {
2100        "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails"
2101    }
2102}
2103
2104/// Defines additional types related to [ProbingDetails].
2105pub mod probing_details {
2106    #[allow(unused_imports)]
2107    use super::*;
2108
2109    /// Representation of a network edge location as per
2110    /// <https://cloud.google.com/vpc/docs/edge-locations>.
2111    #[derive(Clone, Default, PartialEq)]
2112    #[non_exhaustive]
2113    pub struct EdgeLocation {
2114        /// Name of the metropolitan area.
2115        pub metropolitan_area: std::string::String,
2116
2117        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2118    }
2119
2120    impl EdgeLocation {
2121        pub fn new() -> Self {
2122            std::default::Default::default()
2123        }
2124
2125        /// Sets the value of [metropolitan_area][crate::model::probing_details::EdgeLocation::metropolitan_area].
2126        ///
2127        /// # Example
2128        /// ```ignore,no_run
2129        /// # use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2130        /// let x = EdgeLocation::new().set_metropolitan_area("example");
2131        /// ```
2132        pub fn set_metropolitan_area<T: std::convert::Into<std::string::String>>(
2133            mut self,
2134            v: T,
2135        ) -> Self {
2136            self.metropolitan_area = v.into();
2137            self
2138        }
2139    }
2140
2141    impl wkt::message::Message for EdgeLocation {
2142        fn typename() -> &'static str {
2143            "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails.EdgeLocation"
2144        }
2145    }
2146
2147    /// Probing results for a single edge device.
2148    #[derive(Clone, Default, PartialEq)]
2149    #[non_exhaustive]
2150    pub struct SingleEdgeResponse {
2151        /// The overall result of active probing for this egress device.
2152        pub result: crate::model::probing_details::ProbingResult,
2153
2154        /// Number of probes sent.
2155        pub sent_probe_count: i32,
2156
2157        /// Number of probes that reached the destination.
2158        pub successful_probe_count: i32,
2159
2160        /// Latency as measured by active probing in one direction: from the source
2161        /// to the destination endpoint.
2162        pub probing_latency: std::option::Option<crate::model::LatencyDistribution>,
2163
2164        /// The EdgeLocation from which a packet, destined to the internet, will
2165        /// egress the Google network.
2166        /// This will only be populated for a connectivity test which has an internet
2167        /// destination address.
2168        /// The absence of this field *must not* be used as an indication that the
2169        /// destination is part of the Google network.
2170        pub destination_egress_location:
2171            std::option::Option<crate::model::probing_details::EdgeLocation>,
2172
2173        /// Router name in the format '{router}.{metroshard}'. For example:
2174        /// pf01.aaa01, pr02.aaa01.
2175        pub destination_router: std::string::String,
2176
2177        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2178    }
2179
2180    impl SingleEdgeResponse {
2181        pub fn new() -> Self {
2182            std::default::Default::default()
2183        }
2184
2185        /// Sets the value of [result][crate::model::probing_details::SingleEdgeResponse::result].
2186        ///
2187        /// # Example
2188        /// ```ignore,no_run
2189        /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2190        /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingResult;
2191        /// let x0 = SingleEdgeResponse::new().set_result(ProbingResult::Reachable);
2192        /// let x1 = SingleEdgeResponse::new().set_result(ProbingResult::Unreachable);
2193        /// let x2 = SingleEdgeResponse::new().set_result(ProbingResult::ReachabilityInconsistent);
2194        /// ```
2195        pub fn set_result<T: std::convert::Into<crate::model::probing_details::ProbingResult>>(
2196            mut self,
2197            v: T,
2198        ) -> Self {
2199            self.result = v.into();
2200            self
2201        }
2202
2203        /// Sets the value of [sent_probe_count][crate::model::probing_details::SingleEdgeResponse::sent_probe_count].
2204        ///
2205        /// # Example
2206        /// ```ignore,no_run
2207        /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2208        /// let x = SingleEdgeResponse::new().set_sent_probe_count(42);
2209        /// ```
2210        pub fn set_sent_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2211            self.sent_probe_count = v.into();
2212            self
2213        }
2214
2215        /// Sets the value of [successful_probe_count][crate::model::probing_details::SingleEdgeResponse::successful_probe_count].
2216        ///
2217        /// # Example
2218        /// ```ignore,no_run
2219        /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2220        /// let x = SingleEdgeResponse::new().set_successful_probe_count(42);
2221        /// ```
2222        pub fn set_successful_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2223            self.successful_probe_count = v.into();
2224            self
2225        }
2226
2227        /// Sets the value of [probing_latency][crate::model::probing_details::SingleEdgeResponse::probing_latency].
2228        ///
2229        /// # Example
2230        /// ```ignore,no_run
2231        /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2232        /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2233        /// let x = SingleEdgeResponse::new().set_probing_latency(LatencyDistribution::default()/* use setters */);
2234        /// ```
2235        pub fn set_probing_latency<T>(mut self, v: T) -> Self
2236        where
2237            T: std::convert::Into<crate::model::LatencyDistribution>,
2238        {
2239            self.probing_latency = std::option::Option::Some(v.into());
2240            self
2241        }
2242
2243        /// Sets or clears the value of [probing_latency][crate::model::probing_details::SingleEdgeResponse::probing_latency].
2244        ///
2245        /// # Example
2246        /// ```ignore,no_run
2247        /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2248        /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2249        /// let x = SingleEdgeResponse::new().set_or_clear_probing_latency(Some(LatencyDistribution::default()/* use setters */));
2250        /// let x = SingleEdgeResponse::new().set_or_clear_probing_latency(None::<LatencyDistribution>);
2251        /// ```
2252        pub fn set_or_clear_probing_latency<T>(mut self, v: std::option::Option<T>) -> Self
2253        where
2254            T: std::convert::Into<crate::model::LatencyDistribution>,
2255        {
2256            self.probing_latency = v.map(|x| x.into());
2257            self
2258        }
2259
2260        /// Sets the value of [destination_egress_location][crate::model::probing_details::SingleEdgeResponse::destination_egress_location].
2261        ///
2262        /// # Example
2263        /// ```ignore,no_run
2264        /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2265        /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2266        /// let x = SingleEdgeResponse::new().set_destination_egress_location(EdgeLocation::default()/* use setters */);
2267        /// ```
2268        pub fn set_destination_egress_location<T>(mut self, v: T) -> Self
2269        where
2270            T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2271        {
2272            self.destination_egress_location = std::option::Option::Some(v.into());
2273            self
2274        }
2275
2276        /// Sets or clears the value of [destination_egress_location][crate::model::probing_details::SingleEdgeResponse::destination_egress_location].
2277        ///
2278        /// # Example
2279        /// ```ignore,no_run
2280        /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2281        /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2282        /// let x = SingleEdgeResponse::new().set_or_clear_destination_egress_location(Some(EdgeLocation::default()/* use setters */));
2283        /// let x = SingleEdgeResponse::new().set_or_clear_destination_egress_location(None::<EdgeLocation>);
2284        /// ```
2285        pub fn set_or_clear_destination_egress_location<T>(
2286            mut self,
2287            v: std::option::Option<T>,
2288        ) -> Self
2289        where
2290            T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2291        {
2292            self.destination_egress_location = v.map(|x| x.into());
2293            self
2294        }
2295
2296        /// Sets the value of [destination_router][crate::model::probing_details::SingleEdgeResponse::destination_router].
2297        ///
2298        /// # Example
2299        /// ```ignore,no_run
2300        /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2301        /// let x = SingleEdgeResponse::new().set_destination_router("example");
2302        /// ```
2303        pub fn set_destination_router<T: std::convert::Into<std::string::String>>(
2304            mut self,
2305            v: T,
2306        ) -> Self {
2307            self.destination_router = v.into();
2308            self
2309        }
2310    }
2311
2312    impl wkt::message::Message for SingleEdgeResponse {
2313        fn typename() -> &'static str {
2314            "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails.SingleEdgeResponse"
2315        }
2316    }
2317
2318    /// Overall probing result of the test.
2319    ///
2320    /// # Working with unknown values
2321    ///
2322    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2323    /// additional enum variants at any time. Adding new variants is not considered
2324    /// a breaking change. Applications should write their code in anticipation of:
2325    ///
2326    /// - New values appearing in future releases of the client library, **and**
2327    /// - New values received dynamically, without application changes.
2328    ///
2329    /// Please consult the [Working with enums] section in the user guide for some
2330    /// guidelines.
2331    ///
2332    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2333    #[derive(Clone, Debug, PartialEq)]
2334    #[non_exhaustive]
2335    pub enum ProbingResult {
2336        /// No result was specified.
2337        Unspecified,
2338        /// At least 95% of packets reached the destination.
2339        Reachable,
2340        /// No packets reached the destination.
2341        Unreachable,
2342        /// Less than 95% of packets reached the destination.
2343        ReachabilityInconsistent,
2344        /// Reachability could not be determined. Possible reasons are:
2345        ///
2346        /// * The user lacks permission to access some of the network resources
2347        ///   required to run the test.
2348        /// * No valid source endpoint could be derived from the request.
2349        /// * An internal error occurred.
2350        Undetermined,
2351        /// If set, the enum was initialized with an unknown value.
2352        ///
2353        /// Applications can examine the value using [ProbingResult::value] or
2354        /// [ProbingResult::name].
2355        UnknownValue(probing_result::UnknownValue),
2356    }
2357
2358    #[doc(hidden)]
2359    pub mod probing_result {
2360        #[allow(unused_imports)]
2361        use super::*;
2362        #[derive(Clone, Debug, PartialEq)]
2363        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2364    }
2365
2366    impl ProbingResult {
2367        /// Gets the enum value.
2368        ///
2369        /// Returns `None` if the enum contains an unknown value deserialized from
2370        /// the string representation of enums.
2371        pub fn value(&self) -> std::option::Option<i32> {
2372            match self {
2373                Self::Unspecified => std::option::Option::Some(0),
2374                Self::Reachable => std::option::Option::Some(1),
2375                Self::Unreachable => std::option::Option::Some(2),
2376                Self::ReachabilityInconsistent => std::option::Option::Some(3),
2377                Self::Undetermined => std::option::Option::Some(4),
2378                Self::UnknownValue(u) => u.0.value(),
2379            }
2380        }
2381
2382        /// Gets the enum value as a string.
2383        ///
2384        /// Returns `None` if the enum contains an unknown value deserialized from
2385        /// the integer representation of enums.
2386        pub fn name(&self) -> std::option::Option<&str> {
2387            match self {
2388                Self::Unspecified => std::option::Option::Some("PROBING_RESULT_UNSPECIFIED"),
2389                Self::Reachable => std::option::Option::Some("REACHABLE"),
2390                Self::Unreachable => std::option::Option::Some("UNREACHABLE"),
2391                Self::ReachabilityInconsistent => {
2392                    std::option::Option::Some("REACHABILITY_INCONSISTENT")
2393                }
2394                Self::Undetermined => std::option::Option::Some("UNDETERMINED"),
2395                Self::UnknownValue(u) => u.0.name(),
2396            }
2397        }
2398    }
2399
2400    impl std::default::Default for ProbingResult {
2401        fn default() -> Self {
2402            use std::convert::From;
2403            Self::from(0)
2404        }
2405    }
2406
2407    impl std::fmt::Display for ProbingResult {
2408        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2409            wkt::internal::display_enum(f, self.name(), self.value())
2410        }
2411    }
2412
2413    impl std::convert::From<i32> for ProbingResult {
2414        fn from(value: i32) -> Self {
2415            match value {
2416                0 => Self::Unspecified,
2417                1 => Self::Reachable,
2418                2 => Self::Unreachable,
2419                3 => Self::ReachabilityInconsistent,
2420                4 => Self::Undetermined,
2421                _ => Self::UnknownValue(probing_result::UnknownValue(
2422                    wkt::internal::UnknownEnumValue::Integer(value),
2423                )),
2424            }
2425        }
2426    }
2427
2428    impl std::convert::From<&str> for ProbingResult {
2429        fn from(value: &str) -> Self {
2430            use std::string::ToString;
2431            match value {
2432                "PROBING_RESULT_UNSPECIFIED" => Self::Unspecified,
2433                "REACHABLE" => Self::Reachable,
2434                "UNREACHABLE" => Self::Unreachable,
2435                "REACHABILITY_INCONSISTENT" => Self::ReachabilityInconsistent,
2436                "UNDETERMINED" => Self::Undetermined,
2437                _ => Self::UnknownValue(probing_result::UnknownValue(
2438                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2439                )),
2440            }
2441        }
2442    }
2443
2444    impl serde::ser::Serialize for ProbingResult {
2445        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2446        where
2447            S: serde::Serializer,
2448        {
2449            match self {
2450                Self::Unspecified => serializer.serialize_i32(0),
2451                Self::Reachable => serializer.serialize_i32(1),
2452                Self::Unreachable => serializer.serialize_i32(2),
2453                Self::ReachabilityInconsistent => serializer.serialize_i32(3),
2454                Self::Undetermined => serializer.serialize_i32(4),
2455                Self::UnknownValue(u) => u.0.serialize(serializer),
2456            }
2457        }
2458    }
2459
2460    impl<'de> serde::de::Deserialize<'de> for ProbingResult {
2461        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2462        where
2463            D: serde::Deserializer<'de>,
2464        {
2465            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProbingResult>::new(
2466                ".google.cloud.networkmanagement.v1.ProbingDetails.ProbingResult",
2467            ))
2468        }
2469    }
2470
2471    /// Abort cause types.
2472    ///
2473    /// # Working with unknown values
2474    ///
2475    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2476    /// additional enum variants at any time. Adding new variants is not considered
2477    /// a breaking change. Applications should write their code in anticipation of:
2478    ///
2479    /// - New values appearing in future releases of the client library, **and**
2480    /// - New values received dynamically, without application changes.
2481    ///
2482    /// Please consult the [Working with enums] section in the user guide for some
2483    /// guidelines.
2484    ///
2485    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2486    #[derive(Clone, Debug, PartialEq)]
2487    #[non_exhaustive]
2488    pub enum ProbingAbortCause {
2489        /// No reason was specified.
2490        Unspecified,
2491        /// The user lacks permission to access some of the
2492        /// network resources required to run the test.
2493        PermissionDenied,
2494        /// No valid source endpoint could be derived from the request.
2495        NoSourceLocation,
2496        /// If set, the enum was initialized with an unknown value.
2497        ///
2498        /// Applications can examine the value using [ProbingAbortCause::value] or
2499        /// [ProbingAbortCause::name].
2500        UnknownValue(probing_abort_cause::UnknownValue),
2501    }
2502
2503    #[doc(hidden)]
2504    pub mod probing_abort_cause {
2505        #[allow(unused_imports)]
2506        use super::*;
2507        #[derive(Clone, Debug, PartialEq)]
2508        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2509    }
2510
2511    impl ProbingAbortCause {
2512        /// Gets the enum value.
2513        ///
2514        /// Returns `None` if the enum contains an unknown value deserialized from
2515        /// the string representation of enums.
2516        pub fn value(&self) -> std::option::Option<i32> {
2517            match self {
2518                Self::Unspecified => std::option::Option::Some(0),
2519                Self::PermissionDenied => std::option::Option::Some(1),
2520                Self::NoSourceLocation => std::option::Option::Some(2),
2521                Self::UnknownValue(u) => u.0.value(),
2522            }
2523        }
2524
2525        /// Gets the enum value as a string.
2526        ///
2527        /// Returns `None` if the enum contains an unknown value deserialized from
2528        /// the integer representation of enums.
2529        pub fn name(&self) -> std::option::Option<&str> {
2530            match self {
2531                Self::Unspecified => std::option::Option::Some("PROBING_ABORT_CAUSE_UNSPECIFIED"),
2532                Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
2533                Self::NoSourceLocation => std::option::Option::Some("NO_SOURCE_LOCATION"),
2534                Self::UnknownValue(u) => u.0.name(),
2535            }
2536        }
2537    }
2538
2539    impl std::default::Default for ProbingAbortCause {
2540        fn default() -> Self {
2541            use std::convert::From;
2542            Self::from(0)
2543        }
2544    }
2545
2546    impl std::fmt::Display for ProbingAbortCause {
2547        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2548            wkt::internal::display_enum(f, self.name(), self.value())
2549        }
2550    }
2551
2552    impl std::convert::From<i32> for ProbingAbortCause {
2553        fn from(value: i32) -> Self {
2554            match value {
2555                0 => Self::Unspecified,
2556                1 => Self::PermissionDenied,
2557                2 => Self::NoSourceLocation,
2558                _ => Self::UnknownValue(probing_abort_cause::UnknownValue(
2559                    wkt::internal::UnknownEnumValue::Integer(value),
2560                )),
2561            }
2562        }
2563    }
2564
2565    impl std::convert::From<&str> for ProbingAbortCause {
2566        fn from(value: &str) -> Self {
2567            use std::string::ToString;
2568            match value {
2569                "PROBING_ABORT_CAUSE_UNSPECIFIED" => Self::Unspecified,
2570                "PERMISSION_DENIED" => Self::PermissionDenied,
2571                "NO_SOURCE_LOCATION" => Self::NoSourceLocation,
2572                _ => Self::UnknownValue(probing_abort_cause::UnknownValue(
2573                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2574                )),
2575            }
2576        }
2577    }
2578
2579    impl serde::ser::Serialize for ProbingAbortCause {
2580        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2581        where
2582            S: serde::Serializer,
2583        {
2584            match self {
2585                Self::Unspecified => serializer.serialize_i32(0),
2586                Self::PermissionDenied => serializer.serialize_i32(1),
2587                Self::NoSourceLocation => serializer.serialize_i32(2),
2588                Self::UnknownValue(u) => u.0.serialize(serializer),
2589            }
2590        }
2591    }
2592
2593    impl<'de> serde::de::Deserialize<'de> for ProbingAbortCause {
2594        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2595        where
2596            D: serde::Deserializer<'de>,
2597        {
2598            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProbingAbortCause>::new(
2599                ".google.cloud.networkmanagement.v1.ProbingDetails.ProbingAbortCause",
2600            ))
2601        }
2602    }
2603}
2604
2605/// Request for the `ListConnectivityTests` method.
2606#[derive(Clone, Default, PartialEq)]
2607#[non_exhaustive]
2608pub struct ListConnectivityTestsRequest {
2609    /// Required. The parent resource of the Connectivity Tests:
2610    /// `projects/{project_id}/locations/global`
2611    pub parent: std::string::String,
2612
2613    /// Number of `ConnectivityTests` to return.
2614    pub page_size: i32,
2615
2616    /// Page token from an earlier query, as returned in `next_page_token`.
2617    pub page_token: std::string::String,
2618
2619    /// Lists the `ConnectivityTests` that match the filter expression. A filter
2620    /// expression filters the resources listed in the response. The expression
2621    /// must be of the form `<field> <operator> <value>` where operators: `<`, `>`,
2622    /// `<=`,
2623    /// `>=`,
2624    /// `!=`, `=`, `:` are supported (colon `:` represents a HAS operator which is
2625    /// roughly synonymous with equality). \<field\> can refer to a proto or JSON
2626    /// field, or a synthetic field. Field names can be camelCase or snake_case.
2627    ///
2628    /// Examples:
2629    ///
2630    /// - Filter by name:
2631    ///   name = "projects/proj-1/locations/global/connectivityTests/test-1
2632    ///
2633    /// - Filter by labels:
2634    ///
2635    ///   - Resources that have a key called `foo`
2636    ///     labels.foo:*
2637    ///   - Resources that have a key called `foo` whose value is `bar`
2638    ///     labels.foo = bar
2639    pub filter: std::string::String,
2640
2641    /// Field to use to sort the list.
2642    pub order_by: std::string::String,
2643
2644    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2645}
2646
2647impl ListConnectivityTestsRequest {
2648    pub fn new() -> Self {
2649        std::default::Default::default()
2650    }
2651
2652    /// Sets the value of [parent][crate::model::ListConnectivityTestsRequest::parent].
2653    ///
2654    /// # Example
2655    /// ```ignore,no_run
2656    /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2657    /// let x = ListConnectivityTestsRequest::new().set_parent("example");
2658    /// ```
2659    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2660        self.parent = v.into();
2661        self
2662    }
2663
2664    /// Sets the value of [page_size][crate::model::ListConnectivityTestsRequest::page_size].
2665    ///
2666    /// # Example
2667    /// ```ignore,no_run
2668    /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2669    /// let x = ListConnectivityTestsRequest::new().set_page_size(42);
2670    /// ```
2671    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2672        self.page_size = v.into();
2673        self
2674    }
2675
2676    /// Sets the value of [page_token][crate::model::ListConnectivityTestsRequest::page_token].
2677    ///
2678    /// # Example
2679    /// ```ignore,no_run
2680    /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2681    /// let x = ListConnectivityTestsRequest::new().set_page_token("example");
2682    /// ```
2683    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2684        self.page_token = v.into();
2685        self
2686    }
2687
2688    /// Sets the value of [filter][crate::model::ListConnectivityTestsRequest::filter].
2689    ///
2690    /// # Example
2691    /// ```ignore,no_run
2692    /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2693    /// let x = ListConnectivityTestsRequest::new().set_filter("example");
2694    /// ```
2695    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2696        self.filter = v.into();
2697        self
2698    }
2699
2700    /// Sets the value of [order_by][crate::model::ListConnectivityTestsRequest::order_by].
2701    ///
2702    /// # Example
2703    /// ```ignore,no_run
2704    /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2705    /// let x = ListConnectivityTestsRequest::new().set_order_by("example");
2706    /// ```
2707    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2708        self.order_by = v.into();
2709        self
2710    }
2711}
2712
2713impl wkt::message::Message for ListConnectivityTestsRequest {
2714    fn typename() -> &'static str {
2715        "type.googleapis.com/google.cloud.networkmanagement.v1.ListConnectivityTestsRequest"
2716    }
2717}
2718
2719/// Response for the `ListConnectivityTests` method.
2720#[derive(Clone, Default, PartialEq)]
2721#[non_exhaustive]
2722pub struct ListConnectivityTestsResponse {
2723    /// List of Connectivity Tests.
2724    pub resources: std::vec::Vec<crate::model::ConnectivityTest>,
2725
2726    /// Page token to fetch the next set of Connectivity Tests.
2727    pub next_page_token: std::string::String,
2728
2729    /// Locations that could not be reached (when querying all locations with `-`).
2730    pub unreachable: std::vec::Vec<std::string::String>,
2731
2732    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2733}
2734
2735impl ListConnectivityTestsResponse {
2736    pub fn new() -> Self {
2737        std::default::Default::default()
2738    }
2739
2740    /// Sets the value of [resources][crate::model::ListConnectivityTestsResponse::resources].
2741    ///
2742    /// # Example
2743    /// ```ignore,no_run
2744    /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2745    /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2746    /// let x = ListConnectivityTestsResponse::new()
2747    ///     .set_resources([
2748    ///         ConnectivityTest::default()/* use setters */,
2749    ///         ConnectivityTest::default()/* use (different) setters */,
2750    ///     ]);
2751    /// ```
2752    pub fn set_resources<T, V>(mut self, v: T) -> Self
2753    where
2754        T: std::iter::IntoIterator<Item = V>,
2755        V: std::convert::Into<crate::model::ConnectivityTest>,
2756    {
2757        use std::iter::Iterator;
2758        self.resources = v.into_iter().map(|i| i.into()).collect();
2759        self
2760    }
2761
2762    /// Sets the value of [next_page_token][crate::model::ListConnectivityTestsResponse::next_page_token].
2763    ///
2764    /// # Example
2765    /// ```ignore,no_run
2766    /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2767    /// let x = ListConnectivityTestsResponse::new().set_next_page_token("example");
2768    /// ```
2769    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2770        self.next_page_token = v.into();
2771        self
2772    }
2773
2774    /// Sets the value of [unreachable][crate::model::ListConnectivityTestsResponse::unreachable].
2775    ///
2776    /// # Example
2777    /// ```ignore,no_run
2778    /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2779    /// let x = ListConnectivityTestsResponse::new().set_unreachable(["a", "b", "c"]);
2780    /// ```
2781    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2782    where
2783        T: std::iter::IntoIterator<Item = V>,
2784        V: std::convert::Into<std::string::String>,
2785    {
2786        use std::iter::Iterator;
2787        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2788        self
2789    }
2790}
2791
2792impl wkt::message::Message for ListConnectivityTestsResponse {
2793    fn typename() -> &'static str {
2794        "type.googleapis.com/google.cloud.networkmanagement.v1.ListConnectivityTestsResponse"
2795    }
2796}
2797
2798#[doc(hidden)]
2799impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectivityTestsResponse {
2800    type PageItem = crate::model::ConnectivityTest;
2801
2802    fn items(self) -> std::vec::Vec<Self::PageItem> {
2803        self.resources
2804    }
2805
2806    fn next_page_token(&self) -> std::string::String {
2807        use std::clone::Clone;
2808        self.next_page_token.clone()
2809    }
2810}
2811
2812/// Request for the `GetConnectivityTest` method.
2813#[derive(Clone, Default, PartialEq)]
2814#[non_exhaustive]
2815pub struct GetConnectivityTestRequest {
2816    /// Required. `ConnectivityTest` resource name using the form:
2817    /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
2818    pub name: std::string::String,
2819
2820    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2821}
2822
2823impl GetConnectivityTestRequest {
2824    pub fn new() -> Self {
2825        std::default::Default::default()
2826    }
2827
2828    /// Sets the value of [name][crate::model::GetConnectivityTestRequest::name].
2829    ///
2830    /// # Example
2831    /// ```ignore,no_run
2832    /// # use google_cloud_networkmanagement_v1::model::GetConnectivityTestRequest;
2833    /// let x = GetConnectivityTestRequest::new().set_name("example");
2834    /// ```
2835    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2836        self.name = v.into();
2837        self
2838    }
2839}
2840
2841impl wkt::message::Message for GetConnectivityTestRequest {
2842    fn typename() -> &'static str {
2843        "type.googleapis.com/google.cloud.networkmanagement.v1.GetConnectivityTestRequest"
2844    }
2845}
2846
2847/// Request for the `CreateConnectivityTest` method.
2848#[derive(Clone, Default, PartialEq)]
2849#[non_exhaustive]
2850pub struct CreateConnectivityTestRequest {
2851    /// Required. The parent resource of the Connectivity Test to create:
2852    /// `projects/{project_id}/locations/global`
2853    pub parent: std::string::String,
2854
2855    /// Required. The logical name of the Connectivity Test in your project
2856    /// with the following restrictions:
2857    ///
2858    /// * Must contain only lowercase letters, numbers, and hyphens.
2859    /// * Must start with a letter.
2860    /// * Must be between 1-40 characters.
2861    /// * Must end with a number or a letter.
2862    /// * Must be unique within the customer project
2863    pub test_id: std::string::String,
2864
2865    /// Required. A `ConnectivityTest` resource
2866    pub resource: std::option::Option<crate::model::ConnectivityTest>,
2867
2868    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2869}
2870
2871impl CreateConnectivityTestRequest {
2872    pub fn new() -> Self {
2873        std::default::Default::default()
2874    }
2875
2876    /// Sets the value of [parent][crate::model::CreateConnectivityTestRequest::parent].
2877    ///
2878    /// # Example
2879    /// ```ignore,no_run
2880    /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2881    /// let x = CreateConnectivityTestRequest::new().set_parent("example");
2882    /// ```
2883    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2884        self.parent = v.into();
2885        self
2886    }
2887
2888    /// Sets the value of [test_id][crate::model::CreateConnectivityTestRequest::test_id].
2889    ///
2890    /// # Example
2891    /// ```ignore,no_run
2892    /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2893    /// let x = CreateConnectivityTestRequest::new().set_test_id("example");
2894    /// ```
2895    pub fn set_test_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2896        self.test_id = v.into();
2897        self
2898    }
2899
2900    /// Sets the value of [resource][crate::model::CreateConnectivityTestRequest::resource].
2901    ///
2902    /// # Example
2903    /// ```ignore,no_run
2904    /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2905    /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2906    /// let x = CreateConnectivityTestRequest::new().set_resource(ConnectivityTest::default()/* use setters */);
2907    /// ```
2908    pub fn set_resource<T>(mut self, v: T) -> Self
2909    where
2910        T: std::convert::Into<crate::model::ConnectivityTest>,
2911    {
2912        self.resource = std::option::Option::Some(v.into());
2913        self
2914    }
2915
2916    /// Sets or clears the value of [resource][crate::model::CreateConnectivityTestRequest::resource].
2917    ///
2918    /// # Example
2919    /// ```ignore,no_run
2920    /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2921    /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2922    /// let x = CreateConnectivityTestRequest::new().set_or_clear_resource(Some(ConnectivityTest::default()/* use setters */));
2923    /// let x = CreateConnectivityTestRequest::new().set_or_clear_resource(None::<ConnectivityTest>);
2924    /// ```
2925    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
2926    where
2927        T: std::convert::Into<crate::model::ConnectivityTest>,
2928    {
2929        self.resource = v.map(|x| x.into());
2930        self
2931    }
2932}
2933
2934impl wkt::message::Message for CreateConnectivityTestRequest {
2935    fn typename() -> &'static str {
2936        "type.googleapis.com/google.cloud.networkmanagement.v1.CreateConnectivityTestRequest"
2937    }
2938}
2939
2940/// Request for the `UpdateConnectivityTest` method.
2941#[derive(Clone, Default, PartialEq)]
2942#[non_exhaustive]
2943pub struct UpdateConnectivityTestRequest {
2944    /// Required. Mask of fields to update. At least one path must be supplied in
2945    /// this field.
2946    pub update_mask: std::option::Option<wkt::FieldMask>,
2947
2948    /// Required. Only fields specified in update_mask are updated.
2949    pub resource: std::option::Option<crate::model::ConnectivityTest>,
2950
2951    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2952}
2953
2954impl UpdateConnectivityTestRequest {
2955    pub fn new() -> Self {
2956        std::default::Default::default()
2957    }
2958
2959    /// Sets the value of [update_mask][crate::model::UpdateConnectivityTestRequest::update_mask].
2960    ///
2961    /// # Example
2962    /// ```ignore,no_run
2963    /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
2964    /// use wkt::FieldMask;
2965    /// let x = UpdateConnectivityTestRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2966    /// ```
2967    pub fn set_update_mask<T>(mut self, v: T) -> Self
2968    where
2969        T: std::convert::Into<wkt::FieldMask>,
2970    {
2971        self.update_mask = std::option::Option::Some(v.into());
2972        self
2973    }
2974
2975    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectivityTestRequest::update_mask].
2976    ///
2977    /// # Example
2978    /// ```ignore,no_run
2979    /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
2980    /// use wkt::FieldMask;
2981    /// let x = UpdateConnectivityTestRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2982    /// let x = UpdateConnectivityTestRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2983    /// ```
2984    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2985    where
2986        T: std::convert::Into<wkt::FieldMask>,
2987    {
2988        self.update_mask = v.map(|x| x.into());
2989        self
2990    }
2991
2992    /// Sets the value of [resource][crate::model::UpdateConnectivityTestRequest::resource].
2993    ///
2994    /// # Example
2995    /// ```ignore,no_run
2996    /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
2997    /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2998    /// let x = UpdateConnectivityTestRequest::new().set_resource(ConnectivityTest::default()/* use setters */);
2999    /// ```
3000    pub fn set_resource<T>(mut self, v: T) -> Self
3001    where
3002        T: std::convert::Into<crate::model::ConnectivityTest>,
3003    {
3004        self.resource = std::option::Option::Some(v.into());
3005        self
3006    }
3007
3008    /// Sets or clears the value of [resource][crate::model::UpdateConnectivityTestRequest::resource].
3009    ///
3010    /// # Example
3011    /// ```ignore,no_run
3012    /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
3013    /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
3014    /// let x = UpdateConnectivityTestRequest::new().set_or_clear_resource(Some(ConnectivityTest::default()/* use setters */));
3015    /// let x = UpdateConnectivityTestRequest::new().set_or_clear_resource(None::<ConnectivityTest>);
3016    /// ```
3017    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
3018    where
3019        T: std::convert::Into<crate::model::ConnectivityTest>,
3020    {
3021        self.resource = v.map(|x| x.into());
3022        self
3023    }
3024}
3025
3026impl wkt::message::Message for UpdateConnectivityTestRequest {
3027    fn typename() -> &'static str {
3028        "type.googleapis.com/google.cloud.networkmanagement.v1.UpdateConnectivityTestRequest"
3029    }
3030}
3031
3032/// Request for the `DeleteConnectivityTest` method.
3033#[derive(Clone, Default, PartialEq)]
3034#[non_exhaustive]
3035pub struct DeleteConnectivityTestRequest {
3036    /// Required. Connectivity Test resource name using the form:
3037    /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
3038    pub name: std::string::String,
3039
3040    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3041}
3042
3043impl DeleteConnectivityTestRequest {
3044    pub fn new() -> Self {
3045        std::default::Default::default()
3046    }
3047
3048    /// Sets the value of [name][crate::model::DeleteConnectivityTestRequest::name].
3049    ///
3050    /// # Example
3051    /// ```ignore,no_run
3052    /// # use google_cloud_networkmanagement_v1::model::DeleteConnectivityTestRequest;
3053    /// let x = DeleteConnectivityTestRequest::new().set_name("example");
3054    /// ```
3055    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3056        self.name = v.into();
3057        self
3058    }
3059}
3060
3061impl wkt::message::Message for DeleteConnectivityTestRequest {
3062    fn typename() -> &'static str {
3063        "type.googleapis.com/google.cloud.networkmanagement.v1.DeleteConnectivityTestRequest"
3064    }
3065}
3066
3067/// Request for the `RerunConnectivityTest` method.
3068#[derive(Clone, Default, PartialEq)]
3069#[non_exhaustive]
3070pub struct RerunConnectivityTestRequest {
3071    /// Required. Connectivity Test resource name using the form:
3072    /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
3073    pub name: std::string::String,
3074
3075    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3076}
3077
3078impl RerunConnectivityTestRequest {
3079    pub fn new() -> Self {
3080        std::default::Default::default()
3081    }
3082
3083    /// Sets the value of [name][crate::model::RerunConnectivityTestRequest::name].
3084    ///
3085    /// # Example
3086    /// ```ignore,no_run
3087    /// # use google_cloud_networkmanagement_v1::model::RerunConnectivityTestRequest;
3088    /// let x = RerunConnectivityTestRequest::new().set_name("example");
3089    /// ```
3090    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3091        self.name = v.into();
3092        self
3093    }
3094}
3095
3096impl wkt::message::Message for RerunConnectivityTestRequest {
3097    fn typename() -> &'static str {
3098        "type.googleapis.com/google.cloud.networkmanagement.v1.RerunConnectivityTestRequest"
3099    }
3100}
3101
3102/// Metadata describing an [Operation][google.longrunning.Operation]
3103///
3104/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
3105#[derive(Clone, Default, PartialEq)]
3106#[non_exhaustive]
3107pub struct OperationMetadata {
3108    /// The time the operation was created.
3109    pub create_time: std::option::Option<wkt::Timestamp>,
3110
3111    /// The time the operation finished running.
3112    pub end_time: std::option::Option<wkt::Timestamp>,
3113
3114    /// Target of the operation - for example
3115    /// projects/project-1/locations/global/connectivityTests/test-1
3116    pub target: std::string::String,
3117
3118    /// Name of the verb executed by the operation.
3119    pub verb: std::string::String,
3120
3121    /// Human-readable status of the operation, if any.
3122    pub status_detail: std::string::String,
3123
3124    /// Specifies if cancellation was requested for the operation.
3125    pub cancel_requested: bool,
3126
3127    /// API version.
3128    pub api_version: std::string::String,
3129
3130    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3131}
3132
3133impl OperationMetadata {
3134    pub fn new() -> Self {
3135        std::default::Default::default()
3136    }
3137
3138    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3139    ///
3140    /// # Example
3141    /// ```ignore,no_run
3142    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3143    /// use wkt::Timestamp;
3144    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
3145    /// ```
3146    pub fn set_create_time<T>(mut self, v: T) -> Self
3147    where
3148        T: std::convert::Into<wkt::Timestamp>,
3149    {
3150        self.create_time = std::option::Option::Some(v.into());
3151        self
3152    }
3153
3154    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3155    ///
3156    /// # Example
3157    /// ```ignore,no_run
3158    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3159    /// use wkt::Timestamp;
3160    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3161    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
3162    /// ```
3163    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3164    where
3165        T: std::convert::Into<wkt::Timestamp>,
3166    {
3167        self.create_time = v.map(|x| x.into());
3168        self
3169    }
3170
3171    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3172    ///
3173    /// # Example
3174    /// ```ignore,no_run
3175    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3176    /// use wkt::Timestamp;
3177    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3178    /// ```
3179    pub fn set_end_time<T>(mut self, v: T) -> Self
3180    where
3181        T: std::convert::Into<wkt::Timestamp>,
3182    {
3183        self.end_time = std::option::Option::Some(v.into());
3184        self
3185    }
3186
3187    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3188    ///
3189    /// # Example
3190    /// ```ignore,no_run
3191    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3192    /// use wkt::Timestamp;
3193    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3194    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3195    /// ```
3196    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3197    where
3198        T: std::convert::Into<wkt::Timestamp>,
3199    {
3200        self.end_time = v.map(|x| x.into());
3201        self
3202    }
3203
3204    /// Sets the value of [target][crate::model::OperationMetadata::target].
3205    ///
3206    /// # Example
3207    /// ```ignore,no_run
3208    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3209    /// let x = OperationMetadata::new().set_target("example");
3210    /// ```
3211    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3212        self.target = v.into();
3213        self
3214    }
3215
3216    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3217    ///
3218    /// # Example
3219    /// ```ignore,no_run
3220    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3221    /// let x = OperationMetadata::new().set_verb("example");
3222    /// ```
3223    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3224        self.verb = v.into();
3225        self
3226    }
3227
3228    /// Sets the value of [status_detail][crate::model::OperationMetadata::status_detail].
3229    ///
3230    /// # Example
3231    /// ```ignore,no_run
3232    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3233    /// let x = OperationMetadata::new().set_status_detail("example");
3234    /// ```
3235    pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3236        self.status_detail = v.into();
3237        self
3238    }
3239
3240    /// Sets the value of [cancel_requested][crate::model::OperationMetadata::cancel_requested].
3241    ///
3242    /// # Example
3243    /// ```ignore,no_run
3244    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3245    /// let x = OperationMetadata::new().set_cancel_requested(true);
3246    /// ```
3247    pub fn set_cancel_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3248        self.cancel_requested = v.into();
3249        self
3250    }
3251
3252    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3253    ///
3254    /// # Example
3255    /// ```ignore,no_run
3256    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3257    /// let x = OperationMetadata::new().set_api_version("example");
3258    /// ```
3259    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3260        self.api_version = v.into();
3261        self
3262    }
3263}
3264
3265impl wkt::message::Message for OperationMetadata {
3266    fn typename() -> &'static str {
3267        "type.googleapis.com/google.cloud.networkmanagement.v1.OperationMetadata"
3268    }
3269}
3270
3271/// Trace represents one simulated packet forwarding path.
3272///
3273/// * Each trace contains multiple ordered steps.
3274/// * Each step is in a particular state with associated configuration.
3275/// * State is categorized as final or non-final states.
3276/// * Each final state has a reason associated.
3277/// * Each trace must end with a final state (the last step).
3278///
3279/// ```norust
3280///   |---------------------Trace----------------------|
3281///   Step1(State) Step2(State) ---  StepN(State(final))
3282/// ```
3283#[derive(Clone, Default, PartialEq)]
3284#[non_exhaustive]
3285pub struct Trace {
3286    /// Derived from the source and destination endpoints definition specified by
3287    /// user request, and validated by the data plane model.
3288    /// If there are multiple traces starting from different source locations, then
3289    /// the endpoint_info may be different between traces.
3290    pub endpoint_info: std::option::Option<crate::model::EndpointInfo>,
3291
3292    /// A trace of a test contains multiple steps from the initial state to the
3293    /// final state (delivered, dropped, forwarded, or aborted).
3294    ///
3295    /// The steps are ordered by the processing sequence within the simulated
3296    /// network state machine. It is critical to preserve the order of the steps
3297    /// and avoid reordering or sorting them.
3298    pub steps: std::vec::Vec<crate::model::Step>,
3299
3300    /// ID of trace. For forward traces, this ID is unique for each trace. For
3301    /// return traces, it matches ID of associated forward trace. A single forward
3302    /// trace can be associated with none, one or more than one return trace.
3303    pub forward_trace_id: i32,
3304
3305    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3306}
3307
3308impl Trace {
3309    pub fn new() -> Self {
3310        std::default::Default::default()
3311    }
3312
3313    /// Sets the value of [endpoint_info][crate::model::Trace::endpoint_info].
3314    ///
3315    /// # Example
3316    /// ```ignore,no_run
3317    /// # use google_cloud_networkmanagement_v1::model::Trace;
3318    /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3319    /// let x = Trace::new().set_endpoint_info(EndpointInfo::default()/* use setters */);
3320    /// ```
3321    pub fn set_endpoint_info<T>(mut self, v: T) -> Self
3322    where
3323        T: std::convert::Into<crate::model::EndpointInfo>,
3324    {
3325        self.endpoint_info = std::option::Option::Some(v.into());
3326        self
3327    }
3328
3329    /// Sets or clears the value of [endpoint_info][crate::model::Trace::endpoint_info].
3330    ///
3331    /// # Example
3332    /// ```ignore,no_run
3333    /// # use google_cloud_networkmanagement_v1::model::Trace;
3334    /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3335    /// let x = Trace::new().set_or_clear_endpoint_info(Some(EndpointInfo::default()/* use setters */));
3336    /// let x = Trace::new().set_or_clear_endpoint_info(None::<EndpointInfo>);
3337    /// ```
3338    pub fn set_or_clear_endpoint_info<T>(mut self, v: std::option::Option<T>) -> Self
3339    where
3340        T: std::convert::Into<crate::model::EndpointInfo>,
3341    {
3342        self.endpoint_info = v.map(|x| x.into());
3343        self
3344    }
3345
3346    /// Sets the value of [steps][crate::model::Trace::steps].
3347    ///
3348    /// # Example
3349    /// ```ignore,no_run
3350    /// # use google_cloud_networkmanagement_v1::model::Trace;
3351    /// use google_cloud_networkmanagement_v1::model::Step;
3352    /// let x = Trace::new()
3353    ///     .set_steps([
3354    ///         Step::default()/* use setters */,
3355    ///         Step::default()/* use (different) setters */,
3356    ///     ]);
3357    /// ```
3358    pub fn set_steps<T, V>(mut self, v: T) -> Self
3359    where
3360        T: std::iter::IntoIterator<Item = V>,
3361        V: std::convert::Into<crate::model::Step>,
3362    {
3363        use std::iter::Iterator;
3364        self.steps = v.into_iter().map(|i| i.into()).collect();
3365        self
3366    }
3367
3368    /// Sets the value of [forward_trace_id][crate::model::Trace::forward_trace_id].
3369    ///
3370    /// # Example
3371    /// ```ignore,no_run
3372    /// # use google_cloud_networkmanagement_v1::model::Trace;
3373    /// let x = Trace::new().set_forward_trace_id(42);
3374    /// ```
3375    pub fn set_forward_trace_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3376        self.forward_trace_id = v.into();
3377        self
3378    }
3379}
3380
3381impl wkt::message::Message for Trace {
3382    fn typename() -> &'static str {
3383        "type.googleapis.com/google.cloud.networkmanagement.v1.Trace"
3384    }
3385}
3386
3387/// A simulated forwarding path is composed of multiple steps.
3388/// Each step has a well-defined state and an associated configuration.
3389#[derive(Clone, Default, PartialEq)]
3390#[non_exhaustive]
3391pub struct Step {
3392    /// A description of the step. Usually this is a summary of the state.
3393    pub description: std::string::String,
3394
3395    /// Each step is in one of the pre-defined states.
3396    pub state: crate::model::step::State,
3397
3398    /// This is a step that leads to the final state Drop.
3399    pub causes_drop: bool,
3400
3401    /// Project ID that contains the configuration this step is validating.
3402    pub project_id: std::string::String,
3403
3404    /// Configuration or metadata associated with each step.
3405    /// The configuration is filtered based on viewer's permission. If a viewer
3406    /// has no permission to view the configuration in this step, for non-final
3407    /// states a special state is populated (VIEWER_PERMISSION_MISSING), and for
3408    /// final state the configuration is cleared.
3409    pub step_info: std::option::Option<crate::model::step::StepInfo>,
3410
3411    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3412}
3413
3414impl Step {
3415    pub fn new() -> Self {
3416        std::default::Default::default()
3417    }
3418
3419    /// Sets the value of [description][crate::model::Step::description].
3420    ///
3421    /// # Example
3422    /// ```ignore,no_run
3423    /// # use google_cloud_networkmanagement_v1::model::Step;
3424    /// let x = Step::new().set_description("example");
3425    /// ```
3426    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3427        self.description = v.into();
3428        self
3429    }
3430
3431    /// Sets the value of [state][crate::model::Step::state].
3432    ///
3433    /// # Example
3434    /// ```ignore,no_run
3435    /// # use google_cloud_networkmanagement_v1::model::Step;
3436    /// use google_cloud_networkmanagement_v1::model::step::State;
3437    /// let x0 = Step::new().set_state(State::StartFromInstance);
3438    /// let x1 = Step::new().set_state(State::StartFromInternet);
3439    /// let x2 = Step::new().set_state(State::StartFromGoogleService);
3440    /// ```
3441    pub fn set_state<T: std::convert::Into<crate::model::step::State>>(mut self, v: T) -> Self {
3442        self.state = v.into();
3443        self
3444    }
3445
3446    /// Sets the value of [causes_drop][crate::model::Step::causes_drop].
3447    ///
3448    /// # Example
3449    /// ```ignore,no_run
3450    /// # use google_cloud_networkmanagement_v1::model::Step;
3451    /// let x = Step::new().set_causes_drop(true);
3452    /// ```
3453    pub fn set_causes_drop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3454        self.causes_drop = v.into();
3455        self
3456    }
3457
3458    /// Sets the value of [project_id][crate::model::Step::project_id].
3459    ///
3460    /// # Example
3461    /// ```ignore,no_run
3462    /// # use google_cloud_networkmanagement_v1::model::Step;
3463    /// let x = Step::new().set_project_id("example");
3464    /// ```
3465    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3466        self.project_id = v.into();
3467        self
3468    }
3469
3470    /// Sets the value of [step_info][crate::model::Step::step_info].
3471    ///
3472    /// Note that all the setters affecting `step_info` are mutually
3473    /// exclusive.
3474    ///
3475    /// # Example
3476    /// ```ignore,no_run
3477    /// # use google_cloud_networkmanagement_v1::model::Step;
3478    /// use google_cloud_networkmanagement_v1::model::InstanceInfo;
3479    /// let x = Step::new().set_step_info(Some(
3480    ///     google_cloud_networkmanagement_v1::model::step::StepInfo::Instance(InstanceInfo::default().into())));
3481    /// ```
3482    pub fn set_step_info<
3483        T: std::convert::Into<std::option::Option<crate::model::step::StepInfo>>,
3484    >(
3485        mut self,
3486        v: T,
3487    ) -> Self {
3488        self.step_info = v.into();
3489        self
3490    }
3491
3492    /// The value of [step_info][crate::model::Step::step_info]
3493    /// if it holds a `Instance`, `None` if the field is not set or
3494    /// holds a different branch.
3495    pub fn instance(&self) -> std::option::Option<&std::boxed::Box<crate::model::InstanceInfo>> {
3496        #[allow(unreachable_patterns)]
3497        self.step_info.as_ref().and_then(|v| match v {
3498            crate::model::step::StepInfo::Instance(v) => std::option::Option::Some(v),
3499            _ => std::option::Option::None,
3500        })
3501    }
3502
3503    /// Sets the value of [step_info][crate::model::Step::step_info]
3504    /// to hold a `Instance`.
3505    ///
3506    /// Note that all the setters affecting `step_info` are
3507    /// mutually exclusive.
3508    ///
3509    /// # Example
3510    /// ```ignore,no_run
3511    /// # use google_cloud_networkmanagement_v1::model::Step;
3512    /// use google_cloud_networkmanagement_v1::model::InstanceInfo;
3513    /// let x = Step::new().set_instance(InstanceInfo::default()/* use setters */);
3514    /// assert!(x.instance().is_some());
3515    /// assert!(x.firewall().is_none());
3516    /// assert!(x.route().is_none());
3517    /// assert!(x.endpoint().is_none());
3518    /// assert!(x.google_service().is_none());
3519    /// assert!(x.forwarding_rule().is_none());
3520    /// assert!(x.hybrid_subnet().is_none());
3521    /// assert!(x.vpn_gateway().is_none());
3522    /// assert!(x.vpn_tunnel().is_none());
3523    /// assert!(x.interconnect_attachment().is_none());
3524    /// assert!(x.vpc_connector().is_none());
3525    /// assert!(x.direct_vpc_egress_connection().is_none());
3526    /// assert!(x.serverless_external_connection().is_none());
3527    /// assert!(x.deliver().is_none());
3528    /// assert!(x.forward().is_none());
3529    /// assert!(x.abort().is_none());
3530    /// assert!(x.drop().is_none());
3531    /// assert!(x.load_balancer().is_none());
3532    /// assert!(x.network().is_none());
3533    /// assert!(x.gke_master().is_none());
3534    /// assert!(x.gke_pod().is_none());
3535    /// assert!(x.ip_masquerading_skipped().is_none());
3536    /// assert!(x.gke_network_policy().is_none());
3537    /// assert!(x.gke_network_policy_skipped().is_none());
3538    /// assert!(x.cloud_sql_instance().is_none());
3539    /// assert!(x.redis_instance().is_none());
3540    /// assert!(x.redis_cluster().is_none());
3541    /// assert!(x.cloud_function().is_none());
3542    /// assert!(x.app_engine_version().is_none());
3543    /// assert!(x.cloud_run_revision().is_none());
3544    /// assert!(x.nat().is_none());
3545    /// assert!(x.proxy_connection().is_none());
3546    /// assert!(x.load_balancer_backend_info().is_none());
3547    /// assert!(x.storage_bucket().is_none());
3548    /// assert!(x.serverless_neg().is_none());
3549    /// assert!(x.ngfw_packet_inspection().is_none());
3550    /// ```
3551    pub fn set_instance<T: std::convert::Into<std::boxed::Box<crate::model::InstanceInfo>>>(
3552        mut self,
3553        v: T,
3554    ) -> Self {
3555        self.step_info =
3556            std::option::Option::Some(crate::model::step::StepInfo::Instance(v.into()));
3557        self
3558    }
3559
3560    /// The value of [step_info][crate::model::Step::step_info]
3561    /// if it holds a `Firewall`, `None` if the field is not set or
3562    /// holds a different branch.
3563    pub fn firewall(&self) -> std::option::Option<&std::boxed::Box<crate::model::FirewallInfo>> {
3564        #[allow(unreachable_patterns)]
3565        self.step_info.as_ref().and_then(|v| match v {
3566            crate::model::step::StepInfo::Firewall(v) => std::option::Option::Some(v),
3567            _ => std::option::Option::None,
3568        })
3569    }
3570
3571    /// Sets the value of [step_info][crate::model::Step::step_info]
3572    /// to hold a `Firewall`.
3573    ///
3574    /// Note that all the setters affecting `step_info` are
3575    /// mutually exclusive.
3576    ///
3577    /// # Example
3578    /// ```ignore,no_run
3579    /// # use google_cloud_networkmanagement_v1::model::Step;
3580    /// use google_cloud_networkmanagement_v1::model::FirewallInfo;
3581    /// let x = Step::new().set_firewall(FirewallInfo::default()/* use setters */);
3582    /// assert!(x.firewall().is_some());
3583    /// assert!(x.instance().is_none());
3584    /// assert!(x.route().is_none());
3585    /// assert!(x.endpoint().is_none());
3586    /// assert!(x.google_service().is_none());
3587    /// assert!(x.forwarding_rule().is_none());
3588    /// assert!(x.hybrid_subnet().is_none());
3589    /// assert!(x.vpn_gateway().is_none());
3590    /// assert!(x.vpn_tunnel().is_none());
3591    /// assert!(x.interconnect_attachment().is_none());
3592    /// assert!(x.vpc_connector().is_none());
3593    /// assert!(x.direct_vpc_egress_connection().is_none());
3594    /// assert!(x.serverless_external_connection().is_none());
3595    /// assert!(x.deliver().is_none());
3596    /// assert!(x.forward().is_none());
3597    /// assert!(x.abort().is_none());
3598    /// assert!(x.drop().is_none());
3599    /// assert!(x.load_balancer().is_none());
3600    /// assert!(x.network().is_none());
3601    /// assert!(x.gke_master().is_none());
3602    /// assert!(x.gke_pod().is_none());
3603    /// assert!(x.ip_masquerading_skipped().is_none());
3604    /// assert!(x.gke_network_policy().is_none());
3605    /// assert!(x.gke_network_policy_skipped().is_none());
3606    /// assert!(x.cloud_sql_instance().is_none());
3607    /// assert!(x.redis_instance().is_none());
3608    /// assert!(x.redis_cluster().is_none());
3609    /// assert!(x.cloud_function().is_none());
3610    /// assert!(x.app_engine_version().is_none());
3611    /// assert!(x.cloud_run_revision().is_none());
3612    /// assert!(x.nat().is_none());
3613    /// assert!(x.proxy_connection().is_none());
3614    /// assert!(x.load_balancer_backend_info().is_none());
3615    /// assert!(x.storage_bucket().is_none());
3616    /// assert!(x.serverless_neg().is_none());
3617    /// assert!(x.ngfw_packet_inspection().is_none());
3618    /// ```
3619    pub fn set_firewall<T: std::convert::Into<std::boxed::Box<crate::model::FirewallInfo>>>(
3620        mut self,
3621        v: T,
3622    ) -> Self {
3623        self.step_info =
3624            std::option::Option::Some(crate::model::step::StepInfo::Firewall(v.into()));
3625        self
3626    }
3627
3628    /// The value of [step_info][crate::model::Step::step_info]
3629    /// if it holds a `Route`, `None` if the field is not set or
3630    /// holds a different branch.
3631    pub fn route(&self) -> std::option::Option<&std::boxed::Box<crate::model::RouteInfo>> {
3632        #[allow(unreachable_patterns)]
3633        self.step_info.as_ref().and_then(|v| match v {
3634            crate::model::step::StepInfo::Route(v) => std::option::Option::Some(v),
3635            _ => std::option::Option::None,
3636        })
3637    }
3638
3639    /// Sets the value of [step_info][crate::model::Step::step_info]
3640    /// to hold a `Route`.
3641    ///
3642    /// Note that all the setters affecting `step_info` are
3643    /// mutually exclusive.
3644    ///
3645    /// # Example
3646    /// ```ignore,no_run
3647    /// # use google_cloud_networkmanagement_v1::model::Step;
3648    /// use google_cloud_networkmanagement_v1::model::RouteInfo;
3649    /// let x = Step::new().set_route(RouteInfo::default()/* use setters */);
3650    /// assert!(x.route().is_some());
3651    /// assert!(x.instance().is_none());
3652    /// assert!(x.firewall().is_none());
3653    /// assert!(x.endpoint().is_none());
3654    /// assert!(x.google_service().is_none());
3655    /// assert!(x.forwarding_rule().is_none());
3656    /// assert!(x.hybrid_subnet().is_none());
3657    /// assert!(x.vpn_gateway().is_none());
3658    /// assert!(x.vpn_tunnel().is_none());
3659    /// assert!(x.interconnect_attachment().is_none());
3660    /// assert!(x.vpc_connector().is_none());
3661    /// assert!(x.direct_vpc_egress_connection().is_none());
3662    /// assert!(x.serverless_external_connection().is_none());
3663    /// assert!(x.deliver().is_none());
3664    /// assert!(x.forward().is_none());
3665    /// assert!(x.abort().is_none());
3666    /// assert!(x.drop().is_none());
3667    /// assert!(x.load_balancer().is_none());
3668    /// assert!(x.network().is_none());
3669    /// assert!(x.gke_master().is_none());
3670    /// assert!(x.gke_pod().is_none());
3671    /// assert!(x.ip_masquerading_skipped().is_none());
3672    /// assert!(x.gke_network_policy().is_none());
3673    /// assert!(x.gke_network_policy_skipped().is_none());
3674    /// assert!(x.cloud_sql_instance().is_none());
3675    /// assert!(x.redis_instance().is_none());
3676    /// assert!(x.redis_cluster().is_none());
3677    /// assert!(x.cloud_function().is_none());
3678    /// assert!(x.app_engine_version().is_none());
3679    /// assert!(x.cloud_run_revision().is_none());
3680    /// assert!(x.nat().is_none());
3681    /// assert!(x.proxy_connection().is_none());
3682    /// assert!(x.load_balancer_backend_info().is_none());
3683    /// assert!(x.storage_bucket().is_none());
3684    /// assert!(x.serverless_neg().is_none());
3685    /// assert!(x.ngfw_packet_inspection().is_none());
3686    /// ```
3687    pub fn set_route<T: std::convert::Into<std::boxed::Box<crate::model::RouteInfo>>>(
3688        mut self,
3689        v: T,
3690    ) -> Self {
3691        self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Route(v.into()));
3692        self
3693    }
3694
3695    /// The value of [step_info][crate::model::Step::step_info]
3696    /// if it holds a `Endpoint`, `None` if the field is not set or
3697    /// holds a different branch.
3698    pub fn endpoint(&self) -> std::option::Option<&std::boxed::Box<crate::model::EndpointInfo>> {
3699        #[allow(unreachable_patterns)]
3700        self.step_info.as_ref().and_then(|v| match v {
3701            crate::model::step::StepInfo::Endpoint(v) => std::option::Option::Some(v),
3702            _ => std::option::Option::None,
3703        })
3704    }
3705
3706    /// Sets the value of [step_info][crate::model::Step::step_info]
3707    /// to hold a `Endpoint`.
3708    ///
3709    /// Note that all the setters affecting `step_info` are
3710    /// mutually exclusive.
3711    ///
3712    /// # Example
3713    /// ```ignore,no_run
3714    /// # use google_cloud_networkmanagement_v1::model::Step;
3715    /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3716    /// let x = Step::new().set_endpoint(EndpointInfo::default()/* use setters */);
3717    /// assert!(x.endpoint().is_some());
3718    /// assert!(x.instance().is_none());
3719    /// assert!(x.firewall().is_none());
3720    /// assert!(x.route().is_none());
3721    /// assert!(x.google_service().is_none());
3722    /// assert!(x.forwarding_rule().is_none());
3723    /// assert!(x.hybrid_subnet().is_none());
3724    /// assert!(x.vpn_gateway().is_none());
3725    /// assert!(x.vpn_tunnel().is_none());
3726    /// assert!(x.interconnect_attachment().is_none());
3727    /// assert!(x.vpc_connector().is_none());
3728    /// assert!(x.direct_vpc_egress_connection().is_none());
3729    /// assert!(x.serverless_external_connection().is_none());
3730    /// assert!(x.deliver().is_none());
3731    /// assert!(x.forward().is_none());
3732    /// assert!(x.abort().is_none());
3733    /// assert!(x.drop().is_none());
3734    /// assert!(x.load_balancer().is_none());
3735    /// assert!(x.network().is_none());
3736    /// assert!(x.gke_master().is_none());
3737    /// assert!(x.gke_pod().is_none());
3738    /// assert!(x.ip_masquerading_skipped().is_none());
3739    /// assert!(x.gke_network_policy().is_none());
3740    /// assert!(x.gke_network_policy_skipped().is_none());
3741    /// assert!(x.cloud_sql_instance().is_none());
3742    /// assert!(x.redis_instance().is_none());
3743    /// assert!(x.redis_cluster().is_none());
3744    /// assert!(x.cloud_function().is_none());
3745    /// assert!(x.app_engine_version().is_none());
3746    /// assert!(x.cloud_run_revision().is_none());
3747    /// assert!(x.nat().is_none());
3748    /// assert!(x.proxy_connection().is_none());
3749    /// assert!(x.load_balancer_backend_info().is_none());
3750    /// assert!(x.storage_bucket().is_none());
3751    /// assert!(x.serverless_neg().is_none());
3752    /// assert!(x.ngfw_packet_inspection().is_none());
3753    /// ```
3754    pub fn set_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::EndpointInfo>>>(
3755        mut self,
3756        v: T,
3757    ) -> Self {
3758        self.step_info =
3759            std::option::Option::Some(crate::model::step::StepInfo::Endpoint(v.into()));
3760        self
3761    }
3762
3763    /// The value of [step_info][crate::model::Step::step_info]
3764    /// if it holds a `GoogleService`, `None` if the field is not set or
3765    /// holds a different branch.
3766    pub fn google_service(
3767        &self,
3768    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleServiceInfo>> {
3769        #[allow(unreachable_patterns)]
3770        self.step_info.as_ref().and_then(|v| match v {
3771            crate::model::step::StepInfo::GoogleService(v) => std::option::Option::Some(v),
3772            _ => std::option::Option::None,
3773        })
3774    }
3775
3776    /// Sets the value of [step_info][crate::model::Step::step_info]
3777    /// to hold a `GoogleService`.
3778    ///
3779    /// Note that all the setters affecting `step_info` are
3780    /// mutually exclusive.
3781    ///
3782    /// # Example
3783    /// ```ignore,no_run
3784    /// # use google_cloud_networkmanagement_v1::model::Step;
3785    /// use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
3786    /// let x = Step::new().set_google_service(GoogleServiceInfo::default()/* use setters */);
3787    /// assert!(x.google_service().is_some());
3788    /// assert!(x.instance().is_none());
3789    /// assert!(x.firewall().is_none());
3790    /// assert!(x.route().is_none());
3791    /// assert!(x.endpoint().is_none());
3792    /// assert!(x.forwarding_rule().is_none());
3793    /// assert!(x.hybrid_subnet().is_none());
3794    /// assert!(x.vpn_gateway().is_none());
3795    /// assert!(x.vpn_tunnel().is_none());
3796    /// assert!(x.interconnect_attachment().is_none());
3797    /// assert!(x.vpc_connector().is_none());
3798    /// assert!(x.direct_vpc_egress_connection().is_none());
3799    /// assert!(x.serverless_external_connection().is_none());
3800    /// assert!(x.deliver().is_none());
3801    /// assert!(x.forward().is_none());
3802    /// assert!(x.abort().is_none());
3803    /// assert!(x.drop().is_none());
3804    /// assert!(x.load_balancer().is_none());
3805    /// assert!(x.network().is_none());
3806    /// assert!(x.gke_master().is_none());
3807    /// assert!(x.gke_pod().is_none());
3808    /// assert!(x.ip_masquerading_skipped().is_none());
3809    /// assert!(x.gke_network_policy().is_none());
3810    /// assert!(x.gke_network_policy_skipped().is_none());
3811    /// assert!(x.cloud_sql_instance().is_none());
3812    /// assert!(x.redis_instance().is_none());
3813    /// assert!(x.redis_cluster().is_none());
3814    /// assert!(x.cloud_function().is_none());
3815    /// assert!(x.app_engine_version().is_none());
3816    /// assert!(x.cloud_run_revision().is_none());
3817    /// assert!(x.nat().is_none());
3818    /// assert!(x.proxy_connection().is_none());
3819    /// assert!(x.load_balancer_backend_info().is_none());
3820    /// assert!(x.storage_bucket().is_none());
3821    /// assert!(x.serverless_neg().is_none());
3822    /// assert!(x.ngfw_packet_inspection().is_none());
3823    /// ```
3824    pub fn set_google_service<
3825        T: std::convert::Into<std::boxed::Box<crate::model::GoogleServiceInfo>>,
3826    >(
3827        mut self,
3828        v: T,
3829    ) -> Self {
3830        self.step_info =
3831            std::option::Option::Some(crate::model::step::StepInfo::GoogleService(v.into()));
3832        self
3833    }
3834
3835    /// The value of [step_info][crate::model::Step::step_info]
3836    /// if it holds a `ForwardingRule`, `None` if the field is not set or
3837    /// holds a different branch.
3838    pub fn forwarding_rule(
3839        &self,
3840    ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardingRuleInfo>> {
3841        #[allow(unreachable_patterns)]
3842        self.step_info.as_ref().and_then(|v| match v {
3843            crate::model::step::StepInfo::ForwardingRule(v) => std::option::Option::Some(v),
3844            _ => std::option::Option::None,
3845        })
3846    }
3847
3848    /// Sets the value of [step_info][crate::model::Step::step_info]
3849    /// to hold a `ForwardingRule`.
3850    ///
3851    /// Note that all the setters affecting `step_info` are
3852    /// mutually exclusive.
3853    ///
3854    /// # Example
3855    /// ```ignore,no_run
3856    /// # use google_cloud_networkmanagement_v1::model::Step;
3857    /// use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
3858    /// let x = Step::new().set_forwarding_rule(ForwardingRuleInfo::default()/* use setters */);
3859    /// assert!(x.forwarding_rule().is_some());
3860    /// assert!(x.instance().is_none());
3861    /// assert!(x.firewall().is_none());
3862    /// assert!(x.route().is_none());
3863    /// assert!(x.endpoint().is_none());
3864    /// assert!(x.google_service().is_none());
3865    /// assert!(x.hybrid_subnet().is_none());
3866    /// assert!(x.vpn_gateway().is_none());
3867    /// assert!(x.vpn_tunnel().is_none());
3868    /// assert!(x.interconnect_attachment().is_none());
3869    /// assert!(x.vpc_connector().is_none());
3870    /// assert!(x.direct_vpc_egress_connection().is_none());
3871    /// assert!(x.serverless_external_connection().is_none());
3872    /// assert!(x.deliver().is_none());
3873    /// assert!(x.forward().is_none());
3874    /// assert!(x.abort().is_none());
3875    /// assert!(x.drop().is_none());
3876    /// assert!(x.load_balancer().is_none());
3877    /// assert!(x.network().is_none());
3878    /// assert!(x.gke_master().is_none());
3879    /// assert!(x.gke_pod().is_none());
3880    /// assert!(x.ip_masquerading_skipped().is_none());
3881    /// assert!(x.gke_network_policy().is_none());
3882    /// assert!(x.gke_network_policy_skipped().is_none());
3883    /// assert!(x.cloud_sql_instance().is_none());
3884    /// assert!(x.redis_instance().is_none());
3885    /// assert!(x.redis_cluster().is_none());
3886    /// assert!(x.cloud_function().is_none());
3887    /// assert!(x.app_engine_version().is_none());
3888    /// assert!(x.cloud_run_revision().is_none());
3889    /// assert!(x.nat().is_none());
3890    /// assert!(x.proxy_connection().is_none());
3891    /// assert!(x.load_balancer_backend_info().is_none());
3892    /// assert!(x.storage_bucket().is_none());
3893    /// assert!(x.serverless_neg().is_none());
3894    /// assert!(x.ngfw_packet_inspection().is_none());
3895    /// ```
3896    pub fn set_forwarding_rule<
3897        T: std::convert::Into<std::boxed::Box<crate::model::ForwardingRuleInfo>>,
3898    >(
3899        mut self,
3900        v: T,
3901    ) -> Self {
3902        self.step_info =
3903            std::option::Option::Some(crate::model::step::StepInfo::ForwardingRule(v.into()));
3904        self
3905    }
3906
3907    /// The value of [step_info][crate::model::Step::step_info]
3908    /// if it holds a `HybridSubnet`, `None` if the field is not set or
3909    /// holds a different branch.
3910    pub fn hybrid_subnet(
3911        &self,
3912    ) -> std::option::Option<&std::boxed::Box<crate::model::HybridSubnetInfo>> {
3913        #[allow(unreachable_patterns)]
3914        self.step_info.as_ref().and_then(|v| match v {
3915            crate::model::step::StepInfo::HybridSubnet(v) => std::option::Option::Some(v),
3916            _ => std::option::Option::None,
3917        })
3918    }
3919
3920    /// Sets the value of [step_info][crate::model::Step::step_info]
3921    /// to hold a `HybridSubnet`.
3922    ///
3923    /// Note that all the setters affecting `step_info` are
3924    /// mutually exclusive.
3925    ///
3926    /// # Example
3927    /// ```ignore,no_run
3928    /// # use google_cloud_networkmanagement_v1::model::Step;
3929    /// use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
3930    /// let x = Step::new().set_hybrid_subnet(HybridSubnetInfo::default()/* use setters */);
3931    /// assert!(x.hybrid_subnet().is_some());
3932    /// assert!(x.instance().is_none());
3933    /// assert!(x.firewall().is_none());
3934    /// assert!(x.route().is_none());
3935    /// assert!(x.endpoint().is_none());
3936    /// assert!(x.google_service().is_none());
3937    /// assert!(x.forwarding_rule().is_none());
3938    /// assert!(x.vpn_gateway().is_none());
3939    /// assert!(x.vpn_tunnel().is_none());
3940    /// assert!(x.interconnect_attachment().is_none());
3941    /// assert!(x.vpc_connector().is_none());
3942    /// assert!(x.direct_vpc_egress_connection().is_none());
3943    /// assert!(x.serverless_external_connection().is_none());
3944    /// assert!(x.deliver().is_none());
3945    /// assert!(x.forward().is_none());
3946    /// assert!(x.abort().is_none());
3947    /// assert!(x.drop().is_none());
3948    /// assert!(x.load_balancer().is_none());
3949    /// assert!(x.network().is_none());
3950    /// assert!(x.gke_master().is_none());
3951    /// assert!(x.gke_pod().is_none());
3952    /// assert!(x.ip_masquerading_skipped().is_none());
3953    /// assert!(x.gke_network_policy().is_none());
3954    /// assert!(x.gke_network_policy_skipped().is_none());
3955    /// assert!(x.cloud_sql_instance().is_none());
3956    /// assert!(x.redis_instance().is_none());
3957    /// assert!(x.redis_cluster().is_none());
3958    /// assert!(x.cloud_function().is_none());
3959    /// assert!(x.app_engine_version().is_none());
3960    /// assert!(x.cloud_run_revision().is_none());
3961    /// assert!(x.nat().is_none());
3962    /// assert!(x.proxy_connection().is_none());
3963    /// assert!(x.load_balancer_backend_info().is_none());
3964    /// assert!(x.storage_bucket().is_none());
3965    /// assert!(x.serverless_neg().is_none());
3966    /// assert!(x.ngfw_packet_inspection().is_none());
3967    /// ```
3968    pub fn set_hybrid_subnet<
3969        T: std::convert::Into<std::boxed::Box<crate::model::HybridSubnetInfo>>,
3970    >(
3971        mut self,
3972        v: T,
3973    ) -> Self {
3974        self.step_info =
3975            std::option::Option::Some(crate::model::step::StepInfo::HybridSubnet(v.into()));
3976        self
3977    }
3978
3979    /// The value of [step_info][crate::model::Step::step_info]
3980    /// if it holds a `VpnGateway`, `None` if the field is not set or
3981    /// holds a different branch.
3982    pub fn vpn_gateway(
3983        &self,
3984    ) -> std::option::Option<&std::boxed::Box<crate::model::VpnGatewayInfo>> {
3985        #[allow(unreachable_patterns)]
3986        self.step_info.as_ref().and_then(|v| match v {
3987            crate::model::step::StepInfo::VpnGateway(v) => std::option::Option::Some(v),
3988            _ => std::option::Option::None,
3989        })
3990    }
3991
3992    /// Sets the value of [step_info][crate::model::Step::step_info]
3993    /// to hold a `VpnGateway`.
3994    ///
3995    /// Note that all the setters affecting `step_info` are
3996    /// mutually exclusive.
3997    ///
3998    /// # Example
3999    /// ```ignore,no_run
4000    /// # use google_cloud_networkmanagement_v1::model::Step;
4001    /// use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
4002    /// let x = Step::new().set_vpn_gateway(VpnGatewayInfo::default()/* use setters */);
4003    /// assert!(x.vpn_gateway().is_some());
4004    /// assert!(x.instance().is_none());
4005    /// assert!(x.firewall().is_none());
4006    /// assert!(x.route().is_none());
4007    /// assert!(x.endpoint().is_none());
4008    /// assert!(x.google_service().is_none());
4009    /// assert!(x.forwarding_rule().is_none());
4010    /// assert!(x.hybrid_subnet().is_none());
4011    /// assert!(x.vpn_tunnel().is_none());
4012    /// assert!(x.interconnect_attachment().is_none());
4013    /// assert!(x.vpc_connector().is_none());
4014    /// assert!(x.direct_vpc_egress_connection().is_none());
4015    /// assert!(x.serverless_external_connection().is_none());
4016    /// assert!(x.deliver().is_none());
4017    /// assert!(x.forward().is_none());
4018    /// assert!(x.abort().is_none());
4019    /// assert!(x.drop().is_none());
4020    /// assert!(x.load_balancer().is_none());
4021    /// assert!(x.network().is_none());
4022    /// assert!(x.gke_master().is_none());
4023    /// assert!(x.gke_pod().is_none());
4024    /// assert!(x.ip_masquerading_skipped().is_none());
4025    /// assert!(x.gke_network_policy().is_none());
4026    /// assert!(x.gke_network_policy_skipped().is_none());
4027    /// assert!(x.cloud_sql_instance().is_none());
4028    /// assert!(x.redis_instance().is_none());
4029    /// assert!(x.redis_cluster().is_none());
4030    /// assert!(x.cloud_function().is_none());
4031    /// assert!(x.app_engine_version().is_none());
4032    /// assert!(x.cloud_run_revision().is_none());
4033    /// assert!(x.nat().is_none());
4034    /// assert!(x.proxy_connection().is_none());
4035    /// assert!(x.load_balancer_backend_info().is_none());
4036    /// assert!(x.storage_bucket().is_none());
4037    /// assert!(x.serverless_neg().is_none());
4038    /// assert!(x.ngfw_packet_inspection().is_none());
4039    /// ```
4040    pub fn set_vpn_gateway<T: std::convert::Into<std::boxed::Box<crate::model::VpnGatewayInfo>>>(
4041        mut self,
4042        v: T,
4043    ) -> Self {
4044        self.step_info =
4045            std::option::Option::Some(crate::model::step::StepInfo::VpnGateway(v.into()));
4046        self
4047    }
4048
4049    /// The value of [step_info][crate::model::Step::step_info]
4050    /// if it holds a `VpnTunnel`, `None` if the field is not set or
4051    /// holds a different branch.
4052    pub fn vpn_tunnel(&self) -> std::option::Option<&std::boxed::Box<crate::model::VpnTunnelInfo>> {
4053        #[allow(unreachable_patterns)]
4054        self.step_info.as_ref().and_then(|v| match v {
4055            crate::model::step::StepInfo::VpnTunnel(v) => std::option::Option::Some(v),
4056            _ => std::option::Option::None,
4057        })
4058    }
4059
4060    /// Sets the value of [step_info][crate::model::Step::step_info]
4061    /// to hold a `VpnTunnel`.
4062    ///
4063    /// Note that all the setters affecting `step_info` are
4064    /// mutually exclusive.
4065    ///
4066    /// # Example
4067    /// ```ignore,no_run
4068    /// # use google_cloud_networkmanagement_v1::model::Step;
4069    /// use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
4070    /// let x = Step::new().set_vpn_tunnel(VpnTunnelInfo::default()/* use setters */);
4071    /// assert!(x.vpn_tunnel().is_some());
4072    /// assert!(x.instance().is_none());
4073    /// assert!(x.firewall().is_none());
4074    /// assert!(x.route().is_none());
4075    /// assert!(x.endpoint().is_none());
4076    /// assert!(x.google_service().is_none());
4077    /// assert!(x.forwarding_rule().is_none());
4078    /// assert!(x.hybrid_subnet().is_none());
4079    /// assert!(x.vpn_gateway().is_none());
4080    /// assert!(x.interconnect_attachment().is_none());
4081    /// assert!(x.vpc_connector().is_none());
4082    /// assert!(x.direct_vpc_egress_connection().is_none());
4083    /// assert!(x.serverless_external_connection().is_none());
4084    /// assert!(x.deliver().is_none());
4085    /// assert!(x.forward().is_none());
4086    /// assert!(x.abort().is_none());
4087    /// assert!(x.drop().is_none());
4088    /// assert!(x.load_balancer().is_none());
4089    /// assert!(x.network().is_none());
4090    /// assert!(x.gke_master().is_none());
4091    /// assert!(x.gke_pod().is_none());
4092    /// assert!(x.ip_masquerading_skipped().is_none());
4093    /// assert!(x.gke_network_policy().is_none());
4094    /// assert!(x.gke_network_policy_skipped().is_none());
4095    /// assert!(x.cloud_sql_instance().is_none());
4096    /// assert!(x.redis_instance().is_none());
4097    /// assert!(x.redis_cluster().is_none());
4098    /// assert!(x.cloud_function().is_none());
4099    /// assert!(x.app_engine_version().is_none());
4100    /// assert!(x.cloud_run_revision().is_none());
4101    /// assert!(x.nat().is_none());
4102    /// assert!(x.proxy_connection().is_none());
4103    /// assert!(x.load_balancer_backend_info().is_none());
4104    /// assert!(x.storage_bucket().is_none());
4105    /// assert!(x.serverless_neg().is_none());
4106    /// assert!(x.ngfw_packet_inspection().is_none());
4107    /// ```
4108    pub fn set_vpn_tunnel<T: std::convert::Into<std::boxed::Box<crate::model::VpnTunnelInfo>>>(
4109        mut self,
4110        v: T,
4111    ) -> Self {
4112        self.step_info =
4113            std::option::Option::Some(crate::model::step::StepInfo::VpnTunnel(v.into()));
4114        self
4115    }
4116
4117    /// The value of [step_info][crate::model::Step::step_info]
4118    /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
4119    /// holds a different branch.
4120    pub fn interconnect_attachment(
4121        &self,
4122    ) -> std::option::Option<&std::boxed::Box<crate::model::InterconnectAttachmentInfo>> {
4123        #[allow(unreachable_patterns)]
4124        self.step_info.as_ref().and_then(|v| match v {
4125            crate::model::step::StepInfo::InterconnectAttachment(v) => std::option::Option::Some(v),
4126            _ => std::option::Option::None,
4127        })
4128    }
4129
4130    /// Sets the value of [step_info][crate::model::Step::step_info]
4131    /// to hold a `InterconnectAttachment`.
4132    ///
4133    /// Note that all the setters affecting `step_info` are
4134    /// mutually exclusive.
4135    ///
4136    /// # Example
4137    /// ```ignore,no_run
4138    /// # use google_cloud_networkmanagement_v1::model::Step;
4139    /// use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
4140    /// let x = Step::new().set_interconnect_attachment(InterconnectAttachmentInfo::default()/* use setters */);
4141    /// assert!(x.interconnect_attachment().is_some());
4142    /// assert!(x.instance().is_none());
4143    /// assert!(x.firewall().is_none());
4144    /// assert!(x.route().is_none());
4145    /// assert!(x.endpoint().is_none());
4146    /// assert!(x.google_service().is_none());
4147    /// assert!(x.forwarding_rule().is_none());
4148    /// assert!(x.hybrid_subnet().is_none());
4149    /// assert!(x.vpn_gateway().is_none());
4150    /// assert!(x.vpn_tunnel().is_none());
4151    /// assert!(x.vpc_connector().is_none());
4152    /// assert!(x.direct_vpc_egress_connection().is_none());
4153    /// assert!(x.serverless_external_connection().is_none());
4154    /// assert!(x.deliver().is_none());
4155    /// assert!(x.forward().is_none());
4156    /// assert!(x.abort().is_none());
4157    /// assert!(x.drop().is_none());
4158    /// assert!(x.load_balancer().is_none());
4159    /// assert!(x.network().is_none());
4160    /// assert!(x.gke_master().is_none());
4161    /// assert!(x.gke_pod().is_none());
4162    /// assert!(x.ip_masquerading_skipped().is_none());
4163    /// assert!(x.gke_network_policy().is_none());
4164    /// assert!(x.gke_network_policy_skipped().is_none());
4165    /// assert!(x.cloud_sql_instance().is_none());
4166    /// assert!(x.redis_instance().is_none());
4167    /// assert!(x.redis_cluster().is_none());
4168    /// assert!(x.cloud_function().is_none());
4169    /// assert!(x.app_engine_version().is_none());
4170    /// assert!(x.cloud_run_revision().is_none());
4171    /// assert!(x.nat().is_none());
4172    /// assert!(x.proxy_connection().is_none());
4173    /// assert!(x.load_balancer_backend_info().is_none());
4174    /// assert!(x.storage_bucket().is_none());
4175    /// assert!(x.serverless_neg().is_none());
4176    /// assert!(x.ngfw_packet_inspection().is_none());
4177    /// ```
4178    pub fn set_interconnect_attachment<
4179        T: std::convert::Into<std::boxed::Box<crate::model::InterconnectAttachmentInfo>>,
4180    >(
4181        mut self,
4182        v: T,
4183    ) -> Self {
4184        self.step_info = std::option::Option::Some(
4185            crate::model::step::StepInfo::InterconnectAttachment(v.into()),
4186        );
4187        self
4188    }
4189
4190    /// The value of [step_info][crate::model::Step::step_info]
4191    /// if it holds a `VpcConnector`, `None` if the field is not set or
4192    /// holds a different branch.
4193    pub fn vpc_connector(
4194        &self,
4195    ) -> std::option::Option<&std::boxed::Box<crate::model::VpcConnectorInfo>> {
4196        #[allow(unreachable_patterns)]
4197        self.step_info.as_ref().and_then(|v| match v {
4198            crate::model::step::StepInfo::VpcConnector(v) => std::option::Option::Some(v),
4199            _ => std::option::Option::None,
4200        })
4201    }
4202
4203    /// Sets the value of [step_info][crate::model::Step::step_info]
4204    /// to hold a `VpcConnector`.
4205    ///
4206    /// Note that all the setters affecting `step_info` are
4207    /// mutually exclusive.
4208    ///
4209    /// # Example
4210    /// ```ignore,no_run
4211    /// # use google_cloud_networkmanagement_v1::model::Step;
4212    /// use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
4213    /// let x = Step::new().set_vpc_connector(VpcConnectorInfo::default()/* use setters */);
4214    /// assert!(x.vpc_connector().is_some());
4215    /// assert!(x.instance().is_none());
4216    /// assert!(x.firewall().is_none());
4217    /// assert!(x.route().is_none());
4218    /// assert!(x.endpoint().is_none());
4219    /// assert!(x.google_service().is_none());
4220    /// assert!(x.forwarding_rule().is_none());
4221    /// assert!(x.hybrid_subnet().is_none());
4222    /// assert!(x.vpn_gateway().is_none());
4223    /// assert!(x.vpn_tunnel().is_none());
4224    /// assert!(x.interconnect_attachment().is_none());
4225    /// assert!(x.direct_vpc_egress_connection().is_none());
4226    /// assert!(x.serverless_external_connection().is_none());
4227    /// assert!(x.deliver().is_none());
4228    /// assert!(x.forward().is_none());
4229    /// assert!(x.abort().is_none());
4230    /// assert!(x.drop().is_none());
4231    /// assert!(x.load_balancer().is_none());
4232    /// assert!(x.network().is_none());
4233    /// assert!(x.gke_master().is_none());
4234    /// assert!(x.gke_pod().is_none());
4235    /// assert!(x.ip_masquerading_skipped().is_none());
4236    /// assert!(x.gke_network_policy().is_none());
4237    /// assert!(x.gke_network_policy_skipped().is_none());
4238    /// assert!(x.cloud_sql_instance().is_none());
4239    /// assert!(x.redis_instance().is_none());
4240    /// assert!(x.redis_cluster().is_none());
4241    /// assert!(x.cloud_function().is_none());
4242    /// assert!(x.app_engine_version().is_none());
4243    /// assert!(x.cloud_run_revision().is_none());
4244    /// assert!(x.nat().is_none());
4245    /// assert!(x.proxy_connection().is_none());
4246    /// assert!(x.load_balancer_backend_info().is_none());
4247    /// assert!(x.storage_bucket().is_none());
4248    /// assert!(x.serverless_neg().is_none());
4249    /// assert!(x.ngfw_packet_inspection().is_none());
4250    /// ```
4251    pub fn set_vpc_connector<
4252        T: std::convert::Into<std::boxed::Box<crate::model::VpcConnectorInfo>>,
4253    >(
4254        mut self,
4255        v: T,
4256    ) -> Self {
4257        self.step_info =
4258            std::option::Option::Some(crate::model::step::StepInfo::VpcConnector(v.into()));
4259        self
4260    }
4261
4262    /// The value of [step_info][crate::model::Step::step_info]
4263    /// if it holds a `DirectVpcEgressConnection`, `None` if the field is not set or
4264    /// holds a different branch.
4265    pub fn direct_vpc_egress_connection(
4266        &self,
4267    ) -> std::option::Option<&std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>> {
4268        #[allow(unreachable_patterns)]
4269        self.step_info.as_ref().and_then(|v| match v {
4270            crate::model::step::StepInfo::DirectVpcEgressConnection(v) => {
4271                std::option::Option::Some(v)
4272            }
4273            _ => std::option::Option::None,
4274        })
4275    }
4276
4277    /// Sets the value of [step_info][crate::model::Step::step_info]
4278    /// to hold a `DirectVpcEgressConnection`.
4279    ///
4280    /// Note that all the setters affecting `step_info` are
4281    /// mutually exclusive.
4282    ///
4283    /// # Example
4284    /// ```ignore,no_run
4285    /// # use google_cloud_networkmanagement_v1::model::Step;
4286    /// use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
4287    /// let x = Step::new().set_direct_vpc_egress_connection(DirectVpcEgressConnectionInfo::default()/* use setters */);
4288    /// assert!(x.direct_vpc_egress_connection().is_some());
4289    /// assert!(x.instance().is_none());
4290    /// assert!(x.firewall().is_none());
4291    /// assert!(x.route().is_none());
4292    /// assert!(x.endpoint().is_none());
4293    /// assert!(x.google_service().is_none());
4294    /// assert!(x.forwarding_rule().is_none());
4295    /// assert!(x.hybrid_subnet().is_none());
4296    /// assert!(x.vpn_gateway().is_none());
4297    /// assert!(x.vpn_tunnel().is_none());
4298    /// assert!(x.interconnect_attachment().is_none());
4299    /// assert!(x.vpc_connector().is_none());
4300    /// assert!(x.serverless_external_connection().is_none());
4301    /// assert!(x.deliver().is_none());
4302    /// assert!(x.forward().is_none());
4303    /// assert!(x.abort().is_none());
4304    /// assert!(x.drop().is_none());
4305    /// assert!(x.load_balancer().is_none());
4306    /// assert!(x.network().is_none());
4307    /// assert!(x.gke_master().is_none());
4308    /// assert!(x.gke_pod().is_none());
4309    /// assert!(x.ip_masquerading_skipped().is_none());
4310    /// assert!(x.gke_network_policy().is_none());
4311    /// assert!(x.gke_network_policy_skipped().is_none());
4312    /// assert!(x.cloud_sql_instance().is_none());
4313    /// assert!(x.redis_instance().is_none());
4314    /// assert!(x.redis_cluster().is_none());
4315    /// assert!(x.cloud_function().is_none());
4316    /// assert!(x.app_engine_version().is_none());
4317    /// assert!(x.cloud_run_revision().is_none());
4318    /// assert!(x.nat().is_none());
4319    /// assert!(x.proxy_connection().is_none());
4320    /// assert!(x.load_balancer_backend_info().is_none());
4321    /// assert!(x.storage_bucket().is_none());
4322    /// assert!(x.serverless_neg().is_none());
4323    /// assert!(x.ngfw_packet_inspection().is_none());
4324    /// ```
4325    pub fn set_direct_vpc_egress_connection<
4326        T: std::convert::Into<std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>>,
4327    >(
4328        mut self,
4329        v: T,
4330    ) -> Self {
4331        self.step_info = std::option::Option::Some(
4332            crate::model::step::StepInfo::DirectVpcEgressConnection(v.into()),
4333        );
4334        self
4335    }
4336
4337    /// The value of [step_info][crate::model::Step::step_info]
4338    /// if it holds a `ServerlessExternalConnection`, `None` if the field is not set or
4339    /// holds a different branch.
4340    pub fn serverless_external_connection(
4341        &self,
4342    ) -> std::option::Option<&std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>> {
4343        #[allow(unreachable_patterns)]
4344        self.step_info.as_ref().and_then(|v| match v {
4345            crate::model::step::StepInfo::ServerlessExternalConnection(v) => {
4346                std::option::Option::Some(v)
4347            }
4348            _ => std::option::Option::None,
4349        })
4350    }
4351
4352    /// Sets the value of [step_info][crate::model::Step::step_info]
4353    /// to hold a `ServerlessExternalConnection`.
4354    ///
4355    /// Note that all the setters affecting `step_info` are
4356    /// mutually exclusive.
4357    ///
4358    /// # Example
4359    /// ```ignore,no_run
4360    /// # use google_cloud_networkmanagement_v1::model::Step;
4361    /// use google_cloud_networkmanagement_v1::model::ServerlessExternalConnectionInfo;
4362    /// let x = Step::new().set_serverless_external_connection(ServerlessExternalConnectionInfo::default()/* use setters */);
4363    /// assert!(x.serverless_external_connection().is_some());
4364    /// assert!(x.instance().is_none());
4365    /// assert!(x.firewall().is_none());
4366    /// assert!(x.route().is_none());
4367    /// assert!(x.endpoint().is_none());
4368    /// assert!(x.google_service().is_none());
4369    /// assert!(x.forwarding_rule().is_none());
4370    /// assert!(x.hybrid_subnet().is_none());
4371    /// assert!(x.vpn_gateway().is_none());
4372    /// assert!(x.vpn_tunnel().is_none());
4373    /// assert!(x.interconnect_attachment().is_none());
4374    /// assert!(x.vpc_connector().is_none());
4375    /// assert!(x.direct_vpc_egress_connection().is_none());
4376    /// assert!(x.deliver().is_none());
4377    /// assert!(x.forward().is_none());
4378    /// assert!(x.abort().is_none());
4379    /// assert!(x.drop().is_none());
4380    /// assert!(x.load_balancer().is_none());
4381    /// assert!(x.network().is_none());
4382    /// assert!(x.gke_master().is_none());
4383    /// assert!(x.gke_pod().is_none());
4384    /// assert!(x.ip_masquerading_skipped().is_none());
4385    /// assert!(x.gke_network_policy().is_none());
4386    /// assert!(x.gke_network_policy_skipped().is_none());
4387    /// assert!(x.cloud_sql_instance().is_none());
4388    /// assert!(x.redis_instance().is_none());
4389    /// assert!(x.redis_cluster().is_none());
4390    /// assert!(x.cloud_function().is_none());
4391    /// assert!(x.app_engine_version().is_none());
4392    /// assert!(x.cloud_run_revision().is_none());
4393    /// assert!(x.nat().is_none());
4394    /// assert!(x.proxy_connection().is_none());
4395    /// assert!(x.load_balancer_backend_info().is_none());
4396    /// assert!(x.storage_bucket().is_none());
4397    /// assert!(x.serverless_neg().is_none());
4398    /// assert!(x.ngfw_packet_inspection().is_none());
4399    /// ```
4400    pub fn set_serverless_external_connection<
4401        T: std::convert::Into<std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>>,
4402    >(
4403        mut self,
4404        v: T,
4405    ) -> Self {
4406        self.step_info = std::option::Option::Some(
4407            crate::model::step::StepInfo::ServerlessExternalConnection(v.into()),
4408        );
4409        self
4410    }
4411
4412    /// The value of [step_info][crate::model::Step::step_info]
4413    /// if it holds a `Deliver`, `None` if the field is not set or
4414    /// holds a different branch.
4415    pub fn deliver(&self) -> std::option::Option<&std::boxed::Box<crate::model::DeliverInfo>> {
4416        #[allow(unreachable_patterns)]
4417        self.step_info.as_ref().and_then(|v| match v {
4418            crate::model::step::StepInfo::Deliver(v) => std::option::Option::Some(v),
4419            _ => std::option::Option::None,
4420        })
4421    }
4422
4423    /// Sets the value of [step_info][crate::model::Step::step_info]
4424    /// to hold a `Deliver`.
4425    ///
4426    /// Note that all the setters affecting `step_info` are
4427    /// mutually exclusive.
4428    ///
4429    /// # Example
4430    /// ```ignore,no_run
4431    /// # use google_cloud_networkmanagement_v1::model::Step;
4432    /// use google_cloud_networkmanagement_v1::model::DeliverInfo;
4433    /// let x = Step::new().set_deliver(DeliverInfo::default()/* use setters */);
4434    /// assert!(x.deliver().is_some());
4435    /// assert!(x.instance().is_none());
4436    /// assert!(x.firewall().is_none());
4437    /// assert!(x.route().is_none());
4438    /// assert!(x.endpoint().is_none());
4439    /// assert!(x.google_service().is_none());
4440    /// assert!(x.forwarding_rule().is_none());
4441    /// assert!(x.hybrid_subnet().is_none());
4442    /// assert!(x.vpn_gateway().is_none());
4443    /// assert!(x.vpn_tunnel().is_none());
4444    /// assert!(x.interconnect_attachment().is_none());
4445    /// assert!(x.vpc_connector().is_none());
4446    /// assert!(x.direct_vpc_egress_connection().is_none());
4447    /// assert!(x.serverless_external_connection().is_none());
4448    /// assert!(x.forward().is_none());
4449    /// assert!(x.abort().is_none());
4450    /// assert!(x.drop().is_none());
4451    /// assert!(x.load_balancer().is_none());
4452    /// assert!(x.network().is_none());
4453    /// assert!(x.gke_master().is_none());
4454    /// assert!(x.gke_pod().is_none());
4455    /// assert!(x.ip_masquerading_skipped().is_none());
4456    /// assert!(x.gke_network_policy().is_none());
4457    /// assert!(x.gke_network_policy_skipped().is_none());
4458    /// assert!(x.cloud_sql_instance().is_none());
4459    /// assert!(x.redis_instance().is_none());
4460    /// assert!(x.redis_cluster().is_none());
4461    /// assert!(x.cloud_function().is_none());
4462    /// assert!(x.app_engine_version().is_none());
4463    /// assert!(x.cloud_run_revision().is_none());
4464    /// assert!(x.nat().is_none());
4465    /// assert!(x.proxy_connection().is_none());
4466    /// assert!(x.load_balancer_backend_info().is_none());
4467    /// assert!(x.storage_bucket().is_none());
4468    /// assert!(x.serverless_neg().is_none());
4469    /// assert!(x.ngfw_packet_inspection().is_none());
4470    /// ```
4471    pub fn set_deliver<T: std::convert::Into<std::boxed::Box<crate::model::DeliverInfo>>>(
4472        mut self,
4473        v: T,
4474    ) -> Self {
4475        self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Deliver(v.into()));
4476        self
4477    }
4478
4479    /// The value of [step_info][crate::model::Step::step_info]
4480    /// if it holds a `Forward`, `None` if the field is not set or
4481    /// holds a different branch.
4482    pub fn forward(&self) -> std::option::Option<&std::boxed::Box<crate::model::ForwardInfo>> {
4483        #[allow(unreachable_patterns)]
4484        self.step_info.as_ref().and_then(|v| match v {
4485            crate::model::step::StepInfo::Forward(v) => std::option::Option::Some(v),
4486            _ => std::option::Option::None,
4487        })
4488    }
4489
4490    /// Sets the value of [step_info][crate::model::Step::step_info]
4491    /// to hold a `Forward`.
4492    ///
4493    /// Note that all the setters affecting `step_info` are
4494    /// mutually exclusive.
4495    ///
4496    /// # Example
4497    /// ```ignore,no_run
4498    /// # use google_cloud_networkmanagement_v1::model::Step;
4499    /// use google_cloud_networkmanagement_v1::model::ForwardInfo;
4500    /// let x = Step::new().set_forward(ForwardInfo::default()/* use setters */);
4501    /// assert!(x.forward().is_some());
4502    /// assert!(x.instance().is_none());
4503    /// assert!(x.firewall().is_none());
4504    /// assert!(x.route().is_none());
4505    /// assert!(x.endpoint().is_none());
4506    /// assert!(x.google_service().is_none());
4507    /// assert!(x.forwarding_rule().is_none());
4508    /// assert!(x.hybrid_subnet().is_none());
4509    /// assert!(x.vpn_gateway().is_none());
4510    /// assert!(x.vpn_tunnel().is_none());
4511    /// assert!(x.interconnect_attachment().is_none());
4512    /// assert!(x.vpc_connector().is_none());
4513    /// assert!(x.direct_vpc_egress_connection().is_none());
4514    /// assert!(x.serverless_external_connection().is_none());
4515    /// assert!(x.deliver().is_none());
4516    /// assert!(x.abort().is_none());
4517    /// assert!(x.drop().is_none());
4518    /// assert!(x.load_balancer().is_none());
4519    /// assert!(x.network().is_none());
4520    /// assert!(x.gke_master().is_none());
4521    /// assert!(x.gke_pod().is_none());
4522    /// assert!(x.ip_masquerading_skipped().is_none());
4523    /// assert!(x.gke_network_policy().is_none());
4524    /// assert!(x.gke_network_policy_skipped().is_none());
4525    /// assert!(x.cloud_sql_instance().is_none());
4526    /// assert!(x.redis_instance().is_none());
4527    /// assert!(x.redis_cluster().is_none());
4528    /// assert!(x.cloud_function().is_none());
4529    /// assert!(x.app_engine_version().is_none());
4530    /// assert!(x.cloud_run_revision().is_none());
4531    /// assert!(x.nat().is_none());
4532    /// assert!(x.proxy_connection().is_none());
4533    /// assert!(x.load_balancer_backend_info().is_none());
4534    /// assert!(x.storage_bucket().is_none());
4535    /// assert!(x.serverless_neg().is_none());
4536    /// assert!(x.ngfw_packet_inspection().is_none());
4537    /// ```
4538    pub fn set_forward<T: std::convert::Into<std::boxed::Box<crate::model::ForwardInfo>>>(
4539        mut self,
4540        v: T,
4541    ) -> Self {
4542        self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Forward(v.into()));
4543        self
4544    }
4545
4546    /// The value of [step_info][crate::model::Step::step_info]
4547    /// if it holds a `Abort`, `None` if the field is not set or
4548    /// holds a different branch.
4549    pub fn abort(&self) -> std::option::Option<&std::boxed::Box<crate::model::AbortInfo>> {
4550        #[allow(unreachable_patterns)]
4551        self.step_info.as_ref().and_then(|v| match v {
4552            crate::model::step::StepInfo::Abort(v) => std::option::Option::Some(v),
4553            _ => std::option::Option::None,
4554        })
4555    }
4556
4557    /// Sets the value of [step_info][crate::model::Step::step_info]
4558    /// to hold a `Abort`.
4559    ///
4560    /// Note that all the setters affecting `step_info` are
4561    /// mutually exclusive.
4562    ///
4563    /// # Example
4564    /// ```ignore,no_run
4565    /// # use google_cloud_networkmanagement_v1::model::Step;
4566    /// use google_cloud_networkmanagement_v1::model::AbortInfo;
4567    /// let x = Step::new().set_abort(AbortInfo::default()/* use setters */);
4568    /// assert!(x.abort().is_some());
4569    /// assert!(x.instance().is_none());
4570    /// assert!(x.firewall().is_none());
4571    /// assert!(x.route().is_none());
4572    /// assert!(x.endpoint().is_none());
4573    /// assert!(x.google_service().is_none());
4574    /// assert!(x.forwarding_rule().is_none());
4575    /// assert!(x.hybrid_subnet().is_none());
4576    /// assert!(x.vpn_gateway().is_none());
4577    /// assert!(x.vpn_tunnel().is_none());
4578    /// assert!(x.interconnect_attachment().is_none());
4579    /// assert!(x.vpc_connector().is_none());
4580    /// assert!(x.direct_vpc_egress_connection().is_none());
4581    /// assert!(x.serverless_external_connection().is_none());
4582    /// assert!(x.deliver().is_none());
4583    /// assert!(x.forward().is_none());
4584    /// assert!(x.drop().is_none());
4585    /// assert!(x.load_balancer().is_none());
4586    /// assert!(x.network().is_none());
4587    /// assert!(x.gke_master().is_none());
4588    /// assert!(x.gke_pod().is_none());
4589    /// assert!(x.ip_masquerading_skipped().is_none());
4590    /// assert!(x.gke_network_policy().is_none());
4591    /// assert!(x.gke_network_policy_skipped().is_none());
4592    /// assert!(x.cloud_sql_instance().is_none());
4593    /// assert!(x.redis_instance().is_none());
4594    /// assert!(x.redis_cluster().is_none());
4595    /// assert!(x.cloud_function().is_none());
4596    /// assert!(x.app_engine_version().is_none());
4597    /// assert!(x.cloud_run_revision().is_none());
4598    /// assert!(x.nat().is_none());
4599    /// assert!(x.proxy_connection().is_none());
4600    /// assert!(x.load_balancer_backend_info().is_none());
4601    /// assert!(x.storage_bucket().is_none());
4602    /// assert!(x.serverless_neg().is_none());
4603    /// assert!(x.ngfw_packet_inspection().is_none());
4604    /// ```
4605    pub fn set_abort<T: std::convert::Into<std::boxed::Box<crate::model::AbortInfo>>>(
4606        mut self,
4607        v: T,
4608    ) -> Self {
4609        self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Abort(v.into()));
4610        self
4611    }
4612
4613    /// The value of [step_info][crate::model::Step::step_info]
4614    /// if it holds a `Drop`, `None` if the field is not set or
4615    /// holds a different branch.
4616    pub fn drop(&self) -> std::option::Option<&std::boxed::Box<crate::model::DropInfo>> {
4617        #[allow(unreachable_patterns)]
4618        self.step_info.as_ref().and_then(|v| match v {
4619            crate::model::step::StepInfo::Drop(v) => std::option::Option::Some(v),
4620            _ => std::option::Option::None,
4621        })
4622    }
4623
4624    /// Sets the value of [step_info][crate::model::Step::step_info]
4625    /// to hold a `Drop`.
4626    ///
4627    /// Note that all the setters affecting `step_info` are
4628    /// mutually exclusive.
4629    ///
4630    /// # Example
4631    /// ```ignore,no_run
4632    /// # use google_cloud_networkmanagement_v1::model::Step;
4633    /// use google_cloud_networkmanagement_v1::model::DropInfo;
4634    /// let x = Step::new().set_drop(DropInfo::default()/* use setters */);
4635    /// assert!(x.drop().is_some());
4636    /// assert!(x.instance().is_none());
4637    /// assert!(x.firewall().is_none());
4638    /// assert!(x.route().is_none());
4639    /// assert!(x.endpoint().is_none());
4640    /// assert!(x.google_service().is_none());
4641    /// assert!(x.forwarding_rule().is_none());
4642    /// assert!(x.hybrid_subnet().is_none());
4643    /// assert!(x.vpn_gateway().is_none());
4644    /// assert!(x.vpn_tunnel().is_none());
4645    /// assert!(x.interconnect_attachment().is_none());
4646    /// assert!(x.vpc_connector().is_none());
4647    /// assert!(x.direct_vpc_egress_connection().is_none());
4648    /// assert!(x.serverless_external_connection().is_none());
4649    /// assert!(x.deliver().is_none());
4650    /// assert!(x.forward().is_none());
4651    /// assert!(x.abort().is_none());
4652    /// assert!(x.load_balancer().is_none());
4653    /// assert!(x.network().is_none());
4654    /// assert!(x.gke_master().is_none());
4655    /// assert!(x.gke_pod().is_none());
4656    /// assert!(x.ip_masquerading_skipped().is_none());
4657    /// assert!(x.gke_network_policy().is_none());
4658    /// assert!(x.gke_network_policy_skipped().is_none());
4659    /// assert!(x.cloud_sql_instance().is_none());
4660    /// assert!(x.redis_instance().is_none());
4661    /// assert!(x.redis_cluster().is_none());
4662    /// assert!(x.cloud_function().is_none());
4663    /// assert!(x.app_engine_version().is_none());
4664    /// assert!(x.cloud_run_revision().is_none());
4665    /// assert!(x.nat().is_none());
4666    /// assert!(x.proxy_connection().is_none());
4667    /// assert!(x.load_balancer_backend_info().is_none());
4668    /// assert!(x.storage_bucket().is_none());
4669    /// assert!(x.serverless_neg().is_none());
4670    /// assert!(x.ngfw_packet_inspection().is_none());
4671    /// ```
4672    pub fn set_drop<T: std::convert::Into<std::boxed::Box<crate::model::DropInfo>>>(
4673        mut self,
4674        v: T,
4675    ) -> Self {
4676        self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Drop(v.into()));
4677        self
4678    }
4679
4680    /// The value of [step_info][crate::model::Step::step_info]
4681    /// if it holds a `LoadBalancer`, `None` if the field is not set or
4682    /// holds a different branch.
4683    #[deprecated]
4684    pub fn load_balancer(
4685        &self,
4686    ) -> std::option::Option<&std::boxed::Box<crate::model::LoadBalancerInfo>> {
4687        #[allow(unreachable_patterns)]
4688        self.step_info.as_ref().and_then(|v| match v {
4689            crate::model::step::StepInfo::LoadBalancer(v) => std::option::Option::Some(v),
4690            _ => std::option::Option::None,
4691        })
4692    }
4693
4694    /// Sets the value of [step_info][crate::model::Step::step_info]
4695    /// to hold a `LoadBalancer`.
4696    ///
4697    /// Note that all the setters affecting `step_info` are
4698    /// mutually exclusive.
4699    ///
4700    /// # Example
4701    /// ```ignore,no_run
4702    /// # use google_cloud_networkmanagement_v1::model::Step;
4703    /// use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
4704    /// let x = Step::new().set_load_balancer(LoadBalancerInfo::default()/* use setters */);
4705    /// assert!(x.load_balancer().is_some());
4706    /// assert!(x.instance().is_none());
4707    /// assert!(x.firewall().is_none());
4708    /// assert!(x.route().is_none());
4709    /// assert!(x.endpoint().is_none());
4710    /// assert!(x.google_service().is_none());
4711    /// assert!(x.forwarding_rule().is_none());
4712    /// assert!(x.hybrid_subnet().is_none());
4713    /// assert!(x.vpn_gateway().is_none());
4714    /// assert!(x.vpn_tunnel().is_none());
4715    /// assert!(x.interconnect_attachment().is_none());
4716    /// assert!(x.vpc_connector().is_none());
4717    /// assert!(x.direct_vpc_egress_connection().is_none());
4718    /// assert!(x.serverless_external_connection().is_none());
4719    /// assert!(x.deliver().is_none());
4720    /// assert!(x.forward().is_none());
4721    /// assert!(x.abort().is_none());
4722    /// assert!(x.drop().is_none());
4723    /// assert!(x.network().is_none());
4724    /// assert!(x.gke_master().is_none());
4725    /// assert!(x.gke_pod().is_none());
4726    /// assert!(x.ip_masquerading_skipped().is_none());
4727    /// assert!(x.gke_network_policy().is_none());
4728    /// assert!(x.gke_network_policy_skipped().is_none());
4729    /// assert!(x.cloud_sql_instance().is_none());
4730    /// assert!(x.redis_instance().is_none());
4731    /// assert!(x.redis_cluster().is_none());
4732    /// assert!(x.cloud_function().is_none());
4733    /// assert!(x.app_engine_version().is_none());
4734    /// assert!(x.cloud_run_revision().is_none());
4735    /// assert!(x.nat().is_none());
4736    /// assert!(x.proxy_connection().is_none());
4737    /// assert!(x.load_balancer_backend_info().is_none());
4738    /// assert!(x.storage_bucket().is_none());
4739    /// assert!(x.serverless_neg().is_none());
4740    /// assert!(x.ngfw_packet_inspection().is_none());
4741    /// ```
4742    #[deprecated]
4743    pub fn set_load_balancer<
4744        T: std::convert::Into<std::boxed::Box<crate::model::LoadBalancerInfo>>,
4745    >(
4746        mut self,
4747        v: T,
4748    ) -> Self {
4749        self.step_info =
4750            std::option::Option::Some(crate::model::step::StepInfo::LoadBalancer(v.into()));
4751        self
4752    }
4753
4754    /// The value of [step_info][crate::model::Step::step_info]
4755    /// if it holds a `Network`, `None` if the field is not set or
4756    /// holds a different branch.
4757    pub fn network(&self) -> std::option::Option<&std::boxed::Box<crate::model::NetworkInfo>> {
4758        #[allow(unreachable_patterns)]
4759        self.step_info.as_ref().and_then(|v| match v {
4760            crate::model::step::StepInfo::Network(v) => std::option::Option::Some(v),
4761            _ => std::option::Option::None,
4762        })
4763    }
4764
4765    /// Sets the value of [step_info][crate::model::Step::step_info]
4766    /// to hold a `Network`.
4767    ///
4768    /// Note that all the setters affecting `step_info` are
4769    /// mutually exclusive.
4770    ///
4771    /// # Example
4772    /// ```ignore,no_run
4773    /// # use google_cloud_networkmanagement_v1::model::Step;
4774    /// use google_cloud_networkmanagement_v1::model::NetworkInfo;
4775    /// let x = Step::new().set_network(NetworkInfo::default()/* use setters */);
4776    /// assert!(x.network().is_some());
4777    /// assert!(x.instance().is_none());
4778    /// assert!(x.firewall().is_none());
4779    /// assert!(x.route().is_none());
4780    /// assert!(x.endpoint().is_none());
4781    /// assert!(x.google_service().is_none());
4782    /// assert!(x.forwarding_rule().is_none());
4783    /// assert!(x.hybrid_subnet().is_none());
4784    /// assert!(x.vpn_gateway().is_none());
4785    /// assert!(x.vpn_tunnel().is_none());
4786    /// assert!(x.interconnect_attachment().is_none());
4787    /// assert!(x.vpc_connector().is_none());
4788    /// assert!(x.direct_vpc_egress_connection().is_none());
4789    /// assert!(x.serverless_external_connection().is_none());
4790    /// assert!(x.deliver().is_none());
4791    /// assert!(x.forward().is_none());
4792    /// assert!(x.abort().is_none());
4793    /// assert!(x.drop().is_none());
4794    /// assert!(x.load_balancer().is_none());
4795    /// assert!(x.gke_master().is_none());
4796    /// assert!(x.gke_pod().is_none());
4797    /// assert!(x.ip_masquerading_skipped().is_none());
4798    /// assert!(x.gke_network_policy().is_none());
4799    /// assert!(x.gke_network_policy_skipped().is_none());
4800    /// assert!(x.cloud_sql_instance().is_none());
4801    /// assert!(x.redis_instance().is_none());
4802    /// assert!(x.redis_cluster().is_none());
4803    /// assert!(x.cloud_function().is_none());
4804    /// assert!(x.app_engine_version().is_none());
4805    /// assert!(x.cloud_run_revision().is_none());
4806    /// assert!(x.nat().is_none());
4807    /// assert!(x.proxy_connection().is_none());
4808    /// assert!(x.load_balancer_backend_info().is_none());
4809    /// assert!(x.storage_bucket().is_none());
4810    /// assert!(x.serverless_neg().is_none());
4811    /// assert!(x.ngfw_packet_inspection().is_none());
4812    /// ```
4813    pub fn set_network<T: std::convert::Into<std::boxed::Box<crate::model::NetworkInfo>>>(
4814        mut self,
4815        v: T,
4816    ) -> Self {
4817        self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Network(v.into()));
4818        self
4819    }
4820
4821    /// The value of [step_info][crate::model::Step::step_info]
4822    /// if it holds a `GkeMaster`, `None` if the field is not set or
4823    /// holds a different branch.
4824    pub fn gke_master(&self) -> std::option::Option<&std::boxed::Box<crate::model::GKEMasterInfo>> {
4825        #[allow(unreachable_patterns)]
4826        self.step_info.as_ref().and_then(|v| match v {
4827            crate::model::step::StepInfo::GkeMaster(v) => std::option::Option::Some(v),
4828            _ => std::option::Option::None,
4829        })
4830    }
4831
4832    /// Sets the value of [step_info][crate::model::Step::step_info]
4833    /// to hold a `GkeMaster`.
4834    ///
4835    /// Note that all the setters affecting `step_info` are
4836    /// mutually exclusive.
4837    ///
4838    /// # Example
4839    /// ```ignore,no_run
4840    /// # use google_cloud_networkmanagement_v1::model::Step;
4841    /// use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
4842    /// let x = Step::new().set_gke_master(GKEMasterInfo::default()/* use setters */);
4843    /// assert!(x.gke_master().is_some());
4844    /// assert!(x.instance().is_none());
4845    /// assert!(x.firewall().is_none());
4846    /// assert!(x.route().is_none());
4847    /// assert!(x.endpoint().is_none());
4848    /// assert!(x.google_service().is_none());
4849    /// assert!(x.forwarding_rule().is_none());
4850    /// assert!(x.hybrid_subnet().is_none());
4851    /// assert!(x.vpn_gateway().is_none());
4852    /// assert!(x.vpn_tunnel().is_none());
4853    /// assert!(x.interconnect_attachment().is_none());
4854    /// assert!(x.vpc_connector().is_none());
4855    /// assert!(x.direct_vpc_egress_connection().is_none());
4856    /// assert!(x.serverless_external_connection().is_none());
4857    /// assert!(x.deliver().is_none());
4858    /// assert!(x.forward().is_none());
4859    /// assert!(x.abort().is_none());
4860    /// assert!(x.drop().is_none());
4861    /// assert!(x.load_balancer().is_none());
4862    /// assert!(x.network().is_none());
4863    /// assert!(x.gke_pod().is_none());
4864    /// assert!(x.ip_masquerading_skipped().is_none());
4865    /// assert!(x.gke_network_policy().is_none());
4866    /// assert!(x.gke_network_policy_skipped().is_none());
4867    /// assert!(x.cloud_sql_instance().is_none());
4868    /// assert!(x.redis_instance().is_none());
4869    /// assert!(x.redis_cluster().is_none());
4870    /// assert!(x.cloud_function().is_none());
4871    /// assert!(x.app_engine_version().is_none());
4872    /// assert!(x.cloud_run_revision().is_none());
4873    /// assert!(x.nat().is_none());
4874    /// assert!(x.proxy_connection().is_none());
4875    /// assert!(x.load_balancer_backend_info().is_none());
4876    /// assert!(x.storage_bucket().is_none());
4877    /// assert!(x.serverless_neg().is_none());
4878    /// assert!(x.ngfw_packet_inspection().is_none());
4879    /// ```
4880    pub fn set_gke_master<T: std::convert::Into<std::boxed::Box<crate::model::GKEMasterInfo>>>(
4881        mut self,
4882        v: T,
4883    ) -> Self {
4884        self.step_info =
4885            std::option::Option::Some(crate::model::step::StepInfo::GkeMaster(v.into()));
4886        self
4887    }
4888
4889    /// The value of [step_info][crate::model::Step::step_info]
4890    /// if it holds a `GkePod`, `None` if the field is not set or
4891    /// holds a different branch.
4892    pub fn gke_pod(&self) -> std::option::Option<&std::boxed::Box<crate::model::GkePodInfo>> {
4893        #[allow(unreachable_patterns)]
4894        self.step_info.as_ref().and_then(|v| match v {
4895            crate::model::step::StepInfo::GkePod(v) => std::option::Option::Some(v),
4896            _ => std::option::Option::None,
4897        })
4898    }
4899
4900    /// Sets the value of [step_info][crate::model::Step::step_info]
4901    /// to hold a `GkePod`.
4902    ///
4903    /// Note that all the setters affecting `step_info` are
4904    /// mutually exclusive.
4905    ///
4906    /// # Example
4907    /// ```ignore,no_run
4908    /// # use google_cloud_networkmanagement_v1::model::Step;
4909    /// use google_cloud_networkmanagement_v1::model::GkePodInfo;
4910    /// let x = Step::new().set_gke_pod(GkePodInfo::default()/* use setters */);
4911    /// assert!(x.gke_pod().is_some());
4912    /// assert!(x.instance().is_none());
4913    /// assert!(x.firewall().is_none());
4914    /// assert!(x.route().is_none());
4915    /// assert!(x.endpoint().is_none());
4916    /// assert!(x.google_service().is_none());
4917    /// assert!(x.forwarding_rule().is_none());
4918    /// assert!(x.hybrid_subnet().is_none());
4919    /// assert!(x.vpn_gateway().is_none());
4920    /// assert!(x.vpn_tunnel().is_none());
4921    /// assert!(x.interconnect_attachment().is_none());
4922    /// assert!(x.vpc_connector().is_none());
4923    /// assert!(x.direct_vpc_egress_connection().is_none());
4924    /// assert!(x.serverless_external_connection().is_none());
4925    /// assert!(x.deliver().is_none());
4926    /// assert!(x.forward().is_none());
4927    /// assert!(x.abort().is_none());
4928    /// assert!(x.drop().is_none());
4929    /// assert!(x.load_balancer().is_none());
4930    /// assert!(x.network().is_none());
4931    /// assert!(x.gke_master().is_none());
4932    /// assert!(x.ip_masquerading_skipped().is_none());
4933    /// assert!(x.gke_network_policy().is_none());
4934    /// assert!(x.gke_network_policy_skipped().is_none());
4935    /// assert!(x.cloud_sql_instance().is_none());
4936    /// assert!(x.redis_instance().is_none());
4937    /// assert!(x.redis_cluster().is_none());
4938    /// assert!(x.cloud_function().is_none());
4939    /// assert!(x.app_engine_version().is_none());
4940    /// assert!(x.cloud_run_revision().is_none());
4941    /// assert!(x.nat().is_none());
4942    /// assert!(x.proxy_connection().is_none());
4943    /// assert!(x.load_balancer_backend_info().is_none());
4944    /// assert!(x.storage_bucket().is_none());
4945    /// assert!(x.serverless_neg().is_none());
4946    /// assert!(x.ngfw_packet_inspection().is_none());
4947    /// ```
4948    pub fn set_gke_pod<T: std::convert::Into<std::boxed::Box<crate::model::GkePodInfo>>>(
4949        mut self,
4950        v: T,
4951    ) -> Self {
4952        self.step_info = std::option::Option::Some(crate::model::step::StepInfo::GkePod(v.into()));
4953        self
4954    }
4955
4956    /// The value of [step_info][crate::model::Step::step_info]
4957    /// if it holds a `IpMasqueradingSkipped`, `None` if the field is not set or
4958    /// holds a different branch.
4959    pub fn ip_masquerading_skipped(
4960        &self,
4961    ) -> std::option::Option<&std::boxed::Box<crate::model::IpMasqueradingSkippedInfo>> {
4962        #[allow(unreachable_patterns)]
4963        self.step_info.as_ref().and_then(|v| match v {
4964            crate::model::step::StepInfo::IpMasqueradingSkipped(v) => std::option::Option::Some(v),
4965            _ => std::option::Option::None,
4966        })
4967    }
4968
4969    /// Sets the value of [step_info][crate::model::Step::step_info]
4970    /// to hold a `IpMasqueradingSkipped`.
4971    ///
4972    /// Note that all the setters affecting `step_info` are
4973    /// mutually exclusive.
4974    ///
4975    /// # Example
4976    /// ```ignore,no_run
4977    /// # use google_cloud_networkmanagement_v1::model::Step;
4978    /// use google_cloud_networkmanagement_v1::model::IpMasqueradingSkippedInfo;
4979    /// let x = Step::new().set_ip_masquerading_skipped(IpMasqueradingSkippedInfo::default()/* use setters */);
4980    /// assert!(x.ip_masquerading_skipped().is_some());
4981    /// assert!(x.instance().is_none());
4982    /// assert!(x.firewall().is_none());
4983    /// assert!(x.route().is_none());
4984    /// assert!(x.endpoint().is_none());
4985    /// assert!(x.google_service().is_none());
4986    /// assert!(x.forwarding_rule().is_none());
4987    /// assert!(x.hybrid_subnet().is_none());
4988    /// assert!(x.vpn_gateway().is_none());
4989    /// assert!(x.vpn_tunnel().is_none());
4990    /// assert!(x.interconnect_attachment().is_none());
4991    /// assert!(x.vpc_connector().is_none());
4992    /// assert!(x.direct_vpc_egress_connection().is_none());
4993    /// assert!(x.serverless_external_connection().is_none());
4994    /// assert!(x.deliver().is_none());
4995    /// assert!(x.forward().is_none());
4996    /// assert!(x.abort().is_none());
4997    /// assert!(x.drop().is_none());
4998    /// assert!(x.load_balancer().is_none());
4999    /// assert!(x.network().is_none());
5000    /// assert!(x.gke_master().is_none());
5001    /// assert!(x.gke_pod().is_none());
5002    /// assert!(x.gke_network_policy().is_none());
5003    /// assert!(x.gke_network_policy_skipped().is_none());
5004    /// assert!(x.cloud_sql_instance().is_none());
5005    /// assert!(x.redis_instance().is_none());
5006    /// assert!(x.redis_cluster().is_none());
5007    /// assert!(x.cloud_function().is_none());
5008    /// assert!(x.app_engine_version().is_none());
5009    /// assert!(x.cloud_run_revision().is_none());
5010    /// assert!(x.nat().is_none());
5011    /// assert!(x.proxy_connection().is_none());
5012    /// assert!(x.load_balancer_backend_info().is_none());
5013    /// assert!(x.storage_bucket().is_none());
5014    /// assert!(x.serverless_neg().is_none());
5015    /// assert!(x.ngfw_packet_inspection().is_none());
5016    /// ```
5017    pub fn set_ip_masquerading_skipped<
5018        T: std::convert::Into<std::boxed::Box<crate::model::IpMasqueradingSkippedInfo>>,
5019    >(
5020        mut self,
5021        v: T,
5022    ) -> Self {
5023        self.step_info = std::option::Option::Some(
5024            crate::model::step::StepInfo::IpMasqueradingSkipped(v.into()),
5025        );
5026        self
5027    }
5028
5029    /// The value of [step_info][crate::model::Step::step_info]
5030    /// if it holds a `GkeNetworkPolicy`, `None` if the field is not set or
5031    /// holds a different branch.
5032    pub fn gke_network_policy(
5033        &self,
5034    ) -> std::option::Option<&std::boxed::Box<crate::model::GkeNetworkPolicyInfo>> {
5035        #[allow(unreachable_patterns)]
5036        self.step_info.as_ref().and_then(|v| match v {
5037            crate::model::step::StepInfo::GkeNetworkPolicy(v) => std::option::Option::Some(v),
5038            _ => std::option::Option::None,
5039        })
5040    }
5041
5042    /// Sets the value of [step_info][crate::model::Step::step_info]
5043    /// to hold a `GkeNetworkPolicy`.
5044    ///
5045    /// Note that all the setters affecting `step_info` are
5046    /// mutually exclusive.
5047    ///
5048    /// # Example
5049    /// ```ignore,no_run
5050    /// # use google_cloud_networkmanagement_v1::model::Step;
5051    /// use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
5052    /// let x = Step::new().set_gke_network_policy(GkeNetworkPolicyInfo::default()/* use setters */);
5053    /// assert!(x.gke_network_policy().is_some());
5054    /// assert!(x.instance().is_none());
5055    /// assert!(x.firewall().is_none());
5056    /// assert!(x.route().is_none());
5057    /// assert!(x.endpoint().is_none());
5058    /// assert!(x.google_service().is_none());
5059    /// assert!(x.forwarding_rule().is_none());
5060    /// assert!(x.hybrid_subnet().is_none());
5061    /// assert!(x.vpn_gateway().is_none());
5062    /// assert!(x.vpn_tunnel().is_none());
5063    /// assert!(x.interconnect_attachment().is_none());
5064    /// assert!(x.vpc_connector().is_none());
5065    /// assert!(x.direct_vpc_egress_connection().is_none());
5066    /// assert!(x.serverless_external_connection().is_none());
5067    /// assert!(x.deliver().is_none());
5068    /// assert!(x.forward().is_none());
5069    /// assert!(x.abort().is_none());
5070    /// assert!(x.drop().is_none());
5071    /// assert!(x.load_balancer().is_none());
5072    /// assert!(x.network().is_none());
5073    /// assert!(x.gke_master().is_none());
5074    /// assert!(x.gke_pod().is_none());
5075    /// assert!(x.ip_masquerading_skipped().is_none());
5076    /// assert!(x.gke_network_policy_skipped().is_none());
5077    /// assert!(x.cloud_sql_instance().is_none());
5078    /// assert!(x.redis_instance().is_none());
5079    /// assert!(x.redis_cluster().is_none());
5080    /// assert!(x.cloud_function().is_none());
5081    /// assert!(x.app_engine_version().is_none());
5082    /// assert!(x.cloud_run_revision().is_none());
5083    /// assert!(x.nat().is_none());
5084    /// assert!(x.proxy_connection().is_none());
5085    /// assert!(x.load_balancer_backend_info().is_none());
5086    /// assert!(x.storage_bucket().is_none());
5087    /// assert!(x.serverless_neg().is_none());
5088    /// assert!(x.ngfw_packet_inspection().is_none());
5089    /// ```
5090    pub fn set_gke_network_policy<
5091        T: std::convert::Into<std::boxed::Box<crate::model::GkeNetworkPolicyInfo>>,
5092    >(
5093        mut self,
5094        v: T,
5095    ) -> Self {
5096        self.step_info =
5097            std::option::Option::Some(crate::model::step::StepInfo::GkeNetworkPolicy(v.into()));
5098        self
5099    }
5100
5101    /// The value of [step_info][crate::model::Step::step_info]
5102    /// if it holds a `GkeNetworkPolicySkipped`, `None` if the field is not set or
5103    /// holds a different branch.
5104    pub fn gke_network_policy_skipped(
5105        &self,
5106    ) -> std::option::Option<&std::boxed::Box<crate::model::GkeNetworkPolicySkippedInfo>> {
5107        #[allow(unreachable_patterns)]
5108        self.step_info.as_ref().and_then(|v| match v {
5109            crate::model::step::StepInfo::GkeNetworkPolicySkipped(v) => {
5110                std::option::Option::Some(v)
5111            }
5112            _ => std::option::Option::None,
5113        })
5114    }
5115
5116    /// Sets the value of [step_info][crate::model::Step::step_info]
5117    /// to hold a `GkeNetworkPolicySkipped`.
5118    ///
5119    /// Note that all the setters affecting `step_info` are
5120    /// mutually exclusive.
5121    ///
5122    /// # Example
5123    /// ```ignore,no_run
5124    /// # use google_cloud_networkmanagement_v1::model::Step;
5125    /// use google_cloud_networkmanagement_v1::model::GkeNetworkPolicySkippedInfo;
5126    /// let x = Step::new().set_gke_network_policy_skipped(GkeNetworkPolicySkippedInfo::default()/* use setters */);
5127    /// assert!(x.gke_network_policy_skipped().is_some());
5128    /// assert!(x.instance().is_none());
5129    /// assert!(x.firewall().is_none());
5130    /// assert!(x.route().is_none());
5131    /// assert!(x.endpoint().is_none());
5132    /// assert!(x.google_service().is_none());
5133    /// assert!(x.forwarding_rule().is_none());
5134    /// assert!(x.hybrid_subnet().is_none());
5135    /// assert!(x.vpn_gateway().is_none());
5136    /// assert!(x.vpn_tunnel().is_none());
5137    /// assert!(x.interconnect_attachment().is_none());
5138    /// assert!(x.vpc_connector().is_none());
5139    /// assert!(x.direct_vpc_egress_connection().is_none());
5140    /// assert!(x.serverless_external_connection().is_none());
5141    /// assert!(x.deliver().is_none());
5142    /// assert!(x.forward().is_none());
5143    /// assert!(x.abort().is_none());
5144    /// assert!(x.drop().is_none());
5145    /// assert!(x.load_balancer().is_none());
5146    /// assert!(x.network().is_none());
5147    /// assert!(x.gke_master().is_none());
5148    /// assert!(x.gke_pod().is_none());
5149    /// assert!(x.ip_masquerading_skipped().is_none());
5150    /// assert!(x.gke_network_policy().is_none());
5151    /// assert!(x.cloud_sql_instance().is_none());
5152    /// assert!(x.redis_instance().is_none());
5153    /// assert!(x.redis_cluster().is_none());
5154    /// assert!(x.cloud_function().is_none());
5155    /// assert!(x.app_engine_version().is_none());
5156    /// assert!(x.cloud_run_revision().is_none());
5157    /// assert!(x.nat().is_none());
5158    /// assert!(x.proxy_connection().is_none());
5159    /// assert!(x.load_balancer_backend_info().is_none());
5160    /// assert!(x.storage_bucket().is_none());
5161    /// assert!(x.serverless_neg().is_none());
5162    /// assert!(x.ngfw_packet_inspection().is_none());
5163    /// ```
5164    pub fn set_gke_network_policy_skipped<
5165        T: std::convert::Into<std::boxed::Box<crate::model::GkeNetworkPolicySkippedInfo>>,
5166    >(
5167        mut self,
5168        v: T,
5169    ) -> Self {
5170        self.step_info = std::option::Option::Some(
5171            crate::model::step::StepInfo::GkeNetworkPolicySkipped(v.into()),
5172        );
5173        self
5174    }
5175
5176    /// The value of [step_info][crate::model::Step::step_info]
5177    /// if it holds a `CloudSqlInstance`, `None` if the field is not set or
5178    /// holds a different branch.
5179    pub fn cloud_sql_instance(
5180        &self,
5181    ) -> std::option::Option<&std::boxed::Box<crate::model::CloudSQLInstanceInfo>> {
5182        #[allow(unreachable_patterns)]
5183        self.step_info.as_ref().and_then(|v| match v {
5184            crate::model::step::StepInfo::CloudSqlInstance(v) => std::option::Option::Some(v),
5185            _ => std::option::Option::None,
5186        })
5187    }
5188
5189    /// Sets the value of [step_info][crate::model::Step::step_info]
5190    /// to hold a `CloudSqlInstance`.
5191    ///
5192    /// Note that all the setters affecting `step_info` are
5193    /// mutually exclusive.
5194    ///
5195    /// # Example
5196    /// ```ignore,no_run
5197    /// # use google_cloud_networkmanagement_v1::model::Step;
5198    /// use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
5199    /// let x = Step::new().set_cloud_sql_instance(CloudSQLInstanceInfo::default()/* use setters */);
5200    /// assert!(x.cloud_sql_instance().is_some());
5201    /// assert!(x.instance().is_none());
5202    /// assert!(x.firewall().is_none());
5203    /// assert!(x.route().is_none());
5204    /// assert!(x.endpoint().is_none());
5205    /// assert!(x.google_service().is_none());
5206    /// assert!(x.forwarding_rule().is_none());
5207    /// assert!(x.hybrid_subnet().is_none());
5208    /// assert!(x.vpn_gateway().is_none());
5209    /// assert!(x.vpn_tunnel().is_none());
5210    /// assert!(x.interconnect_attachment().is_none());
5211    /// assert!(x.vpc_connector().is_none());
5212    /// assert!(x.direct_vpc_egress_connection().is_none());
5213    /// assert!(x.serverless_external_connection().is_none());
5214    /// assert!(x.deliver().is_none());
5215    /// assert!(x.forward().is_none());
5216    /// assert!(x.abort().is_none());
5217    /// assert!(x.drop().is_none());
5218    /// assert!(x.load_balancer().is_none());
5219    /// assert!(x.network().is_none());
5220    /// assert!(x.gke_master().is_none());
5221    /// assert!(x.gke_pod().is_none());
5222    /// assert!(x.ip_masquerading_skipped().is_none());
5223    /// assert!(x.gke_network_policy().is_none());
5224    /// assert!(x.gke_network_policy_skipped().is_none());
5225    /// assert!(x.redis_instance().is_none());
5226    /// assert!(x.redis_cluster().is_none());
5227    /// assert!(x.cloud_function().is_none());
5228    /// assert!(x.app_engine_version().is_none());
5229    /// assert!(x.cloud_run_revision().is_none());
5230    /// assert!(x.nat().is_none());
5231    /// assert!(x.proxy_connection().is_none());
5232    /// assert!(x.load_balancer_backend_info().is_none());
5233    /// assert!(x.storage_bucket().is_none());
5234    /// assert!(x.serverless_neg().is_none());
5235    /// assert!(x.ngfw_packet_inspection().is_none());
5236    /// ```
5237    pub fn set_cloud_sql_instance<
5238        T: std::convert::Into<std::boxed::Box<crate::model::CloudSQLInstanceInfo>>,
5239    >(
5240        mut self,
5241        v: T,
5242    ) -> Self {
5243        self.step_info =
5244            std::option::Option::Some(crate::model::step::StepInfo::CloudSqlInstance(v.into()));
5245        self
5246    }
5247
5248    /// The value of [step_info][crate::model::Step::step_info]
5249    /// if it holds a `RedisInstance`, `None` if the field is not set or
5250    /// holds a different branch.
5251    pub fn redis_instance(
5252        &self,
5253    ) -> std::option::Option<&std::boxed::Box<crate::model::RedisInstanceInfo>> {
5254        #[allow(unreachable_patterns)]
5255        self.step_info.as_ref().and_then(|v| match v {
5256            crate::model::step::StepInfo::RedisInstance(v) => std::option::Option::Some(v),
5257            _ => std::option::Option::None,
5258        })
5259    }
5260
5261    /// Sets the value of [step_info][crate::model::Step::step_info]
5262    /// to hold a `RedisInstance`.
5263    ///
5264    /// Note that all the setters affecting `step_info` are
5265    /// mutually exclusive.
5266    ///
5267    /// # Example
5268    /// ```ignore,no_run
5269    /// # use google_cloud_networkmanagement_v1::model::Step;
5270    /// use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
5271    /// let x = Step::new().set_redis_instance(RedisInstanceInfo::default()/* use setters */);
5272    /// assert!(x.redis_instance().is_some());
5273    /// assert!(x.instance().is_none());
5274    /// assert!(x.firewall().is_none());
5275    /// assert!(x.route().is_none());
5276    /// assert!(x.endpoint().is_none());
5277    /// assert!(x.google_service().is_none());
5278    /// assert!(x.forwarding_rule().is_none());
5279    /// assert!(x.hybrid_subnet().is_none());
5280    /// assert!(x.vpn_gateway().is_none());
5281    /// assert!(x.vpn_tunnel().is_none());
5282    /// assert!(x.interconnect_attachment().is_none());
5283    /// assert!(x.vpc_connector().is_none());
5284    /// assert!(x.direct_vpc_egress_connection().is_none());
5285    /// assert!(x.serverless_external_connection().is_none());
5286    /// assert!(x.deliver().is_none());
5287    /// assert!(x.forward().is_none());
5288    /// assert!(x.abort().is_none());
5289    /// assert!(x.drop().is_none());
5290    /// assert!(x.load_balancer().is_none());
5291    /// assert!(x.network().is_none());
5292    /// assert!(x.gke_master().is_none());
5293    /// assert!(x.gke_pod().is_none());
5294    /// assert!(x.ip_masquerading_skipped().is_none());
5295    /// assert!(x.gke_network_policy().is_none());
5296    /// assert!(x.gke_network_policy_skipped().is_none());
5297    /// assert!(x.cloud_sql_instance().is_none());
5298    /// assert!(x.redis_cluster().is_none());
5299    /// assert!(x.cloud_function().is_none());
5300    /// assert!(x.app_engine_version().is_none());
5301    /// assert!(x.cloud_run_revision().is_none());
5302    /// assert!(x.nat().is_none());
5303    /// assert!(x.proxy_connection().is_none());
5304    /// assert!(x.load_balancer_backend_info().is_none());
5305    /// assert!(x.storage_bucket().is_none());
5306    /// assert!(x.serverless_neg().is_none());
5307    /// assert!(x.ngfw_packet_inspection().is_none());
5308    /// ```
5309    pub fn set_redis_instance<
5310        T: std::convert::Into<std::boxed::Box<crate::model::RedisInstanceInfo>>,
5311    >(
5312        mut self,
5313        v: T,
5314    ) -> Self {
5315        self.step_info =
5316            std::option::Option::Some(crate::model::step::StepInfo::RedisInstance(v.into()));
5317        self
5318    }
5319
5320    /// The value of [step_info][crate::model::Step::step_info]
5321    /// if it holds a `RedisCluster`, `None` if the field is not set or
5322    /// holds a different branch.
5323    pub fn redis_cluster(
5324        &self,
5325    ) -> std::option::Option<&std::boxed::Box<crate::model::RedisClusterInfo>> {
5326        #[allow(unreachable_patterns)]
5327        self.step_info.as_ref().and_then(|v| match v {
5328            crate::model::step::StepInfo::RedisCluster(v) => std::option::Option::Some(v),
5329            _ => std::option::Option::None,
5330        })
5331    }
5332
5333    /// Sets the value of [step_info][crate::model::Step::step_info]
5334    /// to hold a `RedisCluster`.
5335    ///
5336    /// Note that all the setters affecting `step_info` are
5337    /// mutually exclusive.
5338    ///
5339    /// # Example
5340    /// ```ignore,no_run
5341    /// # use google_cloud_networkmanagement_v1::model::Step;
5342    /// use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
5343    /// let x = Step::new().set_redis_cluster(RedisClusterInfo::default()/* use setters */);
5344    /// assert!(x.redis_cluster().is_some());
5345    /// assert!(x.instance().is_none());
5346    /// assert!(x.firewall().is_none());
5347    /// assert!(x.route().is_none());
5348    /// assert!(x.endpoint().is_none());
5349    /// assert!(x.google_service().is_none());
5350    /// assert!(x.forwarding_rule().is_none());
5351    /// assert!(x.hybrid_subnet().is_none());
5352    /// assert!(x.vpn_gateway().is_none());
5353    /// assert!(x.vpn_tunnel().is_none());
5354    /// assert!(x.interconnect_attachment().is_none());
5355    /// assert!(x.vpc_connector().is_none());
5356    /// assert!(x.direct_vpc_egress_connection().is_none());
5357    /// assert!(x.serverless_external_connection().is_none());
5358    /// assert!(x.deliver().is_none());
5359    /// assert!(x.forward().is_none());
5360    /// assert!(x.abort().is_none());
5361    /// assert!(x.drop().is_none());
5362    /// assert!(x.load_balancer().is_none());
5363    /// assert!(x.network().is_none());
5364    /// assert!(x.gke_master().is_none());
5365    /// assert!(x.gke_pod().is_none());
5366    /// assert!(x.ip_masquerading_skipped().is_none());
5367    /// assert!(x.gke_network_policy().is_none());
5368    /// assert!(x.gke_network_policy_skipped().is_none());
5369    /// assert!(x.cloud_sql_instance().is_none());
5370    /// assert!(x.redis_instance().is_none());
5371    /// assert!(x.cloud_function().is_none());
5372    /// assert!(x.app_engine_version().is_none());
5373    /// assert!(x.cloud_run_revision().is_none());
5374    /// assert!(x.nat().is_none());
5375    /// assert!(x.proxy_connection().is_none());
5376    /// assert!(x.load_balancer_backend_info().is_none());
5377    /// assert!(x.storage_bucket().is_none());
5378    /// assert!(x.serverless_neg().is_none());
5379    /// assert!(x.ngfw_packet_inspection().is_none());
5380    /// ```
5381    pub fn set_redis_cluster<
5382        T: std::convert::Into<std::boxed::Box<crate::model::RedisClusterInfo>>,
5383    >(
5384        mut self,
5385        v: T,
5386    ) -> Self {
5387        self.step_info =
5388            std::option::Option::Some(crate::model::step::StepInfo::RedisCluster(v.into()));
5389        self
5390    }
5391
5392    /// The value of [step_info][crate::model::Step::step_info]
5393    /// if it holds a `CloudFunction`, `None` if the field is not set or
5394    /// holds a different branch.
5395    pub fn cloud_function(
5396        &self,
5397    ) -> std::option::Option<&std::boxed::Box<crate::model::CloudFunctionInfo>> {
5398        #[allow(unreachable_patterns)]
5399        self.step_info.as_ref().and_then(|v| match v {
5400            crate::model::step::StepInfo::CloudFunction(v) => std::option::Option::Some(v),
5401            _ => std::option::Option::None,
5402        })
5403    }
5404
5405    /// Sets the value of [step_info][crate::model::Step::step_info]
5406    /// to hold a `CloudFunction`.
5407    ///
5408    /// Note that all the setters affecting `step_info` are
5409    /// mutually exclusive.
5410    ///
5411    /// # Example
5412    /// ```ignore,no_run
5413    /// # use google_cloud_networkmanagement_v1::model::Step;
5414    /// use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
5415    /// let x = Step::new().set_cloud_function(CloudFunctionInfo::default()/* use setters */);
5416    /// assert!(x.cloud_function().is_some());
5417    /// assert!(x.instance().is_none());
5418    /// assert!(x.firewall().is_none());
5419    /// assert!(x.route().is_none());
5420    /// assert!(x.endpoint().is_none());
5421    /// assert!(x.google_service().is_none());
5422    /// assert!(x.forwarding_rule().is_none());
5423    /// assert!(x.hybrid_subnet().is_none());
5424    /// assert!(x.vpn_gateway().is_none());
5425    /// assert!(x.vpn_tunnel().is_none());
5426    /// assert!(x.interconnect_attachment().is_none());
5427    /// assert!(x.vpc_connector().is_none());
5428    /// assert!(x.direct_vpc_egress_connection().is_none());
5429    /// assert!(x.serverless_external_connection().is_none());
5430    /// assert!(x.deliver().is_none());
5431    /// assert!(x.forward().is_none());
5432    /// assert!(x.abort().is_none());
5433    /// assert!(x.drop().is_none());
5434    /// assert!(x.load_balancer().is_none());
5435    /// assert!(x.network().is_none());
5436    /// assert!(x.gke_master().is_none());
5437    /// assert!(x.gke_pod().is_none());
5438    /// assert!(x.ip_masquerading_skipped().is_none());
5439    /// assert!(x.gke_network_policy().is_none());
5440    /// assert!(x.gke_network_policy_skipped().is_none());
5441    /// assert!(x.cloud_sql_instance().is_none());
5442    /// assert!(x.redis_instance().is_none());
5443    /// assert!(x.redis_cluster().is_none());
5444    /// assert!(x.app_engine_version().is_none());
5445    /// assert!(x.cloud_run_revision().is_none());
5446    /// assert!(x.nat().is_none());
5447    /// assert!(x.proxy_connection().is_none());
5448    /// assert!(x.load_balancer_backend_info().is_none());
5449    /// assert!(x.storage_bucket().is_none());
5450    /// assert!(x.serverless_neg().is_none());
5451    /// assert!(x.ngfw_packet_inspection().is_none());
5452    /// ```
5453    pub fn set_cloud_function<
5454        T: std::convert::Into<std::boxed::Box<crate::model::CloudFunctionInfo>>,
5455    >(
5456        mut self,
5457        v: T,
5458    ) -> Self {
5459        self.step_info =
5460            std::option::Option::Some(crate::model::step::StepInfo::CloudFunction(v.into()));
5461        self
5462    }
5463
5464    /// The value of [step_info][crate::model::Step::step_info]
5465    /// if it holds a `AppEngineVersion`, `None` if the field is not set or
5466    /// holds a different branch.
5467    pub fn app_engine_version(
5468        &self,
5469    ) -> std::option::Option<&std::boxed::Box<crate::model::AppEngineVersionInfo>> {
5470        #[allow(unreachable_patterns)]
5471        self.step_info.as_ref().and_then(|v| match v {
5472            crate::model::step::StepInfo::AppEngineVersion(v) => std::option::Option::Some(v),
5473            _ => std::option::Option::None,
5474        })
5475    }
5476
5477    /// Sets the value of [step_info][crate::model::Step::step_info]
5478    /// to hold a `AppEngineVersion`.
5479    ///
5480    /// Note that all the setters affecting `step_info` are
5481    /// mutually exclusive.
5482    ///
5483    /// # Example
5484    /// ```ignore,no_run
5485    /// # use google_cloud_networkmanagement_v1::model::Step;
5486    /// use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
5487    /// let x = Step::new().set_app_engine_version(AppEngineVersionInfo::default()/* use setters */);
5488    /// assert!(x.app_engine_version().is_some());
5489    /// assert!(x.instance().is_none());
5490    /// assert!(x.firewall().is_none());
5491    /// assert!(x.route().is_none());
5492    /// assert!(x.endpoint().is_none());
5493    /// assert!(x.google_service().is_none());
5494    /// assert!(x.forwarding_rule().is_none());
5495    /// assert!(x.hybrid_subnet().is_none());
5496    /// assert!(x.vpn_gateway().is_none());
5497    /// assert!(x.vpn_tunnel().is_none());
5498    /// assert!(x.interconnect_attachment().is_none());
5499    /// assert!(x.vpc_connector().is_none());
5500    /// assert!(x.direct_vpc_egress_connection().is_none());
5501    /// assert!(x.serverless_external_connection().is_none());
5502    /// assert!(x.deliver().is_none());
5503    /// assert!(x.forward().is_none());
5504    /// assert!(x.abort().is_none());
5505    /// assert!(x.drop().is_none());
5506    /// assert!(x.load_balancer().is_none());
5507    /// assert!(x.network().is_none());
5508    /// assert!(x.gke_master().is_none());
5509    /// assert!(x.gke_pod().is_none());
5510    /// assert!(x.ip_masquerading_skipped().is_none());
5511    /// assert!(x.gke_network_policy().is_none());
5512    /// assert!(x.gke_network_policy_skipped().is_none());
5513    /// assert!(x.cloud_sql_instance().is_none());
5514    /// assert!(x.redis_instance().is_none());
5515    /// assert!(x.redis_cluster().is_none());
5516    /// assert!(x.cloud_function().is_none());
5517    /// assert!(x.cloud_run_revision().is_none());
5518    /// assert!(x.nat().is_none());
5519    /// assert!(x.proxy_connection().is_none());
5520    /// assert!(x.load_balancer_backend_info().is_none());
5521    /// assert!(x.storage_bucket().is_none());
5522    /// assert!(x.serverless_neg().is_none());
5523    /// assert!(x.ngfw_packet_inspection().is_none());
5524    /// ```
5525    pub fn set_app_engine_version<
5526        T: std::convert::Into<std::boxed::Box<crate::model::AppEngineVersionInfo>>,
5527    >(
5528        mut self,
5529        v: T,
5530    ) -> Self {
5531        self.step_info =
5532            std::option::Option::Some(crate::model::step::StepInfo::AppEngineVersion(v.into()));
5533        self
5534    }
5535
5536    /// The value of [step_info][crate::model::Step::step_info]
5537    /// if it holds a `CloudRunRevision`, `None` if the field is not set or
5538    /// holds a different branch.
5539    pub fn cloud_run_revision(
5540        &self,
5541    ) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunRevisionInfo>> {
5542        #[allow(unreachable_patterns)]
5543        self.step_info.as_ref().and_then(|v| match v {
5544            crate::model::step::StepInfo::CloudRunRevision(v) => std::option::Option::Some(v),
5545            _ => std::option::Option::None,
5546        })
5547    }
5548
5549    /// Sets the value of [step_info][crate::model::Step::step_info]
5550    /// to hold a `CloudRunRevision`.
5551    ///
5552    /// Note that all the setters affecting `step_info` are
5553    /// mutually exclusive.
5554    ///
5555    /// # Example
5556    /// ```ignore,no_run
5557    /// # use google_cloud_networkmanagement_v1::model::Step;
5558    /// use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
5559    /// let x = Step::new().set_cloud_run_revision(CloudRunRevisionInfo::default()/* use setters */);
5560    /// assert!(x.cloud_run_revision().is_some());
5561    /// assert!(x.instance().is_none());
5562    /// assert!(x.firewall().is_none());
5563    /// assert!(x.route().is_none());
5564    /// assert!(x.endpoint().is_none());
5565    /// assert!(x.google_service().is_none());
5566    /// assert!(x.forwarding_rule().is_none());
5567    /// assert!(x.hybrid_subnet().is_none());
5568    /// assert!(x.vpn_gateway().is_none());
5569    /// assert!(x.vpn_tunnel().is_none());
5570    /// assert!(x.interconnect_attachment().is_none());
5571    /// assert!(x.vpc_connector().is_none());
5572    /// assert!(x.direct_vpc_egress_connection().is_none());
5573    /// assert!(x.serverless_external_connection().is_none());
5574    /// assert!(x.deliver().is_none());
5575    /// assert!(x.forward().is_none());
5576    /// assert!(x.abort().is_none());
5577    /// assert!(x.drop().is_none());
5578    /// assert!(x.load_balancer().is_none());
5579    /// assert!(x.network().is_none());
5580    /// assert!(x.gke_master().is_none());
5581    /// assert!(x.gke_pod().is_none());
5582    /// assert!(x.ip_masquerading_skipped().is_none());
5583    /// assert!(x.gke_network_policy().is_none());
5584    /// assert!(x.gke_network_policy_skipped().is_none());
5585    /// assert!(x.cloud_sql_instance().is_none());
5586    /// assert!(x.redis_instance().is_none());
5587    /// assert!(x.redis_cluster().is_none());
5588    /// assert!(x.cloud_function().is_none());
5589    /// assert!(x.app_engine_version().is_none());
5590    /// assert!(x.nat().is_none());
5591    /// assert!(x.proxy_connection().is_none());
5592    /// assert!(x.load_balancer_backend_info().is_none());
5593    /// assert!(x.storage_bucket().is_none());
5594    /// assert!(x.serverless_neg().is_none());
5595    /// assert!(x.ngfw_packet_inspection().is_none());
5596    /// ```
5597    pub fn set_cloud_run_revision<
5598        T: std::convert::Into<std::boxed::Box<crate::model::CloudRunRevisionInfo>>,
5599    >(
5600        mut self,
5601        v: T,
5602    ) -> Self {
5603        self.step_info =
5604            std::option::Option::Some(crate::model::step::StepInfo::CloudRunRevision(v.into()));
5605        self
5606    }
5607
5608    /// The value of [step_info][crate::model::Step::step_info]
5609    /// if it holds a `Nat`, `None` if the field is not set or
5610    /// holds a different branch.
5611    pub fn nat(&self) -> std::option::Option<&std::boxed::Box<crate::model::NatInfo>> {
5612        #[allow(unreachable_patterns)]
5613        self.step_info.as_ref().and_then(|v| match v {
5614            crate::model::step::StepInfo::Nat(v) => std::option::Option::Some(v),
5615            _ => std::option::Option::None,
5616        })
5617    }
5618
5619    /// Sets the value of [step_info][crate::model::Step::step_info]
5620    /// to hold a `Nat`.
5621    ///
5622    /// Note that all the setters affecting `step_info` are
5623    /// mutually exclusive.
5624    ///
5625    /// # Example
5626    /// ```ignore,no_run
5627    /// # use google_cloud_networkmanagement_v1::model::Step;
5628    /// use google_cloud_networkmanagement_v1::model::NatInfo;
5629    /// let x = Step::new().set_nat(NatInfo::default()/* use setters */);
5630    /// assert!(x.nat().is_some());
5631    /// assert!(x.instance().is_none());
5632    /// assert!(x.firewall().is_none());
5633    /// assert!(x.route().is_none());
5634    /// assert!(x.endpoint().is_none());
5635    /// assert!(x.google_service().is_none());
5636    /// assert!(x.forwarding_rule().is_none());
5637    /// assert!(x.hybrid_subnet().is_none());
5638    /// assert!(x.vpn_gateway().is_none());
5639    /// assert!(x.vpn_tunnel().is_none());
5640    /// assert!(x.interconnect_attachment().is_none());
5641    /// assert!(x.vpc_connector().is_none());
5642    /// assert!(x.direct_vpc_egress_connection().is_none());
5643    /// assert!(x.serverless_external_connection().is_none());
5644    /// assert!(x.deliver().is_none());
5645    /// assert!(x.forward().is_none());
5646    /// assert!(x.abort().is_none());
5647    /// assert!(x.drop().is_none());
5648    /// assert!(x.load_balancer().is_none());
5649    /// assert!(x.network().is_none());
5650    /// assert!(x.gke_master().is_none());
5651    /// assert!(x.gke_pod().is_none());
5652    /// assert!(x.ip_masquerading_skipped().is_none());
5653    /// assert!(x.gke_network_policy().is_none());
5654    /// assert!(x.gke_network_policy_skipped().is_none());
5655    /// assert!(x.cloud_sql_instance().is_none());
5656    /// assert!(x.redis_instance().is_none());
5657    /// assert!(x.redis_cluster().is_none());
5658    /// assert!(x.cloud_function().is_none());
5659    /// assert!(x.app_engine_version().is_none());
5660    /// assert!(x.cloud_run_revision().is_none());
5661    /// assert!(x.proxy_connection().is_none());
5662    /// assert!(x.load_balancer_backend_info().is_none());
5663    /// assert!(x.storage_bucket().is_none());
5664    /// assert!(x.serverless_neg().is_none());
5665    /// assert!(x.ngfw_packet_inspection().is_none());
5666    /// ```
5667    pub fn set_nat<T: std::convert::Into<std::boxed::Box<crate::model::NatInfo>>>(
5668        mut self,
5669        v: T,
5670    ) -> Self {
5671        self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Nat(v.into()));
5672        self
5673    }
5674
5675    /// The value of [step_info][crate::model::Step::step_info]
5676    /// if it holds a `ProxyConnection`, `None` if the field is not set or
5677    /// holds a different branch.
5678    pub fn proxy_connection(
5679        &self,
5680    ) -> std::option::Option<&std::boxed::Box<crate::model::ProxyConnectionInfo>> {
5681        #[allow(unreachable_patterns)]
5682        self.step_info.as_ref().and_then(|v| match v {
5683            crate::model::step::StepInfo::ProxyConnection(v) => std::option::Option::Some(v),
5684            _ => std::option::Option::None,
5685        })
5686    }
5687
5688    /// Sets the value of [step_info][crate::model::Step::step_info]
5689    /// to hold a `ProxyConnection`.
5690    ///
5691    /// Note that all the setters affecting `step_info` are
5692    /// mutually exclusive.
5693    ///
5694    /// # Example
5695    /// ```ignore,no_run
5696    /// # use google_cloud_networkmanagement_v1::model::Step;
5697    /// use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
5698    /// let x = Step::new().set_proxy_connection(ProxyConnectionInfo::default()/* use setters */);
5699    /// assert!(x.proxy_connection().is_some());
5700    /// assert!(x.instance().is_none());
5701    /// assert!(x.firewall().is_none());
5702    /// assert!(x.route().is_none());
5703    /// assert!(x.endpoint().is_none());
5704    /// assert!(x.google_service().is_none());
5705    /// assert!(x.forwarding_rule().is_none());
5706    /// assert!(x.hybrid_subnet().is_none());
5707    /// assert!(x.vpn_gateway().is_none());
5708    /// assert!(x.vpn_tunnel().is_none());
5709    /// assert!(x.interconnect_attachment().is_none());
5710    /// assert!(x.vpc_connector().is_none());
5711    /// assert!(x.direct_vpc_egress_connection().is_none());
5712    /// assert!(x.serverless_external_connection().is_none());
5713    /// assert!(x.deliver().is_none());
5714    /// assert!(x.forward().is_none());
5715    /// assert!(x.abort().is_none());
5716    /// assert!(x.drop().is_none());
5717    /// assert!(x.load_balancer().is_none());
5718    /// assert!(x.network().is_none());
5719    /// assert!(x.gke_master().is_none());
5720    /// assert!(x.gke_pod().is_none());
5721    /// assert!(x.ip_masquerading_skipped().is_none());
5722    /// assert!(x.gke_network_policy().is_none());
5723    /// assert!(x.gke_network_policy_skipped().is_none());
5724    /// assert!(x.cloud_sql_instance().is_none());
5725    /// assert!(x.redis_instance().is_none());
5726    /// assert!(x.redis_cluster().is_none());
5727    /// assert!(x.cloud_function().is_none());
5728    /// assert!(x.app_engine_version().is_none());
5729    /// assert!(x.cloud_run_revision().is_none());
5730    /// assert!(x.nat().is_none());
5731    /// assert!(x.load_balancer_backend_info().is_none());
5732    /// assert!(x.storage_bucket().is_none());
5733    /// assert!(x.serverless_neg().is_none());
5734    /// assert!(x.ngfw_packet_inspection().is_none());
5735    /// ```
5736    pub fn set_proxy_connection<
5737        T: std::convert::Into<std::boxed::Box<crate::model::ProxyConnectionInfo>>,
5738    >(
5739        mut self,
5740        v: T,
5741    ) -> Self {
5742        self.step_info =
5743            std::option::Option::Some(crate::model::step::StepInfo::ProxyConnection(v.into()));
5744        self
5745    }
5746
5747    /// The value of [step_info][crate::model::Step::step_info]
5748    /// if it holds a `LoadBalancerBackendInfo`, `None` if the field is not set or
5749    /// holds a different branch.
5750    pub fn load_balancer_backend_info(
5751        &self,
5752    ) -> std::option::Option<&std::boxed::Box<crate::model::LoadBalancerBackendInfo>> {
5753        #[allow(unreachable_patterns)]
5754        self.step_info.as_ref().and_then(|v| match v {
5755            crate::model::step::StepInfo::LoadBalancerBackendInfo(v) => {
5756                std::option::Option::Some(v)
5757            }
5758            _ => std::option::Option::None,
5759        })
5760    }
5761
5762    /// Sets the value of [step_info][crate::model::Step::step_info]
5763    /// to hold a `LoadBalancerBackendInfo`.
5764    ///
5765    /// Note that all the setters affecting `step_info` are
5766    /// mutually exclusive.
5767    ///
5768    /// # Example
5769    /// ```ignore,no_run
5770    /// # use google_cloud_networkmanagement_v1::model::Step;
5771    /// use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
5772    /// let x = Step::new().set_load_balancer_backend_info(LoadBalancerBackendInfo::default()/* use setters */);
5773    /// assert!(x.load_balancer_backend_info().is_some());
5774    /// assert!(x.instance().is_none());
5775    /// assert!(x.firewall().is_none());
5776    /// assert!(x.route().is_none());
5777    /// assert!(x.endpoint().is_none());
5778    /// assert!(x.google_service().is_none());
5779    /// assert!(x.forwarding_rule().is_none());
5780    /// assert!(x.hybrid_subnet().is_none());
5781    /// assert!(x.vpn_gateway().is_none());
5782    /// assert!(x.vpn_tunnel().is_none());
5783    /// assert!(x.interconnect_attachment().is_none());
5784    /// assert!(x.vpc_connector().is_none());
5785    /// assert!(x.direct_vpc_egress_connection().is_none());
5786    /// assert!(x.serverless_external_connection().is_none());
5787    /// assert!(x.deliver().is_none());
5788    /// assert!(x.forward().is_none());
5789    /// assert!(x.abort().is_none());
5790    /// assert!(x.drop().is_none());
5791    /// assert!(x.load_balancer().is_none());
5792    /// assert!(x.network().is_none());
5793    /// assert!(x.gke_master().is_none());
5794    /// assert!(x.gke_pod().is_none());
5795    /// assert!(x.ip_masquerading_skipped().is_none());
5796    /// assert!(x.gke_network_policy().is_none());
5797    /// assert!(x.gke_network_policy_skipped().is_none());
5798    /// assert!(x.cloud_sql_instance().is_none());
5799    /// assert!(x.redis_instance().is_none());
5800    /// assert!(x.redis_cluster().is_none());
5801    /// assert!(x.cloud_function().is_none());
5802    /// assert!(x.app_engine_version().is_none());
5803    /// assert!(x.cloud_run_revision().is_none());
5804    /// assert!(x.nat().is_none());
5805    /// assert!(x.proxy_connection().is_none());
5806    /// assert!(x.storage_bucket().is_none());
5807    /// assert!(x.serverless_neg().is_none());
5808    /// assert!(x.ngfw_packet_inspection().is_none());
5809    /// ```
5810    pub fn set_load_balancer_backend_info<
5811        T: std::convert::Into<std::boxed::Box<crate::model::LoadBalancerBackendInfo>>,
5812    >(
5813        mut self,
5814        v: T,
5815    ) -> Self {
5816        self.step_info = std::option::Option::Some(
5817            crate::model::step::StepInfo::LoadBalancerBackendInfo(v.into()),
5818        );
5819        self
5820    }
5821
5822    /// The value of [step_info][crate::model::Step::step_info]
5823    /// if it holds a `StorageBucket`, `None` if the field is not set or
5824    /// holds a different branch.
5825    pub fn storage_bucket(
5826        &self,
5827    ) -> std::option::Option<&std::boxed::Box<crate::model::StorageBucketInfo>> {
5828        #[allow(unreachable_patterns)]
5829        self.step_info.as_ref().and_then(|v| match v {
5830            crate::model::step::StepInfo::StorageBucket(v) => std::option::Option::Some(v),
5831            _ => std::option::Option::None,
5832        })
5833    }
5834
5835    /// Sets the value of [step_info][crate::model::Step::step_info]
5836    /// to hold a `StorageBucket`.
5837    ///
5838    /// Note that all the setters affecting `step_info` are
5839    /// mutually exclusive.
5840    ///
5841    /// # Example
5842    /// ```ignore,no_run
5843    /// # use google_cloud_networkmanagement_v1::model::Step;
5844    /// use google_cloud_networkmanagement_v1::model::StorageBucketInfo;
5845    /// let x = Step::new().set_storage_bucket(StorageBucketInfo::default()/* use setters */);
5846    /// assert!(x.storage_bucket().is_some());
5847    /// assert!(x.instance().is_none());
5848    /// assert!(x.firewall().is_none());
5849    /// assert!(x.route().is_none());
5850    /// assert!(x.endpoint().is_none());
5851    /// assert!(x.google_service().is_none());
5852    /// assert!(x.forwarding_rule().is_none());
5853    /// assert!(x.hybrid_subnet().is_none());
5854    /// assert!(x.vpn_gateway().is_none());
5855    /// assert!(x.vpn_tunnel().is_none());
5856    /// assert!(x.interconnect_attachment().is_none());
5857    /// assert!(x.vpc_connector().is_none());
5858    /// assert!(x.direct_vpc_egress_connection().is_none());
5859    /// assert!(x.serverless_external_connection().is_none());
5860    /// assert!(x.deliver().is_none());
5861    /// assert!(x.forward().is_none());
5862    /// assert!(x.abort().is_none());
5863    /// assert!(x.drop().is_none());
5864    /// assert!(x.load_balancer().is_none());
5865    /// assert!(x.network().is_none());
5866    /// assert!(x.gke_master().is_none());
5867    /// assert!(x.gke_pod().is_none());
5868    /// assert!(x.ip_masquerading_skipped().is_none());
5869    /// assert!(x.gke_network_policy().is_none());
5870    /// assert!(x.gke_network_policy_skipped().is_none());
5871    /// assert!(x.cloud_sql_instance().is_none());
5872    /// assert!(x.redis_instance().is_none());
5873    /// assert!(x.redis_cluster().is_none());
5874    /// assert!(x.cloud_function().is_none());
5875    /// assert!(x.app_engine_version().is_none());
5876    /// assert!(x.cloud_run_revision().is_none());
5877    /// assert!(x.nat().is_none());
5878    /// assert!(x.proxy_connection().is_none());
5879    /// assert!(x.load_balancer_backend_info().is_none());
5880    /// assert!(x.serverless_neg().is_none());
5881    /// assert!(x.ngfw_packet_inspection().is_none());
5882    /// ```
5883    pub fn set_storage_bucket<
5884        T: std::convert::Into<std::boxed::Box<crate::model::StorageBucketInfo>>,
5885    >(
5886        mut self,
5887        v: T,
5888    ) -> Self {
5889        self.step_info =
5890            std::option::Option::Some(crate::model::step::StepInfo::StorageBucket(v.into()));
5891        self
5892    }
5893
5894    /// The value of [step_info][crate::model::Step::step_info]
5895    /// if it holds a `ServerlessNeg`, `None` if the field is not set or
5896    /// holds a different branch.
5897    pub fn serverless_neg(
5898        &self,
5899    ) -> std::option::Option<&std::boxed::Box<crate::model::ServerlessNegInfo>> {
5900        #[allow(unreachable_patterns)]
5901        self.step_info.as_ref().and_then(|v| match v {
5902            crate::model::step::StepInfo::ServerlessNeg(v) => std::option::Option::Some(v),
5903            _ => std::option::Option::None,
5904        })
5905    }
5906
5907    /// Sets the value of [step_info][crate::model::Step::step_info]
5908    /// to hold a `ServerlessNeg`.
5909    ///
5910    /// Note that all the setters affecting `step_info` are
5911    /// mutually exclusive.
5912    ///
5913    /// # Example
5914    /// ```ignore,no_run
5915    /// # use google_cloud_networkmanagement_v1::model::Step;
5916    /// use google_cloud_networkmanagement_v1::model::ServerlessNegInfo;
5917    /// let x = Step::new().set_serverless_neg(ServerlessNegInfo::default()/* use setters */);
5918    /// assert!(x.serverless_neg().is_some());
5919    /// assert!(x.instance().is_none());
5920    /// assert!(x.firewall().is_none());
5921    /// assert!(x.route().is_none());
5922    /// assert!(x.endpoint().is_none());
5923    /// assert!(x.google_service().is_none());
5924    /// assert!(x.forwarding_rule().is_none());
5925    /// assert!(x.hybrid_subnet().is_none());
5926    /// assert!(x.vpn_gateway().is_none());
5927    /// assert!(x.vpn_tunnel().is_none());
5928    /// assert!(x.interconnect_attachment().is_none());
5929    /// assert!(x.vpc_connector().is_none());
5930    /// assert!(x.direct_vpc_egress_connection().is_none());
5931    /// assert!(x.serverless_external_connection().is_none());
5932    /// assert!(x.deliver().is_none());
5933    /// assert!(x.forward().is_none());
5934    /// assert!(x.abort().is_none());
5935    /// assert!(x.drop().is_none());
5936    /// assert!(x.load_balancer().is_none());
5937    /// assert!(x.network().is_none());
5938    /// assert!(x.gke_master().is_none());
5939    /// assert!(x.gke_pod().is_none());
5940    /// assert!(x.ip_masquerading_skipped().is_none());
5941    /// assert!(x.gke_network_policy().is_none());
5942    /// assert!(x.gke_network_policy_skipped().is_none());
5943    /// assert!(x.cloud_sql_instance().is_none());
5944    /// assert!(x.redis_instance().is_none());
5945    /// assert!(x.redis_cluster().is_none());
5946    /// assert!(x.cloud_function().is_none());
5947    /// assert!(x.app_engine_version().is_none());
5948    /// assert!(x.cloud_run_revision().is_none());
5949    /// assert!(x.nat().is_none());
5950    /// assert!(x.proxy_connection().is_none());
5951    /// assert!(x.load_balancer_backend_info().is_none());
5952    /// assert!(x.storage_bucket().is_none());
5953    /// assert!(x.ngfw_packet_inspection().is_none());
5954    /// ```
5955    pub fn set_serverless_neg<
5956        T: std::convert::Into<std::boxed::Box<crate::model::ServerlessNegInfo>>,
5957    >(
5958        mut self,
5959        v: T,
5960    ) -> Self {
5961        self.step_info =
5962            std::option::Option::Some(crate::model::step::StepInfo::ServerlessNeg(v.into()));
5963        self
5964    }
5965
5966    /// The value of [step_info][crate::model::Step::step_info]
5967    /// if it holds a `NgfwPacketInspection`, `None` if the field is not set or
5968    /// holds a different branch.
5969    pub fn ngfw_packet_inspection(
5970        &self,
5971    ) -> std::option::Option<&std::boxed::Box<crate::model::NgfwPacketInspectionInfo>> {
5972        #[allow(unreachable_patterns)]
5973        self.step_info.as_ref().and_then(|v| match v {
5974            crate::model::step::StepInfo::NgfwPacketInspection(v) => std::option::Option::Some(v),
5975            _ => std::option::Option::None,
5976        })
5977    }
5978
5979    /// Sets the value of [step_info][crate::model::Step::step_info]
5980    /// to hold a `NgfwPacketInspection`.
5981    ///
5982    /// Note that all the setters affecting `step_info` are
5983    /// mutually exclusive.
5984    ///
5985    /// # Example
5986    /// ```ignore,no_run
5987    /// # use google_cloud_networkmanagement_v1::model::Step;
5988    /// use google_cloud_networkmanagement_v1::model::NgfwPacketInspectionInfo;
5989    /// let x = Step::new().set_ngfw_packet_inspection(NgfwPacketInspectionInfo::default()/* use setters */);
5990    /// assert!(x.ngfw_packet_inspection().is_some());
5991    /// assert!(x.instance().is_none());
5992    /// assert!(x.firewall().is_none());
5993    /// assert!(x.route().is_none());
5994    /// assert!(x.endpoint().is_none());
5995    /// assert!(x.google_service().is_none());
5996    /// assert!(x.forwarding_rule().is_none());
5997    /// assert!(x.hybrid_subnet().is_none());
5998    /// assert!(x.vpn_gateway().is_none());
5999    /// assert!(x.vpn_tunnel().is_none());
6000    /// assert!(x.interconnect_attachment().is_none());
6001    /// assert!(x.vpc_connector().is_none());
6002    /// assert!(x.direct_vpc_egress_connection().is_none());
6003    /// assert!(x.serverless_external_connection().is_none());
6004    /// assert!(x.deliver().is_none());
6005    /// assert!(x.forward().is_none());
6006    /// assert!(x.abort().is_none());
6007    /// assert!(x.drop().is_none());
6008    /// assert!(x.load_balancer().is_none());
6009    /// assert!(x.network().is_none());
6010    /// assert!(x.gke_master().is_none());
6011    /// assert!(x.gke_pod().is_none());
6012    /// assert!(x.ip_masquerading_skipped().is_none());
6013    /// assert!(x.gke_network_policy().is_none());
6014    /// assert!(x.gke_network_policy_skipped().is_none());
6015    /// assert!(x.cloud_sql_instance().is_none());
6016    /// assert!(x.redis_instance().is_none());
6017    /// assert!(x.redis_cluster().is_none());
6018    /// assert!(x.cloud_function().is_none());
6019    /// assert!(x.app_engine_version().is_none());
6020    /// assert!(x.cloud_run_revision().is_none());
6021    /// assert!(x.nat().is_none());
6022    /// assert!(x.proxy_connection().is_none());
6023    /// assert!(x.load_balancer_backend_info().is_none());
6024    /// assert!(x.storage_bucket().is_none());
6025    /// assert!(x.serverless_neg().is_none());
6026    /// ```
6027    pub fn set_ngfw_packet_inspection<
6028        T: std::convert::Into<std::boxed::Box<crate::model::NgfwPacketInspectionInfo>>,
6029    >(
6030        mut self,
6031        v: T,
6032    ) -> Self {
6033        self.step_info =
6034            std::option::Option::Some(crate::model::step::StepInfo::NgfwPacketInspection(v.into()));
6035        self
6036    }
6037}
6038
6039impl wkt::message::Message for Step {
6040    fn typename() -> &'static str {
6041        "type.googleapis.com/google.cloud.networkmanagement.v1.Step"
6042    }
6043}
6044
6045/// Defines additional types related to [Step].
6046pub mod step {
6047    #[allow(unused_imports)]
6048    use super::*;
6049
6050    /// Type of states that are defined in the network state machine.
6051    /// Each step in the packet trace is in a specific state.
6052    ///
6053    /// # Working with unknown values
6054    ///
6055    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6056    /// additional enum variants at any time. Adding new variants is not considered
6057    /// a breaking change. Applications should write their code in anticipation of:
6058    ///
6059    /// - New values appearing in future releases of the client library, **and**
6060    /// - New values received dynamically, without application changes.
6061    ///
6062    /// Please consult the [Working with enums] section in the user guide for some
6063    /// guidelines.
6064    ///
6065    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6066    #[derive(Clone, Debug, PartialEq)]
6067    #[non_exhaustive]
6068    pub enum State {
6069        /// Unspecified state.
6070        Unspecified,
6071        /// Initial state: packet originating from a Compute Engine instance.
6072        /// An InstanceInfo is populated with starting instance information.
6073        StartFromInstance,
6074        /// Initial state: packet originating from the internet.
6075        /// The endpoint information is populated.
6076        StartFromInternet,
6077        /// Initial state: packet originating from a Google service.
6078        /// The google_service information is populated.
6079        StartFromGoogleService,
6080        /// Initial state: packet originating from a VPC or on-premises network
6081        /// with internal source IP.
6082        /// If the source is a VPC network visible to the user, a NetworkInfo
6083        /// is populated with details of the network.
6084        StartFromPrivateNetwork,
6085        /// Initial state: packet originating from a Google Kubernetes Engine cluster
6086        /// master. A GKEMasterInfo is populated with starting instance information.
6087        StartFromGkeMaster,
6088        /// Initial state: packet originating from a Cloud SQL instance.
6089        /// A CloudSQLInstanceInfo is populated with starting instance information.
6090        StartFromCloudSqlInstance,
6091        /// Initial state: packet originating from a Google Kubernetes Engine Pod.
6092        /// A GkePodInfo is populated with starting Pod information.
6093        StartFromGkePod,
6094        /// Initial state: packet originating from a Redis instance.
6095        /// A RedisInstanceInfo is populated with starting instance information.
6096        StartFromRedisInstance,
6097        /// Initial state: packet originating from a Redis Cluster.
6098        /// A RedisClusterInfo is populated with starting Cluster information.
6099        StartFromRedisCluster,
6100        /// Initial state: packet originating from a Cloud Function.
6101        /// A CloudFunctionInfo is populated with starting function information.
6102        StartFromCloudFunction,
6103        /// Initial state: packet originating from an App Engine service version.
6104        /// An AppEngineVersionInfo is populated with starting version information.
6105        StartFromAppEngineVersion,
6106        /// Initial state: packet originating from a Cloud Run revision.
6107        /// A CloudRunRevisionInfo is populated with starting revision information.
6108        StartFromCloudRunRevision,
6109        /// Initial state: packet originating from a Storage Bucket. Used only for
6110        /// return traces.
6111        /// The storage_bucket information is populated.
6112        StartFromStorageBucket,
6113        /// Initial state: packet originating from a published service that uses
6114        /// Private Service Connect. Used only for return traces.
6115        StartFromPscPublishedService,
6116        /// Initial state: packet originating from a serverless network endpoint
6117        /// group backend. Used only for return traces.
6118        /// The serverless_neg information is populated.
6119        StartFromServerlessNeg,
6120        /// Config checking state: verify ingress firewall rule.
6121        ApplyIngressFirewallRule,
6122        /// Config checking state: verify egress firewall rule.
6123        ApplyEgressFirewallRule,
6124        /// Config checking state: verify route.
6125        ApplyRoute,
6126        /// Config checking state: match forwarding rule.
6127        ApplyForwardingRule,
6128        /// Config checking state: verify load balancer backend configuration.
6129        AnalyzeLoadBalancerBackend,
6130        /// Config checking state: packet sent or received under foreign IP
6131        /// address and allowed.
6132        SpoofingApproved,
6133        /// Forwarding state: arriving at a Compute Engine instance.
6134        ArriveAtInstance,
6135        /// Forwarding state: arriving at a Compute Engine internal load balancer.
6136        #[deprecated]
6137        ArriveAtInternalLoadBalancer,
6138        /// Forwarding state: arriving at a Compute Engine external load balancer.
6139        #[deprecated]
6140        ArriveAtExternalLoadBalancer,
6141        /// Forwarding state: arriving at a hybrid subnet. Appropriate routing
6142        /// configuration will be determined here.
6143        ArriveAtHybridSubnet,
6144        /// Forwarding state: arriving at a Cloud VPN gateway.
6145        ArriveAtVpnGateway,
6146        /// Forwarding state: arriving at a Cloud VPN tunnel.
6147        ArriveAtVpnTunnel,
6148        /// Forwarding state: arriving at an interconnect attachment.
6149        ArriveAtInterconnectAttachment,
6150        /// Forwarding state: arriving at a VPC connector.
6151        ArriveAtVpcConnector,
6152        /// Forwarding state: arriving at a GKE Pod.
6153        ArriveAtGkePod,
6154        /// Forwarding state: for packets originating from a serverless endpoint
6155        /// forwarded through Direct VPC egress.
6156        DirectVpcEgressConnection,
6157        /// Forwarding state: for packets originating from a serverless endpoint
6158        /// forwarded through public (external) connectivity.
6159        ServerlessExternalConnection,
6160        /// Forwarding state: Layer 7 packet inspection by the firewall endpoint
6161        /// based on the configured security profile group.
6162        NgfwPacketInspection,
6163        /// Transition state: packet header translated. The `nat` field is populated
6164        /// with the translation information.
6165        Nat,
6166        /// Transition state: GKE Pod IP masquerading is skipped. The
6167        /// `ip_masquerading_skipped` field is populated with the reason.
6168        SkipGkePodIpMasquerading,
6169        /// Transition state: GKE Ingress Network Policy is skipped. The
6170        /// `gke_network_policy_skipped` field is populated with the reason.
6171        SkipGkeIngressNetworkPolicy,
6172        /// Transition state: GKE Egress Network Policy is skipped. The
6173        /// `gke_network_policy_skipped` field is populated with the reason.
6174        SkipGkeEgressNetworkPolicy,
6175        /// Config checking state: verify ingress GKE network policy.
6176        ApplyIngressGkeNetworkPolicy,
6177        /// Config checking state: verify egress GKE network policy.
6178        ApplyEgressGkeNetworkPolicy,
6179        /// Transition state: original connection is terminated and a new proxied
6180        /// connection is initiated.
6181        ProxyConnection,
6182        /// Final state: packet could be delivered.
6183        Deliver,
6184        /// Final state: packet could be dropped.
6185        Drop,
6186        /// Final state: packet could be forwarded to a network with an unknown
6187        /// configuration.
6188        Forward,
6189        /// Final state: analysis is aborted.
6190        Abort,
6191        /// Special state: viewer of the test result does not have permission to
6192        /// see the configuration in this step.
6193        ViewerPermissionMissing,
6194        /// If set, the enum was initialized with an unknown value.
6195        ///
6196        /// Applications can examine the value using [State::value] or
6197        /// [State::name].
6198        UnknownValue(state::UnknownValue),
6199    }
6200
6201    #[doc(hidden)]
6202    pub mod state {
6203        #[allow(unused_imports)]
6204        use super::*;
6205        #[derive(Clone, Debug, PartialEq)]
6206        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6207    }
6208
6209    impl State {
6210        /// Gets the enum value.
6211        ///
6212        /// Returns `None` if the enum contains an unknown value deserialized from
6213        /// the string representation of enums.
6214        pub fn value(&self) -> std::option::Option<i32> {
6215            match self {
6216                Self::Unspecified => std::option::Option::Some(0),
6217                Self::StartFromInstance => std::option::Option::Some(1),
6218                Self::StartFromInternet => std::option::Option::Some(2),
6219                Self::StartFromGoogleService => std::option::Option::Some(27),
6220                Self::StartFromPrivateNetwork => std::option::Option::Some(3),
6221                Self::StartFromGkeMaster => std::option::Option::Some(21),
6222                Self::StartFromCloudSqlInstance => std::option::Option::Some(22),
6223                Self::StartFromGkePod => std::option::Option::Some(39),
6224                Self::StartFromRedisInstance => std::option::Option::Some(32),
6225                Self::StartFromRedisCluster => std::option::Option::Some(33),
6226                Self::StartFromCloudFunction => std::option::Option::Some(23),
6227                Self::StartFromAppEngineVersion => std::option::Option::Some(25),
6228                Self::StartFromCloudRunRevision => std::option::Option::Some(26),
6229                Self::StartFromStorageBucket => std::option::Option::Some(29),
6230                Self::StartFromPscPublishedService => std::option::Option::Some(30),
6231                Self::StartFromServerlessNeg => std::option::Option::Some(31),
6232                Self::ApplyIngressFirewallRule => std::option::Option::Some(4),
6233                Self::ApplyEgressFirewallRule => std::option::Option::Some(5),
6234                Self::ApplyRoute => std::option::Option::Some(6),
6235                Self::ApplyForwardingRule => std::option::Option::Some(7),
6236                Self::AnalyzeLoadBalancerBackend => std::option::Option::Some(28),
6237                Self::SpoofingApproved => std::option::Option::Some(8),
6238                Self::ArriveAtInstance => std::option::Option::Some(9),
6239                Self::ArriveAtInternalLoadBalancer => std::option::Option::Some(10),
6240                Self::ArriveAtExternalLoadBalancer => std::option::Option::Some(11),
6241                Self::ArriveAtHybridSubnet => std::option::Option::Some(38),
6242                Self::ArriveAtVpnGateway => std::option::Option::Some(12),
6243                Self::ArriveAtVpnTunnel => std::option::Option::Some(13),
6244                Self::ArriveAtInterconnectAttachment => std::option::Option::Some(37),
6245                Self::ArriveAtVpcConnector => std::option::Option::Some(24),
6246                Self::ArriveAtGkePod => std::option::Option::Some(44),
6247                Self::DirectVpcEgressConnection => std::option::Option::Some(35),
6248                Self::ServerlessExternalConnection => std::option::Option::Some(36),
6249                Self::NgfwPacketInspection => std::option::Option::Some(47),
6250                Self::Nat => std::option::Option::Some(14),
6251                Self::SkipGkePodIpMasquerading => std::option::Option::Some(40),
6252                Self::SkipGkeIngressNetworkPolicy => std::option::Option::Some(41),
6253                Self::SkipGkeEgressNetworkPolicy => std::option::Option::Some(42),
6254                Self::ApplyIngressGkeNetworkPolicy => std::option::Option::Some(45),
6255                Self::ApplyEgressGkeNetworkPolicy => std::option::Option::Some(46),
6256                Self::ProxyConnection => std::option::Option::Some(15),
6257                Self::Deliver => std::option::Option::Some(16),
6258                Self::Drop => std::option::Option::Some(17),
6259                Self::Forward => std::option::Option::Some(18),
6260                Self::Abort => std::option::Option::Some(19),
6261                Self::ViewerPermissionMissing => std::option::Option::Some(20),
6262                Self::UnknownValue(u) => u.0.value(),
6263            }
6264        }
6265
6266        /// Gets the enum value as a string.
6267        ///
6268        /// Returns `None` if the enum contains an unknown value deserialized from
6269        /// the integer representation of enums.
6270        pub fn name(&self) -> std::option::Option<&str> {
6271            match self {
6272                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6273                Self::StartFromInstance => std::option::Option::Some("START_FROM_INSTANCE"),
6274                Self::StartFromInternet => std::option::Option::Some("START_FROM_INTERNET"),
6275                Self::StartFromGoogleService => {
6276                    std::option::Option::Some("START_FROM_GOOGLE_SERVICE")
6277                }
6278                Self::StartFromPrivateNetwork => {
6279                    std::option::Option::Some("START_FROM_PRIVATE_NETWORK")
6280                }
6281                Self::StartFromGkeMaster => std::option::Option::Some("START_FROM_GKE_MASTER"),
6282                Self::StartFromCloudSqlInstance => {
6283                    std::option::Option::Some("START_FROM_CLOUD_SQL_INSTANCE")
6284                }
6285                Self::StartFromGkePod => std::option::Option::Some("START_FROM_GKE_POD"),
6286                Self::StartFromRedisInstance => {
6287                    std::option::Option::Some("START_FROM_REDIS_INSTANCE")
6288                }
6289                Self::StartFromRedisCluster => {
6290                    std::option::Option::Some("START_FROM_REDIS_CLUSTER")
6291                }
6292                Self::StartFromCloudFunction => {
6293                    std::option::Option::Some("START_FROM_CLOUD_FUNCTION")
6294                }
6295                Self::StartFromAppEngineVersion => {
6296                    std::option::Option::Some("START_FROM_APP_ENGINE_VERSION")
6297                }
6298                Self::StartFromCloudRunRevision => {
6299                    std::option::Option::Some("START_FROM_CLOUD_RUN_REVISION")
6300                }
6301                Self::StartFromStorageBucket => {
6302                    std::option::Option::Some("START_FROM_STORAGE_BUCKET")
6303                }
6304                Self::StartFromPscPublishedService => {
6305                    std::option::Option::Some("START_FROM_PSC_PUBLISHED_SERVICE")
6306                }
6307                Self::StartFromServerlessNeg => {
6308                    std::option::Option::Some("START_FROM_SERVERLESS_NEG")
6309                }
6310                Self::ApplyIngressFirewallRule => {
6311                    std::option::Option::Some("APPLY_INGRESS_FIREWALL_RULE")
6312                }
6313                Self::ApplyEgressFirewallRule => {
6314                    std::option::Option::Some("APPLY_EGRESS_FIREWALL_RULE")
6315                }
6316                Self::ApplyRoute => std::option::Option::Some("APPLY_ROUTE"),
6317                Self::ApplyForwardingRule => std::option::Option::Some("APPLY_FORWARDING_RULE"),
6318                Self::AnalyzeLoadBalancerBackend => {
6319                    std::option::Option::Some("ANALYZE_LOAD_BALANCER_BACKEND")
6320                }
6321                Self::SpoofingApproved => std::option::Option::Some("SPOOFING_APPROVED"),
6322                Self::ArriveAtInstance => std::option::Option::Some("ARRIVE_AT_INSTANCE"),
6323                Self::ArriveAtInternalLoadBalancer => {
6324                    std::option::Option::Some("ARRIVE_AT_INTERNAL_LOAD_BALANCER")
6325                }
6326                Self::ArriveAtExternalLoadBalancer => {
6327                    std::option::Option::Some("ARRIVE_AT_EXTERNAL_LOAD_BALANCER")
6328                }
6329                Self::ArriveAtHybridSubnet => std::option::Option::Some("ARRIVE_AT_HYBRID_SUBNET"),
6330                Self::ArriveAtVpnGateway => std::option::Option::Some("ARRIVE_AT_VPN_GATEWAY"),
6331                Self::ArriveAtVpnTunnel => std::option::Option::Some("ARRIVE_AT_VPN_TUNNEL"),
6332                Self::ArriveAtInterconnectAttachment => {
6333                    std::option::Option::Some("ARRIVE_AT_INTERCONNECT_ATTACHMENT")
6334                }
6335                Self::ArriveAtVpcConnector => std::option::Option::Some("ARRIVE_AT_VPC_CONNECTOR"),
6336                Self::ArriveAtGkePod => std::option::Option::Some("ARRIVE_AT_GKE_POD"),
6337                Self::DirectVpcEgressConnection => {
6338                    std::option::Option::Some("DIRECT_VPC_EGRESS_CONNECTION")
6339                }
6340                Self::ServerlessExternalConnection => {
6341                    std::option::Option::Some("SERVERLESS_EXTERNAL_CONNECTION")
6342                }
6343                Self::NgfwPacketInspection => std::option::Option::Some("NGFW_PACKET_INSPECTION"),
6344                Self::Nat => std::option::Option::Some("NAT"),
6345                Self::SkipGkePodIpMasquerading => {
6346                    std::option::Option::Some("SKIP_GKE_POD_IP_MASQUERADING")
6347                }
6348                Self::SkipGkeIngressNetworkPolicy => {
6349                    std::option::Option::Some("SKIP_GKE_INGRESS_NETWORK_POLICY")
6350                }
6351                Self::SkipGkeEgressNetworkPolicy => {
6352                    std::option::Option::Some("SKIP_GKE_EGRESS_NETWORK_POLICY")
6353                }
6354                Self::ApplyIngressGkeNetworkPolicy => {
6355                    std::option::Option::Some("APPLY_INGRESS_GKE_NETWORK_POLICY")
6356                }
6357                Self::ApplyEgressGkeNetworkPolicy => {
6358                    std::option::Option::Some("APPLY_EGRESS_GKE_NETWORK_POLICY")
6359                }
6360                Self::ProxyConnection => std::option::Option::Some("PROXY_CONNECTION"),
6361                Self::Deliver => std::option::Option::Some("DELIVER"),
6362                Self::Drop => std::option::Option::Some("DROP"),
6363                Self::Forward => std::option::Option::Some("FORWARD"),
6364                Self::Abort => std::option::Option::Some("ABORT"),
6365                Self::ViewerPermissionMissing => {
6366                    std::option::Option::Some("VIEWER_PERMISSION_MISSING")
6367                }
6368                Self::UnknownValue(u) => u.0.name(),
6369            }
6370        }
6371    }
6372
6373    impl std::default::Default for State {
6374        fn default() -> Self {
6375            use std::convert::From;
6376            Self::from(0)
6377        }
6378    }
6379
6380    impl std::fmt::Display for State {
6381        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6382            wkt::internal::display_enum(f, self.name(), self.value())
6383        }
6384    }
6385
6386    impl std::convert::From<i32> for State {
6387        fn from(value: i32) -> Self {
6388            match value {
6389                0 => Self::Unspecified,
6390                1 => Self::StartFromInstance,
6391                2 => Self::StartFromInternet,
6392                3 => Self::StartFromPrivateNetwork,
6393                4 => Self::ApplyIngressFirewallRule,
6394                5 => Self::ApplyEgressFirewallRule,
6395                6 => Self::ApplyRoute,
6396                7 => Self::ApplyForwardingRule,
6397                8 => Self::SpoofingApproved,
6398                9 => Self::ArriveAtInstance,
6399                10 => Self::ArriveAtInternalLoadBalancer,
6400                11 => Self::ArriveAtExternalLoadBalancer,
6401                12 => Self::ArriveAtVpnGateway,
6402                13 => Self::ArriveAtVpnTunnel,
6403                14 => Self::Nat,
6404                15 => Self::ProxyConnection,
6405                16 => Self::Deliver,
6406                17 => Self::Drop,
6407                18 => Self::Forward,
6408                19 => Self::Abort,
6409                20 => Self::ViewerPermissionMissing,
6410                21 => Self::StartFromGkeMaster,
6411                22 => Self::StartFromCloudSqlInstance,
6412                23 => Self::StartFromCloudFunction,
6413                24 => Self::ArriveAtVpcConnector,
6414                25 => Self::StartFromAppEngineVersion,
6415                26 => Self::StartFromCloudRunRevision,
6416                27 => Self::StartFromGoogleService,
6417                28 => Self::AnalyzeLoadBalancerBackend,
6418                29 => Self::StartFromStorageBucket,
6419                30 => Self::StartFromPscPublishedService,
6420                31 => Self::StartFromServerlessNeg,
6421                32 => Self::StartFromRedisInstance,
6422                33 => Self::StartFromRedisCluster,
6423                35 => Self::DirectVpcEgressConnection,
6424                36 => Self::ServerlessExternalConnection,
6425                37 => Self::ArriveAtInterconnectAttachment,
6426                38 => Self::ArriveAtHybridSubnet,
6427                39 => Self::StartFromGkePod,
6428                40 => Self::SkipGkePodIpMasquerading,
6429                41 => Self::SkipGkeIngressNetworkPolicy,
6430                42 => Self::SkipGkeEgressNetworkPolicy,
6431                44 => Self::ArriveAtGkePod,
6432                45 => Self::ApplyIngressGkeNetworkPolicy,
6433                46 => Self::ApplyEgressGkeNetworkPolicy,
6434                47 => Self::NgfwPacketInspection,
6435                _ => Self::UnknownValue(state::UnknownValue(
6436                    wkt::internal::UnknownEnumValue::Integer(value),
6437                )),
6438            }
6439        }
6440    }
6441
6442    impl std::convert::From<&str> for State {
6443        fn from(value: &str) -> Self {
6444            use std::string::ToString;
6445            match value {
6446                "STATE_UNSPECIFIED" => Self::Unspecified,
6447                "START_FROM_INSTANCE" => Self::StartFromInstance,
6448                "START_FROM_INTERNET" => Self::StartFromInternet,
6449                "START_FROM_GOOGLE_SERVICE" => Self::StartFromGoogleService,
6450                "START_FROM_PRIVATE_NETWORK" => Self::StartFromPrivateNetwork,
6451                "START_FROM_GKE_MASTER" => Self::StartFromGkeMaster,
6452                "START_FROM_CLOUD_SQL_INSTANCE" => Self::StartFromCloudSqlInstance,
6453                "START_FROM_GKE_POD" => Self::StartFromGkePod,
6454                "START_FROM_REDIS_INSTANCE" => Self::StartFromRedisInstance,
6455                "START_FROM_REDIS_CLUSTER" => Self::StartFromRedisCluster,
6456                "START_FROM_CLOUD_FUNCTION" => Self::StartFromCloudFunction,
6457                "START_FROM_APP_ENGINE_VERSION" => Self::StartFromAppEngineVersion,
6458                "START_FROM_CLOUD_RUN_REVISION" => Self::StartFromCloudRunRevision,
6459                "START_FROM_STORAGE_BUCKET" => Self::StartFromStorageBucket,
6460                "START_FROM_PSC_PUBLISHED_SERVICE" => Self::StartFromPscPublishedService,
6461                "START_FROM_SERVERLESS_NEG" => Self::StartFromServerlessNeg,
6462                "APPLY_INGRESS_FIREWALL_RULE" => Self::ApplyIngressFirewallRule,
6463                "APPLY_EGRESS_FIREWALL_RULE" => Self::ApplyEgressFirewallRule,
6464                "APPLY_ROUTE" => Self::ApplyRoute,
6465                "APPLY_FORWARDING_RULE" => Self::ApplyForwardingRule,
6466                "ANALYZE_LOAD_BALANCER_BACKEND" => Self::AnalyzeLoadBalancerBackend,
6467                "SPOOFING_APPROVED" => Self::SpoofingApproved,
6468                "ARRIVE_AT_INSTANCE" => Self::ArriveAtInstance,
6469                "ARRIVE_AT_INTERNAL_LOAD_BALANCER" => Self::ArriveAtInternalLoadBalancer,
6470                "ARRIVE_AT_EXTERNAL_LOAD_BALANCER" => Self::ArriveAtExternalLoadBalancer,
6471                "ARRIVE_AT_HYBRID_SUBNET" => Self::ArriveAtHybridSubnet,
6472                "ARRIVE_AT_VPN_GATEWAY" => Self::ArriveAtVpnGateway,
6473                "ARRIVE_AT_VPN_TUNNEL" => Self::ArriveAtVpnTunnel,
6474                "ARRIVE_AT_INTERCONNECT_ATTACHMENT" => Self::ArriveAtInterconnectAttachment,
6475                "ARRIVE_AT_VPC_CONNECTOR" => Self::ArriveAtVpcConnector,
6476                "ARRIVE_AT_GKE_POD" => Self::ArriveAtGkePod,
6477                "DIRECT_VPC_EGRESS_CONNECTION" => Self::DirectVpcEgressConnection,
6478                "SERVERLESS_EXTERNAL_CONNECTION" => Self::ServerlessExternalConnection,
6479                "NGFW_PACKET_INSPECTION" => Self::NgfwPacketInspection,
6480                "NAT" => Self::Nat,
6481                "SKIP_GKE_POD_IP_MASQUERADING" => Self::SkipGkePodIpMasquerading,
6482                "SKIP_GKE_INGRESS_NETWORK_POLICY" => Self::SkipGkeIngressNetworkPolicy,
6483                "SKIP_GKE_EGRESS_NETWORK_POLICY" => Self::SkipGkeEgressNetworkPolicy,
6484                "APPLY_INGRESS_GKE_NETWORK_POLICY" => Self::ApplyIngressGkeNetworkPolicy,
6485                "APPLY_EGRESS_GKE_NETWORK_POLICY" => Self::ApplyEgressGkeNetworkPolicy,
6486                "PROXY_CONNECTION" => Self::ProxyConnection,
6487                "DELIVER" => Self::Deliver,
6488                "DROP" => Self::Drop,
6489                "FORWARD" => Self::Forward,
6490                "ABORT" => Self::Abort,
6491                "VIEWER_PERMISSION_MISSING" => Self::ViewerPermissionMissing,
6492                _ => Self::UnknownValue(state::UnknownValue(
6493                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6494                )),
6495            }
6496        }
6497    }
6498
6499    impl serde::ser::Serialize for State {
6500        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6501        where
6502            S: serde::Serializer,
6503        {
6504            match self {
6505                Self::Unspecified => serializer.serialize_i32(0),
6506                Self::StartFromInstance => serializer.serialize_i32(1),
6507                Self::StartFromInternet => serializer.serialize_i32(2),
6508                Self::StartFromGoogleService => serializer.serialize_i32(27),
6509                Self::StartFromPrivateNetwork => serializer.serialize_i32(3),
6510                Self::StartFromGkeMaster => serializer.serialize_i32(21),
6511                Self::StartFromCloudSqlInstance => serializer.serialize_i32(22),
6512                Self::StartFromGkePod => serializer.serialize_i32(39),
6513                Self::StartFromRedisInstance => serializer.serialize_i32(32),
6514                Self::StartFromRedisCluster => serializer.serialize_i32(33),
6515                Self::StartFromCloudFunction => serializer.serialize_i32(23),
6516                Self::StartFromAppEngineVersion => serializer.serialize_i32(25),
6517                Self::StartFromCloudRunRevision => serializer.serialize_i32(26),
6518                Self::StartFromStorageBucket => serializer.serialize_i32(29),
6519                Self::StartFromPscPublishedService => serializer.serialize_i32(30),
6520                Self::StartFromServerlessNeg => serializer.serialize_i32(31),
6521                Self::ApplyIngressFirewallRule => serializer.serialize_i32(4),
6522                Self::ApplyEgressFirewallRule => serializer.serialize_i32(5),
6523                Self::ApplyRoute => serializer.serialize_i32(6),
6524                Self::ApplyForwardingRule => serializer.serialize_i32(7),
6525                Self::AnalyzeLoadBalancerBackend => serializer.serialize_i32(28),
6526                Self::SpoofingApproved => serializer.serialize_i32(8),
6527                Self::ArriveAtInstance => serializer.serialize_i32(9),
6528                Self::ArriveAtInternalLoadBalancer => serializer.serialize_i32(10),
6529                Self::ArriveAtExternalLoadBalancer => serializer.serialize_i32(11),
6530                Self::ArriveAtHybridSubnet => serializer.serialize_i32(38),
6531                Self::ArriveAtVpnGateway => serializer.serialize_i32(12),
6532                Self::ArriveAtVpnTunnel => serializer.serialize_i32(13),
6533                Self::ArriveAtInterconnectAttachment => serializer.serialize_i32(37),
6534                Self::ArriveAtVpcConnector => serializer.serialize_i32(24),
6535                Self::ArriveAtGkePod => serializer.serialize_i32(44),
6536                Self::DirectVpcEgressConnection => serializer.serialize_i32(35),
6537                Self::ServerlessExternalConnection => serializer.serialize_i32(36),
6538                Self::NgfwPacketInspection => serializer.serialize_i32(47),
6539                Self::Nat => serializer.serialize_i32(14),
6540                Self::SkipGkePodIpMasquerading => serializer.serialize_i32(40),
6541                Self::SkipGkeIngressNetworkPolicy => serializer.serialize_i32(41),
6542                Self::SkipGkeEgressNetworkPolicy => serializer.serialize_i32(42),
6543                Self::ApplyIngressGkeNetworkPolicy => serializer.serialize_i32(45),
6544                Self::ApplyEgressGkeNetworkPolicy => serializer.serialize_i32(46),
6545                Self::ProxyConnection => serializer.serialize_i32(15),
6546                Self::Deliver => serializer.serialize_i32(16),
6547                Self::Drop => serializer.serialize_i32(17),
6548                Self::Forward => serializer.serialize_i32(18),
6549                Self::Abort => serializer.serialize_i32(19),
6550                Self::ViewerPermissionMissing => serializer.serialize_i32(20),
6551                Self::UnknownValue(u) => u.0.serialize(serializer),
6552            }
6553        }
6554    }
6555
6556    impl<'de> serde::de::Deserialize<'de> for State {
6557        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6558        where
6559            D: serde::Deserializer<'de>,
6560        {
6561            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6562                ".google.cloud.networkmanagement.v1.Step.State",
6563            ))
6564        }
6565    }
6566
6567    /// Configuration or metadata associated with each step.
6568    /// The configuration is filtered based on viewer's permission. If a viewer
6569    /// has no permission to view the configuration in this step, for non-final
6570    /// states a special state is populated (VIEWER_PERMISSION_MISSING), and for
6571    /// final state the configuration is cleared.
6572    #[derive(Clone, Debug, PartialEq)]
6573    #[non_exhaustive]
6574    pub enum StepInfo {
6575        /// Display information of a Compute Engine instance.
6576        Instance(std::boxed::Box<crate::model::InstanceInfo>),
6577        /// Display information of a Compute Engine firewall rule.
6578        Firewall(std::boxed::Box<crate::model::FirewallInfo>),
6579        /// Display information of a Compute Engine route.
6580        Route(std::boxed::Box<crate::model::RouteInfo>),
6581        /// Display information of the source and destination under analysis.
6582        /// The endpoint information in an intermediate state may differ with the
6583        /// initial input, as it might be modified by state like NAT,
6584        /// or Connection Proxy.
6585        Endpoint(std::boxed::Box<crate::model::EndpointInfo>),
6586        /// Display information of a Google service
6587        GoogleService(std::boxed::Box<crate::model::GoogleServiceInfo>),
6588        /// Display information of a Compute Engine forwarding rule.
6589        ForwardingRule(std::boxed::Box<crate::model::ForwardingRuleInfo>),
6590        /// Display information of a hybrid subnet.
6591        HybridSubnet(std::boxed::Box<crate::model::HybridSubnetInfo>),
6592        /// Display information of a Compute Engine VPN gateway.
6593        VpnGateway(std::boxed::Box<crate::model::VpnGatewayInfo>),
6594        /// Display information of a Compute Engine VPN tunnel.
6595        VpnTunnel(std::boxed::Box<crate::model::VpnTunnelInfo>),
6596        /// Display information of an interconnect attachment.
6597        InterconnectAttachment(std::boxed::Box<crate::model::InterconnectAttachmentInfo>),
6598        /// Display information of a VPC connector.
6599        VpcConnector(std::boxed::Box<crate::model::VpcConnectorInfo>),
6600        /// Display information of a serverless direct VPC egress connection.
6601        DirectVpcEgressConnection(std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>),
6602        /// Display information of a serverless public (external) connection.
6603        ServerlessExternalConnection(
6604            std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>,
6605        ),
6606        /// Display information of the final state "deliver" and reason.
6607        Deliver(std::boxed::Box<crate::model::DeliverInfo>),
6608        /// Display information of the final state "forward" and reason.
6609        Forward(std::boxed::Box<crate::model::ForwardInfo>),
6610        /// Display information of the final state "abort" and reason.
6611        Abort(std::boxed::Box<crate::model::AbortInfo>),
6612        /// Display information of the final state "drop" and reason.
6613        Drop(std::boxed::Box<crate::model::DropInfo>),
6614        /// Display information of the load balancers. Deprecated in favor of the
6615        /// `load_balancer_backend_info` field, not used in new tests.
6616        #[deprecated]
6617        LoadBalancer(std::boxed::Box<crate::model::LoadBalancerInfo>),
6618        /// Display information of a Google Cloud network.
6619        Network(std::boxed::Box<crate::model::NetworkInfo>),
6620        /// Display information of a Google Kubernetes Engine cluster master.
6621        GkeMaster(std::boxed::Box<crate::model::GKEMasterInfo>),
6622        /// Display information of a Google Kubernetes Engine Pod.
6623        GkePod(std::boxed::Box<crate::model::GkePodInfo>),
6624        /// Display information of the reason why GKE Pod IP masquerading was
6625        /// skipped.
6626        IpMasqueradingSkipped(std::boxed::Box<crate::model::IpMasqueradingSkippedInfo>),
6627        /// Display information of a GKE Network Policy.
6628        GkeNetworkPolicy(std::boxed::Box<crate::model::GkeNetworkPolicyInfo>),
6629        /// Display information of the reason why GKE Network Policy evaluation was
6630        /// skipped.
6631        GkeNetworkPolicySkipped(std::boxed::Box<crate::model::GkeNetworkPolicySkippedInfo>),
6632        /// Display information of a Cloud SQL instance.
6633        CloudSqlInstance(std::boxed::Box<crate::model::CloudSQLInstanceInfo>),
6634        /// Display information of a Redis Instance.
6635        RedisInstance(std::boxed::Box<crate::model::RedisInstanceInfo>),
6636        /// Display information of a Redis Cluster.
6637        RedisCluster(std::boxed::Box<crate::model::RedisClusterInfo>),
6638        /// Display information of a Cloud Function.
6639        CloudFunction(std::boxed::Box<crate::model::CloudFunctionInfo>),
6640        /// Display information of an App Engine service version.
6641        AppEngineVersion(std::boxed::Box<crate::model::AppEngineVersionInfo>),
6642        /// Display information of a Cloud Run revision.
6643        CloudRunRevision(std::boxed::Box<crate::model::CloudRunRevisionInfo>),
6644        /// Display information of a NAT.
6645        Nat(std::boxed::Box<crate::model::NatInfo>),
6646        /// Display information of a ProxyConnection.
6647        ProxyConnection(std::boxed::Box<crate::model::ProxyConnectionInfo>),
6648        /// Display information of a specific load balancer backend.
6649        LoadBalancerBackendInfo(std::boxed::Box<crate::model::LoadBalancerBackendInfo>),
6650        /// Display information of a Storage Bucket. Used only for return traces.
6651        StorageBucket(std::boxed::Box<crate::model::StorageBucketInfo>),
6652        /// Display information of a Serverless network endpoint group backend. Used
6653        /// only for return traces.
6654        ServerlessNeg(std::boxed::Box<crate::model::ServerlessNegInfo>),
6655        /// Display information of a layer 7 packet inspection by the firewall.
6656        NgfwPacketInspection(std::boxed::Box<crate::model::NgfwPacketInspectionInfo>),
6657    }
6658}
6659
6660/// For display only. Metadata associated with a Compute Engine instance.
6661#[derive(Clone, Default, PartialEq)]
6662#[non_exhaustive]
6663pub struct InstanceInfo {
6664    /// Name of a Compute Engine instance.
6665    pub display_name: std::string::String,
6666
6667    /// URI of a Compute Engine instance.
6668    pub uri: std::string::String,
6669
6670    /// Name of the network interface of a Compute Engine instance.
6671    pub interface: std::string::String,
6672
6673    /// URI of a Compute Engine network.
6674    pub network_uri: std::string::String,
6675
6676    /// Internal IP address of the network interface.
6677    pub internal_ip: std::string::String,
6678
6679    /// External IP address of the network interface.
6680    pub external_ip: std::string::String,
6681
6682    /// Network tags configured on the instance.
6683    pub network_tags: std::vec::Vec<std::string::String>,
6684
6685    /// Service account authorized for the instance.
6686    #[deprecated]
6687    pub service_account: std::string::String,
6688
6689    /// URI of the PSC network attachment the NIC is attached to (if relevant).
6690    pub psc_network_attachment_uri: std::string::String,
6691
6692    /// Indicates whether the Compute Engine instance is running.
6693    /// Deprecated: use the `status` field instead.
6694    #[deprecated]
6695    pub running: bool,
6696
6697    /// The status of the instance.
6698    pub status: crate::model::instance_info::Status,
6699
6700    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6701}
6702
6703impl InstanceInfo {
6704    pub fn new() -> Self {
6705        std::default::Default::default()
6706    }
6707
6708    /// Sets the value of [display_name][crate::model::InstanceInfo::display_name].
6709    ///
6710    /// # Example
6711    /// ```ignore,no_run
6712    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6713    /// let x = InstanceInfo::new().set_display_name("example");
6714    /// ```
6715    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6716        self.display_name = v.into();
6717        self
6718    }
6719
6720    /// Sets the value of [uri][crate::model::InstanceInfo::uri].
6721    ///
6722    /// # Example
6723    /// ```ignore,no_run
6724    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6725    /// let x = InstanceInfo::new().set_uri("example");
6726    /// ```
6727    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6728        self.uri = v.into();
6729        self
6730    }
6731
6732    /// Sets the value of [interface][crate::model::InstanceInfo::interface].
6733    ///
6734    /// # Example
6735    /// ```ignore,no_run
6736    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6737    /// let x = InstanceInfo::new().set_interface("example");
6738    /// ```
6739    pub fn set_interface<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6740        self.interface = v.into();
6741        self
6742    }
6743
6744    /// Sets the value of [network_uri][crate::model::InstanceInfo::network_uri].
6745    ///
6746    /// # Example
6747    /// ```ignore,no_run
6748    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6749    /// let x = InstanceInfo::new().set_network_uri("example");
6750    /// ```
6751    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6752        self.network_uri = v.into();
6753        self
6754    }
6755
6756    /// Sets the value of [internal_ip][crate::model::InstanceInfo::internal_ip].
6757    ///
6758    /// # Example
6759    /// ```ignore,no_run
6760    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6761    /// let x = InstanceInfo::new().set_internal_ip("example");
6762    /// ```
6763    pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6764        self.internal_ip = v.into();
6765        self
6766    }
6767
6768    /// Sets the value of [external_ip][crate::model::InstanceInfo::external_ip].
6769    ///
6770    /// # Example
6771    /// ```ignore,no_run
6772    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6773    /// let x = InstanceInfo::new().set_external_ip("example");
6774    /// ```
6775    pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6776        self.external_ip = v.into();
6777        self
6778    }
6779
6780    /// Sets the value of [network_tags][crate::model::InstanceInfo::network_tags].
6781    ///
6782    /// # Example
6783    /// ```ignore,no_run
6784    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6785    /// let x = InstanceInfo::new().set_network_tags(["a", "b", "c"]);
6786    /// ```
6787    pub fn set_network_tags<T, V>(mut self, v: T) -> Self
6788    where
6789        T: std::iter::IntoIterator<Item = V>,
6790        V: std::convert::Into<std::string::String>,
6791    {
6792        use std::iter::Iterator;
6793        self.network_tags = v.into_iter().map(|i| i.into()).collect();
6794        self
6795    }
6796
6797    /// Sets the value of [service_account][crate::model::InstanceInfo::service_account].
6798    ///
6799    /// # Example
6800    /// ```ignore,no_run
6801    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6802    /// let x = InstanceInfo::new().set_service_account("example");
6803    /// ```
6804    #[deprecated]
6805    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6806        self.service_account = v.into();
6807        self
6808    }
6809
6810    /// Sets the value of [psc_network_attachment_uri][crate::model::InstanceInfo::psc_network_attachment_uri].
6811    ///
6812    /// # Example
6813    /// ```ignore,no_run
6814    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6815    /// let x = InstanceInfo::new().set_psc_network_attachment_uri("example");
6816    /// ```
6817    pub fn set_psc_network_attachment_uri<T: std::convert::Into<std::string::String>>(
6818        mut self,
6819        v: T,
6820    ) -> Self {
6821        self.psc_network_attachment_uri = v.into();
6822        self
6823    }
6824
6825    /// Sets the value of [running][crate::model::InstanceInfo::running].
6826    ///
6827    /// # Example
6828    /// ```ignore,no_run
6829    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6830    /// let x = InstanceInfo::new().set_running(true);
6831    /// ```
6832    #[deprecated]
6833    pub fn set_running<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6834        self.running = v.into();
6835        self
6836    }
6837
6838    /// Sets the value of [status][crate::model::InstanceInfo::status].
6839    ///
6840    /// # Example
6841    /// ```ignore,no_run
6842    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6843    /// use google_cloud_networkmanagement_v1::model::instance_info::Status;
6844    /// let x0 = InstanceInfo::new().set_status(Status::Running);
6845    /// let x1 = InstanceInfo::new().set_status(Status::NotRunning);
6846    /// ```
6847    pub fn set_status<T: std::convert::Into<crate::model::instance_info::Status>>(
6848        mut self,
6849        v: T,
6850    ) -> Self {
6851        self.status = v.into();
6852        self
6853    }
6854}
6855
6856impl wkt::message::Message for InstanceInfo {
6857    fn typename() -> &'static str {
6858        "type.googleapis.com/google.cloud.networkmanagement.v1.InstanceInfo"
6859    }
6860}
6861
6862/// Defines additional types related to [InstanceInfo].
6863pub mod instance_info {
6864    #[allow(unused_imports)]
6865    use super::*;
6866
6867    /// The status of the instance. We treat all states other than "RUNNING" as
6868    /// not running.
6869    ///
6870    /// # Working with unknown values
6871    ///
6872    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6873    /// additional enum variants at any time. Adding new variants is not considered
6874    /// a breaking change. Applications should write their code in anticipation of:
6875    ///
6876    /// - New values appearing in future releases of the client library, **and**
6877    /// - New values received dynamically, without application changes.
6878    ///
6879    /// Please consult the [Working with enums] section in the user guide for some
6880    /// guidelines.
6881    ///
6882    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6883    #[derive(Clone, Debug, PartialEq)]
6884    #[non_exhaustive]
6885    pub enum Status {
6886        /// Default unspecified value.
6887        Unspecified,
6888        /// The instance is running.
6889        Running,
6890        /// The instance has any status other than "RUNNING".
6891        NotRunning,
6892        /// If set, the enum was initialized with an unknown value.
6893        ///
6894        /// Applications can examine the value using [Status::value] or
6895        /// [Status::name].
6896        UnknownValue(status::UnknownValue),
6897    }
6898
6899    #[doc(hidden)]
6900    pub mod status {
6901        #[allow(unused_imports)]
6902        use super::*;
6903        #[derive(Clone, Debug, PartialEq)]
6904        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6905    }
6906
6907    impl Status {
6908        /// Gets the enum value.
6909        ///
6910        /// Returns `None` if the enum contains an unknown value deserialized from
6911        /// the string representation of enums.
6912        pub fn value(&self) -> std::option::Option<i32> {
6913            match self {
6914                Self::Unspecified => std::option::Option::Some(0),
6915                Self::Running => std::option::Option::Some(1),
6916                Self::NotRunning => std::option::Option::Some(2),
6917                Self::UnknownValue(u) => u.0.value(),
6918            }
6919        }
6920
6921        /// Gets the enum value as a string.
6922        ///
6923        /// Returns `None` if the enum contains an unknown value deserialized from
6924        /// the integer representation of enums.
6925        pub fn name(&self) -> std::option::Option<&str> {
6926            match self {
6927                Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
6928                Self::Running => std::option::Option::Some("RUNNING"),
6929                Self::NotRunning => std::option::Option::Some("NOT_RUNNING"),
6930                Self::UnknownValue(u) => u.0.name(),
6931            }
6932        }
6933    }
6934
6935    impl std::default::Default for Status {
6936        fn default() -> Self {
6937            use std::convert::From;
6938            Self::from(0)
6939        }
6940    }
6941
6942    impl std::fmt::Display for Status {
6943        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6944            wkt::internal::display_enum(f, self.name(), self.value())
6945        }
6946    }
6947
6948    impl std::convert::From<i32> for Status {
6949        fn from(value: i32) -> Self {
6950            match value {
6951                0 => Self::Unspecified,
6952                1 => Self::Running,
6953                2 => Self::NotRunning,
6954                _ => Self::UnknownValue(status::UnknownValue(
6955                    wkt::internal::UnknownEnumValue::Integer(value),
6956                )),
6957            }
6958        }
6959    }
6960
6961    impl std::convert::From<&str> for Status {
6962        fn from(value: &str) -> Self {
6963            use std::string::ToString;
6964            match value {
6965                "STATUS_UNSPECIFIED" => Self::Unspecified,
6966                "RUNNING" => Self::Running,
6967                "NOT_RUNNING" => Self::NotRunning,
6968                _ => Self::UnknownValue(status::UnknownValue(
6969                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6970                )),
6971            }
6972        }
6973    }
6974
6975    impl serde::ser::Serialize for Status {
6976        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6977        where
6978            S: serde::Serializer,
6979        {
6980            match self {
6981                Self::Unspecified => serializer.serialize_i32(0),
6982                Self::Running => serializer.serialize_i32(1),
6983                Self::NotRunning => serializer.serialize_i32(2),
6984                Self::UnknownValue(u) => u.0.serialize(serializer),
6985            }
6986        }
6987    }
6988
6989    impl<'de> serde::de::Deserialize<'de> for Status {
6990        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6991        where
6992            D: serde::Deserializer<'de>,
6993        {
6994            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
6995                ".google.cloud.networkmanagement.v1.InstanceInfo.Status",
6996            ))
6997        }
6998    }
6999}
7000
7001/// For display only. Metadata associated with a Compute Engine network.
7002#[derive(Clone, Default, PartialEq)]
7003#[non_exhaustive]
7004pub struct NetworkInfo {
7005    /// Name of a Compute Engine network.
7006    pub display_name: std::string::String,
7007
7008    /// URI of a Compute Engine network.
7009    pub uri: std::string::String,
7010
7011    /// URI of the subnet matching the source IP address of the test.
7012    pub matched_subnet_uri: std::string::String,
7013
7014    /// The IP range of the subnet matching the source IP address of the test.
7015    pub matched_ip_range: std::string::String,
7016
7017    /// The region of the subnet matching the source IP address of the test.
7018    pub region: std::string::String,
7019
7020    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7021}
7022
7023impl NetworkInfo {
7024    pub fn new() -> Self {
7025        std::default::Default::default()
7026    }
7027
7028    /// Sets the value of [display_name][crate::model::NetworkInfo::display_name].
7029    ///
7030    /// # Example
7031    /// ```ignore,no_run
7032    /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7033    /// let x = NetworkInfo::new().set_display_name("example");
7034    /// ```
7035    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7036        self.display_name = v.into();
7037        self
7038    }
7039
7040    /// Sets the value of [uri][crate::model::NetworkInfo::uri].
7041    ///
7042    /// # Example
7043    /// ```ignore,no_run
7044    /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7045    /// let x = NetworkInfo::new().set_uri("example");
7046    /// ```
7047    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7048        self.uri = v.into();
7049        self
7050    }
7051
7052    /// Sets the value of [matched_subnet_uri][crate::model::NetworkInfo::matched_subnet_uri].
7053    ///
7054    /// # Example
7055    /// ```ignore,no_run
7056    /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7057    /// let x = NetworkInfo::new().set_matched_subnet_uri("example");
7058    /// ```
7059    pub fn set_matched_subnet_uri<T: std::convert::Into<std::string::String>>(
7060        mut self,
7061        v: T,
7062    ) -> Self {
7063        self.matched_subnet_uri = v.into();
7064        self
7065    }
7066
7067    /// Sets the value of [matched_ip_range][crate::model::NetworkInfo::matched_ip_range].
7068    ///
7069    /// # Example
7070    /// ```ignore,no_run
7071    /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7072    /// let x = NetworkInfo::new().set_matched_ip_range("example");
7073    /// ```
7074    pub fn set_matched_ip_range<T: std::convert::Into<std::string::String>>(
7075        mut self,
7076        v: T,
7077    ) -> Self {
7078        self.matched_ip_range = v.into();
7079        self
7080    }
7081
7082    /// Sets the value of [region][crate::model::NetworkInfo::region].
7083    ///
7084    /// # Example
7085    /// ```ignore,no_run
7086    /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7087    /// let x = NetworkInfo::new().set_region("example");
7088    /// ```
7089    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7090        self.region = v.into();
7091        self
7092    }
7093}
7094
7095impl wkt::message::Message for NetworkInfo {
7096    fn typename() -> &'static str {
7097        "type.googleapis.com/google.cloud.networkmanagement.v1.NetworkInfo"
7098    }
7099}
7100
7101/// For display only. Metadata associated with a VPC firewall rule, an implied
7102/// VPC firewall rule, or a firewall policy rule.
7103#[derive(Clone, Default, PartialEq)]
7104#[non_exhaustive]
7105pub struct FirewallInfo {
7106    /// The display name of the firewall rule. This field might be empty for
7107    /// firewall policy rules.
7108    pub display_name: std::string::String,
7109
7110    /// The URI of the firewall rule. This field is not applicable to implied
7111    /// VPC firewall rules.
7112    pub uri: std::string::String,
7113
7114    /// Possible values: INGRESS, EGRESS
7115    pub direction: std::string::String,
7116
7117    /// Possible values: ALLOW, DENY, APPLY_SECURITY_PROFILE_GROUP
7118    pub action: std::string::String,
7119
7120    /// The priority of the firewall rule.
7121    pub priority: i32,
7122
7123    /// The URI of the VPC network that the firewall rule is associated with.
7124    /// This field is not applicable to hierarchical firewall policy rules.
7125    pub network_uri: std::string::String,
7126
7127    /// The target tags defined by the VPC firewall rule. This field is not
7128    /// applicable to firewall policy rules.
7129    pub target_tags: std::vec::Vec<std::string::String>,
7130
7131    /// The target service accounts specified by the firewall rule.
7132    pub target_service_accounts: std::vec::Vec<std::string::String>,
7133
7134    /// The name of the firewall policy that this rule is associated with.
7135    /// This field is not applicable to VPC firewall rules and implied VPC firewall
7136    /// rules.
7137    pub policy: std::string::String,
7138
7139    /// The URI of the firewall policy that this rule is associated with.
7140    /// This field is not applicable to VPC firewall rules and implied VPC firewall
7141    /// rules.
7142    pub policy_uri: std::string::String,
7143
7144    /// The firewall rule's type.
7145    pub firewall_rule_type: crate::model::firewall_info::FirewallRuleType,
7146
7147    /// The priority of the firewall policy that this rule is associated with.
7148    /// This field is not applicable to VPC firewall rules and implied VPC firewall
7149    /// rules.
7150    pub policy_priority: i32,
7151
7152    /// Target type of the firewall rule.
7153    pub target_type: crate::model::firewall_info::TargetType,
7154
7155    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7156}
7157
7158impl FirewallInfo {
7159    pub fn new() -> Self {
7160        std::default::Default::default()
7161    }
7162
7163    /// Sets the value of [display_name][crate::model::FirewallInfo::display_name].
7164    ///
7165    /// # Example
7166    /// ```ignore,no_run
7167    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7168    /// let x = FirewallInfo::new().set_display_name("example");
7169    /// ```
7170    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7171        self.display_name = v.into();
7172        self
7173    }
7174
7175    /// Sets the value of [uri][crate::model::FirewallInfo::uri].
7176    ///
7177    /// # Example
7178    /// ```ignore,no_run
7179    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7180    /// let x = FirewallInfo::new().set_uri("example");
7181    /// ```
7182    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7183        self.uri = v.into();
7184        self
7185    }
7186
7187    /// Sets the value of [direction][crate::model::FirewallInfo::direction].
7188    ///
7189    /// # Example
7190    /// ```ignore,no_run
7191    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7192    /// let x = FirewallInfo::new().set_direction("example");
7193    /// ```
7194    pub fn set_direction<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7195        self.direction = v.into();
7196        self
7197    }
7198
7199    /// Sets the value of [action][crate::model::FirewallInfo::action].
7200    ///
7201    /// # Example
7202    /// ```ignore,no_run
7203    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7204    /// let x = FirewallInfo::new().set_action("example");
7205    /// ```
7206    pub fn set_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7207        self.action = v.into();
7208        self
7209    }
7210
7211    /// Sets the value of [priority][crate::model::FirewallInfo::priority].
7212    ///
7213    /// # Example
7214    /// ```ignore,no_run
7215    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7216    /// let x = FirewallInfo::new().set_priority(42);
7217    /// ```
7218    pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7219        self.priority = v.into();
7220        self
7221    }
7222
7223    /// Sets the value of [network_uri][crate::model::FirewallInfo::network_uri].
7224    ///
7225    /// # Example
7226    /// ```ignore,no_run
7227    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7228    /// let x = FirewallInfo::new().set_network_uri("example");
7229    /// ```
7230    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7231        self.network_uri = v.into();
7232        self
7233    }
7234
7235    /// Sets the value of [target_tags][crate::model::FirewallInfo::target_tags].
7236    ///
7237    /// # Example
7238    /// ```ignore,no_run
7239    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7240    /// let x = FirewallInfo::new().set_target_tags(["a", "b", "c"]);
7241    /// ```
7242    pub fn set_target_tags<T, V>(mut self, v: T) -> Self
7243    where
7244        T: std::iter::IntoIterator<Item = V>,
7245        V: std::convert::Into<std::string::String>,
7246    {
7247        use std::iter::Iterator;
7248        self.target_tags = v.into_iter().map(|i| i.into()).collect();
7249        self
7250    }
7251
7252    /// Sets the value of [target_service_accounts][crate::model::FirewallInfo::target_service_accounts].
7253    ///
7254    /// # Example
7255    /// ```ignore,no_run
7256    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7257    /// let x = FirewallInfo::new().set_target_service_accounts(["a", "b", "c"]);
7258    /// ```
7259    pub fn set_target_service_accounts<T, V>(mut self, v: T) -> Self
7260    where
7261        T: std::iter::IntoIterator<Item = V>,
7262        V: std::convert::Into<std::string::String>,
7263    {
7264        use std::iter::Iterator;
7265        self.target_service_accounts = v.into_iter().map(|i| i.into()).collect();
7266        self
7267    }
7268
7269    /// Sets the value of [policy][crate::model::FirewallInfo::policy].
7270    ///
7271    /// # Example
7272    /// ```ignore,no_run
7273    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7274    /// let x = FirewallInfo::new().set_policy("example");
7275    /// ```
7276    pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7277        self.policy = v.into();
7278        self
7279    }
7280
7281    /// Sets the value of [policy_uri][crate::model::FirewallInfo::policy_uri].
7282    ///
7283    /// # Example
7284    /// ```ignore,no_run
7285    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7286    /// let x = FirewallInfo::new().set_policy_uri("example");
7287    /// ```
7288    pub fn set_policy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7289        self.policy_uri = v.into();
7290        self
7291    }
7292
7293    /// Sets the value of [firewall_rule_type][crate::model::FirewallInfo::firewall_rule_type].
7294    ///
7295    /// # Example
7296    /// ```ignore,no_run
7297    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7298    /// use google_cloud_networkmanagement_v1::model::firewall_info::FirewallRuleType;
7299    /// let x0 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::HierarchicalFirewallPolicyRule);
7300    /// let x1 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::VpcFirewallRule);
7301    /// let x2 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::ImpliedVpcFirewallRule);
7302    /// ```
7303    pub fn set_firewall_rule_type<
7304        T: std::convert::Into<crate::model::firewall_info::FirewallRuleType>,
7305    >(
7306        mut self,
7307        v: T,
7308    ) -> Self {
7309        self.firewall_rule_type = v.into();
7310        self
7311    }
7312
7313    /// Sets the value of [policy_priority][crate::model::FirewallInfo::policy_priority].
7314    ///
7315    /// # Example
7316    /// ```ignore,no_run
7317    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7318    /// let x = FirewallInfo::new().set_policy_priority(42);
7319    /// ```
7320    pub fn set_policy_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7321        self.policy_priority = v.into();
7322        self
7323    }
7324
7325    /// Sets the value of [target_type][crate::model::FirewallInfo::target_type].
7326    ///
7327    /// # Example
7328    /// ```ignore,no_run
7329    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7330    /// use google_cloud_networkmanagement_v1::model::firewall_info::TargetType;
7331    /// let x0 = FirewallInfo::new().set_target_type(TargetType::Instances);
7332    /// let x1 = FirewallInfo::new().set_target_type(TargetType::InternalManagedLb);
7333    /// ```
7334    pub fn set_target_type<T: std::convert::Into<crate::model::firewall_info::TargetType>>(
7335        mut self,
7336        v: T,
7337    ) -> Self {
7338        self.target_type = v.into();
7339        self
7340    }
7341}
7342
7343impl wkt::message::Message for FirewallInfo {
7344    fn typename() -> &'static str {
7345        "type.googleapis.com/google.cloud.networkmanagement.v1.FirewallInfo"
7346    }
7347}
7348
7349/// Defines additional types related to [FirewallInfo].
7350pub mod firewall_info {
7351    #[allow(unused_imports)]
7352    use super::*;
7353
7354    /// The firewall rule's type.
7355    ///
7356    /// # Working with unknown values
7357    ///
7358    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7359    /// additional enum variants at any time. Adding new variants is not considered
7360    /// a breaking change. Applications should write their code in anticipation of:
7361    ///
7362    /// - New values appearing in future releases of the client library, **and**
7363    /// - New values received dynamically, without application changes.
7364    ///
7365    /// Please consult the [Working with enums] section in the user guide for some
7366    /// guidelines.
7367    ///
7368    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7369    #[derive(Clone, Debug, PartialEq)]
7370    #[non_exhaustive]
7371    pub enum FirewallRuleType {
7372        /// Unspecified type.
7373        Unspecified,
7374        /// Hierarchical firewall policy rule. For details, see
7375        /// [Hierarchical firewall policies
7376        /// overview](https://cloud.google.com/vpc/docs/firewall-policies).
7377        HierarchicalFirewallPolicyRule,
7378        /// VPC firewall rule. For details, see
7379        /// [VPC firewall rules
7380        /// overview](https://cloud.google.com/vpc/docs/firewalls).
7381        VpcFirewallRule,
7382        /// Implied VPC firewall rule. For details, see
7383        /// [Implied
7384        /// rules](https://cloud.google.com/vpc/docs/firewalls#default_firewall_rules).
7385        ImpliedVpcFirewallRule,
7386        /// Implicit firewall rules that are managed by serverless VPC access to
7387        /// allow ingress access. They are not visible in the Google Cloud console.
7388        /// For details, see [VPC connector's implicit
7389        /// rules](https://cloud.google.com/functions/docs/networking/connecting-vpc#restrict-access).
7390        ServerlessVpcAccessManagedFirewallRule,
7391        /// User-defined global network firewall policy rule.
7392        /// For details, see [Network firewall
7393        /// policies](https://cloud.google.com/vpc/docs/network-firewall-policies).
7394        NetworkFirewallPolicyRule,
7395        /// User-defined regional network firewall policy rule.
7396        /// For details, see [Regional network firewall
7397        /// policies](https://cloud.google.com/firewall/docs/regional-firewall-policies).
7398        NetworkRegionalFirewallPolicyRule,
7399        /// System-defined global network firewall policy rule.
7400        SystemNetworkFirewallPolicyRule,
7401        /// System-defined regional network firewall policy rule.
7402        SystemRegionalNetworkFirewallPolicyRule,
7403        /// Firewall policy rule containing attributes not yet supported in
7404        /// Connectivity tests. Firewall analysis is skipped if such a rule can
7405        /// potentially be matched. Please see the [list of unsupported
7406        /// configurations](https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/concepts/overview#unsupported-configs).
7407        UnsupportedFirewallPolicyRule,
7408        /// Tracking state for response traffic created when request traffic goes
7409        /// through allow firewall rule.
7410        /// For details, see [firewall rules
7411        /// specifications](https://cloud.google.com/firewall/docs/firewalls#specifications)
7412        TrackingState,
7413        /// Firewall analysis was skipped due to executing Connectivity Test in the
7414        /// BypassFirewallChecks mode
7415        AnalysisSkipped,
7416        /// If set, the enum was initialized with an unknown value.
7417        ///
7418        /// Applications can examine the value using [FirewallRuleType::value] or
7419        /// [FirewallRuleType::name].
7420        UnknownValue(firewall_rule_type::UnknownValue),
7421    }
7422
7423    #[doc(hidden)]
7424    pub mod firewall_rule_type {
7425        #[allow(unused_imports)]
7426        use super::*;
7427        #[derive(Clone, Debug, PartialEq)]
7428        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7429    }
7430
7431    impl FirewallRuleType {
7432        /// Gets the enum value.
7433        ///
7434        /// Returns `None` if the enum contains an unknown value deserialized from
7435        /// the string representation of enums.
7436        pub fn value(&self) -> std::option::Option<i32> {
7437            match self {
7438                Self::Unspecified => std::option::Option::Some(0),
7439                Self::HierarchicalFirewallPolicyRule => std::option::Option::Some(1),
7440                Self::VpcFirewallRule => std::option::Option::Some(2),
7441                Self::ImpliedVpcFirewallRule => std::option::Option::Some(3),
7442                Self::ServerlessVpcAccessManagedFirewallRule => std::option::Option::Some(4),
7443                Self::NetworkFirewallPolicyRule => std::option::Option::Some(5),
7444                Self::NetworkRegionalFirewallPolicyRule => std::option::Option::Some(6),
7445                Self::SystemNetworkFirewallPolicyRule => std::option::Option::Some(7),
7446                Self::SystemRegionalNetworkFirewallPolicyRule => std::option::Option::Some(8),
7447                Self::UnsupportedFirewallPolicyRule => std::option::Option::Some(100),
7448                Self::TrackingState => std::option::Option::Some(101),
7449                Self::AnalysisSkipped => std::option::Option::Some(102),
7450                Self::UnknownValue(u) => u.0.value(),
7451            }
7452        }
7453
7454        /// Gets the enum value as a string.
7455        ///
7456        /// Returns `None` if the enum contains an unknown value deserialized from
7457        /// the integer representation of enums.
7458        pub fn name(&self) -> std::option::Option<&str> {
7459            match self {
7460                Self::Unspecified => std::option::Option::Some("FIREWALL_RULE_TYPE_UNSPECIFIED"),
7461                Self::HierarchicalFirewallPolicyRule => {
7462                    std::option::Option::Some("HIERARCHICAL_FIREWALL_POLICY_RULE")
7463                }
7464                Self::VpcFirewallRule => std::option::Option::Some("VPC_FIREWALL_RULE"),
7465                Self::ImpliedVpcFirewallRule => {
7466                    std::option::Option::Some("IMPLIED_VPC_FIREWALL_RULE")
7467                }
7468                Self::ServerlessVpcAccessManagedFirewallRule => {
7469                    std::option::Option::Some("SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE")
7470                }
7471                Self::NetworkFirewallPolicyRule => {
7472                    std::option::Option::Some("NETWORK_FIREWALL_POLICY_RULE")
7473                }
7474                Self::NetworkRegionalFirewallPolicyRule => {
7475                    std::option::Option::Some("NETWORK_REGIONAL_FIREWALL_POLICY_RULE")
7476                }
7477                Self::SystemNetworkFirewallPolicyRule => {
7478                    std::option::Option::Some("SYSTEM_NETWORK_FIREWALL_POLICY_RULE")
7479                }
7480                Self::SystemRegionalNetworkFirewallPolicyRule => {
7481                    std::option::Option::Some("SYSTEM_REGIONAL_NETWORK_FIREWALL_POLICY_RULE")
7482                }
7483                Self::UnsupportedFirewallPolicyRule => {
7484                    std::option::Option::Some("UNSUPPORTED_FIREWALL_POLICY_RULE")
7485                }
7486                Self::TrackingState => std::option::Option::Some("TRACKING_STATE"),
7487                Self::AnalysisSkipped => std::option::Option::Some("ANALYSIS_SKIPPED"),
7488                Self::UnknownValue(u) => u.0.name(),
7489            }
7490        }
7491    }
7492
7493    impl std::default::Default for FirewallRuleType {
7494        fn default() -> Self {
7495            use std::convert::From;
7496            Self::from(0)
7497        }
7498    }
7499
7500    impl std::fmt::Display for FirewallRuleType {
7501        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7502            wkt::internal::display_enum(f, self.name(), self.value())
7503        }
7504    }
7505
7506    impl std::convert::From<i32> for FirewallRuleType {
7507        fn from(value: i32) -> Self {
7508            match value {
7509                0 => Self::Unspecified,
7510                1 => Self::HierarchicalFirewallPolicyRule,
7511                2 => Self::VpcFirewallRule,
7512                3 => Self::ImpliedVpcFirewallRule,
7513                4 => Self::ServerlessVpcAccessManagedFirewallRule,
7514                5 => Self::NetworkFirewallPolicyRule,
7515                6 => Self::NetworkRegionalFirewallPolicyRule,
7516                7 => Self::SystemNetworkFirewallPolicyRule,
7517                8 => Self::SystemRegionalNetworkFirewallPolicyRule,
7518                100 => Self::UnsupportedFirewallPolicyRule,
7519                101 => Self::TrackingState,
7520                102 => Self::AnalysisSkipped,
7521                _ => Self::UnknownValue(firewall_rule_type::UnknownValue(
7522                    wkt::internal::UnknownEnumValue::Integer(value),
7523                )),
7524            }
7525        }
7526    }
7527
7528    impl std::convert::From<&str> for FirewallRuleType {
7529        fn from(value: &str) -> Self {
7530            use std::string::ToString;
7531            match value {
7532                "FIREWALL_RULE_TYPE_UNSPECIFIED" => Self::Unspecified,
7533                "HIERARCHICAL_FIREWALL_POLICY_RULE" => Self::HierarchicalFirewallPolicyRule,
7534                "VPC_FIREWALL_RULE" => Self::VpcFirewallRule,
7535                "IMPLIED_VPC_FIREWALL_RULE" => Self::ImpliedVpcFirewallRule,
7536                "SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE" => {
7537                    Self::ServerlessVpcAccessManagedFirewallRule
7538                }
7539                "NETWORK_FIREWALL_POLICY_RULE" => Self::NetworkFirewallPolicyRule,
7540                "NETWORK_REGIONAL_FIREWALL_POLICY_RULE" => Self::NetworkRegionalFirewallPolicyRule,
7541                "SYSTEM_NETWORK_FIREWALL_POLICY_RULE" => Self::SystemNetworkFirewallPolicyRule,
7542                "SYSTEM_REGIONAL_NETWORK_FIREWALL_POLICY_RULE" => {
7543                    Self::SystemRegionalNetworkFirewallPolicyRule
7544                }
7545                "UNSUPPORTED_FIREWALL_POLICY_RULE" => Self::UnsupportedFirewallPolicyRule,
7546                "TRACKING_STATE" => Self::TrackingState,
7547                "ANALYSIS_SKIPPED" => Self::AnalysisSkipped,
7548                _ => Self::UnknownValue(firewall_rule_type::UnknownValue(
7549                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7550                )),
7551            }
7552        }
7553    }
7554
7555    impl serde::ser::Serialize for FirewallRuleType {
7556        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7557        where
7558            S: serde::Serializer,
7559        {
7560            match self {
7561                Self::Unspecified => serializer.serialize_i32(0),
7562                Self::HierarchicalFirewallPolicyRule => serializer.serialize_i32(1),
7563                Self::VpcFirewallRule => serializer.serialize_i32(2),
7564                Self::ImpliedVpcFirewallRule => serializer.serialize_i32(3),
7565                Self::ServerlessVpcAccessManagedFirewallRule => serializer.serialize_i32(4),
7566                Self::NetworkFirewallPolicyRule => serializer.serialize_i32(5),
7567                Self::NetworkRegionalFirewallPolicyRule => serializer.serialize_i32(6),
7568                Self::SystemNetworkFirewallPolicyRule => serializer.serialize_i32(7),
7569                Self::SystemRegionalNetworkFirewallPolicyRule => serializer.serialize_i32(8),
7570                Self::UnsupportedFirewallPolicyRule => serializer.serialize_i32(100),
7571                Self::TrackingState => serializer.serialize_i32(101),
7572                Self::AnalysisSkipped => serializer.serialize_i32(102),
7573                Self::UnknownValue(u) => u.0.serialize(serializer),
7574            }
7575        }
7576    }
7577
7578    impl<'de> serde::de::Deserialize<'de> for FirewallRuleType {
7579        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7580        where
7581            D: serde::Deserializer<'de>,
7582        {
7583            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FirewallRuleType>::new(
7584                ".google.cloud.networkmanagement.v1.FirewallInfo.FirewallRuleType",
7585            ))
7586        }
7587    }
7588
7589    /// Target type of the firewall rule.
7590    ///
7591    /// # Working with unknown values
7592    ///
7593    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7594    /// additional enum variants at any time. Adding new variants is not considered
7595    /// a breaking change. Applications should write their code in anticipation of:
7596    ///
7597    /// - New values appearing in future releases of the client library, **and**
7598    /// - New values received dynamically, without application changes.
7599    ///
7600    /// Please consult the [Working with enums] section in the user guide for some
7601    /// guidelines.
7602    ///
7603    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7604    #[derive(Clone, Debug, PartialEq)]
7605    #[non_exhaustive]
7606    pub enum TargetType {
7607        /// Target type is not specified. In this case we treat the rule as applying
7608        /// to INSTANCES target type.
7609        Unspecified,
7610        /// Firewall rule applies to instances.
7611        Instances,
7612        /// Firewall rule applies to internal managed load balancers.
7613        InternalManagedLb,
7614        /// If set, the enum was initialized with an unknown value.
7615        ///
7616        /// Applications can examine the value using [TargetType::value] or
7617        /// [TargetType::name].
7618        UnknownValue(target_type::UnknownValue),
7619    }
7620
7621    #[doc(hidden)]
7622    pub mod target_type {
7623        #[allow(unused_imports)]
7624        use super::*;
7625        #[derive(Clone, Debug, PartialEq)]
7626        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7627    }
7628
7629    impl TargetType {
7630        /// Gets the enum value.
7631        ///
7632        /// Returns `None` if the enum contains an unknown value deserialized from
7633        /// the string representation of enums.
7634        pub fn value(&self) -> std::option::Option<i32> {
7635            match self {
7636                Self::Unspecified => std::option::Option::Some(0),
7637                Self::Instances => std::option::Option::Some(1),
7638                Self::InternalManagedLb => std::option::Option::Some(2),
7639                Self::UnknownValue(u) => u.0.value(),
7640            }
7641        }
7642
7643        /// Gets the enum value as a string.
7644        ///
7645        /// Returns `None` if the enum contains an unknown value deserialized from
7646        /// the integer representation of enums.
7647        pub fn name(&self) -> std::option::Option<&str> {
7648            match self {
7649                Self::Unspecified => std::option::Option::Some("TARGET_TYPE_UNSPECIFIED"),
7650                Self::Instances => std::option::Option::Some("INSTANCES"),
7651                Self::InternalManagedLb => std::option::Option::Some("INTERNAL_MANAGED_LB"),
7652                Self::UnknownValue(u) => u.0.name(),
7653            }
7654        }
7655    }
7656
7657    impl std::default::Default for TargetType {
7658        fn default() -> Self {
7659            use std::convert::From;
7660            Self::from(0)
7661        }
7662    }
7663
7664    impl std::fmt::Display for TargetType {
7665        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7666            wkt::internal::display_enum(f, self.name(), self.value())
7667        }
7668    }
7669
7670    impl std::convert::From<i32> for TargetType {
7671        fn from(value: i32) -> Self {
7672            match value {
7673                0 => Self::Unspecified,
7674                1 => Self::Instances,
7675                2 => Self::InternalManagedLb,
7676                _ => Self::UnknownValue(target_type::UnknownValue(
7677                    wkt::internal::UnknownEnumValue::Integer(value),
7678                )),
7679            }
7680        }
7681    }
7682
7683    impl std::convert::From<&str> for TargetType {
7684        fn from(value: &str) -> Self {
7685            use std::string::ToString;
7686            match value {
7687                "TARGET_TYPE_UNSPECIFIED" => Self::Unspecified,
7688                "INSTANCES" => Self::Instances,
7689                "INTERNAL_MANAGED_LB" => Self::InternalManagedLb,
7690                _ => Self::UnknownValue(target_type::UnknownValue(
7691                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7692                )),
7693            }
7694        }
7695    }
7696
7697    impl serde::ser::Serialize for TargetType {
7698        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7699        where
7700            S: serde::Serializer,
7701        {
7702            match self {
7703                Self::Unspecified => serializer.serialize_i32(0),
7704                Self::Instances => serializer.serialize_i32(1),
7705                Self::InternalManagedLb => serializer.serialize_i32(2),
7706                Self::UnknownValue(u) => u.0.serialize(serializer),
7707            }
7708        }
7709    }
7710
7711    impl<'de> serde::de::Deserialize<'de> for TargetType {
7712        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7713        where
7714            D: serde::Deserializer<'de>,
7715        {
7716            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetType>::new(
7717                ".google.cloud.networkmanagement.v1.FirewallInfo.TargetType",
7718            ))
7719        }
7720    }
7721}
7722
7723/// For display only. Metadata associated with a Compute Engine route.
7724#[derive(Clone, Default, PartialEq)]
7725#[non_exhaustive]
7726pub struct RouteInfo {
7727    /// Type of route.
7728    pub route_type: crate::model::route_info::RouteType,
7729
7730    /// Type of next hop.
7731    pub next_hop_type: crate::model::route_info::NextHopType,
7732
7733    /// Indicates where route is applicable. Deprecated, routes with NCC_HUB scope
7734    /// are not included in the trace in new tests.
7735    #[deprecated]
7736    pub route_scope: crate::model::route_info::RouteScope,
7737
7738    /// Name of a route.
7739    pub display_name: std::string::String,
7740
7741    /// URI of a route. SUBNET, STATIC, PEERING_SUBNET (only for peering network)
7742    /// and POLICY_BASED routes only.
7743    pub uri: std::string::String,
7744
7745    /// Region of the route. DYNAMIC, PEERING_DYNAMIC, POLICY_BASED and ADVERTISED
7746    /// routes only. If set for POLICY_BASED route, this is a region of VLAN
7747    /// attachments for Cloud Interconnect the route applies to.
7748    pub region: std::string::String,
7749
7750    /// Destination IP range of the route.
7751    pub dest_ip_range: std::string::String,
7752
7753    /// String type of the next hop of the route (for example, "VPN tunnel").
7754    /// Deprecated in favor of the next_hop_type and next_hop_uri fields, not used
7755    /// in new tests.
7756    #[deprecated]
7757    pub next_hop: std::string::String,
7758
7759    /// URI of a VPC network where route is located.
7760    pub network_uri: std::string::String,
7761
7762    /// Priority of the route.
7763    pub priority: i32,
7764
7765    /// Instance tags of the route.
7766    pub instance_tags: std::vec::Vec<std::string::String>,
7767
7768    /// Source IP address range of the route. POLICY_BASED routes only.
7769    pub src_ip_range: std::string::String,
7770
7771    /// Destination port ranges of the route. POLICY_BASED routes only.
7772    pub dest_port_ranges: std::vec::Vec<std::string::String>,
7773
7774    /// Source port ranges of the route. POLICY_BASED routes only.
7775    pub src_port_ranges: std::vec::Vec<std::string::String>,
7776
7777    /// Protocols of the route. POLICY_BASED routes only.
7778    pub protocols: std::vec::Vec<std::string::String>,
7779
7780    /// URI of the NCC Hub the route is advertised by. PEERING_SUBNET and
7781    /// PEERING_DYNAMIC routes that are advertised by NCC Hub only.
7782    pub ncc_hub_uri: std::option::Option<std::string::String>,
7783
7784    /// URI of the destination NCC Spoke. PEERING_SUBNET and PEERING_DYNAMIC routes
7785    /// that are advertised by NCC Hub only.
7786    pub ncc_spoke_uri: std::option::Option<std::string::String>,
7787
7788    /// For ADVERTISED dynamic routes, the URI of the Cloud Router that advertised
7789    /// the corresponding IP prefix.
7790    pub advertised_route_source_router_uri: std::option::Option<std::string::String>,
7791
7792    /// For ADVERTISED routes, the URI of their next hop, i.e. the URI of the
7793    /// hybrid endpoint (VPN tunnel, Interconnect attachment, NCC router appliance)
7794    /// the advertised prefix is advertised through, or URI of the source peered
7795    /// network. Deprecated in favor of the next_hop_uri field, not used in new
7796    /// tests.
7797    #[deprecated]
7798    pub advertised_route_next_hop_uri: std::option::Option<std::string::String>,
7799
7800    /// URI of the next hop resource.
7801    pub next_hop_uri: std::string::String,
7802
7803    /// URI of a VPC network where the next hop resource is located.
7804    pub next_hop_network_uri: std::string::String,
7805
7806    /// For PEERING_SUBNET and PEERING_STATIC routes, the URI of the originating
7807    /// SUBNET/STATIC route.
7808    pub originating_route_uri: std::string::String,
7809
7810    /// For PEERING_SUBNET, PEERING_STATIC and PEERING_DYNAMIC routes, the name of
7811    /// the originating SUBNET/STATIC/DYNAMIC route.
7812    pub originating_route_display_name: std::string::String,
7813
7814    /// For PEERING_SUBNET and PEERING_DYNAMIC routes that are advertised by NCC
7815    /// Hub, the URI of the corresponding route in NCC Hub's routing table.
7816    pub ncc_hub_route_uri: std::string::String,
7817
7818    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7819}
7820
7821impl RouteInfo {
7822    pub fn new() -> Self {
7823        std::default::Default::default()
7824    }
7825
7826    /// Sets the value of [route_type][crate::model::RouteInfo::route_type].
7827    ///
7828    /// # Example
7829    /// ```ignore,no_run
7830    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7831    /// use google_cloud_networkmanagement_v1::model::route_info::RouteType;
7832    /// let x0 = RouteInfo::new().set_route_type(RouteType::Subnet);
7833    /// let x1 = RouteInfo::new().set_route_type(RouteType::Static);
7834    /// let x2 = RouteInfo::new().set_route_type(RouteType::Dynamic);
7835    /// ```
7836    pub fn set_route_type<T: std::convert::Into<crate::model::route_info::RouteType>>(
7837        mut self,
7838        v: T,
7839    ) -> Self {
7840        self.route_type = v.into();
7841        self
7842    }
7843
7844    /// Sets the value of [next_hop_type][crate::model::RouteInfo::next_hop_type].
7845    ///
7846    /// # Example
7847    /// ```ignore,no_run
7848    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7849    /// use google_cloud_networkmanagement_v1::model::route_info::NextHopType;
7850    /// let x0 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopIp);
7851    /// let x1 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopInstance);
7852    /// let x2 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopNetwork);
7853    /// ```
7854    pub fn set_next_hop_type<T: std::convert::Into<crate::model::route_info::NextHopType>>(
7855        mut self,
7856        v: T,
7857    ) -> Self {
7858        self.next_hop_type = v.into();
7859        self
7860    }
7861
7862    /// Sets the value of [route_scope][crate::model::RouteInfo::route_scope].
7863    ///
7864    /// # Example
7865    /// ```ignore,no_run
7866    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7867    /// use google_cloud_networkmanagement_v1::model::route_info::RouteScope;
7868    /// let x0 = RouteInfo::new().set_route_scope(RouteScope::Network);
7869    /// let x1 = RouteInfo::new().set_route_scope(RouteScope::NccHub);
7870    /// ```
7871    #[deprecated]
7872    pub fn set_route_scope<T: std::convert::Into<crate::model::route_info::RouteScope>>(
7873        mut self,
7874        v: T,
7875    ) -> Self {
7876        self.route_scope = v.into();
7877        self
7878    }
7879
7880    /// Sets the value of [display_name][crate::model::RouteInfo::display_name].
7881    ///
7882    /// # Example
7883    /// ```ignore,no_run
7884    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7885    /// let x = RouteInfo::new().set_display_name("example");
7886    /// ```
7887    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7888        self.display_name = v.into();
7889        self
7890    }
7891
7892    /// Sets the value of [uri][crate::model::RouteInfo::uri].
7893    ///
7894    /// # Example
7895    /// ```ignore,no_run
7896    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7897    /// let x = RouteInfo::new().set_uri("example");
7898    /// ```
7899    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7900        self.uri = v.into();
7901        self
7902    }
7903
7904    /// Sets the value of [region][crate::model::RouteInfo::region].
7905    ///
7906    /// # Example
7907    /// ```ignore,no_run
7908    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7909    /// let x = RouteInfo::new().set_region("example");
7910    /// ```
7911    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7912        self.region = v.into();
7913        self
7914    }
7915
7916    /// Sets the value of [dest_ip_range][crate::model::RouteInfo::dest_ip_range].
7917    ///
7918    /// # Example
7919    /// ```ignore,no_run
7920    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7921    /// let x = RouteInfo::new().set_dest_ip_range("example");
7922    /// ```
7923    pub fn set_dest_ip_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7924        self.dest_ip_range = v.into();
7925        self
7926    }
7927
7928    /// Sets the value of [next_hop][crate::model::RouteInfo::next_hop].
7929    ///
7930    /// # Example
7931    /// ```ignore,no_run
7932    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7933    /// let x = RouteInfo::new().set_next_hop("example");
7934    /// ```
7935    #[deprecated]
7936    pub fn set_next_hop<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7937        self.next_hop = v.into();
7938        self
7939    }
7940
7941    /// Sets the value of [network_uri][crate::model::RouteInfo::network_uri].
7942    ///
7943    /// # Example
7944    /// ```ignore,no_run
7945    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7946    /// let x = RouteInfo::new().set_network_uri("example");
7947    /// ```
7948    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7949        self.network_uri = v.into();
7950        self
7951    }
7952
7953    /// Sets the value of [priority][crate::model::RouteInfo::priority].
7954    ///
7955    /// # Example
7956    /// ```ignore,no_run
7957    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7958    /// let x = RouteInfo::new().set_priority(42);
7959    /// ```
7960    pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7961        self.priority = v.into();
7962        self
7963    }
7964
7965    /// Sets the value of [instance_tags][crate::model::RouteInfo::instance_tags].
7966    ///
7967    /// # Example
7968    /// ```ignore,no_run
7969    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7970    /// let x = RouteInfo::new().set_instance_tags(["a", "b", "c"]);
7971    /// ```
7972    pub fn set_instance_tags<T, V>(mut self, v: T) -> Self
7973    where
7974        T: std::iter::IntoIterator<Item = V>,
7975        V: std::convert::Into<std::string::String>,
7976    {
7977        use std::iter::Iterator;
7978        self.instance_tags = v.into_iter().map(|i| i.into()).collect();
7979        self
7980    }
7981
7982    /// Sets the value of [src_ip_range][crate::model::RouteInfo::src_ip_range].
7983    ///
7984    /// # Example
7985    /// ```ignore,no_run
7986    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7987    /// let x = RouteInfo::new().set_src_ip_range("example");
7988    /// ```
7989    pub fn set_src_ip_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7990        self.src_ip_range = v.into();
7991        self
7992    }
7993
7994    /// Sets the value of [dest_port_ranges][crate::model::RouteInfo::dest_port_ranges].
7995    ///
7996    /// # Example
7997    /// ```ignore,no_run
7998    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7999    /// let x = RouteInfo::new().set_dest_port_ranges(["a", "b", "c"]);
8000    /// ```
8001    pub fn set_dest_port_ranges<T, V>(mut self, v: T) -> Self
8002    where
8003        T: std::iter::IntoIterator<Item = V>,
8004        V: std::convert::Into<std::string::String>,
8005    {
8006        use std::iter::Iterator;
8007        self.dest_port_ranges = v.into_iter().map(|i| i.into()).collect();
8008        self
8009    }
8010
8011    /// Sets the value of [src_port_ranges][crate::model::RouteInfo::src_port_ranges].
8012    ///
8013    /// # Example
8014    /// ```ignore,no_run
8015    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8016    /// let x = RouteInfo::new().set_src_port_ranges(["a", "b", "c"]);
8017    /// ```
8018    pub fn set_src_port_ranges<T, V>(mut self, v: T) -> Self
8019    where
8020        T: std::iter::IntoIterator<Item = V>,
8021        V: std::convert::Into<std::string::String>,
8022    {
8023        use std::iter::Iterator;
8024        self.src_port_ranges = v.into_iter().map(|i| i.into()).collect();
8025        self
8026    }
8027
8028    /// Sets the value of [protocols][crate::model::RouteInfo::protocols].
8029    ///
8030    /// # Example
8031    /// ```ignore,no_run
8032    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8033    /// let x = RouteInfo::new().set_protocols(["a", "b", "c"]);
8034    /// ```
8035    pub fn set_protocols<T, V>(mut self, v: T) -> Self
8036    where
8037        T: std::iter::IntoIterator<Item = V>,
8038        V: std::convert::Into<std::string::String>,
8039    {
8040        use std::iter::Iterator;
8041        self.protocols = v.into_iter().map(|i| i.into()).collect();
8042        self
8043    }
8044
8045    /// Sets the value of [ncc_hub_uri][crate::model::RouteInfo::ncc_hub_uri].
8046    ///
8047    /// # Example
8048    /// ```ignore,no_run
8049    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8050    /// let x = RouteInfo::new().set_ncc_hub_uri("example");
8051    /// ```
8052    pub fn set_ncc_hub_uri<T>(mut self, v: T) -> Self
8053    where
8054        T: std::convert::Into<std::string::String>,
8055    {
8056        self.ncc_hub_uri = std::option::Option::Some(v.into());
8057        self
8058    }
8059
8060    /// Sets or clears the value of [ncc_hub_uri][crate::model::RouteInfo::ncc_hub_uri].
8061    ///
8062    /// # Example
8063    /// ```ignore,no_run
8064    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8065    /// let x = RouteInfo::new().set_or_clear_ncc_hub_uri(Some("example"));
8066    /// let x = RouteInfo::new().set_or_clear_ncc_hub_uri(None::<String>);
8067    /// ```
8068    pub fn set_or_clear_ncc_hub_uri<T>(mut self, v: std::option::Option<T>) -> Self
8069    where
8070        T: std::convert::Into<std::string::String>,
8071    {
8072        self.ncc_hub_uri = v.map(|x| x.into());
8073        self
8074    }
8075
8076    /// Sets the value of [ncc_spoke_uri][crate::model::RouteInfo::ncc_spoke_uri].
8077    ///
8078    /// # Example
8079    /// ```ignore,no_run
8080    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8081    /// let x = RouteInfo::new().set_ncc_spoke_uri("example");
8082    /// ```
8083    pub fn set_ncc_spoke_uri<T>(mut self, v: T) -> Self
8084    where
8085        T: std::convert::Into<std::string::String>,
8086    {
8087        self.ncc_spoke_uri = std::option::Option::Some(v.into());
8088        self
8089    }
8090
8091    /// Sets or clears the value of [ncc_spoke_uri][crate::model::RouteInfo::ncc_spoke_uri].
8092    ///
8093    /// # Example
8094    /// ```ignore,no_run
8095    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8096    /// let x = RouteInfo::new().set_or_clear_ncc_spoke_uri(Some("example"));
8097    /// let x = RouteInfo::new().set_or_clear_ncc_spoke_uri(None::<String>);
8098    /// ```
8099    pub fn set_or_clear_ncc_spoke_uri<T>(mut self, v: std::option::Option<T>) -> Self
8100    where
8101        T: std::convert::Into<std::string::String>,
8102    {
8103        self.ncc_spoke_uri = v.map(|x| x.into());
8104        self
8105    }
8106
8107    /// Sets the value of [advertised_route_source_router_uri][crate::model::RouteInfo::advertised_route_source_router_uri].
8108    ///
8109    /// # Example
8110    /// ```ignore,no_run
8111    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8112    /// let x = RouteInfo::new().set_advertised_route_source_router_uri("example");
8113    /// ```
8114    pub fn set_advertised_route_source_router_uri<T>(mut self, v: T) -> Self
8115    where
8116        T: std::convert::Into<std::string::String>,
8117    {
8118        self.advertised_route_source_router_uri = std::option::Option::Some(v.into());
8119        self
8120    }
8121
8122    /// Sets or clears the value of [advertised_route_source_router_uri][crate::model::RouteInfo::advertised_route_source_router_uri].
8123    ///
8124    /// # Example
8125    /// ```ignore,no_run
8126    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8127    /// let x = RouteInfo::new().set_or_clear_advertised_route_source_router_uri(Some("example"));
8128    /// let x = RouteInfo::new().set_or_clear_advertised_route_source_router_uri(None::<String>);
8129    /// ```
8130    pub fn set_or_clear_advertised_route_source_router_uri<T>(
8131        mut self,
8132        v: std::option::Option<T>,
8133    ) -> Self
8134    where
8135        T: std::convert::Into<std::string::String>,
8136    {
8137        self.advertised_route_source_router_uri = v.map(|x| x.into());
8138        self
8139    }
8140
8141    /// Sets the value of [advertised_route_next_hop_uri][crate::model::RouteInfo::advertised_route_next_hop_uri].
8142    ///
8143    /// # Example
8144    /// ```ignore,no_run
8145    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8146    /// let x = RouteInfo::new().set_advertised_route_next_hop_uri("example");
8147    /// ```
8148    #[deprecated]
8149    pub fn set_advertised_route_next_hop_uri<T>(mut self, v: T) -> Self
8150    where
8151        T: std::convert::Into<std::string::String>,
8152    {
8153        self.advertised_route_next_hop_uri = std::option::Option::Some(v.into());
8154        self
8155    }
8156
8157    /// Sets or clears the value of [advertised_route_next_hop_uri][crate::model::RouteInfo::advertised_route_next_hop_uri].
8158    ///
8159    /// # Example
8160    /// ```ignore,no_run
8161    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8162    /// let x = RouteInfo::new().set_or_clear_advertised_route_next_hop_uri(Some("example"));
8163    /// let x = RouteInfo::new().set_or_clear_advertised_route_next_hop_uri(None::<String>);
8164    /// ```
8165    #[deprecated]
8166    pub fn set_or_clear_advertised_route_next_hop_uri<T>(
8167        mut self,
8168        v: std::option::Option<T>,
8169    ) -> Self
8170    where
8171        T: std::convert::Into<std::string::String>,
8172    {
8173        self.advertised_route_next_hop_uri = v.map(|x| x.into());
8174        self
8175    }
8176
8177    /// Sets the value of [next_hop_uri][crate::model::RouteInfo::next_hop_uri].
8178    ///
8179    /// # Example
8180    /// ```ignore,no_run
8181    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8182    /// let x = RouteInfo::new().set_next_hop_uri("example");
8183    /// ```
8184    pub fn set_next_hop_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8185        self.next_hop_uri = v.into();
8186        self
8187    }
8188
8189    /// Sets the value of [next_hop_network_uri][crate::model::RouteInfo::next_hop_network_uri].
8190    ///
8191    /// # Example
8192    /// ```ignore,no_run
8193    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8194    /// let x = RouteInfo::new().set_next_hop_network_uri("example");
8195    /// ```
8196    pub fn set_next_hop_network_uri<T: std::convert::Into<std::string::String>>(
8197        mut self,
8198        v: T,
8199    ) -> Self {
8200        self.next_hop_network_uri = v.into();
8201        self
8202    }
8203
8204    /// Sets the value of [originating_route_uri][crate::model::RouteInfo::originating_route_uri].
8205    ///
8206    /// # Example
8207    /// ```ignore,no_run
8208    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8209    /// let x = RouteInfo::new().set_originating_route_uri("example");
8210    /// ```
8211    pub fn set_originating_route_uri<T: std::convert::Into<std::string::String>>(
8212        mut self,
8213        v: T,
8214    ) -> Self {
8215        self.originating_route_uri = v.into();
8216        self
8217    }
8218
8219    /// Sets the value of [originating_route_display_name][crate::model::RouteInfo::originating_route_display_name].
8220    ///
8221    /// # Example
8222    /// ```ignore,no_run
8223    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8224    /// let x = RouteInfo::new().set_originating_route_display_name("example");
8225    /// ```
8226    pub fn set_originating_route_display_name<T: std::convert::Into<std::string::String>>(
8227        mut self,
8228        v: T,
8229    ) -> Self {
8230        self.originating_route_display_name = v.into();
8231        self
8232    }
8233
8234    /// Sets the value of [ncc_hub_route_uri][crate::model::RouteInfo::ncc_hub_route_uri].
8235    ///
8236    /// # Example
8237    /// ```ignore,no_run
8238    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8239    /// let x = RouteInfo::new().set_ncc_hub_route_uri("example");
8240    /// ```
8241    pub fn set_ncc_hub_route_uri<T: std::convert::Into<std::string::String>>(
8242        mut self,
8243        v: T,
8244    ) -> Self {
8245        self.ncc_hub_route_uri = v.into();
8246        self
8247    }
8248}
8249
8250impl wkt::message::Message for RouteInfo {
8251    fn typename() -> &'static str {
8252        "type.googleapis.com/google.cloud.networkmanagement.v1.RouteInfo"
8253    }
8254}
8255
8256/// Defines additional types related to [RouteInfo].
8257pub mod route_info {
8258    #[allow(unused_imports)]
8259    use super::*;
8260
8261    /// Type of route:
8262    ///
8263    /// # Working with unknown values
8264    ///
8265    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8266    /// additional enum variants at any time. Adding new variants is not considered
8267    /// a breaking change. Applications should write their code in anticipation of:
8268    ///
8269    /// - New values appearing in future releases of the client library, **and**
8270    /// - New values received dynamically, without application changes.
8271    ///
8272    /// Please consult the [Working with enums] section in the user guide for some
8273    /// guidelines.
8274    ///
8275    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8276    #[derive(Clone, Debug, PartialEq)]
8277    #[non_exhaustive]
8278    pub enum RouteType {
8279        /// Unspecified type. Default value.
8280        Unspecified,
8281        /// Route is a subnet route automatically created by the system.
8282        Subnet,
8283        /// Static route created by the user, including the default route to the
8284        /// internet.
8285        Static,
8286        /// Dynamic route exchanged between BGP peers.
8287        Dynamic,
8288        /// A subnet route received from peering network or NCC Hub.
8289        PeeringSubnet,
8290        /// A static route received from peering network.
8291        PeeringStatic,
8292        /// A dynamic route received from peering network or NCC Hub.
8293        PeeringDynamic,
8294        /// Policy based route.
8295        PolicyBased,
8296        /// Advertised route. Synthetic route which is used to transition from the
8297        /// StartFromPrivateNetwork state in Connectivity tests.
8298        Advertised,
8299        /// If set, the enum was initialized with an unknown value.
8300        ///
8301        /// Applications can examine the value using [RouteType::value] or
8302        /// [RouteType::name].
8303        UnknownValue(route_type::UnknownValue),
8304    }
8305
8306    #[doc(hidden)]
8307    pub mod route_type {
8308        #[allow(unused_imports)]
8309        use super::*;
8310        #[derive(Clone, Debug, PartialEq)]
8311        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8312    }
8313
8314    impl RouteType {
8315        /// Gets the enum value.
8316        ///
8317        /// Returns `None` if the enum contains an unknown value deserialized from
8318        /// the string representation of enums.
8319        pub fn value(&self) -> std::option::Option<i32> {
8320            match self {
8321                Self::Unspecified => std::option::Option::Some(0),
8322                Self::Subnet => std::option::Option::Some(1),
8323                Self::Static => std::option::Option::Some(2),
8324                Self::Dynamic => std::option::Option::Some(3),
8325                Self::PeeringSubnet => std::option::Option::Some(4),
8326                Self::PeeringStatic => std::option::Option::Some(5),
8327                Self::PeeringDynamic => std::option::Option::Some(6),
8328                Self::PolicyBased => std::option::Option::Some(7),
8329                Self::Advertised => std::option::Option::Some(101),
8330                Self::UnknownValue(u) => u.0.value(),
8331            }
8332        }
8333
8334        /// Gets the enum value as a string.
8335        ///
8336        /// Returns `None` if the enum contains an unknown value deserialized from
8337        /// the integer representation of enums.
8338        pub fn name(&self) -> std::option::Option<&str> {
8339            match self {
8340                Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
8341                Self::Subnet => std::option::Option::Some("SUBNET"),
8342                Self::Static => std::option::Option::Some("STATIC"),
8343                Self::Dynamic => std::option::Option::Some("DYNAMIC"),
8344                Self::PeeringSubnet => std::option::Option::Some("PEERING_SUBNET"),
8345                Self::PeeringStatic => std::option::Option::Some("PEERING_STATIC"),
8346                Self::PeeringDynamic => std::option::Option::Some("PEERING_DYNAMIC"),
8347                Self::PolicyBased => std::option::Option::Some("POLICY_BASED"),
8348                Self::Advertised => std::option::Option::Some("ADVERTISED"),
8349                Self::UnknownValue(u) => u.0.name(),
8350            }
8351        }
8352    }
8353
8354    impl std::default::Default for RouteType {
8355        fn default() -> Self {
8356            use std::convert::From;
8357            Self::from(0)
8358        }
8359    }
8360
8361    impl std::fmt::Display for RouteType {
8362        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8363            wkt::internal::display_enum(f, self.name(), self.value())
8364        }
8365    }
8366
8367    impl std::convert::From<i32> for RouteType {
8368        fn from(value: i32) -> Self {
8369            match value {
8370                0 => Self::Unspecified,
8371                1 => Self::Subnet,
8372                2 => Self::Static,
8373                3 => Self::Dynamic,
8374                4 => Self::PeeringSubnet,
8375                5 => Self::PeeringStatic,
8376                6 => Self::PeeringDynamic,
8377                7 => Self::PolicyBased,
8378                101 => Self::Advertised,
8379                _ => Self::UnknownValue(route_type::UnknownValue(
8380                    wkt::internal::UnknownEnumValue::Integer(value),
8381                )),
8382            }
8383        }
8384    }
8385
8386    impl std::convert::From<&str> for RouteType {
8387        fn from(value: &str) -> Self {
8388            use std::string::ToString;
8389            match value {
8390                "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
8391                "SUBNET" => Self::Subnet,
8392                "STATIC" => Self::Static,
8393                "DYNAMIC" => Self::Dynamic,
8394                "PEERING_SUBNET" => Self::PeeringSubnet,
8395                "PEERING_STATIC" => Self::PeeringStatic,
8396                "PEERING_DYNAMIC" => Self::PeeringDynamic,
8397                "POLICY_BASED" => Self::PolicyBased,
8398                "ADVERTISED" => Self::Advertised,
8399                _ => Self::UnknownValue(route_type::UnknownValue(
8400                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8401                )),
8402            }
8403        }
8404    }
8405
8406    impl serde::ser::Serialize for RouteType {
8407        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8408        where
8409            S: serde::Serializer,
8410        {
8411            match self {
8412                Self::Unspecified => serializer.serialize_i32(0),
8413                Self::Subnet => serializer.serialize_i32(1),
8414                Self::Static => serializer.serialize_i32(2),
8415                Self::Dynamic => serializer.serialize_i32(3),
8416                Self::PeeringSubnet => serializer.serialize_i32(4),
8417                Self::PeeringStatic => serializer.serialize_i32(5),
8418                Self::PeeringDynamic => serializer.serialize_i32(6),
8419                Self::PolicyBased => serializer.serialize_i32(7),
8420                Self::Advertised => serializer.serialize_i32(101),
8421                Self::UnknownValue(u) => u.0.serialize(serializer),
8422            }
8423        }
8424    }
8425
8426    impl<'de> serde::de::Deserialize<'de> for RouteType {
8427        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8428        where
8429            D: serde::Deserializer<'de>,
8430        {
8431            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
8432                ".google.cloud.networkmanagement.v1.RouteInfo.RouteType",
8433            ))
8434        }
8435    }
8436
8437    /// Type of next hop:
8438    ///
8439    /// # Working with unknown values
8440    ///
8441    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8442    /// additional enum variants at any time. Adding new variants is not considered
8443    /// a breaking change. Applications should write their code in anticipation of:
8444    ///
8445    /// - New values appearing in future releases of the client library, **and**
8446    /// - New values received dynamically, without application changes.
8447    ///
8448    /// Please consult the [Working with enums] section in the user guide for some
8449    /// guidelines.
8450    ///
8451    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8452    #[derive(Clone, Debug, PartialEq)]
8453    #[non_exhaustive]
8454    pub enum NextHopType {
8455        /// Unspecified type. Default value.
8456        Unspecified,
8457        /// Next hop is an IP address.
8458        NextHopIp,
8459        /// Next hop is a Compute Engine instance.
8460        NextHopInstance,
8461        /// Next hop is a VPC network gateway.
8462        NextHopNetwork,
8463        /// Next hop is a peering VPC. This scenario only happens when the user
8464        /// doesn't have permissions to the project where the next hop resource is
8465        /// located.
8466        NextHopPeering,
8467        /// Next hop is an interconnect.
8468        NextHopInterconnect,
8469        /// Next hop is a VPN tunnel.
8470        NextHopVpnTunnel,
8471        /// Next hop is a VPN gateway. This scenario only happens when tracing
8472        /// connectivity from an on-premises network to Google Cloud through a VPN.
8473        /// The analysis simulates a packet departing from the on-premises network
8474        /// through a VPN tunnel and arriving at a Cloud VPN gateway.
8475        NextHopVpnGateway,
8476        /// Next hop is an internet gateway.
8477        NextHopInternetGateway,
8478        /// Next hop is blackhole; that is, the next hop either does not exist or is
8479        /// unusable.
8480        NextHopBlackhole,
8481        /// Next hop is the forwarding rule of an Internal Load Balancer.
8482        NextHopIlb,
8483        /// Next hop is a
8484        /// [router appliance
8485        /// instance](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/ra-overview).
8486        NextHopRouterAppliance,
8487        /// Next hop is an NCC hub. This scenario only happens when the user doesn't
8488        /// have permissions to the project where the next hop resource is located.
8489        NextHopNccHub,
8490        /// Next hop is Secure Web Proxy Gateway.
8491        SecureWebProxyGateway,
8492        /// If set, the enum was initialized with an unknown value.
8493        ///
8494        /// Applications can examine the value using [NextHopType::value] or
8495        /// [NextHopType::name].
8496        UnknownValue(next_hop_type::UnknownValue),
8497    }
8498
8499    #[doc(hidden)]
8500    pub mod next_hop_type {
8501        #[allow(unused_imports)]
8502        use super::*;
8503        #[derive(Clone, Debug, PartialEq)]
8504        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8505    }
8506
8507    impl NextHopType {
8508        /// Gets the enum value.
8509        ///
8510        /// Returns `None` if the enum contains an unknown value deserialized from
8511        /// the string representation of enums.
8512        pub fn value(&self) -> std::option::Option<i32> {
8513            match self {
8514                Self::Unspecified => std::option::Option::Some(0),
8515                Self::NextHopIp => std::option::Option::Some(1),
8516                Self::NextHopInstance => std::option::Option::Some(2),
8517                Self::NextHopNetwork => std::option::Option::Some(3),
8518                Self::NextHopPeering => std::option::Option::Some(4),
8519                Self::NextHopInterconnect => std::option::Option::Some(5),
8520                Self::NextHopVpnTunnel => std::option::Option::Some(6),
8521                Self::NextHopVpnGateway => std::option::Option::Some(7),
8522                Self::NextHopInternetGateway => std::option::Option::Some(8),
8523                Self::NextHopBlackhole => std::option::Option::Some(9),
8524                Self::NextHopIlb => std::option::Option::Some(10),
8525                Self::NextHopRouterAppliance => std::option::Option::Some(11),
8526                Self::NextHopNccHub => std::option::Option::Some(12),
8527                Self::SecureWebProxyGateway => std::option::Option::Some(13),
8528                Self::UnknownValue(u) => u.0.value(),
8529            }
8530        }
8531
8532        /// Gets the enum value as a string.
8533        ///
8534        /// Returns `None` if the enum contains an unknown value deserialized from
8535        /// the integer representation of enums.
8536        pub fn name(&self) -> std::option::Option<&str> {
8537            match self {
8538                Self::Unspecified => std::option::Option::Some("NEXT_HOP_TYPE_UNSPECIFIED"),
8539                Self::NextHopIp => std::option::Option::Some("NEXT_HOP_IP"),
8540                Self::NextHopInstance => std::option::Option::Some("NEXT_HOP_INSTANCE"),
8541                Self::NextHopNetwork => std::option::Option::Some("NEXT_HOP_NETWORK"),
8542                Self::NextHopPeering => std::option::Option::Some("NEXT_HOP_PEERING"),
8543                Self::NextHopInterconnect => std::option::Option::Some("NEXT_HOP_INTERCONNECT"),
8544                Self::NextHopVpnTunnel => std::option::Option::Some("NEXT_HOP_VPN_TUNNEL"),
8545                Self::NextHopVpnGateway => std::option::Option::Some("NEXT_HOP_VPN_GATEWAY"),
8546                Self::NextHopInternetGateway => {
8547                    std::option::Option::Some("NEXT_HOP_INTERNET_GATEWAY")
8548                }
8549                Self::NextHopBlackhole => std::option::Option::Some("NEXT_HOP_BLACKHOLE"),
8550                Self::NextHopIlb => std::option::Option::Some("NEXT_HOP_ILB"),
8551                Self::NextHopRouterAppliance => {
8552                    std::option::Option::Some("NEXT_HOP_ROUTER_APPLIANCE")
8553                }
8554                Self::NextHopNccHub => std::option::Option::Some("NEXT_HOP_NCC_HUB"),
8555                Self::SecureWebProxyGateway => {
8556                    std::option::Option::Some("SECURE_WEB_PROXY_GATEWAY")
8557                }
8558                Self::UnknownValue(u) => u.0.name(),
8559            }
8560        }
8561    }
8562
8563    impl std::default::Default for NextHopType {
8564        fn default() -> Self {
8565            use std::convert::From;
8566            Self::from(0)
8567        }
8568    }
8569
8570    impl std::fmt::Display for NextHopType {
8571        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8572            wkt::internal::display_enum(f, self.name(), self.value())
8573        }
8574    }
8575
8576    impl std::convert::From<i32> for NextHopType {
8577        fn from(value: i32) -> Self {
8578            match value {
8579                0 => Self::Unspecified,
8580                1 => Self::NextHopIp,
8581                2 => Self::NextHopInstance,
8582                3 => Self::NextHopNetwork,
8583                4 => Self::NextHopPeering,
8584                5 => Self::NextHopInterconnect,
8585                6 => Self::NextHopVpnTunnel,
8586                7 => Self::NextHopVpnGateway,
8587                8 => Self::NextHopInternetGateway,
8588                9 => Self::NextHopBlackhole,
8589                10 => Self::NextHopIlb,
8590                11 => Self::NextHopRouterAppliance,
8591                12 => Self::NextHopNccHub,
8592                13 => Self::SecureWebProxyGateway,
8593                _ => Self::UnknownValue(next_hop_type::UnknownValue(
8594                    wkt::internal::UnknownEnumValue::Integer(value),
8595                )),
8596            }
8597        }
8598    }
8599
8600    impl std::convert::From<&str> for NextHopType {
8601        fn from(value: &str) -> Self {
8602            use std::string::ToString;
8603            match value {
8604                "NEXT_HOP_TYPE_UNSPECIFIED" => Self::Unspecified,
8605                "NEXT_HOP_IP" => Self::NextHopIp,
8606                "NEXT_HOP_INSTANCE" => Self::NextHopInstance,
8607                "NEXT_HOP_NETWORK" => Self::NextHopNetwork,
8608                "NEXT_HOP_PEERING" => Self::NextHopPeering,
8609                "NEXT_HOP_INTERCONNECT" => Self::NextHopInterconnect,
8610                "NEXT_HOP_VPN_TUNNEL" => Self::NextHopVpnTunnel,
8611                "NEXT_HOP_VPN_GATEWAY" => Self::NextHopVpnGateway,
8612                "NEXT_HOP_INTERNET_GATEWAY" => Self::NextHopInternetGateway,
8613                "NEXT_HOP_BLACKHOLE" => Self::NextHopBlackhole,
8614                "NEXT_HOP_ILB" => Self::NextHopIlb,
8615                "NEXT_HOP_ROUTER_APPLIANCE" => Self::NextHopRouterAppliance,
8616                "NEXT_HOP_NCC_HUB" => Self::NextHopNccHub,
8617                "SECURE_WEB_PROXY_GATEWAY" => Self::SecureWebProxyGateway,
8618                _ => Self::UnknownValue(next_hop_type::UnknownValue(
8619                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8620                )),
8621            }
8622        }
8623    }
8624
8625    impl serde::ser::Serialize for NextHopType {
8626        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8627        where
8628            S: serde::Serializer,
8629        {
8630            match self {
8631                Self::Unspecified => serializer.serialize_i32(0),
8632                Self::NextHopIp => serializer.serialize_i32(1),
8633                Self::NextHopInstance => serializer.serialize_i32(2),
8634                Self::NextHopNetwork => serializer.serialize_i32(3),
8635                Self::NextHopPeering => serializer.serialize_i32(4),
8636                Self::NextHopInterconnect => serializer.serialize_i32(5),
8637                Self::NextHopVpnTunnel => serializer.serialize_i32(6),
8638                Self::NextHopVpnGateway => serializer.serialize_i32(7),
8639                Self::NextHopInternetGateway => serializer.serialize_i32(8),
8640                Self::NextHopBlackhole => serializer.serialize_i32(9),
8641                Self::NextHopIlb => serializer.serialize_i32(10),
8642                Self::NextHopRouterAppliance => serializer.serialize_i32(11),
8643                Self::NextHopNccHub => serializer.serialize_i32(12),
8644                Self::SecureWebProxyGateway => serializer.serialize_i32(13),
8645                Self::UnknownValue(u) => u.0.serialize(serializer),
8646            }
8647        }
8648    }
8649
8650    impl<'de> serde::de::Deserialize<'de> for NextHopType {
8651        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8652        where
8653            D: serde::Deserializer<'de>,
8654        {
8655            deserializer.deserialize_any(wkt::internal::EnumVisitor::<NextHopType>::new(
8656                ".google.cloud.networkmanagement.v1.RouteInfo.NextHopType",
8657            ))
8658        }
8659    }
8660
8661    /// Indicates where routes are applicable.
8662    ///
8663    /// # Working with unknown values
8664    ///
8665    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8666    /// additional enum variants at any time. Adding new variants is not considered
8667    /// a breaking change. Applications should write their code in anticipation of:
8668    ///
8669    /// - New values appearing in future releases of the client library, **and**
8670    /// - New values received dynamically, without application changes.
8671    ///
8672    /// Please consult the [Working with enums] section in the user guide for some
8673    /// guidelines.
8674    ///
8675    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8676    #[derive(Clone, Debug, PartialEq)]
8677    #[non_exhaustive]
8678    pub enum RouteScope {
8679        /// Unspecified scope. Default value.
8680        Unspecified,
8681        /// Route is applicable to packets in Network.
8682        Network,
8683        /// Route is applicable to packets using NCC Hub's routing table.
8684        NccHub,
8685        /// If set, the enum was initialized with an unknown value.
8686        ///
8687        /// Applications can examine the value using [RouteScope::value] or
8688        /// [RouteScope::name].
8689        UnknownValue(route_scope::UnknownValue),
8690    }
8691
8692    #[doc(hidden)]
8693    pub mod route_scope {
8694        #[allow(unused_imports)]
8695        use super::*;
8696        #[derive(Clone, Debug, PartialEq)]
8697        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8698    }
8699
8700    impl RouteScope {
8701        /// Gets the enum value.
8702        ///
8703        /// Returns `None` if the enum contains an unknown value deserialized from
8704        /// the string representation of enums.
8705        pub fn value(&self) -> std::option::Option<i32> {
8706            match self {
8707                Self::Unspecified => std::option::Option::Some(0),
8708                Self::Network => std::option::Option::Some(1),
8709                Self::NccHub => std::option::Option::Some(2),
8710                Self::UnknownValue(u) => u.0.value(),
8711            }
8712        }
8713
8714        /// Gets the enum value as a string.
8715        ///
8716        /// Returns `None` if the enum contains an unknown value deserialized from
8717        /// the integer representation of enums.
8718        pub fn name(&self) -> std::option::Option<&str> {
8719            match self {
8720                Self::Unspecified => std::option::Option::Some("ROUTE_SCOPE_UNSPECIFIED"),
8721                Self::Network => std::option::Option::Some("NETWORK"),
8722                Self::NccHub => std::option::Option::Some("NCC_HUB"),
8723                Self::UnknownValue(u) => u.0.name(),
8724            }
8725        }
8726    }
8727
8728    impl std::default::Default for RouteScope {
8729        fn default() -> Self {
8730            use std::convert::From;
8731            Self::from(0)
8732        }
8733    }
8734
8735    impl std::fmt::Display for RouteScope {
8736        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8737            wkt::internal::display_enum(f, self.name(), self.value())
8738        }
8739    }
8740
8741    impl std::convert::From<i32> for RouteScope {
8742        fn from(value: i32) -> Self {
8743            match value {
8744                0 => Self::Unspecified,
8745                1 => Self::Network,
8746                2 => Self::NccHub,
8747                _ => Self::UnknownValue(route_scope::UnknownValue(
8748                    wkt::internal::UnknownEnumValue::Integer(value),
8749                )),
8750            }
8751        }
8752    }
8753
8754    impl std::convert::From<&str> for RouteScope {
8755        fn from(value: &str) -> Self {
8756            use std::string::ToString;
8757            match value {
8758                "ROUTE_SCOPE_UNSPECIFIED" => Self::Unspecified,
8759                "NETWORK" => Self::Network,
8760                "NCC_HUB" => Self::NccHub,
8761                _ => Self::UnknownValue(route_scope::UnknownValue(
8762                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8763                )),
8764            }
8765        }
8766    }
8767
8768    impl serde::ser::Serialize for RouteScope {
8769        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8770        where
8771            S: serde::Serializer,
8772        {
8773            match self {
8774                Self::Unspecified => serializer.serialize_i32(0),
8775                Self::Network => serializer.serialize_i32(1),
8776                Self::NccHub => serializer.serialize_i32(2),
8777                Self::UnknownValue(u) => u.0.serialize(serializer),
8778            }
8779        }
8780    }
8781
8782    impl<'de> serde::de::Deserialize<'de> for RouteScope {
8783        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8784        where
8785            D: serde::Deserializer<'de>,
8786        {
8787            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteScope>::new(
8788                ".google.cloud.networkmanagement.v1.RouteInfo.RouteScope",
8789            ))
8790        }
8791    }
8792}
8793
8794/// For display only. Details of a Google Service sending packets to a
8795/// VPC network. Although the source IP might be a publicly routable address,
8796/// some Google Services use special routes within Google production
8797/// infrastructure to reach Compute Engine Instances.
8798/// <https://cloud.google.com/vpc/docs/routes#special_return_paths>
8799#[derive(Clone, Default, PartialEq)]
8800#[non_exhaustive]
8801pub struct GoogleServiceInfo {
8802    /// Source IP address.
8803    pub source_ip: std::string::String,
8804
8805    /// Recognized type of a Google Service.
8806    pub google_service_type: crate::model::google_service_info::GoogleServiceType,
8807
8808    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8809}
8810
8811impl GoogleServiceInfo {
8812    pub fn new() -> Self {
8813        std::default::Default::default()
8814    }
8815
8816    /// Sets the value of [source_ip][crate::model::GoogleServiceInfo::source_ip].
8817    ///
8818    /// # Example
8819    /// ```ignore,no_run
8820    /// # use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
8821    /// let x = GoogleServiceInfo::new().set_source_ip("example");
8822    /// ```
8823    pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8824        self.source_ip = v.into();
8825        self
8826    }
8827
8828    /// Sets the value of [google_service_type][crate::model::GoogleServiceInfo::google_service_type].
8829    ///
8830    /// # Example
8831    /// ```ignore,no_run
8832    /// # use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
8833    /// use google_cloud_networkmanagement_v1::model::google_service_info::GoogleServiceType;
8834    /// let x0 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::Iap);
8835    /// let x1 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::GfeProxyOrHealthCheckProber);
8836    /// let x2 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::CloudDns);
8837    /// ```
8838    pub fn set_google_service_type<
8839        T: std::convert::Into<crate::model::google_service_info::GoogleServiceType>,
8840    >(
8841        mut self,
8842        v: T,
8843    ) -> Self {
8844        self.google_service_type = v.into();
8845        self
8846    }
8847}
8848
8849impl wkt::message::Message for GoogleServiceInfo {
8850    fn typename() -> &'static str {
8851        "type.googleapis.com/google.cloud.networkmanagement.v1.GoogleServiceInfo"
8852    }
8853}
8854
8855/// Defines additional types related to [GoogleServiceInfo].
8856pub mod google_service_info {
8857    #[allow(unused_imports)]
8858    use super::*;
8859
8860    /// Recognized type of a Google Service.
8861    ///
8862    /// # Working with unknown values
8863    ///
8864    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8865    /// additional enum variants at any time. Adding new variants is not considered
8866    /// a breaking change. Applications should write their code in anticipation of:
8867    ///
8868    /// - New values appearing in future releases of the client library, **and**
8869    /// - New values received dynamically, without application changes.
8870    ///
8871    /// Please consult the [Working with enums] section in the user guide for some
8872    /// guidelines.
8873    ///
8874    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8875    #[derive(Clone, Debug, PartialEq)]
8876    #[non_exhaustive]
8877    pub enum GoogleServiceType {
8878        /// Unspecified Google Service.
8879        Unspecified,
8880        /// Identity aware proxy.
8881        /// <https://cloud.google.com/iap/docs/using-tcp-forwarding>
8882        Iap,
8883        /// One of two services sharing IP ranges:
8884        ///
8885        /// * Load Balancer proxy
8886        /// * Centralized Health Check prober
8887        ///   <https://cloud.google.com/load-balancing/docs/firewall-rules>
8888        GfeProxyOrHealthCheckProber,
8889        /// Connectivity from Cloud DNS to forwarding targets or alternate name
8890        /// servers that use private routing.
8891        /// <https://cloud.google.com/dns/docs/zones/forwarding-zones#firewall-rules>
8892        /// <https://cloud.google.com/dns/docs/policies#firewall-rules>
8893        CloudDns,
8894        /// private.googleapis.com and restricted.googleapis.com
8895        GoogleApi,
8896        /// Google API via Private Service Connect.
8897        /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
8898        GoogleApiPsc,
8899        /// Google API via VPC Service Controls.
8900        /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
8901        GoogleApiVpcSc,
8902        /// Google API via Serverless VPC Access.
8903        /// <https://cloud.google.com/vpc/docs/serverless-vpc-access>
8904        ServerlessVpcAccess,
8905        /// If set, the enum was initialized with an unknown value.
8906        ///
8907        /// Applications can examine the value using [GoogleServiceType::value] or
8908        /// [GoogleServiceType::name].
8909        UnknownValue(google_service_type::UnknownValue),
8910    }
8911
8912    #[doc(hidden)]
8913    pub mod google_service_type {
8914        #[allow(unused_imports)]
8915        use super::*;
8916        #[derive(Clone, Debug, PartialEq)]
8917        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8918    }
8919
8920    impl GoogleServiceType {
8921        /// Gets the enum value.
8922        ///
8923        /// Returns `None` if the enum contains an unknown value deserialized from
8924        /// the string representation of enums.
8925        pub fn value(&self) -> std::option::Option<i32> {
8926            match self {
8927                Self::Unspecified => std::option::Option::Some(0),
8928                Self::Iap => std::option::Option::Some(1),
8929                Self::GfeProxyOrHealthCheckProber => std::option::Option::Some(2),
8930                Self::CloudDns => std::option::Option::Some(3),
8931                Self::GoogleApi => std::option::Option::Some(4),
8932                Self::GoogleApiPsc => std::option::Option::Some(5),
8933                Self::GoogleApiVpcSc => std::option::Option::Some(6),
8934                Self::ServerlessVpcAccess => std::option::Option::Some(7),
8935                Self::UnknownValue(u) => u.0.value(),
8936            }
8937        }
8938
8939        /// Gets the enum value as a string.
8940        ///
8941        /// Returns `None` if the enum contains an unknown value deserialized from
8942        /// the integer representation of enums.
8943        pub fn name(&self) -> std::option::Option<&str> {
8944            match self {
8945                Self::Unspecified => std::option::Option::Some("GOOGLE_SERVICE_TYPE_UNSPECIFIED"),
8946                Self::Iap => std::option::Option::Some("IAP"),
8947                Self::GfeProxyOrHealthCheckProber => {
8948                    std::option::Option::Some("GFE_PROXY_OR_HEALTH_CHECK_PROBER")
8949                }
8950                Self::CloudDns => std::option::Option::Some("CLOUD_DNS"),
8951                Self::GoogleApi => std::option::Option::Some("GOOGLE_API"),
8952                Self::GoogleApiPsc => std::option::Option::Some("GOOGLE_API_PSC"),
8953                Self::GoogleApiVpcSc => std::option::Option::Some("GOOGLE_API_VPC_SC"),
8954                Self::ServerlessVpcAccess => std::option::Option::Some("SERVERLESS_VPC_ACCESS"),
8955                Self::UnknownValue(u) => u.0.name(),
8956            }
8957        }
8958    }
8959
8960    impl std::default::Default for GoogleServiceType {
8961        fn default() -> Self {
8962            use std::convert::From;
8963            Self::from(0)
8964        }
8965    }
8966
8967    impl std::fmt::Display for GoogleServiceType {
8968        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8969            wkt::internal::display_enum(f, self.name(), self.value())
8970        }
8971    }
8972
8973    impl std::convert::From<i32> for GoogleServiceType {
8974        fn from(value: i32) -> Self {
8975            match value {
8976                0 => Self::Unspecified,
8977                1 => Self::Iap,
8978                2 => Self::GfeProxyOrHealthCheckProber,
8979                3 => Self::CloudDns,
8980                4 => Self::GoogleApi,
8981                5 => Self::GoogleApiPsc,
8982                6 => Self::GoogleApiVpcSc,
8983                7 => Self::ServerlessVpcAccess,
8984                _ => Self::UnknownValue(google_service_type::UnknownValue(
8985                    wkt::internal::UnknownEnumValue::Integer(value),
8986                )),
8987            }
8988        }
8989    }
8990
8991    impl std::convert::From<&str> for GoogleServiceType {
8992        fn from(value: &str) -> Self {
8993            use std::string::ToString;
8994            match value {
8995                "GOOGLE_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
8996                "IAP" => Self::Iap,
8997                "GFE_PROXY_OR_HEALTH_CHECK_PROBER" => Self::GfeProxyOrHealthCheckProber,
8998                "CLOUD_DNS" => Self::CloudDns,
8999                "GOOGLE_API" => Self::GoogleApi,
9000                "GOOGLE_API_PSC" => Self::GoogleApiPsc,
9001                "GOOGLE_API_VPC_SC" => Self::GoogleApiVpcSc,
9002                "SERVERLESS_VPC_ACCESS" => Self::ServerlessVpcAccess,
9003                _ => Self::UnknownValue(google_service_type::UnknownValue(
9004                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9005                )),
9006            }
9007        }
9008    }
9009
9010    impl serde::ser::Serialize for GoogleServiceType {
9011        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9012        where
9013            S: serde::Serializer,
9014        {
9015            match self {
9016                Self::Unspecified => serializer.serialize_i32(0),
9017                Self::Iap => serializer.serialize_i32(1),
9018                Self::GfeProxyOrHealthCheckProber => serializer.serialize_i32(2),
9019                Self::CloudDns => serializer.serialize_i32(3),
9020                Self::GoogleApi => serializer.serialize_i32(4),
9021                Self::GoogleApiPsc => serializer.serialize_i32(5),
9022                Self::GoogleApiVpcSc => serializer.serialize_i32(6),
9023                Self::ServerlessVpcAccess => serializer.serialize_i32(7),
9024                Self::UnknownValue(u) => u.0.serialize(serializer),
9025            }
9026        }
9027    }
9028
9029    impl<'de> serde::de::Deserialize<'de> for GoogleServiceType {
9030        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9031        where
9032            D: serde::Deserializer<'de>,
9033        {
9034            deserializer.deserialize_any(wkt::internal::EnumVisitor::<GoogleServiceType>::new(
9035                ".google.cloud.networkmanagement.v1.GoogleServiceInfo.GoogleServiceType",
9036            ))
9037        }
9038    }
9039}
9040
9041/// For display only. Metadata associated with a Compute Engine forwarding rule.
9042#[derive(Clone, Default, PartialEq)]
9043#[non_exhaustive]
9044pub struct ForwardingRuleInfo {
9045    /// Name of the forwarding rule.
9046    pub display_name: std::string::String,
9047
9048    /// URI of the forwarding rule.
9049    pub uri: std::string::String,
9050
9051    /// Protocol defined in the forwarding rule that matches the packet.
9052    pub matched_protocol: std::string::String,
9053
9054    /// Port range defined in the forwarding rule that matches the packet.
9055    pub matched_port_range: std::string::String,
9056
9057    /// VIP of the forwarding rule.
9058    pub vip: std::string::String,
9059
9060    /// Target type of the forwarding rule.
9061    pub target: std::string::String,
9062
9063    /// Network URI.
9064    pub network_uri: std::string::String,
9065
9066    /// Region of the forwarding rule. Set only for regional forwarding rules.
9067    pub region: std::string::String,
9068
9069    /// Name of the load balancer the forwarding rule belongs to. Empty for
9070    /// forwarding rules not related to load balancers (like PSC forwarding rules).
9071    pub load_balancer_name: std::string::String,
9072
9073    /// URI of the PSC service attachment this forwarding rule targets (if
9074    /// applicable).
9075    pub psc_service_attachment_uri: std::string::String,
9076
9077    /// PSC Google API target this forwarding rule targets (if applicable).
9078    pub psc_google_api_target: std::string::String,
9079
9080    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9081}
9082
9083impl ForwardingRuleInfo {
9084    pub fn new() -> Self {
9085        std::default::Default::default()
9086    }
9087
9088    /// Sets the value of [display_name][crate::model::ForwardingRuleInfo::display_name].
9089    ///
9090    /// # Example
9091    /// ```ignore,no_run
9092    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9093    /// let x = ForwardingRuleInfo::new().set_display_name("example");
9094    /// ```
9095    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9096        self.display_name = v.into();
9097        self
9098    }
9099
9100    /// Sets the value of [uri][crate::model::ForwardingRuleInfo::uri].
9101    ///
9102    /// # Example
9103    /// ```ignore,no_run
9104    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9105    /// let x = ForwardingRuleInfo::new().set_uri("example");
9106    /// ```
9107    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9108        self.uri = v.into();
9109        self
9110    }
9111
9112    /// Sets the value of [matched_protocol][crate::model::ForwardingRuleInfo::matched_protocol].
9113    ///
9114    /// # Example
9115    /// ```ignore,no_run
9116    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9117    /// let x = ForwardingRuleInfo::new().set_matched_protocol("example");
9118    /// ```
9119    pub fn set_matched_protocol<T: std::convert::Into<std::string::String>>(
9120        mut self,
9121        v: T,
9122    ) -> Self {
9123        self.matched_protocol = v.into();
9124        self
9125    }
9126
9127    /// Sets the value of [matched_port_range][crate::model::ForwardingRuleInfo::matched_port_range].
9128    ///
9129    /// # Example
9130    /// ```ignore,no_run
9131    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9132    /// let x = ForwardingRuleInfo::new().set_matched_port_range("example");
9133    /// ```
9134    pub fn set_matched_port_range<T: std::convert::Into<std::string::String>>(
9135        mut self,
9136        v: T,
9137    ) -> Self {
9138        self.matched_port_range = v.into();
9139        self
9140    }
9141
9142    /// Sets the value of [vip][crate::model::ForwardingRuleInfo::vip].
9143    ///
9144    /// # Example
9145    /// ```ignore,no_run
9146    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9147    /// let x = ForwardingRuleInfo::new().set_vip("example");
9148    /// ```
9149    pub fn set_vip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9150        self.vip = v.into();
9151        self
9152    }
9153
9154    /// Sets the value of [target][crate::model::ForwardingRuleInfo::target].
9155    ///
9156    /// # Example
9157    /// ```ignore,no_run
9158    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9159    /// let x = ForwardingRuleInfo::new().set_target("example");
9160    /// ```
9161    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9162        self.target = v.into();
9163        self
9164    }
9165
9166    /// Sets the value of [network_uri][crate::model::ForwardingRuleInfo::network_uri].
9167    ///
9168    /// # Example
9169    /// ```ignore,no_run
9170    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9171    /// let x = ForwardingRuleInfo::new().set_network_uri("example");
9172    /// ```
9173    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9174        self.network_uri = v.into();
9175        self
9176    }
9177
9178    /// Sets the value of [region][crate::model::ForwardingRuleInfo::region].
9179    ///
9180    /// # Example
9181    /// ```ignore,no_run
9182    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9183    /// let x = ForwardingRuleInfo::new().set_region("example");
9184    /// ```
9185    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9186        self.region = v.into();
9187        self
9188    }
9189
9190    /// Sets the value of [load_balancer_name][crate::model::ForwardingRuleInfo::load_balancer_name].
9191    ///
9192    /// # Example
9193    /// ```ignore,no_run
9194    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9195    /// let x = ForwardingRuleInfo::new().set_load_balancer_name("example");
9196    /// ```
9197    pub fn set_load_balancer_name<T: std::convert::Into<std::string::String>>(
9198        mut self,
9199        v: T,
9200    ) -> Self {
9201        self.load_balancer_name = v.into();
9202        self
9203    }
9204
9205    /// Sets the value of [psc_service_attachment_uri][crate::model::ForwardingRuleInfo::psc_service_attachment_uri].
9206    ///
9207    /// # Example
9208    /// ```ignore,no_run
9209    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9210    /// let x = ForwardingRuleInfo::new().set_psc_service_attachment_uri("example");
9211    /// ```
9212    pub fn set_psc_service_attachment_uri<T: std::convert::Into<std::string::String>>(
9213        mut self,
9214        v: T,
9215    ) -> Self {
9216        self.psc_service_attachment_uri = v.into();
9217        self
9218    }
9219
9220    /// Sets the value of [psc_google_api_target][crate::model::ForwardingRuleInfo::psc_google_api_target].
9221    ///
9222    /// # Example
9223    /// ```ignore,no_run
9224    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9225    /// let x = ForwardingRuleInfo::new().set_psc_google_api_target("example");
9226    /// ```
9227    pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
9228        mut self,
9229        v: T,
9230    ) -> Self {
9231        self.psc_google_api_target = v.into();
9232        self
9233    }
9234}
9235
9236impl wkt::message::Message for ForwardingRuleInfo {
9237    fn typename() -> &'static str {
9238        "type.googleapis.com/google.cloud.networkmanagement.v1.ForwardingRuleInfo"
9239    }
9240}
9241
9242/// For display only. Metadata associated with a load balancer.
9243#[derive(Clone, Default, PartialEq)]
9244#[non_exhaustive]
9245pub struct LoadBalancerInfo {
9246    /// Type of the load balancer.
9247    pub load_balancer_type: crate::model::load_balancer_info::LoadBalancerType,
9248
9249    /// URI of the health check for the load balancer. Deprecated and no longer
9250    /// populated as different load balancer backends might have different health
9251    /// checks.
9252    #[deprecated]
9253    pub health_check_uri: std::string::String,
9254
9255    /// Information for the loadbalancer backends.
9256    pub backends: std::vec::Vec<crate::model::LoadBalancerBackend>,
9257
9258    /// Type of load balancer's backend configuration.
9259    pub backend_type: crate::model::load_balancer_info::BackendType,
9260
9261    /// Backend configuration URI.
9262    pub backend_uri: std::string::String,
9263
9264    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9265}
9266
9267impl LoadBalancerInfo {
9268    pub fn new() -> Self {
9269        std::default::Default::default()
9270    }
9271
9272    /// Sets the value of [load_balancer_type][crate::model::LoadBalancerInfo::load_balancer_type].
9273    ///
9274    /// # Example
9275    /// ```ignore,no_run
9276    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9277    /// use google_cloud_networkmanagement_v1::model::load_balancer_info::LoadBalancerType;
9278    /// let x0 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::InternalTcpUdp);
9279    /// let x1 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::NetworkTcpUdp);
9280    /// let x2 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::HttpProxy);
9281    /// ```
9282    pub fn set_load_balancer_type<
9283        T: std::convert::Into<crate::model::load_balancer_info::LoadBalancerType>,
9284    >(
9285        mut self,
9286        v: T,
9287    ) -> Self {
9288        self.load_balancer_type = v.into();
9289        self
9290    }
9291
9292    /// Sets the value of [health_check_uri][crate::model::LoadBalancerInfo::health_check_uri].
9293    ///
9294    /// # Example
9295    /// ```ignore,no_run
9296    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9297    /// let x = LoadBalancerInfo::new().set_health_check_uri("example");
9298    /// ```
9299    #[deprecated]
9300    pub fn set_health_check_uri<T: std::convert::Into<std::string::String>>(
9301        mut self,
9302        v: T,
9303    ) -> Self {
9304        self.health_check_uri = v.into();
9305        self
9306    }
9307
9308    /// Sets the value of [backends][crate::model::LoadBalancerInfo::backends].
9309    ///
9310    /// # Example
9311    /// ```ignore,no_run
9312    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9313    /// use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9314    /// let x = LoadBalancerInfo::new()
9315    ///     .set_backends([
9316    ///         LoadBalancerBackend::default()/* use setters */,
9317    ///         LoadBalancerBackend::default()/* use (different) setters */,
9318    ///     ]);
9319    /// ```
9320    pub fn set_backends<T, V>(mut self, v: T) -> Self
9321    where
9322        T: std::iter::IntoIterator<Item = V>,
9323        V: std::convert::Into<crate::model::LoadBalancerBackend>,
9324    {
9325        use std::iter::Iterator;
9326        self.backends = v.into_iter().map(|i| i.into()).collect();
9327        self
9328    }
9329
9330    /// Sets the value of [backend_type][crate::model::LoadBalancerInfo::backend_type].
9331    ///
9332    /// # Example
9333    /// ```ignore,no_run
9334    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9335    /// use google_cloud_networkmanagement_v1::model::load_balancer_info::BackendType;
9336    /// let x0 = LoadBalancerInfo::new().set_backend_type(BackendType::BackendService);
9337    /// let x1 = LoadBalancerInfo::new().set_backend_type(BackendType::TargetPool);
9338    /// let x2 = LoadBalancerInfo::new().set_backend_type(BackendType::TargetInstance);
9339    /// ```
9340    pub fn set_backend_type<
9341        T: std::convert::Into<crate::model::load_balancer_info::BackendType>,
9342    >(
9343        mut self,
9344        v: T,
9345    ) -> Self {
9346        self.backend_type = v.into();
9347        self
9348    }
9349
9350    /// Sets the value of [backend_uri][crate::model::LoadBalancerInfo::backend_uri].
9351    ///
9352    /// # Example
9353    /// ```ignore,no_run
9354    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9355    /// let x = LoadBalancerInfo::new().set_backend_uri("example");
9356    /// ```
9357    pub fn set_backend_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9358        self.backend_uri = v.into();
9359        self
9360    }
9361}
9362
9363impl wkt::message::Message for LoadBalancerInfo {
9364    fn typename() -> &'static str {
9365        "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerInfo"
9366    }
9367}
9368
9369/// Defines additional types related to [LoadBalancerInfo].
9370pub mod load_balancer_info {
9371    #[allow(unused_imports)]
9372    use super::*;
9373
9374    /// The type definition for a load balancer:
9375    ///
9376    /// # Working with unknown values
9377    ///
9378    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9379    /// additional enum variants at any time. Adding new variants is not considered
9380    /// a breaking change. Applications should write their code in anticipation of:
9381    ///
9382    /// - New values appearing in future releases of the client library, **and**
9383    /// - New values received dynamically, without application changes.
9384    ///
9385    /// Please consult the [Working with enums] section in the user guide for some
9386    /// guidelines.
9387    ///
9388    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9389    #[derive(Clone, Debug, PartialEq)]
9390    #[non_exhaustive]
9391    pub enum LoadBalancerType {
9392        /// Type is unspecified.
9393        Unspecified,
9394        /// Internal TCP/UDP load balancer.
9395        InternalTcpUdp,
9396        /// Network TCP/UDP load balancer.
9397        NetworkTcpUdp,
9398        /// HTTP(S) proxy load balancer.
9399        HttpProxy,
9400        /// TCP proxy load balancer.
9401        TcpProxy,
9402        /// SSL proxy load balancer.
9403        SslProxy,
9404        /// If set, the enum was initialized with an unknown value.
9405        ///
9406        /// Applications can examine the value using [LoadBalancerType::value] or
9407        /// [LoadBalancerType::name].
9408        UnknownValue(load_balancer_type::UnknownValue),
9409    }
9410
9411    #[doc(hidden)]
9412    pub mod load_balancer_type {
9413        #[allow(unused_imports)]
9414        use super::*;
9415        #[derive(Clone, Debug, PartialEq)]
9416        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9417    }
9418
9419    impl LoadBalancerType {
9420        /// Gets the enum value.
9421        ///
9422        /// Returns `None` if the enum contains an unknown value deserialized from
9423        /// the string representation of enums.
9424        pub fn value(&self) -> std::option::Option<i32> {
9425            match self {
9426                Self::Unspecified => std::option::Option::Some(0),
9427                Self::InternalTcpUdp => std::option::Option::Some(1),
9428                Self::NetworkTcpUdp => std::option::Option::Some(2),
9429                Self::HttpProxy => std::option::Option::Some(3),
9430                Self::TcpProxy => std::option::Option::Some(4),
9431                Self::SslProxy => std::option::Option::Some(5),
9432                Self::UnknownValue(u) => u.0.value(),
9433            }
9434        }
9435
9436        /// Gets the enum value as a string.
9437        ///
9438        /// Returns `None` if the enum contains an unknown value deserialized from
9439        /// the integer representation of enums.
9440        pub fn name(&self) -> std::option::Option<&str> {
9441            match self {
9442                Self::Unspecified => std::option::Option::Some("LOAD_BALANCER_TYPE_UNSPECIFIED"),
9443                Self::InternalTcpUdp => std::option::Option::Some("INTERNAL_TCP_UDP"),
9444                Self::NetworkTcpUdp => std::option::Option::Some("NETWORK_TCP_UDP"),
9445                Self::HttpProxy => std::option::Option::Some("HTTP_PROXY"),
9446                Self::TcpProxy => std::option::Option::Some("TCP_PROXY"),
9447                Self::SslProxy => std::option::Option::Some("SSL_PROXY"),
9448                Self::UnknownValue(u) => u.0.name(),
9449            }
9450        }
9451    }
9452
9453    impl std::default::Default for LoadBalancerType {
9454        fn default() -> Self {
9455            use std::convert::From;
9456            Self::from(0)
9457        }
9458    }
9459
9460    impl std::fmt::Display for LoadBalancerType {
9461        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9462            wkt::internal::display_enum(f, self.name(), self.value())
9463        }
9464    }
9465
9466    impl std::convert::From<i32> for LoadBalancerType {
9467        fn from(value: i32) -> Self {
9468            match value {
9469                0 => Self::Unspecified,
9470                1 => Self::InternalTcpUdp,
9471                2 => Self::NetworkTcpUdp,
9472                3 => Self::HttpProxy,
9473                4 => Self::TcpProxy,
9474                5 => Self::SslProxy,
9475                _ => Self::UnknownValue(load_balancer_type::UnknownValue(
9476                    wkt::internal::UnknownEnumValue::Integer(value),
9477                )),
9478            }
9479        }
9480    }
9481
9482    impl std::convert::From<&str> for LoadBalancerType {
9483        fn from(value: &str) -> Self {
9484            use std::string::ToString;
9485            match value {
9486                "LOAD_BALANCER_TYPE_UNSPECIFIED" => Self::Unspecified,
9487                "INTERNAL_TCP_UDP" => Self::InternalTcpUdp,
9488                "NETWORK_TCP_UDP" => Self::NetworkTcpUdp,
9489                "HTTP_PROXY" => Self::HttpProxy,
9490                "TCP_PROXY" => Self::TcpProxy,
9491                "SSL_PROXY" => Self::SslProxy,
9492                _ => Self::UnknownValue(load_balancer_type::UnknownValue(
9493                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9494                )),
9495            }
9496        }
9497    }
9498
9499    impl serde::ser::Serialize for LoadBalancerType {
9500        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9501        where
9502            S: serde::Serializer,
9503        {
9504            match self {
9505                Self::Unspecified => serializer.serialize_i32(0),
9506                Self::InternalTcpUdp => serializer.serialize_i32(1),
9507                Self::NetworkTcpUdp => serializer.serialize_i32(2),
9508                Self::HttpProxy => serializer.serialize_i32(3),
9509                Self::TcpProxy => serializer.serialize_i32(4),
9510                Self::SslProxy => serializer.serialize_i32(5),
9511                Self::UnknownValue(u) => u.0.serialize(serializer),
9512            }
9513        }
9514    }
9515
9516    impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
9517        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9518        where
9519            D: serde::Deserializer<'de>,
9520        {
9521            deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
9522                ".google.cloud.networkmanagement.v1.LoadBalancerInfo.LoadBalancerType",
9523            ))
9524        }
9525    }
9526
9527    /// The type definition for a load balancer backend configuration:
9528    ///
9529    /// # Working with unknown values
9530    ///
9531    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9532    /// additional enum variants at any time. Adding new variants is not considered
9533    /// a breaking change. Applications should write their code in anticipation of:
9534    ///
9535    /// - New values appearing in future releases of the client library, **and**
9536    /// - New values received dynamically, without application changes.
9537    ///
9538    /// Please consult the [Working with enums] section in the user guide for some
9539    /// guidelines.
9540    ///
9541    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9542    #[derive(Clone, Debug, PartialEq)]
9543    #[non_exhaustive]
9544    pub enum BackendType {
9545        /// Type is unspecified.
9546        Unspecified,
9547        /// Backend Service as the load balancer's backend.
9548        BackendService,
9549        /// Target Pool as the load balancer's backend.
9550        TargetPool,
9551        /// Target Instance as the load balancer's backend.
9552        TargetInstance,
9553        /// If set, the enum was initialized with an unknown value.
9554        ///
9555        /// Applications can examine the value using [BackendType::value] or
9556        /// [BackendType::name].
9557        UnknownValue(backend_type::UnknownValue),
9558    }
9559
9560    #[doc(hidden)]
9561    pub mod backend_type {
9562        #[allow(unused_imports)]
9563        use super::*;
9564        #[derive(Clone, Debug, PartialEq)]
9565        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9566    }
9567
9568    impl BackendType {
9569        /// Gets the enum value.
9570        ///
9571        /// Returns `None` if the enum contains an unknown value deserialized from
9572        /// the string representation of enums.
9573        pub fn value(&self) -> std::option::Option<i32> {
9574            match self {
9575                Self::Unspecified => std::option::Option::Some(0),
9576                Self::BackendService => std::option::Option::Some(1),
9577                Self::TargetPool => std::option::Option::Some(2),
9578                Self::TargetInstance => std::option::Option::Some(3),
9579                Self::UnknownValue(u) => u.0.value(),
9580            }
9581        }
9582
9583        /// Gets the enum value as a string.
9584        ///
9585        /// Returns `None` if the enum contains an unknown value deserialized from
9586        /// the integer representation of enums.
9587        pub fn name(&self) -> std::option::Option<&str> {
9588            match self {
9589                Self::Unspecified => std::option::Option::Some("BACKEND_TYPE_UNSPECIFIED"),
9590                Self::BackendService => std::option::Option::Some("BACKEND_SERVICE"),
9591                Self::TargetPool => std::option::Option::Some("TARGET_POOL"),
9592                Self::TargetInstance => std::option::Option::Some("TARGET_INSTANCE"),
9593                Self::UnknownValue(u) => u.0.name(),
9594            }
9595        }
9596    }
9597
9598    impl std::default::Default for BackendType {
9599        fn default() -> Self {
9600            use std::convert::From;
9601            Self::from(0)
9602        }
9603    }
9604
9605    impl std::fmt::Display for BackendType {
9606        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9607            wkt::internal::display_enum(f, self.name(), self.value())
9608        }
9609    }
9610
9611    impl std::convert::From<i32> for BackendType {
9612        fn from(value: i32) -> Self {
9613            match value {
9614                0 => Self::Unspecified,
9615                1 => Self::BackendService,
9616                2 => Self::TargetPool,
9617                3 => Self::TargetInstance,
9618                _ => Self::UnknownValue(backend_type::UnknownValue(
9619                    wkt::internal::UnknownEnumValue::Integer(value),
9620                )),
9621            }
9622        }
9623    }
9624
9625    impl std::convert::From<&str> for BackendType {
9626        fn from(value: &str) -> Self {
9627            use std::string::ToString;
9628            match value {
9629                "BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
9630                "BACKEND_SERVICE" => Self::BackendService,
9631                "TARGET_POOL" => Self::TargetPool,
9632                "TARGET_INSTANCE" => Self::TargetInstance,
9633                _ => Self::UnknownValue(backend_type::UnknownValue(
9634                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9635                )),
9636            }
9637        }
9638    }
9639
9640    impl serde::ser::Serialize for BackendType {
9641        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9642        where
9643            S: serde::Serializer,
9644        {
9645            match self {
9646                Self::Unspecified => serializer.serialize_i32(0),
9647                Self::BackendService => serializer.serialize_i32(1),
9648                Self::TargetPool => serializer.serialize_i32(2),
9649                Self::TargetInstance => serializer.serialize_i32(3),
9650                Self::UnknownValue(u) => u.0.serialize(serializer),
9651            }
9652        }
9653    }
9654
9655    impl<'de> serde::de::Deserialize<'de> for BackendType {
9656        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9657        where
9658            D: serde::Deserializer<'de>,
9659        {
9660            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackendType>::new(
9661                ".google.cloud.networkmanagement.v1.LoadBalancerInfo.BackendType",
9662            ))
9663        }
9664    }
9665}
9666
9667/// For display only. Metadata associated with a specific load balancer backend.
9668#[derive(Clone, Default, PartialEq)]
9669#[non_exhaustive]
9670pub struct LoadBalancerBackend {
9671    /// Name of a Compute Engine instance or network endpoint.
9672    pub display_name: std::string::String,
9673
9674    /// URI of a Compute Engine instance or network endpoint.
9675    pub uri: std::string::String,
9676
9677    /// State of the health check firewall configuration.
9678    pub health_check_firewall_state: crate::model::load_balancer_backend::HealthCheckFirewallState,
9679
9680    /// A list of firewall rule URIs allowing probes from health check IP ranges.
9681    pub health_check_allowing_firewall_rules: std::vec::Vec<std::string::String>,
9682
9683    /// A list of firewall rule URIs blocking probes from health check IP ranges.
9684    pub health_check_blocking_firewall_rules: std::vec::Vec<std::string::String>,
9685
9686    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9687}
9688
9689impl LoadBalancerBackend {
9690    pub fn new() -> Self {
9691        std::default::Default::default()
9692    }
9693
9694    /// Sets the value of [display_name][crate::model::LoadBalancerBackend::display_name].
9695    ///
9696    /// # Example
9697    /// ```ignore,no_run
9698    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9699    /// let x = LoadBalancerBackend::new().set_display_name("example");
9700    /// ```
9701    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9702        self.display_name = v.into();
9703        self
9704    }
9705
9706    /// Sets the value of [uri][crate::model::LoadBalancerBackend::uri].
9707    ///
9708    /// # Example
9709    /// ```ignore,no_run
9710    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9711    /// let x = LoadBalancerBackend::new().set_uri("example");
9712    /// ```
9713    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9714        self.uri = v.into();
9715        self
9716    }
9717
9718    /// Sets the value of [health_check_firewall_state][crate::model::LoadBalancerBackend::health_check_firewall_state].
9719    ///
9720    /// # Example
9721    /// ```ignore,no_run
9722    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9723    /// use google_cloud_networkmanagement_v1::model::load_balancer_backend::HealthCheckFirewallState;
9724    /// let x0 = LoadBalancerBackend::new().set_health_check_firewall_state(HealthCheckFirewallState::Configured);
9725    /// let x1 = LoadBalancerBackend::new().set_health_check_firewall_state(HealthCheckFirewallState::Misconfigured);
9726    /// ```
9727    pub fn set_health_check_firewall_state<
9728        T: std::convert::Into<crate::model::load_balancer_backend::HealthCheckFirewallState>,
9729    >(
9730        mut self,
9731        v: T,
9732    ) -> Self {
9733        self.health_check_firewall_state = v.into();
9734        self
9735    }
9736
9737    /// Sets the value of [health_check_allowing_firewall_rules][crate::model::LoadBalancerBackend::health_check_allowing_firewall_rules].
9738    ///
9739    /// # Example
9740    /// ```ignore,no_run
9741    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9742    /// let x = LoadBalancerBackend::new().set_health_check_allowing_firewall_rules(["a", "b", "c"]);
9743    /// ```
9744    pub fn set_health_check_allowing_firewall_rules<T, V>(mut self, v: T) -> Self
9745    where
9746        T: std::iter::IntoIterator<Item = V>,
9747        V: std::convert::Into<std::string::String>,
9748    {
9749        use std::iter::Iterator;
9750        self.health_check_allowing_firewall_rules = v.into_iter().map(|i| i.into()).collect();
9751        self
9752    }
9753
9754    /// Sets the value of [health_check_blocking_firewall_rules][crate::model::LoadBalancerBackend::health_check_blocking_firewall_rules].
9755    ///
9756    /// # Example
9757    /// ```ignore,no_run
9758    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9759    /// let x = LoadBalancerBackend::new().set_health_check_blocking_firewall_rules(["a", "b", "c"]);
9760    /// ```
9761    pub fn set_health_check_blocking_firewall_rules<T, V>(mut self, v: T) -> Self
9762    where
9763        T: std::iter::IntoIterator<Item = V>,
9764        V: std::convert::Into<std::string::String>,
9765    {
9766        use std::iter::Iterator;
9767        self.health_check_blocking_firewall_rules = v.into_iter().map(|i| i.into()).collect();
9768        self
9769    }
9770}
9771
9772impl wkt::message::Message for LoadBalancerBackend {
9773    fn typename() -> &'static str {
9774        "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerBackend"
9775    }
9776}
9777
9778/// Defines additional types related to [LoadBalancerBackend].
9779pub mod load_balancer_backend {
9780    #[allow(unused_imports)]
9781    use super::*;
9782
9783    /// State of a health check firewall configuration:
9784    ///
9785    /// # Working with unknown values
9786    ///
9787    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9788    /// additional enum variants at any time. Adding new variants is not considered
9789    /// a breaking change. Applications should write their code in anticipation of:
9790    ///
9791    /// - New values appearing in future releases of the client library, **and**
9792    /// - New values received dynamically, without application changes.
9793    ///
9794    /// Please consult the [Working with enums] section in the user guide for some
9795    /// guidelines.
9796    ///
9797    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9798    #[derive(Clone, Debug, PartialEq)]
9799    #[non_exhaustive]
9800    pub enum HealthCheckFirewallState {
9801        /// State is unspecified. Default state if not populated.
9802        Unspecified,
9803        /// There are configured firewall rules to allow health check probes to the
9804        /// backend.
9805        Configured,
9806        /// There are firewall rules configured to allow partial health check ranges
9807        /// or block all health check ranges.
9808        /// If a health check probe is sent from denied IP ranges,
9809        /// the health check to the backend will fail. Then, the backend will be
9810        /// marked unhealthy and will not receive traffic sent to the load balancer.
9811        Misconfigured,
9812        /// If set, the enum was initialized with an unknown value.
9813        ///
9814        /// Applications can examine the value using [HealthCheckFirewallState::value] or
9815        /// [HealthCheckFirewallState::name].
9816        UnknownValue(health_check_firewall_state::UnknownValue),
9817    }
9818
9819    #[doc(hidden)]
9820    pub mod health_check_firewall_state {
9821        #[allow(unused_imports)]
9822        use super::*;
9823        #[derive(Clone, Debug, PartialEq)]
9824        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9825    }
9826
9827    impl HealthCheckFirewallState {
9828        /// Gets the enum value.
9829        ///
9830        /// Returns `None` if the enum contains an unknown value deserialized from
9831        /// the string representation of enums.
9832        pub fn value(&self) -> std::option::Option<i32> {
9833            match self {
9834                Self::Unspecified => std::option::Option::Some(0),
9835                Self::Configured => std::option::Option::Some(1),
9836                Self::Misconfigured => std::option::Option::Some(2),
9837                Self::UnknownValue(u) => u.0.value(),
9838            }
9839        }
9840
9841        /// Gets the enum value as a string.
9842        ///
9843        /// Returns `None` if the enum contains an unknown value deserialized from
9844        /// the integer representation of enums.
9845        pub fn name(&self) -> std::option::Option<&str> {
9846            match self {
9847                Self::Unspecified => {
9848                    std::option::Option::Some("HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED")
9849                }
9850                Self::Configured => std::option::Option::Some("CONFIGURED"),
9851                Self::Misconfigured => std::option::Option::Some("MISCONFIGURED"),
9852                Self::UnknownValue(u) => u.0.name(),
9853            }
9854        }
9855    }
9856
9857    impl std::default::Default for HealthCheckFirewallState {
9858        fn default() -> Self {
9859            use std::convert::From;
9860            Self::from(0)
9861        }
9862    }
9863
9864    impl std::fmt::Display for HealthCheckFirewallState {
9865        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9866            wkt::internal::display_enum(f, self.name(), self.value())
9867        }
9868    }
9869
9870    impl std::convert::From<i32> for HealthCheckFirewallState {
9871        fn from(value: i32) -> Self {
9872            match value {
9873                0 => Self::Unspecified,
9874                1 => Self::Configured,
9875                2 => Self::Misconfigured,
9876                _ => Self::UnknownValue(health_check_firewall_state::UnknownValue(
9877                    wkt::internal::UnknownEnumValue::Integer(value),
9878                )),
9879            }
9880        }
9881    }
9882
9883    impl std::convert::From<&str> for HealthCheckFirewallState {
9884        fn from(value: &str) -> Self {
9885            use std::string::ToString;
9886            match value {
9887                "HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED" => Self::Unspecified,
9888                "CONFIGURED" => Self::Configured,
9889                "MISCONFIGURED" => Self::Misconfigured,
9890                _ => Self::UnknownValue(health_check_firewall_state::UnknownValue(
9891                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9892                )),
9893            }
9894        }
9895    }
9896
9897    impl serde::ser::Serialize for HealthCheckFirewallState {
9898        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9899        where
9900            S: serde::Serializer,
9901        {
9902            match self {
9903                Self::Unspecified => serializer.serialize_i32(0),
9904                Self::Configured => serializer.serialize_i32(1),
9905                Self::Misconfigured => serializer.serialize_i32(2),
9906                Self::UnknownValue(u) => u.0.serialize(serializer),
9907            }
9908        }
9909    }
9910
9911    impl<'de> serde::de::Deserialize<'de> for HealthCheckFirewallState {
9912        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9913        where
9914            D: serde::Deserializer<'de>,
9915        {
9916            deserializer.deserialize_any(wkt::internal::EnumVisitor::<HealthCheckFirewallState>::new(
9917                ".google.cloud.networkmanagement.v1.LoadBalancerBackend.HealthCheckFirewallState"))
9918        }
9919    }
9920}
9921
9922/// For display only. Metadata associated with a hybrid subnet.
9923#[derive(Clone, Default, PartialEq)]
9924#[non_exhaustive]
9925pub struct HybridSubnetInfo {
9926    /// Name of a hybrid subnet.
9927    pub display_name: std::string::String,
9928
9929    /// URI of a hybrid subnet.
9930    pub uri: std::string::String,
9931
9932    /// Name of a Google Cloud region where the hybrid subnet is configured.
9933    pub region: std::string::String,
9934
9935    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9936}
9937
9938impl HybridSubnetInfo {
9939    pub fn new() -> Self {
9940        std::default::Default::default()
9941    }
9942
9943    /// Sets the value of [display_name][crate::model::HybridSubnetInfo::display_name].
9944    ///
9945    /// # Example
9946    /// ```ignore,no_run
9947    /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
9948    /// let x = HybridSubnetInfo::new().set_display_name("example");
9949    /// ```
9950    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9951        self.display_name = v.into();
9952        self
9953    }
9954
9955    /// Sets the value of [uri][crate::model::HybridSubnetInfo::uri].
9956    ///
9957    /// # Example
9958    /// ```ignore,no_run
9959    /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
9960    /// let x = HybridSubnetInfo::new().set_uri("example");
9961    /// ```
9962    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9963        self.uri = v.into();
9964        self
9965    }
9966
9967    /// Sets the value of [region][crate::model::HybridSubnetInfo::region].
9968    ///
9969    /// # Example
9970    /// ```ignore,no_run
9971    /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
9972    /// let x = HybridSubnetInfo::new().set_region("example");
9973    /// ```
9974    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9975        self.region = v.into();
9976        self
9977    }
9978}
9979
9980impl wkt::message::Message for HybridSubnetInfo {
9981    fn typename() -> &'static str {
9982        "type.googleapis.com/google.cloud.networkmanagement.v1.HybridSubnetInfo"
9983    }
9984}
9985
9986/// For display only. Metadata associated with a Compute Engine VPN gateway.
9987#[derive(Clone, Default, PartialEq)]
9988#[non_exhaustive]
9989pub struct VpnGatewayInfo {
9990    /// Name of a VPN gateway.
9991    pub display_name: std::string::String,
9992
9993    /// URI of a VPN gateway.
9994    pub uri: std::string::String,
9995
9996    /// URI of a Compute Engine network where the VPN gateway is configured.
9997    pub network_uri: std::string::String,
9998
9999    /// IP address of the VPN gateway.
10000    pub ip_address: std::string::String,
10001
10002    /// A VPN tunnel that is associated with this VPN gateway.
10003    /// There may be multiple VPN tunnels configured on a VPN gateway, and only
10004    /// the one relevant to the test is displayed.
10005    pub vpn_tunnel_uri: std::string::String,
10006
10007    /// Name of a Google Cloud region where this VPN gateway is configured.
10008    pub region: std::string::String,
10009
10010    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10011}
10012
10013impl VpnGatewayInfo {
10014    pub fn new() -> Self {
10015        std::default::Default::default()
10016    }
10017
10018    /// Sets the value of [display_name][crate::model::VpnGatewayInfo::display_name].
10019    ///
10020    /// # Example
10021    /// ```ignore,no_run
10022    /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10023    /// let x = VpnGatewayInfo::new().set_display_name("example");
10024    /// ```
10025    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10026        self.display_name = v.into();
10027        self
10028    }
10029
10030    /// Sets the value of [uri][crate::model::VpnGatewayInfo::uri].
10031    ///
10032    /// # Example
10033    /// ```ignore,no_run
10034    /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10035    /// let x = VpnGatewayInfo::new().set_uri("example");
10036    /// ```
10037    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10038        self.uri = v.into();
10039        self
10040    }
10041
10042    /// Sets the value of [network_uri][crate::model::VpnGatewayInfo::network_uri].
10043    ///
10044    /// # Example
10045    /// ```ignore,no_run
10046    /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10047    /// let x = VpnGatewayInfo::new().set_network_uri("example");
10048    /// ```
10049    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10050        self.network_uri = v.into();
10051        self
10052    }
10053
10054    /// Sets the value of [ip_address][crate::model::VpnGatewayInfo::ip_address].
10055    ///
10056    /// # Example
10057    /// ```ignore,no_run
10058    /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10059    /// let x = VpnGatewayInfo::new().set_ip_address("example");
10060    /// ```
10061    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10062        self.ip_address = v.into();
10063        self
10064    }
10065
10066    /// Sets the value of [vpn_tunnel_uri][crate::model::VpnGatewayInfo::vpn_tunnel_uri].
10067    ///
10068    /// # Example
10069    /// ```ignore,no_run
10070    /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10071    /// let x = VpnGatewayInfo::new().set_vpn_tunnel_uri("example");
10072    /// ```
10073    pub fn set_vpn_tunnel_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10074        self.vpn_tunnel_uri = v.into();
10075        self
10076    }
10077
10078    /// Sets the value of [region][crate::model::VpnGatewayInfo::region].
10079    ///
10080    /// # Example
10081    /// ```ignore,no_run
10082    /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10083    /// let x = VpnGatewayInfo::new().set_region("example");
10084    /// ```
10085    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10086        self.region = v.into();
10087        self
10088    }
10089}
10090
10091impl wkt::message::Message for VpnGatewayInfo {
10092    fn typename() -> &'static str {
10093        "type.googleapis.com/google.cloud.networkmanagement.v1.VpnGatewayInfo"
10094    }
10095}
10096
10097/// For display only. Metadata associated with a Compute Engine VPN tunnel.
10098#[derive(Clone, Default, PartialEq)]
10099#[non_exhaustive]
10100pub struct VpnTunnelInfo {
10101    /// Name of a VPN tunnel.
10102    pub display_name: std::string::String,
10103
10104    /// URI of a VPN tunnel.
10105    pub uri: std::string::String,
10106
10107    /// URI of the VPN gateway at local end of the tunnel.
10108    pub source_gateway: std::string::String,
10109
10110    /// URI of a VPN gateway at remote end of the tunnel.
10111    pub remote_gateway: std::string::String,
10112
10113    /// Remote VPN gateway's IP address.
10114    pub remote_gateway_ip: std::string::String,
10115
10116    /// Local VPN gateway's IP address.
10117    pub source_gateway_ip: std::string::String,
10118
10119    /// URI of a Compute Engine network where the VPN tunnel is configured.
10120    pub network_uri: std::string::String,
10121
10122    /// Name of a Google Cloud region where this VPN tunnel is configured.
10123    pub region: std::string::String,
10124
10125    /// Type of the routing policy.
10126    pub routing_type: crate::model::vpn_tunnel_info::RoutingType,
10127
10128    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10129}
10130
10131impl VpnTunnelInfo {
10132    pub fn new() -> Self {
10133        std::default::Default::default()
10134    }
10135
10136    /// Sets the value of [display_name][crate::model::VpnTunnelInfo::display_name].
10137    ///
10138    /// # Example
10139    /// ```ignore,no_run
10140    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10141    /// let x = VpnTunnelInfo::new().set_display_name("example");
10142    /// ```
10143    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10144        self.display_name = v.into();
10145        self
10146    }
10147
10148    /// Sets the value of [uri][crate::model::VpnTunnelInfo::uri].
10149    ///
10150    /// # Example
10151    /// ```ignore,no_run
10152    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10153    /// let x = VpnTunnelInfo::new().set_uri("example");
10154    /// ```
10155    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10156        self.uri = v.into();
10157        self
10158    }
10159
10160    /// Sets the value of [source_gateway][crate::model::VpnTunnelInfo::source_gateway].
10161    ///
10162    /// # Example
10163    /// ```ignore,no_run
10164    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10165    /// let x = VpnTunnelInfo::new().set_source_gateway("example");
10166    /// ```
10167    pub fn set_source_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10168        self.source_gateway = v.into();
10169        self
10170    }
10171
10172    /// Sets the value of [remote_gateway][crate::model::VpnTunnelInfo::remote_gateway].
10173    ///
10174    /// # Example
10175    /// ```ignore,no_run
10176    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10177    /// let x = VpnTunnelInfo::new().set_remote_gateway("example");
10178    /// ```
10179    pub fn set_remote_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10180        self.remote_gateway = v.into();
10181        self
10182    }
10183
10184    /// Sets the value of [remote_gateway_ip][crate::model::VpnTunnelInfo::remote_gateway_ip].
10185    ///
10186    /// # Example
10187    /// ```ignore,no_run
10188    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10189    /// let x = VpnTunnelInfo::new().set_remote_gateway_ip("example");
10190    /// ```
10191    pub fn set_remote_gateway_ip<T: std::convert::Into<std::string::String>>(
10192        mut self,
10193        v: T,
10194    ) -> Self {
10195        self.remote_gateway_ip = v.into();
10196        self
10197    }
10198
10199    /// Sets the value of [source_gateway_ip][crate::model::VpnTunnelInfo::source_gateway_ip].
10200    ///
10201    /// # Example
10202    /// ```ignore,no_run
10203    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10204    /// let x = VpnTunnelInfo::new().set_source_gateway_ip("example");
10205    /// ```
10206    pub fn set_source_gateway_ip<T: std::convert::Into<std::string::String>>(
10207        mut self,
10208        v: T,
10209    ) -> Self {
10210        self.source_gateway_ip = v.into();
10211        self
10212    }
10213
10214    /// Sets the value of [network_uri][crate::model::VpnTunnelInfo::network_uri].
10215    ///
10216    /// # Example
10217    /// ```ignore,no_run
10218    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10219    /// let x = VpnTunnelInfo::new().set_network_uri("example");
10220    /// ```
10221    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10222        self.network_uri = v.into();
10223        self
10224    }
10225
10226    /// Sets the value of [region][crate::model::VpnTunnelInfo::region].
10227    ///
10228    /// # Example
10229    /// ```ignore,no_run
10230    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10231    /// let x = VpnTunnelInfo::new().set_region("example");
10232    /// ```
10233    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10234        self.region = v.into();
10235        self
10236    }
10237
10238    /// Sets the value of [routing_type][crate::model::VpnTunnelInfo::routing_type].
10239    ///
10240    /// # Example
10241    /// ```ignore,no_run
10242    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10243    /// use google_cloud_networkmanagement_v1::model::vpn_tunnel_info::RoutingType;
10244    /// let x0 = VpnTunnelInfo::new().set_routing_type(RoutingType::RouteBased);
10245    /// let x1 = VpnTunnelInfo::new().set_routing_type(RoutingType::PolicyBased);
10246    /// let x2 = VpnTunnelInfo::new().set_routing_type(RoutingType::Dynamic);
10247    /// ```
10248    pub fn set_routing_type<T: std::convert::Into<crate::model::vpn_tunnel_info::RoutingType>>(
10249        mut self,
10250        v: T,
10251    ) -> Self {
10252        self.routing_type = v.into();
10253        self
10254    }
10255}
10256
10257impl wkt::message::Message for VpnTunnelInfo {
10258    fn typename() -> &'static str {
10259        "type.googleapis.com/google.cloud.networkmanagement.v1.VpnTunnelInfo"
10260    }
10261}
10262
10263/// Defines additional types related to [VpnTunnelInfo].
10264pub mod vpn_tunnel_info {
10265    #[allow(unused_imports)]
10266    use super::*;
10267
10268    /// Types of VPN routing policy. For details, refer to [Networks and Tunnel
10269    /// routing](https://cloud.google.com/network-connectivity/docs/vpn/concepts/choosing-networks-routing/).
10270    ///
10271    /// # Working with unknown values
10272    ///
10273    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10274    /// additional enum variants at any time. Adding new variants is not considered
10275    /// a breaking change. Applications should write their code in anticipation of:
10276    ///
10277    /// - New values appearing in future releases of the client library, **and**
10278    /// - New values received dynamically, without application changes.
10279    ///
10280    /// Please consult the [Working with enums] section in the user guide for some
10281    /// guidelines.
10282    ///
10283    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10284    #[derive(Clone, Debug, PartialEq)]
10285    #[non_exhaustive]
10286    pub enum RoutingType {
10287        /// Unspecified type. Default value.
10288        Unspecified,
10289        /// Route based VPN.
10290        RouteBased,
10291        /// Policy based routing.
10292        PolicyBased,
10293        /// Dynamic (BGP) routing.
10294        Dynamic,
10295        /// If set, the enum was initialized with an unknown value.
10296        ///
10297        /// Applications can examine the value using [RoutingType::value] or
10298        /// [RoutingType::name].
10299        UnknownValue(routing_type::UnknownValue),
10300    }
10301
10302    #[doc(hidden)]
10303    pub mod routing_type {
10304        #[allow(unused_imports)]
10305        use super::*;
10306        #[derive(Clone, Debug, PartialEq)]
10307        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10308    }
10309
10310    impl RoutingType {
10311        /// Gets the enum value.
10312        ///
10313        /// Returns `None` if the enum contains an unknown value deserialized from
10314        /// the string representation of enums.
10315        pub fn value(&self) -> std::option::Option<i32> {
10316            match self {
10317                Self::Unspecified => std::option::Option::Some(0),
10318                Self::RouteBased => std::option::Option::Some(1),
10319                Self::PolicyBased => std::option::Option::Some(2),
10320                Self::Dynamic => std::option::Option::Some(3),
10321                Self::UnknownValue(u) => u.0.value(),
10322            }
10323        }
10324
10325        /// Gets the enum value as a string.
10326        ///
10327        /// Returns `None` if the enum contains an unknown value deserialized from
10328        /// the integer representation of enums.
10329        pub fn name(&self) -> std::option::Option<&str> {
10330            match self {
10331                Self::Unspecified => std::option::Option::Some("ROUTING_TYPE_UNSPECIFIED"),
10332                Self::RouteBased => std::option::Option::Some("ROUTE_BASED"),
10333                Self::PolicyBased => std::option::Option::Some("POLICY_BASED"),
10334                Self::Dynamic => std::option::Option::Some("DYNAMIC"),
10335                Self::UnknownValue(u) => u.0.name(),
10336            }
10337        }
10338    }
10339
10340    impl std::default::Default for RoutingType {
10341        fn default() -> Self {
10342            use std::convert::From;
10343            Self::from(0)
10344        }
10345    }
10346
10347    impl std::fmt::Display for RoutingType {
10348        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10349            wkt::internal::display_enum(f, self.name(), self.value())
10350        }
10351    }
10352
10353    impl std::convert::From<i32> for RoutingType {
10354        fn from(value: i32) -> Self {
10355            match value {
10356                0 => Self::Unspecified,
10357                1 => Self::RouteBased,
10358                2 => Self::PolicyBased,
10359                3 => Self::Dynamic,
10360                _ => Self::UnknownValue(routing_type::UnknownValue(
10361                    wkt::internal::UnknownEnumValue::Integer(value),
10362                )),
10363            }
10364        }
10365    }
10366
10367    impl std::convert::From<&str> for RoutingType {
10368        fn from(value: &str) -> Self {
10369            use std::string::ToString;
10370            match value {
10371                "ROUTING_TYPE_UNSPECIFIED" => Self::Unspecified,
10372                "ROUTE_BASED" => Self::RouteBased,
10373                "POLICY_BASED" => Self::PolicyBased,
10374                "DYNAMIC" => Self::Dynamic,
10375                _ => Self::UnknownValue(routing_type::UnknownValue(
10376                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10377                )),
10378            }
10379        }
10380    }
10381
10382    impl serde::ser::Serialize for RoutingType {
10383        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10384        where
10385            S: serde::Serializer,
10386        {
10387            match self {
10388                Self::Unspecified => serializer.serialize_i32(0),
10389                Self::RouteBased => serializer.serialize_i32(1),
10390                Self::PolicyBased => serializer.serialize_i32(2),
10391                Self::Dynamic => serializer.serialize_i32(3),
10392                Self::UnknownValue(u) => u.0.serialize(serializer),
10393            }
10394        }
10395    }
10396
10397    impl<'de> serde::de::Deserialize<'de> for RoutingType {
10398        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10399        where
10400            D: serde::Deserializer<'de>,
10401        {
10402            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutingType>::new(
10403                ".google.cloud.networkmanagement.v1.VpnTunnelInfo.RoutingType",
10404            ))
10405        }
10406    }
10407}
10408
10409/// For display only. Metadata associated with an Interconnect attachment.
10410#[derive(Clone, Default, PartialEq)]
10411#[non_exhaustive]
10412pub struct InterconnectAttachmentInfo {
10413    /// Name of an Interconnect attachment.
10414    pub display_name: std::string::String,
10415
10416    /// URI of an Interconnect attachment.
10417    pub uri: std::string::String,
10418
10419    /// URI of the Interconnect where the Interconnect attachment is
10420    /// configured.
10421    pub interconnect_uri: std::string::String,
10422
10423    /// Name of a Google Cloud region where the Interconnect attachment is
10424    /// configured.
10425    pub region: std::string::String,
10426
10427    /// URI of the Cloud Router to be used for dynamic routing.
10428    pub cloud_router_uri: std::string::String,
10429
10430    /// The type of interconnect attachment this is.
10431    pub r#type: crate::model::interconnect_attachment_info::Type,
10432
10433    /// Appliance IP address that was matched for L2_DEDICATED attachments.
10434    pub l2_attachment_matched_ip_address: std::string::String,
10435
10436    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10437}
10438
10439impl InterconnectAttachmentInfo {
10440    pub fn new() -> Self {
10441        std::default::Default::default()
10442    }
10443
10444    /// Sets the value of [display_name][crate::model::InterconnectAttachmentInfo::display_name].
10445    ///
10446    /// # Example
10447    /// ```ignore,no_run
10448    /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10449    /// let x = InterconnectAttachmentInfo::new().set_display_name("example");
10450    /// ```
10451    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10452        self.display_name = v.into();
10453        self
10454    }
10455
10456    /// Sets the value of [uri][crate::model::InterconnectAttachmentInfo::uri].
10457    ///
10458    /// # Example
10459    /// ```ignore,no_run
10460    /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10461    /// let x = InterconnectAttachmentInfo::new().set_uri("example");
10462    /// ```
10463    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10464        self.uri = v.into();
10465        self
10466    }
10467
10468    /// Sets the value of [interconnect_uri][crate::model::InterconnectAttachmentInfo::interconnect_uri].
10469    ///
10470    /// # Example
10471    /// ```ignore,no_run
10472    /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10473    /// let x = InterconnectAttachmentInfo::new().set_interconnect_uri("example");
10474    /// ```
10475    pub fn set_interconnect_uri<T: std::convert::Into<std::string::String>>(
10476        mut self,
10477        v: T,
10478    ) -> Self {
10479        self.interconnect_uri = v.into();
10480        self
10481    }
10482
10483    /// Sets the value of [region][crate::model::InterconnectAttachmentInfo::region].
10484    ///
10485    /// # Example
10486    /// ```ignore,no_run
10487    /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10488    /// let x = InterconnectAttachmentInfo::new().set_region("example");
10489    /// ```
10490    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10491        self.region = v.into();
10492        self
10493    }
10494
10495    /// Sets the value of [cloud_router_uri][crate::model::InterconnectAttachmentInfo::cloud_router_uri].
10496    ///
10497    /// # Example
10498    /// ```ignore,no_run
10499    /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10500    /// let x = InterconnectAttachmentInfo::new().set_cloud_router_uri("example");
10501    /// ```
10502    pub fn set_cloud_router_uri<T: std::convert::Into<std::string::String>>(
10503        mut self,
10504        v: T,
10505    ) -> Self {
10506        self.cloud_router_uri = v.into();
10507        self
10508    }
10509
10510    /// Sets the value of [r#type][crate::model::InterconnectAttachmentInfo::type].
10511    ///
10512    /// # Example
10513    /// ```ignore,no_run
10514    /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10515    /// use google_cloud_networkmanagement_v1::model::interconnect_attachment_info::Type;
10516    /// let x0 = InterconnectAttachmentInfo::new().set_type(Type::Dedicated);
10517    /// let x1 = InterconnectAttachmentInfo::new().set_type(Type::Partner);
10518    /// let x2 = InterconnectAttachmentInfo::new().set_type(Type::PartnerProvider);
10519    /// ```
10520    pub fn set_type<T: std::convert::Into<crate::model::interconnect_attachment_info::Type>>(
10521        mut self,
10522        v: T,
10523    ) -> Self {
10524        self.r#type = v.into();
10525        self
10526    }
10527
10528    /// Sets the value of [l2_attachment_matched_ip_address][crate::model::InterconnectAttachmentInfo::l2_attachment_matched_ip_address].
10529    ///
10530    /// # Example
10531    /// ```ignore,no_run
10532    /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10533    /// let x = InterconnectAttachmentInfo::new().set_l2_attachment_matched_ip_address("example");
10534    /// ```
10535    pub fn set_l2_attachment_matched_ip_address<T: std::convert::Into<std::string::String>>(
10536        mut self,
10537        v: T,
10538    ) -> Self {
10539        self.l2_attachment_matched_ip_address = v.into();
10540        self
10541    }
10542}
10543
10544impl wkt::message::Message for InterconnectAttachmentInfo {
10545    fn typename() -> &'static str {
10546        "type.googleapis.com/google.cloud.networkmanagement.v1.InterconnectAttachmentInfo"
10547    }
10548}
10549
10550/// Defines additional types related to [InterconnectAttachmentInfo].
10551pub mod interconnect_attachment_info {
10552    #[allow(unused_imports)]
10553    use super::*;
10554
10555    /// What type of interconnect attachment this is.
10556    ///
10557    /// # Working with unknown values
10558    ///
10559    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10560    /// additional enum variants at any time. Adding new variants is not considered
10561    /// a breaking change. Applications should write their code in anticipation of:
10562    ///
10563    /// - New values appearing in future releases of the client library, **and**
10564    /// - New values received dynamically, without application changes.
10565    ///
10566    /// Please consult the [Working with enums] section in the user guide for some
10567    /// guidelines.
10568    ///
10569    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10570    #[derive(Clone, Debug, PartialEq)]
10571    #[non_exhaustive]
10572    pub enum Type {
10573        /// Unspecified type.
10574        Unspecified,
10575        /// Attachment to a dedicated interconnect.
10576        Dedicated,
10577        /// Attachment to a partner interconnect, created by the customer.
10578        Partner,
10579        /// Attachment to a partner interconnect, created by the partner.
10580        PartnerProvider,
10581        /// Attachment to a L2 interconnect, created by the customer.
10582        L2Dedicated,
10583        /// If set, the enum was initialized with an unknown value.
10584        ///
10585        /// Applications can examine the value using [Type::value] or
10586        /// [Type::name].
10587        UnknownValue(r#type::UnknownValue),
10588    }
10589
10590    #[doc(hidden)]
10591    pub mod r#type {
10592        #[allow(unused_imports)]
10593        use super::*;
10594        #[derive(Clone, Debug, PartialEq)]
10595        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10596    }
10597
10598    impl Type {
10599        /// Gets the enum value.
10600        ///
10601        /// Returns `None` if the enum contains an unknown value deserialized from
10602        /// the string representation of enums.
10603        pub fn value(&self) -> std::option::Option<i32> {
10604            match self {
10605                Self::Unspecified => std::option::Option::Some(0),
10606                Self::Dedicated => std::option::Option::Some(1),
10607                Self::Partner => std::option::Option::Some(2),
10608                Self::PartnerProvider => std::option::Option::Some(3),
10609                Self::L2Dedicated => std::option::Option::Some(4),
10610                Self::UnknownValue(u) => u.0.value(),
10611            }
10612        }
10613
10614        /// Gets the enum value as a string.
10615        ///
10616        /// Returns `None` if the enum contains an unknown value deserialized from
10617        /// the integer representation of enums.
10618        pub fn name(&self) -> std::option::Option<&str> {
10619            match self {
10620                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
10621                Self::Dedicated => std::option::Option::Some("DEDICATED"),
10622                Self::Partner => std::option::Option::Some("PARTNER"),
10623                Self::PartnerProvider => std::option::Option::Some("PARTNER_PROVIDER"),
10624                Self::L2Dedicated => std::option::Option::Some("L2_DEDICATED"),
10625                Self::UnknownValue(u) => u.0.name(),
10626            }
10627        }
10628    }
10629
10630    impl std::default::Default for Type {
10631        fn default() -> Self {
10632            use std::convert::From;
10633            Self::from(0)
10634        }
10635    }
10636
10637    impl std::fmt::Display for Type {
10638        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10639            wkt::internal::display_enum(f, self.name(), self.value())
10640        }
10641    }
10642
10643    impl std::convert::From<i32> for Type {
10644        fn from(value: i32) -> Self {
10645            match value {
10646                0 => Self::Unspecified,
10647                1 => Self::Dedicated,
10648                2 => Self::Partner,
10649                3 => Self::PartnerProvider,
10650                4 => Self::L2Dedicated,
10651                _ => Self::UnknownValue(r#type::UnknownValue(
10652                    wkt::internal::UnknownEnumValue::Integer(value),
10653                )),
10654            }
10655        }
10656    }
10657
10658    impl std::convert::From<&str> for Type {
10659        fn from(value: &str) -> Self {
10660            use std::string::ToString;
10661            match value {
10662                "TYPE_UNSPECIFIED" => Self::Unspecified,
10663                "DEDICATED" => Self::Dedicated,
10664                "PARTNER" => Self::Partner,
10665                "PARTNER_PROVIDER" => Self::PartnerProvider,
10666                "L2_DEDICATED" => Self::L2Dedicated,
10667                _ => Self::UnknownValue(r#type::UnknownValue(
10668                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10669                )),
10670            }
10671        }
10672    }
10673
10674    impl serde::ser::Serialize for Type {
10675        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10676        where
10677            S: serde::Serializer,
10678        {
10679            match self {
10680                Self::Unspecified => serializer.serialize_i32(0),
10681                Self::Dedicated => serializer.serialize_i32(1),
10682                Self::Partner => serializer.serialize_i32(2),
10683                Self::PartnerProvider => serializer.serialize_i32(3),
10684                Self::L2Dedicated => serializer.serialize_i32(4),
10685                Self::UnknownValue(u) => u.0.serialize(serializer),
10686            }
10687        }
10688    }
10689
10690    impl<'de> serde::de::Deserialize<'de> for Type {
10691        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10692        where
10693            D: serde::Deserializer<'de>,
10694        {
10695            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
10696                ".google.cloud.networkmanagement.v1.InterconnectAttachmentInfo.Type",
10697            ))
10698        }
10699    }
10700}
10701
10702/// For display only. The specification of the endpoints for the test.
10703/// EndpointInfo is derived from source and destination Endpoint and validated
10704/// by the backend data plane model.
10705#[derive(Clone, Default, PartialEq)]
10706#[non_exhaustive]
10707pub struct EndpointInfo {
10708    /// Source IP address.
10709    pub source_ip: std::string::String,
10710
10711    /// Destination IP address.
10712    pub destination_ip: std::string::String,
10713
10714    /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
10715    pub protocol: std::string::String,
10716
10717    /// Source port. Only valid when protocol is TCP or UDP.
10718    pub source_port: i32,
10719
10720    /// Destination port. Only valid when protocol is TCP or UDP.
10721    pub destination_port: i32,
10722
10723    /// URI of the network where this packet originates from.
10724    pub source_network_uri: std::string::String,
10725
10726    /// URI of the network where this packet is sent to.
10727    pub destination_network_uri: std::string::String,
10728
10729    /// URI of the source telemetry agent this packet originates from.
10730    pub source_agent_uri: std::string::String,
10731
10732    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10733}
10734
10735impl EndpointInfo {
10736    pub fn new() -> Self {
10737        std::default::Default::default()
10738    }
10739
10740    /// Sets the value of [source_ip][crate::model::EndpointInfo::source_ip].
10741    ///
10742    /// # Example
10743    /// ```ignore,no_run
10744    /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10745    /// let x = EndpointInfo::new().set_source_ip("example");
10746    /// ```
10747    pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10748        self.source_ip = v.into();
10749        self
10750    }
10751
10752    /// Sets the value of [destination_ip][crate::model::EndpointInfo::destination_ip].
10753    ///
10754    /// # Example
10755    /// ```ignore,no_run
10756    /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10757    /// let x = EndpointInfo::new().set_destination_ip("example");
10758    /// ```
10759    pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10760        self.destination_ip = v.into();
10761        self
10762    }
10763
10764    /// Sets the value of [protocol][crate::model::EndpointInfo::protocol].
10765    ///
10766    /// # Example
10767    /// ```ignore,no_run
10768    /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10769    /// let x = EndpointInfo::new().set_protocol("example");
10770    /// ```
10771    pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10772        self.protocol = v.into();
10773        self
10774    }
10775
10776    /// Sets the value of [source_port][crate::model::EndpointInfo::source_port].
10777    ///
10778    /// # Example
10779    /// ```ignore,no_run
10780    /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10781    /// let x = EndpointInfo::new().set_source_port(42);
10782    /// ```
10783    pub fn set_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10784        self.source_port = v.into();
10785        self
10786    }
10787
10788    /// Sets the value of [destination_port][crate::model::EndpointInfo::destination_port].
10789    ///
10790    /// # Example
10791    /// ```ignore,no_run
10792    /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10793    /// let x = EndpointInfo::new().set_destination_port(42);
10794    /// ```
10795    pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10796        self.destination_port = v.into();
10797        self
10798    }
10799
10800    /// Sets the value of [source_network_uri][crate::model::EndpointInfo::source_network_uri].
10801    ///
10802    /// # Example
10803    /// ```ignore,no_run
10804    /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10805    /// let x = EndpointInfo::new().set_source_network_uri("example");
10806    /// ```
10807    pub fn set_source_network_uri<T: std::convert::Into<std::string::String>>(
10808        mut self,
10809        v: T,
10810    ) -> Self {
10811        self.source_network_uri = v.into();
10812        self
10813    }
10814
10815    /// Sets the value of [destination_network_uri][crate::model::EndpointInfo::destination_network_uri].
10816    ///
10817    /// # Example
10818    /// ```ignore,no_run
10819    /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10820    /// let x = EndpointInfo::new().set_destination_network_uri("example");
10821    /// ```
10822    pub fn set_destination_network_uri<T: std::convert::Into<std::string::String>>(
10823        mut self,
10824        v: T,
10825    ) -> Self {
10826        self.destination_network_uri = v.into();
10827        self
10828    }
10829
10830    /// Sets the value of [source_agent_uri][crate::model::EndpointInfo::source_agent_uri].
10831    ///
10832    /// # Example
10833    /// ```ignore,no_run
10834    /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10835    /// let x = EndpointInfo::new().set_source_agent_uri("example");
10836    /// ```
10837    pub fn set_source_agent_uri<T: std::convert::Into<std::string::String>>(
10838        mut self,
10839        v: T,
10840    ) -> Self {
10841        self.source_agent_uri = v.into();
10842        self
10843    }
10844}
10845
10846impl wkt::message::Message for EndpointInfo {
10847    fn typename() -> &'static str {
10848        "type.googleapis.com/google.cloud.networkmanagement.v1.EndpointInfo"
10849    }
10850}
10851
10852/// Details of the final state "deliver" and associated resource.
10853#[derive(Clone, Default, PartialEq)]
10854#[non_exhaustive]
10855pub struct DeliverInfo {
10856    /// Target type where the packet is delivered to.
10857    pub target: crate::model::deliver_info::Target,
10858
10859    /// URI of the resource that the packet is delivered to.
10860    pub resource_uri: std::string::String,
10861
10862    /// IP address of the target (if applicable).
10863    pub ip_address: std::string::String,
10864
10865    /// Name of the Cloud Storage Bucket the packet is delivered to (if
10866    /// applicable).
10867    pub storage_bucket: std::string::String,
10868
10869    /// PSC Google API target the packet is delivered to (if applicable).
10870    pub psc_google_api_target: std::string::String,
10871
10872    /// Recognized type of a Google Service the packet is delivered to (if
10873    /// applicable).
10874    pub google_service_type: crate::model::deliver_info::GoogleServiceType,
10875
10876    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10877}
10878
10879impl DeliverInfo {
10880    pub fn new() -> Self {
10881        std::default::Default::default()
10882    }
10883
10884    /// Sets the value of [target][crate::model::DeliverInfo::target].
10885    ///
10886    /// # Example
10887    /// ```ignore,no_run
10888    /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10889    /// use google_cloud_networkmanagement_v1::model::deliver_info::Target;
10890    /// let x0 = DeliverInfo::new().set_target(Target::Instance);
10891    /// let x1 = DeliverInfo::new().set_target(Target::Internet);
10892    /// let x2 = DeliverInfo::new().set_target(Target::GoogleApi);
10893    /// ```
10894    pub fn set_target<T: std::convert::Into<crate::model::deliver_info::Target>>(
10895        mut self,
10896        v: T,
10897    ) -> Self {
10898        self.target = v.into();
10899        self
10900    }
10901
10902    /// Sets the value of [resource_uri][crate::model::DeliverInfo::resource_uri].
10903    ///
10904    /// # Example
10905    /// ```ignore,no_run
10906    /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10907    /// let x = DeliverInfo::new().set_resource_uri("example");
10908    /// ```
10909    pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10910        self.resource_uri = v.into();
10911        self
10912    }
10913
10914    /// Sets the value of [ip_address][crate::model::DeliverInfo::ip_address].
10915    ///
10916    /// # Example
10917    /// ```ignore,no_run
10918    /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10919    /// let x = DeliverInfo::new().set_ip_address("example");
10920    /// ```
10921    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10922        self.ip_address = v.into();
10923        self
10924    }
10925
10926    /// Sets the value of [storage_bucket][crate::model::DeliverInfo::storage_bucket].
10927    ///
10928    /// # Example
10929    /// ```ignore,no_run
10930    /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10931    /// let x = DeliverInfo::new().set_storage_bucket("example");
10932    /// ```
10933    pub fn set_storage_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10934        self.storage_bucket = v.into();
10935        self
10936    }
10937
10938    /// Sets the value of [psc_google_api_target][crate::model::DeliverInfo::psc_google_api_target].
10939    ///
10940    /// # Example
10941    /// ```ignore,no_run
10942    /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10943    /// let x = DeliverInfo::new().set_psc_google_api_target("example");
10944    /// ```
10945    pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
10946        mut self,
10947        v: T,
10948    ) -> Self {
10949        self.psc_google_api_target = v.into();
10950        self
10951    }
10952
10953    /// Sets the value of [google_service_type][crate::model::DeliverInfo::google_service_type].
10954    ///
10955    /// # Example
10956    /// ```ignore,no_run
10957    /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10958    /// use google_cloud_networkmanagement_v1::model::deliver_info::GoogleServiceType;
10959    /// let x0 = DeliverInfo::new().set_google_service_type(GoogleServiceType::Iap);
10960    /// let x1 = DeliverInfo::new().set_google_service_type(GoogleServiceType::GfeProxyOrHealthCheckProber);
10961    /// let x2 = DeliverInfo::new().set_google_service_type(GoogleServiceType::CloudDns);
10962    /// ```
10963    pub fn set_google_service_type<
10964        T: std::convert::Into<crate::model::deliver_info::GoogleServiceType>,
10965    >(
10966        mut self,
10967        v: T,
10968    ) -> Self {
10969        self.google_service_type = v.into();
10970        self
10971    }
10972}
10973
10974impl wkt::message::Message for DeliverInfo {
10975    fn typename() -> &'static str {
10976        "type.googleapis.com/google.cloud.networkmanagement.v1.DeliverInfo"
10977    }
10978}
10979
10980/// Defines additional types related to [DeliverInfo].
10981pub mod deliver_info {
10982    #[allow(unused_imports)]
10983    use super::*;
10984
10985    /// Deliver target types:
10986    ///
10987    /// # Working with unknown values
10988    ///
10989    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10990    /// additional enum variants at any time. Adding new variants is not considered
10991    /// a breaking change. Applications should write their code in anticipation of:
10992    ///
10993    /// - New values appearing in future releases of the client library, **and**
10994    /// - New values received dynamically, without application changes.
10995    ///
10996    /// Please consult the [Working with enums] section in the user guide for some
10997    /// guidelines.
10998    ///
10999    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11000    #[derive(Clone, Debug, PartialEq)]
11001    #[non_exhaustive]
11002    pub enum Target {
11003        /// Target not specified.
11004        Unspecified,
11005        /// Target is a Compute Engine instance.
11006        Instance,
11007        /// Target is the internet.
11008        Internet,
11009        /// Target is a Google API.
11010        GoogleApi,
11011        /// Target is a Google Kubernetes Engine cluster master.
11012        GkeMaster,
11013        /// Target is a Cloud SQL instance.
11014        CloudSqlInstance,
11015        /// Target is a published service that uses [Private Service
11016        /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
11017        PscPublishedService,
11018        /// Target is Google APIs that use [Private Service
11019        /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-apis).
11020        PscGoogleApi,
11021        /// Target is a VPC-SC that uses [Private Service
11022        /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-apis).
11023        PscVpcSc,
11024        /// Target is a serverless network endpoint group.
11025        ServerlessNeg,
11026        /// Target is a Cloud Storage bucket.
11027        StorageBucket,
11028        /// Target is a private network. Used only for return traces.
11029        PrivateNetwork,
11030        /// Target is a Cloud Function. Used only for return traces.
11031        CloudFunction,
11032        /// Target is a App Engine service version. Used only for return traces.
11033        AppEngineVersion,
11034        /// Target is a Cloud Run revision. Used only for return traces.
11035        CloudRunRevision,
11036        /// Target is a Google-managed service. Used only for return traces.
11037        GoogleManagedService,
11038        /// Target is a Redis Instance.
11039        RedisInstance,
11040        /// Target is a Redis Cluster.
11041        RedisCluster,
11042        /// Target is a GKE Pod.
11043        GkePod,
11044        /// If set, the enum was initialized with an unknown value.
11045        ///
11046        /// Applications can examine the value using [Target::value] or
11047        /// [Target::name].
11048        UnknownValue(target::UnknownValue),
11049    }
11050
11051    #[doc(hidden)]
11052    pub mod target {
11053        #[allow(unused_imports)]
11054        use super::*;
11055        #[derive(Clone, Debug, PartialEq)]
11056        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11057    }
11058
11059    impl Target {
11060        /// Gets the enum value.
11061        ///
11062        /// Returns `None` if the enum contains an unknown value deserialized from
11063        /// the string representation of enums.
11064        pub fn value(&self) -> std::option::Option<i32> {
11065            match self {
11066                Self::Unspecified => std::option::Option::Some(0),
11067                Self::Instance => std::option::Option::Some(1),
11068                Self::Internet => std::option::Option::Some(2),
11069                Self::GoogleApi => std::option::Option::Some(3),
11070                Self::GkeMaster => std::option::Option::Some(4),
11071                Self::CloudSqlInstance => std::option::Option::Some(5),
11072                Self::PscPublishedService => std::option::Option::Some(6),
11073                Self::PscGoogleApi => std::option::Option::Some(7),
11074                Self::PscVpcSc => std::option::Option::Some(8),
11075                Self::ServerlessNeg => std::option::Option::Some(9),
11076                Self::StorageBucket => std::option::Option::Some(10),
11077                Self::PrivateNetwork => std::option::Option::Some(11),
11078                Self::CloudFunction => std::option::Option::Some(12),
11079                Self::AppEngineVersion => std::option::Option::Some(13),
11080                Self::CloudRunRevision => std::option::Option::Some(14),
11081                Self::GoogleManagedService => std::option::Option::Some(15),
11082                Self::RedisInstance => std::option::Option::Some(16),
11083                Self::RedisCluster => std::option::Option::Some(17),
11084                Self::GkePod => std::option::Option::Some(19),
11085                Self::UnknownValue(u) => u.0.value(),
11086            }
11087        }
11088
11089        /// Gets the enum value as a string.
11090        ///
11091        /// Returns `None` if the enum contains an unknown value deserialized from
11092        /// the integer representation of enums.
11093        pub fn name(&self) -> std::option::Option<&str> {
11094            match self {
11095                Self::Unspecified => std::option::Option::Some("TARGET_UNSPECIFIED"),
11096                Self::Instance => std::option::Option::Some("INSTANCE"),
11097                Self::Internet => std::option::Option::Some("INTERNET"),
11098                Self::GoogleApi => std::option::Option::Some("GOOGLE_API"),
11099                Self::GkeMaster => std::option::Option::Some("GKE_MASTER"),
11100                Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
11101                Self::PscPublishedService => std::option::Option::Some("PSC_PUBLISHED_SERVICE"),
11102                Self::PscGoogleApi => std::option::Option::Some("PSC_GOOGLE_API"),
11103                Self::PscVpcSc => std::option::Option::Some("PSC_VPC_SC"),
11104                Self::ServerlessNeg => std::option::Option::Some("SERVERLESS_NEG"),
11105                Self::StorageBucket => std::option::Option::Some("STORAGE_BUCKET"),
11106                Self::PrivateNetwork => std::option::Option::Some("PRIVATE_NETWORK"),
11107                Self::CloudFunction => std::option::Option::Some("CLOUD_FUNCTION"),
11108                Self::AppEngineVersion => std::option::Option::Some("APP_ENGINE_VERSION"),
11109                Self::CloudRunRevision => std::option::Option::Some("CLOUD_RUN_REVISION"),
11110                Self::GoogleManagedService => std::option::Option::Some("GOOGLE_MANAGED_SERVICE"),
11111                Self::RedisInstance => std::option::Option::Some("REDIS_INSTANCE"),
11112                Self::RedisCluster => std::option::Option::Some("REDIS_CLUSTER"),
11113                Self::GkePod => std::option::Option::Some("GKE_POD"),
11114                Self::UnknownValue(u) => u.0.name(),
11115            }
11116        }
11117    }
11118
11119    impl std::default::Default for Target {
11120        fn default() -> Self {
11121            use std::convert::From;
11122            Self::from(0)
11123        }
11124    }
11125
11126    impl std::fmt::Display for Target {
11127        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11128            wkt::internal::display_enum(f, self.name(), self.value())
11129        }
11130    }
11131
11132    impl std::convert::From<i32> for Target {
11133        fn from(value: i32) -> Self {
11134            match value {
11135                0 => Self::Unspecified,
11136                1 => Self::Instance,
11137                2 => Self::Internet,
11138                3 => Self::GoogleApi,
11139                4 => Self::GkeMaster,
11140                5 => Self::CloudSqlInstance,
11141                6 => Self::PscPublishedService,
11142                7 => Self::PscGoogleApi,
11143                8 => Self::PscVpcSc,
11144                9 => Self::ServerlessNeg,
11145                10 => Self::StorageBucket,
11146                11 => Self::PrivateNetwork,
11147                12 => Self::CloudFunction,
11148                13 => Self::AppEngineVersion,
11149                14 => Self::CloudRunRevision,
11150                15 => Self::GoogleManagedService,
11151                16 => Self::RedisInstance,
11152                17 => Self::RedisCluster,
11153                19 => Self::GkePod,
11154                _ => Self::UnknownValue(target::UnknownValue(
11155                    wkt::internal::UnknownEnumValue::Integer(value),
11156                )),
11157            }
11158        }
11159    }
11160
11161    impl std::convert::From<&str> for Target {
11162        fn from(value: &str) -> Self {
11163            use std::string::ToString;
11164            match value {
11165                "TARGET_UNSPECIFIED" => Self::Unspecified,
11166                "INSTANCE" => Self::Instance,
11167                "INTERNET" => Self::Internet,
11168                "GOOGLE_API" => Self::GoogleApi,
11169                "GKE_MASTER" => Self::GkeMaster,
11170                "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
11171                "PSC_PUBLISHED_SERVICE" => Self::PscPublishedService,
11172                "PSC_GOOGLE_API" => Self::PscGoogleApi,
11173                "PSC_VPC_SC" => Self::PscVpcSc,
11174                "SERVERLESS_NEG" => Self::ServerlessNeg,
11175                "STORAGE_BUCKET" => Self::StorageBucket,
11176                "PRIVATE_NETWORK" => Self::PrivateNetwork,
11177                "CLOUD_FUNCTION" => Self::CloudFunction,
11178                "APP_ENGINE_VERSION" => Self::AppEngineVersion,
11179                "CLOUD_RUN_REVISION" => Self::CloudRunRevision,
11180                "GOOGLE_MANAGED_SERVICE" => Self::GoogleManagedService,
11181                "REDIS_INSTANCE" => Self::RedisInstance,
11182                "REDIS_CLUSTER" => Self::RedisCluster,
11183                "GKE_POD" => Self::GkePod,
11184                _ => Self::UnknownValue(target::UnknownValue(
11185                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11186                )),
11187            }
11188        }
11189    }
11190
11191    impl serde::ser::Serialize for Target {
11192        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11193        where
11194            S: serde::Serializer,
11195        {
11196            match self {
11197                Self::Unspecified => serializer.serialize_i32(0),
11198                Self::Instance => serializer.serialize_i32(1),
11199                Self::Internet => serializer.serialize_i32(2),
11200                Self::GoogleApi => serializer.serialize_i32(3),
11201                Self::GkeMaster => serializer.serialize_i32(4),
11202                Self::CloudSqlInstance => serializer.serialize_i32(5),
11203                Self::PscPublishedService => serializer.serialize_i32(6),
11204                Self::PscGoogleApi => serializer.serialize_i32(7),
11205                Self::PscVpcSc => serializer.serialize_i32(8),
11206                Self::ServerlessNeg => serializer.serialize_i32(9),
11207                Self::StorageBucket => serializer.serialize_i32(10),
11208                Self::PrivateNetwork => serializer.serialize_i32(11),
11209                Self::CloudFunction => serializer.serialize_i32(12),
11210                Self::AppEngineVersion => serializer.serialize_i32(13),
11211                Self::CloudRunRevision => serializer.serialize_i32(14),
11212                Self::GoogleManagedService => serializer.serialize_i32(15),
11213                Self::RedisInstance => serializer.serialize_i32(16),
11214                Self::RedisCluster => serializer.serialize_i32(17),
11215                Self::GkePod => serializer.serialize_i32(19),
11216                Self::UnknownValue(u) => u.0.serialize(serializer),
11217            }
11218        }
11219    }
11220
11221    impl<'de> serde::de::Deserialize<'de> for Target {
11222        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11223        where
11224            D: serde::Deserializer<'de>,
11225        {
11226            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Target>::new(
11227                ".google.cloud.networkmanagement.v1.DeliverInfo.Target",
11228            ))
11229        }
11230    }
11231
11232    /// Recognized type of a Google Service.
11233    ///
11234    /// # Working with unknown values
11235    ///
11236    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11237    /// additional enum variants at any time. Adding new variants is not considered
11238    /// a breaking change. Applications should write their code in anticipation of:
11239    ///
11240    /// - New values appearing in future releases of the client library, **and**
11241    /// - New values received dynamically, without application changes.
11242    ///
11243    /// Please consult the [Working with enums] section in the user guide for some
11244    /// guidelines.
11245    ///
11246    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11247    #[derive(Clone, Debug, PartialEq)]
11248    #[non_exhaustive]
11249    pub enum GoogleServiceType {
11250        /// Unspecified Google Service.
11251        Unspecified,
11252        /// Identity aware proxy.
11253        /// <https://cloud.google.com/iap/docs/using-tcp-forwarding>
11254        Iap,
11255        /// One of two services sharing IP ranges:
11256        ///
11257        /// * Load Balancer proxy
11258        /// * Centralized Health Check prober
11259        ///   <https://cloud.google.com/load-balancing/docs/firewall-rules>
11260        GfeProxyOrHealthCheckProber,
11261        /// Connectivity from Cloud DNS to forwarding targets or alternate name
11262        /// servers that use private routing.
11263        /// <https://cloud.google.com/dns/docs/zones/forwarding-zones#firewall-rules>
11264        /// <https://cloud.google.com/dns/docs/policies#firewall-rules>
11265        CloudDns,
11266        /// private.googleapis.com and restricted.googleapis.com
11267        PrivateGoogleAccess,
11268        /// Google API via Private Service Connect.
11269        /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
11270        /// Google API via Serverless VPC Access.
11271        /// <https://cloud.google.com/vpc/docs/serverless-vpc-access>
11272        ServerlessVpcAccess,
11273        /// If set, the enum was initialized with an unknown value.
11274        ///
11275        /// Applications can examine the value using [GoogleServiceType::value] or
11276        /// [GoogleServiceType::name].
11277        UnknownValue(google_service_type::UnknownValue),
11278    }
11279
11280    #[doc(hidden)]
11281    pub mod google_service_type {
11282        #[allow(unused_imports)]
11283        use super::*;
11284        #[derive(Clone, Debug, PartialEq)]
11285        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11286    }
11287
11288    impl GoogleServiceType {
11289        /// Gets the enum value.
11290        ///
11291        /// Returns `None` if the enum contains an unknown value deserialized from
11292        /// the string representation of enums.
11293        pub fn value(&self) -> std::option::Option<i32> {
11294            match self {
11295                Self::Unspecified => std::option::Option::Some(0),
11296                Self::Iap => std::option::Option::Some(1),
11297                Self::GfeProxyOrHealthCheckProber => std::option::Option::Some(2),
11298                Self::CloudDns => std::option::Option::Some(3),
11299                Self::PrivateGoogleAccess => std::option::Option::Some(4),
11300                Self::ServerlessVpcAccess => std::option::Option::Some(5),
11301                Self::UnknownValue(u) => u.0.value(),
11302            }
11303        }
11304
11305        /// Gets the enum value as a string.
11306        ///
11307        /// Returns `None` if the enum contains an unknown value deserialized from
11308        /// the integer representation of enums.
11309        pub fn name(&self) -> std::option::Option<&str> {
11310            match self {
11311                Self::Unspecified => std::option::Option::Some("GOOGLE_SERVICE_TYPE_UNSPECIFIED"),
11312                Self::Iap => std::option::Option::Some("IAP"),
11313                Self::GfeProxyOrHealthCheckProber => {
11314                    std::option::Option::Some("GFE_PROXY_OR_HEALTH_CHECK_PROBER")
11315                }
11316                Self::CloudDns => std::option::Option::Some("CLOUD_DNS"),
11317                Self::PrivateGoogleAccess => std::option::Option::Some("PRIVATE_GOOGLE_ACCESS"),
11318                Self::ServerlessVpcAccess => std::option::Option::Some("SERVERLESS_VPC_ACCESS"),
11319                Self::UnknownValue(u) => u.0.name(),
11320            }
11321        }
11322    }
11323
11324    impl std::default::Default for GoogleServiceType {
11325        fn default() -> Self {
11326            use std::convert::From;
11327            Self::from(0)
11328        }
11329    }
11330
11331    impl std::fmt::Display for GoogleServiceType {
11332        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11333            wkt::internal::display_enum(f, self.name(), self.value())
11334        }
11335    }
11336
11337    impl std::convert::From<i32> for GoogleServiceType {
11338        fn from(value: i32) -> Self {
11339            match value {
11340                0 => Self::Unspecified,
11341                1 => Self::Iap,
11342                2 => Self::GfeProxyOrHealthCheckProber,
11343                3 => Self::CloudDns,
11344                4 => Self::PrivateGoogleAccess,
11345                5 => Self::ServerlessVpcAccess,
11346                _ => Self::UnknownValue(google_service_type::UnknownValue(
11347                    wkt::internal::UnknownEnumValue::Integer(value),
11348                )),
11349            }
11350        }
11351    }
11352
11353    impl std::convert::From<&str> for GoogleServiceType {
11354        fn from(value: &str) -> Self {
11355            use std::string::ToString;
11356            match value {
11357                "GOOGLE_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
11358                "IAP" => Self::Iap,
11359                "GFE_PROXY_OR_HEALTH_CHECK_PROBER" => Self::GfeProxyOrHealthCheckProber,
11360                "CLOUD_DNS" => Self::CloudDns,
11361                "PRIVATE_GOOGLE_ACCESS" => Self::PrivateGoogleAccess,
11362                "SERVERLESS_VPC_ACCESS" => Self::ServerlessVpcAccess,
11363                _ => Self::UnknownValue(google_service_type::UnknownValue(
11364                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11365                )),
11366            }
11367        }
11368    }
11369
11370    impl serde::ser::Serialize for GoogleServiceType {
11371        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11372        where
11373            S: serde::Serializer,
11374        {
11375            match self {
11376                Self::Unspecified => serializer.serialize_i32(0),
11377                Self::Iap => serializer.serialize_i32(1),
11378                Self::GfeProxyOrHealthCheckProber => serializer.serialize_i32(2),
11379                Self::CloudDns => serializer.serialize_i32(3),
11380                Self::PrivateGoogleAccess => serializer.serialize_i32(4),
11381                Self::ServerlessVpcAccess => serializer.serialize_i32(5),
11382                Self::UnknownValue(u) => u.0.serialize(serializer),
11383            }
11384        }
11385    }
11386
11387    impl<'de> serde::de::Deserialize<'de> for GoogleServiceType {
11388        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11389        where
11390            D: serde::Deserializer<'de>,
11391        {
11392            deserializer.deserialize_any(wkt::internal::EnumVisitor::<GoogleServiceType>::new(
11393                ".google.cloud.networkmanagement.v1.DeliverInfo.GoogleServiceType",
11394            ))
11395        }
11396    }
11397}
11398
11399/// Details of the final state "forward" and associated resource.
11400#[derive(Clone, Default, PartialEq)]
11401#[non_exhaustive]
11402pub struct ForwardInfo {
11403    /// Target type where this packet is forwarded to.
11404    pub target: crate::model::forward_info::Target,
11405
11406    /// URI of the resource that the packet is forwarded to.
11407    pub resource_uri: std::string::String,
11408
11409    /// IP address of the target (if applicable).
11410    pub ip_address: std::string::String,
11411
11412    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11413}
11414
11415impl ForwardInfo {
11416    pub fn new() -> Self {
11417        std::default::Default::default()
11418    }
11419
11420    /// Sets the value of [target][crate::model::ForwardInfo::target].
11421    ///
11422    /// # Example
11423    /// ```ignore,no_run
11424    /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
11425    /// use google_cloud_networkmanagement_v1::model::forward_info::Target;
11426    /// let x0 = ForwardInfo::new().set_target(Target::PeeringVpc);
11427    /// let x1 = ForwardInfo::new().set_target(Target::VpnGateway);
11428    /// let x2 = ForwardInfo::new().set_target(Target::Interconnect);
11429    /// ```
11430    pub fn set_target<T: std::convert::Into<crate::model::forward_info::Target>>(
11431        mut self,
11432        v: T,
11433    ) -> Self {
11434        self.target = v.into();
11435        self
11436    }
11437
11438    /// Sets the value of [resource_uri][crate::model::ForwardInfo::resource_uri].
11439    ///
11440    /// # Example
11441    /// ```ignore,no_run
11442    /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
11443    /// let x = ForwardInfo::new().set_resource_uri("example");
11444    /// ```
11445    pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11446        self.resource_uri = v.into();
11447        self
11448    }
11449
11450    /// Sets the value of [ip_address][crate::model::ForwardInfo::ip_address].
11451    ///
11452    /// # Example
11453    /// ```ignore,no_run
11454    /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
11455    /// let x = ForwardInfo::new().set_ip_address("example");
11456    /// ```
11457    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11458        self.ip_address = v.into();
11459        self
11460    }
11461}
11462
11463impl wkt::message::Message for ForwardInfo {
11464    fn typename() -> &'static str {
11465        "type.googleapis.com/google.cloud.networkmanagement.v1.ForwardInfo"
11466    }
11467}
11468
11469/// Defines additional types related to [ForwardInfo].
11470pub mod forward_info {
11471    #[allow(unused_imports)]
11472    use super::*;
11473
11474    /// Forward target types.
11475    ///
11476    /// # Working with unknown values
11477    ///
11478    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11479    /// additional enum variants at any time. Adding new variants is not considered
11480    /// a breaking change. Applications should write their code in anticipation of:
11481    ///
11482    /// - New values appearing in future releases of the client library, **and**
11483    /// - New values received dynamically, without application changes.
11484    ///
11485    /// Please consult the [Working with enums] section in the user guide for some
11486    /// guidelines.
11487    ///
11488    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11489    #[derive(Clone, Debug, PartialEq)]
11490    #[non_exhaustive]
11491    pub enum Target {
11492        /// Target not specified.
11493        Unspecified,
11494        /// Forwarded to a VPC peering network.
11495        PeeringVpc,
11496        /// Forwarded to a Cloud VPN gateway.
11497        VpnGateway,
11498        /// Forwarded to a Cloud Interconnect connection.
11499        Interconnect,
11500        /// Forwarded to a Google Kubernetes Engine Container cluster master.
11501        #[deprecated]
11502        GkeMaster,
11503        /// Forwarded to the next hop of a custom route imported from a peering VPC.
11504        ImportedCustomRouteNextHop,
11505        /// Forwarded to a Cloud SQL instance.
11506        #[deprecated]
11507        CloudSqlInstance,
11508        /// Forwarded to a VPC network in another project.
11509        AnotherProject,
11510        /// Forwarded to an NCC Hub.
11511        NccHub,
11512        /// Forwarded to a router appliance.
11513        RouterAppliance,
11514        /// Forwarded to a Secure Web Proxy Gateway.
11515        SecureWebProxyGateway,
11516        /// If set, the enum was initialized with an unknown value.
11517        ///
11518        /// Applications can examine the value using [Target::value] or
11519        /// [Target::name].
11520        UnknownValue(target::UnknownValue),
11521    }
11522
11523    #[doc(hidden)]
11524    pub mod target {
11525        #[allow(unused_imports)]
11526        use super::*;
11527        #[derive(Clone, Debug, PartialEq)]
11528        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11529    }
11530
11531    impl Target {
11532        /// Gets the enum value.
11533        ///
11534        /// Returns `None` if the enum contains an unknown value deserialized from
11535        /// the string representation of enums.
11536        pub fn value(&self) -> std::option::Option<i32> {
11537            match self {
11538                Self::Unspecified => std::option::Option::Some(0),
11539                Self::PeeringVpc => std::option::Option::Some(1),
11540                Self::VpnGateway => std::option::Option::Some(2),
11541                Self::Interconnect => std::option::Option::Some(3),
11542                Self::GkeMaster => std::option::Option::Some(4),
11543                Self::ImportedCustomRouteNextHop => std::option::Option::Some(5),
11544                Self::CloudSqlInstance => std::option::Option::Some(6),
11545                Self::AnotherProject => std::option::Option::Some(7),
11546                Self::NccHub => std::option::Option::Some(8),
11547                Self::RouterAppliance => std::option::Option::Some(9),
11548                Self::SecureWebProxyGateway => std::option::Option::Some(10),
11549                Self::UnknownValue(u) => u.0.value(),
11550            }
11551        }
11552
11553        /// Gets the enum value as a string.
11554        ///
11555        /// Returns `None` if the enum contains an unknown value deserialized from
11556        /// the integer representation of enums.
11557        pub fn name(&self) -> std::option::Option<&str> {
11558            match self {
11559                Self::Unspecified => std::option::Option::Some("TARGET_UNSPECIFIED"),
11560                Self::PeeringVpc => std::option::Option::Some("PEERING_VPC"),
11561                Self::VpnGateway => std::option::Option::Some("VPN_GATEWAY"),
11562                Self::Interconnect => std::option::Option::Some("INTERCONNECT"),
11563                Self::GkeMaster => std::option::Option::Some("GKE_MASTER"),
11564                Self::ImportedCustomRouteNextHop => {
11565                    std::option::Option::Some("IMPORTED_CUSTOM_ROUTE_NEXT_HOP")
11566                }
11567                Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
11568                Self::AnotherProject => std::option::Option::Some("ANOTHER_PROJECT"),
11569                Self::NccHub => std::option::Option::Some("NCC_HUB"),
11570                Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
11571                Self::SecureWebProxyGateway => {
11572                    std::option::Option::Some("SECURE_WEB_PROXY_GATEWAY")
11573                }
11574                Self::UnknownValue(u) => u.0.name(),
11575            }
11576        }
11577    }
11578
11579    impl std::default::Default for Target {
11580        fn default() -> Self {
11581            use std::convert::From;
11582            Self::from(0)
11583        }
11584    }
11585
11586    impl std::fmt::Display for Target {
11587        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11588            wkt::internal::display_enum(f, self.name(), self.value())
11589        }
11590    }
11591
11592    impl std::convert::From<i32> for Target {
11593        fn from(value: i32) -> Self {
11594            match value {
11595                0 => Self::Unspecified,
11596                1 => Self::PeeringVpc,
11597                2 => Self::VpnGateway,
11598                3 => Self::Interconnect,
11599                4 => Self::GkeMaster,
11600                5 => Self::ImportedCustomRouteNextHop,
11601                6 => Self::CloudSqlInstance,
11602                7 => Self::AnotherProject,
11603                8 => Self::NccHub,
11604                9 => Self::RouterAppliance,
11605                10 => Self::SecureWebProxyGateway,
11606                _ => Self::UnknownValue(target::UnknownValue(
11607                    wkt::internal::UnknownEnumValue::Integer(value),
11608                )),
11609            }
11610        }
11611    }
11612
11613    impl std::convert::From<&str> for Target {
11614        fn from(value: &str) -> Self {
11615            use std::string::ToString;
11616            match value {
11617                "TARGET_UNSPECIFIED" => Self::Unspecified,
11618                "PEERING_VPC" => Self::PeeringVpc,
11619                "VPN_GATEWAY" => Self::VpnGateway,
11620                "INTERCONNECT" => Self::Interconnect,
11621                "GKE_MASTER" => Self::GkeMaster,
11622                "IMPORTED_CUSTOM_ROUTE_NEXT_HOP" => Self::ImportedCustomRouteNextHop,
11623                "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
11624                "ANOTHER_PROJECT" => Self::AnotherProject,
11625                "NCC_HUB" => Self::NccHub,
11626                "ROUTER_APPLIANCE" => Self::RouterAppliance,
11627                "SECURE_WEB_PROXY_GATEWAY" => Self::SecureWebProxyGateway,
11628                _ => Self::UnknownValue(target::UnknownValue(
11629                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11630                )),
11631            }
11632        }
11633    }
11634
11635    impl serde::ser::Serialize for Target {
11636        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11637        where
11638            S: serde::Serializer,
11639        {
11640            match self {
11641                Self::Unspecified => serializer.serialize_i32(0),
11642                Self::PeeringVpc => serializer.serialize_i32(1),
11643                Self::VpnGateway => serializer.serialize_i32(2),
11644                Self::Interconnect => serializer.serialize_i32(3),
11645                Self::GkeMaster => serializer.serialize_i32(4),
11646                Self::ImportedCustomRouteNextHop => serializer.serialize_i32(5),
11647                Self::CloudSqlInstance => serializer.serialize_i32(6),
11648                Self::AnotherProject => serializer.serialize_i32(7),
11649                Self::NccHub => serializer.serialize_i32(8),
11650                Self::RouterAppliance => serializer.serialize_i32(9),
11651                Self::SecureWebProxyGateway => serializer.serialize_i32(10),
11652                Self::UnknownValue(u) => u.0.serialize(serializer),
11653            }
11654        }
11655    }
11656
11657    impl<'de> serde::de::Deserialize<'de> for Target {
11658        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11659        where
11660            D: serde::Deserializer<'de>,
11661        {
11662            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Target>::new(
11663                ".google.cloud.networkmanagement.v1.ForwardInfo.Target",
11664            ))
11665        }
11666    }
11667}
11668
11669/// Details of the final state "abort" and associated resource.
11670#[derive(Clone, Default, PartialEq)]
11671#[non_exhaustive]
11672pub struct AbortInfo {
11673    /// Causes that the analysis is aborted.
11674    pub cause: crate::model::abort_info::Cause,
11675
11676    /// URI of the resource that caused the abort.
11677    pub resource_uri: std::string::String,
11678
11679    /// IP address that caused the abort.
11680    pub ip_address: std::string::String,
11681
11682    /// List of project IDs the user specified in the request but lacks access to.
11683    /// In this case, analysis is aborted with the PERMISSION_DENIED cause.
11684    pub projects_missing_permission: std::vec::Vec<std::string::String>,
11685
11686    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11687}
11688
11689impl AbortInfo {
11690    pub fn new() -> Self {
11691        std::default::Default::default()
11692    }
11693
11694    /// Sets the value of [cause][crate::model::AbortInfo::cause].
11695    ///
11696    /// # Example
11697    /// ```ignore,no_run
11698    /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11699    /// use google_cloud_networkmanagement_v1::model::abort_info::Cause;
11700    /// let x0 = AbortInfo::new().set_cause(Cause::UnknownIp);
11701    /// let x1 = AbortInfo::new().set_cause(Cause::GoogleManagedServiceUnknownIp);
11702    /// let x2 = AbortInfo::new().set_cause(Cause::SourceIpAddressNotInSourceNetwork);
11703    /// ```
11704    pub fn set_cause<T: std::convert::Into<crate::model::abort_info::Cause>>(
11705        mut self,
11706        v: T,
11707    ) -> Self {
11708        self.cause = v.into();
11709        self
11710    }
11711
11712    /// Sets the value of [resource_uri][crate::model::AbortInfo::resource_uri].
11713    ///
11714    /// # Example
11715    /// ```ignore,no_run
11716    /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11717    /// let x = AbortInfo::new().set_resource_uri("example");
11718    /// ```
11719    pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11720        self.resource_uri = v.into();
11721        self
11722    }
11723
11724    /// Sets the value of [ip_address][crate::model::AbortInfo::ip_address].
11725    ///
11726    /// # Example
11727    /// ```ignore,no_run
11728    /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11729    /// let x = AbortInfo::new().set_ip_address("example");
11730    /// ```
11731    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11732        self.ip_address = v.into();
11733        self
11734    }
11735
11736    /// Sets the value of [projects_missing_permission][crate::model::AbortInfo::projects_missing_permission].
11737    ///
11738    /// # Example
11739    /// ```ignore,no_run
11740    /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11741    /// let x = AbortInfo::new().set_projects_missing_permission(["a", "b", "c"]);
11742    /// ```
11743    pub fn set_projects_missing_permission<T, V>(mut self, v: T) -> Self
11744    where
11745        T: std::iter::IntoIterator<Item = V>,
11746        V: std::convert::Into<std::string::String>,
11747    {
11748        use std::iter::Iterator;
11749        self.projects_missing_permission = v.into_iter().map(|i| i.into()).collect();
11750        self
11751    }
11752}
11753
11754impl wkt::message::Message for AbortInfo {
11755    fn typename() -> &'static str {
11756        "type.googleapis.com/google.cloud.networkmanagement.v1.AbortInfo"
11757    }
11758}
11759
11760/// Defines additional types related to [AbortInfo].
11761pub mod abort_info {
11762    #[allow(unused_imports)]
11763    use super::*;
11764
11765    /// Abort cause types:
11766    ///
11767    /// # Working with unknown values
11768    ///
11769    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11770    /// additional enum variants at any time. Adding new variants is not considered
11771    /// a breaking change. Applications should write their code in anticipation of:
11772    ///
11773    /// - New values appearing in future releases of the client library, **and**
11774    /// - New values received dynamically, without application changes.
11775    ///
11776    /// Please consult the [Working with enums] section in the user guide for some
11777    /// guidelines.
11778    ///
11779    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11780    #[derive(Clone, Debug, PartialEq)]
11781    #[non_exhaustive]
11782    pub enum Cause {
11783        /// Cause is unspecified.
11784        Unspecified,
11785        /// Aborted due to unknown network. Deprecated, not used in the new tests.
11786        #[deprecated]
11787        UnknownNetwork,
11788        /// Aborted because no project information can be derived from the test
11789        /// input. Deprecated, not used in the new tests.
11790        #[deprecated]
11791        UnknownProject,
11792        /// Aborted because traffic is sent from a public IP to an instance without
11793        /// an external IP. Deprecated, not used in the new tests.
11794        #[deprecated]
11795        NoExternalIp,
11796        /// Aborted because none of the traces matches destination information
11797        /// specified in the input test request. Deprecated, not used in the new
11798        /// tests.
11799        #[deprecated]
11800        UnintendedDestination,
11801        /// Aborted because the source endpoint could not be found. Deprecated, not
11802        /// used in the new tests.
11803        #[deprecated]
11804        SourceEndpointNotFound,
11805        /// Aborted because the source network does not match the source endpoint.
11806        /// Deprecated, not used in the new tests.
11807        #[deprecated]
11808        MismatchedSourceNetwork,
11809        /// Aborted because the destination endpoint could not be found. Deprecated,
11810        /// not used in the new tests.
11811        #[deprecated]
11812        DestinationEndpointNotFound,
11813        /// Aborted because the destination network does not match the destination
11814        /// endpoint. Deprecated, not used in the new tests.
11815        #[deprecated]
11816        MismatchedDestinationNetwork,
11817        /// Aborted because no endpoint with the packet's destination IP address is
11818        /// found.
11819        UnknownIp,
11820        /// Aborted because no endpoint with the packet's destination IP is found in
11821        /// the Google-managed project.
11822        GoogleManagedServiceUnknownIp,
11823        /// Aborted because the source IP address doesn't belong to any of the
11824        /// subnets of the source VPC network.
11825        SourceIpAddressNotInSourceNetwork,
11826        /// Aborted because user lacks permission to access all or part of the
11827        /// network configurations required to run the test.
11828        PermissionDenied,
11829        /// Aborted because user lacks permission to access Cloud NAT configs
11830        /// required to run the test.
11831        PermissionDeniedNoCloudNatConfigs,
11832        /// Aborted because user lacks permission to access Network endpoint group
11833        /// endpoint configs required to run the test.
11834        PermissionDeniedNoNegEndpointConfigs,
11835        /// Aborted because user lacks permission to access Cloud Router configs
11836        /// required to run the test.
11837        PermissionDeniedNoCloudRouterConfigs,
11838        /// Aborted because no valid source or destination endpoint can be derived
11839        /// from the test request.
11840        NoSourceLocation,
11841        /// Aborted because the source IP address is not contained within the subnet
11842        /// ranges of the provided VPC network.
11843        NoSourceGcpNetworkLocation,
11844        /// Aborted because the source IP address is not contained within the
11845        /// destination ranges of the routes towards non-GCP networks in the provided
11846        /// VPC network.
11847        NoSourceNonGcpNetworkLocation,
11848        /// Aborted because the source IP address can't be resolved as an Internet
11849        /// IP address.
11850        NoSourceInternetLocation,
11851        /// Aborted because the source or destination endpoint specified in
11852        /// the request is invalid. Some examples:
11853        ///
11854        /// - The request might contain malformed resource URI, project ID, or IP
11855        ///   address.
11856        /// - The request might contain inconsistent information (for example, the
11857        ///   request might include both the instance and the network, but the instance
11858        ///   might not have a NIC in that network).
11859        InvalidArgument,
11860        /// Aborted because the number of steps in the trace exceeds a certain
11861        /// limit. It might be caused by a routing loop.
11862        TraceTooLong,
11863        /// Aborted due to internal server error.
11864        InternalError,
11865        /// Aborted because the test scenario is not supported.
11866        Unsupported,
11867        /// Aborted because the source and destination resources have no common IP
11868        /// version.
11869        MismatchedIpVersion,
11870        /// Aborted because the connection between the control plane and the node of
11871        /// the source cluster is initiated by the node and managed by the
11872        /// Konnectivity proxy.
11873        GkeKonnectivityProxyUnsupported,
11874        /// Aborted because expected resource configuration was missing.
11875        ResourceConfigNotFound,
11876        /// Aborted because expected VM instance configuration was missing.
11877        VmInstanceConfigNotFound,
11878        /// Aborted because expected network configuration was missing.
11879        NetworkConfigNotFound,
11880        /// Aborted because expected firewall configuration was missing.
11881        FirewallConfigNotFound,
11882        /// Aborted because expected route configuration was missing.
11883        RouteConfigNotFound,
11884        /// Aborted because PSC endpoint selection for the Google-managed service
11885        /// is ambiguous (several PSC endpoints satisfy test input).
11886        GoogleManagedServiceAmbiguousPscEndpoint,
11887        /// Aborted because endpoint selection for the Google-managed service is
11888        /// ambiguous (several endpoints satisfy test input).
11889        GoogleManagedServiceAmbiguousEndpoint,
11890        /// Aborted because tests with a PSC-based Cloud SQL instance as a source are
11891        /// not supported.
11892        SourcePscCloudSqlUnsupported,
11893        /// Aborted because tests with the external database as a source are not
11894        /// supported. In such replication scenarios, the connection is initiated by
11895        /// the Cloud SQL replica instance.
11896        SourceExternalCloudSqlUnsupported,
11897        /// Aborted because tests with a Redis Cluster as a source are not supported.
11898        SourceRedisClusterUnsupported,
11899        /// Aborted because tests with a Redis Instance as a source are not
11900        /// supported.
11901        SourceRedisInstanceUnsupported,
11902        /// Aborted because tests with a forwarding rule as a source are not
11903        /// supported.
11904        SourceForwardingRuleUnsupported,
11905        /// Aborted because one of the endpoints is a non-routable IP address
11906        /// (loopback, link-local, etc).
11907        NonRoutableIpAddress,
11908        /// Aborted due to an unknown issue in the Google-managed project.
11909        UnknownIssueInGoogleManagedProject,
11910        /// Aborted due to an unsupported configuration of the Google-managed
11911        /// project.
11912        UnsupportedGoogleManagedProjectConfig,
11913        /// Aborted because the source endpoint is a Cloud Run revision with direct
11914        /// VPC access enabled, but there are no reserved serverless IP ranges.
11915        NoServerlessIpRanges,
11916        /// Aborted because the used protocol is not supported for the used IP
11917        /// version.
11918        IpVersionProtocolMismatch,
11919        /// Aborted because selected GKE Pod endpoint location is unknown. This is
11920        /// often the case for "Pending" Pods, which don't have assigned IP addresses
11921        /// yet.
11922        GkePodUnknownEndpointLocation,
11923        /// If set, the enum was initialized with an unknown value.
11924        ///
11925        /// Applications can examine the value using [Cause::value] or
11926        /// [Cause::name].
11927        UnknownValue(cause::UnknownValue),
11928    }
11929
11930    #[doc(hidden)]
11931    pub mod cause {
11932        #[allow(unused_imports)]
11933        use super::*;
11934        #[derive(Clone, Debug, PartialEq)]
11935        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11936    }
11937
11938    impl Cause {
11939        /// Gets the enum value.
11940        ///
11941        /// Returns `None` if the enum contains an unknown value deserialized from
11942        /// the string representation of enums.
11943        pub fn value(&self) -> std::option::Option<i32> {
11944            match self {
11945                Self::Unspecified => std::option::Option::Some(0),
11946                Self::UnknownNetwork => std::option::Option::Some(1),
11947                Self::UnknownProject => std::option::Option::Some(3),
11948                Self::NoExternalIp => std::option::Option::Some(7),
11949                Self::UnintendedDestination => std::option::Option::Some(8),
11950                Self::SourceEndpointNotFound => std::option::Option::Some(11),
11951                Self::MismatchedSourceNetwork => std::option::Option::Some(12),
11952                Self::DestinationEndpointNotFound => std::option::Option::Some(13),
11953                Self::MismatchedDestinationNetwork => std::option::Option::Some(14),
11954                Self::UnknownIp => std::option::Option::Some(2),
11955                Self::GoogleManagedServiceUnknownIp => std::option::Option::Some(32),
11956                Self::SourceIpAddressNotInSourceNetwork => std::option::Option::Some(23),
11957                Self::PermissionDenied => std::option::Option::Some(4),
11958                Self::PermissionDeniedNoCloudNatConfigs => std::option::Option::Some(28),
11959                Self::PermissionDeniedNoNegEndpointConfigs => std::option::Option::Some(29),
11960                Self::PermissionDeniedNoCloudRouterConfigs => std::option::Option::Some(36),
11961                Self::NoSourceLocation => std::option::Option::Some(5),
11962                Self::NoSourceGcpNetworkLocation => std::option::Option::Some(42),
11963                Self::NoSourceNonGcpNetworkLocation => std::option::Option::Some(43),
11964                Self::NoSourceInternetLocation => std::option::Option::Some(44),
11965                Self::InvalidArgument => std::option::Option::Some(6),
11966                Self::TraceTooLong => std::option::Option::Some(9),
11967                Self::InternalError => std::option::Option::Some(10),
11968                Self::Unsupported => std::option::Option::Some(15),
11969                Self::MismatchedIpVersion => std::option::Option::Some(16),
11970                Self::GkeKonnectivityProxyUnsupported => std::option::Option::Some(17),
11971                Self::ResourceConfigNotFound => std::option::Option::Some(18),
11972                Self::VmInstanceConfigNotFound => std::option::Option::Some(24),
11973                Self::NetworkConfigNotFound => std::option::Option::Some(25),
11974                Self::FirewallConfigNotFound => std::option::Option::Some(26),
11975                Self::RouteConfigNotFound => std::option::Option::Some(27),
11976                Self::GoogleManagedServiceAmbiguousPscEndpoint => std::option::Option::Some(19),
11977                Self::GoogleManagedServiceAmbiguousEndpoint => std::option::Option::Some(39),
11978                Self::SourcePscCloudSqlUnsupported => std::option::Option::Some(20),
11979                Self::SourceExternalCloudSqlUnsupported => std::option::Option::Some(45),
11980                Self::SourceRedisClusterUnsupported => std::option::Option::Some(34),
11981                Self::SourceRedisInstanceUnsupported => std::option::Option::Some(35),
11982                Self::SourceForwardingRuleUnsupported => std::option::Option::Some(21),
11983                Self::NonRoutableIpAddress => std::option::Option::Some(22),
11984                Self::UnknownIssueInGoogleManagedProject => std::option::Option::Some(30),
11985                Self::UnsupportedGoogleManagedProjectConfig => std::option::Option::Some(31),
11986                Self::NoServerlessIpRanges => std::option::Option::Some(37),
11987                Self::IpVersionProtocolMismatch => std::option::Option::Some(40),
11988                Self::GkePodUnknownEndpointLocation => std::option::Option::Some(41),
11989                Self::UnknownValue(u) => u.0.value(),
11990            }
11991        }
11992
11993        /// Gets the enum value as a string.
11994        ///
11995        /// Returns `None` if the enum contains an unknown value deserialized from
11996        /// the integer representation of enums.
11997        pub fn name(&self) -> std::option::Option<&str> {
11998            match self {
11999                Self::Unspecified => std::option::Option::Some("CAUSE_UNSPECIFIED"),
12000                Self::UnknownNetwork => std::option::Option::Some("UNKNOWN_NETWORK"),
12001                Self::UnknownProject => std::option::Option::Some("UNKNOWN_PROJECT"),
12002                Self::NoExternalIp => std::option::Option::Some("NO_EXTERNAL_IP"),
12003                Self::UnintendedDestination => std::option::Option::Some("UNINTENDED_DESTINATION"),
12004                Self::SourceEndpointNotFound => {
12005                    std::option::Option::Some("SOURCE_ENDPOINT_NOT_FOUND")
12006                }
12007                Self::MismatchedSourceNetwork => {
12008                    std::option::Option::Some("MISMATCHED_SOURCE_NETWORK")
12009                }
12010                Self::DestinationEndpointNotFound => {
12011                    std::option::Option::Some("DESTINATION_ENDPOINT_NOT_FOUND")
12012                }
12013                Self::MismatchedDestinationNetwork => {
12014                    std::option::Option::Some("MISMATCHED_DESTINATION_NETWORK")
12015                }
12016                Self::UnknownIp => std::option::Option::Some("UNKNOWN_IP"),
12017                Self::GoogleManagedServiceUnknownIp => {
12018                    std::option::Option::Some("GOOGLE_MANAGED_SERVICE_UNKNOWN_IP")
12019                }
12020                Self::SourceIpAddressNotInSourceNetwork => {
12021                    std::option::Option::Some("SOURCE_IP_ADDRESS_NOT_IN_SOURCE_NETWORK")
12022                }
12023                Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
12024                Self::PermissionDeniedNoCloudNatConfigs => {
12025                    std::option::Option::Some("PERMISSION_DENIED_NO_CLOUD_NAT_CONFIGS")
12026                }
12027                Self::PermissionDeniedNoNegEndpointConfigs => {
12028                    std::option::Option::Some("PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS")
12029                }
12030                Self::PermissionDeniedNoCloudRouterConfigs => {
12031                    std::option::Option::Some("PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS")
12032                }
12033                Self::NoSourceLocation => std::option::Option::Some("NO_SOURCE_LOCATION"),
12034                Self::NoSourceGcpNetworkLocation => {
12035                    std::option::Option::Some("NO_SOURCE_GCP_NETWORK_LOCATION")
12036                }
12037                Self::NoSourceNonGcpNetworkLocation => {
12038                    std::option::Option::Some("NO_SOURCE_NON_GCP_NETWORK_LOCATION")
12039                }
12040                Self::NoSourceInternetLocation => {
12041                    std::option::Option::Some("NO_SOURCE_INTERNET_LOCATION")
12042                }
12043                Self::InvalidArgument => std::option::Option::Some("INVALID_ARGUMENT"),
12044                Self::TraceTooLong => std::option::Option::Some("TRACE_TOO_LONG"),
12045                Self::InternalError => std::option::Option::Some("INTERNAL_ERROR"),
12046                Self::Unsupported => std::option::Option::Some("UNSUPPORTED"),
12047                Self::MismatchedIpVersion => std::option::Option::Some("MISMATCHED_IP_VERSION"),
12048                Self::GkeKonnectivityProxyUnsupported => {
12049                    std::option::Option::Some("GKE_KONNECTIVITY_PROXY_UNSUPPORTED")
12050                }
12051                Self::ResourceConfigNotFound => {
12052                    std::option::Option::Some("RESOURCE_CONFIG_NOT_FOUND")
12053                }
12054                Self::VmInstanceConfigNotFound => {
12055                    std::option::Option::Some("VM_INSTANCE_CONFIG_NOT_FOUND")
12056                }
12057                Self::NetworkConfigNotFound => {
12058                    std::option::Option::Some("NETWORK_CONFIG_NOT_FOUND")
12059                }
12060                Self::FirewallConfigNotFound => {
12061                    std::option::Option::Some("FIREWALL_CONFIG_NOT_FOUND")
12062                }
12063                Self::RouteConfigNotFound => std::option::Option::Some("ROUTE_CONFIG_NOT_FOUND"),
12064                Self::GoogleManagedServiceAmbiguousPscEndpoint => {
12065                    std::option::Option::Some("GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT")
12066                }
12067                Self::GoogleManagedServiceAmbiguousEndpoint => {
12068                    std::option::Option::Some("GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT")
12069                }
12070                Self::SourcePscCloudSqlUnsupported => {
12071                    std::option::Option::Some("SOURCE_PSC_CLOUD_SQL_UNSUPPORTED")
12072                }
12073                Self::SourceExternalCloudSqlUnsupported => {
12074                    std::option::Option::Some("SOURCE_EXTERNAL_CLOUD_SQL_UNSUPPORTED")
12075                }
12076                Self::SourceRedisClusterUnsupported => {
12077                    std::option::Option::Some("SOURCE_REDIS_CLUSTER_UNSUPPORTED")
12078                }
12079                Self::SourceRedisInstanceUnsupported => {
12080                    std::option::Option::Some("SOURCE_REDIS_INSTANCE_UNSUPPORTED")
12081                }
12082                Self::SourceForwardingRuleUnsupported => {
12083                    std::option::Option::Some("SOURCE_FORWARDING_RULE_UNSUPPORTED")
12084                }
12085                Self::NonRoutableIpAddress => std::option::Option::Some("NON_ROUTABLE_IP_ADDRESS"),
12086                Self::UnknownIssueInGoogleManagedProject => {
12087                    std::option::Option::Some("UNKNOWN_ISSUE_IN_GOOGLE_MANAGED_PROJECT")
12088                }
12089                Self::UnsupportedGoogleManagedProjectConfig => {
12090                    std::option::Option::Some("UNSUPPORTED_GOOGLE_MANAGED_PROJECT_CONFIG")
12091                }
12092                Self::NoServerlessIpRanges => std::option::Option::Some("NO_SERVERLESS_IP_RANGES"),
12093                Self::IpVersionProtocolMismatch => {
12094                    std::option::Option::Some("IP_VERSION_PROTOCOL_MISMATCH")
12095                }
12096                Self::GkePodUnknownEndpointLocation => {
12097                    std::option::Option::Some("GKE_POD_UNKNOWN_ENDPOINT_LOCATION")
12098                }
12099                Self::UnknownValue(u) => u.0.name(),
12100            }
12101        }
12102    }
12103
12104    impl std::default::Default for Cause {
12105        fn default() -> Self {
12106            use std::convert::From;
12107            Self::from(0)
12108        }
12109    }
12110
12111    impl std::fmt::Display for Cause {
12112        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12113            wkt::internal::display_enum(f, self.name(), self.value())
12114        }
12115    }
12116
12117    impl std::convert::From<i32> for Cause {
12118        fn from(value: i32) -> Self {
12119            match value {
12120                0 => Self::Unspecified,
12121                1 => Self::UnknownNetwork,
12122                2 => Self::UnknownIp,
12123                3 => Self::UnknownProject,
12124                4 => Self::PermissionDenied,
12125                5 => Self::NoSourceLocation,
12126                6 => Self::InvalidArgument,
12127                7 => Self::NoExternalIp,
12128                8 => Self::UnintendedDestination,
12129                9 => Self::TraceTooLong,
12130                10 => Self::InternalError,
12131                11 => Self::SourceEndpointNotFound,
12132                12 => Self::MismatchedSourceNetwork,
12133                13 => Self::DestinationEndpointNotFound,
12134                14 => Self::MismatchedDestinationNetwork,
12135                15 => Self::Unsupported,
12136                16 => Self::MismatchedIpVersion,
12137                17 => Self::GkeKonnectivityProxyUnsupported,
12138                18 => Self::ResourceConfigNotFound,
12139                19 => Self::GoogleManagedServiceAmbiguousPscEndpoint,
12140                20 => Self::SourcePscCloudSqlUnsupported,
12141                21 => Self::SourceForwardingRuleUnsupported,
12142                22 => Self::NonRoutableIpAddress,
12143                23 => Self::SourceIpAddressNotInSourceNetwork,
12144                24 => Self::VmInstanceConfigNotFound,
12145                25 => Self::NetworkConfigNotFound,
12146                26 => Self::FirewallConfigNotFound,
12147                27 => Self::RouteConfigNotFound,
12148                28 => Self::PermissionDeniedNoCloudNatConfigs,
12149                29 => Self::PermissionDeniedNoNegEndpointConfigs,
12150                30 => Self::UnknownIssueInGoogleManagedProject,
12151                31 => Self::UnsupportedGoogleManagedProjectConfig,
12152                32 => Self::GoogleManagedServiceUnknownIp,
12153                34 => Self::SourceRedisClusterUnsupported,
12154                35 => Self::SourceRedisInstanceUnsupported,
12155                36 => Self::PermissionDeniedNoCloudRouterConfigs,
12156                37 => Self::NoServerlessIpRanges,
12157                39 => Self::GoogleManagedServiceAmbiguousEndpoint,
12158                40 => Self::IpVersionProtocolMismatch,
12159                41 => Self::GkePodUnknownEndpointLocation,
12160                42 => Self::NoSourceGcpNetworkLocation,
12161                43 => Self::NoSourceNonGcpNetworkLocation,
12162                44 => Self::NoSourceInternetLocation,
12163                45 => Self::SourceExternalCloudSqlUnsupported,
12164                _ => Self::UnknownValue(cause::UnknownValue(
12165                    wkt::internal::UnknownEnumValue::Integer(value),
12166                )),
12167            }
12168        }
12169    }
12170
12171    impl std::convert::From<&str> for Cause {
12172        fn from(value: &str) -> Self {
12173            use std::string::ToString;
12174            match value {
12175                "CAUSE_UNSPECIFIED" => Self::Unspecified,
12176                "UNKNOWN_NETWORK" => Self::UnknownNetwork,
12177                "UNKNOWN_PROJECT" => Self::UnknownProject,
12178                "NO_EXTERNAL_IP" => Self::NoExternalIp,
12179                "UNINTENDED_DESTINATION" => Self::UnintendedDestination,
12180                "SOURCE_ENDPOINT_NOT_FOUND" => Self::SourceEndpointNotFound,
12181                "MISMATCHED_SOURCE_NETWORK" => Self::MismatchedSourceNetwork,
12182                "DESTINATION_ENDPOINT_NOT_FOUND" => Self::DestinationEndpointNotFound,
12183                "MISMATCHED_DESTINATION_NETWORK" => Self::MismatchedDestinationNetwork,
12184                "UNKNOWN_IP" => Self::UnknownIp,
12185                "GOOGLE_MANAGED_SERVICE_UNKNOWN_IP" => Self::GoogleManagedServiceUnknownIp,
12186                "SOURCE_IP_ADDRESS_NOT_IN_SOURCE_NETWORK" => {
12187                    Self::SourceIpAddressNotInSourceNetwork
12188                }
12189                "PERMISSION_DENIED" => Self::PermissionDenied,
12190                "PERMISSION_DENIED_NO_CLOUD_NAT_CONFIGS" => Self::PermissionDeniedNoCloudNatConfigs,
12191                "PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS" => {
12192                    Self::PermissionDeniedNoNegEndpointConfigs
12193                }
12194                "PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS" => {
12195                    Self::PermissionDeniedNoCloudRouterConfigs
12196                }
12197                "NO_SOURCE_LOCATION" => Self::NoSourceLocation,
12198                "NO_SOURCE_GCP_NETWORK_LOCATION" => Self::NoSourceGcpNetworkLocation,
12199                "NO_SOURCE_NON_GCP_NETWORK_LOCATION" => Self::NoSourceNonGcpNetworkLocation,
12200                "NO_SOURCE_INTERNET_LOCATION" => Self::NoSourceInternetLocation,
12201                "INVALID_ARGUMENT" => Self::InvalidArgument,
12202                "TRACE_TOO_LONG" => Self::TraceTooLong,
12203                "INTERNAL_ERROR" => Self::InternalError,
12204                "UNSUPPORTED" => Self::Unsupported,
12205                "MISMATCHED_IP_VERSION" => Self::MismatchedIpVersion,
12206                "GKE_KONNECTIVITY_PROXY_UNSUPPORTED" => Self::GkeKonnectivityProxyUnsupported,
12207                "RESOURCE_CONFIG_NOT_FOUND" => Self::ResourceConfigNotFound,
12208                "VM_INSTANCE_CONFIG_NOT_FOUND" => Self::VmInstanceConfigNotFound,
12209                "NETWORK_CONFIG_NOT_FOUND" => Self::NetworkConfigNotFound,
12210                "FIREWALL_CONFIG_NOT_FOUND" => Self::FirewallConfigNotFound,
12211                "ROUTE_CONFIG_NOT_FOUND" => Self::RouteConfigNotFound,
12212                "GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT" => {
12213                    Self::GoogleManagedServiceAmbiguousPscEndpoint
12214                }
12215                "GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT" => {
12216                    Self::GoogleManagedServiceAmbiguousEndpoint
12217                }
12218                "SOURCE_PSC_CLOUD_SQL_UNSUPPORTED" => Self::SourcePscCloudSqlUnsupported,
12219                "SOURCE_EXTERNAL_CLOUD_SQL_UNSUPPORTED" => Self::SourceExternalCloudSqlUnsupported,
12220                "SOURCE_REDIS_CLUSTER_UNSUPPORTED" => Self::SourceRedisClusterUnsupported,
12221                "SOURCE_REDIS_INSTANCE_UNSUPPORTED" => Self::SourceRedisInstanceUnsupported,
12222                "SOURCE_FORWARDING_RULE_UNSUPPORTED" => Self::SourceForwardingRuleUnsupported,
12223                "NON_ROUTABLE_IP_ADDRESS" => Self::NonRoutableIpAddress,
12224                "UNKNOWN_ISSUE_IN_GOOGLE_MANAGED_PROJECT" => {
12225                    Self::UnknownIssueInGoogleManagedProject
12226                }
12227                "UNSUPPORTED_GOOGLE_MANAGED_PROJECT_CONFIG" => {
12228                    Self::UnsupportedGoogleManagedProjectConfig
12229                }
12230                "NO_SERVERLESS_IP_RANGES" => Self::NoServerlessIpRanges,
12231                "IP_VERSION_PROTOCOL_MISMATCH" => Self::IpVersionProtocolMismatch,
12232                "GKE_POD_UNKNOWN_ENDPOINT_LOCATION" => Self::GkePodUnknownEndpointLocation,
12233                _ => Self::UnknownValue(cause::UnknownValue(
12234                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12235                )),
12236            }
12237        }
12238    }
12239
12240    impl serde::ser::Serialize for Cause {
12241        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12242        where
12243            S: serde::Serializer,
12244        {
12245            match self {
12246                Self::Unspecified => serializer.serialize_i32(0),
12247                Self::UnknownNetwork => serializer.serialize_i32(1),
12248                Self::UnknownProject => serializer.serialize_i32(3),
12249                Self::NoExternalIp => serializer.serialize_i32(7),
12250                Self::UnintendedDestination => serializer.serialize_i32(8),
12251                Self::SourceEndpointNotFound => serializer.serialize_i32(11),
12252                Self::MismatchedSourceNetwork => serializer.serialize_i32(12),
12253                Self::DestinationEndpointNotFound => serializer.serialize_i32(13),
12254                Self::MismatchedDestinationNetwork => serializer.serialize_i32(14),
12255                Self::UnknownIp => serializer.serialize_i32(2),
12256                Self::GoogleManagedServiceUnknownIp => serializer.serialize_i32(32),
12257                Self::SourceIpAddressNotInSourceNetwork => serializer.serialize_i32(23),
12258                Self::PermissionDenied => serializer.serialize_i32(4),
12259                Self::PermissionDeniedNoCloudNatConfigs => serializer.serialize_i32(28),
12260                Self::PermissionDeniedNoNegEndpointConfigs => serializer.serialize_i32(29),
12261                Self::PermissionDeniedNoCloudRouterConfigs => serializer.serialize_i32(36),
12262                Self::NoSourceLocation => serializer.serialize_i32(5),
12263                Self::NoSourceGcpNetworkLocation => serializer.serialize_i32(42),
12264                Self::NoSourceNonGcpNetworkLocation => serializer.serialize_i32(43),
12265                Self::NoSourceInternetLocation => serializer.serialize_i32(44),
12266                Self::InvalidArgument => serializer.serialize_i32(6),
12267                Self::TraceTooLong => serializer.serialize_i32(9),
12268                Self::InternalError => serializer.serialize_i32(10),
12269                Self::Unsupported => serializer.serialize_i32(15),
12270                Self::MismatchedIpVersion => serializer.serialize_i32(16),
12271                Self::GkeKonnectivityProxyUnsupported => serializer.serialize_i32(17),
12272                Self::ResourceConfigNotFound => serializer.serialize_i32(18),
12273                Self::VmInstanceConfigNotFound => serializer.serialize_i32(24),
12274                Self::NetworkConfigNotFound => serializer.serialize_i32(25),
12275                Self::FirewallConfigNotFound => serializer.serialize_i32(26),
12276                Self::RouteConfigNotFound => serializer.serialize_i32(27),
12277                Self::GoogleManagedServiceAmbiguousPscEndpoint => serializer.serialize_i32(19),
12278                Self::GoogleManagedServiceAmbiguousEndpoint => serializer.serialize_i32(39),
12279                Self::SourcePscCloudSqlUnsupported => serializer.serialize_i32(20),
12280                Self::SourceExternalCloudSqlUnsupported => serializer.serialize_i32(45),
12281                Self::SourceRedisClusterUnsupported => serializer.serialize_i32(34),
12282                Self::SourceRedisInstanceUnsupported => serializer.serialize_i32(35),
12283                Self::SourceForwardingRuleUnsupported => serializer.serialize_i32(21),
12284                Self::NonRoutableIpAddress => serializer.serialize_i32(22),
12285                Self::UnknownIssueInGoogleManagedProject => serializer.serialize_i32(30),
12286                Self::UnsupportedGoogleManagedProjectConfig => serializer.serialize_i32(31),
12287                Self::NoServerlessIpRanges => serializer.serialize_i32(37),
12288                Self::IpVersionProtocolMismatch => serializer.serialize_i32(40),
12289                Self::GkePodUnknownEndpointLocation => serializer.serialize_i32(41),
12290                Self::UnknownValue(u) => u.0.serialize(serializer),
12291            }
12292        }
12293    }
12294
12295    impl<'de> serde::de::Deserialize<'de> for Cause {
12296        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12297        where
12298            D: serde::Deserializer<'de>,
12299        {
12300            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Cause>::new(
12301                ".google.cloud.networkmanagement.v1.AbortInfo.Cause",
12302            ))
12303        }
12304    }
12305}
12306
12307/// Details of the final state "drop" and associated resource.
12308#[derive(Clone, Default, PartialEq)]
12309#[non_exhaustive]
12310pub struct DropInfo {
12311    /// Cause that the packet is dropped.
12312    pub cause: crate::model::drop_info::Cause,
12313
12314    /// URI of the resource that caused the drop.
12315    pub resource_uri: std::string::String,
12316
12317    /// Source IP address of the dropped packet (if relevant).
12318    pub source_ip: std::string::String,
12319
12320    /// Destination IP address of the dropped packet (if relevant).
12321    pub destination_ip: std::string::String,
12322
12323    /// Region of the dropped packet (if relevant).
12324    pub region: std::string::String,
12325
12326    /// Geolocation (region code) of the source IP address (if relevant).
12327    pub source_geolocation_code: std::string::String,
12328
12329    /// Geolocation (region code) of the destination IP address (if relevant).
12330    pub destination_geolocation_code: std::string::String,
12331
12332    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12333}
12334
12335impl DropInfo {
12336    pub fn new() -> Self {
12337        std::default::Default::default()
12338    }
12339
12340    /// Sets the value of [cause][crate::model::DropInfo::cause].
12341    ///
12342    /// # Example
12343    /// ```ignore,no_run
12344    /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12345    /// use google_cloud_networkmanagement_v1::model::drop_info::Cause;
12346    /// let x0 = DropInfo::new().set_cause(Cause::UnknownExternalAddress);
12347    /// let x1 = DropInfo::new().set_cause(Cause::ForeignIpDisallowed);
12348    /// let x2 = DropInfo::new().set_cause(Cause::FirewallRule);
12349    /// ```
12350    pub fn set_cause<T: std::convert::Into<crate::model::drop_info::Cause>>(
12351        mut self,
12352        v: T,
12353    ) -> Self {
12354        self.cause = v.into();
12355        self
12356    }
12357
12358    /// Sets the value of [resource_uri][crate::model::DropInfo::resource_uri].
12359    ///
12360    /// # Example
12361    /// ```ignore,no_run
12362    /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12363    /// let x = DropInfo::new().set_resource_uri("example");
12364    /// ```
12365    pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12366        self.resource_uri = v.into();
12367        self
12368    }
12369
12370    /// Sets the value of [source_ip][crate::model::DropInfo::source_ip].
12371    ///
12372    /// # Example
12373    /// ```ignore,no_run
12374    /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12375    /// let x = DropInfo::new().set_source_ip("example");
12376    /// ```
12377    pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12378        self.source_ip = v.into();
12379        self
12380    }
12381
12382    /// Sets the value of [destination_ip][crate::model::DropInfo::destination_ip].
12383    ///
12384    /// # Example
12385    /// ```ignore,no_run
12386    /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12387    /// let x = DropInfo::new().set_destination_ip("example");
12388    /// ```
12389    pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12390        self.destination_ip = v.into();
12391        self
12392    }
12393
12394    /// Sets the value of [region][crate::model::DropInfo::region].
12395    ///
12396    /// # Example
12397    /// ```ignore,no_run
12398    /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12399    /// let x = DropInfo::new().set_region("example");
12400    /// ```
12401    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12402        self.region = v.into();
12403        self
12404    }
12405
12406    /// Sets the value of [source_geolocation_code][crate::model::DropInfo::source_geolocation_code].
12407    ///
12408    /// # Example
12409    /// ```ignore,no_run
12410    /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12411    /// let x = DropInfo::new().set_source_geolocation_code("example");
12412    /// ```
12413    pub fn set_source_geolocation_code<T: std::convert::Into<std::string::String>>(
12414        mut self,
12415        v: T,
12416    ) -> Self {
12417        self.source_geolocation_code = v.into();
12418        self
12419    }
12420
12421    /// Sets the value of [destination_geolocation_code][crate::model::DropInfo::destination_geolocation_code].
12422    ///
12423    /// # Example
12424    /// ```ignore,no_run
12425    /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12426    /// let x = DropInfo::new().set_destination_geolocation_code("example");
12427    /// ```
12428    pub fn set_destination_geolocation_code<T: std::convert::Into<std::string::String>>(
12429        mut self,
12430        v: T,
12431    ) -> Self {
12432        self.destination_geolocation_code = v.into();
12433        self
12434    }
12435}
12436
12437impl wkt::message::Message for DropInfo {
12438    fn typename() -> &'static str {
12439        "type.googleapis.com/google.cloud.networkmanagement.v1.DropInfo"
12440    }
12441}
12442
12443/// Defines additional types related to [DropInfo].
12444pub mod drop_info {
12445    #[allow(unused_imports)]
12446    use super::*;
12447
12448    /// Drop cause types:
12449    ///
12450    /// # Working with unknown values
12451    ///
12452    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12453    /// additional enum variants at any time. Adding new variants is not considered
12454    /// a breaking change. Applications should write their code in anticipation of:
12455    ///
12456    /// - New values appearing in future releases of the client library, **and**
12457    /// - New values received dynamically, without application changes.
12458    ///
12459    /// Please consult the [Working with enums] section in the user guide for some
12460    /// guidelines.
12461    ///
12462    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12463    #[derive(Clone, Debug, PartialEq)]
12464    #[non_exhaustive]
12465    pub enum Cause {
12466        /// Cause is unspecified.
12467        Unspecified,
12468        /// Destination external address cannot be resolved to a known target. If
12469        /// the address is used in a Google Cloud project, provide the project ID
12470        /// as test input.
12471        UnknownExternalAddress,
12472        /// A Compute Engine instance can only send or receive a packet with a
12473        /// foreign IP address if ip_forward is enabled.
12474        ForeignIpDisallowed,
12475        /// Dropped due to a firewall rule, unless allowed due to connection
12476        /// tracking.
12477        FirewallRule,
12478        /// Dropped due to no matching routes.
12479        NoRoute,
12480        /// Dropped due to invalid route. Route's next hop is a blackhole.
12481        RouteBlackhole,
12482        /// Packet is sent to a wrong (unintended) network. Example: you trace a
12483        /// packet from VM1:Network1 to VM2:Network2, however, the route configured
12484        /// in Network1 sends the packet destined for VM2's IP address to Network3.
12485        RouteWrongNetwork,
12486        /// Route's next hop IP address cannot be resolved to a GCP resource.
12487        RouteNextHopIpAddressNotResolved,
12488        /// Route's next hop resource is not found.
12489        RouteNextHopResourceNotFound,
12490        /// Route's next hop instance doesn't have a NIC in the route's network.
12491        RouteNextHopInstanceWrongNetwork,
12492        /// Route's next hop IP address is not a primary IP address of the next hop
12493        /// instance.
12494        RouteNextHopInstanceNonPrimaryIp,
12495        /// Route's next hop forwarding rule doesn't match next hop IP address.
12496        RouteNextHopForwardingRuleIpMismatch,
12497        /// Route's next hop VPN tunnel is down (does not have valid IKE SAs).
12498        RouteNextHopVpnTunnelNotEstablished,
12499        /// Route's next hop forwarding rule type is invalid (it's not a forwarding
12500        /// rule of the internal passthrough load balancer).
12501        RouteNextHopForwardingRuleTypeInvalid,
12502        /// Packet is sent from the Internet to the private IPv6 address.
12503        NoRouteFromInternetToPrivateIpv6Address,
12504        /// Packet is sent from the Internet to the private IPv4 address.
12505        NoRouteFromInternetToPrivateIpv4Address,
12506        /// Packet is sent from the external IPv6 source address of an instance to
12507        /// the private IPv6 address of an instance.
12508        NoRouteFromExternalIpv6SourceToPrivateIpv6Address,
12509        /// The packet does not match a policy-based VPN tunnel local selector.
12510        VpnTunnelLocalSelectorMismatch,
12511        /// The packet does not match a policy-based VPN tunnel remote selector.
12512        VpnTunnelRemoteSelectorMismatch,
12513        /// Packet with internal destination address sent to the internet gateway.
12514        PrivateTrafficToInternet,
12515        /// Endpoint with only an internal IP address tries to access Google API and
12516        /// services, but Private Google Access is not enabled in the subnet or is
12517        /// not applicable.
12518        PrivateGoogleAccessDisallowed,
12519        /// Source endpoint tries to access Google API and services through the VPN
12520        /// tunnel to another network, but Private Google Access needs to be enabled
12521        /// in the source endpoint network.
12522        PrivateGoogleAccessViaVpnTunnelUnsupported,
12523        /// Endpoint with only an internal IP address tries to access external hosts,
12524        /// but there is no matching Cloud NAT gateway in the subnet.
12525        NoExternalAddress,
12526        /// Destination internal address cannot be resolved to a known target. If
12527        /// this is a shared VPC scenario, verify if the service project ID is
12528        /// provided as test input. Otherwise, verify if the IP address is being
12529        /// used in the project.
12530        UnknownInternalAddress,
12531        /// Forwarding rule's protocol and ports do not match the packet header.
12532        ForwardingRuleMismatch,
12533        /// Forwarding rule does not have backends configured.
12534        ForwardingRuleNoInstances,
12535        /// Firewalls block the health check probes to the backends and cause
12536        /// the backends to be unavailable for traffic from the load balancer.
12537        /// For more details, see [Health check firewall
12538        /// rules](https://cloud.google.com/load-balancing/docs/health-checks#firewall_rules).
12539        FirewallBlockingLoadBalancerBackendHealthCheck,
12540        /// Matching ingress firewall rules by network tags for packets sent via
12541        /// serverless VPC direct egress is unsupported. Behavior is undefined.
12542        /// <https://cloud.google.com/run/docs/configuring/vpc-direct-vpc#limitations>
12543        IngressFirewallTagsUnsupportedByDirectVpcEgress,
12544        /// Packet is sent from or to a Compute Engine instance that is not in a
12545        /// running state.
12546        InstanceNotRunning,
12547        /// Packet sent from or to a GKE cluster that is not in running state.
12548        GkeClusterNotRunning,
12549        /// Packet sent from or to a GKE Pod that is not in running state.
12550        GkePodNotRunning,
12551        /// Packet sent from or to a Cloud SQL instance that is not in running state.
12552        CloudSqlInstanceNotRunning,
12553        /// Packet sent from or to a Redis Instance that is not in running state.
12554        RedisInstanceNotRunning,
12555        /// Packet sent from or to a Redis Cluster that is not in running state.
12556        RedisClusterNotRunning,
12557        /// The type of traffic is blocked and the user cannot configure a firewall
12558        /// rule to enable it. See [Always blocked
12559        /// traffic](https://cloud.google.com/vpc/docs/firewalls#blockedtraffic) for
12560        /// more details.
12561        TrafficTypeBlocked,
12562        /// Access to Google Kubernetes Engine cluster master's endpoint is not
12563        /// authorized. See [Access to the cluster
12564        /// endpoints](https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#access_to_the_cluster_endpoints)
12565        /// for more details.
12566        GkeMasterUnauthorizedAccess,
12567        /// Access to the Cloud SQL instance endpoint is not authorized.
12568        /// See [Authorizing with authorized
12569        /// networks](https://cloud.google.com/sql/docs/mysql/authorize-networks) for
12570        /// more details.
12571        CloudSqlInstanceUnauthorizedAccess,
12572        /// Packet was dropped inside Google Kubernetes Engine Service.
12573        DroppedInsideGkeService,
12574        /// Packet was dropped inside Cloud SQL Service.
12575        DroppedInsideCloudSqlService,
12576        /// Packet was dropped because there is no peering between the originating
12577        /// network and the Google Managed Services Network.
12578        GoogleManagedServiceNoPeering,
12579        /// Packet was dropped because the Google-managed service uses Private
12580        /// Service Connect (PSC), but the PSC endpoint is not found in the project.
12581        GoogleManagedServiceNoPscEndpoint,
12582        /// Packet was dropped because the GKE cluster uses Private Service Connect
12583        /// (PSC), but the PSC endpoint is not found in the project.
12584        GkePscEndpointMissing,
12585        /// Packet was dropped because the Cloud SQL instance has neither a private
12586        /// nor a public IP address.
12587        CloudSqlInstanceNoIpAddress,
12588        /// Packet was dropped because a GKE cluster private endpoint is
12589        /// unreachable from a region different from the cluster's region.
12590        GkeControlPlaneRegionMismatch,
12591        /// Packet sent from a public GKE cluster control plane to a private
12592        /// IP address.
12593        PublicGkeControlPlaneToPrivateDestination,
12594        /// Packet was dropped because there is no route from a GKE cluster
12595        /// control plane to a destination network.
12596        GkeControlPlaneNoRoute,
12597        /// Packet sent from a Cloud SQL instance to an external IP address is not
12598        /// allowed. The Cloud SQL instance is not configured to send packets to
12599        /// external IP addresses.
12600        CloudSqlInstanceNotConfiguredForExternalTraffic,
12601        /// Packet sent from a Cloud SQL instance with only a public IP address to a
12602        /// private IP address.
12603        PublicCloudSqlInstanceToPrivateDestination,
12604        /// Packet was dropped because there is no route from a Cloud SQL
12605        /// instance to a destination network.
12606        CloudSqlInstanceNoRoute,
12607        /// Packet was dropped because the Cloud SQL instance requires all
12608        /// connections to use Cloud SQL connectors and to target the Cloud SQL proxy
12609        /// port (3307).
12610        CloudSqlConnectorRequired,
12611        /// Packet could be dropped because the Cloud Function is not in an active
12612        /// status.
12613        CloudFunctionNotActive,
12614        /// Packet could be dropped because no VPC connector is set.
12615        VpcConnectorNotSet,
12616        /// Packet could be dropped because the VPC connector is not in a running
12617        /// state.
12618        VpcConnectorNotRunning,
12619        /// Packet could be dropped because the traffic from the serverless service
12620        /// to the VPC connector is not allowed.
12621        VpcConnectorServerlessTrafficBlocked,
12622        /// Packet could be dropped because the health check traffic to the VPC
12623        /// connector is not allowed.
12624        VpcConnectorHealthCheckTrafficBlocked,
12625        /// Packet could be dropped because it was sent from a different region
12626        /// to a regional forwarding without global access.
12627        ForwardingRuleRegionMismatch,
12628        /// The Private Service Connect endpoint is in a project that is not approved
12629        /// to connect to the service.
12630        PscConnectionNotAccepted,
12631        /// The packet is sent to the Private Service Connect endpoint over the
12632        /// peering, but [it's not
12633        /// supported](https://cloud.google.com/vpc/docs/configure-private-service-connect-services#on-premises).
12634        PscEndpointAccessedFromPeeredNetwork,
12635        /// The packet is sent to the Private Service Connect backend (network
12636        /// endpoint group), but the producer PSC forwarding rule does not have
12637        /// global access enabled.
12638        PscNegProducerEndpointNoGlobalAccess,
12639        /// The packet is sent to the Private Service Connect backend (network
12640        /// endpoint group), but the producer PSC forwarding rule has multiple ports
12641        /// specified.
12642        PscNegProducerForwardingRuleMultiplePorts,
12643        /// The packet is sent to the Private Service Connect backend (network
12644        /// endpoint group) targeting a Cloud SQL service attachment, but this
12645        /// configuration is not supported.
12646        CloudSqlPscNegUnsupported,
12647        /// No NAT subnets are defined for the PSC service attachment.
12648        NoNatSubnetsForPscServiceAttachment,
12649        /// PSC endpoint is accessed via NCC, but PSC transitivity configuration is
12650        /// not yet propagated.
12651        PscTransitivityNotPropagated,
12652        /// The packet sent from the hybrid NEG proxy matches a non-dynamic route,
12653        /// but such a configuration is not supported.
12654        HybridNegNonDynamicRouteMatched,
12655        /// The packet sent from the hybrid NEG proxy matches a dynamic route with a
12656        /// next hop in a different region, but such a configuration is not
12657        /// supported.
12658        HybridNegNonLocalDynamicRouteMatched,
12659        /// Packet sent from a Cloud Run revision that is not ready.
12660        CloudRunRevisionNotReady,
12661        /// Packet was dropped inside Private Service Connect service producer.
12662        DroppedInsidePscServiceProducer,
12663        /// Packet sent to a load balancer, which requires a proxy-only subnet and
12664        /// the subnet is not found.
12665        LoadBalancerHasNoProxySubnet,
12666        /// Packet sent to Cloud Nat without active NAT IPs.
12667        CloudNatNoAddresses,
12668        /// Packet is stuck in a routing loop.
12669        RoutingLoop,
12670        /// Packet is dropped inside a Google-managed service due to being delivered
12671        /// in return trace to an endpoint that doesn't match the endpoint the packet
12672        /// was sent from in forward trace. Used only for return traces.
12673        DroppedInsideGoogleManagedService,
12674        /// Packet is dropped due to a load balancer backend instance not having a
12675        /// network interface in the network expected by the load balancer.
12676        LoadBalancerBackendInvalidNetwork,
12677        /// Packet is dropped due to a backend service named port not being defined
12678        /// on the instance group level.
12679        BackendServiceNamedPortNotDefined,
12680        /// Packet is dropped due to a destination IP range being part of a Private
12681        /// NAT IP range.
12682        DestinationIsPrivateNatIpRange,
12683        /// Generic drop cause for a packet being dropped inside a Redis Instance
12684        /// service project.
12685        DroppedInsideRedisInstanceService,
12686        /// Packet is dropped due to an unsupported port being used to connect to a
12687        /// Redis Instance. Port 6379 should be used to connect to a Redis Instance.
12688        RedisInstanceUnsupportedPort,
12689        /// Packet is dropped due to connecting from PUPI address to a PSA based
12690        /// Redis Instance.
12691        RedisInstanceConnectingFromPupiAddress,
12692        /// Packet is dropped due to no route to the destination network.
12693        RedisInstanceNoRouteToDestinationNetwork,
12694        /// Redis Instance does not have an external IP address.
12695        RedisInstanceNoExternalIp,
12696        /// Packet is dropped due to an unsupported protocol being used to connect to
12697        /// a Redis Instance. Only TCP connections are accepted by a Redis Instance.
12698        RedisInstanceUnsupportedProtocol,
12699        /// Generic drop cause for a packet being dropped inside a Redis Cluster
12700        /// service project.
12701        DroppedInsideRedisClusterService,
12702        /// Packet is dropped due to an unsupported port being used to connect to a
12703        /// Redis Cluster. Ports 6379 and 11000 to 13047 should be used to connect to
12704        /// a Redis Cluster.
12705        RedisClusterUnsupportedPort,
12706        /// Redis Cluster does not have an external IP address.
12707        RedisClusterNoExternalIp,
12708        /// Packet is dropped due to an unsupported protocol being used to connect to
12709        /// a Redis Cluster. Only TCP connections are accepted by a Redis Cluster.
12710        RedisClusterUnsupportedProtocol,
12711        /// Packet from the non-GCP (on-prem) or unknown GCP network is dropped due
12712        /// to the destination IP address not belonging to any IP prefix advertised
12713        /// via BGP by the Cloud Router.
12714        NoAdvertisedRouteToGcpDestination,
12715        /// Packet from the non-GCP (on-prem) or unknown GCP network is dropped due
12716        /// to the destination IP address not belonging to any IP prefix included to
12717        /// the local traffic selector of the VPN tunnel.
12718        NoTrafficSelectorToGcpDestination,
12719        /// Packet from the unknown peered network is dropped due to no known route
12720        /// from the source network to the destination IP address.
12721        NoKnownRouteFromPeeredNetworkToDestination,
12722        /// Sending packets processed by the Private NAT Gateways to the Private
12723        /// Service Connect endpoints is not supported.
12724        PrivateNatToPscEndpointUnsupported,
12725        /// Packet is sent to the PSC port mapping service, but its destination port
12726        /// does not match any port mapping rules.
12727        PscPortMappingPortMismatch,
12728        /// Sending packets directly to the PSC port mapping service without going
12729        /// through the PSC connection is not supported.
12730        PscPortMappingWithoutPscConnectionUnsupported,
12731        /// Packet with destination IP address within the reserved NAT64 range is
12732        /// dropped due to matching a route of an unsupported type.
12733        UnsupportedRouteMatchedForNat64Destination,
12734        /// Packet could be dropped because hybrid endpoint like a VPN gateway or
12735        /// Interconnect is not allowed to send traffic to the Internet.
12736        TrafficFromHybridEndpointToInternetDisallowed,
12737        /// Packet with destination IP address within the reserved NAT64 range is
12738        /// dropped due to no matching NAT gateway in the subnet.
12739        NoMatchingNat64Gateway,
12740        /// Packet is dropped due to matching a Private NAT64 gateway with no rules
12741        /// for source IPv6 addresses.
12742        NoConfiguredPrivateNat64Rule,
12743        /// Packet is dropped due to being sent to a backend of a passthrough load
12744        /// balancer that doesn't use the same IP version as the frontend.
12745        LoadBalancerBackendIpVersionMismatch,
12746        /// Packet from the unknown NCC network is dropped due to no known route
12747        /// from the source network to the destination IP address.
12748        NoKnownRouteFromNccNetworkToDestination,
12749        /// Packet is dropped by Cloud NAT due to using an unsupported protocol.
12750        CloudNatProtocolUnsupported,
12751        /// Packet is dropped due to using an unsupported protocol (any other than
12752        /// UDP) for L2 Interconnect.
12753        L2InterconnectUnsupportedProtocol,
12754        /// Packet is dropped due to using an unsupported port (any other than
12755        /// 6081) for L2 Interconnect.
12756        L2InterconnectUnsupportedPort,
12757        /// Packet is dropped due to destination IP not matching the appliance
12758        /// mapping IPs configured on the L2 Interconnect attachment.
12759        L2InterconnectDestinationIpMismatch,
12760        /// Packet could be dropped because it matches a route associated with an NCC
12761        /// spoke in the hybrid subnet context, but such a configuration is not
12762        /// supported.
12763        NccRouteWithinHybridSubnetUnsupported,
12764        /// Packet is dropped because the region of the hybrid subnet is different
12765        /// from the region of the next hop of the route matched within this hybrid
12766        /// subnet.
12767        HybridSubnetRegionMismatch,
12768        /// Packet is dropped because no matching route was found in the hybrid
12769        /// subnet.
12770        HybridSubnetNoRoute,
12771        /// Packet is dropped by GKE Network Policy.
12772        GkeNetworkPolicy,
12773        /// Packet is dropped because there is no valid matching route from the
12774        /// network of the Google-managed service to the destination.
12775        NoValidRouteFromGoogleManagedNetworkToDestination,
12776        /// If set, the enum was initialized with an unknown value.
12777        ///
12778        /// Applications can examine the value using [Cause::value] or
12779        /// [Cause::name].
12780        UnknownValue(cause::UnknownValue),
12781    }
12782
12783    #[doc(hidden)]
12784    pub mod cause {
12785        #[allow(unused_imports)]
12786        use super::*;
12787        #[derive(Clone, Debug, PartialEq)]
12788        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12789    }
12790
12791    impl Cause {
12792        /// Gets the enum value.
12793        ///
12794        /// Returns `None` if the enum contains an unknown value deserialized from
12795        /// the string representation of enums.
12796        pub fn value(&self) -> std::option::Option<i32> {
12797            match self {
12798                Self::Unspecified => std::option::Option::Some(0),
12799                Self::UnknownExternalAddress => std::option::Option::Some(1),
12800                Self::ForeignIpDisallowed => std::option::Option::Some(2),
12801                Self::FirewallRule => std::option::Option::Some(3),
12802                Self::NoRoute => std::option::Option::Some(4),
12803                Self::RouteBlackhole => std::option::Option::Some(5),
12804                Self::RouteWrongNetwork => std::option::Option::Some(6),
12805                Self::RouteNextHopIpAddressNotResolved => std::option::Option::Some(42),
12806                Self::RouteNextHopResourceNotFound => std::option::Option::Some(43),
12807                Self::RouteNextHopInstanceWrongNetwork => std::option::Option::Some(49),
12808                Self::RouteNextHopInstanceNonPrimaryIp => std::option::Option::Some(50),
12809                Self::RouteNextHopForwardingRuleIpMismatch => std::option::Option::Some(51),
12810                Self::RouteNextHopVpnTunnelNotEstablished => std::option::Option::Some(52),
12811                Self::RouteNextHopForwardingRuleTypeInvalid => std::option::Option::Some(53),
12812                Self::NoRouteFromInternetToPrivateIpv6Address => std::option::Option::Some(44),
12813                Self::NoRouteFromInternetToPrivateIpv4Address => std::option::Option::Some(109),
12814                Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
12815                    std::option::Option::Some(98)
12816                }
12817                Self::VpnTunnelLocalSelectorMismatch => std::option::Option::Some(45),
12818                Self::VpnTunnelRemoteSelectorMismatch => std::option::Option::Some(46),
12819                Self::PrivateTrafficToInternet => std::option::Option::Some(7),
12820                Self::PrivateGoogleAccessDisallowed => std::option::Option::Some(8),
12821                Self::PrivateGoogleAccessViaVpnTunnelUnsupported => std::option::Option::Some(47),
12822                Self::NoExternalAddress => std::option::Option::Some(9),
12823                Self::UnknownInternalAddress => std::option::Option::Some(10),
12824                Self::ForwardingRuleMismatch => std::option::Option::Some(11),
12825                Self::ForwardingRuleNoInstances => std::option::Option::Some(12),
12826                Self::FirewallBlockingLoadBalancerBackendHealthCheck => {
12827                    std::option::Option::Some(13)
12828                }
12829                Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => {
12830                    std::option::Option::Some(85)
12831                }
12832                Self::InstanceNotRunning => std::option::Option::Some(14),
12833                Self::GkeClusterNotRunning => std::option::Option::Some(27),
12834                Self::GkePodNotRunning => std::option::Option::Some(103),
12835                Self::CloudSqlInstanceNotRunning => std::option::Option::Some(28),
12836                Self::RedisInstanceNotRunning => std::option::Option::Some(68),
12837                Self::RedisClusterNotRunning => std::option::Option::Some(69),
12838                Self::TrafficTypeBlocked => std::option::Option::Some(15),
12839                Self::GkeMasterUnauthorizedAccess => std::option::Option::Some(16),
12840                Self::CloudSqlInstanceUnauthorizedAccess => std::option::Option::Some(17),
12841                Self::DroppedInsideGkeService => std::option::Option::Some(18),
12842                Self::DroppedInsideCloudSqlService => std::option::Option::Some(19),
12843                Self::GoogleManagedServiceNoPeering => std::option::Option::Some(20),
12844                Self::GoogleManagedServiceNoPscEndpoint => std::option::Option::Some(38),
12845                Self::GkePscEndpointMissing => std::option::Option::Some(36),
12846                Self::CloudSqlInstanceNoIpAddress => std::option::Option::Some(21),
12847                Self::GkeControlPlaneRegionMismatch => std::option::Option::Some(30),
12848                Self::PublicGkeControlPlaneToPrivateDestination => std::option::Option::Some(31),
12849                Self::GkeControlPlaneNoRoute => std::option::Option::Some(32),
12850                Self::CloudSqlInstanceNotConfiguredForExternalTraffic => {
12851                    std::option::Option::Some(33)
12852                }
12853                Self::PublicCloudSqlInstanceToPrivateDestination => std::option::Option::Some(34),
12854                Self::CloudSqlInstanceNoRoute => std::option::Option::Some(35),
12855                Self::CloudSqlConnectorRequired => std::option::Option::Some(63),
12856                Self::CloudFunctionNotActive => std::option::Option::Some(22),
12857                Self::VpcConnectorNotSet => std::option::Option::Some(23),
12858                Self::VpcConnectorNotRunning => std::option::Option::Some(24),
12859                Self::VpcConnectorServerlessTrafficBlocked => std::option::Option::Some(60),
12860                Self::VpcConnectorHealthCheckTrafficBlocked => std::option::Option::Some(61),
12861                Self::ForwardingRuleRegionMismatch => std::option::Option::Some(25),
12862                Self::PscConnectionNotAccepted => std::option::Option::Some(26),
12863                Self::PscEndpointAccessedFromPeeredNetwork => std::option::Option::Some(41),
12864                Self::PscNegProducerEndpointNoGlobalAccess => std::option::Option::Some(48),
12865                Self::PscNegProducerForwardingRuleMultiplePorts => std::option::Option::Some(54),
12866                Self::CloudSqlPscNegUnsupported => std::option::Option::Some(58),
12867                Self::NoNatSubnetsForPscServiceAttachment => std::option::Option::Some(57),
12868                Self::PscTransitivityNotPropagated => std::option::Option::Some(64),
12869                Self::HybridNegNonDynamicRouteMatched => std::option::Option::Some(55),
12870                Self::HybridNegNonLocalDynamicRouteMatched => std::option::Option::Some(56),
12871                Self::CloudRunRevisionNotReady => std::option::Option::Some(29),
12872                Self::DroppedInsidePscServiceProducer => std::option::Option::Some(37),
12873                Self::LoadBalancerHasNoProxySubnet => std::option::Option::Some(39),
12874                Self::CloudNatNoAddresses => std::option::Option::Some(40),
12875                Self::RoutingLoop => std::option::Option::Some(59),
12876                Self::DroppedInsideGoogleManagedService => std::option::Option::Some(62),
12877                Self::LoadBalancerBackendInvalidNetwork => std::option::Option::Some(65),
12878                Self::BackendServiceNamedPortNotDefined => std::option::Option::Some(66),
12879                Self::DestinationIsPrivateNatIpRange => std::option::Option::Some(67),
12880                Self::DroppedInsideRedisInstanceService => std::option::Option::Some(70),
12881                Self::RedisInstanceUnsupportedPort => std::option::Option::Some(71),
12882                Self::RedisInstanceConnectingFromPupiAddress => std::option::Option::Some(72),
12883                Self::RedisInstanceNoRouteToDestinationNetwork => std::option::Option::Some(73),
12884                Self::RedisInstanceNoExternalIp => std::option::Option::Some(74),
12885                Self::RedisInstanceUnsupportedProtocol => std::option::Option::Some(78),
12886                Self::DroppedInsideRedisClusterService => std::option::Option::Some(75),
12887                Self::RedisClusterUnsupportedPort => std::option::Option::Some(76),
12888                Self::RedisClusterNoExternalIp => std::option::Option::Some(77),
12889                Self::RedisClusterUnsupportedProtocol => std::option::Option::Some(79),
12890                Self::NoAdvertisedRouteToGcpDestination => std::option::Option::Some(80),
12891                Self::NoTrafficSelectorToGcpDestination => std::option::Option::Some(81),
12892                Self::NoKnownRouteFromPeeredNetworkToDestination => std::option::Option::Some(82),
12893                Self::PrivateNatToPscEndpointUnsupported => std::option::Option::Some(83),
12894                Self::PscPortMappingPortMismatch => std::option::Option::Some(86),
12895                Self::PscPortMappingWithoutPscConnectionUnsupported => {
12896                    std::option::Option::Some(87)
12897                }
12898                Self::UnsupportedRouteMatchedForNat64Destination => std::option::Option::Some(88),
12899                Self::TrafficFromHybridEndpointToInternetDisallowed => {
12900                    std::option::Option::Some(89)
12901                }
12902                Self::NoMatchingNat64Gateway => std::option::Option::Some(90),
12903                Self::NoConfiguredPrivateNat64Rule => std::option::Option::Some(107),
12904                Self::LoadBalancerBackendIpVersionMismatch => std::option::Option::Some(96),
12905                Self::NoKnownRouteFromNccNetworkToDestination => std::option::Option::Some(97),
12906                Self::CloudNatProtocolUnsupported => std::option::Option::Some(99),
12907                Self::L2InterconnectUnsupportedProtocol => std::option::Option::Some(100),
12908                Self::L2InterconnectUnsupportedPort => std::option::Option::Some(101),
12909                Self::L2InterconnectDestinationIpMismatch => std::option::Option::Some(102),
12910                Self::NccRouteWithinHybridSubnetUnsupported => std::option::Option::Some(104),
12911                Self::HybridSubnetRegionMismatch => std::option::Option::Some(105),
12912                Self::HybridSubnetNoRoute => std::option::Option::Some(106),
12913                Self::GkeNetworkPolicy => std::option::Option::Some(108),
12914                Self::NoValidRouteFromGoogleManagedNetworkToDestination => {
12915                    std::option::Option::Some(110)
12916                }
12917                Self::UnknownValue(u) => u.0.value(),
12918            }
12919        }
12920
12921        /// Gets the enum value as a string.
12922        ///
12923        /// Returns `None` if the enum contains an unknown value deserialized from
12924        /// the integer representation of enums.
12925        pub fn name(&self) -> std::option::Option<&str> {
12926            match self {
12927                Self::Unspecified => std::option::Option::Some("CAUSE_UNSPECIFIED"),
12928                Self::UnknownExternalAddress => {
12929                    std::option::Option::Some("UNKNOWN_EXTERNAL_ADDRESS")
12930                }
12931                Self::ForeignIpDisallowed => std::option::Option::Some("FOREIGN_IP_DISALLOWED"),
12932                Self::FirewallRule => std::option::Option::Some("FIREWALL_RULE"),
12933                Self::NoRoute => std::option::Option::Some("NO_ROUTE"),
12934                Self::RouteBlackhole => std::option::Option::Some("ROUTE_BLACKHOLE"),
12935                Self::RouteWrongNetwork => std::option::Option::Some("ROUTE_WRONG_NETWORK"),
12936                Self::RouteNextHopIpAddressNotResolved => {
12937                    std::option::Option::Some("ROUTE_NEXT_HOP_IP_ADDRESS_NOT_RESOLVED")
12938                }
12939                Self::RouteNextHopResourceNotFound => {
12940                    std::option::Option::Some("ROUTE_NEXT_HOP_RESOURCE_NOT_FOUND")
12941                }
12942                Self::RouteNextHopInstanceWrongNetwork => {
12943                    std::option::Option::Some("ROUTE_NEXT_HOP_INSTANCE_WRONG_NETWORK")
12944                }
12945                Self::RouteNextHopInstanceNonPrimaryIp => {
12946                    std::option::Option::Some("ROUTE_NEXT_HOP_INSTANCE_NON_PRIMARY_IP")
12947                }
12948                Self::RouteNextHopForwardingRuleIpMismatch => {
12949                    std::option::Option::Some("ROUTE_NEXT_HOP_FORWARDING_RULE_IP_MISMATCH")
12950                }
12951                Self::RouteNextHopVpnTunnelNotEstablished => {
12952                    std::option::Option::Some("ROUTE_NEXT_HOP_VPN_TUNNEL_NOT_ESTABLISHED")
12953                }
12954                Self::RouteNextHopForwardingRuleTypeInvalid => {
12955                    std::option::Option::Some("ROUTE_NEXT_HOP_FORWARDING_RULE_TYPE_INVALID")
12956                }
12957                Self::NoRouteFromInternetToPrivateIpv6Address => {
12958                    std::option::Option::Some("NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV6_ADDRESS")
12959                }
12960                Self::NoRouteFromInternetToPrivateIpv4Address => {
12961                    std::option::Option::Some("NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV4_ADDRESS")
12962                }
12963                Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
12964                    std::option::Option::Some(
12965                        "NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS",
12966                    )
12967                }
12968                Self::VpnTunnelLocalSelectorMismatch => {
12969                    std::option::Option::Some("VPN_TUNNEL_LOCAL_SELECTOR_MISMATCH")
12970                }
12971                Self::VpnTunnelRemoteSelectorMismatch => {
12972                    std::option::Option::Some("VPN_TUNNEL_REMOTE_SELECTOR_MISMATCH")
12973                }
12974                Self::PrivateTrafficToInternet => {
12975                    std::option::Option::Some("PRIVATE_TRAFFIC_TO_INTERNET")
12976                }
12977                Self::PrivateGoogleAccessDisallowed => {
12978                    std::option::Option::Some("PRIVATE_GOOGLE_ACCESS_DISALLOWED")
12979                }
12980                Self::PrivateGoogleAccessViaVpnTunnelUnsupported => {
12981                    std::option::Option::Some("PRIVATE_GOOGLE_ACCESS_VIA_VPN_TUNNEL_UNSUPPORTED")
12982                }
12983                Self::NoExternalAddress => std::option::Option::Some("NO_EXTERNAL_ADDRESS"),
12984                Self::UnknownInternalAddress => {
12985                    std::option::Option::Some("UNKNOWN_INTERNAL_ADDRESS")
12986                }
12987                Self::ForwardingRuleMismatch => {
12988                    std::option::Option::Some("FORWARDING_RULE_MISMATCH")
12989                }
12990                Self::ForwardingRuleNoInstances => {
12991                    std::option::Option::Some("FORWARDING_RULE_NO_INSTANCES")
12992                }
12993                Self::FirewallBlockingLoadBalancerBackendHealthCheck => std::option::Option::Some(
12994                    "FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK",
12995                ),
12996                Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => std::option::Option::Some(
12997                    "INGRESS_FIREWALL_TAGS_UNSUPPORTED_BY_DIRECT_VPC_EGRESS",
12998                ),
12999                Self::InstanceNotRunning => std::option::Option::Some("INSTANCE_NOT_RUNNING"),
13000                Self::GkeClusterNotRunning => std::option::Option::Some("GKE_CLUSTER_NOT_RUNNING"),
13001                Self::GkePodNotRunning => std::option::Option::Some("GKE_POD_NOT_RUNNING"),
13002                Self::CloudSqlInstanceNotRunning => {
13003                    std::option::Option::Some("CLOUD_SQL_INSTANCE_NOT_RUNNING")
13004                }
13005                Self::RedisInstanceNotRunning => {
13006                    std::option::Option::Some("REDIS_INSTANCE_NOT_RUNNING")
13007                }
13008                Self::RedisClusterNotRunning => {
13009                    std::option::Option::Some("REDIS_CLUSTER_NOT_RUNNING")
13010                }
13011                Self::TrafficTypeBlocked => std::option::Option::Some("TRAFFIC_TYPE_BLOCKED"),
13012                Self::GkeMasterUnauthorizedAccess => {
13013                    std::option::Option::Some("GKE_MASTER_UNAUTHORIZED_ACCESS")
13014                }
13015                Self::CloudSqlInstanceUnauthorizedAccess => {
13016                    std::option::Option::Some("CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS")
13017                }
13018                Self::DroppedInsideGkeService => {
13019                    std::option::Option::Some("DROPPED_INSIDE_GKE_SERVICE")
13020                }
13021                Self::DroppedInsideCloudSqlService => {
13022                    std::option::Option::Some("DROPPED_INSIDE_CLOUD_SQL_SERVICE")
13023                }
13024                Self::GoogleManagedServiceNoPeering => {
13025                    std::option::Option::Some("GOOGLE_MANAGED_SERVICE_NO_PEERING")
13026                }
13027                Self::GoogleManagedServiceNoPscEndpoint => {
13028                    std::option::Option::Some("GOOGLE_MANAGED_SERVICE_NO_PSC_ENDPOINT")
13029                }
13030                Self::GkePscEndpointMissing => {
13031                    std::option::Option::Some("GKE_PSC_ENDPOINT_MISSING")
13032                }
13033                Self::CloudSqlInstanceNoIpAddress => {
13034                    std::option::Option::Some("CLOUD_SQL_INSTANCE_NO_IP_ADDRESS")
13035                }
13036                Self::GkeControlPlaneRegionMismatch => {
13037                    std::option::Option::Some("GKE_CONTROL_PLANE_REGION_MISMATCH")
13038                }
13039                Self::PublicGkeControlPlaneToPrivateDestination => {
13040                    std::option::Option::Some("PUBLIC_GKE_CONTROL_PLANE_TO_PRIVATE_DESTINATION")
13041                }
13042                Self::GkeControlPlaneNoRoute => {
13043                    std::option::Option::Some("GKE_CONTROL_PLANE_NO_ROUTE")
13044                }
13045                Self::CloudSqlInstanceNotConfiguredForExternalTraffic => std::option::Option::Some(
13046                    "CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC",
13047                ),
13048                Self::PublicCloudSqlInstanceToPrivateDestination => {
13049                    std::option::Option::Some("PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION")
13050                }
13051                Self::CloudSqlInstanceNoRoute => {
13052                    std::option::Option::Some("CLOUD_SQL_INSTANCE_NO_ROUTE")
13053                }
13054                Self::CloudSqlConnectorRequired => {
13055                    std::option::Option::Some("CLOUD_SQL_CONNECTOR_REQUIRED")
13056                }
13057                Self::CloudFunctionNotActive => {
13058                    std::option::Option::Some("CLOUD_FUNCTION_NOT_ACTIVE")
13059                }
13060                Self::VpcConnectorNotSet => std::option::Option::Some("VPC_CONNECTOR_NOT_SET"),
13061                Self::VpcConnectorNotRunning => {
13062                    std::option::Option::Some("VPC_CONNECTOR_NOT_RUNNING")
13063                }
13064                Self::VpcConnectorServerlessTrafficBlocked => {
13065                    std::option::Option::Some("VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED")
13066                }
13067                Self::VpcConnectorHealthCheckTrafficBlocked => {
13068                    std::option::Option::Some("VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED")
13069                }
13070                Self::ForwardingRuleRegionMismatch => {
13071                    std::option::Option::Some("FORWARDING_RULE_REGION_MISMATCH")
13072                }
13073                Self::PscConnectionNotAccepted => {
13074                    std::option::Option::Some("PSC_CONNECTION_NOT_ACCEPTED")
13075                }
13076                Self::PscEndpointAccessedFromPeeredNetwork => {
13077                    std::option::Option::Some("PSC_ENDPOINT_ACCESSED_FROM_PEERED_NETWORK")
13078                }
13079                Self::PscNegProducerEndpointNoGlobalAccess => {
13080                    std::option::Option::Some("PSC_NEG_PRODUCER_ENDPOINT_NO_GLOBAL_ACCESS")
13081                }
13082                Self::PscNegProducerForwardingRuleMultiplePorts => {
13083                    std::option::Option::Some("PSC_NEG_PRODUCER_FORWARDING_RULE_MULTIPLE_PORTS")
13084                }
13085                Self::CloudSqlPscNegUnsupported => {
13086                    std::option::Option::Some("CLOUD_SQL_PSC_NEG_UNSUPPORTED")
13087                }
13088                Self::NoNatSubnetsForPscServiceAttachment => {
13089                    std::option::Option::Some("NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT")
13090                }
13091                Self::PscTransitivityNotPropagated => {
13092                    std::option::Option::Some("PSC_TRANSITIVITY_NOT_PROPAGATED")
13093                }
13094                Self::HybridNegNonDynamicRouteMatched => {
13095                    std::option::Option::Some("HYBRID_NEG_NON_DYNAMIC_ROUTE_MATCHED")
13096                }
13097                Self::HybridNegNonLocalDynamicRouteMatched => {
13098                    std::option::Option::Some("HYBRID_NEG_NON_LOCAL_DYNAMIC_ROUTE_MATCHED")
13099                }
13100                Self::CloudRunRevisionNotReady => {
13101                    std::option::Option::Some("CLOUD_RUN_REVISION_NOT_READY")
13102                }
13103                Self::DroppedInsidePscServiceProducer => {
13104                    std::option::Option::Some("DROPPED_INSIDE_PSC_SERVICE_PRODUCER")
13105                }
13106                Self::LoadBalancerHasNoProxySubnet => {
13107                    std::option::Option::Some("LOAD_BALANCER_HAS_NO_PROXY_SUBNET")
13108                }
13109                Self::CloudNatNoAddresses => std::option::Option::Some("CLOUD_NAT_NO_ADDRESSES"),
13110                Self::RoutingLoop => std::option::Option::Some("ROUTING_LOOP"),
13111                Self::DroppedInsideGoogleManagedService => {
13112                    std::option::Option::Some("DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE")
13113                }
13114                Self::LoadBalancerBackendInvalidNetwork => {
13115                    std::option::Option::Some("LOAD_BALANCER_BACKEND_INVALID_NETWORK")
13116                }
13117                Self::BackendServiceNamedPortNotDefined => {
13118                    std::option::Option::Some("BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED")
13119                }
13120                Self::DestinationIsPrivateNatIpRange => {
13121                    std::option::Option::Some("DESTINATION_IS_PRIVATE_NAT_IP_RANGE")
13122                }
13123                Self::DroppedInsideRedisInstanceService => {
13124                    std::option::Option::Some("DROPPED_INSIDE_REDIS_INSTANCE_SERVICE")
13125                }
13126                Self::RedisInstanceUnsupportedPort => {
13127                    std::option::Option::Some("REDIS_INSTANCE_UNSUPPORTED_PORT")
13128                }
13129                Self::RedisInstanceConnectingFromPupiAddress => {
13130                    std::option::Option::Some("REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS")
13131                }
13132                Self::RedisInstanceNoRouteToDestinationNetwork => {
13133                    std::option::Option::Some("REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK")
13134                }
13135                Self::RedisInstanceNoExternalIp => {
13136                    std::option::Option::Some("REDIS_INSTANCE_NO_EXTERNAL_IP")
13137                }
13138                Self::RedisInstanceUnsupportedProtocol => {
13139                    std::option::Option::Some("REDIS_INSTANCE_UNSUPPORTED_PROTOCOL")
13140                }
13141                Self::DroppedInsideRedisClusterService => {
13142                    std::option::Option::Some("DROPPED_INSIDE_REDIS_CLUSTER_SERVICE")
13143                }
13144                Self::RedisClusterUnsupportedPort => {
13145                    std::option::Option::Some("REDIS_CLUSTER_UNSUPPORTED_PORT")
13146                }
13147                Self::RedisClusterNoExternalIp => {
13148                    std::option::Option::Some("REDIS_CLUSTER_NO_EXTERNAL_IP")
13149                }
13150                Self::RedisClusterUnsupportedProtocol => {
13151                    std::option::Option::Some("REDIS_CLUSTER_UNSUPPORTED_PROTOCOL")
13152                }
13153                Self::NoAdvertisedRouteToGcpDestination => {
13154                    std::option::Option::Some("NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION")
13155                }
13156                Self::NoTrafficSelectorToGcpDestination => {
13157                    std::option::Option::Some("NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION")
13158                }
13159                Self::NoKnownRouteFromPeeredNetworkToDestination => {
13160                    std::option::Option::Some("NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION")
13161                }
13162                Self::PrivateNatToPscEndpointUnsupported => {
13163                    std::option::Option::Some("PRIVATE_NAT_TO_PSC_ENDPOINT_UNSUPPORTED")
13164                }
13165                Self::PscPortMappingPortMismatch => {
13166                    std::option::Option::Some("PSC_PORT_MAPPING_PORT_MISMATCH")
13167                }
13168                Self::PscPortMappingWithoutPscConnectionUnsupported => {
13169                    std::option::Option::Some("PSC_PORT_MAPPING_WITHOUT_PSC_CONNECTION_UNSUPPORTED")
13170                }
13171                Self::UnsupportedRouteMatchedForNat64Destination => {
13172                    std::option::Option::Some("UNSUPPORTED_ROUTE_MATCHED_FOR_NAT64_DESTINATION")
13173                }
13174                Self::TrafficFromHybridEndpointToInternetDisallowed => {
13175                    std::option::Option::Some("TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED")
13176                }
13177                Self::NoMatchingNat64Gateway => {
13178                    std::option::Option::Some("NO_MATCHING_NAT64_GATEWAY")
13179                }
13180                Self::NoConfiguredPrivateNat64Rule => {
13181                    std::option::Option::Some("NO_CONFIGURED_PRIVATE_NAT64_RULE")
13182                }
13183                Self::LoadBalancerBackendIpVersionMismatch => {
13184                    std::option::Option::Some("LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH")
13185                }
13186                Self::NoKnownRouteFromNccNetworkToDestination => {
13187                    std::option::Option::Some("NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION")
13188                }
13189                Self::CloudNatProtocolUnsupported => {
13190                    std::option::Option::Some("CLOUD_NAT_PROTOCOL_UNSUPPORTED")
13191                }
13192                Self::L2InterconnectUnsupportedProtocol => {
13193                    std::option::Option::Some("L2_INTERCONNECT_UNSUPPORTED_PROTOCOL")
13194                }
13195                Self::L2InterconnectUnsupportedPort => {
13196                    std::option::Option::Some("L2_INTERCONNECT_UNSUPPORTED_PORT")
13197                }
13198                Self::L2InterconnectDestinationIpMismatch => {
13199                    std::option::Option::Some("L2_INTERCONNECT_DESTINATION_IP_MISMATCH")
13200                }
13201                Self::NccRouteWithinHybridSubnetUnsupported => {
13202                    std::option::Option::Some("NCC_ROUTE_WITHIN_HYBRID_SUBNET_UNSUPPORTED")
13203                }
13204                Self::HybridSubnetRegionMismatch => {
13205                    std::option::Option::Some("HYBRID_SUBNET_REGION_MISMATCH")
13206                }
13207                Self::HybridSubnetNoRoute => std::option::Option::Some("HYBRID_SUBNET_NO_ROUTE"),
13208                Self::GkeNetworkPolicy => std::option::Option::Some("GKE_NETWORK_POLICY"),
13209                Self::NoValidRouteFromGoogleManagedNetworkToDestination => {
13210                    std::option::Option::Some(
13211                        "NO_VALID_ROUTE_FROM_GOOGLE_MANAGED_NETWORK_TO_DESTINATION",
13212                    )
13213                }
13214                Self::UnknownValue(u) => u.0.name(),
13215            }
13216        }
13217    }
13218
13219    impl std::default::Default for Cause {
13220        fn default() -> Self {
13221            use std::convert::From;
13222            Self::from(0)
13223        }
13224    }
13225
13226    impl std::fmt::Display for Cause {
13227        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13228            wkt::internal::display_enum(f, self.name(), self.value())
13229        }
13230    }
13231
13232    impl std::convert::From<i32> for Cause {
13233        fn from(value: i32) -> Self {
13234            match value {
13235                0 => Self::Unspecified,
13236                1 => Self::UnknownExternalAddress,
13237                2 => Self::ForeignIpDisallowed,
13238                3 => Self::FirewallRule,
13239                4 => Self::NoRoute,
13240                5 => Self::RouteBlackhole,
13241                6 => Self::RouteWrongNetwork,
13242                7 => Self::PrivateTrafficToInternet,
13243                8 => Self::PrivateGoogleAccessDisallowed,
13244                9 => Self::NoExternalAddress,
13245                10 => Self::UnknownInternalAddress,
13246                11 => Self::ForwardingRuleMismatch,
13247                12 => Self::ForwardingRuleNoInstances,
13248                13 => Self::FirewallBlockingLoadBalancerBackendHealthCheck,
13249                14 => Self::InstanceNotRunning,
13250                15 => Self::TrafficTypeBlocked,
13251                16 => Self::GkeMasterUnauthorizedAccess,
13252                17 => Self::CloudSqlInstanceUnauthorizedAccess,
13253                18 => Self::DroppedInsideGkeService,
13254                19 => Self::DroppedInsideCloudSqlService,
13255                20 => Self::GoogleManagedServiceNoPeering,
13256                21 => Self::CloudSqlInstanceNoIpAddress,
13257                22 => Self::CloudFunctionNotActive,
13258                23 => Self::VpcConnectorNotSet,
13259                24 => Self::VpcConnectorNotRunning,
13260                25 => Self::ForwardingRuleRegionMismatch,
13261                26 => Self::PscConnectionNotAccepted,
13262                27 => Self::GkeClusterNotRunning,
13263                28 => Self::CloudSqlInstanceNotRunning,
13264                29 => Self::CloudRunRevisionNotReady,
13265                30 => Self::GkeControlPlaneRegionMismatch,
13266                31 => Self::PublicGkeControlPlaneToPrivateDestination,
13267                32 => Self::GkeControlPlaneNoRoute,
13268                33 => Self::CloudSqlInstanceNotConfiguredForExternalTraffic,
13269                34 => Self::PublicCloudSqlInstanceToPrivateDestination,
13270                35 => Self::CloudSqlInstanceNoRoute,
13271                36 => Self::GkePscEndpointMissing,
13272                37 => Self::DroppedInsidePscServiceProducer,
13273                38 => Self::GoogleManagedServiceNoPscEndpoint,
13274                39 => Self::LoadBalancerHasNoProxySubnet,
13275                40 => Self::CloudNatNoAddresses,
13276                41 => Self::PscEndpointAccessedFromPeeredNetwork,
13277                42 => Self::RouteNextHopIpAddressNotResolved,
13278                43 => Self::RouteNextHopResourceNotFound,
13279                44 => Self::NoRouteFromInternetToPrivateIpv6Address,
13280                45 => Self::VpnTunnelLocalSelectorMismatch,
13281                46 => Self::VpnTunnelRemoteSelectorMismatch,
13282                47 => Self::PrivateGoogleAccessViaVpnTunnelUnsupported,
13283                48 => Self::PscNegProducerEndpointNoGlobalAccess,
13284                49 => Self::RouteNextHopInstanceWrongNetwork,
13285                50 => Self::RouteNextHopInstanceNonPrimaryIp,
13286                51 => Self::RouteNextHopForwardingRuleIpMismatch,
13287                52 => Self::RouteNextHopVpnTunnelNotEstablished,
13288                53 => Self::RouteNextHopForwardingRuleTypeInvalid,
13289                54 => Self::PscNegProducerForwardingRuleMultiplePorts,
13290                55 => Self::HybridNegNonDynamicRouteMatched,
13291                56 => Self::HybridNegNonLocalDynamicRouteMatched,
13292                57 => Self::NoNatSubnetsForPscServiceAttachment,
13293                58 => Self::CloudSqlPscNegUnsupported,
13294                59 => Self::RoutingLoop,
13295                60 => Self::VpcConnectorServerlessTrafficBlocked,
13296                61 => Self::VpcConnectorHealthCheckTrafficBlocked,
13297                62 => Self::DroppedInsideGoogleManagedService,
13298                63 => Self::CloudSqlConnectorRequired,
13299                64 => Self::PscTransitivityNotPropagated,
13300                65 => Self::LoadBalancerBackendInvalidNetwork,
13301                66 => Self::BackendServiceNamedPortNotDefined,
13302                67 => Self::DestinationIsPrivateNatIpRange,
13303                68 => Self::RedisInstanceNotRunning,
13304                69 => Self::RedisClusterNotRunning,
13305                70 => Self::DroppedInsideRedisInstanceService,
13306                71 => Self::RedisInstanceUnsupportedPort,
13307                72 => Self::RedisInstanceConnectingFromPupiAddress,
13308                73 => Self::RedisInstanceNoRouteToDestinationNetwork,
13309                74 => Self::RedisInstanceNoExternalIp,
13310                75 => Self::DroppedInsideRedisClusterService,
13311                76 => Self::RedisClusterUnsupportedPort,
13312                77 => Self::RedisClusterNoExternalIp,
13313                78 => Self::RedisInstanceUnsupportedProtocol,
13314                79 => Self::RedisClusterUnsupportedProtocol,
13315                80 => Self::NoAdvertisedRouteToGcpDestination,
13316                81 => Self::NoTrafficSelectorToGcpDestination,
13317                82 => Self::NoKnownRouteFromPeeredNetworkToDestination,
13318                83 => Self::PrivateNatToPscEndpointUnsupported,
13319                85 => Self::IngressFirewallTagsUnsupportedByDirectVpcEgress,
13320                86 => Self::PscPortMappingPortMismatch,
13321                87 => Self::PscPortMappingWithoutPscConnectionUnsupported,
13322                88 => Self::UnsupportedRouteMatchedForNat64Destination,
13323                89 => Self::TrafficFromHybridEndpointToInternetDisallowed,
13324                90 => Self::NoMatchingNat64Gateway,
13325                96 => Self::LoadBalancerBackendIpVersionMismatch,
13326                97 => Self::NoKnownRouteFromNccNetworkToDestination,
13327                98 => Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address,
13328                99 => Self::CloudNatProtocolUnsupported,
13329                100 => Self::L2InterconnectUnsupportedProtocol,
13330                101 => Self::L2InterconnectUnsupportedPort,
13331                102 => Self::L2InterconnectDestinationIpMismatch,
13332                103 => Self::GkePodNotRunning,
13333                104 => Self::NccRouteWithinHybridSubnetUnsupported,
13334                105 => Self::HybridSubnetRegionMismatch,
13335                106 => Self::HybridSubnetNoRoute,
13336                107 => Self::NoConfiguredPrivateNat64Rule,
13337                108 => Self::GkeNetworkPolicy,
13338                109 => Self::NoRouteFromInternetToPrivateIpv4Address,
13339                110 => Self::NoValidRouteFromGoogleManagedNetworkToDestination,
13340                _ => Self::UnknownValue(cause::UnknownValue(
13341                    wkt::internal::UnknownEnumValue::Integer(value),
13342                )),
13343            }
13344        }
13345    }
13346
13347    impl std::convert::From<&str> for Cause {
13348        fn from(value: &str) -> Self {
13349            use std::string::ToString;
13350            match value {
13351                "CAUSE_UNSPECIFIED" => Self::Unspecified,
13352                "UNKNOWN_EXTERNAL_ADDRESS" => Self::UnknownExternalAddress,
13353                "FOREIGN_IP_DISALLOWED" => Self::ForeignIpDisallowed,
13354                "FIREWALL_RULE" => Self::FirewallRule,
13355                "NO_ROUTE" => Self::NoRoute,
13356                "ROUTE_BLACKHOLE" => Self::RouteBlackhole,
13357                "ROUTE_WRONG_NETWORK" => Self::RouteWrongNetwork,
13358                "ROUTE_NEXT_HOP_IP_ADDRESS_NOT_RESOLVED" => Self::RouteNextHopIpAddressNotResolved,
13359                "ROUTE_NEXT_HOP_RESOURCE_NOT_FOUND" => Self::RouteNextHopResourceNotFound,
13360                "ROUTE_NEXT_HOP_INSTANCE_WRONG_NETWORK" => Self::RouteNextHopInstanceWrongNetwork,
13361                "ROUTE_NEXT_HOP_INSTANCE_NON_PRIMARY_IP" => Self::RouteNextHopInstanceNonPrimaryIp,
13362                "ROUTE_NEXT_HOP_FORWARDING_RULE_IP_MISMATCH" => {
13363                    Self::RouteNextHopForwardingRuleIpMismatch
13364                }
13365                "ROUTE_NEXT_HOP_VPN_TUNNEL_NOT_ESTABLISHED" => {
13366                    Self::RouteNextHopVpnTunnelNotEstablished
13367                }
13368                "ROUTE_NEXT_HOP_FORWARDING_RULE_TYPE_INVALID" => {
13369                    Self::RouteNextHopForwardingRuleTypeInvalid
13370                }
13371                "NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV6_ADDRESS" => {
13372                    Self::NoRouteFromInternetToPrivateIpv6Address
13373                }
13374                "NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV4_ADDRESS" => {
13375                    Self::NoRouteFromInternetToPrivateIpv4Address
13376                }
13377                "NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS" => {
13378                    Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address
13379                }
13380                "VPN_TUNNEL_LOCAL_SELECTOR_MISMATCH" => Self::VpnTunnelLocalSelectorMismatch,
13381                "VPN_TUNNEL_REMOTE_SELECTOR_MISMATCH" => Self::VpnTunnelRemoteSelectorMismatch,
13382                "PRIVATE_TRAFFIC_TO_INTERNET" => Self::PrivateTrafficToInternet,
13383                "PRIVATE_GOOGLE_ACCESS_DISALLOWED" => Self::PrivateGoogleAccessDisallowed,
13384                "PRIVATE_GOOGLE_ACCESS_VIA_VPN_TUNNEL_UNSUPPORTED" => {
13385                    Self::PrivateGoogleAccessViaVpnTunnelUnsupported
13386                }
13387                "NO_EXTERNAL_ADDRESS" => Self::NoExternalAddress,
13388                "UNKNOWN_INTERNAL_ADDRESS" => Self::UnknownInternalAddress,
13389                "FORWARDING_RULE_MISMATCH" => Self::ForwardingRuleMismatch,
13390                "FORWARDING_RULE_NO_INSTANCES" => Self::ForwardingRuleNoInstances,
13391                "FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK" => {
13392                    Self::FirewallBlockingLoadBalancerBackendHealthCheck
13393                }
13394                "INGRESS_FIREWALL_TAGS_UNSUPPORTED_BY_DIRECT_VPC_EGRESS" => {
13395                    Self::IngressFirewallTagsUnsupportedByDirectVpcEgress
13396                }
13397                "INSTANCE_NOT_RUNNING" => Self::InstanceNotRunning,
13398                "GKE_CLUSTER_NOT_RUNNING" => Self::GkeClusterNotRunning,
13399                "GKE_POD_NOT_RUNNING" => Self::GkePodNotRunning,
13400                "CLOUD_SQL_INSTANCE_NOT_RUNNING" => Self::CloudSqlInstanceNotRunning,
13401                "REDIS_INSTANCE_NOT_RUNNING" => Self::RedisInstanceNotRunning,
13402                "REDIS_CLUSTER_NOT_RUNNING" => Self::RedisClusterNotRunning,
13403                "TRAFFIC_TYPE_BLOCKED" => Self::TrafficTypeBlocked,
13404                "GKE_MASTER_UNAUTHORIZED_ACCESS" => Self::GkeMasterUnauthorizedAccess,
13405                "CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS" => {
13406                    Self::CloudSqlInstanceUnauthorizedAccess
13407                }
13408                "DROPPED_INSIDE_GKE_SERVICE" => Self::DroppedInsideGkeService,
13409                "DROPPED_INSIDE_CLOUD_SQL_SERVICE" => Self::DroppedInsideCloudSqlService,
13410                "GOOGLE_MANAGED_SERVICE_NO_PEERING" => Self::GoogleManagedServiceNoPeering,
13411                "GOOGLE_MANAGED_SERVICE_NO_PSC_ENDPOINT" => Self::GoogleManagedServiceNoPscEndpoint,
13412                "GKE_PSC_ENDPOINT_MISSING" => Self::GkePscEndpointMissing,
13413                "CLOUD_SQL_INSTANCE_NO_IP_ADDRESS" => Self::CloudSqlInstanceNoIpAddress,
13414                "GKE_CONTROL_PLANE_REGION_MISMATCH" => Self::GkeControlPlaneRegionMismatch,
13415                "PUBLIC_GKE_CONTROL_PLANE_TO_PRIVATE_DESTINATION" => {
13416                    Self::PublicGkeControlPlaneToPrivateDestination
13417                }
13418                "GKE_CONTROL_PLANE_NO_ROUTE" => Self::GkeControlPlaneNoRoute,
13419                "CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC" => {
13420                    Self::CloudSqlInstanceNotConfiguredForExternalTraffic
13421                }
13422                "PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION" => {
13423                    Self::PublicCloudSqlInstanceToPrivateDestination
13424                }
13425                "CLOUD_SQL_INSTANCE_NO_ROUTE" => Self::CloudSqlInstanceNoRoute,
13426                "CLOUD_SQL_CONNECTOR_REQUIRED" => Self::CloudSqlConnectorRequired,
13427                "CLOUD_FUNCTION_NOT_ACTIVE" => Self::CloudFunctionNotActive,
13428                "VPC_CONNECTOR_NOT_SET" => Self::VpcConnectorNotSet,
13429                "VPC_CONNECTOR_NOT_RUNNING" => Self::VpcConnectorNotRunning,
13430                "VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED" => {
13431                    Self::VpcConnectorServerlessTrafficBlocked
13432                }
13433                "VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED" => {
13434                    Self::VpcConnectorHealthCheckTrafficBlocked
13435                }
13436                "FORWARDING_RULE_REGION_MISMATCH" => Self::ForwardingRuleRegionMismatch,
13437                "PSC_CONNECTION_NOT_ACCEPTED" => Self::PscConnectionNotAccepted,
13438                "PSC_ENDPOINT_ACCESSED_FROM_PEERED_NETWORK" => {
13439                    Self::PscEndpointAccessedFromPeeredNetwork
13440                }
13441                "PSC_NEG_PRODUCER_ENDPOINT_NO_GLOBAL_ACCESS" => {
13442                    Self::PscNegProducerEndpointNoGlobalAccess
13443                }
13444                "PSC_NEG_PRODUCER_FORWARDING_RULE_MULTIPLE_PORTS" => {
13445                    Self::PscNegProducerForwardingRuleMultiplePorts
13446                }
13447                "CLOUD_SQL_PSC_NEG_UNSUPPORTED" => Self::CloudSqlPscNegUnsupported,
13448                "NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT" => {
13449                    Self::NoNatSubnetsForPscServiceAttachment
13450                }
13451                "PSC_TRANSITIVITY_NOT_PROPAGATED" => Self::PscTransitivityNotPropagated,
13452                "HYBRID_NEG_NON_DYNAMIC_ROUTE_MATCHED" => Self::HybridNegNonDynamicRouteMatched,
13453                "HYBRID_NEG_NON_LOCAL_DYNAMIC_ROUTE_MATCHED" => {
13454                    Self::HybridNegNonLocalDynamicRouteMatched
13455                }
13456                "CLOUD_RUN_REVISION_NOT_READY" => Self::CloudRunRevisionNotReady,
13457                "DROPPED_INSIDE_PSC_SERVICE_PRODUCER" => Self::DroppedInsidePscServiceProducer,
13458                "LOAD_BALANCER_HAS_NO_PROXY_SUBNET" => Self::LoadBalancerHasNoProxySubnet,
13459                "CLOUD_NAT_NO_ADDRESSES" => Self::CloudNatNoAddresses,
13460                "ROUTING_LOOP" => Self::RoutingLoop,
13461                "DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE" => Self::DroppedInsideGoogleManagedService,
13462                "LOAD_BALANCER_BACKEND_INVALID_NETWORK" => Self::LoadBalancerBackendInvalidNetwork,
13463                "BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED" => Self::BackendServiceNamedPortNotDefined,
13464                "DESTINATION_IS_PRIVATE_NAT_IP_RANGE" => Self::DestinationIsPrivateNatIpRange,
13465                "DROPPED_INSIDE_REDIS_INSTANCE_SERVICE" => Self::DroppedInsideRedisInstanceService,
13466                "REDIS_INSTANCE_UNSUPPORTED_PORT" => Self::RedisInstanceUnsupportedPort,
13467                "REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS" => {
13468                    Self::RedisInstanceConnectingFromPupiAddress
13469                }
13470                "REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK" => {
13471                    Self::RedisInstanceNoRouteToDestinationNetwork
13472                }
13473                "REDIS_INSTANCE_NO_EXTERNAL_IP" => Self::RedisInstanceNoExternalIp,
13474                "REDIS_INSTANCE_UNSUPPORTED_PROTOCOL" => Self::RedisInstanceUnsupportedProtocol,
13475                "DROPPED_INSIDE_REDIS_CLUSTER_SERVICE" => Self::DroppedInsideRedisClusterService,
13476                "REDIS_CLUSTER_UNSUPPORTED_PORT" => Self::RedisClusterUnsupportedPort,
13477                "REDIS_CLUSTER_NO_EXTERNAL_IP" => Self::RedisClusterNoExternalIp,
13478                "REDIS_CLUSTER_UNSUPPORTED_PROTOCOL" => Self::RedisClusterUnsupportedProtocol,
13479                "NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION" => Self::NoAdvertisedRouteToGcpDestination,
13480                "NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION" => Self::NoTrafficSelectorToGcpDestination,
13481                "NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION" => {
13482                    Self::NoKnownRouteFromPeeredNetworkToDestination
13483                }
13484                "PRIVATE_NAT_TO_PSC_ENDPOINT_UNSUPPORTED" => {
13485                    Self::PrivateNatToPscEndpointUnsupported
13486                }
13487                "PSC_PORT_MAPPING_PORT_MISMATCH" => Self::PscPortMappingPortMismatch,
13488                "PSC_PORT_MAPPING_WITHOUT_PSC_CONNECTION_UNSUPPORTED" => {
13489                    Self::PscPortMappingWithoutPscConnectionUnsupported
13490                }
13491                "UNSUPPORTED_ROUTE_MATCHED_FOR_NAT64_DESTINATION" => {
13492                    Self::UnsupportedRouteMatchedForNat64Destination
13493                }
13494                "TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED" => {
13495                    Self::TrafficFromHybridEndpointToInternetDisallowed
13496                }
13497                "NO_MATCHING_NAT64_GATEWAY" => Self::NoMatchingNat64Gateway,
13498                "NO_CONFIGURED_PRIVATE_NAT64_RULE" => Self::NoConfiguredPrivateNat64Rule,
13499                "LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH" => {
13500                    Self::LoadBalancerBackendIpVersionMismatch
13501                }
13502                "NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION" => {
13503                    Self::NoKnownRouteFromNccNetworkToDestination
13504                }
13505                "CLOUD_NAT_PROTOCOL_UNSUPPORTED" => Self::CloudNatProtocolUnsupported,
13506                "L2_INTERCONNECT_UNSUPPORTED_PROTOCOL" => Self::L2InterconnectUnsupportedProtocol,
13507                "L2_INTERCONNECT_UNSUPPORTED_PORT" => Self::L2InterconnectUnsupportedPort,
13508                "L2_INTERCONNECT_DESTINATION_IP_MISMATCH" => {
13509                    Self::L2InterconnectDestinationIpMismatch
13510                }
13511                "NCC_ROUTE_WITHIN_HYBRID_SUBNET_UNSUPPORTED" => {
13512                    Self::NccRouteWithinHybridSubnetUnsupported
13513                }
13514                "HYBRID_SUBNET_REGION_MISMATCH" => Self::HybridSubnetRegionMismatch,
13515                "HYBRID_SUBNET_NO_ROUTE" => Self::HybridSubnetNoRoute,
13516                "GKE_NETWORK_POLICY" => Self::GkeNetworkPolicy,
13517                "NO_VALID_ROUTE_FROM_GOOGLE_MANAGED_NETWORK_TO_DESTINATION" => {
13518                    Self::NoValidRouteFromGoogleManagedNetworkToDestination
13519                }
13520                _ => Self::UnknownValue(cause::UnknownValue(
13521                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13522                )),
13523            }
13524        }
13525    }
13526
13527    impl serde::ser::Serialize for Cause {
13528        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13529        where
13530            S: serde::Serializer,
13531        {
13532            match self {
13533                Self::Unspecified => serializer.serialize_i32(0),
13534                Self::UnknownExternalAddress => serializer.serialize_i32(1),
13535                Self::ForeignIpDisallowed => serializer.serialize_i32(2),
13536                Self::FirewallRule => serializer.serialize_i32(3),
13537                Self::NoRoute => serializer.serialize_i32(4),
13538                Self::RouteBlackhole => serializer.serialize_i32(5),
13539                Self::RouteWrongNetwork => serializer.serialize_i32(6),
13540                Self::RouteNextHopIpAddressNotResolved => serializer.serialize_i32(42),
13541                Self::RouteNextHopResourceNotFound => serializer.serialize_i32(43),
13542                Self::RouteNextHopInstanceWrongNetwork => serializer.serialize_i32(49),
13543                Self::RouteNextHopInstanceNonPrimaryIp => serializer.serialize_i32(50),
13544                Self::RouteNextHopForwardingRuleIpMismatch => serializer.serialize_i32(51),
13545                Self::RouteNextHopVpnTunnelNotEstablished => serializer.serialize_i32(52),
13546                Self::RouteNextHopForwardingRuleTypeInvalid => serializer.serialize_i32(53),
13547                Self::NoRouteFromInternetToPrivateIpv6Address => serializer.serialize_i32(44),
13548                Self::NoRouteFromInternetToPrivateIpv4Address => serializer.serialize_i32(109),
13549                Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
13550                    serializer.serialize_i32(98)
13551                }
13552                Self::VpnTunnelLocalSelectorMismatch => serializer.serialize_i32(45),
13553                Self::VpnTunnelRemoteSelectorMismatch => serializer.serialize_i32(46),
13554                Self::PrivateTrafficToInternet => serializer.serialize_i32(7),
13555                Self::PrivateGoogleAccessDisallowed => serializer.serialize_i32(8),
13556                Self::PrivateGoogleAccessViaVpnTunnelUnsupported => serializer.serialize_i32(47),
13557                Self::NoExternalAddress => serializer.serialize_i32(9),
13558                Self::UnknownInternalAddress => serializer.serialize_i32(10),
13559                Self::ForwardingRuleMismatch => serializer.serialize_i32(11),
13560                Self::ForwardingRuleNoInstances => serializer.serialize_i32(12),
13561                Self::FirewallBlockingLoadBalancerBackendHealthCheck => {
13562                    serializer.serialize_i32(13)
13563                }
13564                Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => {
13565                    serializer.serialize_i32(85)
13566                }
13567                Self::InstanceNotRunning => serializer.serialize_i32(14),
13568                Self::GkeClusterNotRunning => serializer.serialize_i32(27),
13569                Self::GkePodNotRunning => serializer.serialize_i32(103),
13570                Self::CloudSqlInstanceNotRunning => serializer.serialize_i32(28),
13571                Self::RedisInstanceNotRunning => serializer.serialize_i32(68),
13572                Self::RedisClusterNotRunning => serializer.serialize_i32(69),
13573                Self::TrafficTypeBlocked => serializer.serialize_i32(15),
13574                Self::GkeMasterUnauthorizedAccess => serializer.serialize_i32(16),
13575                Self::CloudSqlInstanceUnauthorizedAccess => serializer.serialize_i32(17),
13576                Self::DroppedInsideGkeService => serializer.serialize_i32(18),
13577                Self::DroppedInsideCloudSqlService => serializer.serialize_i32(19),
13578                Self::GoogleManagedServiceNoPeering => serializer.serialize_i32(20),
13579                Self::GoogleManagedServiceNoPscEndpoint => serializer.serialize_i32(38),
13580                Self::GkePscEndpointMissing => serializer.serialize_i32(36),
13581                Self::CloudSqlInstanceNoIpAddress => serializer.serialize_i32(21),
13582                Self::GkeControlPlaneRegionMismatch => serializer.serialize_i32(30),
13583                Self::PublicGkeControlPlaneToPrivateDestination => serializer.serialize_i32(31),
13584                Self::GkeControlPlaneNoRoute => serializer.serialize_i32(32),
13585                Self::CloudSqlInstanceNotConfiguredForExternalTraffic => {
13586                    serializer.serialize_i32(33)
13587                }
13588                Self::PublicCloudSqlInstanceToPrivateDestination => serializer.serialize_i32(34),
13589                Self::CloudSqlInstanceNoRoute => serializer.serialize_i32(35),
13590                Self::CloudSqlConnectorRequired => serializer.serialize_i32(63),
13591                Self::CloudFunctionNotActive => serializer.serialize_i32(22),
13592                Self::VpcConnectorNotSet => serializer.serialize_i32(23),
13593                Self::VpcConnectorNotRunning => serializer.serialize_i32(24),
13594                Self::VpcConnectorServerlessTrafficBlocked => serializer.serialize_i32(60),
13595                Self::VpcConnectorHealthCheckTrafficBlocked => serializer.serialize_i32(61),
13596                Self::ForwardingRuleRegionMismatch => serializer.serialize_i32(25),
13597                Self::PscConnectionNotAccepted => serializer.serialize_i32(26),
13598                Self::PscEndpointAccessedFromPeeredNetwork => serializer.serialize_i32(41),
13599                Self::PscNegProducerEndpointNoGlobalAccess => serializer.serialize_i32(48),
13600                Self::PscNegProducerForwardingRuleMultiplePorts => serializer.serialize_i32(54),
13601                Self::CloudSqlPscNegUnsupported => serializer.serialize_i32(58),
13602                Self::NoNatSubnetsForPscServiceAttachment => serializer.serialize_i32(57),
13603                Self::PscTransitivityNotPropagated => serializer.serialize_i32(64),
13604                Self::HybridNegNonDynamicRouteMatched => serializer.serialize_i32(55),
13605                Self::HybridNegNonLocalDynamicRouteMatched => serializer.serialize_i32(56),
13606                Self::CloudRunRevisionNotReady => serializer.serialize_i32(29),
13607                Self::DroppedInsidePscServiceProducer => serializer.serialize_i32(37),
13608                Self::LoadBalancerHasNoProxySubnet => serializer.serialize_i32(39),
13609                Self::CloudNatNoAddresses => serializer.serialize_i32(40),
13610                Self::RoutingLoop => serializer.serialize_i32(59),
13611                Self::DroppedInsideGoogleManagedService => serializer.serialize_i32(62),
13612                Self::LoadBalancerBackendInvalidNetwork => serializer.serialize_i32(65),
13613                Self::BackendServiceNamedPortNotDefined => serializer.serialize_i32(66),
13614                Self::DestinationIsPrivateNatIpRange => serializer.serialize_i32(67),
13615                Self::DroppedInsideRedisInstanceService => serializer.serialize_i32(70),
13616                Self::RedisInstanceUnsupportedPort => serializer.serialize_i32(71),
13617                Self::RedisInstanceConnectingFromPupiAddress => serializer.serialize_i32(72),
13618                Self::RedisInstanceNoRouteToDestinationNetwork => serializer.serialize_i32(73),
13619                Self::RedisInstanceNoExternalIp => serializer.serialize_i32(74),
13620                Self::RedisInstanceUnsupportedProtocol => serializer.serialize_i32(78),
13621                Self::DroppedInsideRedisClusterService => serializer.serialize_i32(75),
13622                Self::RedisClusterUnsupportedPort => serializer.serialize_i32(76),
13623                Self::RedisClusterNoExternalIp => serializer.serialize_i32(77),
13624                Self::RedisClusterUnsupportedProtocol => serializer.serialize_i32(79),
13625                Self::NoAdvertisedRouteToGcpDestination => serializer.serialize_i32(80),
13626                Self::NoTrafficSelectorToGcpDestination => serializer.serialize_i32(81),
13627                Self::NoKnownRouteFromPeeredNetworkToDestination => serializer.serialize_i32(82),
13628                Self::PrivateNatToPscEndpointUnsupported => serializer.serialize_i32(83),
13629                Self::PscPortMappingPortMismatch => serializer.serialize_i32(86),
13630                Self::PscPortMappingWithoutPscConnectionUnsupported => serializer.serialize_i32(87),
13631                Self::UnsupportedRouteMatchedForNat64Destination => serializer.serialize_i32(88),
13632                Self::TrafficFromHybridEndpointToInternetDisallowed => serializer.serialize_i32(89),
13633                Self::NoMatchingNat64Gateway => serializer.serialize_i32(90),
13634                Self::NoConfiguredPrivateNat64Rule => serializer.serialize_i32(107),
13635                Self::LoadBalancerBackendIpVersionMismatch => serializer.serialize_i32(96),
13636                Self::NoKnownRouteFromNccNetworkToDestination => serializer.serialize_i32(97),
13637                Self::CloudNatProtocolUnsupported => serializer.serialize_i32(99),
13638                Self::L2InterconnectUnsupportedProtocol => serializer.serialize_i32(100),
13639                Self::L2InterconnectUnsupportedPort => serializer.serialize_i32(101),
13640                Self::L2InterconnectDestinationIpMismatch => serializer.serialize_i32(102),
13641                Self::NccRouteWithinHybridSubnetUnsupported => serializer.serialize_i32(104),
13642                Self::HybridSubnetRegionMismatch => serializer.serialize_i32(105),
13643                Self::HybridSubnetNoRoute => serializer.serialize_i32(106),
13644                Self::GkeNetworkPolicy => serializer.serialize_i32(108),
13645                Self::NoValidRouteFromGoogleManagedNetworkToDestination => {
13646                    serializer.serialize_i32(110)
13647                }
13648                Self::UnknownValue(u) => u.0.serialize(serializer),
13649            }
13650        }
13651    }
13652
13653    impl<'de> serde::de::Deserialize<'de> for Cause {
13654        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13655        where
13656            D: serde::Deserializer<'de>,
13657        {
13658            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Cause>::new(
13659                ".google.cloud.networkmanagement.v1.DropInfo.Cause",
13660            ))
13661        }
13662    }
13663}
13664
13665/// For display only. Metadata associated with a Google Kubernetes Engine (GKE)
13666/// cluster master.
13667#[derive(Clone, Default, PartialEq)]
13668#[non_exhaustive]
13669pub struct GKEMasterInfo {
13670    /// URI of a GKE cluster.
13671    pub cluster_uri: std::string::String,
13672
13673    /// URI of a GKE cluster network.
13674    pub cluster_network_uri: std::string::String,
13675
13676    /// Internal IP address of a GKE cluster control plane.
13677    pub internal_ip: std::string::String,
13678
13679    /// External IP address of a GKE cluster control plane.
13680    pub external_ip: std::string::String,
13681
13682    /// DNS endpoint of a GKE cluster control plane.
13683    pub dns_endpoint: std::string::String,
13684
13685    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13686}
13687
13688impl GKEMasterInfo {
13689    pub fn new() -> Self {
13690        std::default::Default::default()
13691    }
13692
13693    /// Sets the value of [cluster_uri][crate::model::GKEMasterInfo::cluster_uri].
13694    ///
13695    /// # Example
13696    /// ```ignore,no_run
13697    /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13698    /// let x = GKEMasterInfo::new().set_cluster_uri("example");
13699    /// ```
13700    pub fn set_cluster_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13701        self.cluster_uri = v.into();
13702        self
13703    }
13704
13705    /// Sets the value of [cluster_network_uri][crate::model::GKEMasterInfo::cluster_network_uri].
13706    ///
13707    /// # Example
13708    /// ```ignore,no_run
13709    /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13710    /// let x = GKEMasterInfo::new().set_cluster_network_uri("example");
13711    /// ```
13712    pub fn set_cluster_network_uri<T: std::convert::Into<std::string::String>>(
13713        mut self,
13714        v: T,
13715    ) -> Self {
13716        self.cluster_network_uri = v.into();
13717        self
13718    }
13719
13720    /// Sets the value of [internal_ip][crate::model::GKEMasterInfo::internal_ip].
13721    ///
13722    /// # Example
13723    /// ```ignore,no_run
13724    /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13725    /// let x = GKEMasterInfo::new().set_internal_ip("example");
13726    /// ```
13727    pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13728        self.internal_ip = v.into();
13729        self
13730    }
13731
13732    /// Sets the value of [external_ip][crate::model::GKEMasterInfo::external_ip].
13733    ///
13734    /// # Example
13735    /// ```ignore,no_run
13736    /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13737    /// let x = GKEMasterInfo::new().set_external_ip("example");
13738    /// ```
13739    pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13740        self.external_ip = v.into();
13741        self
13742    }
13743
13744    /// Sets the value of [dns_endpoint][crate::model::GKEMasterInfo::dns_endpoint].
13745    ///
13746    /// # Example
13747    /// ```ignore,no_run
13748    /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13749    /// let x = GKEMasterInfo::new().set_dns_endpoint("example");
13750    /// ```
13751    pub fn set_dns_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13752        self.dns_endpoint = v.into();
13753        self
13754    }
13755}
13756
13757impl wkt::message::Message for GKEMasterInfo {
13758    fn typename() -> &'static str {
13759        "type.googleapis.com/google.cloud.networkmanagement.v1.GKEMasterInfo"
13760    }
13761}
13762
13763/// For display only. Metadata associated with a Google Kubernetes Engine (GKE)
13764/// Pod.
13765#[derive(Clone, Default, PartialEq)]
13766#[non_exhaustive]
13767pub struct GkePodInfo {
13768    /// URI of a GKE Pod.
13769    /// For Pods in regional Clusters, the URI format is:
13770    /// `projects/{project}/locations/{location}/clusters/{cluster}/k8s/namespaces/{namespace}/pods/{pod}`
13771    /// For Pods in zonal Clusters, the URI format is:
13772    /// `projects/{project}/zones/{zone}/clusters/{cluster}/k8s/namespaces/{namespace}/pods/{pod}`
13773    pub pod_uri: std::string::String,
13774
13775    /// IP address of a GKE Pod. If the Pod is dual-stack, this is the IP address
13776    /// relevant to the trace.
13777    pub ip_address: std::string::String,
13778
13779    /// URI of the network containing the GKE Pod.
13780    pub network_uri: std::string::String,
13781
13782    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13783}
13784
13785impl GkePodInfo {
13786    pub fn new() -> Self {
13787        std::default::Default::default()
13788    }
13789
13790    /// Sets the value of [pod_uri][crate::model::GkePodInfo::pod_uri].
13791    ///
13792    /// # Example
13793    /// ```ignore,no_run
13794    /// # use google_cloud_networkmanagement_v1::model::GkePodInfo;
13795    /// let x = GkePodInfo::new().set_pod_uri("example");
13796    /// ```
13797    pub fn set_pod_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13798        self.pod_uri = v.into();
13799        self
13800    }
13801
13802    /// Sets the value of [ip_address][crate::model::GkePodInfo::ip_address].
13803    ///
13804    /// # Example
13805    /// ```ignore,no_run
13806    /// # use google_cloud_networkmanagement_v1::model::GkePodInfo;
13807    /// let x = GkePodInfo::new().set_ip_address("example");
13808    /// ```
13809    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13810        self.ip_address = v.into();
13811        self
13812    }
13813
13814    /// Sets the value of [network_uri][crate::model::GkePodInfo::network_uri].
13815    ///
13816    /// # Example
13817    /// ```ignore,no_run
13818    /// # use google_cloud_networkmanagement_v1::model::GkePodInfo;
13819    /// let x = GkePodInfo::new().set_network_uri("example");
13820    /// ```
13821    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13822        self.network_uri = v.into();
13823        self
13824    }
13825}
13826
13827impl wkt::message::Message for GkePodInfo {
13828    fn typename() -> &'static str {
13829        "type.googleapis.com/google.cloud.networkmanagement.v1.GkePodInfo"
13830    }
13831}
13832
13833/// For display only. Contains information about why IP masquerading was skipped
13834/// for the packet.
13835#[derive(Clone, Default, PartialEq)]
13836#[non_exhaustive]
13837pub struct IpMasqueradingSkippedInfo {
13838    /// Reason why IP masquerading was not applied.
13839    pub reason: crate::model::ip_masquerading_skipped_info::Reason,
13840
13841    /// The matched non-masquerade IP range. Only set if reason is
13842    /// DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE or
13843    /// DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE.
13844    pub non_masquerade_range: std::string::String,
13845
13846    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13847}
13848
13849impl IpMasqueradingSkippedInfo {
13850    pub fn new() -> Self {
13851        std::default::Default::default()
13852    }
13853
13854    /// Sets the value of [reason][crate::model::IpMasqueradingSkippedInfo::reason].
13855    ///
13856    /// # Example
13857    /// ```ignore,no_run
13858    /// # use google_cloud_networkmanagement_v1::model::IpMasqueradingSkippedInfo;
13859    /// use google_cloud_networkmanagement_v1::model::ip_masquerading_skipped_info::Reason;
13860    /// let x0 = IpMasqueradingSkippedInfo::new().set_reason(Reason::DestinationIpInConfiguredNonMasqueradeRange);
13861    /// let x1 = IpMasqueradingSkippedInfo::new().set_reason(Reason::DestinationIpInDefaultNonMasqueradeRange);
13862    /// let x2 = IpMasqueradingSkippedInfo::new().set_reason(Reason::DestinationOnSameNode);
13863    /// ```
13864    pub fn set_reason<T: std::convert::Into<crate::model::ip_masquerading_skipped_info::Reason>>(
13865        mut self,
13866        v: T,
13867    ) -> Self {
13868        self.reason = v.into();
13869        self
13870    }
13871
13872    /// Sets the value of [non_masquerade_range][crate::model::IpMasqueradingSkippedInfo::non_masquerade_range].
13873    ///
13874    /// # Example
13875    /// ```ignore,no_run
13876    /// # use google_cloud_networkmanagement_v1::model::IpMasqueradingSkippedInfo;
13877    /// let x = IpMasqueradingSkippedInfo::new().set_non_masquerade_range("example");
13878    /// ```
13879    pub fn set_non_masquerade_range<T: std::convert::Into<std::string::String>>(
13880        mut self,
13881        v: T,
13882    ) -> Self {
13883        self.non_masquerade_range = v.into();
13884        self
13885    }
13886}
13887
13888impl wkt::message::Message for IpMasqueradingSkippedInfo {
13889    fn typename() -> &'static str {
13890        "type.googleapis.com/google.cloud.networkmanagement.v1.IpMasqueradingSkippedInfo"
13891    }
13892}
13893
13894/// Defines additional types related to [IpMasqueradingSkippedInfo].
13895pub mod ip_masquerading_skipped_info {
13896    #[allow(unused_imports)]
13897    use super::*;
13898
13899    /// Reason why IP masquerading was skipped.
13900    ///
13901    /// # Working with unknown values
13902    ///
13903    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13904    /// additional enum variants at any time. Adding new variants is not considered
13905    /// a breaking change. Applications should write their code in anticipation of:
13906    ///
13907    /// - New values appearing in future releases of the client library, **and**
13908    /// - New values received dynamically, without application changes.
13909    ///
13910    /// Please consult the [Working with enums] section in the user guide for some
13911    /// guidelines.
13912    ///
13913    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13914    #[derive(Clone, Debug, PartialEq)]
13915    #[non_exhaustive]
13916    pub enum Reason {
13917        /// Unused default value.
13918        Unspecified,
13919        /// Masquerading not applied because destination IP is in one of configured
13920        /// non-masquerade ranges.
13921        DestinationIpInConfiguredNonMasqueradeRange,
13922        /// Masquerading not applied because destination IP is in one of default
13923        /// non-masquerade ranges.
13924        DestinationIpInDefaultNonMasqueradeRange,
13925        /// Masquerading not applied because destination is on the same Node.
13926        DestinationOnSameNode,
13927        /// Masquerading not applied because ip-masq-agent doesn't exist and default
13928        /// SNAT is disabled.
13929        DefaultSnatDisabled,
13930        /// Masquerading not applied because the packet's IP version is IPv6.
13931        NoMasqueradingForIpv6,
13932        /// Masquerading not applied because the source Pod uses the host Node's
13933        /// network namespace, including the Node's IP address.
13934        PodUsesNodeNetworkNamespace,
13935        /// Masquerading not applied because the packet is a return packet.
13936        NoMasqueradingForReturnPacket,
13937        /// If set, the enum was initialized with an unknown value.
13938        ///
13939        /// Applications can examine the value using [Reason::value] or
13940        /// [Reason::name].
13941        UnknownValue(reason::UnknownValue),
13942    }
13943
13944    #[doc(hidden)]
13945    pub mod reason {
13946        #[allow(unused_imports)]
13947        use super::*;
13948        #[derive(Clone, Debug, PartialEq)]
13949        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13950    }
13951
13952    impl Reason {
13953        /// Gets the enum value.
13954        ///
13955        /// Returns `None` if the enum contains an unknown value deserialized from
13956        /// the string representation of enums.
13957        pub fn value(&self) -> std::option::Option<i32> {
13958            match self {
13959                Self::Unspecified => std::option::Option::Some(0),
13960                Self::DestinationIpInConfiguredNonMasqueradeRange => std::option::Option::Some(1),
13961                Self::DestinationIpInDefaultNonMasqueradeRange => std::option::Option::Some(2),
13962                Self::DestinationOnSameNode => std::option::Option::Some(3),
13963                Self::DefaultSnatDisabled => std::option::Option::Some(4),
13964                Self::NoMasqueradingForIpv6 => std::option::Option::Some(5),
13965                Self::PodUsesNodeNetworkNamespace => std::option::Option::Some(6),
13966                Self::NoMasqueradingForReturnPacket => std::option::Option::Some(7),
13967                Self::UnknownValue(u) => u.0.value(),
13968            }
13969        }
13970
13971        /// Gets the enum value as a string.
13972        ///
13973        /// Returns `None` if the enum contains an unknown value deserialized from
13974        /// the integer representation of enums.
13975        pub fn name(&self) -> std::option::Option<&str> {
13976            match self {
13977                Self::Unspecified => std::option::Option::Some("REASON_UNSPECIFIED"),
13978                Self::DestinationIpInConfiguredNonMasqueradeRange => {
13979                    std::option::Option::Some("DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE")
13980                }
13981                Self::DestinationIpInDefaultNonMasqueradeRange => {
13982                    std::option::Option::Some("DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE")
13983                }
13984                Self::DestinationOnSameNode => {
13985                    std::option::Option::Some("DESTINATION_ON_SAME_NODE")
13986                }
13987                Self::DefaultSnatDisabled => std::option::Option::Some("DEFAULT_SNAT_DISABLED"),
13988                Self::NoMasqueradingForIpv6 => {
13989                    std::option::Option::Some("NO_MASQUERADING_FOR_IPV6")
13990                }
13991                Self::PodUsesNodeNetworkNamespace => {
13992                    std::option::Option::Some("POD_USES_NODE_NETWORK_NAMESPACE")
13993                }
13994                Self::NoMasqueradingForReturnPacket => {
13995                    std::option::Option::Some("NO_MASQUERADING_FOR_RETURN_PACKET")
13996                }
13997                Self::UnknownValue(u) => u.0.name(),
13998            }
13999        }
14000    }
14001
14002    impl std::default::Default for Reason {
14003        fn default() -> Self {
14004            use std::convert::From;
14005            Self::from(0)
14006        }
14007    }
14008
14009    impl std::fmt::Display for Reason {
14010        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14011            wkt::internal::display_enum(f, self.name(), self.value())
14012        }
14013    }
14014
14015    impl std::convert::From<i32> for Reason {
14016        fn from(value: i32) -> Self {
14017            match value {
14018                0 => Self::Unspecified,
14019                1 => Self::DestinationIpInConfiguredNonMasqueradeRange,
14020                2 => Self::DestinationIpInDefaultNonMasqueradeRange,
14021                3 => Self::DestinationOnSameNode,
14022                4 => Self::DefaultSnatDisabled,
14023                5 => Self::NoMasqueradingForIpv6,
14024                6 => Self::PodUsesNodeNetworkNamespace,
14025                7 => Self::NoMasqueradingForReturnPacket,
14026                _ => Self::UnknownValue(reason::UnknownValue(
14027                    wkt::internal::UnknownEnumValue::Integer(value),
14028                )),
14029            }
14030        }
14031    }
14032
14033    impl std::convert::From<&str> for Reason {
14034        fn from(value: &str) -> Self {
14035            use std::string::ToString;
14036            match value {
14037                "REASON_UNSPECIFIED" => Self::Unspecified,
14038                "DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE" => {
14039                    Self::DestinationIpInConfiguredNonMasqueradeRange
14040                }
14041                "DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE" => {
14042                    Self::DestinationIpInDefaultNonMasqueradeRange
14043                }
14044                "DESTINATION_ON_SAME_NODE" => Self::DestinationOnSameNode,
14045                "DEFAULT_SNAT_DISABLED" => Self::DefaultSnatDisabled,
14046                "NO_MASQUERADING_FOR_IPV6" => Self::NoMasqueradingForIpv6,
14047                "POD_USES_NODE_NETWORK_NAMESPACE" => Self::PodUsesNodeNetworkNamespace,
14048                "NO_MASQUERADING_FOR_RETURN_PACKET" => Self::NoMasqueradingForReturnPacket,
14049                _ => Self::UnknownValue(reason::UnknownValue(
14050                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14051                )),
14052            }
14053        }
14054    }
14055
14056    impl serde::ser::Serialize for Reason {
14057        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14058        where
14059            S: serde::Serializer,
14060        {
14061            match self {
14062                Self::Unspecified => serializer.serialize_i32(0),
14063                Self::DestinationIpInConfiguredNonMasqueradeRange => serializer.serialize_i32(1),
14064                Self::DestinationIpInDefaultNonMasqueradeRange => serializer.serialize_i32(2),
14065                Self::DestinationOnSameNode => serializer.serialize_i32(3),
14066                Self::DefaultSnatDisabled => serializer.serialize_i32(4),
14067                Self::NoMasqueradingForIpv6 => serializer.serialize_i32(5),
14068                Self::PodUsesNodeNetworkNamespace => serializer.serialize_i32(6),
14069                Self::NoMasqueradingForReturnPacket => serializer.serialize_i32(7),
14070                Self::UnknownValue(u) => u.0.serialize(serializer),
14071            }
14072        }
14073    }
14074
14075    impl<'de> serde::de::Deserialize<'de> for Reason {
14076        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14077        where
14078            D: serde::Deserializer<'de>,
14079        {
14080            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Reason>::new(
14081                ".google.cloud.networkmanagement.v1.IpMasqueradingSkippedInfo.Reason",
14082            ))
14083        }
14084    }
14085}
14086
14087/// For display only. Metadata associated with a GKE Network Policy.
14088#[derive(Clone, Default, PartialEq)]
14089#[non_exhaustive]
14090pub struct GkeNetworkPolicyInfo {
14091    /// The name of the Network Policy.
14092    pub display_name: std::string::String,
14093
14094    /// The URI of the Network Policy.
14095    /// Format for a Network Policy in a zonal cluster:
14096    /// `projects/<project_id>/zones/<zone>/clusters/<cluster>/k8s/namespaces/<namespace>/networking.k8s.io/networkpolicies/<networkpolicy>`
14097    /// Format for a Network Policy in a regional cluster:
14098    /// `projects/<project_id>/locations/<location>/clusters/<cluster>/k8s/namespaces/<namespace>/networking.k8s.io/networkpolicies/<networkpolicy>`
14099    pub uri: std::string::String,
14100
14101    /// Possible values: INGRESS, EGRESS
14102    pub direction: std::string::String,
14103
14104    /// Possible values: ALLOW, DENY
14105    pub action: std::string::String,
14106
14107    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14108}
14109
14110impl GkeNetworkPolicyInfo {
14111    pub fn new() -> Self {
14112        std::default::Default::default()
14113    }
14114
14115    /// Sets the value of [display_name][crate::model::GkeNetworkPolicyInfo::display_name].
14116    ///
14117    /// # Example
14118    /// ```ignore,no_run
14119    /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
14120    /// let x = GkeNetworkPolicyInfo::new().set_display_name("example");
14121    /// ```
14122    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14123        self.display_name = v.into();
14124        self
14125    }
14126
14127    /// Sets the value of [uri][crate::model::GkeNetworkPolicyInfo::uri].
14128    ///
14129    /// # Example
14130    /// ```ignore,no_run
14131    /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
14132    /// let x = GkeNetworkPolicyInfo::new().set_uri("example");
14133    /// ```
14134    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14135        self.uri = v.into();
14136        self
14137    }
14138
14139    /// Sets the value of [direction][crate::model::GkeNetworkPolicyInfo::direction].
14140    ///
14141    /// # Example
14142    /// ```ignore,no_run
14143    /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
14144    /// let x = GkeNetworkPolicyInfo::new().set_direction("example");
14145    /// ```
14146    pub fn set_direction<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14147        self.direction = v.into();
14148        self
14149    }
14150
14151    /// Sets the value of [action][crate::model::GkeNetworkPolicyInfo::action].
14152    ///
14153    /// # Example
14154    /// ```ignore,no_run
14155    /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
14156    /// let x = GkeNetworkPolicyInfo::new().set_action("example");
14157    /// ```
14158    pub fn set_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14159        self.action = v.into();
14160        self
14161    }
14162}
14163
14164impl wkt::message::Message for GkeNetworkPolicyInfo {
14165    fn typename() -> &'static str {
14166        "type.googleapis.com/google.cloud.networkmanagement.v1.GkeNetworkPolicyInfo"
14167    }
14168}
14169
14170/// For display only. Contains information about why GKE Network Policy
14171/// evaluation was skipped.
14172#[derive(Clone, Default, PartialEq)]
14173#[non_exhaustive]
14174pub struct GkeNetworkPolicySkippedInfo {
14175    /// Reason why Network Policy evaluation was skipped.
14176    pub reason: crate::model::gke_network_policy_skipped_info::Reason,
14177
14178    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14179}
14180
14181impl GkeNetworkPolicySkippedInfo {
14182    pub fn new() -> Self {
14183        std::default::Default::default()
14184    }
14185
14186    /// Sets the value of [reason][crate::model::GkeNetworkPolicySkippedInfo::reason].
14187    ///
14188    /// # Example
14189    /// ```ignore,no_run
14190    /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicySkippedInfo;
14191    /// use google_cloud_networkmanagement_v1::model::gke_network_policy_skipped_info::Reason;
14192    /// let x0 = GkeNetworkPolicySkippedInfo::new().set_reason(Reason::NetworkPolicyDisabled);
14193    /// let x1 = GkeNetworkPolicySkippedInfo::new().set_reason(Reason::IngressSourceOnSameNode);
14194    /// let x2 = GkeNetworkPolicySkippedInfo::new().set_reason(Reason::EgressFromNodeNetworkNamespacePod);
14195    /// ```
14196    pub fn set_reason<
14197        T: std::convert::Into<crate::model::gke_network_policy_skipped_info::Reason>,
14198    >(
14199        mut self,
14200        v: T,
14201    ) -> Self {
14202        self.reason = v.into();
14203        self
14204    }
14205}
14206
14207impl wkt::message::Message for GkeNetworkPolicySkippedInfo {
14208    fn typename() -> &'static str {
14209        "type.googleapis.com/google.cloud.networkmanagement.v1.GkeNetworkPolicySkippedInfo"
14210    }
14211}
14212
14213/// Defines additional types related to [GkeNetworkPolicySkippedInfo].
14214pub mod gke_network_policy_skipped_info {
14215    #[allow(unused_imports)]
14216    use super::*;
14217
14218    ///
14219    /// # Working with unknown values
14220    ///
14221    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14222    /// additional enum variants at any time. Adding new variants is not considered
14223    /// a breaking change. Applications should write their code in anticipation of:
14224    ///
14225    /// - New values appearing in future releases of the client library, **and**
14226    /// - New values received dynamically, without application changes.
14227    ///
14228    /// Please consult the [Working with enums] section in the user guide for some
14229    /// guidelines.
14230    ///
14231    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14232    #[derive(Clone, Debug, PartialEq)]
14233    #[non_exhaustive]
14234    pub enum Reason {
14235        /// Unused default value.
14236        Unspecified,
14237        /// Network Policy is disabled on the cluster.
14238        NetworkPolicyDisabled,
14239        /// Ingress traffic to a Pod from a source on the same Node is always
14240        /// allowed.
14241        IngressSourceOnSameNode,
14242        /// Egress traffic from a Pod that uses the Node's network namespace is not
14243        /// subject to Network Policy.
14244        EgressFromNodeNetworkNamespacePod,
14245        /// Network Policy is not applied to response traffic. This is because GKE
14246        /// Network Policy evaluation is stateful in both GKE Dataplane V2 (eBPF) and
14247        /// legacy (iptables) implementations.
14248        NetworkPolicyNotAppliedToResponseTraffic,
14249        /// Network Policy evaluation is currently not supported for clusters with
14250        /// FQDN Network Policies enabled.
14251        NetworkPolicyAnalysisUnsupported,
14252        /// If set, the enum was initialized with an unknown value.
14253        ///
14254        /// Applications can examine the value using [Reason::value] or
14255        /// [Reason::name].
14256        UnknownValue(reason::UnknownValue),
14257    }
14258
14259    #[doc(hidden)]
14260    pub mod reason {
14261        #[allow(unused_imports)]
14262        use super::*;
14263        #[derive(Clone, Debug, PartialEq)]
14264        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14265    }
14266
14267    impl Reason {
14268        /// Gets the enum value.
14269        ///
14270        /// Returns `None` if the enum contains an unknown value deserialized from
14271        /// the string representation of enums.
14272        pub fn value(&self) -> std::option::Option<i32> {
14273            match self {
14274                Self::Unspecified => std::option::Option::Some(0),
14275                Self::NetworkPolicyDisabled => std::option::Option::Some(1),
14276                Self::IngressSourceOnSameNode => std::option::Option::Some(2),
14277                Self::EgressFromNodeNetworkNamespacePod => std::option::Option::Some(3),
14278                Self::NetworkPolicyNotAppliedToResponseTraffic => std::option::Option::Some(4),
14279                Self::NetworkPolicyAnalysisUnsupported => std::option::Option::Some(100),
14280                Self::UnknownValue(u) => u.0.value(),
14281            }
14282        }
14283
14284        /// Gets the enum value as a string.
14285        ///
14286        /// Returns `None` if the enum contains an unknown value deserialized from
14287        /// the integer representation of enums.
14288        pub fn name(&self) -> std::option::Option<&str> {
14289            match self {
14290                Self::Unspecified => std::option::Option::Some("REASON_UNSPECIFIED"),
14291                Self::NetworkPolicyDisabled => std::option::Option::Some("NETWORK_POLICY_DISABLED"),
14292                Self::IngressSourceOnSameNode => {
14293                    std::option::Option::Some("INGRESS_SOURCE_ON_SAME_NODE")
14294                }
14295                Self::EgressFromNodeNetworkNamespacePod => {
14296                    std::option::Option::Some("EGRESS_FROM_NODE_NETWORK_NAMESPACE_POD")
14297                }
14298                Self::NetworkPolicyNotAppliedToResponseTraffic => {
14299                    std::option::Option::Some("NETWORK_POLICY_NOT_APPLIED_TO_RESPONSE_TRAFFIC")
14300                }
14301                Self::NetworkPolicyAnalysisUnsupported => {
14302                    std::option::Option::Some("NETWORK_POLICY_ANALYSIS_UNSUPPORTED")
14303                }
14304                Self::UnknownValue(u) => u.0.name(),
14305            }
14306        }
14307    }
14308
14309    impl std::default::Default for Reason {
14310        fn default() -> Self {
14311            use std::convert::From;
14312            Self::from(0)
14313        }
14314    }
14315
14316    impl std::fmt::Display for Reason {
14317        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14318            wkt::internal::display_enum(f, self.name(), self.value())
14319        }
14320    }
14321
14322    impl std::convert::From<i32> for Reason {
14323        fn from(value: i32) -> Self {
14324            match value {
14325                0 => Self::Unspecified,
14326                1 => Self::NetworkPolicyDisabled,
14327                2 => Self::IngressSourceOnSameNode,
14328                3 => Self::EgressFromNodeNetworkNamespacePod,
14329                4 => Self::NetworkPolicyNotAppliedToResponseTraffic,
14330                100 => Self::NetworkPolicyAnalysisUnsupported,
14331                _ => Self::UnknownValue(reason::UnknownValue(
14332                    wkt::internal::UnknownEnumValue::Integer(value),
14333                )),
14334            }
14335        }
14336    }
14337
14338    impl std::convert::From<&str> for Reason {
14339        fn from(value: &str) -> Self {
14340            use std::string::ToString;
14341            match value {
14342                "REASON_UNSPECIFIED" => Self::Unspecified,
14343                "NETWORK_POLICY_DISABLED" => Self::NetworkPolicyDisabled,
14344                "INGRESS_SOURCE_ON_SAME_NODE" => Self::IngressSourceOnSameNode,
14345                "EGRESS_FROM_NODE_NETWORK_NAMESPACE_POD" => Self::EgressFromNodeNetworkNamespacePod,
14346                "NETWORK_POLICY_NOT_APPLIED_TO_RESPONSE_TRAFFIC" => {
14347                    Self::NetworkPolicyNotAppliedToResponseTraffic
14348                }
14349                "NETWORK_POLICY_ANALYSIS_UNSUPPORTED" => Self::NetworkPolicyAnalysisUnsupported,
14350                _ => Self::UnknownValue(reason::UnknownValue(
14351                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14352                )),
14353            }
14354        }
14355    }
14356
14357    impl serde::ser::Serialize for Reason {
14358        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14359        where
14360            S: serde::Serializer,
14361        {
14362            match self {
14363                Self::Unspecified => serializer.serialize_i32(0),
14364                Self::NetworkPolicyDisabled => serializer.serialize_i32(1),
14365                Self::IngressSourceOnSameNode => serializer.serialize_i32(2),
14366                Self::EgressFromNodeNetworkNamespacePod => serializer.serialize_i32(3),
14367                Self::NetworkPolicyNotAppliedToResponseTraffic => serializer.serialize_i32(4),
14368                Self::NetworkPolicyAnalysisUnsupported => serializer.serialize_i32(100),
14369                Self::UnknownValue(u) => u.0.serialize(serializer),
14370            }
14371        }
14372    }
14373
14374    impl<'de> serde::de::Deserialize<'de> for Reason {
14375        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14376        where
14377            D: serde::Deserializer<'de>,
14378        {
14379            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Reason>::new(
14380                ".google.cloud.networkmanagement.v1.GkeNetworkPolicySkippedInfo.Reason",
14381            ))
14382        }
14383    }
14384}
14385
14386/// For display only. Metadata associated with a Cloud SQL instance.
14387#[derive(Clone, Default, PartialEq)]
14388#[non_exhaustive]
14389pub struct CloudSQLInstanceInfo {
14390    /// Name of a Cloud SQL instance.
14391    pub display_name: std::string::String,
14392
14393    /// URI of a Cloud SQL instance.
14394    pub uri: std::string::String,
14395
14396    /// URI of a Cloud SQL instance network or empty string if the instance does
14397    /// not have one.
14398    pub network_uri: std::string::String,
14399
14400    /// Internal IP address of a Cloud SQL instance.
14401    pub internal_ip: std::string::String,
14402
14403    /// External IP address of a Cloud SQL instance.
14404    pub external_ip: std::string::String,
14405
14406    /// Region in which the Cloud SQL instance is running.
14407    pub region: std::string::String,
14408
14409    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14410}
14411
14412impl CloudSQLInstanceInfo {
14413    pub fn new() -> Self {
14414        std::default::Default::default()
14415    }
14416
14417    /// Sets the value of [display_name][crate::model::CloudSQLInstanceInfo::display_name].
14418    ///
14419    /// # Example
14420    /// ```ignore,no_run
14421    /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14422    /// let x = CloudSQLInstanceInfo::new().set_display_name("example");
14423    /// ```
14424    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14425        self.display_name = v.into();
14426        self
14427    }
14428
14429    /// Sets the value of [uri][crate::model::CloudSQLInstanceInfo::uri].
14430    ///
14431    /// # Example
14432    /// ```ignore,no_run
14433    /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14434    /// let x = CloudSQLInstanceInfo::new().set_uri("example");
14435    /// ```
14436    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14437        self.uri = v.into();
14438        self
14439    }
14440
14441    /// Sets the value of [network_uri][crate::model::CloudSQLInstanceInfo::network_uri].
14442    ///
14443    /// # Example
14444    /// ```ignore,no_run
14445    /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14446    /// let x = CloudSQLInstanceInfo::new().set_network_uri("example");
14447    /// ```
14448    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14449        self.network_uri = v.into();
14450        self
14451    }
14452
14453    /// Sets the value of [internal_ip][crate::model::CloudSQLInstanceInfo::internal_ip].
14454    ///
14455    /// # Example
14456    /// ```ignore,no_run
14457    /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14458    /// let x = CloudSQLInstanceInfo::new().set_internal_ip("example");
14459    /// ```
14460    pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14461        self.internal_ip = v.into();
14462        self
14463    }
14464
14465    /// Sets the value of [external_ip][crate::model::CloudSQLInstanceInfo::external_ip].
14466    ///
14467    /// # Example
14468    /// ```ignore,no_run
14469    /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14470    /// let x = CloudSQLInstanceInfo::new().set_external_ip("example");
14471    /// ```
14472    pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14473        self.external_ip = v.into();
14474        self
14475    }
14476
14477    /// Sets the value of [region][crate::model::CloudSQLInstanceInfo::region].
14478    ///
14479    /// # Example
14480    /// ```ignore,no_run
14481    /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14482    /// let x = CloudSQLInstanceInfo::new().set_region("example");
14483    /// ```
14484    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14485        self.region = v.into();
14486        self
14487    }
14488}
14489
14490impl wkt::message::Message for CloudSQLInstanceInfo {
14491    fn typename() -> &'static str {
14492        "type.googleapis.com/google.cloud.networkmanagement.v1.CloudSQLInstanceInfo"
14493    }
14494}
14495
14496/// For display only. Metadata associated with a Cloud Redis Instance.
14497#[derive(Clone, Default, PartialEq)]
14498#[non_exhaustive]
14499pub struct RedisInstanceInfo {
14500    /// Name of a Cloud Redis Instance.
14501    pub display_name: std::string::String,
14502
14503    /// URI of a Cloud Redis Instance.
14504    pub uri: std::string::String,
14505
14506    /// URI of a Cloud Redis Instance network.
14507    pub network_uri: std::string::String,
14508
14509    /// Primary endpoint IP address of a Cloud Redis Instance.
14510    pub primary_endpoint_ip: std::string::String,
14511
14512    /// Read endpoint IP address of a Cloud Redis Instance (if applicable).
14513    pub read_endpoint_ip: std::string::String,
14514
14515    /// Region in which the Cloud Redis Instance is defined.
14516    pub region: std::string::String,
14517
14518    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14519}
14520
14521impl RedisInstanceInfo {
14522    pub fn new() -> Self {
14523        std::default::Default::default()
14524    }
14525
14526    /// Sets the value of [display_name][crate::model::RedisInstanceInfo::display_name].
14527    ///
14528    /// # Example
14529    /// ```ignore,no_run
14530    /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14531    /// let x = RedisInstanceInfo::new().set_display_name("example");
14532    /// ```
14533    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14534        self.display_name = v.into();
14535        self
14536    }
14537
14538    /// Sets the value of [uri][crate::model::RedisInstanceInfo::uri].
14539    ///
14540    /// # Example
14541    /// ```ignore,no_run
14542    /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14543    /// let x = RedisInstanceInfo::new().set_uri("example");
14544    /// ```
14545    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14546        self.uri = v.into();
14547        self
14548    }
14549
14550    /// Sets the value of [network_uri][crate::model::RedisInstanceInfo::network_uri].
14551    ///
14552    /// # Example
14553    /// ```ignore,no_run
14554    /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14555    /// let x = RedisInstanceInfo::new().set_network_uri("example");
14556    /// ```
14557    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14558        self.network_uri = v.into();
14559        self
14560    }
14561
14562    /// Sets the value of [primary_endpoint_ip][crate::model::RedisInstanceInfo::primary_endpoint_ip].
14563    ///
14564    /// # Example
14565    /// ```ignore,no_run
14566    /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14567    /// let x = RedisInstanceInfo::new().set_primary_endpoint_ip("example");
14568    /// ```
14569    pub fn set_primary_endpoint_ip<T: std::convert::Into<std::string::String>>(
14570        mut self,
14571        v: T,
14572    ) -> Self {
14573        self.primary_endpoint_ip = v.into();
14574        self
14575    }
14576
14577    /// Sets the value of [read_endpoint_ip][crate::model::RedisInstanceInfo::read_endpoint_ip].
14578    ///
14579    /// # Example
14580    /// ```ignore,no_run
14581    /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14582    /// let x = RedisInstanceInfo::new().set_read_endpoint_ip("example");
14583    /// ```
14584    pub fn set_read_endpoint_ip<T: std::convert::Into<std::string::String>>(
14585        mut self,
14586        v: T,
14587    ) -> Self {
14588        self.read_endpoint_ip = v.into();
14589        self
14590    }
14591
14592    /// Sets the value of [region][crate::model::RedisInstanceInfo::region].
14593    ///
14594    /// # Example
14595    /// ```ignore,no_run
14596    /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14597    /// let x = RedisInstanceInfo::new().set_region("example");
14598    /// ```
14599    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14600        self.region = v.into();
14601        self
14602    }
14603}
14604
14605impl wkt::message::Message for RedisInstanceInfo {
14606    fn typename() -> &'static str {
14607        "type.googleapis.com/google.cloud.networkmanagement.v1.RedisInstanceInfo"
14608    }
14609}
14610
14611/// For display only. Metadata associated with a Redis Cluster.
14612#[derive(Clone, Default, PartialEq)]
14613#[non_exhaustive]
14614pub struct RedisClusterInfo {
14615    /// Name of a Redis Cluster.
14616    pub display_name: std::string::String,
14617
14618    /// URI of a Redis Cluster in format
14619    /// "projects/{project_id}/locations/{location}/clusters/{cluster_id}"
14620    pub uri: std::string::String,
14621
14622    /// URI of the network containing the Redis Cluster endpoints in format
14623    /// "projects/{project_id}/global/networks/{network_id}".
14624    pub network_uri: std::string::String,
14625
14626    /// Discovery endpoint IP address of a Redis Cluster.
14627    pub discovery_endpoint_ip_address: std::string::String,
14628
14629    /// Secondary endpoint IP address of a Redis Cluster.
14630    pub secondary_endpoint_ip_address: std::string::String,
14631
14632    /// Name of the region in which the Redis Cluster is defined. For example,
14633    /// "us-central1".
14634    pub location: std::string::String,
14635
14636    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14637}
14638
14639impl RedisClusterInfo {
14640    pub fn new() -> Self {
14641        std::default::Default::default()
14642    }
14643
14644    /// Sets the value of [display_name][crate::model::RedisClusterInfo::display_name].
14645    ///
14646    /// # Example
14647    /// ```ignore,no_run
14648    /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14649    /// let x = RedisClusterInfo::new().set_display_name("example");
14650    /// ```
14651    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14652        self.display_name = v.into();
14653        self
14654    }
14655
14656    /// Sets the value of [uri][crate::model::RedisClusterInfo::uri].
14657    ///
14658    /// # Example
14659    /// ```ignore,no_run
14660    /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14661    /// let x = RedisClusterInfo::new().set_uri("example");
14662    /// ```
14663    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14664        self.uri = v.into();
14665        self
14666    }
14667
14668    /// Sets the value of [network_uri][crate::model::RedisClusterInfo::network_uri].
14669    ///
14670    /// # Example
14671    /// ```ignore,no_run
14672    /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14673    /// let x = RedisClusterInfo::new().set_network_uri("example");
14674    /// ```
14675    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14676        self.network_uri = v.into();
14677        self
14678    }
14679
14680    /// Sets the value of [discovery_endpoint_ip_address][crate::model::RedisClusterInfo::discovery_endpoint_ip_address].
14681    ///
14682    /// # Example
14683    /// ```ignore,no_run
14684    /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14685    /// let x = RedisClusterInfo::new().set_discovery_endpoint_ip_address("example");
14686    /// ```
14687    pub fn set_discovery_endpoint_ip_address<T: std::convert::Into<std::string::String>>(
14688        mut self,
14689        v: T,
14690    ) -> Self {
14691        self.discovery_endpoint_ip_address = v.into();
14692        self
14693    }
14694
14695    /// Sets the value of [secondary_endpoint_ip_address][crate::model::RedisClusterInfo::secondary_endpoint_ip_address].
14696    ///
14697    /// # Example
14698    /// ```ignore,no_run
14699    /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14700    /// let x = RedisClusterInfo::new().set_secondary_endpoint_ip_address("example");
14701    /// ```
14702    pub fn set_secondary_endpoint_ip_address<T: std::convert::Into<std::string::String>>(
14703        mut self,
14704        v: T,
14705    ) -> Self {
14706        self.secondary_endpoint_ip_address = v.into();
14707        self
14708    }
14709
14710    /// Sets the value of [location][crate::model::RedisClusterInfo::location].
14711    ///
14712    /// # Example
14713    /// ```ignore,no_run
14714    /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14715    /// let x = RedisClusterInfo::new().set_location("example");
14716    /// ```
14717    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14718        self.location = v.into();
14719        self
14720    }
14721}
14722
14723impl wkt::message::Message for RedisClusterInfo {
14724    fn typename() -> &'static str {
14725        "type.googleapis.com/google.cloud.networkmanagement.v1.RedisClusterInfo"
14726    }
14727}
14728
14729/// For display only. Metadata associated with a Cloud Function.
14730#[derive(Clone, Default, PartialEq)]
14731#[non_exhaustive]
14732pub struct CloudFunctionInfo {
14733    /// Name of a Cloud Function.
14734    pub display_name: std::string::String,
14735
14736    /// URI of a Cloud Function.
14737    pub uri: std::string::String,
14738
14739    /// Location in which the Cloud Function is deployed.
14740    pub location: std::string::String,
14741
14742    /// Latest successfully deployed version id of the Cloud Function.
14743    pub version_id: i64,
14744
14745    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14746}
14747
14748impl CloudFunctionInfo {
14749    pub fn new() -> Self {
14750        std::default::Default::default()
14751    }
14752
14753    /// Sets the value of [display_name][crate::model::CloudFunctionInfo::display_name].
14754    ///
14755    /// # Example
14756    /// ```ignore,no_run
14757    /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
14758    /// let x = CloudFunctionInfo::new().set_display_name("example");
14759    /// ```
14760    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14761        self.display_name = v.into();
14762        self
14763    }
14764
14765    /// Sets the value of [uri][crate::model::CloudFunctionInfo::uri].
14766    ///
14767    /// # Example
14768    /// ```ignore,no_run
14769    /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
14770    /// let x = CloudFunctionInfo::new().set_uri("example");
14771    /// ```
14772    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14773        self.uri = v.into();
14774        self
14775    }
14776
14777    /// Sets the value of [location][crate::model::CloudFunctionInfo::location].
14778    ///
14779    /// # Example
14780    /// ```ignore,no_run
14781    /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
14782    /// let x = CloudFunctionInfo::new().set_location("example");
14783    /// ```
14784    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14785        self.location = v.into();
14786        self
14787    }
14788
14789    /// Sets the value of [version_id][crate::model::CloudFunctionInfo::version_id].
14790    ///
14791    /// # Example
14792    /// ```ignore,no_run
14793    /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
14794    /// let x = CloudFunctionInfo::new().set_version_id(42);
14795    /// ```
14796    pub fn set_version_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14797        self.version_id = v.into();
14798        self
14799    }
14800}
14801
14802impl wkt::message::Message for CloudFunctionInfo {
14803    fn typename() -> &'static str {
14804        "type.googleapis.com/google.cloud.networkmanagement.v1.CloudFunctionInfo"
14805    }
14806}
14807
14808/// For display only. Metadata associated with a Cloud Run revision.
14809#[derive(Clone, Default, PartialEq)]
14810#[non_exhaustive]
14811pub struct CloudRunRevisionInfo {
14812    /// Name of a Cloud Run revision.
14813    pub display_name: std::string::String,
14814
14815    /// URI of a Cloud Run revision.
14816    pub uri: std::string::String,
14817
14818    /// Location in which this revision is deployed.
14819    pub location: std::string::String,
14820
14821    /// URI of Cloud Run service this revision belongs to.
14822    pub service_uri: std::string::String,
14823
14824    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14825}
14826
14827impl CloudRunRevisionInfo {
14828    pub fn new() -> Self {
14829        std::default::Default::default()
14830    }
14831
14832    /// Sets the value of [display_name][crate::model::CloudRunRevisionInfo::display_name].
14833    ///
14834    /// # Example
14835    /// ```ignore,no_run
14836    /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
14837    /// let x = CloudRunRevisionInfo::new().set_display_name("example");
14838    /// ```
14839    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14840        self.display_name = v.into();
14841        self
14842    }
14843
14844    /// Sets the value of [uri][crate::model::CloudRunRevisionInfo::uri].
14845    ///
14846    /// # Example
14847    /// ```ignore,no_run
14848    /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
14849    /// let x = CloudRunRevisionInfo::new().set_uri("example");
14850    /// ```
14851    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14852        self.uri = v.into();
14853        self
14854    }
14855
14856    /// Sets the value of [location][crate::model::CloudRunRevisionInfo::location].
14857    ///
14858    /// # Example
14859    /// ```ignore,no_run
14860    /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
14861    /// let x = CloudRunRevisionInfo::new().set_location("example");
14862    /// ```
14863    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14864        self.location = v.into();
14865        self
14866    }
14867
14868    /// Sets the value of [service_uri][crate::model::CloudRunRevisionInfo::service_uri].
14869    ///
14870    /// # Example
14871    /// ```ignore,no_run
14872    /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
14873    /// let x = CloudRunRevisionInfo::new().set_service_uri("example");
14874    /// ```
14875    pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14876        self.service_uri = v.into();
14877        self
14878    }
14879}
14880
14881impl wkt::message::Message for CloudRunRevisionInfo {
14882    fn typename() -> &'static str {
14883        "type.googleapis.com/google.cloud.networkmanagement.v1.CloudRunRevisionInfo"
14884    }
14885}
14886
14887/// For display only. Metadata associated with an App Engine version.
14888#[derive(Clone, Default, PartialEq)]
14889#[non_exhaustive]
14890pub struct AppEngineVersionInfo {
14891    /// Name of an App Engine version.
14892    pub display_name: std::string::String,
14893
14894    /// URI of an App Engine version.
14895    pub uri: std::string::String,
14896
14897    /// Runtime of the App Engine version.
14898    pub runtime: std::string::String,
14899
14900    /// App Engine execution environment for a version.
14901    pub environment: std::string::String,
14902
14903    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14904}
14905
14906impl AppEngineVersionInfo {
14907    pub fn new() -> Self {
14908        std::default::Default::default()
14909    }
14910
14911    /// Sets the value of [display_name][crate::model::AppEngineVersionInfo::display_name].
14912    ///
14913    /// # Example
14914    /// ```ignore,no_run
14915    /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
14916    /// let x = AppEngineVersionInfo::new().set_display_name("example");
14917    /// ```
14918    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14919        self.display_name = v.into();
14920        self
14921    }
14922
14923    /// Sets the value of [uri][crate::model::AppEngineVersionInfo::uri].
14924    ///
14925    /// # Example
14926    /// ```ignore,no_run
14927    /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
14928    /// let x = AppEngineVersionInfo::new().set_uri("example");
14929    /// ```
14930    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14931        self.uri = v.into();
14932        self
14933    }
14934
14935    /// Sets the value of [runtime][crate::model::AppEngineVersionInfo::runtime].
14936    ///
14937    /// # Example
14938    /// ```ignore,no_run
14939    /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
14940    /// let x = AppEngineVersionInfo::new().set_runtime("example");
14941    /// ```
14942    pub fn set_runtime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14943        self.runtime = v.into();
14944        self
14945    }
14946
14947    /// Sets the value of [environment][crate::model::AppEngineVersionInfo::environment].
14948    ///
14949    /// # Example
14950    /// ```ignore,no_run
14951    /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
14952    /// let x = AppEngineVersionInfo::new().set_environment("example");
14953    /// ```
14954    pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14955        self.environment = v.into();
14956        self
14957    }
14958}
14959
14960impl wkt::message::Message for AppEngineVersionInfo {
14961    fn typename() -> &'static str {
14962        "type.googleapis.com/google.cloud.networkmanagement.v1.AppEngineVersionInfo"
14963    }
14964}
14965
14966/// For display only. Metadata associated with a VPC connector.
14967#[derive(Clone, Default, PartialEq)]
14968#[non_exhaustive]
14969pub struct VpcConnectorInfo {
14970    /// Name of a VPC connector.
14971    pub display_name: std::string::String,
14972
14973    /// URI of a VPC connector.
14974    pub uri: std::string::String,
14975
14976    /// Location in which the VPC connector is deployed.
14977    pub location: std::string::String,
14978
14979    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14980}
14981
14982impl VpcConnectorInfo {
14983    pub fn new() -> Self {
14984        std::default::Default::default()
14985    }
14986
14987    /// Sets the value of [display_name][crate::model::VpcConnectorInfo::display_name].
14988    ///
14989    /// # Example
14990    /// ```ignore,no_run
14991    /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
14992    /// let x = VpcConnectorInfo::new().set_display_name("example");
14993    /// ```
14994    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14995        self.display_name = v.into();
14996        self
14997    }
14998
14999    /// Sets the value of [uri][crate::model::VpcConnectorInfo::uri].
15000    ///
15001    /// # Example
15002    /// ```ignore,no_run
15003    /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
15004    /// let x = VpcConnectorInfo::new().set_uri("example");
15005    /// ```
15006    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15007        self.uri = v.into();
15008        self
15009    }
15010
15011    /// Sets the value of [location][crate::model::VpcConnectorInfo::location].
15012    ///
15013    /// # Example
15014    /// ```ignore,no_run
15015    /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
15016    /// let x = VpcConnectorInfo::new().set_location("example");
15017    /// ```
15018    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15019        self.location = v.into();
15020        self
15021    }
15022}
15023
15024impl wkt::message::Message for VpcConnectorInfo {
15025    fn typename() -> &'static str {
15026        "type.googleapis.com/google.cloud.networkmanagement.v1.VpcConnectorInfo"
15027    }
15028}
15029
15030/// For display only. Metadata associated with a serverless direct VPC egress
15031/// connection.
15032#[derive(Clone, Default, PartialEq)]
15033#[non_exhaustive]
15034pub struct DirectVpcEgressConnectionInfo {
15035    /// URI of direct access network.
15036    pub network_uri: std::string::String,
15037
15038    /// URI of direct access subnetwork.
15039    pub subnetwork_uri: std::string::String,
15040
15041    /// Selected IP range.
15042    pub selected_ip_range: std::string::String,
15043
15044    /// Selected starting IP address, from the selected IP range.
15045    pub selected_ip_address: std::string::String,
15046
15047    /// Region in which the Direct VPC egress is deployed.
15048    pub region: std::string::String,
15049
15050    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15051}
15052
15053impl DirectVpcEgressConnectionInfo {
15054    pub fn new() -> Self {
15055        std::default::Default::default()
15056    }
15057
15058    /// Sets the value of [network_uri][crate::model::DirectVpcEgressConnectionInfo::network_uri].
15059    ///
15060    /// # Example
15061    /// ```ignore,no_run
15062    /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15063    /// let x = DirectVpcEgressConnectionInfo::new().set_network_uri("example");
15064    /// ```
15065    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15066        self.network_uri = v.into();
15067        self
15068    }
15069
15070    /// Sets the value of [subnetwork_uri][crate::model::DirectVpcEgressConnectionInfo::subnetwork_uri].
15071    ///
15072    /// # Example
15073    /// ```ignore,no_run
15074    /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15075    /// let x = DirectVpcEgressConnectionInfo::new().set_subnetwork_uri("example");
15076    /// ```
15077    pub fn set_subnetwork_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15078        self.subnetwork_uri = v.into();
15079        self
15080    }
15081
15082    /// Sets the value of [selected_ip_range][crate::model::DirectVpcEgressConnectionInfo::selected_ip_range].
15083    ///
15084    /// # Example
15085    /// ```ignore,no_run
15086    /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15087    /// let x = DirectVpcEgressConnectionInfo::new().set_selected_ip_range("example");
15088    /// ```
15089    pub fn set_selected_ip_range<T: std::convert::Into<std::string::String>>(
15090        mut self,
15091        v: T,
15092    ) -> Self {
15093        self.selected_ip_range = v.into();
15094        self
15095    }
15096
15097    /// Sets the value of [selected_ip_address][crate::model::DirectVpcEgressConnectionInfo::selected_ip_address].
15098    ///
15099    /// # Example
15100    /// ```ignore,no_run
15101    /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15102    /// let x = DirectVpcEgressConnectionInfo::new().set_selected_ip_address("example");
15103    /// ```
15104    pub fn set_selected_ip_address<T: std::convert::Into<std::string::String>>(
15105        mut self,
15106        v: T,
15107    ) -> Self {
15108        self.selected_ip_address = v.into();
15109        self
15110    }
15111
15112    /// Sets the value of [region][crate::model::DirectVpcEgressConnectionInfo::region].
15113    ///
15114    /// # Example
15115    /// ```ignore,no_run
15116    /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15117    /// let x = DirectVpcEgressConnectionInfo::new().set_region("example");
15118    /// ```
15119    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15120        self.region = v.into();
15121        self
15122    }
15123}
15124
15125impl wkt::message::Message for DirectVpcEgressConnectionInfo {
15126    fn typename() -> &'static str {
15127        "type.googleapis.com/google.cloud.networkmanagement.v1.DirectVpcEgressConnectionInfo"
15128    }
15129}
15130
15131/// For display only. Metadata associated with a serverless public connection.
15132#[derive(Clone, Default, PartialEq)]
15133#[non_exhaustive]
15134pub struct ServerlessExternalConnectionInfo {
15135    /// Selected starting IP address, from the Google dynamic address pool.
15136    pub selected_ip_address: std::string::String,
15137
15138    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15139}
15140
15141impl ServerlessExternalConnectionInfo {
15142    pub fn new() -> Self {
15143        std::default::Default::default()
15144    }
15145
15146    /// Sets the value of [selected_ip_address][crate::model::ServerlessExternalConnectionInfo::selected_ip_address].
15147    ///
15148    /// # Example
15149    /// ```ignore,no_run
15150    /// # use google_cloud_networkmanagement_v1::model::ServerlessExternalConnectionInfo;
15151    /// let x = ServerlessExternalConnectionInfo::new().set_selected_ip_address("example");
15152    /// ```
15153    pub fn set_selected_ip_address<T: std::convert::Into<std::string::String>>(
15154        mut self,
15155        v: T,
15156    ) -> Self {
15157        self.selected_ip_address = v.into();
15158        self
15159    }
15160}
15161
15162impl wkt::message::Message for ServerlessExternalConnectionInfo {
15163    fn typename() -> &'static str {
15164        "type.googleapis.com/google.cloud.networkmanagement.v1.ServerlessExternalConnectionInfo"
15165    }
15166}
15167
15168/// For display only. Metadata associated with NAT.
15169#[derive(Clone, Default, PartialEq)]
15170#[non_exhaustive]
15171pub struct NatInfo {
15172    /// Type of NAT.
15173    pub r#type: crate::model::nat_info::Type,
15174
15175    /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
15176    pub protocol: std::string::String,
15177
15178    /// URI of the network where NAT translation takes place.
15179    pub network_uri: std::string::String,
15180
15181    /// Source IP address before NAT translation.
15182    pub old_source_ip: std::string::String,
15183
15184    /// Source IP address after NAT translation.
15185    pub new_source_ip: std::string::String,
15186
15187    /// Destination IP address before NAT translation.
15188    pub old_destination_ip: std::string::String,
15189
15190    /// Destination IP address after NAT translation.
15191    pub new_destination_ip: std::string::String,
15192
15193    /// Source port before NAT translation. Only valid when protocol is TCP or UDP.
15194    pub old_source_port: i32,
15195
15196    /// Source port after NAT translation. Only valid when protocol is TCP or UDP.
15197    pub new_source_port: i32,
15198
15199    /// Destination port before NAT translation. Only valid when protocol is TCP or
15200    /// UDP.
15201    pub old_destination_port: i32,
15202
15203    /// Destination port after NAT translation. Only valid when protocol is TCP or
15204    /// UDP.
15205    pub new_destination_port: i32,
15206
15207    /// Uri of the Cloud Router. Only valid when type is CLOUD_NAT.
15208    pub router_uri: std::string::String,
15209
15210    /// The name of Cloud NAT Gateway. Only valid when type is CLOUD_NAT.
15211    pub nat_gateway_name: std::string::String,
15212
15213    /// Type of Cloud NAT gateway. Only valid when `type` is CLOUD_NAT.
15214    pub cloud_nat_gateway_type: crate::model::nat_info::CloudNatGatewayType,
15215
15216    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15217}
15218
15219impl NatInfo {
15220    pub fn new() -> Self {
15221        std::default::Default::default()
15222    }
15223
15224    /// Sets the value of [r#type][crate::model::NatInfo::type].
15225    ///
15226    /// # Example
15227    /// ```ignore,no_run
15228    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15229    /// use google_cloud_networkmanagement_v1::model::nat_info::Type;
15230    /// let x0 = NatInfo::new().set_type(Type::InternalToExternal);
15231    /// let x1 = NatInfo::new().set_type(Type::ExternalToInternal);
15232    /// let x2 = NatInfo::new().set_type(Type::CloudNat);
15233    /// ```
15234    pub fn set_type<T: std::convert::Into<crate::model::nat_info::Type>>(mut self, v: T) -> Self {
15235        self.r#type = v.into();
15236        self
15237    }
15238
15239    /// Sets the value of [protocol][crate::model::NatInfo::protocol].
15240    ///
15241    /// # Example
15242    /// ```ignore,no_run
15243    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15244    /// let x = NatInfo::new().set_protocol("example");
15245    /// ```
15246    pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15247        self.protocol = v.into();
15248        self
15249    }
15250
15251    /// Sets the value of [network_uri][crate::model::NatInfo::network_uri].
15252    ///
15253    /// # Example
15254    /// ```ignore,no_run
15255    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15256    /// let x = NatInfo::new().set_network_uri("example");
15257    /// ```
15258    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15259        self.network_uri = v.into();
15260        self
15261    }
15262
15263    /// Sets the value of [old_source_ip][crate::model::NatInfo::old_source_ip].
15264    ///
15265    /// # Example
15266    /// ```ignore,no_run
15267    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15268    /// let x = NatInfo::new().set_old_source_ip("example");
15269    /// ```
15270    pub fn set_old_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15271        self.old_source_ip = v.into();
15272        self
15273    }
15274
15275    /// Sets the value of [new_source_ip][crate::model::NatInfo::new_source_ip].
15276    ///
15277    /// # Example
15278    /// ```ignore,no_run
15279    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15280    /// let x = NatInfo::new().set_new_source_ip("example");
15281    /// ```
15282    pub fn set_new_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15283        self.new_source_ip = v.into();
15284        self
15285    }
15286
15287    /// Sets the value of [old_destination_ip][crate::model::NatInfo::old_destination_ip].
15288    ///
15289    /// # Example
15290    /// ```ignore,no_run
15291    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15292    /// let x = NatInfo::new().set_old_destination_ip("example");
15293    /// ```
15294    pub fn set_old_destination_ip<T: std::convert::Into<std::string::String>>(
15295        mut self,
15296        v: T,
15297    ) -> Self {
15298        self.old_destination_ip = v.into();
15299        self
15300    }
15301
15302    /// Sets the value of [new_destination_ip][crate::model::NatInfo::new_destination_ip].
15303    ///
15304    /// # Example
15305    /// ```ignore,no_run
15306    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15307    /// let x = NatInfo::new().set_new_destination_ip("example");
15308    /// ```
15309    pub fn set_new_destination_ip<T: std::convert::Into<std::string::String>>(
15310        mut self,
15311        v: T,
15312    ) -> Self {
15313        self.new_destination_ip = v.into();
15314        self
15315    }
15316
15317    /// Sets the value of [old_source_port][crate::model::NatInfo::old_source_port].
15318    ///
15319    /// # Example
15320    /// ```ignore,no_run
15321    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15322    /// let x = NatInfo::new().set_old_source_port(42);
15323    /// ```
15324    pub fn set_old_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15325        self.old_source_port = v.into();
15326        self
15327    }
15328
15329    /// Sets the value of [new_source_port][crate::model::NatInfo::new_source_port].
15330    ///
15331    /// # Example
15332    /// ```ignore,no_run
15333    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15334    /// let x = NatInfo::new().set_new_source_port(42);
15335    /// ```
15336    pub fn set_new_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15337        self.new_source_port = v.into();
15338        self
15339    }
15340
15341    /// Sets the value of [old_destination_port][crate::model::NatInfo::old_destination_port].
15342    ///
15343    /// # Example
15344    /// ```ignore,no_run
15345    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15346    /// let x = NatInfo::new().set_old_destination_port(42);
15347    /// ```
15348    pub fn set_old_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15349        self.old_destination_port = v.into();
15350        self
15351    }
15352
15353    /// Sets the value of [new_destination_port][crate::model::NatInfo::new_destination_port].
15354    ///
15355    /// # Example
15356    /// ```ignore,no_run
15357    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15358    /// let x = NatInfo::new().set_new_destination_port(42);
15359    /// ```
15360    pub fn set_new_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15361        self.new_destination_port = v.into();
15362        self
15363    }
15364
15365    /// Sets the value of [router_uri][crate::model::NatInfo::router_uri].
15366    ///
15367    /// # Example
15368    /// ```ignore,no_run
15369    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15370    /// let x = NatInfo::new().set_router_uri("example");
15371    /// ```
15372    pub fn set_router_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15373        self.router_uri = v.into();
15374        self
15375    }
15376
15377    /// Sets the value of [nat_gateway_name][crate::model::NatInfo::nat_gateway_name].
15378    ///
15379    /// # Example
15380    /// ```ignore,no_run
15381    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15382    /// let x = NatInfo::new().set_nat_gateway_name("example");
15383    /// ```
15384    pub fn set_nat_gateway_name<T: std::convert::Into<std::string::String>>(
15385        mut self,
15386        v: T,
15387    ) -> Self {
15388        self.nat_gateway_name = v.into();
15389        self
15390    }
15391
15392    /// Sets the value of [cloud_nat_gateway_type][crate::model::NatInfo::cloud_nat_gateway_type].
15393    ///
15394    /// # Example
15395    /// ```ignore,no_run
15396    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15397    /// use google_cloud_networkmanagement_v1::model::nat_info::CloudNatGatewayType;
15398    /// let x0 = NatInfo::new().set_cloud_nat_gateway_type(CloudNatGatewayType::PublicNat44);
15399    /// let x1 = NatInfo::new().set_cloud_nat_gateway_type(CloudNatGatewayType::PublicNat64);
15400    /// let x2 = NatInfo::new().set_cloud_nat_gateway_type(CloudNatGatewayType::PrivateNatNcc);
15401    /// ```
15402    pub fn set_cloud_nat_gateway_type<
15403        T: std::convert::Into<crate::model::nat_info::CloudNatGatewayType>,
15404    >(
15405        mut self,
15406        v: T,
15407    ) -> Self {
15408        self.cloud_nat_gateway_type = v.into();
15409        self
15410    }
15411}
15412
15413impl wkt::message::Message for NatInfo {
15414    fn typename() -> &'static str {
15415        "type.googleapis.com/google.cloud.networkmanagement.v1.NatInfo"
15416    }
15417}
15418
15419/// Defines additional types related to [NatInfo].
15420pub mod nat_info {
15421    #[allow(unused_imports)]
15422    use super::*;
15423
15424    /// Types of NAT.
15425    ///
15426    /// # Working with unknown values
15427    ///
15428    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15429    /// additional enum variants at any time. Adding new variants is not considered
15430    /// a breaking change. Applications should write their code in anticipation of:
15431    ///
15432    /// - New values appearing in future releases of the client library, **and**
15433    /// - New values received dynamically, without application changes.
15434    ///
15435    /// Please consult the [Working with enums] section in the user guide for some
15436    /// guidelines.
15437    ///
15438    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15439    #[derive(Clone, Debug, PartialEq)]
15440    #[non_exhaustive]
15441    pub enum Type {
15442        /// Type is unspecified.
15443        Unspecified,
15444        /// From Compute Engine instance's internal address to external address.
15445        InternalToExternal,
15446        /// From Compute Engine instance's external address to internal address.
15447        ExternalToInternal,
15448        /// Cloud NAT Gateway.
15449        CloudNat,
15450        /// Private service connect NAT.
15451        PrivateServiceConnect,
15452        /// GKE Pod IP address masquerading.
15453        GkePodIpMasquerading,
15454        /// If set, the enum was initialized with an unknown value.
15455        ///
15456        /// Applications can examine the value using [Type::value] or
15457        /// [Type::name].
15458        UnknownValue(r#type::UnknownValue),
15459    }
15460
15461    #[doc(hidden)]
15462    pub mod r#type {
15463        #[allow(unused_imports)]
15464        use super::*;
15465        #[derive(Clone, Debug, PartialEq)]
15466        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15467    }
15468
15469    impl Type {
15470        /// Gets the enum value.
15471        ///
15472        /// Returns `None` if the enum contains an unknown value deserialized from
15473        /// the string representation of enums.
15474        pub fn value(&self) -> std::option::Option<i32> {
15475            match self {
15476                Self::Unspecified => std::option::Option::Some(0),
15477                Self::InternalToExternal => std::option::Option::Some(1),
15478                Self::ExternalToInternal => std::option::Option::Some(2),
15479                Self::CloudNat => std::option::Option::Some(3),
15480                Self::PrivateServiceConnect => std::option::Option::Some(4),
15481                Self::GkePodIpMasquerading => std::option::Option::Some(5),
15482                Self::UnknownValue(u) => u.0.value(),
15483            }
15484        }
15485
15486        /// Gets the enum value as a string.
15487        ///
15488        /// Returns `None` if the enum contains an unknown value deserialized from
15489        /// the integer representation of enums.
15490        pub fn name(&self) -> std::option::Option<&str> {
15491            match self {
15492                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
15493                Self::InternalToExternal => std::option::Option::Some("INTERNAL_TO_EXTERNAL"),
15494                Self::ExternalToInternal => std::option::Option::Some("EXTERNAL_TO_INTERNAL"),
15495                Self::CloudNat => std::option::Option::Some("CLOUD_NAT"),
15496                Self::PrivateServiceConnect => std::option::Option::Some("PRIVATE_SERVICE_CONNECT"),
15497                Self::GkePodIpMasquerading => std::option::Option::Some("GKE_POD_IP_MASQUERADING"),
15498                Self::UnknownValue(u) => u.0.name(),
15499            }
15500        }
15501    }
15502
15503    impl std::default::Default for Type {
15504        fn default() -> Self {
15505            use std::convert::From;
15506            Self::from(0)
15507        }
15508    }
15509
15510    impl std::fmt::Display for Type {
15511        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15512            wkt::internal::display_enum(f, self.name(), self.value())
15513        }
15514    }
15515
15516    impl std::convert::From<i32> for Type {
15517        fn from(value: i32) -> Self {
15518            match value {
15519                0 => Self::Unspecified,
15520                1 => Self::InternalToExternal,
15521                2 => Self::ExternalToInternal,
15522                3 => Self::CloudNat,
15523                4 => Self::PrivateServiceConnect,
15524                5 => Self::GkePodIpMasquerading,
15525                _ => Self::UnknownValue(r#type::UnknownValue(
15526                    wkt::internal::UnknownEnumValue::Integer(value),
15527                )),
15528            }
15529        }
15530    }
15531
15532    impl std::convert::From<&str> for Type {
15533        fn from(value: &str) -> Self {
15534            use std::string::ToString;
15535            match value {
15536                "TYPE_UNSPECIFIED" => Self::Unspecified,
15537                "INTERNAL_TO_EXTERNAL" => Self::InternalToExternal,
15538                "EXTERNAL_TO_INTERNAL" => Self::ExternalToInternal,
15539                "CLOUD_NAT" => Self::CloudNat,
15540                "PRIVATE_SERVICE_CONNECT" => Self::PrivateServiceConnect,
15541                "GKE_POD_IP_MASQUERADING" => Self::GkePodIpMasquerading,
15542                _ => Self::UnknownValue(r#type::UnknownValue(
15543                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15544                )),
15545            }
15546        }
15547    }
15548
15549    impl serde::ser::Serialize for Type {
15550        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15551        where
15552            S: serde::Serializer,
15553        {
15554            match self {
15555                Self::Unspecified => serializer.serialize_i32(0),
15556                Self::InternalToExternal => serializer.serialize_i32(1),
15557                Self::ExternalToInternal => serializer.serialize_i32(2),
15558                Self::CloudNat => serializer.serialize_i32(3),
15559                Self::PrivateServiceConnect => serializer.serialize_i32(4),
15560                Self::GkePodIpMasquerading => serializer.serialize_i32(5),
15561                Self::UnknownValue(u) => u.0.serialize(serializer),
15562            }
15563        }
15564    }
15565
15566    impl<'de> serde::de::Deserialize<'de> for Type {
15567        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15568        where
15569            D: serde::Deserializer<'de>,
15570        {
15571            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
15572                ".google.cloud.networkmanagement.v1.NatInfo.Type",
15573            ))
15574        }
15575    }
15576
15577    /// Types of Cloud NAT gateway.
15578    ///
15579    /// # Working with unknown values
15580    ///
15581    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15582    /// additional enum variants at any time. Adding new variants is not considered
15583    /// a breaking change. Applications should write their code in anticipation of:
15584    ///
15585    /// - New values appearing in future releases of the client library, **and**
15586    /// - New values received dynamically, without application changes.
15587    ///
15588    /// Please consult the [Working with enums] section in the user guide for some
15589    /// guidelines.
15590    ///
15591    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15592    #[derive(Clone, Debug, PartialEq)]
15593    #[non_exhaustive]
15594    pub enum CloudNatGatewayType {
15595        /// Type is unspecified.
15596        Unspecified,
15597        /// Public NAT gateway.
15598        PublicNat44,
15599        /// Public NAT64 gateway.
15600        PublicNat64,
15601        /// Private NAT gateway for NCC.
15602        PrivateNatNcc,
15603        /// Private NAT gateway for hybrid connectivity.
15604        PrivateNatHybrid,
15605        /// Private NAT64 gateway.
15606        PrivateNat64,
15607        /// If set, the enum was initialized with an unknown value.
15608        ///
15609        /// Applications can examine the value using [CloudNatGatewayType::value] or
15610        /// [CloudNatGatewayType::name].
15611        UnknownValue(cloud_nat_gateway_type::UnknownValue),
15612    }
15613
15614    #[doc(hidden)]
15615    pub mod cloud_nat_gateway_type {
15616        #[allow(unused_imports)]
15617        use super::*;
15618        #[derive(Clone, Debug, PartialEq)]
15619        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15620    }
15621
15622    impl CloudNatGatewayType {
15623        /// Gets the enum value.
15624        ///
15625        /// Returns `None` if the enum contains an unknown value deserialized from
15626        /// the string representation of enums.
15627        pub fn value(&self) -> std::option::Option<i32> {
15628            match self {
15629                Self::Unspecified => std::option::Option::Some(0),
15630                Self::PublicNat44 => std::option::Option::Some(1),
15631                Self::PublicNat64 => std::option::Option::Some(2),
15632                Self::PrivateNatNcc => std::option::Option::Some(3),
15633                Self::PrivateNatHybrid => std::option::Option::Some(4),
15634                Self::PrivateNat64 => std::option::Option::Some(5),
15635                Self::UnknownValue(u) => u.0.value(),
15636            }
15637        }
15638
15639        /// Gets the enum value as a string.
15640        ///
15641        /// Returns `None` if the enum contains an unknown value deserialized from
15642        /// the integer representation of enums.
15643        pub fn name(&self) -> std::option::Option<&str> {
15644            match self {
15645                Self::Unspecified => {
15646                    std::option::Option::Some("CLOUD_NAT_GATEWAY_TYPE_UNSPECIFIED")
15647                }
15648                Self::PublicNat44 => std::option::Option::Some("PUBLIC_NAT44"),
15649                Self::PublicNat64 => std::option::Option::Some("PUBLIC_NAT64"),
15650                Self::PrivateNatNcc => std::option::Option::Some("PRIVATE_NAT_NCC"),
15651                Self::PrivateNatHybrid => std::option::Option::Some("PRIVATE_NAT_HYBRID"),
15652                Self::PrivateNat64 => std::option::Option::Some("PRIVATE_NAT64"),
15653                Self::UnknownValue(u) => u.0.name(),
15654            }
15655        }
15656    }
15657
15658    impl std::default::Default for CloudNatGatewayType {
15659        fn default() -> Self {
15660            use std::convert::From;
15661            Self::from(0)
15662        }
15663    }
15664
15665    impl std::fmt::Display for CloudNatGatewayType {
15666        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15667            wkt::internal::display_enum(f, self.name(), self.value())
15668        }
15669    }
15670
15671    impl std::convert::From<i32> for CloudNatGatewayType {
15672        fn from(value: i32) -> Self {
15673            match value {
15674                0 => Self::Unspecified,
15675                1 => Self::PublicNat44,
15676                2 => Self::PublicNat64,
15677                3 => Self::PrivateNatNcc,
15678                4 => Self::PrivateNatHybrid,
15679                5 => Self::PrivateNat64,
15680                _ => Self::UnknownValue(cloud_nat_gateway_type::UnknownValue(
15681                    wkt::internal::UnknownEnumValue::Integer(value),
15682                )),
15683            }
15684        }
15685    }
15686
15687    impl std::convert::From<&str> for CloudNatGatewayType {
15688        fn from(value: &str) -> Self {
15689            use std::string::ToString;
15690            match value {
15691                "CLOUD_NAT_GATEWAY_TYPE_UNSPECIFIED" => Self::Unspecified,
15692                "PUBLIC_NAT44" => Self::PublicNat44,
15693                "PUBLIC_NAT64" => Self::PublicNat64,
15694                "PRIVATE_NAT_NCC" => Self::PrivateNatNcc,
15695                "PRIVATE_NAT_HYBRID" => Self::PrivateNatHybrid,
15696                "PRIVATE_NAT64" => Self::PrivateNat64,
15697                _ => Self::UnknownValue(cloud_nat_gateway_type::UnknownValue(
15698                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15699                )),
15700            }
15701        }
15702    }
15703
15704    impl serde::ser::Serialize for CloudNatGatewayType {
15705        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15706        where
15707            S: serde::Serializer,
15708        {
15709            match self {
15710                Self::Unspecified => serializer.serialize_i32(0),
15711                Self::PublicNat44 => serializer.serialize_i32(1),
15712                Self::PublicNat64 => serializer.serialize_i32(2),
15713                Self::PrivateNatNcc => serializer.serialize_i32(3),
15714                Self::PrivateNatHybrid => serializer.serialize_i32(4),
15715                Self::PrivateNat64 => serializer.serialize_i32(5),
15716                Self::UnknownValue(u) => u.0.serialize(serializer),
15717            }
15718        }
15719    }
15720
15721    impl<'de> serde::de::Deserialize<'de> for CloudNatGatewayType {
15722        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15723        where
15724            D: serde::Deserializer<'de>,
15725        {
15726            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudNatGatewayType>::new(
15727                ".google.cloud.networkmanagement.v1.NatInfo.CloudNatGatewayType",
15728            ))
15729        }
15730    }
15731}
15732
15733/// For display only. Metadata associated with ProxyConnection.
15734#[derive(Clone, Default, PartialEq)]
15735#[non_exhaustive]
15736pub struct ProxyConnectionInfo {
15737    /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
15738    pub protocol: std::string::String,
15739
15740    /// Source IP address of an original connection.
15741    pub old_source_ip: std::string::String,
15742
15743    /// Source IP address of a new connection.
15744    pub new_source_ip: std::string::String,
15745
15746    /// Destination IP address of an original connection
15747    pub old_destination_ip: std::string::String,
15748
15749    /// Destination IP address of a new connection.
15750    pub new_destination_ip: std::string::String,
15751
15752    /// Source port of an original connection. Only valid when protocol is TCP or
15753    /// UDP.
15754    pub old_source_port: i32,
15755
15756    /// Source port of a new connection. Only valid when protocol is TCP or UDP.
15757    pub new_source_port: i32,
15758
15759    /// Destination port of an original connection. Only valid when protocol is TCP
15760    /// or UDP.
15761    pub old_destination_port: i32,
15762
15763    /// Destination port of a new connection. Only valid when protocol is TCP or
15764    /// UDP.
15765    pub new_destination_port: i32,
15766
15767    /// Uri of proxy subnet.
15768    pub subnet_uri: std::string::String,
15769
15770    /// URI of the network where connection is proxied.
15771    pub network_uri: std::string::String,
15772
15773    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15774}
15775
15776impl ProxyConnectionInfo {
15777    pub fn new() -> Self {
15778        std::default::Default::default()
15779    }
15780
15781    /// Sets the value of [protocol][crate::model::ProxyConnectionInfo::protocol].
15782    ///
15783    /// # Example
15784    /// ```ignore,no_run
15785    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15786    /// let x = ProxyConnectionInfo::new().set_protocol("example");
15787    /// ```
15788    pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15789        self.protocol = v.into();
15790        self
15791    }
15792
15793    /// Sets the value of [old_source_ip][crate::model::ProxyConnectionInfo::old_source_ip].
15794    ///
15795    /// # Example
15796    /// ```ignore,no_run
15797    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15798    /// let x = ProxyConnectionInfo::new().set_old_source_ip("example");
15799    /// ```
15800    pub fn set_old_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15801        self.old_source_ip = v.into();
15802        self
15803    }
15804
15805    /// Sets the value of [new_source_ip][crate::model::ProxyConnectionInfo::new_source_ip].
15806    ///
15807    /// # Example
15808    /// ```ignore,no_run
15809    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15810    /// let x = ProxyConnectionInfo::new().set_new_source_ip("example");
15811    /// ```
15812    pub fn set_new_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15813        self.new_source_ip = v.into();
15814        self
15815    }
15816
15817    /// Sets the value of [old_destination_ip][crate::model::ProxyConnectionInfo::old_destination_ip].
15818    ///
15819    /// # Example
15820    /// ```ignore,no_run
15821    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15822    /// let x = ProxyConnectionInfo::new().set_old_destination_ip("example");
15823    /// ```
15824    pub fn set_old_destination_ip<T: std::convert::Into<std::string::String>>(
15825        mut self,
15826        v: T,
15827    ) -> Self {
15828        self.old_destination_ip = v.into();
15829        self
15830    }
15831
15832    /// Sets the value of [new_destination_ip][crate::model::ProxyConnectionInfo::new_destination_ip].
15833    ///
15834    /// # Example
15835    /// ```ignore,no_run
15836    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15837    /// let x = ProxyConnectionInfo::new().set_new_destination_ip("example");
15838    /// ```
15839    pub fn set_new_destination_ip<T: std::convert::Into<std::string::String>>(
15840        mut self,
15841        v: T,
15842    ) -> Self {
15843        self.new_destination_ip = v.into();
15844        self
15845    }
15846
15847    /// Sets the value of [old_source_port][crate::model::ProxyConnectionInfo::old_source_port].
15848    ///
15849    /// # Example
15850    /// ```ignore,no_run
15851    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15852    /// let x = ProxyConnectionInfo::new().set_old_source_port(42);
15853    /// ```
15854    pub fn set_old_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15855        self.old_source_port = v.into();
15856        self
15857    }
15858
15859    /// Sets the value of [new_source_port][crate::model::ProxyConnectionInfo::new_source_port].
15860    ///
15861    /// # Example
15862    /// ```ignore,no_run
15863    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15864    /// let x = ProxyConnectionInfo::new().set_new_source_port(42);
15865    /// ```
15866    pub fn set_new_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15867        self.new_source_port = v.into();
15868        self
15869    }
15870
15871    /// Sets the value of [old_destination_port][crate::model::ProxyConnectionInfo::old_destination_port].
15872    ///
15873    /// # Example
15874    /// ```ignore,no_run
15875    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15876    /// let x = ProxyConnectionInfo::new().set_old_destination_port(42);
15877    /// ```
15878    pub fn set_old_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15879        self.old_destination_port = v.into();
15880        self
15881    }
15882
15883    /// Sets the value of [new_destination_port][crate::model::ProxyConnectionInfo::new_destination_port].
15884    ///
15885    /// # Example
15886    /// ```ignore,no_run
15887    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15888    /// let x = ProxyConnectionInfo::new().set_new_destination_port(42);
15889    /// ```
15890    pub fn set_new_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15891        self.new_destination_port = v.into();
15892        self
15893    }
15894
15895    /// Sets the value of [subnet_uri][crate::model::ProxyConnectionInfo::subnet_uri].
15896    ///
15897    /// # Example
15898    /// ```ignore,no_run
15899    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15900    /// let x = ProxyConnectionInfo::new().set_subnet_uri("example");
15901    /// ```
15902    pub fn set_subnet_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15903        self.subnet_uri = v.into();
15904        self
15905    }
15906
15907    /// Sets the value of [network_uri][crate::model::ProxyConnectionInfo::network_uri].
15908    ///
15909    /// # Example
15910    /// ```ignore,no_run
15911    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15912    /// let x = ProxyConnectionInfo::new().set_network_uri("example");
15913    /// ```
15914    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15915        self.network_uri = v.into();
15916        self
15917    }
15918}
15919
15920impl wkt::message::Message for ProxyConnectionInfo {
15921    fn typename() -> &'static str {
15922        "type.googleapis.com/google.cloud.networkmanagement.v1.ProxyConnectionInfo"
15923    }
15924}
15925
15926/// For display only. Metadata associated with the load balancer backend.
15927#[derive(Clone, Default, PartialEq)]
15928#[non_exhaustive]
15929pub struct LoadBalancerBackendInfo {
15930    /// Display name of the backend. For example, it might be an instance name for
15931    /// the instance group backends, or an IP address and port for zonal network
15932    /// endpoint group backends.
15933    pub name: std::string::String,
15934
15935    /// URI of the backend instance (if applicable). Populated for instance group
15936    /// backends, and zonal NEG backends.
15937    pub instance_uri: std::string::String,
15938
15939    /// URI of the backend service this backend belongs to (if applicable).
15940    pub backend_service_uri: std::string::String,
15941
15942    /// URI of the instance group this backend belongs to (if applicable).
15943    pub instance_group_uri: std::string::String,
15944
15945    /// URI of the network endpoint group this backend belongs to (if applicable).
15946    pub network_endpoint_group_uri: std::string::String,
15947
15948    /// URI of the backend bucket this backend targets (if applicable).
15949    pub backend_bucket_uri: std::string::String,
15950
15951    /// URI of the PSC service attachment this PSC NEG backend targets (if
15952    /// applicable).
15953    pub psc_service_attachment_uri: std::string::String,
15954
15955    /// PSC Google API target this PSC NEG backend targets (if applicable).
15956    pub psc_google_api_target: std::string::String,
15957
15958    /// URI of the health check attached to this backend (if applicable).
15959    pub health_check_uri: std::string::String,
15960
15961    /// Output only. Health check firewalls configuration state for the backend.
15962    /// This is a result of the static firewall analysis (verifying that health
15963    /// check traffic from required IP ranges to the backend is allowed or not).
15964    /// The backend might still be unhealthy even if these firewalls are
15965    /// configured. Please refer to the documentation for more information:
15966    /// <https://cloud.google.com/load-balancing/docs/firewall-rules>
15967    pub health_check_firewalls_config_state:
15968        crate::model::load_balancer_backend_info::HealthCheckFirewallsConfigState,
15969
15970    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15971}
15972
15973impl LoadBalancerBackendInfo {
15974    pub fn new() -> Self {
15975        std::default::Default::default()
15976    }
15977
15978    /// Sets the value of [name][crate::model::LoadBalancerBackendInfo::name].
15979    ///
15980    /// # Example
15981    /// ```ignore,no_run
15982    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
15983    /// let x = LoadBalancerBackendInfo::new().set_name("example");
15984    /// ```
15985    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15986        self.name = v.into();
15987        self
15988    }
15989
15990    /// Sets the value of [instance_uri][crate::model::LoadBalancerBackendInfo::instance_uri].
15991    ///
15992    /// # Example
15993    /// ```ignore,no_run
15994    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
15995    /// let x = LoadBalancerBackendInfo::new().set_instance_uri("example");
15996    /// ```
15997    pub fn set_instance_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15998        self.instance_uri = v.into();
15999        self
16000    }
16001
16002    /// Sets the value of [backend_service_uri][crate::model::LoadBalancerBackendInfo::backend_service_uri].
16003    ///
16004    /// # Example
16005    /// ```ignore,no_run
16006    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16007    /// let x = LoadBalancerBackendInfo::new().set_backend_service_uri("example");
16008    /// ```
16009    pub fn set_backend_service_uri<T: std::convert::Into<std::string::String>>(
16010        mut self,
16011        v: T,
16012    ) -> Self {
16013        self.backend_service_uri = v.into();
16014        self
16015    }
16016
16017    /// Sets the value of [instance_group_uri][crate::model::LoadBalancerBackendInfo::instance_group_uri].
16018    ///
16019    /// # Example
16020    /// ```ignore,no_run
16021    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16022    /// let x = LoadBalancerBackendInfo::new().set_instance_group_uri("example");
16023    /// ```
16024    pub fn set_instance_group_uri<T: std::convert::Into<std::string::String>>(
16025        mut self,
16026        v: T,
16027    ) -> Self {
16028        self.instance_group_uri = v.into();
16029        self
16030    }
16031
16032    /// Sets the value of [network_endpoint_group_uri][crate::model::LoadBalancerBackendInfo::network_endpoint_group_uri].
16033    ///
16034    /// # Example
16035    /// ```ignore,no_run
16036    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16037    /// let x = LoadBalancerBackendInfo::new().set_network_endpoint_group_uri("example");
16038    /// ```
16039    pub fn set_network_endpoint_group_uri<T: std::convert::Into<std::string::String>>(
16040        mut self,
16041        v: T,
16042    ) -> Self {
16043        self.network_endpoint_group_uri = v.into();
16044        self
16045    }
16046
16047    /// Sets the value of [backend_bucket_uri][crate::model::LoadBalancerBackendInfo::backend_bucket_uri].
16048    ///
16049    /// # Example
16050    /// ```ignore,no_run
16051    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16052    /// let x = LoadBalancerBackendInfo::new().set_backend_bucket_uri("example");
16053    /// ```
16054    pub fn set_backend_bucket_uri<T: std::convert::Into<std::string::String>>(
16055        mut self,
16056        v: T,
16057    ) -> Self {
16058        self.backend_bucket_uri = v.into();
16059        self
16060    }
16061
16062    /// Sets the value of [psc_service_attachment_uri][crate::model::LoadBalancerBackendInfo::psc_service_attachment_uri].
16063    ///
16064    /// # Example
16065    /// ```ignore,no_run
16066    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16067    /// let x = LoadBalancerBackendInfo::new().set_psc_service_attachment_uri("example");
16068    /// ```
16069    pub fn set_psc_service_attachment_uri<T: std::convert::Into<std::string::String>>(
16070        mut self,
16071        v: T,
16072    ) -> Self {
16073        self.psc_service_attachment_uri = v.into();
16074        self
16075    }
16076
16077    /// Sets the value of [psc_google_api_target][crate::model::LoadBalancerBackendInfo::psc_google_api_target].
16078    ///
16079    /// # Example
16080    /// ```ignore,no_run
16081    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16082    /// let x = LoadBalancerBackendInfo::new().set_psc_google_api_target("example");
16083    /// ```
16084    pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
16085        mut self,
16086        v: T,
16087    ) -> Self {
16088        self.psc_google_api_target = v.into();
16089        self
16090    }
16091
16092    /// Sets the value of [health_check_uri][crate::model::LoadBalancerBackendInfo::health_check_uri].
16093    ///
16094    /// # Example
16095    /// ```ignore,no_run
16096    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16097    /// let x = LoadBalancerBackendInfo::new().set_health_check_uri("example");
16098    /// ```
16099    pub fn set_health_check_uri<T: std::convert::Into<std::string::String>>(
16100        mut self,
16101        v: T,
16102    ) -> Self {
16103        self.health_check_uri = v.into();
16104        self
16105    }
16106
16107    /// Sets the value of [health_check_firewalls_config_state][crate::model::LoadBalancerBackendInfo::health_check_firewalls_config_state].
16108    ///
16109    /// # Example
16110    /// ```ignore,no_run
16111    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16112    /// use google_cloud_networkmanagement_v1::model::load_balancer_backend_info::HealthCheckFirewallsConfigState;
16113    /// let x0 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsConfigured);
16114    /// let x1 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsPartiallyConfigured);
16115    /// let x2 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsNotConfigured);
16116    /// ```
16117    pub fn set_health_check_firewalls_config_state<
16118        T: std::convert::Into<
16119                crate::model::load_balancer_backend_info::HealthCheckFirewallsConfigState,
16120            >,
16121    >(
16122        mut self,
16123        v: T,
16124    ) -> Self {
16125        self.health_check_firewalls_config_state = v.into();
16126        self
16127    }
16128}
16129
16130impl wkt::message::Message for LoadBalancerBackendInfo {
16131    fn typename() -> &'static str {
16132        "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerBackendInfo"
16133    }
16134}
16135
16136/// Defines additional types related to [LoadBalancerBackendInfo].
16137pub mod load_balancer_backend_info {
16138    #[allow(unused_imports)]
16139    use super::*;
16140
16141    /// Health check firewalls configuration state enum.
16142    ///
16143    /// # Working with unknown values
16144    ///
16145    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16146    /// additional enum variants at any time. Adding new variants is not considered
16147    /// a breaking change. Applications should write their code in anticipation of:
16148    ///
16149    /// - New values appearing in future releases of the client library, **and**
16150    /// - New values received dynamically, without application changes.
16151    ///
16152    /// Please consult the [Working with enums] section in the user guide for some
16153    /// guidelines.
16154    ///
16155    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16156    #[derive(Clone, Debug, PartialEq)]
16157    #[non_exhaustive]
16158    pub enum HealthCheckFirewallsConfigState {
16159        /// Configuration state unspecified. It usually means that the backend has
16160        /// no health check attached, or there was an unexpected configuration error
16161        /// preventing Connectivity tests from verifying health check configuration.
16162        Unspecified,
16163        /// Firewall rules (policies) allowing health check traffic from all required
16164        /// IP ranges to the backend are configured.
16165        FirewallsConfigured,
16166        /// Firewall rules (policies) allow health check traffic only from a part of
16167        /// required IP ranges.
16168        FirewallsPartiallyConfigured,
16169        /// Firewall rules (policies) deny health check traffic from all required
16170        /// IP ranges to the backend.
16171        FirewallsNotConfigured,
16172        /// The network contains firewall rules of unsupported types, so Connectivity
16173        /// tests were not able to verify health check configuration status. Please
16174        /// refer to the documentation for the list of unsupported configurations:
16175        /// <https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/concepts/overview#unsupported-configs>
16176        FirewallsUnsupported,
16177        /// If set, the enum was initialized with an unknown value.
16178        ///
16179        /// Applications can examine the value using [HealthCheckFirewallsConfigState::value] or
16180        /// [HealthCheckFirewallsConfigState::name].
16181        UnknownValue(health_check_firewalls_config_state::UnknownValue),
16182    }
16183
16184    #[doc(hidden)]
16185    pub mod health_check_firewalls_config_state {
16186        #[allow(unused_imports)]
16187        use super::*;
16188        #[derive(Clone, Debug, PartialEq)]
16189        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16190    }
16191
16192    impl HealthCheckFirewallsConfigState {
16193        /// Gets the enum value.
16194        ///
16195        /// Returns `None` if the enum contains an unknown value deserialized from
16196        /// the string representation of enums.
16197        pub fn value(&self) -> std::option::Option<i32> {
16198            match self {
16199                Self::Unspecified => std::option::Option::Some(0),
16200                Self::FirewallsConfigured => std::option::Option::Some(1),
16201                Self::FirewallsPartiallyConfigured => std::option::Option::Some(2),
16202                Self::FirewallsNotConfigured => std::option::Option::Some(3),
16203                Self::FirewallsUnsupported => std::option::Option::Some(4),
16204                Self::UnknownValue(u) => u.0.value(),
16205            }
16206        }
16207
16208        /// Gets the enum value as a string.
16209        ///
16210        /// Returns `None` if the enum contains an unknown value deserialized from
16211        /// the integer representation of enums.
16212        pub fn name(&self) -> std::option::Option<&str> {
16213            match self {
16214                Self::Unspecified => {
16215                    std::option::Option::Some("HEALTH_CHECK_FIREWALLS_CONFIG_STATE_UNSPECIFIED")
16216                }
16217                Self::FirewallsConfigured => std::option::Option::Some("FIREWALLS_CONFIGURED"),
16218                Self::FirewallsPartiallyConfigured => {
16219                    std::option::Option::Some("FIREWALLS_PARTIALLY_CONFIGURED")
16220                }
16221                Self::FirewallsNotConfigured => {
16222                    std::option::Option::Some("FIREWALLS_NOT_CONFIGURED")
16223                }
16224                Self::FirewallsUnsupported => std::option::Option::Some("FIREWALLS_UNSUPPORTED"),
16225                Self::UnknownValue(u) => u.0.name(),
16226            }
16227        }
16228    }
16229
16230    impl std::default::Default for HealthCheckFirewallsConfigState {
16231        fn default() -> Self {
16232            use std::convert::From;
16233            Self::from(0)
16234        }
16235    }
16236
16237    impl std::fmt::Display for HealthCheckFirewallsConfigState {
16238        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16239            wkt::internal::display_enum(f, self.name(), self.value())
16240        }
16241    }
16242
16243    impl std::convert::From<i32> for HealthCheckFirewallsConfigState {
16244        fn from(value: i32) -> Self {
16245            match value {
16246                0 => Self::Unspecified,
16247                1 => Self::FirewallsConfigured,
16248                2 => Self::FirewallsPartiallyConfigured,
16249                3 => Self::FirewallsNotConfigured,
16250                4 => Self::FirewallsUnsupported,
16251                _ => Self::UnknownValue(health_check_firewalls_config_state::UnknownValue(
16252                    wkt::internal::UnknownEnumValue::Integer(value),
16253                )),
16254            }
16255        }
16256    }
16257
16258    impl std::convert::From<&str> for HealthCheckFirewallsConfigState {
16259        fn from(value: &str) -> Self {
16260            use std::string::ToString;
16261            match value {
16262                "HEALTH_CHECK_FIREWALLS_CONFIG_STATE_UNSPECIFIED" => Self::Unspecified,
16263                "FIREWALLS_CONFIGURED" => Self::FirewallsConfigured,
16264                "FIREWALLS_PARTIALLY_CONFIGURED" => Self::FirewallsPartiallyConfigured,
16265                "FIREWALLS_NOT_CONFIGURED" => Self::FirewallsNotConfigured,
16266                "FIREWALLS_UNSUPPORTED" => Self::FirewallsUnsupported,
16267                _ => Self::UnknownValue(health_check_firewalls_config_state::UnknownValue(
16268                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16269                )),
16270            }
16271        }
16272    }
16273
16274    impl serde::ser::Serialize for HealthCheckFirewallsConfigState {
16275        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16276        where
16277            S: serde::Serializer,
16278        {
16279            match self {
16280                Self::Unspecified => serializer.serialize_i32(0),
16281                Self::FirewallsConfigured => serializer.serialize_i32(1),
16282                Self::FirewallsPartiallyConfigured => serializer.serialize_i32(2),
16283                Self::FirewallsNotConfigured => serializer.serialize_i32(3),
16284                Self::FirewallsUnsupported => serializer.serialize_i32(4),
16285                Self::UnknownValue(u) => u.0.serialize(serializer),
16286            }
16287        }
16288    }
16289
16290    impl<'de> serde::de::Deserialize<'de> for HealthCheckFirewallsConfigState {
16291        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16292        where
16293            D: serde::Deserializer<'de>,
16294        {
16295            deserializer.deserialize_any(wkt::internal::EnumVisitor::<HealthCheckFirewallsConfigState>::new(
16296                ".google.cloud.networkmanagement.v1.LoadBalancerBackendInfo.HealthCheckFirewallsConfigState"))
16297        }
16298    }
16299}
16300
16301/// For display only. Metadata associated with Storage Bucket.
16302#[derive(Clone, Default, PartialEq)]
16303#[non_exhaustive]
16304pub struct StorageBucketInfo {
16305    /// Cloud Storage Bucket name.
16306    pub bucket: std::string::String,
16307
16308    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16309}
16310
16311impl StorageBucketInfo {
16312    pub fn new() -> Self {
16313        std::default::Default::default()
16314    }
16315
16316    /// Sets the value of [bucket][crate::model::StorageBucketInfo::bucket].
16317    ///
16318    /// # Example
16319    /// ```ignore,no_run
16320    /// # use google_cloud_networkmanagement_v1::model::StorageBucketInfo;
16321    /// let x = StorageBucketInfo::new().set_bucket("example");
16322    /// ```
16323    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16324        self.bucket = v.into();
16325        self
16326    }
16327}
16328
16329impl wkt::message::Message for StorageBucketInfo {
16330    fn typename() -> &'static str {
16331        "type.googleapis.com/google.cloud.networkmanagement.v1.StorageBucketInfo"
16332    }
16333}
16334
16335/// For display only. Metadata associated with the serverless network endpoint
16336/// group backend.
16337#[derive(Clone, Default, PartialEq)]
16338#[non_exhaustive]
16339pub struct ServerlessNegInfo {
16340    /// URI of the serverless network endpoint group.
16341    pub neg_uri: std::string::String,
16342
16343    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16344}
16345
16346impl ServerlessNegInfo {
16347    pub fn new() -> Self {
16348        std::default::Default::default()
16349    }
16350
16351    /// Sets the value of [neg_uri][crate::model::ServerlessNegInfo::neg_uri].
16352    ///
16353    /// # Example
16354    /// ```ignore,no_run
16355    /// # use google_cloud_networkmanagement_v1::model::ServerlessNegInfo;
16356    /// let x = ServerlessNegInfo::new().set_neg_uri("example");
16357    /// ```
16358    pub fn set_neg_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16359        self.neg_uri = v.into();
16360        self
16361    }
16362}
16363
16364impl wkt::message::Message for ServerlessNegInfo {
16365    fn typename() -> &'static str {
16366        "type.googleapis.com/google.cloud.networkmanagement.v1.ServerlessNegInfo"
16367    }
16368}
16369
16370/// For display only. Metadata associated with a layer 7 packet inspection by the
16371/// firewall.
16372#[derive(Clone, Default, PartialEq)]
16373#[non_exhaustive]
16374pub struct NgfwPacketInspectionInfo {
16375    /// URI of the security profile group associated with this firewall packet
16376    /// inspection.
16377    pub security_profile_group_uri: std::string::String,
16378
16379    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16380}
16381
16382impl NgfwPacketInspectionInfo {
16383    pub fn new() -> Self {
16384        std::default::Default::default()
16385    }
16386
16387    /// Sets the value of [security_profile_group_uri][crate::model::NgfwPacketInspectionInfo::security_profile_group_uri].
16388    ///
16389    /// # Example
16390    /// ```ignore,no_run
16391    /// # use google_cloud_networkmanagement_v1::model::NgfwPacketInspectionInfo;
16392    /// let x = NgfwPacketInspectionInfo::new().set_security_profile_group_uri("example");
16393    /// ```
16394    pub fn set_security_profile_group_uri<T: std::convert::Into<std::string::String>>(
16395        mut self,
16396        v: T,
16397    ) -> Self {
16398        self.security_profile_group_uri = v.into();
16399        self
16400    }
16401}
16402
16403impl wkt::message::Message for NgfwPacketInspectionInfo {
16404    fn typename() -> &'static str {
16405        "type.googleapis.com/google.cloud.networkmanagement.v1.NgfwPacketInspectionInfo"
16406    }
16407}
16408
16409/// Request for the `ListVpcFlowLogsConfigs` method.
16410#[derive(Clone, Default, PartialEq)]
16411#[non_exhaustive]
16412pub struct ListVpcFlowLogsConfigsRequest {
16413    /// Required. The parent resource of the VpcFlowLogsConfig,
16414    /// in one of the following formats:
16415    ///
16416    /// - For project-level resources: `projects/{project_id}/locations/global`
16417    ///
16418    /// - For organization-level resources:
16419    ///   `organizations/{organization_id}/locations/global`
16420    ///
16421    pub parent: std::string::String,
16422
16423    /// Optional. Number of `VpcFlowLogsConfigs` to return.
16424    pub page_size: i32,
16425
16426    /// Optional. Page token from an earlier query, as returned in
16427    /// `next_page_token`.
16428    pub page_token: std::string::String,
16429
16430    /// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
16431    /// A filter expression must use the supported [CEL logic operators]
16432    /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
16433    pub filter: std::string::String,
16434
16435    /// Optional. Field to use to sort the list.
16436    pub order_by: std::string::String,
16437
16438    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16439}
16440
16441impl ListVpcFlowLogsConfigsRequest {
16442    pub fn new() -> Self {
16443        std::default::Default::default()
16444    }
16445
16446    /// Sets the value of [parent][crate::model::ListVpcFlowLogsConfigsRequest::parent].
16447    ///
16448    /// # Example
16449    /// ```ignore,no_run
16450    /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16451    /// let x = ListVpcFlowLogsConfigsRequest::new().set_parent("example");
16452    /// ```
16453    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16454        self.parent = v.into();
16455        self
16456    }
16457
16458    /// Sets the value of [page_size][crate::model::ListVpcFlowLogsConfigsRequest::page_size].
16459    ///
16460    /// # Example
16461    /// ```ignore,no_run
16462    /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16463    /// let x = ListVpcFlowLogsConfigsRequest::new().set_page_size(42);
16464    /// ```
16465    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16466        self.page_size = v.into();
16467        self
16468    }
16469
16470    /// Sets the value of [page_token][crate::model::ListVpcFlowLogsConfigsRequest::page_token].
16471    ///
16472    /// # Example
16473    /// ```ignore,no_run
16474    /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16475    /// let x = ListVpcFlowLogsConfigsRequest::new().set_page_token("example");
16476    /// ```
16477    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16478        self.page_token = v.into();
16479        self
16480    }
16481
16482    /// Sets the value of [filter][crate::model::ListVpcFlowLogsConfigsRequest::filter].
16483    ///
16484    /// # Example
16485    /// ```ignore,no_run
16486    /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16487    /// let x = ListVpcFlowLogsConfigsRequest::new().set_filter("example");
16488    /// ```
16489    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16490        self.filter = v.into();
16491        self
16492    }
16493
16494    /// Sets the value of [order_by][crate::model::ListVpcFlowLogsConfigsRequest::order_by].
16495    ///
16496    /// # Example
16497    /// ```ignore,no_run
16498    /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16499    /// let x = ListVpcFlowLogsConfigsRequest::new().set_order_by("example");
16500    /// ```
16501    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16502        self.order_by = v.into();
16503        self
16504    }
16505}
16506
16507impl wkt::message::Message for ListVpcFlowLogsConfigsRequest {
16508    fn typename() -> &'static str {
16509        "type.googleapis.com/google.cloud.networkmanagement.v1.ListVpcFlowLogsConfigsRequest"
16510    }
16511}
16512
16513/// Response for the `ListVpcFlowLogsConfigs` method.
16514#[derive(Clone, Default, PartialEq)]
16515#[non_exhaustive]
16516pub struct ListVpcFlowLogsConfigsResponse {
16517    /// List of VPC Flow Log configurations.
16518    pub vpc_flow_logs_configs: std::vec::Vec<crate::model::VpcFlowLogsConfig>,
16519
16520    /// Page token to fetch the next set of configurations.
16521    pub next_page_token: std::string::String,
16522
16523    /// Locations that could not be reached (when querying all locations with `-`).
16524    pub unreachable: std::vec::Vec<std::string::String>,
16525
16526    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16527}
16528
16529impl ListVpcFlowLogsConfigsResponse {
16530    pub fn new() -> Self {
16531        std::default::Default::default()
16532    }
16533
16534    /// Sets the value of [vpc_flow_logs_configs][crate::model::ListVpcFlowLogsConfigsResponse::vpc_flow_logs_configs].
16535    ///
16536    /// # Example
16537    /// ```ignore,no_run
16538    /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
16539    /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16540    /// let x = ListVpcFlowLogsConfigsResponse::new()
16541    ///     .set_vpc_flow_logs_configs([
16542    ///         VpcFlowLogsConfig::default()/* use setters */,
16543    ///         VpcFlowLogsConfig::default()/* use (different) setters */,
16544    ///     ]);
16545    /// ```
16546    pub fn set_vpc_flow_logs_configs<T, V>(mut self, v: T) -> Self
16547    where
16548        T: std::iter::IntoIterator<Item = V>,
16549        V: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16550    {
16551        use std::iter::Iterator;
16552        self.vpc_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
16553        self
16554    }
16555
16556    /// Sets the value of [next_page_token][crate::model::ListVpcFlowLogsConfigsResponse::next_page_token].
16557    ///
16558    /// # Example
16559    /// ```ignore,no_run
16560    /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
16561    /// let x = ListVpcFlowLogsConfigsResponse::new().set_next_page_token("example");
16562    /// ```
16563    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16564        self.next_page_token = v.into();
16565        self
16566    }
16567
16568    /// Sets the value of [unreachable][crate::model::ListVpcFlowLogsConfigsResponse::unreachable].
16569    ///
16570    /// # Example
16571    /// ```ignore,no_run
16572    /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
16573    /// let x = ListVpcFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
16574    /// ```
16575    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
16576    where
16577        T: std::iter::IntoIterator<Item = V>,
16578        V: std::convert::Into<std::string::String>,
16579    {
16580        use std::iter::Iterator;
16581        self.unreachable = v.into_iter().map(|i| i.into()).collect();
16582        self
16583    }
16584}
16585
16586impl wkt::message::Message for ListVpcFlowLogsConfigsResponse {
16587    fn typename() -> &'static str {
16588        "type.googleapis.com/google.cloud.networkmanagement.v1.ListVpcFlowLogsConfigsResponse"
16589    }
16590}
16591
16592#[doc(hidden)]
16593impl google_cloud_gax::paginator::internal::PageableResponse for ListVpcFlowLogsConfigsResponse {
16594    type PageItem = crate::model::VpcFlowLogsConfig;
16595
16596    fn items(self) -> std::vec::Vec<Self::PageItem> {
16597        self.vpc_flow_logs_configs
16598    }
16599
16600    fn next_page_token(&self) -> std::string::String {
16601        use std::clone::Clone;
16602        self.next_page_token.clone()
16603    }
16604}
16605
16606/// Request for the `GetVpcFlowLogsConfig` method.
16607#[derive(Clone, Default, PartialEq)]
16608#[non_exhaustive]
16609pub struct GetVpcFlowLogsConfigRequest {
16610    /// Required. The resource name of the VpcFlowLogsConfig,
16611    /// in one of the following formats:
16612    ///
16613    /// - For project-level resources:
16614    ///   `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
16615    ///
16616    /// - For organization-level resources:
16617    ///   `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
16618    ///
16619    pub name: std::string::String,
16620
16621    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16622}
16623
16624impl GetVpcFlowLogsConfigRequest {
16625    pub fn new() -> Self {
16626        std::default::Default::default()
16627    }
16628
16629    /// Sets the value of [name][crate::model::GetVpcFlowLogsConfigRequest::name].
16630    ///
16631    /// # Example
16632    /// ```ignore,no_run
16633    /// # use google_cloud_networkmanagement_v1::model::GetVpcFlowLogsConfigRequest;
16634    /// let x = GetVpcFlowLogsConfigRequest::new().set_name("example");
16635    /// ```
16636    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16637        self.name = v.into();
16638        self
16639    }
16640}
16641
16642impl wkt::message::Message for GetVpcFlowLogsConfigRequest {
16643    fn typename() -> &'static str {
16644        "type.googleapis.com/google.cloud.networkmanagement.v1.GetVpcFlowLogsConfigRequest"
16645    }
16646}
16647
16648/// Request for the `CreateVpcFlowLogsConfig` method.
16649#[derive(Clone, Default, PartialEq)]
16650#[non_exhaustive]
16651pub struct CreateVpcFlowLogsConfigRequest {
16652    /// Required. The parent resource of the VpcFlowLogsConfig to create,
16653    /// in one of the following formats:
16654    ///
16655    /// - For project-level resources: `projects/{project_id}/locations/global`
16656    ///
16657    /// - For organization-level resources:
16658    ///   `organizations/{organization_id}/locations/global`
16659    ///
16660    pub parent: std::string::String,
16661
16662    /// Required. ID of the `VpcFlowLogsConfig`.
16663    pub vpc_flow_logs_config_id: std::string::String,
16664
16665    /// Required. A `VpcFlowLogsConfig` resource
16666    pub vpc_flow_logs_config: std::option::Option<crate::model::VpcFlowLogsConfig>,
16667
16668    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16669}
16670
16671impl CreateVpcFlowLogsConfigRequest {
16672    pub fn new() -> Self {
16673        std::default::Default::default()
16674    }
16675
16676    /// Sets the value of [parent][crate::model::CreateVpcFlowLogsConfigRequest::parent].
16677    ///
16678    /// # Example
16679    /// ```ignore,no_run
16680    /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
16681    /// let x = CreateVpcFlowLogsConfigRequest::new().set_parent("example");
16682    /// ```
16683    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16684        self.parent = v.into();
16685        self
16686    }
16687
16688    /// Sets the value of [vpc_flow_logs_config_id][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config_id].
16689    ///
16690    /// # Example
16691    /// ```ignore,no_run
16692    /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
16693    /// let x = CreateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config_id("example");
16694    /// ```
16695    pub fn set_vpc_flow_logs_config_id<T: std::convert::Into<std::string::String>>(
16696        mut self,
16697        v: T,
16698    ) -> Self {
16699        self.vpc_flow_logs_config_id = v.into();
16700        self
16701    }
16702
16703    /// Sets the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
16704    ///
16705    /// # Example
16706    /// ```ignore,no_run
16707    /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
16708    /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16709    /// let x = CreateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config(VpcFlowLogsConfig::default()/* use setters */);
16710    /// ```
16711    pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
16712    where
16713        T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16714    {
16715        self.vpc_flow_logs_config = std::option::Option::Some(v.into());
16716        self
16717    }
16718
16719    /// Sets or clears the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
16720    ///
16721    /// # Example
16722    /// ```ignore,no_run
16723    /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
16724    /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16725    /// let x = CreateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(Some(VpcFlowLogsConfig::default()/* use setters */));
16726    /// let x = CreateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(None::<VpcFlowLogsConfig>);
16727    /// ```
16728    pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
16729    where
16730        T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16731    {
16732        self.vpc_flow_logs_config = v.map(|x| x.into());
16733        self
16734    }
16735}
16736
16737impl wkt::message::Message for CreateVpcFlowLogsConfigRequest {
16738    fn typename() -> &'static str {
16739        "type.googleapis.com/google.cloud.networkmanagement.v1.CreateVpcFlowLogsConfigRequest"
16740    }
16741}
16742
16743/// Request for the `UpdateVpcFlowLogsConfig` method.
16744#[derive(Clone, Default, PartialEq)]
16745#[non_exhaustive]
16746pub struct UpdateVpcFlowLogsConfigRequest {
16747    /// Required. Mask of fields to update. At least one path must be supplied in
16748    /// this field.
16749    /// For example, to change the state of the configuration to ENABLED, specify
16750    /// `update_mask` = `"state"`, and the `vpc_flow_logs_config` would be:
16751    /// `vpc_flow_logs_config = {
16752    /// name =
16753    /// "projects/my-project/locations/global/vpcFlowLogsConfigs/my-config"
16754    /// state = "ENABLED" }`
16755    pub update_mask: std::option::Option<wkt::FieldMask>,
16756
16757    /// Required. Only fields specified in update_mask are updated.
16758    pub vpc_flow_logs_config: std::option::Option<crate::model::VpcFlowLogsConfig>,
16759
16760    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16761}
16762
16763impl UpdateVpcFlowLogsConfigRequest {
16764    pub fn new() -> Self {
16765        std::default::Default::default()
16766    }
16767
16768    /// Sets the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
16769    ///
16770    /// # Example
16771    /// ```ignore,no_run
16772    /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
16773    /// use wkt::FieldMask;
16774    /// let x = UpdateVpcFlowLogsConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
16775    /// ```
16776    pub fn set_update_mask<T>(mut self, v: T) -> Self
16777    where
16778        T: std::convert::Into<wkt::FieldMask>,
16779    {
16780        self.update_mask = std::option::Option::Some(v.into());
16781        self
16782    }
16783
16784    /// Sets or clears the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
16785    ///
16786    /// # Example
16787    /// ```ignore,no_run
16788    /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
16789    /// use wkt::FieldMask;
16790    /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
16791    /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
16792    /// ```
16793    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16794    where
16795        T: std::convert::Into<wkt::FieldMask>,
16796    {
16797        self.update_mask = v.map(|x| x.into());
16798        self
16799    }
16800
16801    /// Sets the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
16802    ///
16803    /// # Example
16804    /// ```ignore,no_run
16805    /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
16806    /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16807    /// let x = UpdateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config(VpcFlowLogsConfig::default()/* use setters */);
16808    /// ```
16809    pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
16810    where
16811        T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16812    {
16813        self.vpc_flow_logs_config = std::option::Option::Some(v.into());
16814        self
16815    }
16816
16817    /// Sets or clears the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
16818    ///
16819    /// # Example
16820    /// ```ignore,no_run
16821    /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
16822    /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16823    /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(Some(VpcFlowLogsConfig::default()/* use setters */));
16824    /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(None::<VpcFlowLogsConfig>);
16825    /// ```
16826    pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
16827    where
16828        T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16829    {
16830        self.vpc_flow_logs_config = v.map(|x| x.into());
16831        self
16832    }
16833}
16834
16835impl wkt::message::Message for UpdateVpcFlowLogsConfigRequest {
16836    fn typename() -> &'static str {
16837        "type.googleapis.com/google.cloud.networkmanagement.v1.UpdateVpcFlowLogsConfigRequest"
16838    }
16839}
16840
16841/// Request for the `DeleteVpcFlowLogsConfig` method.
16842#[derive(Clone, Default, PartialEq)]
16843#[non_exhaustive]
16844pub struct DeleteVpcFlowLogsConfigRequest {
16845    /// Required. The resource name of the VpcFlowLogsConfig,
16846    /// in one of the following formats:
16847    ///
16848    /// - For a project-level resource:
16849    ///   `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
16850    ///
16851    /// - For an organization-level resource:
16852    ///   `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
16853    ///
16854    pub name: std::string::String,
16855
16856    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16857}
16858
16859impl DeleteVpcFlowLogsConfigRequest {
16860    pub fn new() -> Self {
16861        std::default::Default::default()
16862    }
16863
16864    /// Sets the value of [name][crate::model::DeleteVpcFlowLogsConfigRequest::name].
16865    ///
16866    /// # Example
16867    /// ```ignore,no_run
16868    /// # use google_cloud_networkmanagement_v1::model::DeleteVpcFlowLogsConfigRequest;
16869    /// let x = DeleteVpcFlowLogsConfigRequest::new().set_name("example");
16870    /// ```
16871    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16872        self.name = v.into();
16873        self
16874    }
16875}
16876
16877impl wkt::message::Message for DeleteVpcFlowLogsConfigRequest {
16878    fn typename() -> &'static str {
16879        "type.googleapis.com/google.cloud.networkmanagement.v1.DeleteVpcFlowLogsConfigRequest"
16880    }
16881}
16882
16883/// Request for the `QueryOrgVpcFlowLogsConfigs` method.
16884#[derive(Clone, Default, PartialEq)]
16885#[non_exhaustive]
16886pub struct QueryOrgVpcFlowLogsConfigsRequest {
16887    /// Required. The parent resource of the VpcFlowLogsConfig, specified in
16888    /// the following format: `projects/{project_id}/locations/global`
16889    pub parent: std::string::String,
16890
16891    /// Optional. Number of `VpcFlowLogsConfigs` to return.
16892    pub page_size: i32,
16893
16894    /// Optional. Page token from an earlier query, as returned in
16895    /// `next_page_token`.
16896    pub page_token: std::string::String,
16897
16898    /// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
16899    /// A filter expression must use the supported [CEL logic operators]
16900    /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
16901    pub filter: std::string::String,
16902
16903    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16904}
16905
16906impl QueryOrgVpcFlowLogsConfigsRequest {
16907    pub fn new() -> Self {
16908        std::default::Default::default()
16909    }
16910
16911    /// Sets the value of [parent][crate::model::QueryOrgVpcFlowLogsConfigsRequest::parent].
16912    ///
16913    /// # Example
16914    /// ```ignore,no_run
16915    /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
16916    /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_parent("example");
16917    /// ```
16918    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16919        self.parent = v.into();
16920        self
16921    }
16922
16923    /// Sets the value of [page_size][crate::model::QueryOrgVpcFlowLogsConfigsRequest::page_size].
16924    ///
16925    /// # Example
16926    /// ```ignore,no_run
16927    /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
16928    /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_page_size(42);
16929    /// ```
16930    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16931        self.page_size = v.into();
16932        self
16933    }
16934
16935    /// Sets the value of [page_token][crate::model::QueryOrgVpcFlowLogsConfigsRequest::page_token].
16936    ///
16937    /// # Example
16938    /// ```ignore,no_run
16939    /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
16940    /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_page_token("example");
16941    /// ```
16942    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16943        self.page_token = v.into();
16944        self
16945    }
16946
16947    /// Sets the value of [filter][crate::model::QueryOrgVpcFlowLogsConfigsRequest::filter].
16948    ///
16949    /// # Example
16950    /// ```ignore,no_run
16951    /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
16952    /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_filter("example");
16953    /// ```
16954    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16955        self.filter = v.into();
16956        self
16957    }
16958}
16959
16960impl wkt::message::Message for QueryOrgVpcFlowLogsConfigsRequest {
16961    fn typename() -> &'static str {
16962        "type.googleapis.com/google.cloud.networkmanagement.v1.QueryOrgVpcFlowLogsConfigsRequest"
16963    }
16964}
16965
16966/// Response for the `QueryVpcFlowLogsConfigs` method.
16967#[derive(Clone, Default, PartialEq)]
16968#[non_exhaustive]
16969pub struct QueryOrgVpcFlowLogsConfigsResponse {
16970    /// List of VPC Flow Log configurations.
16971    pub vpc_flow_logs_configs: std::vec::Vec<crate::model::VpcFlowLogsConfig>,
16972
16973    /// Page token to fetch the next set of configurations.
16974    pub next_page_token: std::string::String,
16975
16976    /// Locations that could not be reached (when querying all locations with `-`).
16977    pub unreachable: std::vec::Vec<std::string::String>,
16978
16979    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16980}
16981
16982impl QueryOrgVpcFlowLogsConfigsResponse {
16983    pub fn new() -> Self {
16984        std::default::Default::default()
16985    }
16986
16987    /// Sets the value of [vpc_flow_logs_configs][crate::model::QueryOrgVpcFlowLogsConfigsResponse::vpc_flow_logs_configs].
16988    ///
16989    /// # Example
16990    /// ```ignore,no_run
16991    /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
16992    /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16993    /// let x = QueryOrgVpcFlowLogsConfigsResponse::new()
16994    ///     .set_vpc_flow_logs_configs([
16995    ///         VpcFlowLogsConfig::default()/* use setters */,
16996    ///         VpcFlowLogsConfig::default()/* use (different) setters */,
16997    ///     ]);
16998    /// ```
16999    pub fn set_vpc_flow_logs_configs<T, V>(mut self, v: T) -> Self
17000    where
17001        T: std::iter::IntoIterator<Item = V>,
17002        V: std::convert::Into<crate::model::VpcFlowLogsConfig>,
17003    {
17004        use std::iter::Iterator;
17005        self.vpc_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
17006        self
17007    }
17008
17009    /// Sets the value of [next_page_token][crate::model::QueryOrgVpcFlowLogsConfigsResponse::next_page_token].
17010    ///
17011    /// # Example
17012    /// ```ignore,no_run
17013    /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
17014    /// let x = QueryOrgVpcFlowLogsConfigsResponse::new().set_next_page_token("example");
17015    /// ```
17016    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17017        self.next_page_token = v.into();
17018        self
17019    }
17020
17021    /// Sets the value of [unreachable][crate::model::QueryOrgVpcFlowLogsConfigsResponse::unreachable].
17022    ///
17023    /// # Example
17024    /// ```ignore,no_run
17025    /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
17026    /// let x = QueryOrgVpcFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
17027    /// ```
17028    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17029    where
17030        T: std::iter::IntoIterator<Item = V>,
17031        V: std::convert::Into<std::string::String>,
17032    {
17033        use std::iter::Iterator;
17034        self.unreachable = v.into_iter().map(|i| i.into()).collect();
17035        self
17036    }
17037}
17038
17039impl wkt::message::Message for QueryOrgVpcFlowLogsConfigsResponse {
17040    fn typename() -> &'static str {
17041        "type.googleapis.com/google.cloud.networkmanagement.v1.QueryOrgVpcFlowLogsConfigsResponse"
17042    }
17043}
17044
17045#[doc(hidden)]
17046impl google_cloud_gax::paginator::internal::PageableResponse
17047    for QueryOrgVpcFlowLogsConfigsResponse
17048{
17049    type PageItem = crate::model::VpcFlowLogsConfig;
17050
17051    fn items(self) -> std::vec::Vec<Self::PageItem> {
17052        self.vpc_flow_logs_configs
17053    }
17054
17055    fn next_page_token(&self) -> std::string::String {
17056        use std::clone::Clone;
17057        self.next_page_token.clone()
17058    }
17059}
17060
17061/// Request for the `ShowEffectiveFlowLogsConfigs` method.
17062#[derive(Clone, Default, PartialEq)]
17063#[non_exhaustive]
17064pub struct ShowEffectiveFlowLogsConfigsRequest {
17065    /// Required. The parent resource of the VpcFlowLogsConfig, specified in
17066    /// the following format: `projects/{project_id}/locations/global`
17067    pub parent: std::string::String,
17068
17069    /// Required. The resource to get the effective VPC Flow Logs configuration
17070    /// for. The resource must belong to the same project as the parent. The
17071    /// resource must be a network, subnetwork, interconnect attachment, VPN
17072    /// tunnel, or a project.
17073    pub resource: std::string::String,
17074
17075    /// Optional. Number of `EffectiveVpcFlowLogsConfigs` to return. Default is 30.
17076    pub page_size: i32,
17077
17078    /// Optional. Page token from an earlier query, as returned in
17079    /// `next_page_token`.
17080    pub page_token: std::string::String,
17081
17082    /// Optional. Lists the `EffectiveVpcFlowLogsConfigs` that match the filter
17083    /// expression. A filter expression must use the supported [CEL logic
17084    /// operators]
17085    /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
17086    pub filter: std::string::String,
17087
17088    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17089}
17090
17091impl ShowEffectiveFlowLogsConfigsRequest {
17092    pub fn new() -> Self {
17093        std::default::Default::default()
17094    }
17095
17096    /// Sets the value of [parent][crate::model::ShowEffectiveFlowLogsConfigsRequest::parent].
17097    ///
17098    /// # Example
17099    /// ```ignore,no_run
17100    /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17101    /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_parent("example");
17102    /// ```
17103    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17104        self.parent = v.into();
17105        self
17106    }
17107
17108    /// Sets the value of [resource][crate::model::ShowEffectiveFlowLogsConfigsRequest::resource].
17109    ///
17110    /// # Example
17111    /// ```ignore,no_run
17112    /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17113    /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_resource("example");
17114    /// ```
17115    pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17116        self.resource = v.into();
17117        self
17118    }
17119
17120    /// Sets the value of [page_size][crate::model::ShowEffectiveFlowLogsConfigsRequest::page_size].
17121    ///
17122    /// # Example
17123    /// ```ignore,no_run
17124    /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17125    /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_page_size(42);
17126    /// ```
17127    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17128        self.page_size = v.into();
17129        self
17130    }
17131
17132    /// Sets the value of [page_token][crate::model::ShowEffectiveFlowLogsConfigsRequest::page_token].
17133    ///
17134    /// # Example
17135    /// ```ignore,no_run
17136    /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17137    /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_page_token("example");
17138    /// ```
17139    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17140        self.page_token = v.into();
17141        self
17142    }
17143
17144    /// Sets the value of [filter][crate::model::ShowEffectiveFlowLogsConfigsRequest::filter].
17145    ///
17146    /// # Example
17147    /// ```ignore,no_run
17148    /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17149    /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_filter("example");
17150    /// ```
17151    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17152        self.filter = v.into();
17153        self
17154    }
17155}
17156
17157impl wkt::message::Message for ShowEffectiveFlowLogsConfigsRequest {
17158    fn typename() -> &'static str {
17159        "type.googleapis.com/google.cloud.networkmanagement.v1.ShowEffectiveFlowLogsConfigsRequest"
17160    }
17161}
17162
17163/// Response for the `ShowEffectiveFlowLogsConfigs` method.
17164#[derive(Clone, Default, PartialEq)]
17165#[non_exhaustive]
17166pub struct ShowEffectiveFlowLogsConfigsResponse {
17167    /// List of Effective Vpc Flow Logs configurations.
17168    pub effective_flow_logs_configs: std::vec::Vec<crate::model::EffectiveVpcFlowLogsConfig>,
17169
17170    /// Page token to fetch the next set of configurations.
17171    pub next_page_token: std::string::String,
17172
17173    /// Locations that could not be reached (when querying all locations with `-`).
17174    pub unreachable: std::vec::Vec<std::string::String>,
17175
17176    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17177}
17178
17179impl ShowEffectiveFlowLogsConfigsResponse {
17180    pub fn new() -> Self {
17181        std::default::Default::default()
17182    }
17183
17184    /// Sets the value of [effective_flow_logs_configs][crate::model::ShowEffectiveFlowLogsConfigsResponse::effective_flow_logs_configs].
17185    ///
17186    /// # Example
17187    /// ```ignore,no_run
17188    /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
17189    /// use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17190    /// let x = ShowEffectiveFlowLogsConfigsResponse::new()
17191    ///     .set_effective_flow_logs_configs([
17192    ///         EffectiveVpcFlowLogsConfig::default()/* use setters */,
17193    ///         EffectiveVpcFlowLogsConfig::default()/* use (different) setters */,
17194    ///     ]);
17195    /// ```
17196    pub fn set_effective_flow_logs_configs<T, V>(mut self, v: T) -> Self
17197    where
17198        T: std::iter::IntoIterator<Item = V>,
17199        V: std::convert::Into<crate::model::EffectiveVpcFlowLogsConfig>,
17200    {
17201        use std::iter::Iterator;
17202        self.effective_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
17203        self
17204    }
17205
17206    /// Sets the value of [next_page_token][crate::model::ShowEffectiveFlowLogsConfigsResponse::next_page_token].
17207    ///
17208    /// # Example
17209    /// ```ignore,no_run
17210    /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
17211    /// let x = ShowEffectiveFlowLogsConfigsResponse::new().set_next_page_token("example");
17212    /// ```
17213    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17214        self.next_page_token = v.into();
17215        self
17216    }
17217
17218    /// Sets the value of [unreachable][crate::model::ShowEffectiveFlowLogsConfigsResponse::unreachable].
17219    ///
17220    /// # Example
17221    /// ```ignore,no_run
17222    /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
17223    /// let x = ShowEffectiveFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
17224    /// ```
17225    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17226    where
17227        T: std::iter::IntoIterator<Item = V>,
17228        V: std::convert::Into<std::string::String>,
17229    {
17230        use std::iter::Iterator;
17231        self.unreachable = v.into_iter().map(|i| i.into()).collect();
17232        self
17233    }
17234}
17235
17236impl wkt::message::Message for ShowEffectiveFlowLogsConfigsResponse {
17237    fn typename() -> &'static str {
17238        "type.googleapis.com/google.cloud.networkmanagement.v1.ShowEffectiveFlowLogsConfigsResponse"
17239    }
17240}
17241
17242#[doc(hidden)]
17243impl google_cloud_gax::paginator::internal::PageableResponse
17244    for ShowEffectiveFlowLogsConfigsResponse
17245{
17246    type PageItem = crate::model::EffectiveVpcFlowLogsConfig;
17247
17248    fn items(self) -> std::vec::Vec<Self::PageItem> {
17249        self.effective_flow_logs_configs
17250    }
17251
17252    fn next_page_token(&self) -> std::string::String {
17253        use std::clone::Clone;
17254        self.next_page_token.clone()
17255    }
17256}
17257
17258/// A configuration to generate VPC Flow Logs.
17259#[derive(Clone, Default, PartialEq)]
17260#[non_exhaustive]
17261pub struct VpcFlowLogsConfig {
17262    /// Identifier. Unique name of the configuration. The name can have one of the
17263    /// following forms:
17264    ///
17265    /// - For project-level configurations:
17266    ///   `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
17267    ///
17268    /// - For organization-level configurations:
17269    ///   `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
17270    ///
17271    pub name: std::string::String,
17272
17273    /// Optional. The user-supplied description of the VPC Flow Logs configuration.
17274    /// Maximum of 512 characters.
17275    pub description: std::option::Option<std::string::String>,
17276
17277    /// Optional. The state of the VPC Flow Log configuration. Default value is
17278    /// ENABLED. When creating a new configuration, it must be enabled. Setting
17279    /// state=DISABLED will pause the log generation for this config.
17280    pub state: std::option::Option<crate::model::vpc_flow_logs_config::State>,
17281
17282    /// Optional. The aggregation interval for the logs. Default value is
17283    /// INTERVAL_5_SEC.
17284    pub aggregation_interval:
17285        std::option::Option<crate::model::vpc_flow_logs_config::AggregationInterval>,
17286
17287    /// Optional. The value of the field must be in (0, 1]. The sampling rate of
17288    /// VPC Flow Logs where 1.0 means all collected logs are reported. Setting the
17289    /// sampling rate to 0.0 is not allowed. If you want to disable VPC Flow Logs,
17290    /// use the state field instead. Default value is 1.0.
17291    pub flow_sampling: std::option::Option<f32>,
17292
17293    /// Optional. Configures whether all, none or a subset of metadata fields
17294    /// should be added to the reported VPC flow logs. Default value is
17295    /// INCLUDE_ALL_METADATA.
17296    pub metadata: std::option::Option<crate::model::vpc_flow_logs_config::Metadata>,
17297
17298    /// Optional. Custom metadata fields to include in the reported VPC flow logs.
17299    /// Can only be specified if "metadata" was set to CUSTOM_METADATA.
17300    pub metadata_fields: std::vec::Vec<std::string::String>,
17301
17302    /// Optional. Export filter used to define which VPC Flow Logs should be
17303    /// logged.
17304    pub filter_expr: std::option::Option<std::string::String>,
17305
17306    /// Optional. Determines whether to include cross project annotations in the
17307    /// logs. This field is available only for organization configurations. If not
17308    /// specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
17309    pub cross_project_metadata:
17310        std::option::Option<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
17311
17312    /// Output only. Describes the state of the configured target resource for
17313    /// diagnostic purposes.
17314    pub target_resource_state:
17315        std::option::Option<crate::model::vpc_flow_logs_config::TargetResourceState>,
17316
17317    /// Optional. Resource labels to represent user-provided metadata.
17318    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
17319
17320    /// Output only. The time the config was created.
17321    pub create_time: std::option::Option<wkt::Timestamp>,
17322
17323    /// Output only. The time the config was updated.
17324    pub update_time: std::option::Option<wkt::Timestamp>,
17325
17326    /// Reference to the resource of the config scope. That is, the scope from
17327    /// which traffic is logged. The target resource must belong to the same
17328    /// project as the configuration.
17329    /// This field is not supported for organization level configurations.
17330    pub target_resource: std::option::Option<crate::model::vpc_flow_logs_config::TargetResource>,
17331
17332    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17333}
17334
17335impl VpcFlowLogsConfig {
17336    pub fn new() -> Self {
17337        std::default::Default::default()
17338    }
17339
17340    /// Sets the value of [name][crate::model::VpcFlowLogsConfig::name].
17341    ///
17342    /// # Example
17343    /// ```ignore,no_run
17344    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17345    /// let x = VpcFlowLogsConfig::new().set_name("example");
17346    /// ```
17347    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17348        self.name = v.into();
17349        self
17350    }
17351
17352    /// Sets the value of [description][crate::model::VpcFlowLogsConfig::description].
17353    ///
17354    /// # Example
17355    /// ```ignore,no_run
17356    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17357    /// let x = VpcFlowLogsConfig::new().set_description("example");
17358    /// ```
17359    pub fn set_description<T>(mut self, v: T) -> Self
17360    where
17361        T: std::convert::Into<std::string::String>,
17362    {
17363        self.description = std::option::Option::Some(v.into());
17364        self
17365    }
17366
17367    /// Sets or clears the value of [description][crate::model::VpcFlowLogsConfig::description].
17368    ///
17369    /// # Example
17370    /// ```ignore,no_run
17371    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17372    /// let x = VpcFlowLogsConfig::new().set_or_clear_description(Some("example"));
17373    /// let x = VpcFlowLogsConfig::new().set_or_clear_description(None::<String>);
17374    /// ```
17375    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
17376    where
17377        T: std::convert::Into<std::string::String>,
17378    {
17379        self.description = v.map(|x| x.into());
17380        self
17381    }
17382
17383    /// Sets the value of [state][crate::model::VpcFlowLogsConfig::state].
17384    ///
17385    /// # Example
17386    /// ```ignore,no_run
17387    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17388    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
17389    /// let x0 = VpcFlowLogsConfig::new().set_state(State::Enabled);
17390    /// let x1 = VpcFlowLogsConfig::new().set_state(State::Disabled);
17391    /// ```
17392    pub fn set_state<T>(mut self, v: T) -> Self
17393    where
17394        T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
17395    {
17396        self.state = std::option::Option::Some(v.into());
17397        self
17398    }
17399
17400    /// Sets or clears the value of [state][crate::model::VpcFlowLogsConfig::state].
17401    ///
17402    /// # Example
17403    /// ```ignore,no_run
17404    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17405    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
17406    /// let x0 = VpcFlowLogsConfig::new().set_or_clear_state(Some(State::Enabled));
17407    /// let x1 = VpcFlowLogsConfig::new().set_or_clear_state(Some(State::Disabled));
17408    /// let x_none = VpcFlowLogsConfig::new().set_or_clear_state(None::<State>);
17409    /// ```
17410    pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
17411    where
17412        T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
17413    {
17414        self.state = v.map(|x| x.into());
17415        self
17416    }
17417
17418    /// Sets the value of [aggregation_interval][crate::model::VpcFlowLogsConfig::aggregation_interval].
17419    ///
17420    /// # Example
17421    /// ```ignore,no_run
17422    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17423    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
17424    /// let x0 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval5Sec);
17425    /// let x1 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval30Sec);
17426    /// let x2 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval1Min);
17427    /// ```
17428    pub fn set_aggregation_interval<T>(mut self, v: T) -> Self
17429    where
17430        T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
17431    {
17432        self.aggregation_interval = std::option::Option::Some(v.into());
17433        self
17434    }
17435
17436    /// Sets or clears the value of [aggregation_interval][crate::model::VpcFlowLogsConfig::aggregation_interval].
17437    ///
17438    /// # Example
17439    /// ```ignore,no_run
17440    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17441    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
17442    /// let x0 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval5Sec));
17443    /// let x1 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval30Sec));
17444    /// let x2 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval1Min));
17445    /// let x_none = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(None::<AggregationInterval>);
17446    /// ```
17447    pub fn set_or_clear_aggregation_interval<T>(mut self, v: std::option::Option<T>) -> Self
17448    where
17449        T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
17450    {
17451        self.aggregation_interval = v.map(|x| x.into());
17452        self
17453    }
17454
17455    /// Sets the value of [flow_sampling][crate::model::VpcFlowLogsConfig::flow_sampling].
17456    ///
17457    /// # Example
17458    /// ```ignore,no_run
17459    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17460    /// let x = VpcFlowLogsConfig::new().set_flow_sampling(42.0);
17461    /// ```
17462    pub fn set_flow_sampling<T>(mut self, v: T) -> Self
17463    where
17464        T: std::convert::Into<f32>,
17465    {
17466        self.flow_sampling = std::option::Option::Some(v.into());
17467        self
17468    }
17469
17470    /// Sets or clears the value of [flow_sampling][crate::model::VpcFlowLogsConfig::flow_sampling].
17471    ///
17472    /// # Example
17473    /// ```ignore,no_run
17474    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17475    /// let x = VpcFlowLogsConfig::new().set_or_clear_flow_sampling(Some(42.0));
17476    /// let x = VpcFlowLogsConfig::new().set_or_clear_flow_sampling(None::<f32>);
17477    /// ```
17478    pub fn set_or_clear_flow_sampling<T>(mut self, v: std::option::Option<T>) -> Self
17479    where
17480        T: std::convert::Into<f32>,
17481    {
17482        self.flow_sampling = v.map(|x| x.into());
17483        self
17484    }
17485
17486    /// Sets the value of [metadata][crate::model::VpcFlowLogsConfig::metadata].
17487    ///
17488    /// # Example
17489    /// ```ignore,no_run
17490    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17491    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
17492    /// let x0 = VpcFlowLogsConfig::new().set_metadata(Metadata::IncludeAllMetadata);
17493    /// let x1 = VpcFlowLogsConfig::new().set_metadata(Metadata::ExcludeAllMetadata);
17494    /// let x2 = VpcFlowLogsConfig::new().set_metadata(Metadata::CustomMetadata);
17495    /// ```
17496    pub fn set_metadata<T>(mut self, v: T) -> Self
17497    where
17498        T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
17499    {
17500        self.metadata = std::option::Option::Some(v.into());
17501        self
17502    }
17503
17504    /// Sets or clears the value of [metadata][crate::model::VpcFlowLogsConfig::metadata].
17505    ///
17506    /// # Example
17507    /// ```ignore,no_run
17508    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17509    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
17510    /// let x0 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::IncludeAllMetadata));
17511    /// let x1 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::ExcludeAllMetadata));
17512    /// let x2 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::CustomMetadata));
17513    /// let x_none = VpcFlowLogsConfig::new().set_or_clear_metadata(None::<Metadata>);
17514    /// ```
17515    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
17516    where
17517        T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
17518    {
17519        self.metadata = v.map(|x| x.into());
17520        self
17521    }
17522
17523    /// Sets the value of [metadata_fields][crate::model::VpcFlowLogsConfig::metadata_fields].
17524    ///
17525    /// # Example
17526    /// ```ignore,no_run
17527    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17528    /// let x = VpcFlowLogsConfig::new().set_metadata_fields(["a", "b", "c"]);
17529    /// ```
17530    pub fn set_metadata_fields<T, V>(mut self, v: T) -> Self
17531    where
17532        T: std::iter::IntoIterator<Item = V>,
17533        V: std::convert::Into<std::string::String>,
17534    {
17535        use std::iter::Iterator;
17536        self.metadata_fields = v.into_iter().map(|i| i.into()).collect();
17537        self
17538    }
17539
17540    /// Sets the value of [filter_expr][crate::model::VpcFlowLogsConfig::filter_expr].
17541    ///
17542    /// # Example
17543    /// ```ignore,no_run
17544    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17545    /// let x = VpcFlowLogsConfig::new().set_filter_expr("example");
17546    /// ```
17547    pub fn set_filter_expr<T>(mut self, v: T) -> Self
17548    where
17549        T: std::convert::Into<std::string::String>,
17550    {
17551        self.filter_expr = std::option::Option::Some(v.into());
17552        self
17553    }
17554
17555    /// Sets or clears the value of [filter_expr][crate::model::VpcFlowLogsConfig::filter_expr].
17556    ///
17557    /// # Example
17558    /// ```ignore,no_run
17559    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17560    /// let x = VpcFlowLogsConfig::new().set_or_clear_filter_expr(Some("example"));
17561    /// let x = VpcFlowLogsConfig::new().set_or_clear_filter_expr(None::<String>);
17562    /// ```
17563    pub fn set_or_clear_filter_expr<T>(mut self, v: std::option::Option<T>) -> Self
17564    where
17565        T: std::convert::Into<std::string::String>,
17566    {
17567        self.filter_expr = v.map(|x| x.into());
17568        self
17569    }
17570
17571    /// Sets the value of [cross_project_metadata][crate::model::VpcFlowLogsConfig::cross_project_metadata].
17572    ///
17573    /// # Example
17574    /// ```ignore,no_run
17575    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17576    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
17577    /// let x0 = VpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Enabled);
17578    /// let x1 = VpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Disabled);
17579    /// ```
17580    pub fn set_cross_project_metadata<T>(mut self, v: T) -> Self
17581    where
17582        T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
17583    {
17584        self.cross_project_metadata = std::option::Option::Some(v.into());
17585        self
17586    }
17587
17588    /// Sets or clears the value of [cross_project_metadata][crate::model::VpcFlowLogsConfig::cross_project_metadata].
17589    ///
17590    /// # Example
17591    /// ```ignore,no_run
17592    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17593    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
17594    /// let x0 = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Enabled));
17595    /// let x1 = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Disabled));
17596    /// let x_none = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(None::<CrossProjectMetadata>);
17597    /// ```
17598    pub fn set_or_clear_cross_project_metadata<T>(mut self, v: std::option::Option<T>) -> Self
17599    where
17600        T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
17601    {
17602        self.cross_project_metadata = v.map(|x| x.into());
17603        self
17604    }
17605
17606    /// Sets the value of [target_resource_state][crate::model::VpcFlowLogsConfig::target_resource_state].
17607    ///
17608    /// # Example
17609    /// ```ignore,no_run
17610    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17611    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResourceState;
17612    /// let x0 = VpcFlowLogsConfig::new().set_target_resource_state(TargetResourceState::TargetResourceExists);
17613    /// let x1 = VpcFlowLogsConfig::new().set_target_resource_state(TargetResourceState::TargetResourceDoesNotExist);
17614    /// ```
17615    pub fn set_target_resource_state<T>(mut self, v: T) -> Self
17616    where
17617        T: std::convert::Into<crate::model::vpc_flow_logs_config::TargetResourceState>,
17618    {
17619        self.target_resource_state = std::option::Option::Some(v.into());
17620        self
17621    }
17622
17623    /// Sets or clears the value of [target_resource_state][crate::model::VpcFlowLogsConfig::target_resource_state].
17624    ///
17625    /// # Example
17626    /// ```ignore,no_run
17627    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17628    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResourceState;
17629    /// let x0 = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(Some(TargetResourceState::TargetResourceExists));
17630    /// let x1 = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(Some(TargetResourceState::TargetResourceDoesNotExist));
17631    /// let x_none = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(None::<TargetResourceState>);
17632    /// ```
17633    pub fn set_or_clear_target_resource_state<T>(mut self, v: std::option::Option<T>) -> Self
17634    where
17635        T: std::convert::Into<crate::model::vpc_flow_logs_config::TargetResourceState>,
17636    {
17637        self.target_resource_state = v.map(|x| x.into());
17638        self
17639    }
17640
17641    /// Sets the value of [labels][crate::model::VpcFlowLogsConfig::labels].
17642    ///
17643    /// # Example
17644    /// ```ignore,no_run
17645    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17646    /// let x = VpcFlowLogsConfig::new().set_labels([
17647    ///     ("key0", "abc"),
17648    ///     ("key1", "xyz"),
17649    /// ]);
17650    /// ```
17651    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
17652    where
17653        T: std::iter::IntoIterator<Item = (K, V)>,
17654        K: std::convert::Into<std::string::String>,
17655        V: std::convert::Into<std::string::String>,
17656    {
17657        use std::iter::Iterator;
17658        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17659        self
17660    }
17661
17662    /// Sets the value of [create_time][crate::model::VpcFlowLogsConfig::create_time].
17663    ///
17664    /// # Example
17665    /// ```ignore,no_run
17666    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17667    /// use wkt::Timestamp;
17668    /// let x = VpcFlowLogsConfig::new().set_create_time(Timestamp::default()/* use setters */);
17669    /// ```
17670    pub fn set_create_time<T>(mut self, v: T) -> Self
17671    where
17672        T: std::convert::Into<wkt::Timestamp>,
17673    {
17674        self.create_time = std::option::Option::Some(v.into());
17675        self
17676    }
17677
17678    /// Sets or clears the value of [create_time][crate::model::VpcFlowLogsConfig::create_time].
17679    ///
17680    /// # Example
17681    /// ```ignore,no_run
17682    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17683    /// use wkt::Timestamp;
17684    /// let x = VpcFlowLogsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17685    /// let x = VpcFlowLogsConfig::new().set_or_clear_create_time(None::<Timestamp>);
17686    /// ```
17687    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17688    where
17689        T: std::convert::Into<wkt::Timestamp>,
17690    {
17691        self.create_time = v.map(|x| x.into());
17692        self
17693    }
17694
17695    /// Sets the value of [update_time][crate::model::VpcFlowLogsConfig::update_time].
17696    ///
17697    /// # Example
17698    /// ```ignore,no_run
17699    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17700    /// use wkt::Timestamp;
17701    /// let x = VpcFlowLogsConfig::new().set_update_time(Timestamp::default()/* use setters */);
17702    /// ```
17703    pub fn set_update_time<T>(mut self, v: T) -> Self
17704    where
17705        T: std::convert::Into<wkt::Timestamp>,
17706    {
17707        self.update_time = std::option::Option::Some(v.into());
17708        self
17709    }
17710
17711    /// Sets or clears the value of [update_time][crate::model::VpcFlowLogsConfig::update_time].
17712    ///
17713    /// # Example
17714    /// ```ignore,no_run
17715    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17716    /// use wkt::Timestamp;
17717    /// let x = VpcFlowLogsConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
17718    /// let x = VpcFlowLogsConfig::new().set_or_clear_update_time(None::<Timestamp>);
17719    /// ```
17720    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
17721    where
17722        T: std::convert::Into<wkt::Timestamp>,
17723    {
17724        self.update_time = v.map(|x| x.into());
17725        self
17726    }
17727
17728    /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource].
17729    ///
17730    /// Note that all the setters affecting `target_resource` are mutually
17731    /// exclusive.
17732    ///
17733    /// # Example
17734    /// ```ignore,no_run
17735    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17736    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResource;
17737    /// let x = VpcFlowLogsConfig::new().set_target_resource(Some(TargetResource::Network("example".to_string())));
17738    /// ```
17739    pub fn set_target_resource<
17740        T: std::convert::Into<std::option::Option<crate::model::vpc_flow_logs_config::TargetResource>>,
17741    >(
17742        mut self,
17743        v: T,
17744    ) -> Self {
17745        self.target_resource = v.into();
17746        self
17747    }
17748
17749    /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17750    /// if it holds a `Network`, `None` if the field is not set or
17751    /// holds a different branch.
17752    pub fn network(&self) -> std::option::Option<&std::string::String> {
17753        #[allow(unreachable_patterns)]
17754        self.target_resource.as_ref().and_then(|v| match v {
17755            crate::model::vpc_flow_logs_config::TargetResource::Network(v) => {
17756                std::option::Option::Some(v)
17757            }
17758            _ => std::option::Option::None,
17759        })
17760    }
17761
17762    /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17763    /// to hold a `Network`.
17764    ///
17765    /// Note that all the setters affecting `target_resource` are
17766    /// mutually exclusive.
17767    ///
17768    /// # Example
17769    /// ```ignore,no_run
17770    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17771    /// let x = VpcFlowLogsConfig::new().set_network("example");
17772    /// assert!(x.network().is_some());
17773    /// assert!(x.subnet().is_none());
17774    /// assert!(x.interconnect_attachment().is_none());
17775    /// assert!(x.vpn_tunnel().is_none());
17776    /// ```
17777    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17778        self.target_resource = std::option::Option::Some(
17779            crate::model::vpc_flow_logs_config::TargetResource::Network(v.into()),
17780        );
17781        self
17782    }
17783
17784    /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17785    /// if it holds a `Subnet`, `None` if the field is not set or
17786    /// holds a different branch.
17787    pub fn subnet(&self) -> std::option::Option<&std::string::String> {
17788        #[allow(unreachable_patterns)]
17789        self.target_resource.as_ref().and_then(|v| match v {
17790            crate::model::vpc_flow_logs_config::TargetResource::Subnet(v) => {
17791                std::option::Option::Some(v)
17792            }
17793            _ => std::option::Option::None,
17794        })
17795    }
17796
17797    /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17798    /// to hold a `Subnet`.
17799    ///
17800    /// Note that all the setters affecting `target_resource` are
17801    /// mutually exclusive.
17802    ///
17803    /// # Example
17804    /// ```ignore,no_run
17805    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17806    /// let x = VpcFlowLogsConfig::new().set_subnet("example");
17807    /// assert!(x.subnet().is_some());
17808    /// assert!(x.network().is_none());
17809    /// assert!(x.interconnect_attachment().is_none());
17810    /// assert!(x.vpn_tunnel().is_none());
17811    /// ```
17812    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17813        self.target_resource = std::option::Option::Some(
17814            crate::model::vpc_flow_logs_config::TargetResource::Subnet(v.into()),
17815        );
17816        self
17817    }
17818
17819    /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17820    /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
17821    /// holds a different branch.
17822    pub fn interconnect_attachment(&self) -> std::option::Option<&std::string::String> {
17823        #[allow(unreachable_patterns)]
17824        self.target_resource.as_ref().and_then(|v| match v {
17825            crate::model::vpc_flow_logs_config::TargetResource::InterconnectAttachment(v) => {
17826                std::option::Option::Some(v)
17827            }
17828            _ => std::option::Option::None,
17829        })
17830    }
17831
17832    /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17833    /// to hold a `InterconnectAttachment`.
17834    ///
17835    /// Note that all the setters affecting `target_resource` are
17836    /// mutually exclusive.
17837    ///
17838    /// # Example
17839    /// ```ignore,no_run
17840    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17841    /// let x = VpcFlowLogsConfig::new().set_interconnect_attachment("example");
17842    /// assert!(x.interconnect_attachment().is_some());
17843    /// assert!(x.network().is_none());
17844    /// assert!(x.subnet().is_none());
17845    /// assert!(x.vpn_tunnel().is_none());
17846    /// ```
17847    pub fn set_interconnect_attachment<T: std::convert::Into<std::string::String>>(
17848        mut self,
17849        v: T,
17850    ) -> Self {
17851        self.target_resource = std::option::Option::Some(
17852            crate::model::vpc_flow_logs_config::TargetResource::InterconnectAttachment(v.into()),
17853        );
17854        self
17855    }
17856
17857    /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17858    /// if it holds a `VpnTunnel`, `None` if the field is not set or
17859    /// holds a different branch.
17860    pub fn vpn_tunnel(&self) -> std::option::Option<&std::string::String> {
17861        #[allow(unreachable_patterns)]
17862        self.target_resource.as_ref().and_then(|v| match v {
17863            crate::model::vpc_flow_logs_config::TargetResource::VpnTunnel(v) => {
17864                std::option::Option::Some(v)
17865            }
17866            _ => std::option::Option::None,
17867        })
17868    }
17869
17870    /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17871    /// to hold a `VpnTunnel`.
17872    ///
17873    /// Note that all the setters affecting `target_resource` are
17874    /// mutually exclusive.
17875    ///
17876    /// # Example
17877    /// ```ignore,no_run
17878    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17879    /// let x = VpcFlowLogsConfig::new().set_vpn_tunnel("example");
17880    /// assert!(x.vpn_tunnel().is_some());
17881    /// assert!(x.network().is_none());
17882    /// assert!(x.subnet().is_none());
17883    /// assert!(x.interconnect_attachment().is_none());
17884    /// ```
17885    pub fn set_vpn_tunnel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17886        self.target_resource = std::option::Option::Some(
17887            crate::model::vpc_flow_logs_config::TargetResource::VpnTunnel(v.into()),
17888        );
17889        self
17890    }
17891}
17892
17893impl wkt::message::Message for VpcFlowLogsConfig {
17894    fn typename() -> &'static str {
17895        "type.googleapis.com/google.cloud.networkmanagement.v1.VpcFlowLogsConfig"
17896    }
17897}
17898
17899/// Defines additional types related to [VpcFlowLogsConfig].
17900pub mod vpc_flow_logs_config {
17901    #[allow(unused_imports)]
17902    use super::*;
17903
17904    /// Determines whether this configuration will be generating logs.
17905    ///
17906    /// # Working with unknown values
17907    ///
17908    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17909    /// additional enum variants at any time. Adding new variants is not considered
17910    /// a breaking change. Applications should write their code in anticipation of:
17911    ///
17912    /// - New values appearing in future releases of the client library, **and**
17913    /// - New values received dynamically, without application changes.
17914    ///
17915    /// Please consult the [Working with enums] section in the user guide for some
17916    /// guidelines.
17917    ///
17918    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17919    #[derive(Clone, Debug, PartialEq)]
17920    #[non_exhaustive]
17921    pub enum State {
17922        /// If not specified, will default to ENABLED.
17923        Unspecified,
17924        /// When ENABLED, this configuration will generate logs.
17925        Enabled,
17926        /// When DISABLED, this configuration will not generate logs.
17927        Disabled,
17928        /// If set, the enum was initialized with an unknown value.
17929        ///
17930        /// Applications can examine the value using [State::value] or
17931        /// [State::name].
17932        UnknownValue(state::UnknownValue),
17933    }
17934
17935    #[doc(hidden)]
17936    pub mod state {
17937        #[allow(unused_imports)]
17938        use super::*;
17939        #[derive(Clone, Debug, PartialEq)]
17940        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17941    }
17942
17943    impl State {
17944        /// Gets the enum value.
17945        ///
17946        /// Returns `None` if the enum contains an unknown value deserialized from
17947        /// the string representation of enums.
17948        pub fn value(&self) -> std::option::Option<i32> {
17949            match self {
17950                Self::Unspecified => std::option::Option::Some(0),
17951                Self::Enabled => std::option::Option::Some(1),
17952                Self::Disabled => std::option::Option::Some(2),
17953                Self::UnknownValue(u) => u.0.value(),
17954            }
17955        }
17956
17957        /// Gets the enum value as a string.
17958        ///
17959        /// Returns `None` if the enum contains an unknown value deserialized from
17960        /// the integer representation of enums.
17961        pub fn name(&self) -> std::option::Option<&str> {
17962            match self {
17963                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17964                Self::Enabled => std::option::Option::Some("ENABLED"),
17965                Self::Disabled => std::option::Option::Some("DISABLED"),
17966                Self::UnknownValue(u) => u.0.name(),
17967            }
17968        }
17969    }
17970
17971    impl std::default::Default for State {
17972        fn default() -> Self {
17973            use std::convert::From;
17974            Self::from(0)
17975        }
17976    }
17977
17978    impl std::fmt::Display for State {
17979        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17980            wkt::internal::display_enum(f, self.name(), self.value())
17981        }
17982    }
17983
17984    impl std::convert::From<i32> for State {
17985        fn from(value: i32) -> Self {
17986            match value {
17987                0 => Self::Unspecified,
17988                1 => Self::Enabled,
17989                2 => Self::Disabled,
17990                _ => Self::UnknownValue(state::UnknownValue(
17991                    wkt::internal::UnknownEnumValue::Integer(value),
17992                )),
17993            }
17994        }
17995    }
17996
17997    impl std::convert::From<&str> for State {
17998        fn from(value: &str) -> Self {
17999            use std::string::ToString;
18000            match value {
18001                "STATE_UNSPECIFIED" => Self::Unspecified,
18002                "ENABLED" => Self::Enabled,
18003                "DISABLED" => Self::Disabled,
18004                _ => Self::UnknownValue(state::UnknownValue(
18005                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18006                )),
18007            }
18008        }
18009    }
18010
18011    impl serde::ser::Serialize for State {
18012        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18013        where
18014            S: serde::Serializer,
18015        {
18016            match self {
18017                Self::Unspecified => serializer.serialize_i32(0),
18018                Self::Enabled => serializer.serialize_i32(1),
18019                Self::Disabled => serializer.serialize_i32(2),
18020                Self::UnknownValue(u) => u.0.serialize(serializer),
18021            }
18022        }
18023    }
18024
18025    impl<'de> serde::de::Deserialize<'de> for State {
18026        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18027        where
18028            D: serde::Deserializer<'de>,
18029        {
18030            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18031                ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.State",
18032            ))
18033        }
18034    }
18035
18036    /// Toggles the aggregation interval for collecting flow logs by 5-tuple.
18037    ///
18038    /// # Working with unknown values
18039    ///
18040    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18041    /// additional enum variants at any time. Adding new variants is not considered
18042    /// a breaking change. Applications should write their code in anticipation of:
18043    ///
18044    /// - New values appearing in future releases of the client library, **and**
18045    /// - New values received dynamically, without application changes.
18046    ///
18047    /// Please consult the [Working with enums] section in the user guide for some
18048    /// guidelines.
18049    ///
18050    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18051    #[derive(Clone, Debug, PartialEq)]
18052    #[non_exhaustive]
18053    pub enum AggregationInterval {
18054        /// If not specified, will default to INTERVAL_5_SEC.
18055        Unspecified,
18056        /// Aggregate logs in 5s intervals.
18057        Interval5Sec,
18058        /// Aggregate logs in 30s intervals.
18059        Interval30Sec,
18060        /// Aggregate logs in 1m intervals.
18061        Interval1Min,
18062        /// Aggregate logs in 5m intervals.
18063        Interval5Min,
18064        /// Aggregate logs in 10m intervals.
18065        Interval10Min,
18066        /// Aggregate logs in 15m intervals.
18067        Interval15Min,
18068        /// If set, the enum was initialized with an unknown value.
18069        ///
18070        /// Applications can examine the value using [AggregationInterval::value] or
18071        /// [AggregationInterval::name].
18072        UnknownValue(aggregation_interval::UnknownValue),
18073    }
18074
18075    #[doc(hidden)]
18076    pub mod aggregation_interval {
18077        #[allow(unused_imports)]
18078        use super::*;
18079        #[derive(Clone, Debug, PartialEq)]
18080        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18081    }
18082
18083    impl AggregationInterval {
18084        /// Gets the enum value.
18085        ///
18086        /// Returns `None` if the enum contains an unknown value deserialized from
18087        /// the string representation of enums.
18088        pub fn value(&self) -> std::option::Option<i32> {
18089            match self {
18090                Self::Unspecified => std::option::Option::Some(0),
18091                Self::Interval5Sec => std::option::Option::Some(1),
18092                Self::Interval30Sec => std::option::Option::Some(2),
18093                Self::Interval1Min => std::option::Option::Some(3),
18094                Self::Interval5Min => std::option::Option::Some(4),
18095                Self::Interval10Min => std::option::Option::Some(5),
18096                Self::Interval15Min => std::option::Option::Some(6),
18097                Self::UnknownValue(u) => u.0.value(),
18098            }
18099        }
18100
18101        /// Gets the enum value as a string.
18102        ///
18103        /// Returns `None` if the enum contains an unknown value deserialized from
18104        /// the integer representation of enums.
18105        pub fn name(&self) -> std::option::Option<&str> {
18106            match self {
18107                Self::Unspecified => std::option::Option::Some("AGGREGATION_INTERVAL_UNSPECIFIED"),
18108                Self::Interval5Sec => std::option::Option::Some("INTERVAL_5_SEC"),
18109                Self::Interval30Sec => std::option::Option::Some("INTERVAL_30_SEC"),
18110                Self::Interval1Min => std::option::Option::Some("INTERVAL_1_MIN"),
18111                Self::Interval5Min => std::option::Option::Some("INTERVAL_5_MIN"),
18112                Self::Interval10Min => std::option::Option::Some("INTERVAL_10_MIN"),
18113                Self::Interval15Min => std::option::Option::Some("INTERVAL_15_MIN"),
18114                Self::UnknownValue(u) => u.0.name(),
18115            }
18116        }
18117    }
18118
18119    impl std::default::Default for AggregationInterval {
18120        fn default() -> Self {
18121            use std::convert::From;
18122            Self::from(0)
18123        }
18124    }
18125
18126    impl std::fmt::Display for AggregationInterval {
18127        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18128            wkt::internal::display_enum(f, self.name(), self.value())
18129        }
18130    }
18131
18132    impl std::convert::From<i32> for AggregationInterval {
18133        fn from(value: i32) -> Self {
18134            match value {
18135                0 => Self::Unspecified,
18136                1 => Self::Interval5Sec,
18137                2 => Self::Interval30Sec,
18138                3 => Self::Interval1Min,
18139                4 => Self::Interval5Min,
18140                5 => Self::Interval10Min,
18141                6 => Self::Interval15Min,
18142                _ => Self::UnknownValue(aggregation_interval::UnknownValue(
18143                    wkt::internal::UnknownEnumValue::Integer(value),
18144                )),
18145            }
18146        }
18147    }
18148
18149    impl std::convert::From<&str> for AggregationInterval {
18150        fn from(value: &str) -> Self {
18151            use std::string::ToString;
18152            match value {
18153                "AGGREGATION_INTERVAL_UNSPECIFIED" => Self::Unspecified,
18154                "INTERVAL_5_SEC" => Self::Interval5Sec,
18155                "INTERVAL_30_SEC" => Self::Interval30Sec,
18156                "INTERVAL_1_MIN" => Self::Interval1Min,
18157                "INTERVAL_5_MIN" => Self::Interval5Min,
18158                "INTERVAL_10_MIN" => Self::Interval10Min,
18159                "INTERVAL_15_MIN" => Self::Interval15Min,
18160                _ => Self::UnknownValue(aggregation_interval::UnknownValue(
18161                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18162                )),
18163            }
18164        }
18165    }
18166
18167    impl serde::ser::Serialize for AggregationInterval {
18168        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18169        where
18170            S: serde::Serializer,
18171        {
18172            match self {
18173                Self::Unspecified => serializer.serialize_i32(0),
18174                Self::Interval5Sec => serializer.serialize_i32(1),
18175                Self::Interval30Sec => serializer.serialize_i32(2),
18176                Self::Interval1Min => serializer.serialize_i32(3),
18177                Self::Interval5Min => serializer.serialize_i32(4),
18178                Self::Interval10Min => serializer.serialize_i32(5),
18179                Self::Interval15Min => serializer.serialize_i32(6),
18180                Self::UnknownValue(u) => u.0.serialize(serializer),
18181            }
18182        }
18183    }
18184
18185    impl<'de> serde::de::Deserialize<'de> for AggregationInterval {
18186        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18187        where
18188            D: serde::Deserializer<'de>,
18189        {
18190            deserializer.deserialize_any(wkt::internal::EnumVisitor::<AggregationInterval>::new(
18191                ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.AggregationInterval",
18192            ))
18193        }
18194    }
18195
18196    /// Configures which log fields would be included.
18197    ///
18198    /// # Working with unknown values
18199    ///
18200    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18201    /// additional enum variants at any time. Adding new variants is not considered
18202    /// a breaking change. Applications should write their code in anticipation of:
18203    ///
18204    /// - New values appearing in future releases of the client library, **and**
18205    /// - New values received dynamically, without application changes.
18206    ///
18207    /// Please consult the [Working with enums] section in the user guide for some
18208    /// guidelines.
18209    ///
18210    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18211    #[derive(Clone, Debug, PartialEq)]
18212    #[non_exhaustive]
18213    pub enum Metadata {
18214        /// If not specified, will default to INCLUDE_ALL_METADATA.
18215        Unspecified,
18216        /// Include all metadata fields.
18217        IncludeAllMetadata,
18218        /// Exclude all metadata fields.
18219        ExcludeAllMetadata,
18220        /// Include only custom fields (specified in metadata_fields).
18221        CustomMetadata,
18222        /// If set, the enum was initialized with an unknown value.
18223        ///
18224        /// Applications can examine the value using [Metadata::value] or
18225        /// [Metadata::name].
18226        UnknownValue(metadata::UnknownValue),
18227    }
18228
18229    #[doc(hidden)]
18230    pub mod metadata {
18231        #[allow(unused_imports)]
18232        use super::*;
18233        #[derive(Clone, Debug, PartialEq)]
18234        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18235    }
18236
18237    impl Metadata {
18238        /// Gets the enum value.
18239        ///
18240        /// Returns `None` if the enum contains an unknown value deserialized from
18241        /// the string representation of enums.
18242        pub fn value(&self) -> std::option::Option<i32> {
18243            match self {
18244                Self::Unspecified => std::option::Option::Some(0),
18245                Self::IncludeAllMetadata => std::option::Option::Some(1),
18246                Self::ExcludeAllMetadata => std::option::Option::Some(2),
18247                Self::CustomMetadata => std::option::Option::Some(3),
18248                Self::UnknownValue(u) => u.0.value(),
18249            }
18250        }
18251
18252        /// Gets the enum value as a string.
18253        ///
18254        /// Returns `None` if the enum contains an unknown value deserialized from
18255        /// the integer representation of enums.
18256        pub fn name(&self) -> std::option::Option<&str> {
18257            match self {
18258                Self::Unspecified => std::option::Option::Some("METADATA_UNSPECIFIED"),
18259                Self::IncludeAllMetadata => std::option::Option::Some("INCLUDE_ALL_METADATA"),
18260                Self::ExcludeAllMetadata => std::option::Option::Some("EXCLUDE_ALL_METADATA"),
18261                Self::CustomMetadata => std::option::Option::Some("CUSTOM_METADATA"),
18262                Self::UnknownValue(u) => u.0.name(),
18263            }
18264        }
18265    }
18266
18267    impl std::default::Default for Metadata {
18268        fn default() -> Self {
18269            use std::convert::From;
18270            Self::from(0)
18271        }
18272    }
18273
18274    impl std::fmt::Display for Metadata {
18275        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18276            wkt::internal::display_enum(f, self.name(), self.value())
18277        }
18278    }
18279
18280    impl std::convert::From<i32> for Metadata {
18281        fn from(value: i32) -> Self {
18282            match value {
18283                0 => Self::Unspecified,
18284                1 => Self::IncludeAllMetadata,
18285                2 => Self::ExcludeAllMetadata,
18286                3 => Self::CustomMetadata,
18287                _ => Self::UnknownValue(metadata::UnknownValue(
18288                    wkt::internal::UnknownEnumValue::Integer(value),
18289                )),
18290            }
18291        }
18292    }
18293
18294    impl std::convert::From<&str> for Metadata {
18295        fn from(value: &str) -> Self {
18296            use std::string::ToString;
18297            match value {
18298                "METADATA_UNSPECIFIED" => Self::Unspecified,
18299                "INCLUDE_ALL_METADATA" => Self::IncludeAllMetadata,
18300                "EXCLUDE_ALL_METADATA" => Self::ExcludeAllMetadata,
18301                "CUSTOM_METADATA" => Self::CustomMetadata,
18302                _ => Self::UnknownValue(metadata::UnknownValue(
18303                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18304                )),
18305            }
18306        }
18307    }
18308
18309    impl serde::ser::Serialize for Metadata {
18310        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18311        where
18312            S: serde::Serializer,
18313        {
18314            match self {
18315                Self::Unspecified => serializer.serialize_i32(0),
18316                Self::IncludeAllMetadata => serializer.serialize_i32(1),
18317                Self::ExcludeAllMetadata => serializer.serialize_i32(2),
18318                Self::CustomMetadata => serializer.serialize_i32(3),
18319                Self::UnknownValue(u) => u.0.serialize(serializer),
18320            }
18321        }
18322    }
18323
18324    impl<'de> serde::de::Deserialize<'de> for Metadata {
18325        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18326        where
18327            D: serde::Deserializer<'de>,
18328        {
18329            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Metadata>::new(
18330                ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.Metadata",
18331            ))
18332        }
18333    }
18334
18335    /// Determines whether to include cross project annotations in the logs.
18336    /// Project configurations will always have CROSS_PROJECT_METADATA_DISABLED.
18337    ///
18338    /// # Working with unknown values
18339    ///
18340    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18341    /// additional enum variants at any time. Adding new variants is not considered
18342    /// a breaking change. Applications should write their code in anticipation of:
18343    ///
18344    /// - New values appearing in future releases of the client library, **and**
18345    /// - New values received dynamically, without application changes.
18346    ///
18347    /// Please consult the [Working with enums] section in the user guide for some
18348    /// guidelines.
18349    ///
18350    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18351    #[derive(Clone, Debug, PartialEq)]
18352    #[non_exhaustive]
18353    pub enum CrossProjectMetadata {
18354        /// If not specified, the default is CROSS_PROJECT_METADATA_ENABLED.
18355        Unspecified,
18356        /// When CROSS_PROJECT_METADATA_ENABLED, metadata from other projects will be
18357        /// included in the logs.
18358        Enabled,
18359        /// When CROSS_PROJECT_METADATA_DISABLED, metadata from other projects will
18360        /// not be included in the logs.
18361        Disabled,
18362        /// If set, the enum was initialized with an unknown value.
18363        ///
18364        /// Applications can examine the value using [CrossProjectMetadata::value] or
18365        /// [CrossProjectMetadata::name].
18366        UnknownValue(cross_project_metadata::UnknownValue),
18367    }
18368
18369    #[doc(hidden)]
18370    pub mod cross_project_metadata {
18371        #[allow(unused_imports)]
18372        use super::*;
18373        #[derive(Clone, Debug, PartialEq)]
18374        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18375    }
18376
18377    impl CrossProjectMetadata {
18378        /// Gets the enum value.
18379        ///
18380        /// Returns `None` if the enum contains an unknown value deserialized from
18381        /// the string representation of enums.
18382        pub fn value(&self) -> std::option::Option<i32> {
18383            match self {
18384                Self::Unspecified => std::option::Option::Some(0),
18385                Self::Enabled => std::option::Option::Some(1),
18386                Self::Disabled => std::option::Option::Some(2),
18387                Self::UnknownValue(u) => u.0.value(),
18388            }
18389        }
18390
18391        /// Gets the enum value as a string.
18392        ///
18393        /// Returns `None` if the enum contains an unknown value deserialized from
18394        /// the integer representation of enums.
18395        pub fn name(&self) -> std::option::Option<&str> {
18396            match self {
18397                Self::Unspecified => {
18398                    std::option::Option::Some("CROSS_PROJECT_METADATA_UNSPECIFIED")
18399                }
18400                Self::Enabled => std::option::Option::Some("CROSS_PROJECT_METADATA_ENABLED"),
18401                Self::Disabled => std::option::Option::Some("CROSS_PROJECT_METADATA_DISABLED"),
18402                Self::UnknownValue(u) => u.0.name(),
18403            }
18404        }
18405    }
18406
18407    impl std::default::Default for CrossProjectMetadata {
18408        fn default() -> Self {
18409            use std::convert::From;
18410            Self::from(0)
18411        }
18412    }
18413
18414    impl std::fmt::Display for CrossProjectMetadata {
18415        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18416            wkt::internal::display_enum(f, self.name(), self.value())
18417        }
18418    }
18419
18420    impl std::convert::From<i32> for CrossProjectMetadata {
18421        fn from(value: i32) -> Self {
18422            match value {
18423                0 => Self::Unspecified,
18424                1 => Self::Enabled,
18425                2 => Self::Disabled,
18426                _ => Self::UnknownValue(cross_project_metadata::UnknownValue(
18427                    wkt::internal::UnknownEnumValue::Integer(value),
18428                )),
18429            }
18430        }
18431    }
18432
18433    impl std::convert::From<&str> for CrossProjectMetadata {
18434        fn from(value: &str) -> Self {
18435            use std::string::ToString;
18436            match value {
18437                "CROSS_PROJECT_METADATA_UNSPECIFIED" => Self::Unspecified,
18438                "CROSS_PROJECT_METADATA_ENABLED" => Self::Enabled,
18439                "CROSS_PROJECT_METADATA_DISABLED" => Self::Disabled,
18440                _ => Self::UnknownValue(cross_project_metadata::UnknownValue(
18441                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18442                )),
18443            }
18444        }
18445    }
18446
18447    impl serde::ser::Serialize for CrossProjectMetadata {
18448        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18449        where
18450            S: serde::Serializer,
18451        {
18452            match self {
18453                Self::Unspecified => serializer.serialize_i32(0),
18454                Self::Enabled => serializer.serialize_i32(1),
18455                Self::Disabled => serializer.serialize_i32(2),
18456                Self::UnknownValue(u) => u.0.serialize(serializer),
18457            }
18458        }
18459    }
18460
18461    impl<'de> serde::de::Deserialize<'de> for CrossProjectMetadata {
18462        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18463        where
18464            D: serde::Deserializer<'de>,
18465        {
18466            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CrossProjectMetadata>::new(
18467                ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.CrossProjectMetadata",
18468            ))
18469        }
18470    }
18471
18472    /// Output only. Indicates whether the target resource exists, for diagnostic
18473    /// purposes.
18474    ///
18475    /// # Working with unknown values
18476    ///
18477    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18478    /// additional enum variants at any time. Adding new variants is not considered
18479    /// a breaking change. Applications should write their code in anticipation of:
18480    ///
18481    /// - New values appearing in future releases of the client library, **and**
18482    /// - New values received dynamically, without application changes.
18483    ///
18484    /// Please consult the [Working with enums] section in the user guide for some
18485    /// guidelines.
18486    ///
18487    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18488    #[derive(Clone, Debug, PartialEq)]
18489    #[non_exhaustive]
18490    pub enum TargetResourceState {
18491        /// Unspecified target resource state.
18492        Unspecified,
18493        /// Indicates that the target resource exists.
18494        TargetResourceExists,
18495        /// Indicates that the target resource does not exist.
18496        TargetResourceDoesNotExist,
18497        /// If set, the enum was initialized with an unknown value.
18498        ///
18499        /// Applications can examine the value using [TargetResourceState::value] or
18500        /// [TargetResourceState::name].
18501        UnknownValue(target_resource_state::UnknownValue),
18502    }
18503
18504    #[doc(hidden)]
18505    pub mod target_resource_state {
18506        #[allow(unused_imports)]
18507        use super::*;
18508        #[derive(Clone, Debug, PartialEq)]
18509        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18510    }
18511
18512    impl TargetResourceState {
18513        /// Gets the enum value.
18514        ///
18515        /// Returns `None` if the enum contains an unknown value deserialized from
18516        /// the string representation of enums.
18517        pub fn value(&self) -> std::option::Option<i32> {
18518            match self {
18519                Self::Unspecified => std::option::Option::Some(0),
18520                Self::TargetResourceExists => std::option::Option::Some(1),
18521                Self::TargetResourceDoesNotExist => std::option::Option::Some(2),
18522                Self::UnknownValue(u) => u.0.value(),
18523            }
18524        }
18525
18526        /// Gets the enum value as a string.
18527        ///
18528        /// Returns `None` if the enum contains an unknown value deserialized from
18529        /// the integer representation of enums.
18530        pub fn name(&self) -> std::option::Option<&str> {
18531            match self {
18532                Self::Unspecified => std::option::Option::Some("TARGET_RESOURCE_STATE_UNSPECIFIED"),
18533                Self::TargetResourceExists => std::option::Option::Some("TARGET_RESOURCE_EXISTS"),
18534                Self::TargetResourceDoesNotExist => {
18535                    std::option::Option::Some("TARGET_RESOURCE_DOES_NOT_EXIST")
18536                }
18537                Self::UnknownValue(u) => u.0.name(),
18538            }
18539        }
18540    }
18541
18542    impl std::default::Default for TargetResourceState {
18543        fn default() -> Self {
18544            use std::convert::From;
18545            Self::from(0)
18546        }
18547    }
18548
18549    impl std::fmt::Display for TargetResourceState {
18550        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18551            wkt::internal::display_enum(f, self.name(), self.value())
18552        }
18553    }
18554
18555    impl std::convert::From<i32> for TargetResourceState {
18556        fn from(value: i32) -> Self {
18557            match value {
18558                0 => Self::Unspecified,
18559                1 => Self::TargetResourceExists,
18560                2 => Self::TargetResourceDoesNotExist,
18561                _ => Self::UnknownValue(target_resource_state::UnknownValue(
18562                    wkt::internal::UnknownEnumValue::Integer(value),
18563                )),
18564            }
18565        }
18566    }
18567
18568    impl std::convert::From<&str> for TargetResourceState {
18569        fn from(value: &str) -> Self {
18570            use std::string::ToString;
18571            match value {
18572                "TARGET_RESOURCE_STATE_UNSPECIFIED" => Self::Unspecified,
18573                "TARGET_RESOURCE_EXISTS" => Self::TargetResourceExists,
18574                "TARGET_RESOURCE_DOES_NOT_EXIST" => Self::TargetResourceDoesNotExist,
18575                _ => Self::UnknownValue(target_resource_state::UnknownValue(
18576                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18577                )),
18578            }
18579        }
18580    }
18581
18582    impl serde::ser::Serialize for TargetResourceState {
18583        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18584        where
18585            S: serde::Serializer,
18586        {
18587            match self {
18588                Self::Unspecified => serializer.serialize_i32(0),
18589                Self::TargetResourceExists => serializer.serialize_i32(1),
18590                Self::TargetResourceDoesNotExist => serializer.serialize_i32(2),
18591                Self::UnknownValue(u) => u.0.serialize(serializer),
18592            }
18593        }
18594    }
18595
18596    impl<'de> serde::de::Deserialize<'de> for TargetResourceState {
18597        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18598        where
18599            D: serde::Deserializer<'de>,
18600        {
18601            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetResourceState>::new(
18602                ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.TargetResourceState",
18603            ))
18604        }
18605    }
18606
18607    /// Reference to the resource of the config scope. That is, the scope from
18608    /// which traffic is logged. The target resource must belong to the same
18609    /// project as the configuration.
18610    /// This field is not supported for organization level configurations.
18611    #[derive(Clone, Debug, PartialEq)]
18612    #[non_exhaustive]
18613    pub enum TargetResource {
18614        /// Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
18615        /// within the network.
18616        /// Format: projects/{project_id}/global/networks/{name}
18617        Network(std::string::String),
18618        /// Traffic will be logged from VMs within the subnetwork.
18619        /// Format: projects/{project_id}/regions/{region}/subnetworks/{name}
18620        Subnet(std::string::String),
18621        /// Traffic will be logged from the Interconnect Attachment.
18622        /// Format:
18623        /// projects/{project_id}/regions/{region}/interconnectAttachments/{name}
18624        InterconnectAttachment(std::string::String),
18625        /// Traffic will be logged from the VPN Tunnel.
18626        /// Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
18627        VpnTunnel(std::string::String),
18628    }
18629}
18630
18631/// A configuration to generate a response for GetEffectiveVpcFlowLogsConfig
18632/// request.
18633#[derive(Clone, Default, PartialEq)]
18634#[non_exhaustive]
18635pub struct EffectiveVpcFlowLogsConfig {
18636    /// Unique name of the configuration. The name can have one of the following
18637    /// forms:
18638    ///
18639    /// - For project-level configurations:
18640    ///   `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
18641    ///
18642    /// - For organization-level configurations:
18643    ///   `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
18644    ///
18645    /// - For a Compute config, the name will be the path of the subnet:
18646    ///   `projects/{project_id}/regions/{region}/subnetworks/{subnet_id}`
18647    ///
18648    pub name: std::string::String,
18649
18650    /// The state of the VPC Flow Log configuration. Default value is ENABLED.
18651    /// When creating a new configuration, it must be enabled.
18652    /// Setting state=DISABLED will pause the log generation for this config.
18653    pub state: std::option::Option<crate::model::vpc_flow_logs_config::State>,
18654
18655    /// The aggregation interval for the logs. Default value is INTERVAL_5_SEC.
18656    pub aggregation_interval:
18657        std::option::Option<crate::model::vpc_flow_logs_config::AggregationInterval>,
18658
18659    /// The value of the field must be in (0, 1]. The sampling rate of VPC Flow
18660    /// Logs where 1.0 means all collected logs are reported.
18661    /// Setting the sampling rate to 0.0 is not allowed. If you want to disable VPC
18662    /// Flow Logs, use the state field instead.
18663    /// Default value is 1.0.
18664    pub flow_sampling: std::option::Option<f32>,
18665
18666    /// Configures whether all, none or a subset of metadata fields should be
18667    /// added to the reported VPC flow logs.
18668    /// Default value is INCLUDE_ALL_METADATA.
18669    pub metadata: std::option::Option<crate::model::vpc_flow_logs_config::Metadata>,
18670
18671    /// Custom metadata fields to include in the reported VPC flow logs.
18672    /// Can only be specified if "metadata" was set to CUSTOM_METADATA.
18673    pub metadata_fields: std::vec::Vec<std::string::String>,
18674
18675    /// Export filter used to define which VPC Flow Logs should be logged.
18676    pub filter_expr: std::option::Option<std::string::String>,
18677
18678    /// Determines whether to include cross project annotations in the logs.
18679    /// This field is available only for organization configurations. If not
18680    /// specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
18681    pub cross_project_metadata:
18682        std::option::Option<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
18683
18684    /// Specifies the scope of the config (e.g., SUBNET, NETWORK, ORGANIZATION..).
18685    pub scope: std::option::Option<crate::model::effective_vpc_flow_logs_config::Scope>,
18686
18687    /// Reference to the resource of the config scope. That is, the scope from
18688    /// which traffic is logged. The target resource must belong to the same
18689    /// project as the configuration.
18690    /// This field is not supported for organization level configurations.
18691    pub target_resource:
18692        std::option::Option<crate::model::effective_vpc_flow_logs_config::TargetResource>,
18693
18694    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18695}
18696
18697impl EffectiveVpcFlowLogsConfig {
18698    pub fn new() -> Self {
18699        std::default::Default::default()
18700    }
18701
18702    /// Sets the value of [name][crate::model::EffectiveVpcFlowLogsConfig::name].
18703    ///
18704    /// # Example
18705    /// ```ignore,no_run
18706    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18707    /// let x = EffectiveVpcFlowLogsConfig::new().set_name("example");
18708    /// ```
18709    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18710        self.name = v.into();
18711        self
18712    }
18713
18714    /// Sets the value of [state][crate::model::EffectiveVpcFlowLogsConfig::state].
18715    ///
18716    /// # Example
18717    /// ```ignore,no_run
18718    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18719    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
18720    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_state(State::Enabled);
18721    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_state(State::Disabled);
18722    /// ```
18723    pub fn set_state<T>(mut self, v: T) -> Self
18724    where
18725        T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
18726    {
18727        self.state = std::option::Option::Some(v.into());
18728        self
18729    }
18730
18731    /// Sets or clears the value of [state][crate::model::EffectiveVpcFlowLogsConfig::state].
18732    ///
18733    /// # Example
18734    /// ```ignore,no_run
18735    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18736    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
18737    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(Some(State::Enabled));
18738    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(Some(State::Disabled));
18739    /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(None::<State>);
18740    /// ```
18741    pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
18742    where
18743        T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
18744    {
18745        self.state = v.map(|x| x.into());
18746        self
18747    }
18748
18749    /// Sets the value of [aggregation_interval][crate::model::EffectiveVpcFlowLogsConfig::aggregation_interval].
18750    ///
18751    /// # Example
18752    /// ```ignore,no_run
18753    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18754    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
18755    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval5Sec);
18756    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval30Sec);
18757    /// let x2 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval1Min);
18758    /// ```
18759    pub fn set_aggregation_interval<T>(mut self, v: T) -> Self
18760    where
18761        T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
18762    {
18763        self.aggregation_interval = std::option::Option::Some(v.into());
18764        self
18765    }
18766
18767    /// Sets or clears the value of [aggregation_interval][crate::model::EffectiveVpcFlowLogsConfig::aggregation_interval].
18768    ///
18769    /// # Example
18770    /// ```ignore,no_run
18771    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18772    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
18773    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval5Sec));
18774    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval30Sec));
18775    /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval1Min));
18776    /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(None::<AggregationInterval>);
18777    /// ```
18778    pub fn set_or_clear_aggregation_interval<T>(mut self, v: std::option::Option<T>) -> Self
18779    where
18780        T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
18781    {
18782        self.aggregation_interval = v.map(|x| x.into());
18783        self
18784    }
18785
18786    /// Sets the value of [flow_sampling][crate::model::EffectiveVpcFlowLogsConfig::flow_sampling].
18787    ///
18788    /// # Example
18789    /// ```ignore,no_run
18790    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18791    /// let x = EffectiveVpcFlowLogsConfig::new().set_flow_sampling(42.0);
18792    /// ```
18793    pub fn set_flow_sampling<T>(mut self, v: T) -> Self
18794    where
18795        T: std::convert::Into<f32>,
18796    {
18797        self.flow_sampling = std::option::Option::Some(v.into());
18798        self
18799    }
18800
18801    /// Sets or clears the value of [flow_sampling][crate::model::EffectiveVpcFlowLogsConfig::flow_sampling].
18802    ///
18803    /// # Example
18804    /// ```ignore,no_run
18805    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18806    /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_flow_sampling(Some(42.0));
18807    /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_flow_sampling(None::<f32>);
18808    /// ```
18809    pub fn set_or_clear_flow_sampling<T>(mut self, v: std::option::Option<T>) -> Self
18810    where
18811        T: std::convert::Into<f32>,
18812    {
18813        self.flow_sampling = v.map(|x| x.into());
18814        self
18815    }
18816
18817    /// Sets the value of [metadata][crate::model::EffectiveVpcFlowLogsConfig::metadata].
18818    ///
18819    /// # Example
18820    /// ```ignore,no_run
18821    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18822    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
18823    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::IncludeAllMetadata);
18824    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::ExcludeAllMetadata);
18825    /// let x2 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::CustomMetadata);
18826    /// ```
18827    pub fn set_metadata<T>(mut self, v: T) -> Self
18828    where
18829        T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
18830    {
18831        self.metadata = std::option::Option::Some(v.into());
18832        self
18833    }
18834
18835    /// Sets or clears the value of [metadata][crate::model::EffectiveVpcFlowLogsConfig::metadata].
18836    ///
18837    /// # Example
18838    /// ```ignore,no_run
18839    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18840    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
18841    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::IncludeAllMetadata));
18842    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::ExcludeAllMetadata));
18843    /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::CustomMetadata));
18844    /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(None::<Metadata>);
18845    /// ```
18846    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
18847    where
18848        T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
18849    {
18850        self.metadata = v.map(|x| x.into());
18851        self
18852    }
18853
18854    /// Sets the value of [metadata_fields][crate::model::EffectiveVpcFlowLogsConfig::metadata_fields].
18855    ///
18856    /// # Example
18857    /// ```ignore,no_run
18858    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18859    /// let x = EffectiveVpcFlowLogsConfig::new().set_metadata_fields(["a", "b", "c"]);
18860    /// ```
18861    pub fn set_metadata_fields<T, V>(mut self, v: T) -> Self
18862    where
18863        T: std::iter::IntoIterator<Item = V>,
18864        V: std::convert::Into<std::string::String>,
18865    {
18866        use std::iter::Iterator;
18867        self.metadata_fields = v.into_iter().map(|i| i.into()).collect();
18868        self
18869    }
18870
18871    /// Sets the value of [filter_expr][crate::model::EffectiveVpcFlowLogsConfig::filter_expr].
18872    ///
18873    /// # Example
18874    /// ```ignore,no_run
18875    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18876    /// let x = EffectiveVpcFlowLogsConfig::new().set_filter_expr("example");
18877    /// ```
18878    pub fn set_filter_expr<T>(mut self, v: T) -> Self
18879    where
18880        T: std::convert::Into<std::string::String>,
18881    {
18882        self.filter_expr = std::option::Option::Some(v.into());
18883        self
18884    }
18885
18886    /// Sets or clears the value of [filter_expr][crate::model::EffectiveVpcFlowLogsConfig::filter_expr].
18887    ///
18888    /// # Example
18889    /// ```ignore,no_run
18890    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18891    /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_filter_expr(Some("example"));
18892    /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_filter_expr(None::<String>);
18893    /// ```
18894    pub fn set_or_clear_filter_expr<T>(mut self, v: std::option::Option<T>) -> Self
18895    where
18896        T: std::convert::Into<std::string::String>,
18897    {
18898        self.filter_expr = v.map(|x| x.into());
18899        self
18900    }
18901
18902    /// Sets the value of [cross_project_metadata][crate::model::EffectiveVpcFlowLogsConfig::cross_project_metadata].
18903    ///
18904    /// # Example
18905    /// ```ignore,no_run
18906    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18907    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
18908    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Enabled);
18909    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Disabled);
18910    /// ```
18911    pub fn set_cross_project_metadata<T>(mut self, v: T) -> Self
18912    where
18913        T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
18914    {
18915        self.cross_project_metadata = std::option::Option::Some(v.into());
18916        self
18917    }
18918
18919    /// Sets or clears the value of [cross_project_metadata][crate::model::EffectiveVpcFlowLogsConfig::cross_project_metadata].
18920    ///
18921    /// # Example
18922    /// ```ignore,no_run
18923    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18924    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
18925    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Enabled));
18926    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Disabled));
18927    /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(None::<CrossProjectMetadata>);
18928    /// ```
18929    pub fn set_or_clear_cross_project_metadata<T>(mut self, v: std::option::Option<T>) -> Self
18930    where
18931        T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
18932    {
18933        self.cross_project_metadata = v.map(|x| x.into());
18934        self
18935    }
18936
18937    /// Sets the value of [scope][crate::model::EffectiveVpcFlowLogsConfig::scope].
18938    ///
18939    /// # Example
18940    /// ```ignore,no_run
18941    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18942    /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::Scope;
18943    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::Subnet);
18944    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::ComputeApiSubnet);
18945    /// let x2 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::Network);
18946    /// ```
18947    pub fn set_scope<T>(mut self, v: T) -> Self
18948    where
18949        T: std::convert::Into<crate::model::effective_vpc_flow_logs_config::Scope>,
18950    {
18951        self.scope = std::option::Option::Some(v.into());
18952        self
18953    }
18954
18955    /// Sets or clears the value of [scope][crate::model::EffectiveVpcFlowLogsConfig::scope].
18956    ///
18957    /// # Example
18958    /// ```ignore,no_run
18959    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18960    /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::Scope;
18961    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::Subnet));
18962    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::ComputeApiSubnet));
18963    /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::Network));
18964    /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(None::<Scope>);
18965    /// ```
18966    pub fn set_or_clear_scope<T>(mut self, v: std::option::Option<T>) -> Self
18967    where
18968        T: std::convert::Into<crate::model::effective_vpc_flow_logs_config::Scope>,
18969    {
18970        self.scope = v.map(|x| x.into());
18971        self
18972    }
18973
18974    /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource].
18975    ///
18976    /// Note that all the setters affecting `target_resource` are mutually
18977    /// exclusive.
18978    ///
18979    /// # Example
18980    /// ```ignore,no_run
18981    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18982    /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::TargetResource;
18983    /// let x = EffectiveVpcFlowLogsConfig::new().set_target_resource(Some(TargetResource::Network("example".to_string())));
18984    /// ```
18985    pub fn set_target_resource<
18986        T: std::convert::Into<
18987                std::option::Option<crate::model::effective_vpc_flow_logs_config::TargetResource>,
18988            >,
18989    >(
18990        mut self,
18991        v: T,
18992    ) -> Self {
18993        self.target_resource = v.into();
18994        self
18995    }
18996
18997    /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
18998    /// if it holds a `Network`, `None` if the field is not set or
18999    /// holds a different branch.
19000    pub fn network(&self) -> std::option::Option<&std::string::String> {
19001        #[allow(unreachable_patterns)]
19002        self.target_resource.as_ref().and_then(|v| match v {
19003            crate::model::effective_vpc_flow_logs_config::TargetResource::Network(v) => {
19004                std::option::Option::Some(v)
19005            }
19006            _ => std::option::Option::None,
19007        })
19008    }
19009
19010    /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19011    /// to hold a `Network`.
19012    ///
19013    /// Note that all the setters affecting `target_resource` are
19014    /// mutually exclusive.
19015    ///
19016    /// # Example
19017    /// ```ignore,no_run
19018    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19019    /// let x = EffectiveVpcFlowLogsConfig::new().set_network("example");
19020    /// assert!(x.network().is_some());
19021    /// assert!(x.subnet().is_none());
19022    /// assert!(x.interconnect_attachment().is_none());
19023    /// assert!(x.vpn_tunnel().is_none());
19024    /// ```
19025    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19026        self.target_resource = std::option::Option::Some(
19027            crate::model::effective_vpc_flow_logs_config::TargetResource::Network(v.into()),
19028        );
19029        self
19030    }
19031
19032    /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19033    /// if it holds a `Subnet`, `None` if the field is not set or
19034    /// holds a different branch.
19035    pub fn subnet(&self) -> std::option::Option<&std::string::String> {
19036        #[allow(unreachable_patterns)]
19037        self.target_resource.as_ref().and_then(|v| match v {
19038            crate::model::effective_vpc_flow_logs_config::TargetResource::Subnet(v) => {
19039                std::option::Option::Some(v)
19040            }
19041            _ => std::option::Option::None,
19042        })
19043    }
19044
19045    /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19046    /// to hold a `Subnet`.
19047    ///
19048    /// Note that all the setters affecting `target_resource` are
19049    /// mutually exclusive.
19050    ///
19051    /// # Example
19052    /// ```ignore,no_run
19053    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19054    /// let x = EffectiveVpcFlowLogsConfig::new().set_subnet("example");
19055    /// assert!(x.subnet().is_some());
19056    /// assert!(x.network().is_none());
19057    /// assert!(x.interconnect_attachment().is_none());
19058    /// assert!(x.vpn_tunnel().is_none());
19059    /// ```
19060    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19061        self.target_resource = std::option::Option::Some(
19062            crate::model::effective_vpc_flow_logs_config::TargetResource::Subnet(v.into()),
19063        );
19064        self
19065    }
19066
19067    /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19068    /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
19069    /// holds a different branch.
19070    pub fn interconnect_attachment(&self) -> std::option::Option<&std::string::String> {
19071        #[allow(unreachable_patterns)]
19072        self.target_resource.as_ref().and_then(|v| match v {
19073            crate::model::effective_vpc_flow_logs_config::TargetResource::InterconnectAttachment(v) => std::option::Option::Some(v),
19074            _ => std::option::Option::None,
19075        })
19076    }
19077
19078    /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19079    /// to hold a `InterconnectAttachment`.
19080    ///
19081    /// Note that all the setters affecting `target_resource` are
19082    /// mutually exclusive.
19083    ///
19084    /// # Example
19085    /// ```ignore,no_run
19086    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19087    /// let x = EffectiveVpcFlowLogsConfig::new().set_interconnect_attachment("example");
19088    /// assert!(x.interconnect_attachment().is_some());
19089    /// assert!(x.network().is_none());
19090    /// assert!(x.subnet().is_none());
19091    /// assert!(x.vpn_tunnel().is_none());
19092    /// ```
19093    pub fn set_interconnect_attachment<T: std::convert::Into<std::string::String>>(
19094        mut self,
19095        v: T,
19096    ) -> Self {
19097        self.target_resource = std::option::Option::Some(
19098            crate::model::effective_vpc_flow_logs_config::TargetResource::InterconnectAttachment(
19099                v.into(),
19100            ),
19101        );
19102        self
19103    }
19104
19105    /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19106    /// if it holds a `VpnTunnel`, `None` if the field is not set or
19107    /// holds a different branch.
19108    pub fn vpn_tunnel(&self) -> std::option::Option<&std::string::String> {
19109        #[allow(unreachable_patterns)]
19110        self.target_resource.as_ref().and_then(|v| match v {
19111            crate::model::effective_vpc_flow_logs_config::TargetResource::VpnTunnel(v) => {
19112                std::option::Option::Some(v)
19113            }
19114            _ => std::option::Option::None,
19115        })
19116    }
19117
19118    /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19119    /// to hold a `VpnTunnel`.
19120    ///
19121    /// Note that all the setters affecting `target_resource` are
19122    /// mutually exclusive.
19123    ///
19124    /// # Example
19125    /// ```ignore,no_run
19126    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19127    /// let x = EffectiveVpcFlowLogsConfig::new().set_vpn_tunnel("example");
19128    /// assert!(x.vpn_tunnel().is_some());
19129    /// assert!(x.network().is_none());
19130    /// assert!(x.subnet().is_none());
19131    /// assert!(x.interconnect_attachment().is_none());
19132    /// ```
19133    pub fn set_vpn_tunnel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19134        self.target_resource = std::option::Option::Some(
19135            crate::model::effective_vpc_flow_logs_config::TargetResource::VpnTunnel(v.into()),
19136        );
19137        self
19138    }
19139}
19140
19141impl wkt::message::Message for EffectiveVpcFlowLogsConfig {
19142    fn typename() -> &'static str {
19143        "type.googleapis.com/google.cloud.networkmanagement.v1.EffectiveVpcFlowLogsConfig"
19144    }
19145}
19146
19147/// Defines additional types related to [EffectiveVpcFlowLogsConfig].
19148pub mod effective_vpc_flow_logs_config {
19149    #[allow(unused_imports)]
19150    use super::*;
19151
19152    /// The scope for this flow log configuration.
19153    ///
19154    /// # Working with unknown values
19155    ///
19156    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19157    /// additional enum variants at any time. Adding new variants is not considered
19158    /// a breaking change. Applications should write their code in anticipation of:
19159    ///
19160    /// - New values appearing in future releases of the client library, **and**
19161    /// - New values received dynamically, without application changes.
19162    ///
19163    /// Please consult the [Working with enums] section in the user guide for some
19164    /// guidelines.
19165    ///
19166    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19167    #[derive(Clone, Debug, PartialEq)]
19168    #[non_exhaustive]
19169    pub enum Scope {
19170        /// Scope is unspecified.
19171        Unspecified,
19172        /// Target resource is a subnet (Network Management API).
19173        Subnet,
19174        /// Target resource is a subnet, and the config originates from the Compute
19175        /// API.
19176        ComputeApiSubnet,
19177        /// Target resource is a network.
19178        Network,
19179        /// Target resource is a VPN tunnel.
19180        VpnTunnel,
19181        /// Target resource is an interconnect attachment.
19182        InterconnectAttachment,
19183        /// Configuration applies to an entire organization.
19184        Organization,
19185        /// If set, the enum was initialized with an unknown value.
19186        ///
19187        /// Applications can examine the value using [Scope::value] or
19188        /// [Scope::name].
19189        UnknownValue(scope::UnknownValue),
19190    }
19191
19192    #[doc(hidden)]
19193    pub mod scope {
19194        #[allow(unused_imports)]
19195        use super::*;
19196        #[derive(Clone, Debug, PartialEq)]
19197        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19198    }
19199
19200    impl Scope {
19201        /// Gets the enum value.
19202        ///
19203        /// Returns `None` if the enum contains an unknown value deserialized from
19204        /// the string representation of enums.
19205        pub fn value(&self) -> std::option::Option<i32> {
19206            match self {
19207                Self::Unspecified => std::option::Option::Some(0),
19208                Self::Subnet => std::option::Option::Some(1),
19209                Self::ComputeApiSubnet => std::option::Option::Some(2),
19210                Self::Network => std::option::Option::Some(3),
19211                Self::VpnTunnel => std::option::Option::Some(4),
19212                Self::InterconnectAttachment => std::option::Option::Some(5),
19213                Self::Organization => std::option::Option::Some(6),
19214                Self::UnknownValue(u) => u.0.value(),
19215            }
19216        }
19217
19218        /// Gets the enum value as a string.
19219        ///
19220        /// Returns `None` if the enum contains an unknown value deserialized from
19221        /// the integer representation of enums.
19222        pub fn name(&self) -> std::option::Option<&str> {
19223            match self {
19224                Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
19225                Self::Subnet => std::option::Option::Some("SUBNET"),
19226                Self::ComputeApiSubnet => std::option::Option::Some("COMPUTE_API_SUBNET"),
19227                Self::Network => std::option::Option::Some("NETWORK"),
19228                Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
19229                Self::InterconnectAttachment => {
19230                    std::option::Option::Some("INTERCONNECT_ATTACHMENT")
19231                }
19232                Self::Organization => std::option::Option::Some("ORGANIZATION"),
19233                Self::UnknownValue(u) => u.0.name(),
19234            }
19235        }
19236    }
19237
19238    impl std::default::Default for Scope {
19239        fn default() -> Self {
19240            use std::convert::From;
19241            Self::from(0)
19242        }
19243    }
19244
19245    impl std::fmt::Display for Scope {
19246        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19247            wkt::internal::display_enum(f, self.name(), self.value())
19248        }
19249    }
19250
19251    impl std::convert::From<i32> for Scope {
19252        fn from(value: i32) -> Self {
19253            match value {
19254                0 => Self::Unspecified,
19255                1 => Self::Subnet,
19256                2 => Self::ComputeApiSubnet,
19257                3 => Self::Network,
19258                4 => Self::VpnTunnel,
19259                5 => Self::InterconnectAttachment,
19260                6 => Self::Organization,
19261                _ => Self::UnknownValue(scope::UnknownValue(
19262                    wkt::internal::UnknownEnumValue::Integer(value),
19263                )),
19264            }
19265        }
19266    }
19267
19268    impl std::convert::From<&str> for Scope {
19269        fn from(value: &str) -> Self {
19270            use std::string::ToString;
19271            match value {
19272                "SCOPE_UNSPECIFIED" => Self::Unspecified,
19273                "SUBNET" => Self::Subnet,
19274                "COMPUTE_API_SUBNET" => Self::ComputeApiSubnet,
19275                "NETWORK" => Self::Network,
19276                "VPN_TUNNEL" => Self::VpnTunnel,
19277                "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
19278                "ORGANIZATION" => Self::Organization,
19279                _ => Self::UnknownValue(scope::UnknownValue(
19280                    wkt::internal::UnknownEnumValue::String(value.to_string()),
19281                )),
19282            }
19283        }
19284    }
19285
19286    impl serde::ser::Serialize for Scope {
19287        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19288        where
19289            S: serde::Serializer,
19290        {
19291            match self {
19292                Self::Unspecified => serializer.serialize_i32(0),
19293                Self::Subnet => serializer.serialize_i32(1),
19294                Self::ComputeApiSubnet => serializer.serialize_i32(2),
19295                Self::Network => serializer.serialize_i32(3),
19296                Self::VpnTunnel => serializer.serialize_i32(4),
19297                Self::InterconnectAttachment => serializer.serialize_i32(5),
19298                Self::Organization => serializer.serialize_i32(6),
19299                Self::UnknownValue(u) => u.0.serialize(serializer),
19300            }
19301        }
19302    }
19303
19304    impl<'de> serde::de::Deserialize<'de> for Scope {
19305        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19306        where
19307            D: serde::Deserializer<'de>,
19308        {
19309            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
19310                ".google.cloud.networkmanagement.v1.EffectiveVpcFlowLogsConfig.Scope",
19311            ))
19312        }
19313    }
19314
19315    /// Reference to the resource of the config scope. That is, the scope from
19316    /// which traffic is logged. The target resource must belong to the same
19317    /// project as the configuration.
19318    /// This field is not supported for organization level configurations.
19319    #[derive(Clone, Debug, PartialEq)]
19320    #[non_exhaustive]
19321    pub enum TargetResource {
19322        /// Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
19323        /// within the network.
19324        /// Format: projects/{project_id}/global/networks/{name}
19325        Network(std::string::String),
19326        /// Traffic will be logged from VMs within the subnetwork.
19327        /// Format: projects/{project_id}/regions/{region}/subnetworks/{name}
19328        Subnet(std::string::String),
19329        /// Traffic will be logged from the Interconnect Attachment.
19330        /// Format:
19331        /// projects/{project_id}/regions/{region}/interconnectAttachments/{name}
19332        InterconnectAttachment(std::string::String),
19333        /// Traffic will be logged from the VPN Tunnel.
19334        /// Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
19335        VpnTunnel(std::string::String),
19336    }
19337}
19338
19339/// Type of a load balancer. For more information, see [Summary of Google Cloud
19340/// load
19341/// balancers](https://cloud.google.com/load-balancing/docs/load-balancing-overview#summary-of-google-cloud-load-balancers).
19342///
19343/// # Working with unknown values
19344///
19345/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19346/// additional enum variants at any time. Adding new variants is not considered
19347/// a breaking change. Applications should write their code in anticipation of:
19348///
19349/// - New values appearing in future releases of the client library, **and**
19350/// - New values received dynamically, without application changes.
19351///
19352/// Please consult the [Working with enums] section in the user guide for some
19353/// guidelines.
19354///
19355/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19356#[derive(Clone, Debug, PartialEq)]
19357#[non_exhaustive]
19358pub enum LoadBalancerType {
19359    /// Forwarding rule points to a different target than a load balancer or a
19360    /// load balancer type is unknown.
19361    Unspecified,
19362    /// Global external HTTP(S) load balancer.
19363    HttpsAdvancedLoadBalancer,
19364    /// Global external HTTP(S) load balancer (classic)
19365    HttpsLoadBalancer,
19366    /// Regional external HTTP(S) load balancer.
19367    RegionalHttpsLoadBalancer,
19368    /// Internal HTTP(S) load balancer.
19369    InternalHttpsLoadBalancer,
19370    /// External SSL proxy load balancer.
19371    SslProxyLoadBalancer,
19372    /// External TCP proxy load balancer.
19373    TcpProxyLoadBalancer,
19374    /// Internal regional TCP proxy load balancer.
19375    InternalTcpProxyLoadBalancer,
19376    /// External TCP/UDP Network load balancer.
19377    NetworkLoadBalancer,
19378    /// Target-pool based external TCP/UDP Network load balancer.
19379    LegacyNetworkLoadBalancer,
19380    /// Internal TCP/UDP load balancer.
19381    TcpUdpInternalLoadBalancer,
19382    /// If set, the enum was initialized with an unknown value.
19383    ///
19384    /// Applications can examine the value using [LoadBalancerType::value] or
19385    /// [LoadBalancerType::name].
19386    UnknownValue(load_balancer_type::UnknownValue),
19387}
19388
19389#[doc(hidden)]
19390pub mod load_balancer_type {
19391    #[allow(unused_imports)]
19392    use super::*;
19393    #[derive(Clone, Debug, PartialEq)]
19394    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19395}
19396
19397impl LoadBalancerType {
19398    /// Gets the enum value.
19399    ///
19400    /// Returns `None` if the enum contains an unknown value deserialized from
19401    /// the string representation of enums.
19402    pub fn value(&self) -> std::option::Option<i32> {
19403        match self {
19404            Self::Unspecified => std::option::Option::Some(0),
19405            Self::HttpsAdvancedLoadBalancer => std::option::Option::Some(1),
19406            Self::HttpsLoadBalancer => std::option::Option::Some(2),
19407            Self::RegionalHttpsLoadBalancer => std::option::Option::Some(3),
19408            Self::InternalHttpsLoadBalancer => std::option::Option::Some(4),
19409            Self::SslProxyLoadBalancer => std::option::Option::Some(5),
19410            Self::TcpProxyLoadBalancer => std::option::Option::Some(6),
19411            Self::InternalTcpProxyLoadBalancer => std::option::Option::Some(7),
19412            Self::NetworkLoadBalancer => std::option::Option::Some(8),
19413            Self::LegacyNetworkLoadBalancer => std::option::Option::Some(9),
19414            Self::TcpUdpInternalLoadBalancer => std::option::Option::Some(10),
19415            Self::UnknownValue(u) => u.0.value(),
19416        }
19417    }
19418
19419    /// Gets the enum value as a string.
19420    ///
19421    /// Returns `None` if the enum contains an unknown value deserialized from
19422    /// the integer representation of enums.
19423    pub fn name(&self) -> std::option::Option<&str> {
19424        match self {
19425            Self::Unspecified => std::option::Option::Some("LOAD_BALANCER_TYPE_UNSPECIFIED"),
19426            Self::HttpsAdvancedLoadBalancer => {
19427                std::option::Option::Some("HTTPS_ADVANCED_LOAD_BALANCER")
19428            }
19429            Self::HttpsLoadBalancer => std::option::Option::Some("HTTPS_LOAD_BALANCER"),
19430            Self::RegionalHttpsLoadBalancer => {
19431                std::option::Option::Some("REGIONAL_HTTPS_LOAD_BALANCER")
19432            }
19433            Self::InternalHttpsLoadBalancer => {
19434                std::option::Option::Some("INTERNAL_HTTPS_LOAD_BALANCER")
19435            }
19436            Self::SslProxyLoadBalancer => std::option::Option::Some("SSL_PROXY_LOAD_BALANCER"),
19437            Self::TcpProxyLoadBalancer => std::option::Option::Some("TCP_PROXY_LOAD_BALANCER"),
19438            Self::InternalTcpProxyLoadBalancer => {
19439                std::option::Option::Some("INTERNAL_TCP_PROXY_LOAD_BALANCER")
19440            }
19441            Self::NetworkLoadBalancer => std::option::Option::Some("NETWORK_LOAD_BALANCER"),
19442            Self::LegacyNetworkLoadBalancer => {
19443                std::option::Option::Some("LEGACY_NETWORK_LOAD_BALANCER")
19444            }
19445            Self::TcpUdpInternalLoadBalancer => {
19446                std::option::Option::Some("TCP_UDP_INTERNAL_LOAD_BALANCER")
19447            }
19448            Self::UnknownValue(u) => u.0.name(),
19449        }
19450    }
19451}
19452
19453impl std::default::Default for LoadBalancerType {
19454    fn default() -> Self {
19455        use std::convert::From;
19456        Self::from(0)
19457    }
19458}
19459
19460impl std::fmt::Display for LoadBalancerType {
19461    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19462        wkt::internal::display_enum(f, self.name(), self.value())
19463    }
19464}
19465
19466impl std::convert::From<i32> for LoadBalancerType {
19467    fn from(value: i32) -> Self {
19468        match value {
19469            0 => Self::Unspecified,
19470            1 => Self::HttpsAdvancedLoadBalancer,
19471            2 => Self::HttpsLoadBalancer,
19472            3 => Self::RegionalHttpsLoadBalancer,
19473            4 => Self::InternalHttpsLoadBalancer,
19474            5 => Self::SslProxyLoadBalancer,
19475            6 => Self::TcpProxyLoadBalancer,
19476            7 => Self::InternalTcpProxyLoadBalancer,
19477            8 => Self::NetworkLoadBalancer,
19478            9 => Self::LegacyNetworkLoadBalancer,
19479            10 => Self::TcpUdpInternalLoadBalancer,
19480            _ => Self::UnknownValue(load_balancer_type::UnknownValue(
19481                wkt::internal::UnknownEnumValue::Integer(value),
19482            )),
19483        }
19484    }
19485}
19486
19487impl std::convert::From<&str> for LoadBalancerType {
19488    fn from(value: &str) -> Self {
19489        use std::string::ToString;
19490        match value {
19491            "LOAD_BALANCER_TYPE_UNSPECIFIED" => Self::Unspecified,
19492            "HTTPS_ADVANCED_LOAD_BALANCER" => Self::HttpsAdvancedLoadBalancer,
19493            "HTTPS_LOAD_BALANCER" => Self::HttpsLoadBalancer,
19494            "REGIONAL_HTTPS_LOAD_BALANCER" => Self::RegionalHttpsLoadBalancer,
19495            "INTERNAL_HTTPS_LOAD_BALANCER" => Self::InternalHttpsLoadBalancer,
19496            "SSL_PROXY_LOAD_BALANCER" => Self::SslProxyLoadBalancer,
19497            "TCP_PROXY_LOAD_BALANCER" => Self::TcpProxyLoadBalancer,
19498            "INTERNAL_TCP_PROXY_LOAD_BALANCER" => Self::InternalTcpProxyLoadBalancer,
19499            "NETWORK_LOAD_BALANCER" => Self::NetworkLoadBalancer,
19500            "LEGACY_NETWORK_LOAD_BALANCER" => Self::LegacyNetworkLoadBalancer,
19501            "TCP_UDP_INTERNAL_LOAD_BALANCER" => Self::TcpUdpInternalLoadBalancer,
19502            _ => Self::UnknownValue(load_balancer_type::UnknownValue(
19503                wkt::internal::UnknownEnumValue::String(value.to_string()),
19504            )),
19505        }
19506    }
19507}
19508
19509impl serde::ser::Serialize for LoadBalancerType {
19510    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19511    where
19512        S: serde::Serializer,
19513    {
19514        match self {
19515            Self::Unspecified => serializer.serialize_i32(0),
19516            Self::HttpsAdvancedLoadBalancer => serializer.serialize_i32(1),
19517            Self::HttpsLoadBalancer => serializer.serialize_i32(2),
19518            Self::RegionalHttpsLoadBalancer => serializer.serialize_i32(3),
19519            Self::InternalHttpsLoadBalancer => serializer.serialize_i32(4),
19520            Self::SslProxyLoadBalancer => serializer.serialize_i32(5),
19521            Self::TcpProxyLoadBalancer => serializer.serialize_i32(6),
19522            Self::InternalTcpProxyLoadBalancer => serializer.serialize_i32(7),
19523            Self::NetworkLoadBalancer => serializer.serialize_i32(8),
19524            Self::LegacyNetworkLoadBalancer => serializer.serialize_i32(9),
19525            Self::TcpUdpInternalLoadBalancer => serializer.serialize_i32(10),
19526            Self::UnknownValue(u) => u.0.serialize(serializer),
19527        }
19528    }
19529}
19530
19531impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
19532    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19533    where
19534        D: serde::Deserializer<'de>,
19535    {
19536        deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
19537            ".google.cloud.networkmanagement.v1.LoadBalancerType",
19538        ))
19539    }
19540}