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    /// Creates a new default instance.
120    pub fn new() -> Self {
121        std::default::Default::default()
122    }
123
124    /// Sets the value of [name][crate::model::ConnectivityTest::name].
125    ///
126    /// # Example
127    /// ```ignore,no_run
128    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
129    /// # let project_id = "project_id";
130    /// # let test_id = "test_id";
131    /// let x = ConnectivityTest::new().set_name(format!("projects/{project_id}/locations/global/connectivityTests/{test_id}"));
132    /// ```
133    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
134        self.name = v.into();
135        self
136    }
137
138    /// Sets the value of [description][crate::model::ConnectivityTest::description].
139    ///
140    /// # Example
141    /// ```ignore,no_run
142    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
143    /// let x = ConnectivityTest::new().set_description("example");
144    /// ```
145    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
146        self.description = v.into();
147        self
148    }
149
150    /// Sets the value of [source][crate::model::ConnectivityTest::source].
151    ///
152    /// # Example
153    /// ```ignore,no_run
154    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
155    /// use google_cloud_networkmanagement_v1::model::Endpoint;
156    /// let x = ConnectivityTest::new().set_source(Endpoint::default()/* use setters */);
157    /// ```
158    pub fn set_source<T>(mut self, v: T) -> Self
159    where
160        T: std::convert::Into<crate::model::Endpoint>,
161    {
162        self.source = std::option::Option::Some(v.into());
163        self
164    }
165
166    /// Sets or clears the value of [source][crate::model::ConnectivityTest::source].
167    ///
168    /// # Example
169    /// ```ignore,no_run
170    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
171    /// use google_cloud_networkmanagement_v1::model::Endpoint;
172    /// let x = ConnectivityTest::new().set_or_clear_source(Some(Endpoint::default()/* use setters */));
173    /// let x = ConnectivityTest::new().set_or_clear_source(None::<Endpoint>);
174    /// ```
175    pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
176    where
177        T: std::convert::Into<crate::model::Endpoint>,
178    {
179        self.source = v.map(|x| x.into());
180        self
181    }
182
183    /// Sets the value of [destination][crate::model::ConnectivityTest::destination].
184    ///
185    /// # Example
186    /// ```ignore,no_run
187    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
188    /// use google_cloud_networkmanagement_v1::model::Endpoint;
189    /// let x = ConnectivityTest::new().set_destination(Endpoint::default()/* use setters */);
190    /// ```
191    pub fn set_destination<T>(mut self, v: T) -> Self
192    where
193        T: std::convert::Into<crate::model::Endpoint>,
194    {
195        self.destination = std::option::Option::Some(v.into());
196        self
197    }
198
199    /// Sets or clears the value of [destination][crate::model::ConnectivityTest::destination].
200    ///
201    /// # Example
202    /// ```ignore,no_run
203    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
204    /// use google_cloud_networkmanagement_v1::model::Endpoint;
205    /// let x = ConnectivityTest::new().set_or_clear_destination(Some(Endpoint::default()/* use setters */));
206    /// let x = ConnectivityTest::new().set_or_clear_destination(None::<Endpoint>);
207    /// ```
208    pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
209    where
210        T: std::convert::Into<crate::model::Endpoint>,
211    {
212        self.destination = v.map(|x| x.into());
213        self
214    }
215
216    /// Sets the value of [protocol][crate::model::ConnectivityTest::protocol].
217    ///
218    /// # Example
219    /// ```ignore,no_run
220    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
221    /// let x = ConnectivityTest::new().set_protocol("example");
222    /// ```
223    pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
224        self.protocol = v.into();
225        self
226    }
227
228    /// Sets the value of [related_projects][crate::model::ConnectivityTest::related_projects].
229    ///
230    /// # Example
231    /// ```ignore,no_run
232    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
233    /// let x = ConnectivityTest::new().set_related_projects(["a", "b", "c"]);
234    /// ```
235    pub fn set_related_projects<T, V>(mut self, v: T) -> Self
236    where
237        T: std::iter::IntoIterator<Item = V>,
238        V: std::convert::Into<std::string::String>,
239    {
240        use std::iter::Iterator;
241        self.related_projects = v.into_iter().map(|i| i.into()).collect();
242        self
243    }
244
245    /// Sets the value of [display_name][crate::model::ConnectivityTest::display_name].
246    ///
247    /// # Example
248    /// ```ignore,no_run
249    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
250    /// let x = ConnectivityTest::new().set_display_name("example");
251    /// ```
252    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
253        self.display_name = v.into();
254        self
255    }
256
257    /// Sets the value of [labels][crate::model::ConnectivityTest::labels].
258    ///
259    /// # Example
260    /// ```ignore,no_run
261    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
262    /// let x = ConnectivityTest::new().set_labels([
263    ///     ("key0", "abc"),
264    ///     ("key1", "xyz"),
265    /// ]);
266    /// ```
267    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
268    where
269        T: std::iter::IntoIterator<Item = (K, V)>,
270        K: std::convert::Into<std::string::String>,
271        V: std::convert::Into<std::string::String>,
272    {
273        use std::iter::Iterator;
274        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
275        self
276    }
277
278    /// Sets the value of [create_time][crate::model::ConnectivityTest::create_time].
279    ///
280    /// # Example
281    /// ```ignore,no_run
282    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
283    /// use wkt::Timestamp;
284    /// let x = ConnectivityTest::new().set_create_time(Timestamp::default()/* use setters */);
285    /// ```
286    pub fn set_create_time<T>(mut self, v: T) -> Self
287    where
288        T: std::convert::Into<wkt::Timestamp>,
289    {
290        self.create_time = std::option::Option::Some(v.into());
291        self
292    }
293
294    /// Sets or clears the value of [create_time][crate::model::ConnectivityTest::create_time].
295    ///
296    /// # Example
297    /// ```ignore,no_run
298    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
299    /// use wkt::Timestamp;
300    /// let x = ConnectivityTest::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
301    /// let x = ConnectivityTest::new().set_or_clear_create_time(None::<Timestamp>);
302    /// ```
303    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
304    where
305        T: std::convert::Into<wkt::Timestamp>,
306    {
307        self.create_time = v.map(|x| x.into());
308        self
309    }
310
311    /// Sets the value of [update_time][crate::model::ConnectivityTest::update_time].
312    ///
313    /// # Example
314    /// ```ignore,no_run
315    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
316    /// use wkt::Timestamp;
317    /// let x = ConnectivityTest::new().set_update_time(Timestamp::default()/* use setters */);
318    /// ```
319    pub fn set_update_time<T>(mut self, v: T) -> Self
320    where
321        T: std::convert::Into<wkt::Timestamp>,
322    {
323        self.update_time = std::option::Option::Some(v.into());
324        self
325    }
326
327    /// Sets or clears the value of [update_time][crate::model::ConnectivityTest::update_time].
328    ///
329    /// # Example
330    /// ```ignore,no_run
331    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
332    /// use wkt::Timestamp;
333    /// let x = ConnectivityTest::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
334    /// let x = ConnectivityTest::new().set_or_clear_update_time(None::<Timestamp>);
335    /// ```
336    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
337    where
338        T: std::convert::Into<wkt::Timestamp>,
339    {
340        self.update_time = v.map(|x| x.into());
341        self
342    }
343
344    /// Sets the value of [reachability_details][crate::model::ConnectivityTest::reachability_details].
345    ///
346    /// # Example
347    /// ```ignore,no_run
348    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
349    /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
350    /// let x = ConnectivityTest::new().set_reachability_details(ReachabilityDetails::default()/* use setters */);
351    /// ```
352    pub fn set_reachability_details<T>(mut self, v: T) -> Self
353    where
354        T: std::convert::Into<crate::model::ReachabilityDetails>,
355    {
356        self.reachability_details = std::option::Option::Some(v.into());
357        self
358    }
359
360    /// Sets or clears the value of [reachability_details][crate::model::ConnectivityTest::reachability_details].
361    ///
362    /// # Example
363    /// ```ignore,no_run
364    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
365    /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
366    /// let x = ConnectivityTest::new().set_or_clear_reachability_details(Some(ReachabilityDetails::default()/* use setters */));
367    /// let x = ConnectivityTest::new().set_or_clear_reachability_details(None::<ReachabilityDetails>);
368    /// ```
369    pub fn set_or_clear_reachability_details<T>(mut self, v: std::option::Option<T>) -> Self
370    where
371        T: std::convert::Into<crate::model::ReachabilityDetails>,
372    {
373        self.reachability_details = v.map(|x| x.into());
374        self
375    }
376
377    /// Sets the value of [probing_details][crate::model::ConnectivityTest::probing_details].
378    ///
379    /// # Example
380    /// ```ignore,no_run
381    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
382    /// use google_cloud_networkmanagement_v1::model::ProbingDetails;
383    /// let x = ConnectivityTest::new().set_probing_details(ProbingDetails::default()/* use setters */);
384    /// ```
385    pub fn set_probing_details<T>(mut self, v: T) -> Self
386    where
387        T: std::convert::Into<crate::model::ProbingDetails>,
388    {
389        self.probing_details = std::option::Option::Some(v.into());
390        self
391    }
392
393    /// Sets or clears the value of [probing_details][crate::model::ConnectivityTest::probing_details].
394    ///
395    /// # Example
396    /// ```ignore,no_run
397    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
398    /// use google_cloud_networkmanagement_v1::model::ProbingDetails;
399    /// let x = ConnectivityTest::new().set_or_clear_probing_details(Some(ProbingDetails::default()/* use setters */));
400    /// let x = ConnectivityTest::new().set_or_clear_probing_details(None::<ProbingDetails>);
401    /// ```
402    pub fn set_or_clear_probing_details<T>(mut self, v: std::option::Option<T>) -> Self
403    where
404        T: std::convert::Into<crate::model::ProbingDetails>,
405    {
406        self.probing_details = v.map(|x| x.into());
407        self
408    }
409
410    /// Sets the value of [round_trip][crate::model::ConnectivityTest::round_trip].
411    ///
412    /// # Example
413    /// ```ignore,no_run
414    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
415    /// let x = ConnectivityTest::new().set_round_trip(true);
416    /// ```
417    pub fn set_round_trip<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
418        self.round_trip = v.into();
419        self
420    }
421
422    /// Sets the value of [return_reachability_details][crate::model::ConnectivityTest::return_reachability_details].
423    ///
424    /// # Example
425    /// ```ignore,no_run
426    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
427    /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
428    /// let x = ConnectivityTest::new().set_return_reachability_details(ReachabilityDetails::default()/* use setters */);
429    /// ```
430    pub fn set_return_reachability_details<T>(mut self, v: T) -> Self
431    where
432        T: std::convert::Into<crate::model::ReachabilityDetails>,
433    {
434        self.return_reachability_details = std::option::Option::Some(v.into());
435        self
436    }
437
438    /// Sets or clears the value of [return_reachability_details][crate::model::ConnectivityTest::return_reachability_details].
439    ///
440    /// # Example
441    /// ```ignore,no_run
442    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
443    /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
444    /// let x = ConnectivityTest::new().set_or_clear_return_reachability_details(Some(ReachabilityDetails::default()/* use setters */));
445    /// let x = ConnectivityTest::new().set_or_clear_return_reachability_details(None::<ReachabilityDetails>);
446    /// ```
447    pub fn set_or_clear_return_reachability_details<T>(mut self, v: std::option::Option<T>) -> Self
448    where
449        T: std::convert::Into<crate::model::ReachabilityDetails>,
450    {
451        self.return_reachability_details = v.map(|x| x.into());
452        self
453    }
454
455    /// Sets the value of [bypass_firewall_checks][crate::model::ConnectivityTest::bypass_firewall_checks].
456    ///
457    /// # Example
458    /// ```ignore,no_run
459    /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
460    /// let x = ConnectivityTest::new().set_bypass_firewall_checks(true);
461    /// ```
462    pub fn set_bypass_firewall_checks<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
463        self.bypass_firewall_checks = v.into();
464        self
465    }
466}
467
468impl wkt::message::Message for ConnectivityTest {
469    fn typename() -> &'static str {
470        "type.googleapis.com/google.cloud.networkmanagement.v1.ConnectivityTest"
471    }
472}
473
474/// Source or destination of the Connectivity Test.
475#[derive(Clone, Default, PartialEq)]
476#[non_exhaustive]
477pub struct Endpoint {
478    /// The IP address of the endpoint, which can be an external or internal IP.
479    pub ip_address: std::string::String,
480
481    /// The IP protocol port of the endpoint.
482    /// Only applicable when protocol is TCP or UDP.
483    pub port: i32,
484
485    /// A Compute Engine instance URI.
486    pub instance: std::string::String,
487
488    /// A forwarding rule and its corresponding IP address represent the frontend
489    /// configuration of a Google Cloud load balancer. Forwarding rules are also
490    /// used for protocol forwarding, Private Service Connect and other network
491    /// services to provide forwarding information in the control plane. Applicable
492    /// only to destination endpoint. Format:
493    /// `projects/{project}/global/forwardingRules/{id}` or
494    /// `projects/{project}/regions/{region}/forwardingRules/{id}`
495    pub forwarding_rule: std::string::String,
496
497    /// Output only. Specifies the type of the target of the forwarding rule.
498    pub forwarding_rule_target: std::option::Option<crate::model::endpoint::ForwardingRuleTarget>,
499
500    /// Output only. ID of the load balancer the forwarding rule points to. Empty
501    /// for forwarding rules not related to load balancers.
502    pub load_balancer_id: std::option::Option<std::string::String>,
503
504    /// Output only. Type of the load balancer the forwarding rule points to.
505    pub load_balancer_type: std::option::Option<crate::model::LoadBalancerType>,
506
507    /// A cluster URI for [Google Kubernetes Engine cluster control
508    /// plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
509    pub gke_master_cluster: std::string::String,
510
511    /// DNS endpoint of [Google Kubernetes Engine cluster control
512    /// plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
513    /// Requires gke_master_cluster to be set, can't be used simultaneoulsly with
514    /// ip_address or network. Applicable only to destination endpoint.
515    pub fqdn: std::string::String,
516
517    /// A [Cloud SQL](https://cloud.google.com/sql) instance URI.
518    pub cloud_sql_instance: std::string::String,
519
520    /// A [Redis Instance](https://cloud.google.com/memorystore/docs/redis) URI.
521    /// Applicable only to destination endpoint.
522    pub redis_instance: std::string::String,
523
524    /// A [Redis Cluster](https://cloud.google.com/memorystore/docs/cluster) URI.
525    /// Applicable only to destination endpoint.
526    pub redis_cluster: std::string::String,
527
528    /// A [GKE Pod](https://cloud.google.com/kubernetes-engine/docs/concepts/pod)
529    /// URI.
530    pub gke_pod: std::string::String,
531
532    /// A [Cloud Function](https://cloud.google.com/functions). Applicable only to
533    /// source endpoint.
534    pub cloud_function: std::option::Option<crate::model::endpoint::CloudFunctionEndpoint>,
535
536    /// An [App Engine](https://cloud.google.com/appengine) [service
537    /// version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions).
538    /// Applicable only to source endpoint.
539    pub app_engine_version: std::option::Option<crate::model::endpoint::AppEngineVersionEndpoint>,
540
541    /// A [Cloud Run](https://cloud.google.com/run)
542    /// [revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get)
543    /// Applicable only to source endpoint.
544    pub cloud_run_revision: std::option::Option<crate::model::endpoint::CloudRunRevisionEndpoint>,
545
546    /// A VPC network URI. For source endpoints, used according to the
547    /// `network_type`. For destination endpoints, used only when the source is an
548    /// external IP address endpoint, and the destination is an internal IP address
549    /// endpoint.
550    pub network: std::string::String,
551
552    /// For source endpoints, type of the network where the endpoint is located.
553    /// Not relevant for destination endpoints.
554    pub network_type: crate::model::endpoint::NetworkType,
555
556    /// For source endpoints, endpoint project ID. Used according to the
557    /// `network_type`. Not relevant for destination endpoints.
558    pub project_id: std::string::String,
559
560    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
561}
562
563impl Endpoint {
564    /// Creates a new default instance.
565    pub fn new() -> Self {
566        std::default::Default::default()
567    }
568
569    /// Sets the value of [ip_address][crate::model::Endpoint::ip_address].
570    ///
571    /// # Example
572    /// ```ignore,no_run
573    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
574    /// let x = Endpoint::new().set_ip_address("example");
575    /// ```
576    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
577        self.ip_address = v.into();
578        self
579    }
580
581    /// Sets the value of [port][crate::model::Endpoint::port].
582    ///
583    /// # Example
584    /// ```ignore,no_run
585    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
586    /// let x = Endpoint::new().set_port(42);
587    /// ```
588    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
589        self.port = v.into();
590        self
591    }
592
593    /// Sets the value of [instance][crate::model::Endpoint::instance].
594    ///
595    /// # Example
596    /// ```ignore,no_run
597    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
598    /// let x = Endpoint::new().set_instance("example");
599    /// ```
600    pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
601        self.instance = v.into();
602        self
603    }
604
605    /// Sets the value of [forwarding_rule][crate::model::Endpoint::forwarding_rule].
606    ///
607    /// # Example
608    /// ```ignore,no_run
609    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
610    /// let x = Endpoint::new().set_forwarding_rule("example");
611    /// ```
612    pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
613        self.forwarding_rule = v.into();
614        self
615    }
616
617    /// Sets the value of [forwarding_rule_target][crate::model::Endpoint::forwarding_rule_target].
618    ///
619    /// # Example
620    /// ```ignore,no_run
621    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
622    /// use google_cloud_networkmanagement_v1::model::endpoint::ForwardingRuleTarget;
623    /// let x0 = Endpoint::new().set_forwarding_rule_target(ForwardingRuleTarget::Instance);
624    /// let x1 = Endpoint::new().set_forwarding_rule_target(ForwardingRuleTarget::LoadBalancer);
625    /// let x2 = Endpoint::new().set_forwarding_rule_target(ForwardingRuleTarget::VpnGateway);
626    /// ```
627    pub fn set_forwarding_rule_target<T>(mut self, v: T) -> Self
628    where
629        T: std::convert::Into<crate::model::endpoint::ForwardingRuleTarget>,
630    {
631        self.forwarding_rule_target = std::option::Option::Some(v.into());
632        self
633    }
634
635    /// Sets or clears the value of [forwarding_rule_target][crate::model::Endpoint::forwarding_rule_target].
636    ///
637    /// # Example
638    /// ```ignore,no_run
639    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
640    /// use google_cloud_networkmanagement_v1::model::endpoint::ForwardingRuleTarget;
641    /// let x0 = Endpoint::new().set_or_clear_forwarding_rule_target(Some(ForwardingRuleTarget::Instance));
642    /// let x1 = Endpoint::new().set_or_clear_forwarding_rule_target(Some(ForwardingRuleTarget::LoadBalancer));
643    /// let x2 = Endpoint::new().set_or_clear_forwarding_rule_target(Some(ForwardingRuleTarget::VpnGateway));
644    /// let x_none = Endpoint::new().set_or_clear_forwarding_rule_target(None::<ForwardingRuleTarget>);
645    /// ```
646    pub fn set_or_clear_forwarding_rule_target<T>(mut self, v: std::option::Option<T>) -> Self
647    where
648        T: std::convert::Into<crate::model::endpoint::ForwardingRuleTarget>,
649    {
650        self.forwarding_rule_target = v.map(|x| x.into());
651        self
652    }
653
654    /// Sets the value of [load_balancer_id][crate::model::Endpoint::load_balancer_id].
655    ///
656    /// # Example
657    /// ```ignore,no_run
658    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
659    /// let x = Endpoint::new().set_load_balancer_id("example");
660    /// ```
661    pub fn set_load_balancer_id<T>(mut self, v: T) -> Self
662    where
663        T: std::convert::Into<std::string::String>,
664    {
665        self.load_balancer_id = std::option::Option::Some(v.into());
666        self
667    }
668
669    /// Sets or clears the value of [load_balancer_id][crate::model::Endpoint::load_balancer_id].
670    ///
671    /// # Example
672    /// ```ignore,no_run
673    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
674    /// let x = Endpoint::new().set_or_clear_load_balancer_id(Some("example"));
675    /// let x = Endpoint::new().set_or_clear_load_balancer_id(None::<String>);
676    /// ```
677    pub fn set_or_clear_load_balancer_id<T>(mut self, v: std::option::Option<T>) -> Self
678    where
679        T: std::convert::Into<std::string::String>,
680    {
681        self.load_balancer_id = v.map(|x| x.into());
682        self
683    }
684
685    /// Sets the value of [load_balancer_type][crate::model::Endpoint::load_balancer_type].
686    ///
687    /// # Example
688    /// ```ignore,no_run
689    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
690    /// use google_cloud_networkmanagement_v1::model::LoadBalancerType;
691    /// let x0 = Endpoint::new().set_load_balancer_type(LoadBalancerType::HttpsAdvancedLoadBalancer);
692    /// let x1 = Endpoint::new().set_load_balancer_type(LoadBalancerType::HttpsLoadBalancer);
693    /// let x2 = Endpoint::new().set_load_balancer_type(LoadBalancerType::RegionalHttpsLoadBalancer);
694    /// ```
695    pub fn set_load_balancer_type<T>(mut self, v: T) -> Self
696    where
697        T: std::convert::Into<crate::model::LoadBalancerType>,
698    {
699        self.load_balancer_type = std::option::Option::Some(v.into());
700        self
701    }
702
703    /// Sets or clears the value of [load_balancer_type][crate::model::Endpoint::load_balancer_type].
704    ///
705    /// # Example
706    /// ```ignore,no_run
707    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
708    /// use google_cloud_networkmanagement_v1::model::LoadBalancerType;
709    /// let x0 = Endpoint::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::HttpsAdvancedLoadBalancer));
710    /// let x1 = Endpoint::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::HttpsLoadBalancer));
711    /// let x2 = Endpoint::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::RegionalHttpsLoadBalancer));
712    /// let x_none = Endpoint::new().set_or_clear_load_balancer_type(None::<LoadBalancerType>);
713    /// ```
714    pub fn set_or_clear_load_balancer_type<T>(mut self, v: std::option::Option<T>) -> Self
715    where
716        T: std::convert::Into<crate::model::LoadBalancerType>,
717    {
718        self.load_balancer_type = v.map(|x| x.into());
719        self
720    }
721
722    /// Sets the value of [gke_master_cluster][crate::model::Endpoint::gke_master_cluster].
723    ///
724    /// # Example
725    /// ```ignore,no_run
726    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
727    /// let x = Endpoint::new().set_gke_master_cluster("example");
728    /// ```
729    pub fn set_gke_master_cluster<T: std::convert::Into<std::string::String>>(
730        mut self,
731        v: T,
732    ) -> Self {
733        self.gke_master_cluster = v.into();
734        self
735    }
736
737    /// Sets the value of [fqdn][crate::model::Endpoint::fqdn].
738    ///
739    /// # Example
740    /// ```ignore,no_run
741    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
742    /// let x = Endpoint::new().set_fqdn("example");
743    /// ```
744    pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
745        self.fqdn = v.into();
746        self
747    }
748
749    /// Sets the value of [cloud_sql_instance][crate::model::Endpoint::cloud_sql_instance].
750    ///
751    /// # Example
752    /// ```ignore,no_run
753    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
754    /// let x = Endpoint::new().set_cloud_sql_instance("example");
755    /// ```
756    pub fn set_cloud_sql_instance<T: std::convert::Into<std::string::String>>(
757        mut self,
758        v: T,
759    ) -> Self {
760        self.cloud_sql_instance = v.into();
761        self
762    }
763
764    /// Sets the value of [redis_instance][crate::model::Endpoint::redis_instance].
765    ///
766    /// # Example
767    /// ```ignore,no_run
768    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
769    /// let x = Endpoint::new().set_redis_instance("example");
770    /// ```
771    pub fn set_redis_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
772        self.redis_instance = v.into();
773        self
774    }
775
776    /// Sets the value of [redis_cluster][crate::model::Endpoint::redis_cluster].
777    ///
778    /// # Example
779    /// ```ignore,no_run
780    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
781    /// let x = Endpoint::new().set_redis_cluster("example");
782    /// ```
783    pub fn set_redis_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
784        self.redis_cluster = v.into();
785        self
786    }
787
788    /// Sets the value of [gke_pod][crate::model::Endpoint::gke_pod].
789    ///
790    /// # Example
791    /// ```ignore,no_run
792    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
793    /// let x = Endpoint::new().set_gke_pod("example");
794    /// ```
795    pub fn set_gke_pod<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
796        self.gke_pod = v.into();
797        self
798    }
799
800    /// Sets the value of [cloud_function][crate::model::Endpoint::cloud_function].
801    ///
802    /// # Example
803    /// ```ignore,no_run
804    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
805    /// use google_cloud_networkmanagement_v1::model::endpoint::CloudFunctionEndpoint;
806    /// let x = Endpoint::new().set_cloud_function(CloudFunctionEndpoint::default()/* use setters */);
807    /// ```
808    pub fn set_cloud_function<T>(mut self, v: T) -> Self
809    where
810        T: std::convert::Into<crate::model::endpoint::CloudFunctionEndpoint>,
811    {
812        self.cloud_function = std::option::Option::Some(v.into());
813        self
814    }
815
816    /// Sets or clears the value of [cloud_function][crate::model::Endpoint::cloud_function].
817    ///
818    /// # Example
819    /// ```ignore,no_run
820    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
821    /// use google_cloud_networkmanagement_v1::model::endpoint::CloudFunctionEndpoint;
822    /// let x = Endpoint::new().set_or_clear_cloud_function(Some(CloudFunctionEndpoint::default()/* use setters */));
823    /// let x = Endpoint::new().set_or_clear_cloud_function(None::<CloudFunctionEndpoint>);
824    /// ```
825    pub fn set_or_clear_cloud_function<T>(mut self, v: std::option::Option<T>) -> Self
826    where
827        T: std::convert::Into<crate::model::endpoint::CloudFunctionEndpoint>,
828    {
829        self.cloud_function = v.map(|x| x.into());
830        self
831    }
832
833    /// Sets the value of [app_engine_version][crate::model::Endpoint::app_engine_version].
834    ///
835    /// # Example
836    /// ```ignore,no_run
837    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
838    /// use google_cloud_networkmanagement_v1::model::endpoint::AppEngineVersionEndpoint;
839    /// let x = Endpoint::new().set_app_engine_version(AppEngineVersionEndpoint::default()/* use setters */);
840    /// ```
841    pub fn set_app_engine_version<T>(mut self, v: T) -> Self
842    where
843        T: std::convert::Into<crate::model::endpoint::AppEngineVersionEndpoint>,
844    {
845        self.app_engine_version = std::option::Option::Some(v.into());
846        self
847    }
848
849    /// Sets or clears the value of [app_engine_version][crate::model::Endpoint::app_engine_version].
850    ///
851    /// # Example
852    /// ```ignore,no_run
853    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
854    /// use google_cloud_networkmanagement_v1::model::endpoint::AppEngineVersionEndpoint;
855    /// let x = Endpoint::new().set_or_clear_app_engine_version(Some(AppEngineVersionEndpoint::default()/* use setters */));
856    /// let x = Endpoint::new().set_or_clear_app_engine_version(None::<AppEngineVersionEndpoint>);
857    /// ```
858    pub fn set_or_clear_app_engine_version<T>(mut self, v: std::option::Option<T>) -> Self
859    where
860        T: std::convert::Into<crate::model::endpoint::AppEngineVersionEndpoint>,
861    {
862        self.app_engine_version = v.map(|x| x.into());
863        self
864    }
865
866    /// Sets the value of [cloud_run_revision][crate::model::Endpoint::cloud_run_revision].
867    ///
868    /// # Example
869    /// ```ignore,no_run
870    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
871    /// use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
872    /// let x = Endpoint::new().set_cloud_run_revision(CloudRunRevisionEndpoint::default()/* use setters */);
873    /// ```
874    pub fn set_cloud_run_revision<T>(mut self, v: T) -> Self
875    where
876        T: std::convert::Into<crate::model::endpoint::CloudRunRevisionEndpoint>,
877    {
878        self.cloud_run_revision = std::option::Option::Some(v.into());
879        self
880    }
881
882    /// Sets or clears the value of [cloud_run_revision][crate::model::Endpoint::cloud_run_revision].
883    ///
884    /// # Example
885    /// ```ignore,no_run
886    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
887    /// use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
888    /// let x = Endpoint::new().set_or_clear_cloud_run_revision(Some(CloudRunRevisionEndpoint::default()/* use setters */));
889    /// let x = Endpoint::new().set_or_clear_cloud_run_revision(None::<CloudRunRevisionEndpoint>);
890    /// ```
891    pub fn set_or_clear_cloud_run_revision<T>(mut self, v: std::option::Option<T>) -> Self
892    where
893        T: std::convert::Into<crate::model::endpoint::CloudRunRevisionEndpoint>,
894    {
895        self.cloud_run_revision = v.map(|x| x.into());
896        self
897    }
898
899    /// Sets the value of [network][crate::model::Endpoint::network].
900    ///
901    /// # Example
902    /// ```ignore,no_run
903    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
904    /// let x = Endpoint::new().set_network("example");
905    /// ```
906    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
907        self.network = v.into();
908        self
909    }
910
911    /// Sets the value of [network_type][crate::model::Endpoint::network_type].
912    ///
913    /// # Example
914    /// ```ignore,no_run
915    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
916    /// use google_cloud_networkmanagement_v1::model::endpoint::NetworkType;
917    /// let x0 = Endpoint::new().set_network_type(NetworkType::GcpNetwork);
918    /// let x1 = Endpoint::new().set_network_type(NetworkType::NonGcpNetwork);
919    /// let x2 = Endpoint::new().set_network_type(NetworkType::Internet);
920    /// ```
921    pub fn set_network_type<T: std::convert::Into<crate::model::endpoint::NetworkType>>(
922        mut self,
923        v: T,
924    ) -> Self {
925        self.network_type = v.into();
926        self
927    }
928
929    /// Sets the value of [project_id][crate::model::Endpoint::project_id].
930    ///
931    /// # Example
932    /// ```ignore,no_run
933    /// # use google_cloud_networkmanagement_v1::model::Endpoint;
934    /// let x = Endpoint::new().set_project_id("example");
935    /// ```
936    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
937        self.project_id = v.into();
938        self
939    }
940}
941
942impl wkt::message::Message for Endpoint {
943    fn typename() -> &'static str {
944        "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint"
945    }
946}
947
948/// Defines additional types related to [Endpoint].
949pub mod endpoint {
950    #[allow(unused_imports)]
951    use super::*;
952
953    /// Wrapper for Cloud Function attributes.
954    #[derive(Clone, Default, PartialEq)]
955    #[non_exhaustive]
956    pub struct CloudFunctionEndpoint {
957        /// A [Cloud Function](https://cloud.google.com/functions) name.
958        pub uri: std::string::String,
959
960        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
961    }
962
963    impl CloudFunctionEndpoint {
964        /// Creates a new default instance.
965        pub fn new() -> Self {
966            std::default::Default::default()
967        }
968
969        /// Sets the value of [uri][crate::model::endpoint::CloudFunctionEndpoint::uri].
970        ///
971        /// # Example
972        /// ```ignore,no_run
973        /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudFunctionEndpoint;
974        /// let x = CloudFunctionEndpoint::new().set_uri("example");
975        /// ```
976        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
977            self.uri = v.into();
978            self
979        }
980    }
981
982    impl wkt::message::Message for CloudFunctionEndpoint {
983        fn typename() -> &'static str {
984            "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.CloudFunctionEndpoint"
985        }
986    }
987
988    /// Wrapper for the App Engine service version attributes.
989    #[derive(Clone, Default, PartialEq)]
990    #[non_exhaustive]
991    pub struct AppEngineVersionEndpoint {
992        /// An [App Engine](https://cloud.google.com/appengine) [service
993        /// version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions)
994        /// name.
995        pub uri: std::string::String,
996
997        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
998    }
999
1000    impl AppEngineVersionEndpoint {
1001        /// Creates a new default instance.
1002        pub fn new() -> Self {
1003            std::default::Default::default()
1004        }
1005
1006        /// Sets the value of [uri][crate::model::endpoint::AppEngineVersionEndpoint::uri].
1007        ///
1008        /// # Example
1009        /// ```ignore,no_run
1010        /// # use google_cloud_networkmanagement_v1::model::endpoint::AppEngineVersionEndpoint;
1011        /// let x = AppEngineVersionEndpoint::new().set_uri("example");
1012        /// ```
1013        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1014            self.uri = v.into();
1015            self
1016        }
1017    }
1018
1019    impl wkt::message::Message for AppEngineVersionEndpoint {
1020        fn typename() -> &'static str {
1021            "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.AppEngineVersionEndpoint"
1022        }
1023    }
1024
1025    /// Wrapper for Cloud Run revision attributes.
1026    #[derive(Clone, Default, PartialEq)]
1027    #[non_exhaustive]
1028    pub struct CloudRunRevisionEndpoint {
1029        /// A [Cloud Run](https://cloud.google.com/run)
1030        /// [revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get)
1031        /// URI. The format is:
1032        /// projects/{project}/locations/{location}/revisions/{revision}
1033        pub uri: std::string::String,
1034
1035        /// Output only. The URI of the Cloud Run service that the revision belongs
1036        /// to. The format is:
1037        /// projects/{project}/locations/{location}/services/{service}
1038        pub service_uri: std::string::String,
1039
1040        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1041    }
1042
1043    impl CloudRunRevisionEndpoint {
1044        /// Creates a new default instance.
1045        pub fn new() -> Self {
1046            std::default::Default::default()
1047        }
1048
1049        /// Sets the value of [uri][crate::model::endpoint::CloudRunRevisionEndpoint::uri].
1050        ///
1051        /// # Example
1052        /// ```ignore,no_run
1053        /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
1054        /// let x = CloudRunRevisionEndpoint::new().set_uri("example");
1055        /// ```
1056        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1057            self.uri = v.into();
1058            self
1059        }
1060
1061        /// Sets the value of [service_uri][crate::model::endpoint::CloudRunRevisionEndpoint::service_uri].
1062        ///
1063        /// # Example
1064        /// ```ignore,no_run
1065        /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
1066        /// let x = CloudRunRevisionEndpoint::new().set_service_uri("example");
1067        /// ```
1068        pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1069            self.service_uri = v.into();
1070            self
1071        }
1072    }
1073
1074    impl wkt::message::Message for CloudRunRevisionEndpoint {
1075        fn typename() -> &'static str {
1076            "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.CloudRunRevisionEndpoint"
1077        }
1078    }
1079
1080    /// The type of the network of the IP address endpoint. Relevant for the source
1081    /// IP address endpoints.
1082    ///
1083    /// # Working with unknown values
1084    ///
1085    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1086    /// additional enum variants at any time. Adding new variants is not considered
1087    /// a breaking change. Applications should write their code in anticipation of:
1088    ///
1089    /// - New values appearing in future releases of the client library, **and**
1090    /// - New values received dynamically, without application changes.
1091    ///
1092    /// Please consult the [Working with enums] section in the user guide for some
1093    /// guidelines.
1094    ///
1095    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1096    #[derive(Clone, Debug, PartialEq)]
1097    #[non_exhaustive]
1098    pub enum NetworkType {
1099        /// Unspecified. The test will analyze all possible IP address locations.
1100        /// This might take longer and produce inaccurate or ambiguous results, so
1101        /// prefer specifying an explicit network type.
1102        ///
1103        /// The `project_id` field should be set to the project where the GCP
1104        /// endpoint is located, or where the non-GCP endpoint should be reachable
1105        /// from (via routes to non-GCP networks). The project might also be inferred
1106        /// from the Connectivity Test project or other projects referenced in the
1107        /// request.
1108        Unspecified,
1109        /// A VPC network. Should be used for internal IP addresses in VPC networks.
1110        /// The `network` field should be set to the URI of this network. Only
1111        /// endpoints within this network will be considered.
1112        GcpNetwork,
1113        /// A non-GCP network (for example, an on-premises network or another cloud
1114        /// provider network). Should be used for internal IP addresses outside of
1115        /// Google Cloud. The `network` field should be set to the URI of the VPC
1116        /// network containing a corresponding Cloud VPN tunnel, Cloud Interconnect
1117        /// VLAN attachment, or a router appliance instance. Only endpoints reachable
1118        /// from the provided VPC network via the routes to non-GCP networks will be
1119        /// considered.
1120        NonGcpNetwork,
1121        /// Internet. Should be used for internet-routable external IP addresses or
1122        /// IP addresses for global Google APIs and services.
1123        Internet,
1124        /// If set, the enum was initialized with an unknown value.
1125        ///
1126        /// Applications can examine the value using [NetworkType::value] or
1127        /// [NetworkType::name].
1128        UnknownValue(network_type::UnknownValue),
1129    }
1130
1131    #[doc(hidden)]
1132    pub mod network_type {
1133        #[allow(unused_imports)]
1134        use super::*;
1135        #[derive(Clone, Debug, PartialEq)]
1136        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1137    }
1138
1139    impl NetworkType {
1140        /// Gets the enum value.
1141        ///
1142        /// Returns `None` if the enum contains an unknown value deserialized from
1143        /// the string representation of enums.
1144        pub fn value(&self) -> std::option::Option<i32> {
1145            match self {
1146                Self::Unspecified => std::option::Option::Some(0),
1147                Self::GcpNetwork => std::option::Option::Some(1),
1148                Self::NonGcpNetwork => std::option::Option::Some(2),
1149                Self::Internet => std::option::Option::Some(3),
1150                Self::UnknownValue(u) => u.0.value(),
1151            }
1152        }
1153
1154        /// Gets the enum value as a string.
1155        ///
1156        /// Returns `None` if the enum contains an unknown value deserialized from
1157        /// the integer representation of enums.
1158        pub fn name(&self) -> std::option::Option<&str> {
1159            match self {
1160                Self::Unspecified => std::option::Option::Some("NETWORK_TYPE_UNSPECIFIED"),
1161                Self::GcpNetwork => std::option::Option::Some("GCP_NETWORK"),
1162                Self::NonGcpNetwork => std::option::Option::Some("NON_GCP_NETWORK"),
1163                Self::Internet => std::option::Option::Some("INTERNET"),
1164                Self::UnknownValue(u) => u.0.name(),
1165            }
1166        }
1167    }
1168
1169    impl std::default::Default for NetworkType {
1170        fn default() -> Self {
1171            use std::convert::From;
1172            Self::from(0)
1173        }
1174    }
1175
1176    impl std::fmt::Display for NetworkType {
1177        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1178            wkt::internal::display_enum(f, self.name(), self.value())
1179        }
1180    }
1181
1182    impl std::convert::From<i32> for NetworkType {
1183        fn from(value: i32) -> Self {
1184            match value {
1185                0 => Self::Unspecified,
1186                1 => Self::GcpNetwork,
1187                2 => Self::NonGcpNetwork,
1188                3 => Self::Internet,
1189                _ => Self::UnknownValue(network_type::UnknownValue(
1190                    wkt::internal::UnknownEnumValue::Integer(value),
1191                )),
1192            }
1193        }
1194    }
1195
1196    impl std::convert::From<&str> for NetworkType {
1197        fn from(value: &str) -> Self {
1198            use std::string::ToString;
1199            match value {
1200                "NETWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
1201                "GCP_NETWORK" => Self::GcpNetwork,
1202                "NON_GCP_NETWORK" => Self::NonGcpNetwork,
1203                "INTERNET" => Self::Internet,
1204                _ => Self::UnknownValue(network_type::UnknownValue(
1205                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1206                )),
1207            }
1208        }
1209    }
1210
1211    impl serde::ser::Serialize for NetworkType {
1212        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1213        where
1214            S: serde::Serializer,
1215        {
1216            match self {
1217                Self::Unspecified => serializer.serialize_i32(0),
1218                Self::GcpNetwork => serializer.serialize_i32(1),
1219                Self::NonGcpNetwork => serializer.serialize_i32(2),
1220                Self::Internet => serializer.serialize_i32(3),
1221                Self::UnknownValue(u) => u.0.serialize(serializer),
1222            }
1223        }
1224    }
1225
1226    impl<'de> serde::de::Deserialize<'de> for NetworkType {
1227        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1228        where
1229            D: serde::Deserializer<'de>,
1230        {
1231            deserializer.deserialize_any(wkt::internal::EnumVisitor::<NetworkType>::new(
1232                ".google.cloud.networkmanagement.v1.Endpoint.NetworkType",
1233            ))
1234        }
1235    }
1236
1237    /// Type of the target of a forwarding rule.
1238    ///
1239    /// # Working with unknown values
1240    ///
1241    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1242    /// additional enum variants at any time. Adding new variants is not considered
1243    /// a breaking change. Applications should write their code in anticipation of:
1244    ///
1245    /// - New values appearing in future releases of the client library, **and**
1246    /// - New values received dynamically, without application changes.
1247    ///
1248    /// Please consult the [Working with enums] section in the user guide for some
1249    /// guidelines.
1250    ///
1251    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1252    #[derive(Clone, Debug, PartialEq)]
1253    #[non_exhaustive]
1254    pub enum ForwardingRuleTarget {
1255        /// Forwarding rule target is unknown.
1256        Unspecified,
1257        /// Compute Engine instance for protocol forwarding.
1258        Instance,
1259        /// Load Balancer. The specific type can be found from [load_balancer_type]
1260        /// [google.cloud.networkmanagement.v1.Endpoint.load_balancer_type].
1261        LoadBalancer,
1262        /// Classic Cloud VPN Gateway.
1263        VpnGateway,
1264        /// Forwarding Rule is a Private Service Connect endpoint.
1265        Psc,
1266        /// If set, the enum was initialized with an unknown value.
1267        ///
1268        /// Applications can examine the value using [ForwardingRuleTarget::value] or
1269        /// [ForwardingRuleTarget::name].
1270        UnknownValue(forwarding_rule_target::UnknownValue),
1271    }
1272
1273    #[doc(hidden)]
1274    pub mod forwarding_rule_target {
1275        #[allow(unused_imports)]
1276        use super::*;
1277        #[derive(Clone, Debug, PartialEq)]
1278        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1279    }
1280
1281    impl ForwardingRuleTarget {
1282        /// Gets the enum value.
1283        ///
1284        /// Returns `None` if the enum contains an unknown value deserialized from
1285        /// the string representation of enums.
1286        pub fn value(&self) -> std::option::Option<i32> {
1287            match self {
1288                Self::Unspecified => std::option::Option::Some(0),
1289                Self::Instance => std::option::Option::Some(1),
1290                Self::LoadBalancer => std::option::Option::Some(2),
1291                Self::VpnGateway => std::option::Option::Some(3),
1292                Self::Psc => std::option::Option::Some(4),
1293                Self::UnknownValue(u) => u.0.value(),
1294            }
1295        }
1296
1297        /// Gets the enum value as a string.
1298        ///
1299        /// Returns `None` if the enum contains an unknown value deserialized from
1300        /// the integer representation of enums.
1301        pub fn name(&self) -> std::option::Option<&str> {
1302            match self {
1303                Self::Unspecified => {
1304                    std::option::Option::Some("FORWARDING_RULE_TARGET_UNSPECIFIED")
1305                }
1306                Self::Instance => std::option::Option::Some("INSTANCE"),
1307                Self::LoadBalancer => std::option::Option::Some("LOAD_BALANCER"),
1308                Self::VpnGateway => std::option::Option::Some("VPN_GATEWAY"),
1309                Self::Psc => std::option::Option::Some("PSC"),
1310                Self::UnknownValue(u) => u.0.name(),
1311            }
1312        }
1313    }
1314
1315    impl std::default::Default for ForwardingRuleTarget {
1316        fn default() -> Self {
1317            use std::convert::From;
1318            Self::from(0)
1319        }
1320    }
1321
1322    impl std::fmt::Display for ForwardingRuleTarget {
1323        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1324            wkt::internal::display_enum(f, self.name(), self.value())
1325        }
1326    }
1327
1328    impl std::convert::From<i32> for ForwardingRuleTarget {
1329        fn from(value: i32) -> Self {
1330            match value {
1331                0 => Self::Unspecified,
1332                1 => Self::Instance,
1333                2 => Self::LoadBalancer,
1334                3 => Self::VpnGateway,
1335                4 => Self::Psc,
1336                _ => Self::UnknownValue(forwarding_rule_target::UnknownValue(
1337                    wkt::internal::UnknownEnumValue::Integer(value),
1338                )),
1339            }
1340        }
1341    }
1342
1343    impl std::convert::From<&str> for ForwardingRuleTarget {
1344        fn from(value: &str) -> Self {
1345            use std::string::ToString;
1346            match value {
1347                "FORWARDING_RULE_TARGET_UNSPECIFIED" => Self::Unspecified,
1348                "INSTANCE" => Self::Instance,
1349                "LOAD_BALANCER" => Self::LoadBalancer,
1350                "VPN_GATEWAY" => Self::VpnGateway,
1351                "PSC" => Self::Psc,
1352                _ => Self::UnknownValue(forwarding_rule_target::UnknownValue(
1353                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1354                )),
1355            }
1356        }
1357    }
1358
1359    impl serde::ser::Serialize for ForwardingRuleTarget {
1360        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1361        where
1362            S: serde::Serializer,
1363        {
1364            match self {
1365                Self::Unspecified => serializer.serialize_i32(0),
1366                Self::Instance => serializer.serialize_i32(1),
1367                Self::LoadBalancer => serializer.serialize_i32(2),
1368                Self::VpnGateway => serializer.serialize_i32(3),
1369                Self::Psc => serializer.serialize_i32(4),
1370                Self::UnknownValue(u) => u.0.serialize(serializer),
1371            }
1372        }
1373    }
1374
1375    impl<'de> serde::de::Deserialize<'de> for ForwardingRuleTarget {
1376        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1377        where
1378            D: serde::Deserializer<'de>,
1379        {
1380            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ForwardingRuleTarget>::new(
1381                ".google.cloud.networkmanagement.v1.Endpoint.ForwardingRuleTarget",
1382            ))
1383        }
1384    }
1385}
1386
1387/// Results of the configuration analysis from the last run of the test.
1388#[derive(Clone, Default, PartialEq)]
1389#[non_exhaustive]
1390pub struct ReachabilityDetails {
1391    /// The overall result of the test's configuration analysis.
1392    pub result: crate::model::reachability_details::Result,
1393
1394    /// The time of the configuration analysis.
1395    pub verify_time: std::option::Option<wkt::Timestamp>,
1396
1397    /// The details of a failure or a cancellation of reachability analysis.
1398    pub error: std::option::Option<google_cloud_rpc::model::Status>,
1399
1400    /// Result may contain a list of traces if a test has multiple possible
1401    /// paths in the network, such as when destination endpoint is a load balancer
1402    /// with multiple backends.
1403    pub traces: std::vec::Vec<crate::model::Trace>,
1404
1405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1406}
1407
1408impl ReachabilityDetails {
1409    /// Creates a new default instance.
1410    pub fn new() -> Self {
1411        std::default::Default::default()
1412    }
1413
1414    /// Sets the value of [result][crate::model::ReachabilityDetails::result].
1415    ///
1416    /// # Example
1417    /// ```ignore,no_run
1418    /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1419    /// use google_cloud_networkmanagement_v1::model::reachability_details::Result;
1420    /// let x0 = ReachabilityDetails::new().set_result(Result::Reachable);
1421    /// let x1 = ReachabilityDetails::new().set_result(Result::Unreachable);
1422    /// let x2 = ReachabilityDetails::new().set_result(Result::Ambiguous);
1423    /// ```
1424    pub fn set_result<T: std::convert::Into<crate::model::reachability_details::Result>>(
1425        mut self,
1426        v: T,
1427    ) -> Self {
1428        self.result = v.into();
1429        self
1430    }
1431
1432    /// Sets the value of [verify_time][crate::model::ReachabilityDetails::verify_time].
1433    ///
1434    /// # Example
1435    /// ```ignore,no_run
1436    /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1437    /// use wkt::Timestamp;
1438    /// let x = ReachabilityDetails::new().set_verify_time(Timestamp::default()/* use setters */);
1439    /// ```
1440    pub fn set_verify_time<T>(mut self, v: T) -> Self
1441    where
1442        T: std::convert::Into<wkt::Timestamp>,
1443    {
1444        self.verify_time = std::option::Option::Some(v.into());
1445        self
1446    }
1447
1448    /// Sets or clears the value of [verify_time][crate::model::ReachabilityDetails::verify_time].
1449    ///
1450    /// # Example
1451    /// ```ignore,no_run
1452    /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1453    /// use wkt::Timestamp;
1454    /// let x = ReachabilityDetails::new().set_or_clear_verify_time(Some(Timestamp::default()/* use setters */));
1455    /// let x = ReachabilityDetails::new().set_or_clear_verify_time(None::<Timestamp>);
1456    /// ```
1457    pub fn set_or_clear_verify_time<T>(mut self, v: std::option::Option<T>) -> Self
1458    where
1459        T: std::convert::Into<wkt::Timestamp>,
1460    {
1461        self.verify_time = v.map(|x| x.into());
1462        self
1463    }
1464
1465    /// Sets the value of [error][crate::model::ReachabilityDetails::error].
1466    ///
1467    /// # Example
1468    /// ```ignore,no_run
1469    /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1470    /// use google_cloud_rpc::model::Status;
1471    /// let x = ReachabilityDetails::new().set_error(Status::default()/* use setters */);
1472    /// ```
1473    pub fn set_error<T>(mut self, v: T) -> Self
1474    where
1475        T: std::convert::Into<google_cloud_rpc::model::Status>,
1476    {
1477        self.error = std::option::Option::Some(v.into());
1478        self
1479    }
1480
1481    /// Sets or clears the value of [error][crate::model::ReachabilityDetails::error].
1482    ///
1483    /// # Example
1484    /// ```ignore,no_run
1485    /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1486    /// use google_cloud_rpc::model::Status;
1487    /// let x = ReachabilityDetails::new().set_or_clear_error(Some(Status::default()/* use setters */));
1488    /// let x = ReachabilityDetails::new().set_or_clear_error(None::<Status>);
1489    /// ```
1490    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1491    where
1492        T: std::convert::Into<google_cloud_rpc::model::Status>,
1493    {
1494        self.error = v.map(|x| x.into());
1495        self
1496    }
1497
1498    /// Sets the value of [traces][crate::model::ReachabilityDetails::traces].
1499    ///
1500    /// # Example
1501    /// ```ignore,no_run
1502    /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1503    /// use google_cloud_networkmanagement_v1::model::Trace;
1504    /// let x = ReachabilityDetails::new()
1505    ///     .set_traces([
1506    ///         Trace::default()/* use setters */,
1507    ///         Trace::default()/* use (different) setters */,
1508    ///     ]);
1509    /// ```
1510    pub fn set_traces<T, V>(mut self, v: T) -> Self
1511    where
1512        T: std::iter::IntoIterator<Item = V>,
1513        V: std::convert::Into<crate::model::Trace>,
1514    {
1515        use std::iter::Iterator;
1516        self.traces = v.into_iter().map(|i| i.into()).collect();
1517        self
1518    }
1519}
1520
1521impl wkt::message::Message for ReachabilityDetails {
1522    fn typename() -> &'static str {
1523        "type.googleapis.com/google.cloud.networkmanagement.v1.ReachabilityDetails"
1524    }
1525}
1526
1527/// Defines additional types related to [ReachabilityDetails].
1528pub mod reachability_details {
1529    #[allow(unused_imports)]
1530    use super::*;
1531
1532    /// The overall result of the test's configuration analysis.
1533    ///
1534    /// # Working with unknown values
1535    ///
1536    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1537    /// additional enum variants at any time. Adding new variants is not considered
1538    /// a breaking change. Applications should write their code in anticipation of:
1539    ///
1540    /// - New values appearing in future releases of the client library, **and**
1541    /// - New values received dynamically, without application changes.
1542    ///
1543    /// Please consult the [Working with enums] section in the user guide for some
1544    /// guidelines.
1545    ///
1546    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1547    #[derive(Clone, Debug, PartialEq)]
1548    #[non_exhaustive]
1549    pub enum Result {
1550        /// No result was specified.
1551        Unspecified,
1552        /// Possible scenarios are:
1553        ///
1554        /// * The configuration analysis determined that a packet originating from
1555        ///   the source is expected to reach the destination.
1556        /// * The analysis didn't complete because the user lacks permission for
1557        ///   some of the resources in the trace. However, at the time the user's
1558        ///   permission became insufficient, the trace had been successful so far.
1559        Reachable,
1560        /// A packet originating from the source is expected to be dropped before
1561        /// reaching the destination.
1562        Unreachable,
1563        /// The source and destination endpoints do not uniquely identify
1564        /// the test location in the network, and the reachability result contains
1565        /// multiple traces. For some traces, a packet could be delivered, and for
1566        /// others, it would not be. This result is also assigned to
1567        /// configuration analysis of return path if on its own it should be
1568        /// REACHABLE, but configuration analysis of forward path is AMBIGUOUS.
1569        Ambiguous,
1570        /// The configuration analysis did not complete. Possible reasons are:
1571        ///
1572        /// * A permissions error occurred--for example, the user might not have
1573        ///   read permission for all of the resources named in the test.
1574        /// * An internal error occurred.
1575        /// * The analyzer received an invalid or unsupported argument or was unable
1576        ///   to identify a known endpoint.
1577        Undetermined,
1578        /// If set, the enum was initialized with an unknown value.
1579        ///
1580        /// Applications can examine the value using [Result::value] or
1581        /// [Result::name].
1582        UnknownValue(result::UnknownValue),
1583    }
1584
1585    #[doc(hidden)]
1586    pub mod result {
1587        #[allow(unused_imports)]
1588        use super::*;
1589        #[derive(Clone, Debug, PartialEq)]
1590        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1591    }
1592
1593    impl Result {
1594        /// Gets the enum value.
1595        ///
1596        /// Returns `None` if the enum contains an unknown value deserialized from
1597        /// the string representation of enums.
1598        pub fn value(&self) -> std::option::Option<i32> {
1599            match self {
1600                Self::Unspecified => std::option::Option::Some(0),
1601                Self::Reachable => std::option::Option::Some(1),
1602                Self::Unreachable => std::option::Option::Some(2),
1603                Self::Ambiguous => std::option::Option::Some(4),
1604                Self::Undetermined => std::option::Option::Some(5),
1605                Self::UnknownValue(u) => u.0.value(),
1606            }
1607        }
1608
1609        /// Gets the enum value as a string.
1610        ///
1611        /// Returns `None` if the enum contains an unknown value deserialized from
1612        /// the integer representation of enums.
1613        pub fn name(&self) -> std::option::Option<&str> {
1614            match self {
1615                Self::Unspecified => std::option::Option::Some("RESULT_UNSPECIFIED"),
1616                Self::Reachable => std::option::Option::Some("REACHABLE"),
1617                Self::Unreachable => std::option::Option::Some("UNREACHABLE"),
1618                Self::Ambiguous => std::option::Option::Some("AMBIGUOUS"),
1619                Self::Undetermined => std::option::Option::Some("UNDETERMINED"),
1620                Self::UnknownValue(u) => u.0.name(),
1621            }
1622        }
1623    }
1624
1625    impl std::default::Default for Result {
1626        fn default() -> Self {
1627            use std::convert::From;
1628            Self::from(0)
1629        }
1630    }
1631
1632    impl std::fmt::Display for Result {
1633        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1634            wkt::internal::display_enum(f, self.name(), self.value())
1635        }
1636    }
1637
1638    impl std::convert::From<i32> for Result {
1639        fn from(value: i32) -> Self {
1640            match value {
1641                0 => Self::Unspecified,
1642                1 => Self::Reachable,
1643                2 => Self::Unreachable,
1644                4 => Self::Ambiguous,
1645                5 => Self::Undetermined,
1646                _ => Self::UnknownValue(result::UnknownValue(
1647                    wkt::internal::UnknownEnumValue::Integer(value),
1648                )),
1649            }
1650        }
1651    }
1652
1653    impl std::convert::From<&str> for Result {
1654        fn from(value: &str) -> Self {
1655            use std::string::ToString;
1656            match value {
1657                "RESULT_UNSPECIFIED" => Self::Unspecified,
1658                "REACHABLE" => Self::Reachable,
1659                "UNREACHABLE" => Self::Unreachable,
1660                "AMBIGUOUS" => Self::Ambiguous,
1661                "UNDETERMINED" => Self::Undetermined,
1662                _ => Self::UnknownValue(result::UnknownValue(
1663                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1664                )),
1665            }
1666        }
1667    }
1668
1669    impl serde::ser::Serialize for Result {
1670        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1671        where
1672            S: serde::Serializer,
1673        {
1674            match self {
1675                Self::Unspecified => serializer.serialize_i32(0),
1676                Self::Reachable => serializer.serialize_i32(1),
1677                Self::Unreachable => serializer.serialize_i32(2),
1678                Self::Ambiguous => serializer.serialize_i32(4),
1679                Self::Undetermined => serializer.serialize_i32(5),
1680                Self::UnknownValue(u) => u.0.serialize(serializer),
1681            }
1682        }
1683    }
1684
1685    impl<'de> serde::de::Deserialize<'de> for Result {
1686        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1687        where
1688            D: serde::Deserializer<'de>,
1689        {
1690            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Result>::new(
1691                ".google.cloud.networkmanagement.v1.ReachabilityDetails.Result",
1692            ))
1693        }
1694    }
1695}
1696
1697/// Latency percentile rank and value.
1698#[derive(Clone, Default, PartialEq)]
1699#[non_exhaustive]
1700pub struct LatencyPercentile {
1701    /// Percentage of samples this data point applies to.
1702    pub percent: i32,
1703
1704    /// percent-th percentile of latency observed, in microseconds.
1705    /// Fraction of percent/100 of samples have latency lower or
1706    /// equal to the value of this field.
1707    pub latency_micros: i64,
1708
1709    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1710}
1711
1712impl LatencyPercentile {
1713    /// Creates a new default instance.
1714    pub fn new() -> Self {
1715        std::default::Default::default()
1716    }
1717
1718    /// Sets the value of [percent][crate::model::LatencyPercentile::percent].
1719    ///
1720    /// # Example
1721    /// ```ignore,no_run
1722    /// # use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1723    /// let x = LatencyPercentile::new().set_percent(42);
1724    /// ```
1725    pub fn set_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1726        self.percent = v.into();
1727        self
1728    }
1729
1730    /// Sets the value of [latency_micros][crate::model::LatencyPercentile::latency_micros].
1731    ///
1732    /// # Example
1733    /// ```ignore,no_run
1734    /// # use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1735    /// let x = LatencyPercentile::new().set_latency_micros(42);
1736    /// ```
1737    pub fn set_latency_micros<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1738        self.latency_micros = v.into();
1739        self
1740    }
1741}
1742
1743impl wkt::message::Message for LatencyPercentile {
1744    fn typename() -> &'static str {
1745        "type.googleapis.com/google.cloud.networkmanagement.v1.LatencyPercentile"
1746    }
1747}
1748
1749/// Describes measured latency distribution.
1750#[derive(Clone, Default, PartialEq)]
1751#[non_exhaustive]
1752pub struct LatencyDistribution {
1753    /// Representative latency percentiles.
1754    pub latency_percentiles: std::vec::Vec<crate::model::LatencyPercentile>,
1755
1756    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1757}
1758
1759impl LatencyDistribution {
1760    /// Creates a new default instance.
1761    pub fn new() -> Self {
1762        std::default::Default::default()
1763    }
1764
1765    /// Sets the value of [latency_percentiles][crate::model::LatencyDistribution::latency_percentiles].
1766    ///
1767    /// # Example
1768    /// ```ignore,no_run
1769    /// # use google_cloud_networkmanagement_v1::model::LatencyDistribution;
1770    /// use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1771    /// let x = LatencyDistribution::new()
1772    ///     .set_latency_percentiles([
1773    ///         LatencyPercentile::default()/* use setters */,
1774    ///         LatencyPercentile::default()/* use (different) setters */,
1775    ///     ]);
1776    /// ```
1777    pub fn set_latency_percentiles<T, V>(mut self, v: T) -> Self
1778    where
1779        T: std::iter::IntoIterator<Item = V>,
1780        V: std::convert::Into<crate::model::LatencyPercentile>,
1781    {
1782        use std::iter::Iterator;
1783        self.latency_percentiles = v.into_iter().map(|i| i.into()).collect();
1784        self
1785    }
1786}
1787
1788impl wkt::message::Message for LatencyDistribution {
1789    fn typename() -> &'static str {
1790        "type.googleapis.com/google.cloud.networkmanagement.v1.LatencyDistribution"
1791    }
1792}
1793
1794/// Results of active probing from the last run of the test.
1795#[derive(Clone, Default, PartialEq)]
1796#[non_exhaustive]
1797pub struct ProbingDetails {
1798    /// The overall result of active probing.
1799    pub result: crate::model::probing_details::ProbingResult,
1800
1801    /// The time that reachability was assessed through active probing.
1802    pub verify_time: std::option::Option<wkt::Timestamp>,
1803
1804    /// Details about an internal failure or the cancellation of active probing.
1805    pub error: std::option::Option<google_cloud_rpc::model::Status>,
1806
1807    /// The reason probing was aborted.
1808    pub abort_cause: crate::model::probing_details::ProbingAbortCause,
1809
1810    /// Number of probes sent.
1811    pub sent_probe_count: i32,
1812
1813    /// Number of probes that reached the destination.
1814    pub successful_probe_count: i32,
1815
1816    /// The source and destination endpoints derived from the test input and used
1817    /// for active probing.
1818    pub endpoint_info: std::option::Option<crate::model::EndpointInfo>,
1819
1820    /// Latency as measured by active probing in one direction:
1821    /// from the source to the destination endpoint.
1822    pub probing_latency: std::option::Option<crate::model::LatencyDistribution>,
1823
1824    /// The EdgeLocation from which a packet, destined to the internet, will egress
1825    /// the Google network.
1826    /// This will only be populated for a connectivity test which has an internet
1827    /// destination address.
1828    /// The absence of this field *must not* be used as an indication that the
1829    /// destination is part of the Google network.
1830    pub destination_egress_location:
1831        std::option::Option<crate::model::probing_details::EdgeLocation>,
1832
1833    /// Probing results for all edge devices.
1834    pub edge_responses: std::vec::Vec<crate::model::probing_details::SingleEdgeResponse>,
1835
1836    /// Whether all relevant edge devices were probed.
1837    pub probed_all_devices: bool,
1838
1839    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1840}
1841
1842impl ProbingDetails {
1843    /// Creates a new default instance.
1844    pub fn new() -> Self {
1845        std::default::Default::default()
1846    }
1847
1848    /// Sets the value of [result][crate::model::ProbingDetails::result].
1849    ///
1850    /// # Example
1851    /// ```ignore,no_run
1852    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1853    /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingResult;
1854    /// let x0 = ProbingDetails::new().set_result(ProbingResult::Reachable);
1855    /// let x1 = ProbingDetails::new().set_result(ProbingResult::Unreachable);
1856    /// let x2 = ProbingDetails::new().set_result(ProbingResult::ReachabilityInconsistent);
1857    /// ```
1858    pub fn set_result<T: std::convert::Into<crate::model::probing_details::ProbingResult>>(
1859        mut self,
1860        v: T,
1861    ) -> Self {
1862        self.result = v.into();
1863        self
1864    }
1865
1866    /// Sets the value of [verify_time][crate::model::ProbingDetails::verify_time].
1867    ///
1868    /// # Example
1869    /// ```ignore,no_run
1870    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1871    /// use wkt::Timestamp;
1872    /// let x = ProbingDetails::new().set_verify_time(Timestamp::default()/* use setters */);
1873    /// ```
1874    pub fn set_verify_time<T>(mut self, v: T) -> Self
1875    where
1876        T: std::convert::Into<wkt::Timestamp>,
1877    {
1878        self.verify_time = std::option::Option::Some(v.into());
1879        self
1880    }
1881
1882    /// Sets or clears the value of [verify_time][crate::model::ProbingDetails::verify_time].
1883    ///
1884    /// # Example
1885    /// ```ignore,no_run
1886    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1887    /// use wkt::Timestamp;
1888    /// let x = ProbingDetails::new().set_or_clear_verify_time(Some(Timestamp::default()/* use setters */));
1889    /// let x = ProbingDetails::new().set_or_clear_verify_time(None::<Timestamp>);
1890    /// ```
1891    pub fn set_or_clear_verify_time<T>(mut self, v: std::option::Option<T>) -> Self
1892    where
1893        T: std::convert::Into<wkt::Timestamp>,
1894    {
1895        self.verify_time = v.map(|x| x.into());
1896        self
1897    }
1898
1899    /// Sets the value of [error][crate::model::ProbingDetails::error].
1900    ///
1901    /// # Example
1902    /// ```ignore,no_run
1903    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1904    /// use google_cloud_rpc::model::Status;
1905    /// let x = ProbingDetails::new().set_error(Status::default()/* use setters */);
1906    /// ```
1907    pub fn set_error<T>(mut self, v: T) -> Self
1908    where
1909        T: std::convert::Into<google_cloud_rpc::model::Status>,
1910    {
1911        self.error = std::option::Option::Some(v.into());
1912        self
1913    }
1914
1915    /// Sets or clears the value of [error][crate::model::ProbingDetails::error].
1916    ///
1917    /// # Example
1918    /// ```ignore,no_run
1919    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1920    /// use google_cloud_rpc::model::Status;
1921    /// let x = ProbingDetails::new().set_or_clear_error(Some(Status::default()/* use setters */));
1922    /// let x = ProbingDetails::new().set_or_clear_error(None::<Status>);
1923    /// ```
1924    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1925    where
1926        T: std::convert::Into<google_cloud_rpc::model::Status>,
1927    {
1928        self.error = v.map(|x| x.into());
1929        self
1930    }
1931
1932    /// Sets the value of [abort_cause][crate::model::ProbingDetails::abort_cause].
1933    ///
1934    /// # Example
1935    /// ```ignore,no_run
1936    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1937    /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingAbortCause;
1938    /// let x0 = ProbingDetails::new().set_abort_cause(ProbingAbortCause::PermissionDenied);
1939    /// let x1 = ProbingDetails::new().set_abort_cause(ProbingAbortCause::NoSourceLocation);
1940    /// ```
1941    pub fn set_abort_cause<
1942        T: std::convert::Into<crate::model::probing_details::ProbingAbortCause>,
1943    >(
1944        mut self,
1945        v: T,
1946    ) -> Self {
1947        self.abort_cause = v.into();
1948        self
1949    }
1950
1951    /// Sets the value of [sent_probe_count][crate::model::ProbingDetails::sent_probe_count].
1952    ///
1953    /// # Example
1954    /// ```ignore,no_run
1955    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1956    /// let x = ProbingDetails::new().set_sent_probe_count(42);
1957    /// ```
1958    pub fn set_sent_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1959        self.sent_probe_count = v.into();
1960        self
1961    }
1962
1963    /// Sets the value of [successful_probe_count][crate::model::ProbingDetails::successful_probe_count].
1964    ///
1965    /// # Example
1966    /// ```ignore,no_run
1967    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1968    /// let x = ProbingDetails::new().set_successful_probe_count(42);
1969    /// ```
1970    pub fn set_successful_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1971        self.successful_probe_count = v.into();
1972        self
1973    }
1974
1975    /// Sets the value of [endpoint_info][crate::model::ProbingDetails::endpoint_info].
1976    ///
1977    /// # Example
1978    /// ```ignore,no_run
1979    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1980    /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
1981    /// let x = ProbingDetails::new().set_endpoint_info(EndpointInfo::default()/* use setters */);
1982    /// ```
1983    pub fn set_endpoint_info<T>(mut self, v: T) -> Self
1984    where
1985        T: std::convert::Into<crate::model::EndpointInfo>,
1986    {
1987        self.endpoint_info = std::option::Option::Some(v.into());
1988        self
1989    }
1990
1991    /// Sets or clears the value of [endpoint_info][crate::model::ProbingDetails::endpoint_info].
1992    ///
1993    /// # Example
1994    /// ```ignore,no_run
1995    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1996    /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
1997    /// let x = ProbingDetails::new().set_or_clear_endpoint_info(Some(EndpointInfo::default()/* use setters */));
1998    /// let x = ProbingDetails::new().set_or_clear_endpoint_info(None::<EndpointInfo>);
1999    /// ```
2000    pub fn set_or_clear_endpoint_info<T>(mut self, v: std::option::Option<T>) -> Self
2001    where
2002        T: std::convert::Into<crate::model::EndpointInfo>,
2003    {
2004        self.endpoint_info = v.map(|x| x.into());
2005        self
2006    }
2007
2008    /// Sets the value of [probing_latency][crate::model::ProbingDetails::probing_latency].
2009    ///
2010    /// # Example
2011    /// ```ignore,no_run
2012    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2013    /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2014    /// let x = ProbingDetails::new().set_probing_latency(LatencyDistribution::default()/* use setters */);
2015    /// ```
2016    pub fn set_probing_latency<T>(mut self, v: T) -> Self
2017    where
2018        T: std::convert::Into<crate::model::LatencyDistribution>,
2019    {
2020        self.probing_latency = std::option::Option::Some(v.into());
2021        self
2022    }
2023
2024    /// Sets or clears the value of [probing_latency][crate::model::ProbingDetails::probing_latency].
2025    ///
2026    /// # Example
2027    /// ```ignore,no_run
2028    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2029    /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2030    /// let x = ProbingDetails::new().set_or_clear_probing_latency(Some(LatencyDistribution::default()/* use setters */));
2031    /// let x = ProbingDetails::new().set_or_clear_probing_latency(None::<LatencyDistribution>);
2032    /// ```
2033    pub fn set_or_clear_probing_latency<T>(mut self, v: std::option::Option<T>) -> Self
2034    where
2035        T: std::convert::Into<crate::model::LatencyDistribution>,
2036    {
2037        self.probing_latency = v.map(|x| x.into());
2038        self
2039    }
2040
2041    /// Sets the value of [destination_egress_location][crate::model::ProbingDetails::destination_egress_location].
2042    ///
2043    /// # Example
2044    /// ```ignore,no_run
2045    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2046    /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2047    /// let x = ProbingDetails::new().set_destination_egress_location(EdgeLocation::default()/* use setters */);
2048    /// ```
2049    pub fn set_destination_egress_location<T>(mut self, v: T) -> Self
2050    where
2051        T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2052    {
2053        self.destination_egress_location = std::option::Option::Some(v.into());
2054        self
2055    }
2056
2057    /// Sets or clears the value of [destination_egress_location][crate::model::ProbingDetails::destination_egress_location].
2058    ///
2059    /// # Example
2060    /// ```ignore,no_run
2061    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2062    /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2063    /// let x = ProbingDetails::new().set_or_clear_destination_egress_location(Some(EdgeLocation::default()/* use setters */));
2064    /// let x = ProbingDetails::new().set_or_clear_destination_egress_location(None::<EdgeLocation>);
2065    /// ```
2066    pub fn set_or_clear_destination_egress_location<T>(mut self, v: std::option::Option<T>) -> Self
2067    where
2068        T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2069    {
2070        self.destination_egress_location = v.map(|x| x.into());
2071        self
2072    }
2073
2074    /// Sets the value of [edge_responses][crate::model::ProbingDetails::edge_responses].
2075    ///
2076    /// # Example
2077    /// ```ignore,no_run
2078    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2079    /// use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2080    /// let x = ProbingDetails::new()
2081    ///     .set_edge_responses([
2082    ///         SingleEdgeResponse::default()/* use setters */,
2083    ///         SingleEdgeResponse::default()/* use (different) setters */,
2084    ///     ]);
2085    /// ```
2086    pub fn set_edge_responses<T, V>(mut self, v: T) -> Self
2087    where
2088        T: std::iter::IntoIterator<Item = V>,
2089        V: std::convert::Into<crate::model::probing_details::SingleEdgeResponse>,
2090    {
2091        use std::iter::Iterator;
2092        self.edge_responses = v.into_iter().map(|i| i.into()).collect();
2093        self
2094    }
2095
2096    /// Sets the value of [probed_all_devices][crate::model::ProbingDetails::probed_all_devices].
2097    ///
2098    /// # Example
2099    /// ```ignore,no_run
2100    /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2101    /// let x = ProbingDetails::new().set_probed_all_devices(true);
2102    /// ```
2103    pub fn set_probed_all_devices<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2104        self.probed_all_devices = v.into();
2105        self
2106    }
2107}
2108
2109impl wkt::message::Message for ProbingDetails {
2110    fn typename() -> &'static str {
2111        "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails"
2112    }
2113}
2114
2115/// Defines additional types related to [ProbingDetails].
2116pub mod probing_details {
2117    #[allow(unused_imports)]
2118    use super::*;
2119
2120    /// Representation of a network edge location as per
2121    /// <https://cloud.google.com/vpc/docs/edge-locations>.
2122    #[derive(Clone, Default, PartialEq)]
2123    #[non_exhaustive]
2124    pub struct EdgeLocation {
2125        /// Name of the metropolitan area.
2126        pub metropolitan_area: std::string::String,
2127
2128        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2129    }
2130
2131    impl EdgeLocation {
2132        /// Creates a new default instance.
2133        pub fn new() -> Self {
2134            std::default::Default::default()
2135        }
2136
2137        /// Sets the value of [metropolitan_area][crate::model::probing_details::EdgeLocation::metropolitan_area].
2138        ///
2139        /// # Example
2140        /// ```ignore,no_run
2141        /// # use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2142        /// let x = EdgeLocation::new().set_metropolitan_area("example");
2143        /// ```
2144        pub fn set_metropolitan_area<T: std::convert::Into<std::string::String>>(
2145            mut self,
2146            v: T,
2147        ) -> Self {
2148            self.metropolitan_area = v.into();
2149            self
2150        }
2151    }
2152
2153    impl wkt::message::Message for EdgeLocation {
2154        fn typename() -> &'static str {
2155            "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails.EdgeLocation"
2156        }
2157    }
2158
2159    /// Probing results for a single edge device.
2160    #[derive(Clone, Default, PartialEq)]
2161    #[non_exhaustive]
2162    pub struct SingleEdgeResponse {
2163        /// The overall result of active probing for this egress device.
2164        pub result: crate::model::probing_details::ProbingResult,
2165
2166        /// Number of probes sent.
2167        pub sent_probe_count: i32,
2168
2169        /// Number of probes that reached the destination.
2170        pub successful_probe_count: i32,
2171
2172        /// Latency as measured by active probing in one direction: from the source
2173        /// to the destination endpoint.
2174        pub probing_latency: std::option::Option<crate::model::LatencyDistribution>,
2175
2176        /// The EdgeLocation from which a packet, destined to the internet, will
2177        /// egress the Google network.
2178        /// This will only be populated for a connectivity test which has an internet
2179        /// destination address.
2180        /// The absence of this field *must not* be used as an indication that the
2181        /// destination is part of the Google network.
2182        pub destination_egress_location:
2183            std::option::Option<crate::model::probing_details::EdgeLocation>,
2184
2185        /// Router name in the format '{router}.{metroshard}'. For example:
2186        /// pf01.aaa01, pr02.aaa01.
2187        pub destination_router: std::string::String,
2188
2189        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2190    }
2191
2192    impl SingleEdgeResponse {
2193        /// Creates a new default instance.
2194        pub fn new() -> Self {
2195            std::default::Default::default()
2196        }
2197
2198        /// Sets the value of [result][crate::model::probing_details::SingleEdgeResponse::result].
2199        ///
2200        /// # Example
2201        /// ```ignore,no_run
2202        /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2203        /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingResult;
2204        /// let x0 = SingleEdgeResponse::new().set_result(ProbingResult::Reachable);
2205        /// let x1 = SingleEdgeResponse::new().set_result(ProbingResult::Unreachable);
2206        /// let x2 = SingleEdgeResponse::new().set_result(ProbingResult::ReachabilityInconsistent);
2207        /// ```
2208        pub fn set_result<T: std::convert::Into<crate::model::probing_details::ProbingResult>>(
2209            mut self,
2210            v: T,
2211        ) -> Self {
2212            self.result = v.into();
2213            self
2214        }
2215
2216        /// Sets the value of [sent_probe_count][crate::model::probing_details::SingleEdgeResponse::sent_probe_count].
2217        ///
2218        /// # Example
2219        /// ```ignore,no_run
2220        /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2221        /// let x = SingleEdgeResponse::new().set_sent_probe_count(42);
2222        /// ```
2223        pub fn set_sent_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2224            self.sent_probe_count = v.into();
2225            self
2226        }
2227
2228        /// Sets the value of [successful_probe_count][crate::model::probing_details::SingleEdgeResponse::successful_probe_count].
2229        ///
2230        /// # Example
2231        /// ```ignore,no_run
2232        /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2233        /// let x = SingleEdgeResponse::new().set_successful_probe_count(42);
2234        /// ```
2235        pub fn set_successful_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2236            self.successful_probe_count = v.into();
2237            self
2238        }
2239
2240        /// Sets the value of [probing_latency][crate::model::probing_details::SingleEdgeResponse::probing_latency].
2241        ///
2242        /// # Example
2243        /// ```ignore,no_run
2244        /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2245        /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2246        /// let x = SingleEdgeResponse::new().set_probing_latency(LatencyDistribution::default()/* use setters */);
2247        /// ```
2248        pub fn set_probing_latency<T>(mut self, v: T) -> Self
2249        where
2250            T: std::convert::Into<crate::model::LatencyDistribution>,
2251        {
2252            self.probing_latency = std::option::Option::Some(v.into());
2253            self
2254        }
2255
2256        /// Sets or clears the value of [probing_latency][crate::model::probing_details::SingleEdgeResponse::probing_latency].
2257        ///
2258        /// # Example
2259        /// ```ignore,no_run
2260        /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2261        /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2262        /// let x = SingleEdgeResponse::new().set_or_clear_probing_latency(Some(LatencyDistribution::default()/* use setters */));
2263        /// let x = SingleEdgeResponse::new().set_or_clear_probing_latency(None::<LatencyDistribution>);
2264        /// ```
2265        pub fn set_or_clear_probing_latency<T>(mut self, v: std::option::Option<T>) -> Self
2266        where
2267            T: std::convert::Into<crate::model::LatencyDistribution>,
2268        {
2269            self.probing_latency = v.map(|x| x.into());
2270            self
2271        }
2272
2273        /// Sets the value of [destination_egress_location][crate::model::probing_details::SingleEdgeResponse::destination_egress_location].
2274        ///
2275        /// # Example
2276        /// ```ignore,no_run
2277        /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2278        /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2279        /// let x = SingleEdgeResponse::new().set_destination_egress_location(EdgeLocation::default()/* use setters */);
2280        /// ```
2281        pub fn set_destination_egress_location<T>(mut self, v: T) -> Self
2282        where
2283            T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2284        {
2285            self.destination_egress_location = std::option::Option::Some(v.into());
2286            self
2287        }
2288
2289        /// Sets or clears the value of [destination_egress_location][crate::model::probing_details::SingleEdgeResponse::destination_egress_location].
2290        ///
2291        /// # Example
2292        /// ```ignore,no_run
2293        /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2294        /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2295        /// let x = SingleEdgeResponse::new().set_or_clear_destination_egress_location(Some(EdgeLocation::default()/* use setters */));
2296        /// let x = SingleEdgeResponse::new().set_or_clear_destination_egress_location(None::<EdgeLocation>);
2297        /// ```
2298        pub fn set_or_clear_destination_egress_location<T>(
2299            mut self,
2300            v: std::option::Option<T>,
2301        ) -> Self
2302        where
2303            T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2304        {
2305            self.destination_egress_location = v.map(|x| x.into());
2306            self
2307        }
2308
2309        /// Sets the value of [destination_router][crate::model::probing_details::SingleEdgeResponse::destination_router].
2310        ///
2311        /// # Example
2312        /// ```ignore,no_run
2313        /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2314        /// let x = SingleEdgeResponse::new().set_destination_router("example");
2315        /// ```
2316        pub fn set_destination_router<T: std::convert::Into<std::string::String>>(
2317            mut self,
2318            v: T,
2319        ) -> Self {
2320            self.destination_router = v.into();
2321            self
2322        }
2323    }
2324
2325    impl wkt::message::Message for SingleEdgeResponse {
2326        fn typename() -> &'static str {
2327            "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails.SingleEdgeResponse"
2328        }
2329    }
2330
2331    /// Overall probing result of the test.
2332    ///
2333    /// # Working with unknown values
2334    ///
2335    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2336    /// additional enum variants at any time. Adding new variants is not considered
2337    /// a breaking change. Applications should write their code in anticipation of:
2338    ///
2339    /// - New values appearing in future releases of the client library, **and**
2340    /// - New values received dynamically, without application changes.
2341    ///
2342    /// Please consult the [Working with enums] section in the user guide for some
2343    /// guidelines.
2344    ///
2345    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2346    #[derive(Clone, Debug, PartialEq)]
2347    #[non_exhaustive]
2348    pub enum ProbingResult {
2349        /// No result was specified.
2350        Unspecified,
2351        /// At least 95% of packets reached the destination.
2352        Reachable,
2353        /// No packets reached the destination.
2354        Unreachable,
2355        /// Less than 95% of packets reached the destination.
2356        ReachabilityInconsistent,
2357        /// Reachability could not be determined. Possible reasons are:
2358        ///
2359        /// * The user lacks permission to access some of the network resources
2360        ///   required to run the test.
2361        /// * No valid source endpoint could be derived from the request.
2362        /// * An internal error occurred.
2363        Undetermined,
2364        /// If set, the enum was initialized with an unknown value.
2365        ///
2366        /// Applications can examine the value using [ProbingResult::value] or
2367        /// [ProbingResult::name].
2368        UnknownValue(probing_result::UnknownValue),
2369    }
2370
2371    #[doc(hidden)]
2372    pub mod probing_result {
2373        #[allow(unused_imports)]
2374        use super::*;
2375        #[derive(Clone, Debug, PartialEq)]
2376        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2377    }
2378
2379    impl ProbingResult {
2380        /// Gets the enum value.
2381        ///
2382        /// Returns `None` if the enum contains an unknown value deserialized from
2383        /// the string representation of enums.
2384        pub fn value(&self) -> std::option::Option<i32> {
2385            match self {
2386                Self::Unspecified => std::option::Option::Some(0),
2387                Self::Reachable => std::option::Option::Some(1),
2388                Self::Unreachable => std::option::Option::Some(2),
2389                Self::ReachabilityInconsistent => std::option::Option::Some(3),
2390                Self::Undetermined => std::option::Option::Some(4),
2391                Self::UnknownValue(u) => u.0.value(),
2392            }
2393        }
2394
2395        /// Gets the enum value as a string.
2396        ///
2397        /// Returns `None` if the enum contains an unknown value deserialized from
2398        /// the integer representation of enums.
2399        pub fn name(&self) -> std::option::Option<&str> {
2400            match self {
2401                Self::Unspecified => std::option::Option::Some("PROBING_RESULT_UNSPECIFIED"),
2402                Self::Reachable => std::option::Option::Some("REACHABLE"),
2403                Self::Unreachable => std::option::Option::Some("UNREACHABLE"),
2404                Self::ReachabilityInconsistent => {
2405                    std::option::Option::Some("REACHABILITY_INCONSISTENT")
2406                }
2407                Self::Undetermined => std::option::Option::Some("UNDETERMINED"),
2408                Self::UnknownValue(u) => u.0.name(),
2409            }
2410        }
2411    }
2412
2413    impl std::default::Default for ProbingResult {
2414        fn default() -> Self {
2415            use std::convert::From;
2416            Self::from(0)
2417        }
2418    }
2419
2420    impl std::fmt::Display for ProbingResult {
2421        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2422            wkt::internal::display_enum(f, self.name(), self.value())
2423        }
2424    }
2425
2426    impl std::convert::From<i32> for ProbingResult {
2427        fn from(value: i32) -> Self {
2428            match value {
2429                0 => Self::Unspecified,
2430                1 => Self::Reachable,
2431                2 => Self::Unreachable,
2432                3 => Self::ReachabilityInconsistent,
2433                4 => Self::Undetermined,
2434                _ => Self::UnknownValue(probing_result::UnknownValue(
2435                    wkt::internal::UnknownEnumValue::Integer(value),
2436                )),
2437            }
2438        }
2439    }
2440
2441    impl std::convert::From<&str> for ProbingResult {
2442        fn from(value: &str) -> Self {
2443            use std::string::ToString;
2444            match value {
2445                "PROBING_RESULT_UNSPECIFIED" => Self::Unspecified,
2446                "REACHABLE" => Self::Reachable,
2447                "UNREACHABLE" => Self::Unreachable,
2448                "REACHABILITY_INCONSISTENT" => Self::ReachabilityInconsistent,
2449                "UNDETERMINED" => Self::Undetermined,
2450                _ => Self::UnknownValue(probing_result::UnknownValue(
2451                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2452                )),
2453            }
2454        }
2455    }
2456
2457    impl serde::ser::Serialize for ProbingResult {
2458        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2459        where
2460            S: serde::Serializer,
2461        {
2462            match self {
2463                Self::Unspecified => serializer.serialize_i32(0),
2464                Self::Reachable => serializer.serialize_i32(1),
2465                Self::Unreachable => serializer.serialize_i32(2),
2466                Self::ReachabilityInconsistent => serializer.serialize_i32(3),
2467                Self::Undetermined => serializer.serialize_i32(4),
2468                Self::UnknownValue(u) => u.0.serialize(serializer),
2469            }
2470        }
2471    }
2472
2473    impl<'de> serde::de::Deserialize<'de> for ProbingResult {
2474        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2475        where
2476            D: serde::Deserializer<'de>,
2477        {
2478            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProbingResult>::new(
2479                ".google.cloud.networkmanagement.v1.ProbingDetails.ProbingResult",
2480            ))
2481        }
2482    }
2483
2484    /// Abort cause types.
2485    ///
2486    /// # Working with unknown values
2487    ///
2488    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2489    /// additional enum variants at any time. Adding new variants is not considered
2490    /// a breaking change. Applications should write their code in anticipation of:
2491    ///
2492    /// - New values appearing in future releases of the client library, **and**
2493    /// - New values received dynamically, without application changes.
2494    ///
2495    /// Please consult the [Working with enums] section in the user guide for some
2496    /// guidelines.
2497    ///
2498    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2499    #[derive(Clone, Debug, PartialEq)]
2500    #[non_exhaustive]
2501    pub enum ProbingAbortCause {
2502        /// No reason was specified.
2503        Unspecified,
2504        /// The user lacks permission to access some of the
2505        /// network resources required to run the test.
2506        PermissionDenied,
2507        /// No valid source endpoint could be derived from the request.
2508        NoSourceLocation,
2509        /// If set, the enum was initialized with an unknown value.
2510        ///
2511        /// Applications can examine the value using [ProbingAbortCause::value] or
2512        /// [ProbingAbortCause::name].
2513        UnknownValue(probing_abort_cause::UnknownValue),
2514    }
2515
2516    #[doc(hidden)]
2517    pub mod probing_abort_cause {
2518        #[allow(unused_imports)]
2519        use super::*;
2520        #[derive(Clone, Debug, PartialEq)]
2521        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2522    }
2523
2524    impl ProbingAbortCause {
2525        /// Gets the enum value.
2526        ///
2527        /// Returns `None` if the enum contains an unknown value deserialized from
2528        /// the string representation of enums.
2529        pub fn value(&self) -> std::option::Option<i32> {
2530            match self {
2531                Self::Unspecified => std::option::Option::Some(0),
2532                Self::PermissionDenied => std::option::Option::Some(1),
2533                Self::NoSourceLocation => std::option::Option::Some(2),
2534                Self::UnknownValue(u) => u.0.value(),
2535            }
2536        }
2537
2538        /// Gets the enum value as a string.
2539        ///
2540        /// Returns `None` if the enum contains an unknown value deserialized from
2541        /// the integer representation of enums.
2542        pub fn name(&self) -> std::option::Option<&str> {
2543            match self {
2544                Self::Unspecified => std::option::Option::Some("PROBING_ABORT_CAUSE_UNSPECIFIED"),
2545                Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
2546                Self::NoSourceLocation => std::option::Option::Some("NO_SOURCE_LOCATION"),
2547                Self::UnknownValue(u) => u.0.name(),
2548            }
2549        }
2550    }
2551
2552    impl std::default::Default for ProbingAbortCause {
2553        fn default() -> Self {
2554            use std::convert::From;
2555            Self::from(0)
2556        }
2557    }
2558
2559    impl std::fmt::Display for ProbingAbortCause {
2560        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2561            wkt::internal::display_enum(f, self.name(), self.value())
2562        }
2563    }
2564
2565    impl std::convert::From<i32> for ProbingAbortCause {
2566        fn from(value: i32) -> Self {
2567            match value {
2568                0 => Self::Unspecified,
2569                1 => Self::PermissionDenied,
2570                2 => Self::NoSourceLocation,
2571                _ => Self::UnknownValue(probing_abort_cause::UnknownValue(
2572                    wkt::internal::UnknownEnumValue::Integer(value),
2573                )),
2574            }
2575        }
2576    }
2577
2578    impl std::convert::From<&str> for ProbingAbortCause {
2579        fn from(value: &str) -> Self {
2580            use std::string::ToString;
2581            match value {
2582                "PROBING_ABORT_CAUSE_UNSPECIFIED" => Self::Unspecified,
2583                "PERMISSION_DENIED" => Self::PermissionDenied,
2584                "NO_SOURCE_LOCATION" => Self::NoSourceLocation,
2585                _ => Self::UnknownValue(probing_abort_cause::UnknownValue(
2586                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2587                )),
2588            }
2589        }
2590    }
2591
2592    impl serde::ser::Serialize for ProbingAbortCause {
2593        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2594        where
2595            S: serde::Serializer,
2596        {
2597            match self {
2598                Self::Unspecified => serializer.serialize_i32(0),
2599                Self::PermissionDenied => serializer.serialize_i32(1),
2600                Self::NoSourceLocation => serializer.serialize_i32(2),
2601                Self::UnknownValue(u) => u.0.serialize(serializer),
2602            }
2603        }
2604    }
2605
2606    impl<'de> serde::de::Deserialize<'de> for ProbingAbortCause {
2607        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2608        where
2609            D: serde::Deserializer<'de>,
2610        {
2611            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProbingAbortCause>::new(
2612                ".google.cloud.networkmanagement.v1.ProbingDetails.ProbingAbortCause",
2613            ))
2614        }
2615    }
2616}
2617
2618/// Request for the `ListConnectivityTests` method.
2619#[derive(Clone, Default, PartialEq)]
2620#[non_exhaustive]
2621pub struct ListConnectivityTestsRequest {
2622    /// Required. The parent resource of the Connectivity Tests:
2623    /// `projects/{project_id}/locations/global`
2624    pub parent: std::string::String,
2625
2626    /// Number of `ConnectivityTests` to return.
2627    pub page_size: i32,
2628
2629    /// Page token from an earlier query, as returned in `next_page_token`.
2630    pub page_token: std::string::String,
2631
2632    /// Lists the `ConnectivityTests` that match the filter expression. A filter
2633    /// expression filters the resources listed in the response. The expression
2634    /// must be of the form `<field> <operator> <value>` where operators: `<`, `>`,
2635    /// `<=`,
2636    /// `>=`,
2637    /// `!=`, `=`, `:` are supported (colon `:` represents a HAS operator which is
2638    /// roughly synonymous with equality). \<field\> can refer to a proto or JSON
2639    /// field, or a synthetic field. Field names can be camelCase or snake_case.
2640    ///
2641    /// Examples:
2642    ///
2643    /// - Filter by name:
2644    ///   name = "projects/proj-1/locations/global/connectivityTests/test-1
2645    ///
2646    /// - Filter by labels:
2647    ///
2648    ///   - Resources that have a key called `foo`
2649    ///     labels.foo:*
2650    ///   - Resources that have a key called `foo` whose value is `bar`
2651    ///     labels.foo = bar
2652    pub filter: std::string::String,
2653
2654    /// Field to use to sort the list.
2655    pub order_by: std::string::String,
2656
2657    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2658}
2659
2660impl ListConnectivityTestsRequest {
2661    /// Creates a new default instance.
2662    pub fn new() -> Self {
2663        std::default::Default::default()
2664    }
2665
2666    /// Sets the value of [parent][crate::model::ListConnectivityTestsRequest::parent].
2667    ///
2668    /// # Example
2669    /// ```ignore,no_run
2670    /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2671    /// let x = ListConnectivityTestsRequest::new().set_parent("example");
2672    /// ```
2673    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2674        self.parent = v.into();
2675        self
2676    }
2677
2678    /// Sets the value of [page_size][crate::model::ListConnectivityTestsRequest::page_size].
2679    ///
2680    /// # Example
2681    /// ```ignore,no_run
2682    /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2683    /// let x = ListConnectivityTestsRequest::new().set_page_size(42);
2684    /// ```
2685    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2686        self.page_size = v.into();
2687        self
2688    }
2689
2690    /// Sets the value of [page_token][crate::model::ListConnectivityTestsRequest::page_token].
2691    ///
2692    /// # Example
2693    /// ```ignore,no_run
2694    /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2695    /// let x = ListConnectivityTestsRequest::new().set_page_token("example");
2696    /// ```
2697    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2698        self.page_token = v.into();
2699        self
2700    }
2701
2702    /// Sets the value of [filter][crate::model::ListConnectivityTestsRequest::filter].
2703    ///
2704    /// # Example
2705    /// ```ignore,no_run
2706    /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2707    /// let x = ListConnectivityTestsRequest::new().set_filter("example");
2708    /// ```
2709    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2710        self.filter = v.into();
2711        self
2712    }
2713
2714    /// Sets the value of [order_by][crate::model::ListConnectivityTestsRequest::order_by].
2715    ///
2716    /// # Example
2717    /// ```ignore,no_run
2718    /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2719    /// let x = ListConnectivityTestsRequest::new().set_order_by("example");
2720    /// ```
2721    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2722        self.order_by = v.into();
2723        self
2724    }
2725}
2726
2727impl wkt::message::Message for ListConnectivityTestsRequest {
2728    fn typename() -> &'static str {
2729        "type.googleapis.com/google.cloud.networkmanagement.v1.ListConnectivityTestsRequest"
2730    }
2731}
2732
2733/// Response for the `ListConnectivityTests` method.
2734#[derive(Clone, Default, PartialEq)]
2735#[non_exhaustive]
2736pub struct ListConnectivityTestsResponse {
2737    /// List of Connectivity Tests.
2738    pub resources: std::vec::Vec<crate::model::ConnectivityTest>,
2739
2740    /// Page token to fetch the next set of Connectivity Tests.
2741    pub next_page_token: std::string::String,
2742
2743    /// Locations that could not be reached (when querying all locations with `-`).
2744    pub unreachable: std::vec::Vec<std::string::String>,
2745
2746    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2747}
2748
2749impl ListConnectivityTestsResponse {
2750    /// Creates a new default instance.
2751    pub fn new() -> Self {
2752        std::default::Default::default()
2753    }
2754
2755    /// Sets the value of [resources][crate::model::ListConnectivityTestsResponse::resources].
2756    ///
2757    /// # Example
2758    /// ```ignore,no_run
2759    /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2760    /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2761    /// let x = ListConnectivityTestsResponse::new()
2762    ///     .set_resources([
2763    ///         ConnectivityTest::default()/* use setters */,
2764    ///         ConnectivityTest::default()/* use (different) setters */,
2765    ///     ]);
2766    /// ```
2767    pub fn set_resources<T, V>(mut self, v: T) -> Self
2768    where
2769        T: std::iter::IntoIterator<Item = V>,
2770        V: std::convert::Into<crate::model::ConnectivityTest>,
2771    {
2772        use std::iter::Iterator;
2773        self.resources = v.into_iter().map(|i| i.into()).collect();
2774        self
2775    }
2776
2777    /// Sets the value of [next_page_token][crate::model::ListConnectivityTestsResponse::next_page_token].
2778    ///
2779    /// # Example
2780    /// ```ignore,no_run
2781    /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2782    /// let x = ListConnectivityTestsResponse::new().set_next_page_token("example");
2783    /// ```
2784    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2785        self.next_page_token = v.into();
2786        self
2787    }
2788
2789    /// Sets the value of [unreachable][crate::model::ListConnectivityTestsResponse::unreachable].
2790    ///
2791    /// # Example
2792    /// ```ignore,no_run
2793    /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2794    /// let x = ListConnectivityTestsResponse::new().set_unreachable(["a", "b", "c"]);
2795    /// ```
2796    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2797    where
2798        T: std::iter::IntoIterator<Item = V>,
2799        V: std::convert::Into<std::string::String>,
2800    {
2801        use std::iter::Iterator;
2802        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2803        self
2804    }
2805}
2806
2807impl wkt::message::Message for ListConnectivityTestsResponse {
2808    fn typename() -> &'static str {
2809        "type.googleapis.com/google.cloud.networkmanagement.v1.ListConnectivityTestsResponse"
2810    }
2811}
2812
2813#[doc(hidden)]
2814impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectivityTestsResponse {
2815    type PageItem = crate::model::ConnectivityTest;
2816
2817    fn items(self) -> std::vec::Vec<Self::PageItem> {
2818        self.resources
2819    }
2820
2821    fn next_page_token(&self) -> std::string::String {
2822        use std::clone::Clone;
2823        self.next_page_token.clone()
2824    }
2825}
2826
2827/// Request for the `GetConnectivityTest` method.
2828#[derive(Clone, Default, PartialEq)]
2829#[non_exhaustive]
2830pub struct GetConnectivityTestRequest {
2831    /// Required. `ConnectivityTest` resource name using the form:
2832    /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
2833    pub name: std::string::String,
2834
2835    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2836}
2837
2838impl GetConnectivityTestRequest {
2839    /// Creates a new default instance.
2840    pub fn new() -> Self {
2841        std::default::Default::default()
2842    }
2843
2844    /// Sets the value of [name][crate::model::GetConnectivityTestRequest::name].
2845    ///
2846    /// # Example
2847    /// ```ignore,no_run
2848    /// # use google_cloud_networkmanagement_v1::model::GetConnectivityTestRequest;
2849    /// # let project_id = "project_id";
2850    /// # let test_id = "test_id";
2851    /// let x = GetConnectivityTestRequest::new().set_name(format!("projects/{project_id}/locations/global/connectivityTests/{test_id}"));
2852    /// ```
2853    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2854        self.name = v.into();
2855        self
2856    }
2857}
2858
2859impl wkt::message::Message for GetConnectivityTestRequest {
2860    fn typename() -> &'static str {
2861        "type.googleapis.com/google.cloud.networkmanagement.v1.GetConnectivityTestRequest"
2862    }
2863}
2864
2865/// Request for the `CreateConnectivityTest` method.
2866#[derive(Clone, Default, PartialEq)]
2867#[non_exhaustive]
2868pub struct CreateConnectivityTestRequest {
2869    /// Required. The parent resource of the Connectivity Test to create:
2870    /// `projects/{project_id}/locations/global`
2871    pub parent: std::string::String,
2872
2873    /// Required. The logical name of the Connectivity Test in your project
2874    /// with the following restrictions:
2875    ///
2876    /// * Must contain only lowercase letters, numbers, and hyphens.
2877    /// * Must start with a letter.
2878    /// * Must be between 1-40 characters.
2879    /// * Must end with a number or a letter.
2880    /// * Must be unique within the customer project
2881    pub test_id: std::string::String,
2882
2883    /// Required. A `ConnectivityTest` resource
2884    pub resource: std::option::Option<crate::model::ConnectivityTest>,
2885
2886    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2887}
2888
2889impl CreateConnectivityTestRequest {
2890    /// Creates a new default instance.
2891    pub fn new() -> Self {
2892        std::default::Default::default()
2893    }
2894
2895    /// Sets the value of [parent][crate::model::CreateConnectivityTestRequest::parent].
2896    ///
2897    /// # Example
2898    /// ```ignore,no_run
2899    /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2900    /// let x = CreateConnectivityTestRequest::new().set_parent("example");
2901    /// ```
2902    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2903        self.parent = v.into();
2904        self
2905    }
2906
2907    /// Sets the value of [test_id][crate::model::CreateConnectivityTestRequest::test_id].
2908    ///
2909    /// # Example
2910    /// ```ignore,no_run
2911    /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2912    /// let x = CreateConnectivityTestRequest::new().set_test_id("example");
2913    /// ```
2914    pub fn set_test_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2915        self.test_id = v.into();
2916        self
2917    }
2918
2919    /// Sets the value of [resource][crate::model::CreateConnectivityTestRequest::resource].
2920    ///
2921    /// # Example
2922    /// ```ignore,no_run
2923    /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2924    /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2925    /// let x = CreateConnectivityTestRequest::new().set_resource(ConnectivityTest::default()/* use setters */);
2926    /// ```
2927    pub fn set_resource<T>(mut self, v: T) -> Self
2928    where
2929        T: std::convert::Into<crate::model::ConnectivityTest>,
2930    {
2931        self.resource = std::option::Option::Some(v.into());
2932        self
2933    }
2934
2935    /// Sets or clears the value of [resource][crate::model::CreateConnectivityTestRequest::resource].
2936    ///
2937    /// # Example
2938    /// ```ignore,no_run
2939    /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2940    /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2941    /// let x = CreateConnectivityTestRequest::new().set_or_clear_resource(Some(ConnectivityTest::default()/* use setters */));
2942    /// let x = CreateConnectivityTestRequest::new().set_or_clear_resource(None::<ConnectivityTest>);
2943    /// ```
2944    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
2945    where
2946        T: std::convert::Into<crate::model::ConnectivityTest>,
2947    {
2948        self.resource = v.map(|x| x.into());
2949        self
2950    }
2951}
2952
2953impl wkt::message::Message for CreateConnectivityTestRequest {
2954    fn typename() -> &'static str {
2955        "type.googleapis.com/google.cloud.networkmanagement.v1.CreateConnectivityTestRequest"
2956    }
2957}
2958
2959/// Request for the `UpdateConnectivityTest` method.
2960#[derive(Clone, Default, PartialEq)]
2961#[non_exhaustive]
2962pub struct UpdateConnectivityTestRequest {
2963    /// Required. Mask of fields to update. At least one path must be supplied in
2964    /// this field.
2965    pub update_mask: std::option::Option<wkt::FieldMask>,
2966
2967    /// Required. Only fields specified in update_mask are updated.
2968    pub resource: std::option::Option<crate::model::ConnectivityTest>,
2969
2970    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2971}
2972
2973impl UpdateConnectivityTestRequest {
2974    /// Creates a new default instance.
2975    pub fn new() -> Self {
2976        std::default::Default::default()
2977    }
2978
2979    /// Sets the value of [update_mask][crate::model::UpdateConnectivityTestRequest::update_mask].
2980    ///
2981    /// # Example
2982    /// ```ignore,no_run
2983    /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
2984    /// use wkt::FieldMask;
2985    /// let x = UpdateConnectivityTestRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2986    /// ```
2987    pub fn set_update_mask<T>(mut self, v: T) -> Self
2988    where
2989        T: std::convert::Into<wkt::FieldMask>,
2990    {
2991        self.update_mask = std::option::Option::Some(v.into());
2992        self
2993    }
2994
2995    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectivityTestRequest::update_mask].
2996    ///
2997    /// # Example
2998    /// ```ignore,no_run
2999    /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
3000    /// use wkt::FieldMask;
3001    /// let x = UpdateConnectivityTestRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3002    /// let x = UpdateConnectivityTestRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3003    /// ```
3004    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3005    where
3006        T: std::convert::Into<wkt::FieldMask>,
3007    {
3008        self.update_mask = v.map(|x| x.into());
3009        self
3010    }
3011
3012    /// Sets the value of [resource][crate::model::UpdateConnectivityTestRequest::resource].
3013    ///
3014    /// # Example
3015    /// ```ignore,no_run
3016    /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
3017    /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
3018    /// let x = UpdateConnectivityTestRequest::new().set_resource(ConnectivityTest::default()/* use setters */);
3019    /// ```
3020    pub fn set_resource<T>(mut self, v: T) -> Self
3021    where
3022        T: std::convert::Into<crate::model::ConnectivityTest>,
3023    {
3024        self.resource = std::option::Option::Some(v.into());
3025        self
3026    }
3027
3028    /// Sets or clears the value of [resource][crate::model::UpdateConnectivityTestRequest::resource].
3029    ///
3030    /// # Example
3031    /// ```ignore,no_run
3032    /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
3033    /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
3034    /// let x = UpdateConnectivityTestRequest::new().set_or_clear_resource(Some(ConnectivityTest::default()/* use setters */));
3035    /// let x = UpdateConnectivityTestRequest::new().set_or_clear_resource(None::<ConnectivityTest>);
3036    /// ```
3037    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
3038    where
3039        T: std::convert::Into<crate::model::ConnectivityTest>,
3040    {
3041        self.resource = v.map(|x| x.into());
3042        self
3043    }
3044}
3045
3046impl wkt::message::Message for UpdateConnectivityTestRequest {
3047    fn typename() -> &'static str {
3048        "type.googleapis.com/google.cloud.networkmanagement.v1.UpdateConnectivityTestRequest"
3049    }
3050}
3051
3052/// Request for the `DeleteConnectivityTest` method.
3053#[derive(Clone, Default, PartialEq)]
3054#[non_exhaustive]
3055pub struct DeleteConnectivityTestRequest {
3056    /// Required. Connectivity Test resource name using the form:
3057    /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
3058    pub name: std::string::String,
3059
3060    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3061}
3062
3063impl DeleteConnectivityTestRequest {
3064    /// Creates a new default instance.
3065    pub fn new() -> Self {
3066        std::default::Default::default()
3067    }
3068
3069    /// Sets the value of [name][crate::model::DeleteConnectivityTestRequest::name].
3070    ///
3071    /// # Example
3072    /// ```ignore,no_run
3073    /// # use google_cloud_networkmanagement_v1::model::DeleteConnectivityTestRequest;
3074    /// # let project_id = "project_id";
3075    /// # let test_id = "test_id";
3076    /// let x = DeleteConnectivityTestRequest::new().set_name(format!("projects/{project_id}/locations/global/connectivityTests/{test_id}"));
3077    /// ```
3078    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3079        self.name = v.into();
3080        self
3081    }
3082}
3083
3084impl wkt::message::Message for DeleteConnectivityTestRequest {
3085    fn typename() -> &'static str {
3086        "type.googleapis.com/google.cloud.networkmanagement.v1.DeleteConnectivityTestRequest"
3087    }
3088}
3089
3090/// Request for the `RerunConnectivityTest` method.
3091#[derive(Clone, Default, PartialEq)]
3092#[non_exhaustive]
3093pub struct RerunConnectivityTestRequest {
3094    /// Required. Connectivity Test resource name using the form:
3095    /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
3096    pub name: std::string::String,
3097
3098    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3099}
3100
3101impl RerunConnectivityTestRequest {
3102    /// Creates a new default instance.
3103    pub fn new() -> Self {
3104        std::default::Default::default()
3105    }
3106
3107    /// Sets the value of [name][crate::model::RerunConnectivityTestRequest::name].
3108    ///
3109    /// # Example
3110    /// ```ignore,no_run
3111    /// # use google_cloud_networkmanagement_v1::model::RerunConnectivityTestRequest;
3112    /// # let project_id = "project_id";
3113    /// # let test_id = "test_id";
3114    /// let x = RerunConnectivityTestRequest::new().set_name(format!("projects/{project_id}/locations/global/connectivityTests/{test_id}"));
3115    /// ```
3116    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3117        self.name = v.into();
3118        self
3119    }
3120}
3121
3122impl wkt::message::Message for RerunConnectivityTestRequest {
3123    fn typename() -> &'static str {
3124        "type.googleapis.com/google.cloud.networkmanagement.v1.RerunConnectivityTestRequest"
3125    }
3126}
3127
3128/// Metadata describing an [Operation][google.longrunning.Operation]
3129///
3130/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
3131#[derive(Clone, Default, PartialEq)]
3132#[non_exhaustive]
3133pub struct OperationMetadata {
3134    /// The time the operation was created.
3135    pub create_time: std::option::Option<wkt::Timestamp>,
3136
3137    /// The time the operation finished running.
3138    pub end_time: std::option::Option<wkt::Timestamp>,
3139
3140    /// Target of the operation - for example
3141    /// projects/project-1/locations/global/connectivityTests/test-1
3142    pub target: std::string::String,
3143
3144    /// Name of the verb executed by the operation.
3145    pub verb: std::string::String,
3146
3147    /// Human-readable status of the operation, if any.
3148    pub status_detail: std::string::String,
3149
3150    /// Specifies if cancellation was requested for the operation.
3151    pub cancel_requested: bool,
3152
3153    /// API version.
3154    pub api_version: std::string::String,
3155
3156    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3157}
3158
3159impl OperationMetadata {
3160    /// Creates a new default instance.
3161    pub fn new() -> Self {
3162        std::default::Default::default()
3163    }
3164
3165    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3166    ///
3167    /// # Example
3168    /// ```ignore,no_run
3169    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3170    /// use wkt::Timestamp;
3171    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
3172    /// ```
3173    pub fn set_create_time<T>(mut self, v: T) -> Self
3174    where
3175        T: std::convert::Into<wkt::Timestamp>,
3176    {
3177        self.create_time = std::option::Option::Some(v.into());
3178        self
3179    }
3180
3181    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3182    ///
3183    /// # Example
3184    /// ```ignore,no_run
3185    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3186    /// use wkt::Timestamp;
3187    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3188    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
3189    /// ```
3190    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3191    where
3192        T: std::convert::Into<wkt::Timestamp>,
3193    {
3194        self.create_time = v.map(|x| x.into());
3195        self
3196    }
3197
3198    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3199    ///
3200    /// # Example
3201    /// ```ignore,no_run
3202    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3203    /// use wkt::Timestamp;
3204    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3205    /// ```
3206    pub fn set_end_time<T>(mut self, v: T) -> Self
3207    where
3208        T: std::convert::Into<wkt::Timestamp>,
3209    {
3210        self.end_time = std::option::Option::Some(v.into());
3211        self
3212    }
3213
3214    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3215    ///
3216    /// # Example
3217    /// ```ignore,no_run
3218    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3219    /// use wkt::Timestamp;
3220    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3221    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3222    /// ```
3223    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3224    where
3225        T: std::convert::Into<wkt::Timestamp>,
3226    {
3227        self.end_time = v.map(|x| x.into());
3228        self
3229    }
3230
3231    /// Sets the value of [target][crate::model::OperationMetadata::target].
3232    ///
3233    /// # Example
3234    /// ```ignore,no_run
3235    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3236    /// let x = OperationMetadata::new().set_target("example");
3237    /// ```
3238    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3239        self.target = v.into();
3240        self
3241    }
3242
3243    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3244    ///
3245    /// # Example
3246    /// ```ignore,no_run
3247    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3248    /// let x = OperationMetadata::new().set_verb("example");
3249    /// ```
3250    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3251        self.verb = v.into();
3252        self
3253    }
3254
3255    /// Sets the value of [status_detail][crate::model::OperationMetadata::status_detail].
3256    ///
3257    /// # Example
3258    /// ```ignore,no_run
3259    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3260    /// let x = OperationMetadata::new().set_status_detail("example");
3261    /// ```
3262    pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3263        self.status_detail = v.into();
3264        self
3265    }
3266
3267    /// Sets the value of [cancel_requested][crate::model::OperationMetadata::cancel_requested].
3268    ///
3269    /// # Example
3270    /// ```ignore,no_run
3271    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3272    /// let x = OperationMetadata::new().set_cancel_requested(true);
3273    /// ```
3274    pub fn set_cancel_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3275        self.cancel_requested = v.into();
3276        self
3277    }
3278
3279    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3280    ///
3281    /// # Example
3282    /// ```ignore,no_run
3283    /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3284    /// let x = OperationMetadata::new().set_api_version("example");
3285    /// ```
3286    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3287        self.api_version = v.into();
3288        self
3289    }
3290}
3291
3292impl wkt::message::Message for OperationMetadata {
3293    fn typename() -> &'static str {
3294        "type.googleapis.com/google.cloud.networkmanagement.v1.OperationMetadata"
3295    }
3296}
3297
3298/// Trace represents one simulated packet forwarding path.
3299///
3300/// * Each trace contains multiple ordered steps.
3301/// * Each step is in a particular state with associated configuration.
3302/// * State is categorized as final or non-final states.
3303/// * Each final state has a reason associated.
3304/// * Each trace must end with a final state (the last step).
3305///
3306/// ```norust
3307///   |---------------------Trace----------------------|
3308///   Step1(State) Step2(State) ---  StepN(State(final))
3309/// ```
3310#[derive(Clone, Default, PartialEq)]
3311#[non_exhaustive]
3312pub struct Trace {
3313    /// Derived from the source and destination endpoints definition specified by
3314    /// user request, and validated by the data plane model.
3315    /// If there are multiple traces starting from different source locations, then
3316    /// the endpoint_info may be different between traces.
3317    pub endpoint_info: std::option::Option<crate::model::EndpointInfo>,
3318
3319    /// A trace of a test contains multiple steps from the initial state to the
3320    /// final state (delivered, dropped, forwarded, or aborted).
3321    ///
3322    /// The steps are ordered by the processing sequence within the simulated
3323    /// network state machine. It is critical to preserve the order of the steps
3324    /// and avoid reordering or sorting them.
3325    pub steps: std::vec::Vec<crate::model::Step>,
3326
3327    /// ID of trace. For forward traces, this ID is unique for each trace. For
3328    /// return traces, it matches ID of associated forward trace. A single forward
3329    /// trace can be associated with none, one or more than one return trace.
3330    pub forward_trace_id: i32,
3331
3332    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3333}
3334
3335impl Trace {
3336    /// Creates a new default instance.
3337    pub fn new() -> Self {
3338        std::default::Default::default()
3339    }
3340
3341    /// Sets the value of [endpoint_info][crate::model::Trace::endpoint_info].
3342    ///
3343    /// # Example
3344    /// ```ignore,no_run
3345    /// # use google_cloud_networkmanagement_v1::model::Trace;
3346    /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3347    /// let x = Trace::new().set_endpoint_info(EndpointInfo::default()/* use setters */);
3348    /// ```
3349    pub fn set_endpoint_info<T>(mut self, v: T) -> Self
3350    where
3351        T: std::convert::Into<crate::model::EndpointInfo>,
3352    {
3353        self.endpoint_info = std::option::Option::Some(v.into());
3354        self
3355    }
3356
3357    /// Sets or clears the value of [endpoint_info][crate::model::Trace::endpoint_info].
3358    ///
3359    /// # Example
3360    /// ```ignore,no_run
3361    /// # use google_cloud_networkmanagement_v1::model::Trace;
3362    /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3363    /// let x = Trace::new().set_or_clear_endpoint_info(Some(EndpointInfo::default()/* use setters */));
3364    /// let x = Trace::new().set_or_clear_endpoint_info(None::<EndpointInfo>);
3365    /// ```
3366    pub fn set_or_clear_endpoint_info<T>(mut self, v: std::option::Option<T>) -> Self
3367    where
3368        T: std::convert::Into<crate::model::EndpointInfo>,
3369    {
3370        self.endpoint_info = v.map(|x| x.into());
3371        self
3372    }
3373
3374    /// Sets the value of [steps][crate::model::Trace::steps].
3375    ///
3376    /// # Example
3377    /// ```ignore,no_run
3378    /// # use google_cloud_networkmanagement_v1::model::Trace;
3379    /// use google_cloud_networkmanagement_v1::model::Step;
3380    /// let x = Trace::new()
3381    ///     .set_steps([
3382    ///         Step::default()/* use setters */,
3383    ///         Step::default()/* use (different) setters */,
3384    ///     ]);
3385    /// ```
3386    pub fn set_steps<T, V>(mut self, v: T) -> Self
3387    where
3388        T: std::iter::IntoIterator<Item = V>,
3389        V: std::convert::Into<crate::model::Step>,
3390    {
3391        use std::iter::Iterator;
3392        self.steps = v.into_iter().map(|i| i.into()).collect();
3393        self
3394    }
3395
3396    /// Sets the value of [forward_trace_id][crate::model::Trace::forward_trace_id].
3397    ///
3398    /// # Example
3399    /// ```ignore,no_run
3400    /// # use google_cloud_networkmanagement_v1::model::Trace;
3401    /// let x = Trace::new().set_forward_trace_id(42);
3402    /// ```
3403    pub fn set_forward_trace_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3404        self.forward_trace_id = v.into();
3405        self
3406    }
3407}
3408
3409impl wkt::message::Message for Trace {
3410    fn typename() -> &'static str {
3411        "type.googleapis.com/google.cloud.networkmanagement.v1.Trace"
3412    }
3413}
3414
3415/// A simulated forwarding path is composed of multiple steps.
3416/// Each step has a well-defined state and an associated configuration.
3417#[derive(Clone, Default, PartialEq)]
3418#[non_exhaustive]
3419pub struct Step {
3420    /// A description of the step. Usually this is a summary of the state.
3421    pub description: std::string::String,
3422
3423    /// Each step is in one of the pre-defined states.
3424    pub state: crate::model::step::State,
3425
3426    /// This is a step that leads to the final state Drop.
3427    pub causes_drop: bool,
3428
3429    /// Project ID that contains the configuration this step is validating.
3430    pub project_id: std::string::String,
3431
3432    /// Configuration or metadata associated with each step.
3433    /// The configuration is filtered based on viewer's permission. If a viewer
3434    /// has no permission to view the configuration in this step, for non-final
3435    /// states a special state is populated (VIEWER_PERMISSION_MISSING), and for
3436    /// final state the configuration is cleared.
3437    pub step_info: std::option::Option<crate::model::step::StepInfo>,
3438
3439    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3440}
3441
3442impl Step {
3443    /// Creates a new default instance.
3444    pub fn new() -> Self {
3445        std::default::Default::default()
3446    }
3447
3448    /// Sets the value of [description][crate::model::Step::description].
3449    ///
3450    /// # Example
3451    /// ```ignore,no_run
3452    /// # use google_cloud_networkmanagement_v1::model::Step;
3453    /// let x = Step::new().set_description("example");
3454    /// ```
3455    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3456        self.description = v.into();
3457        self
3458    }
3459
3460    /// Sets the value of [state][crate::model::Step::state].
3461    ///
3462    /// # Example
3463    /// ```ignore,no_run
3464    /// # use google_cloud_networkmanagement_v1::model::Step;
3465    /// use google_cloud_networkmanagement_v1::model::step::State;
3466    /// let x0 = Step::new().set_state(State::StartFromInstance);
3467    /// let x1 = Step::new().set_state(State::StartFromInternet);
3468    /// let x2 = Step::new().set_state(State::StartFromGoogleService);
3469    /// ```
3470    pub fn set_state<T: std::convert::Into<crate::model::step::State>>(mut self, v: T) -> Self {
3471        self.state = v.into();
3472        self
3473    }
3474
3475    /// Sets the value of [causes_drop][crate::model::Step::causes_drop].
3476    ///
3477    /// # Example
3478    /// ```ignore,no_run
3479    /// # use google_cloud_networkmanagement_v1::model::Step;
3480    /// let x = Step::new().set_causes_drop(true);
3481    /// ```
3482    pub fn set_causes_drop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3483        self.causes_drop = v.into();
3484        self
3485    }
3486
3487    /// Sets the value of [project_id][crate::model::Step::project_id].
3488    ///
3489    /// # Example
3490    /// ```ignore,no_run
3491    /// # use google_cloud_networkmanagement_v1::model::Step;
3492    /// let x = Step::new().set_project_id("example");
3493    /// ```
3494    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3495        self.project_id = v.into();
3496        self
3497    }
3498
3499    /// Sets the value of [step_info][crate::model::Step::step_info].
3500    ///
3501    /// Note that all the setters affecting `step_info` are mutually
3502    /// exclusive.
3503    ///
3504    /// # Example
3505    /// ```ignore,no_run
3506    /// # use google_cloud_networkmanagement_v1::model::Step;
3507    /// use google_cloud_networkmanagement_v1::model::InstanceInfo;
3508    /// let x = Step::new().set_step_info(Some(
3509    ///     google_cloud_networkmanagement_v1::model::step::StepInfo::Instance(InstanceInfo::default().into())));
3510    /// ```
3511    pub fn set_step_info<
3512        T: std::convert::Into<std::option::Option<crate::model::step::StepInfo>>,
3513    >(
3514        mut self,
3515        v: T,
3516    ) -> Self {
3517        self.step_info = v.into();
3518        self
3519    }
3520
3521    /// The value of [step_info][crate::model::Step::step_info]
3522    /// if it holds a `Instance`, `None` if the field is not set or
3523    /// holds a different branch.
3524    pub fn instance(&self) -> std::option::Option<&std::boxed::Box<crate::model::InstanceInfo>> {
3525        #[allow(unreachable_patterns)]
3526        self.step_info.as_ref().and_then(|v| match v {
3527            crate::model::step::StepInfo::Instance(v) => std::option::Option::Some(v),
3528            _ => std::option::Option::None,
3529        })
3530    }
3531
3532    /// Sets the value of [step_info][crate::model::Step::step_info]
3533    /// to hold a `Instance`.
3534    ///
3535    /// Note that all the setters affecting `step_info` are
3536    /// mutually exclusive.
3537    ///
3538    /// # Example
3539    /// ```ignore,no_run
3540    /// # use google_cloud_networkmanagement_v1::model::Step;
3541    /// use google_cloud_networkmanagement_v1::model::InstanceInfo;
3542    /// let x = Step::new().set_instance(InstanceInfo::default()/* use setters */);
3543    /// assert!(x.instance().is_some());
3544    /// assert!(x.firewall().is_none());
3545    /// assert!(x.route().is_none());
3546    /// assert!(x.endpoint().is_none());
3547    /// assert!(x.google_service().is_none());
3548    /// assert!(x.forwarding_rule().is_none());
3549    /// assert!(x.hybrid_subnet().is_none());
3550    /// assert!(x.vpn_gateway().is_none());
3551    /// assert!(x.vpn_tunnel().is_none());
3552    /// assert!(x.interconnect_attachment().is_none());
3553    /// assert!(x.vpc_connector().is_none());
3554    /// assert!(x.direct_vpc_egress_connection().is_none());
3555    /// assert!(x.serverless_external_connection().is_none());
3556    /// assert!(x.deliver().is_none());
3557    /// assert!(x.forward().is_none());
3558    /// assert!(x.abort().is_none());
3559    /// assert!(x.drop().is_none());
3560    /// assert!(x.load_balancer().is_none());
3561    /// assert!(x.network().is_none());
3562    /// assert!(x.gke_master().is_none());
3563    /// assert!(x.gke_pod().is_none());
3564    /// assert!(x.ip_masquerading_skipped().is_none());
3565    /// assert!(x.gke_network_policy().is_none());
3566    /// assert!(x.gke_network_policy_skipped().is_none());
3567    /// assert!(x.cloud_sql_instance().is_none());
3568    /// assert!(x.redis_instance().is_none());
3569    /// assert!(x.redis_cluster().is_none());
3570    /// assert!(x.cloud_function().is_none());
3571    /// assert!(x.app_engine_version().is_none());
3572    /// assert!(x.cloud_run_revision().is_none());
3573    /// assert!(x.nat().is_none());
3574    /// assert!(x.proxy_connection().is_none());
3575    /// assert!(x.load_balancer_backend_info().is_none());
3576    /// assert!(x.storage_bucket().is_none());
3577    /// assert!(x.serverless_neg().is_none());
3578    /// assert!(x.ngfw_packet_inspection().is_none());
3579    /// ```
3580    pub fn set_instance<T: std::convert::Into<std::boxed::Box<crate::model::InstanceInfo>>>(
3581        mut self,
3582        v: T,
3583    ) -> Self {
3584        self.step_info =
3585            std::option::Option::Some(crate::model::step::StepInfo::Instance(v.into()));
3586        self
3587    }
3588
3589    /// The value of [step_info][crate::model::Step::step_info]
3590    /// if it holds a `Firewall`, `None` if the field is not set or
3591    /// holds a different branch.
3592    pub fn firewall(&self) -> std::option::Option<&std::boxed::Box<crate::model::FirewallInfo>> {
3593        #[allow(unreachable_patterns)]
3594        self.step_info.as_ref().and_then(|v| match v {
3595            crate::model::step::StepInfo::Firewall(v) => std::option::Option::Some(v),
3596            _ => std::option::Option::None,
3597        })
3598    }
3599
3600    /// Sets the value of [step_info][crate::model::Step::step_info]
3601    /// to hold a `Firewall`.
3602    ///
3603    /// Note that all the setters affecting `step_info` are
3604    /// mutually exclusive.
3605    ///
3606    /// # Example
3607    /// ```ignore,no_run
3608    /// # use google_cloud_networkmanagement_v1::model::Step;
3609    /// use google_cloud_networkmanagement_v1::model::FirewallInfo;
3610    /// let x = Step::new().set_firewall(FirewallInfo::default()/* use setters */);
3611    /// assert!(x.firewall().is_some());
3612    /// assert!(x.instance().is_none());
3613    /// assert!(x.route().is_none());
3614    /// assert!(x.endpoint().is_none());
3615    /// assert!(x.google_service().is_none());
3616    /// assert!(x.forwarding_rule().is_none());
3617    /// assert!(x.hybrid_subnet().is_none());
3618    /// assert!(x.vpn_gateway().is_none());
3619    /// assert!(x.vpn_tunnel().is_none());
3620    /// assert!(x.interconnect_attachment().is_none());
3621    /// assert!(x.vpc_connector().is_none());
3622    /// assert!(x.direct_vpc_egress_connection().is_none());
3623    /// assert!(x.serverless_external_connection().is_none());
3624    /// assert!(x.deliver().is_none());
3625    /// assert!(x.forward().is_none());
3626    /// assert!(x.abort().is_none());
3627    /// assert!(x.drop().is_none());
3628    /// assert!(x.load_balancer().is_none());
3629    /// assert!(x.network().is_none());
3630    /// assert!(x.gke_master().is_none());
3631    /// assert!(x.gke_pod().is_none());
3632    /// assert!(x.ip_masquerading_skipped().is_none());
3633    /// assert!(x.gke_network_policy().is_none());
3634    /// assert!(x.gke_network_policy_skipped().is_none());
3635    /// assert!(x.cloud_sql_instance().is_none());
3636    /// assert!(x.redis_instance().is_none());
3637    /// assert!(x.redis_cluster().is_none());
3638    /// assert!(x.cloud_function().is_none());
3639    /// assert!(x.app_engine_version().is_none());
3640    /// assert!(x.cloud_run_revision().is_none());
3641    /// assert!(x.nat().is_none());
3642    /// assert!(x.proxy_connection().is_none());
3643    /// assert!(x.load_balancer_backend_info().is_none());
3644    /// assert!(x.storage_bucket().is_none());
3645    /// assert!(x.serverless_neg().is_none());
3646    /// assert!(x.ngfw_packet_inspection().is_none());
3647    /// ```
3648    pub fn set_firewall<T: std::convert::Into<std::boxed::Box<crate::model::FirewallInfo>>>(
3649        mut self,
3650        v: T,
3651    ) -> Self {
3652        self.step_info =
3653            std::option::Option::Some(crate::model::step::StepInfo::Firewall(v.into()));
3654        self
3655    }
3656
3657    /// The value of [step_info][crate::model::Step::step_info]
3658    /// if it holds a `Route`, `None` if the field is not set or
3659    /// holds a different branch.
3660    pub fn route(&self) -> std::option::Option<&std::boxed::Box<crate::model::RouteInfo>> {
3661        #[allow(unreachable_patterns)]
3662        self.step_info.as_ref().and_then(|v| match v {
3663            crate::model::step::StepInfo::Route(v) => std::option::Option::Some(v),
3664            _ => std::option::Option::None,
3665        })
3666    }
3667
3668    /// Sets the value of [step_info][crate::model::Step::step_info]
3669    /// to hold a `Route`.
3670    ///
3671    /// Note that all the setters affecting `step_info` are
3672    /// mutually exclusive.
3673    ///
3674    /// # Example
3675    /// ```ignore,no_run
3676    /// # use google_cloud_networkmanagement_v1::model::Step;
3677    /// use google_cloud_networkmanagement_v1::model::RouteInfo;
3678    /// let x = Step::new().set_route(RouteInfo::default()/* use setters */);
3679    /// assert!(x.route().is_some());
3680    /// assert!(x.instance().is_none());
3681    /// assert!(x.firewall().is_none());
3682    /// assert!(x.endpoint().is_none());
3683    /// assert!(x.google_service().is_none());
3684    /// assert!(x.forwarding_rule().is_none());
3685    /// assert!(x.hybrid_subnet().is_none());
3686    /// assert!(x.vpn_gateway().is_none());
3687    /// assert!(x.vpn_tunnel().is_none());
3688    /// assert!(x.interconnect_attachment().is_none());
3689    /// assert!(x.vpc_connector().is_none());
3690    /// assert!(x.direct_vpc_egress_connection().is_none());
3691    /// assert!(x.serverless_external_connection().is_none());
3692    /// assert!(x.deliver().is_none());
3693    /// assert!(x.forward().is_none());
3694    /// assert!(x.abort().is_none());
3695    /// assert!(x.drop().is_none());
3696    /// assert!(x.load_balancer().is_none());
3697    /// assert!(x.network().is_none());
3698    /// assert!(x.gke_master().is_none());
3699    /// assert!(x.gke_pod().is_none());
3700    /// assert!(x.ip_masquerading_skipped().is_none());
3701    /// assert!(x.gke_network_policy().is_none());
3702    /// assert!(x.gke_network_policy_skipped().is_none());
3703    /// assert!(x.cloud_sql_instance().is_none());
3704    /// assert!(x.redis_instance().is_none());
3705    /// assert!(x.redis_cluster().is_none());
3706    /// assert!(x.cloud_function().is_none());
3707    /// assert!(x.app_engine_version().is_none());
3708    /// assert!(x.cloud_run_revision().is_none());
3709    /// assert!(x.nat().is_none());
3710    /// assert!(x.proxy_connection().is_none());
3711    /// assert!(x.load_balancer_backend_info().is_none());
3712    /// assert!(x.storage_bucket().is_none());
3713    /// assert!(x.serverless_neg().is_none());
3714    /// assert!(x.ngfw_packet_inspection().is_none());
3715    /// ```
3716    pub fn set_route<T: std::convert::Into<std::boxed::Box<crate::model::RouteInfo>>>(
3717        mut self,
3718        v: T,
3719    ) -> Self {
3720        self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Route(v.into()));
3721        self
3722    }
3723
3724    /// The value of [step_info][crate::model::Step::step_info]
3725    /// if it holds a `Endpoint`, `None` if the field is not set or
3726    /// holds a different branch.
3727    pub fn endpoint(&self) -> std::option::Option<&std::boxed::Box<crate::model::EndpointInfo>> {
3728        #[allow(unreachable_patterns)]
3729        self.step_info.as_ref().and_then(|v| match v {
3730            crate::model::step::StepInfo::Endpoint(v) => std::option::Option::Some(v),
3731            _ => std::option::Option::None,
3732        })
3733    }
3734
3735    /// Sets the value of [step_info][crate::model::Step::step_info]
3736    /// to hold a `Endpoint`.
3737    ///
3738    /// Note that all the setters affecting `step_info` are
3739    /// mutually exclusive.
3740    ///
3741    /// # Example
3742    /// ```ignore,no_run
3743    /// # use google_cloud_networkmanagement_v1::model::Step;
3744    /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3745    /// let x = Step::new().set_endpoint(EndpointInfo::default()/* use setters */);
3746    /// assert!(x.endpoint().is_some());
3747    /// assert!(x.instance().is_none());
3748    /// assert!(x.firewall().is_none());
3749    /// assert!(x.route().is_none());
3750    /// assert!(x.google_service().is_none());
3751    /// assert!(x.forwarding_rule().is_none());
3752    /// assert!(x.hybrid_subnet().is_none());
3753    /// assert!(x.vpn_gateway().is_none());
3754    /// assert!(x.vpn_tunnel().is_none());
3755    /// assert!(x.interconnect_attachment().is_none());
3756    /// assert!(x.vpc_connector().is_none());
3757    /// assert!(x.direct_vpc_egress_connection().is_none());
3758    /// assert!(x.serverless_external_connection().is_none());
3759    /// assert!(x.deliver().is_none());
3760    /// assert!(x.forward().is_none());
3761    /// assert!(x.abort().is_none());
3762    /// assert!(x.drop().is_none());
3763    /// assert!(x.load_balancer().is_none());
3764    /// assert!(x.network().is_none());
3765    /// assert!(x.gke_master().is_none());
3766    /// assert!(x.gke_pod().is_none());
3767    /// assert!(x.ip_masquerading_skipped().is_none());
3768    /// assert!(x.gke_network_policy().is_none());
3769    /// assert!(x.gke_network_policy_skipped().is_none());
3770    /// assert!(x.cloud_sql_instance().is_none());
3771    /// assert!(x.redis_instance().is_none());
3772    /// assert!(x.redis_cluster().is_none());
3773    /// assert!(x.cloud_function().is_none());
3774    /// assert!(x.app_engine_version().is_none());
3775    /// assert!(x.cloud_run_revision().is_none());
3776    /// assert!(x.nat().is_none());
3777    /// assert!(x.proxy_connection().is_none());
3778    /// assert!(x.load_balancer_backend_info().is_none());
3779    /// assert!(x.storage_bucket().is_none());
3780    /// assert!(x.serverless_neg().is_none());
3781    /// assert!(x.ngfw_packet_inspection().is_none());
3782    /// ```
3783    pub fn set_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::EndpointInfo>>>(
3784        mut self,
3785        v: T,
3786    ) -> Self {
3787        self.step_info =
3788            std::option::Option::Some(crate::model::step::StepInfo::Endpoint(v.into()));
3789        self
3790    }
3791
3792    /// The value of [step_info][crate::model::Step::step_info]
3793    /// if it holds a `GoogleService`, `None` if the field is not set or
3794    /// holds a different branch.
3795    pub fn google_service(
3796        &self,
3797    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleServiceInfo>> {
3798        #[allow(unreachable_patterns)]
3799        self.step_info.as_ref().and_then(|v| match v {
3800            crate::model::step::StepInfo::GoogleService(v) => std::option::Option::Some(v),
3801            _ => std::option::Option::None,
3802        })
3803    }
3804
3805    /// Sets the value of [step_info][crate::model::Step::step_info]
3806    /// to hold a `GoogleService`.
3807    ///
3808    /// Note that all the setters affecting `step_info` are
3809    /// mutually exclusive.
3810    ///
3811    /// # Example
3812    /// ```ignore,no_run
3813    /// # use google_cloud_networkmanagement_v1::model::Step;
3814    /// use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
3815    /// let x = Step::new().set_google_service(GoogleServiceInfo::default()/* use setters */);
3816    /// assert!(x.google_service().is_some());
3817    /// assert!(x.instance().is_none());
3818    /// assert!(x.firewall().is_none());
3819    /// assert!(x.route().is_none());
3820    /// assert!(x.endpoint().is_none());
3821    /// assert!(x.forwarding_rule().is_none());
3822    /// assert!(x.hybrid_subnet().is_none());
3823    /// assert!(x.vpn_gateway().is_none());
3824    /// assert!(x.vpn_tunnel().is_none());
3825    /// assert!(x.interconnect_attachment().is_none());
3826    /// assert!(x.vpc_connector().is_none());
3827    /// assert!(x.direct_vpc_egress_connection().is_none());
3828    /// assert!(x.serverless_external_connection().is_none());
3829    /// assert!(x.deliver().is_none());
3830    /// assert!(x.forward().is_none());
3831    /// assert!(x.abort().is_none());
3832    /// assert!(x.drop().is_none());
3833    /// assert!(x.load_balancer().is_none());
3834    /// assert!(x.network().is_none());
3835    /// assert!(x.gke_master().is_none());
3836    /// assert!(x.gke_pod().is_none());
3837    /// assert!(x.ip_masquerading_skipped().is_none());
3838    /// assert!(x.gke_network_policy().is_none());
3839    /// assert!(x.gke_network_policy_skipped().is_none());
3840    /// assert!(x.cloud_sql_instance().is_none());
3841    /// assert!(x.redis_instance().is_none());
3842    /// assert!(x.redis_cluster().is_none());
3843    /// assert!(x.cloud_function().is_none());
3844    /// assert!(x.app_engine_version().is_none());
3845    /// assert!(x.cloud_run_revision().is_none());
3846    /// assert!(x.nat().is_none());
3847    /// assert!(x.proxy_connection().is_none());
3848    /// assert!(x.load_balancer_backend_info().is_none());
3849    /// assert!(x.storage_bucket().is_none());
3850    /// assert!(x.serverless_neg().is_none());
3851    /// assert!(x.ngfw_packet_inspection().is_none());
3852    /// ```
3853    pub fn set_google_service<
3854        T: std::convert::Into<std::boxed::Box<crate::model::GoogleServiceInfo>>,
3855    >(
3856        mut self,
3857        v: T,
3858    ) -> Self {
3859        self.step_info =
3860            std::option::Option::Some(crate::model::step::StepInfo::GoogleService(v.into()));
3861        self
3862    }
3863
3864    /// The value of [step_info][crate::model::Step::step_info]
3865    /// if it holds a `ForwardingRule`, `None` if the field is not set or
3866    /// holds a different branch.
3867    pub fn forwarding_rule(
3868        &self,
3869    ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardingRuleInfo>> {
3870        #[allow(unreachable_patterns)]
3871        self.step_info.as_ref().and_then(|v| match v {
3872            crate::model::step::StepInfo::ForwardingRule(v) => std::option::Option::Some(v),
3873            _ => std::option::Option::None,
3874        })
3875    }
3876
3877    /// Sets the value of [step_info][crate::model::Step::step_info]
3878    /// to hold a `ForwardingRule`.
3879    ///
3880    /// Note that all the setters affecting `step_info` are
3881    /// mutually exclusive.
3882    ///
3883    /// # Example
3884    /// ```ignore,no_run
3885    /// # use google_cloud_networkmanagement_v1::model::Step;
3886    /// use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
3887    /// let x = Step::new().set_forwarding_rule(ForwardingRuleInfo::default()/* use setters */);
3888    /// assert!(x.forwarding_rule().is_some());
3889    /// assert!(x.instance().is_none());
3890    /// assert!(x.firewall().is_none());
3891    /// assert!(x.route().is_none());
3892    /// assert!(x.endpoint().is_none());
3893    /// assert!(x.google_service().is_none());
3894    /// assert!(x.hybrid_subnet().is_none());
3895    /// assert!(x.vpn_gateway().is_none());
3896    /// assert!(x.vpn_tunnel().is_none());
3897    /// assert!(x.interconnect_attachment().is_none());
3898    /// assert!(x.vpc_connector().is_none());
3899    /// assert!(x.direct_vpc_egress_connection().is_none());
3900    /// assert!(x.serverless_external_connection().is_none());
3901    /// assert!(x.deliver().is_none());
3902    /// assert!(x.forward().is_none());
3903    /// assert!(x.abort().is_none());
3904    /// assert!(x.drop().is_none());
3905    /// assert!(x.load_balancer().is_none());
3906    /// assert!(x.network().is_none());
3907    /// assert!(x.gke_master().is_none());
3908    /// assert!(x.gke_pod().is_none());
3909    /// assert!(x.ip_masquerading_skipped().is_none());
3910    /// assert!(x.gke_network_policy().is_none());
3911    /// assert!(x.gke_network_policy_skipped().is_none());
3912    /// assert!(x.cloud_sql_instance().is_none());
3913    /// assert!(x.redis_instance().is_none());
3914    /// assert!(x.redis_cluster().is_none());
3915    /// assert!(x.cloud_function().is_none());
3916    /// assert!(x.app_engine_version().is_none());
3917    /// assert!(x.cloud_run_revision().is_none());
3918    /// assert!(x.nat().is_none());
3919    /// assert!(x.proxy_connection().is_none());
3920    /// assert!(x.load_balancer_backend_info().is_none());
3921    /// assert!(x.storage_bucket().is_none());
3922    /// assert!(x.serverless_neg().is_none());
3923    /// assert!(x.ngfw_packet_inspection().is_none());
3924    /// ```
3925    pub fn set_forwarding_rule<
3926        T: std::convert::Into<std::boxed::Box<crate::model::ForwardingRuleInfo>>,
3927    >(
3928        mut self,
3929        v: T,
3930    ) -> Self {
3931        self.step_info =
3932            std::option::Option::Some(crate::model::step::StepInfo::ForwardingRule(v.into()));
3933        self
3934    }
3935
3936    /// The value of [step_info][crate::model::Step::step_info]
3937    /// if it holds a `HybridSubnet`, `None` if the field is not set or
3938    /// holds a different branch.
3939    pub fn hybrid_subnet(
3940        &self,
3941    ) -> std::option::Option<&std::boxed::Box<crate::model::HybridSubnetInfo>> {
3942        #[allow(unreachable_patterns)]
3943        self.step_info.as_ref().and_then(|v| match v {
3944            crate::model::step::StepInfo::HybridSubnet(v) => std::option::Option::Some(v),
3945            _ => std::option::Option::None,
3946        })
3947    }
3948
3949    /// Sets the value of [step_info][crate::model::Step::step_info]
3950    /// to hold a `HybridSubnet`.
3951    ///
3952    /// Note that all the setters affecting `step_info` are
3953    /// mutually exclusive.
3954    ///
3955    /// # Example
3956    /// ```ignore,no_run
3957    /// # use google_cloud_networkmanagement_v1::model::Step;
3958    /// use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
3959    /// let x = Step::new().set_hybrid_subnet(HybridSubnetInfo::default()/* use setters */);
3960    /// assert!(x.hybrid_subnet().is_some());
3961    /// assert!(x.instance().is_none());
3962    /// assert!(x.firewall().is_none());
3963    /// assert!(x.route().is_none());
3964    /// assert!(x.endpoint().is_none());
3965    /// assert!(x.google_service().is_none());
3966    /// assert!(x.forwarding_rule().is_none());
3967    /// assert!(x.vpn_gateway().is_none());
3968    /// assert!(x.vpn_tunnel().is_none());
3969    /// assert!(x.interconnect_attachment().is_none());
3970    /// assert!(x.vpc_connector().is_none());
3971    /// assert!(x.direct_vpc_egress_connection().is_none());
3972    /// assert!(x.serverless_external_connection().is_none());
3973    /// assert!(x.deliver().is_none());
3974    /// assert!(x.forward().is_none());
3975    /// assert!(x.abort().is_none());
3976    /// assert!(x.drop().is_none());
3977    /// assert!(x.load_balancer().is_none());
3978    /// assert!(x.network().is_none());
3979    /// assert!(x.gke_master().is_none());
3980    /// assert!(x.gke_pod().is_none());
3981    /// assert!(x.ip_masquerading_skipped().is_none());
3982    /// assert!(x.gke_network_policy().is_none());
3983    /// assert!(x.gke_network_policy_skipped().is_none());
3984    /// assert!(x.cloud_sql_instance().is_none());
3985    /// assert!(x.redis_instance().is_none());
3986    /// assert!(x.redis_cluster().is_none());
3987    /// assert!(x.cloud_function().is_none());
3988    /// assert!(x.app_engine_version().is_none());
3989    /// assert!(x.cloud_run_revision().is_none());
3990    /// assert!(x.nat().is_none());
3991    /// assert!(x.proxy_connection().is_none());
3992    /// assert!(x.load_balancer_backend_info().is_none());
3993    /// assert!(x.storage_bucket().is_none());
3994    /// assert!(x.serverless_neg().is_none());
3995    /// assert!(x.ngfw_packet_inspection().is_none());
3996    /// ```
3997    pub fn set_hybrid_subnet<
3998        T: std::convert::Into<std::boxed::Box<crate::model::HybridSubnetInfo>>,
3999    >(
4000        mut self,
4001        v: T,
4002    ) -> Self {
4003        self.step_info =
4004            std::option::Option::Some(crate::model::step::StepInfo::HybridSubnet(v.into()));
4005        self
4006    }
4007
4008    /// The value of [step_info][crate::model::Step::step_info]
4009    /// if it holds a `VpnGateway`, `None` if the field is not set or
4010    /// holds a different branch.
4011    pub fn vpn_gateway(
4012        &self,
4013    ) -> std::option::Option<&std::boxed::Box<crate::model::VpnGatewayInfo>> {
4014        #[allow(unreachable_patterns)]
4015        self.step_info.as_ref().and_then(|v| match v {
4016            crate::model::step::StepInfo::VpnGateway(v) => std::option::Option::Some(v),
4017            _ => std::option::Option::None,
4018        })
4019    }
4020
4021    /// Sets the value of [step_info][crate::model::Step::step_info]
4022    /// to hold a `VpnGateway`.
4023    ///
4024    /// Note that all the setters affecting `step_info` are
4025    /// mutually exclusive.
4026    ///
4027    /// # Example
4028    /// ```ignore,no_run
4029    /// # use google_cloud_networkmanagement_v1::model::Step;
4030    /// use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
4031    /// let x = Step::new().set_vpn_gateway(VpnGatewayInfo::default()/* use setters */);
4032    /// assert!(x.vpn_gateway().is_some());
4033    /// assert!(x.instance().is_none());
4034    /// assert!(x.firewall().is_none());
4035    /// assert!(x.route().is_none());
4036    /// assert!(x.endpoint().is_none());
4037    /// assert!(x.google_service().is_none());
4038    /// assert!(x.forwarding_rule().is_none());
4039    /// assert!(x.hybrid_subnet().is_none());
4040    /// assert!(x.vpn_tunnel().is_none());
4041    /// assert!(x.interconnect_attachment().is_none());
4042    /// assert!(x.vpc_connector().is_none());
4043    /// assert!(x.direct_vpc_egress_connection().is_none());
4044    /// assert!(x.serverless_external_connection().is_none());
4045    /// assert!(x.deliver().is_none());
4046    /// assert!(x.forward().is_none());
4047    /// assert!(x.abort().is_none());
4048    /// assert!(x.drop().is_none());
4049    /// assert!(x.load_balancer().is_none());
4050    /// assert!(x.network().is_none());
4051    /// assert!(x.gke_master().is_none());
4052    /// assert!(x.gke_pod().is_none());
4053    /// assert!(x.ip_masquerading_skipped().is_none());
4054    /// assert!(x.gke_network_policy().is_none());
4055    /// assert!(x.gke_network_policy_skipped().is_none());
4056    /// assert!(x.cloud_sql_instance().is_none());
4057    /// assert!(x.redis_instance().is_none());
4058    /// assert!(x.redis_cluster().is_none());
4059    /// assert!(x.cloud_function().is_none());
4060    /// assert!(x.app_engine_version().is_none());
4061    /// assert!(x.cloud_run_revision().is_none());
4062    /// assert!(x.nat().is_none());
4063    /// assert!(x.proxy_connection().is_none());
4064    /// assert!(x.load_balancer_backend_info().is_none());
4065    /// assert!(x.storage_bucket().is_none());
4066    /// assert!(x.serverless_neg().is_none());
4067    /// assert!(x.ngfw_packet_inspection().is_none());
4068    /// ```
4069    pub fn set_vpn_gateway<T: std::convert::Into<std::boxed::Box<crate::model::VpnGatewayInfo>>>(
4070        mut self,
4071        v: T,
4072    ) -> Self {
4073        self.step_info =
4074            std::option::Option::Some(crate::model::step::StepInfo::VpnGateway(v.into()));
4075        self
4076    }
4077
4078    /// The value of [step_info][crate::model::Step::step_info]
4079    /// if it holds a `VpnTunnel`, `None` if the field is not set or
4080    /// holds a different branch.
4081    pub fn vpn_tunnel(&self) -> std::option::Option<&std::boxed::Box<crate::model::VpnTunnelInfo>> {
4082        #[allow(unreachable_patterns)]
4083        self.step_info.as_ref().and_then(|v| match v {
4084            crate::model::step::StepInfo::VpnTunnel(v) => std::option::Option::Some(v),
4085            _ => std::option::Option::None,
4086        })
4087    }
4088
4089    /// Sets the value of [step_info][crate::model::Step::step_info]
4090    /// to hold a `VpnTunnel`.
4091    ///
4092    /// Note that all the setters affecting `step_info` are
4093    /// mutually exclusive.
4094    ///
4095    /// # Example
4096    /// ```ignore,no_run
4097    /// # use google_cloud_networkmanagement_v1::model::Step;
4098    /// use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
4099    /// let x = Step::new().set_vpn_tunnel(VpnTunnelInfo::default()/* use setters */);
4100    /// assert!(x.vpn_tunnel().is_some());
4101    /// assert!(x.instance().is_none());
4102    /// assert!(x.firewall().is_none());
4103    /// assert!(x.route().is_none());
4104    /// assert!(x.endpoint().is_none());
4105    /// assert!(x.google_service().is_none());
4106    /// assert!(x.forwarding_rule().is_none());
4107    /// assert!(x.hybrid_subnet().is_none());
4108    /// assert!(x.vpn_gateway().is_none());
4109    /// assert!(x.interconnect_attachment().is_none());
4110    /// assert!(x.vpc_connector().is_none());
4111    /// assert!(x.direct_vpc_egress_connection().is_none());
4112    /// assert!(x.serverless_external_connection().is_none());
4113    /// assert!(x.deliver().is_none());
4114    /// assert!(x.forward().is_none());
4115    /// assert!(x.abort().is_none());
4116    /// assert!(x.drop().is_none());
4117    /// assert!(x.load_balancer().is_none());
4118    /// assert!(x.network().is_none());
4119    /// assert!(x.gke_master().is_none());
4120    /// assert!(x.gke_pod().is_none());
4121    /// assert!(x.ip_masquerading_skipped().is_none());
4122    /// assert!(x.gke_network_policy().is_none());
4123    /// assert!(x.gke_network_policy_skipped().is_none());
4124    /// assert!(x.cloud_sql_instance().is_none());
4125    /// assert!(x.redis_instance().is_none());
4126    /// assert!(x.redis_cluster().is_none());
4127    /// assert!(x.cloud_function().is_none());
4128    /// assert!(x.app_engine_version().is_none());
4129    /// assert!(x.cloud_run_revision().is_none());
4130    /// assert!(x.nat().is_none());
4131    /// assert!(x.proxy_connection().is_none());
4132    /// assert!(x.load_balancer_backend_info().is_none());
4133    /// assert!(x.storage_bucket().is_none());
4134    /// assert!(x.serverless_neg().is_none());
4135    /// assert!(x.ngfw_packet_inspection().is_none());
4136    /// ```
4137    pub fn set_vpn_tunnel<T: std::convert::Into<std::boxed::Box<crate::model::VpnTunnelInfo>>>(
4138        mut self,
4139        v: T,
4140    ) -> Self {
4141        self.step_info =
4142            std::option::Option::Some(crate::model::step::StepInfo::VpnTunnel(v.into()));
4143        self
4144    }
4145
4146    /// The value of [step_info][crate::model::Step::step_info]
4147    /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
4148    /// holds a different branch.
4149    pub fn interconnect_attachment(
4150        &self,
4151    ) -> std::option::Option<&std::boxed::Box<crate::model::InterconnectAttachmentInfo>> {
4152        #[allow(unreachable_patterns)]
4153        self.step_info.as_ref().and_then(|v| match v {
4154            crate::model::step::StepInfo::InterconnectAttachment(v) => std::option::Option::Some(v),
4155            _ => std::option::Option::None,
4156        })
4157    }
4158
4159    /// Sets the value of [step_info][crate::model::Step::step_info]
4160    /// to hold a `InterconnectAttachment`.
4161    ///
4162    /// Note that all the setters affecting `step_info` are
4163    /// mutually exclusive.
4164    ///
4165    /// # Example
4166    /// ```ignore,no_run
4167    /// # use google_cloud_networkmanagement_v1::model::Step;
4168    /// use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
4169    /// let x = Step::new().set_interconnect_attachment(InterconnectAttachmentInfo::default()/* use setters */);
4170    /// assert!(x.interconnect_attachment().is_some());
4171    /// assert!(x.instance().is_none());
4172    /// assert!(x.firewall().is_none());
4173    /// assert!(x.route().is_none());
4174    /// assert!(x.endpoint().is_none());
4175    /// assert!(x.google_service().is_none());
4176    /// assert!(x.forwarding_rule().is_none());
4177    /// assert!(x.hybrid_subnet().is_none());
4178    /// assert!(x.vpn_gateway().is_none());
4179    /// assert!(x.vpn_tunnel().is_none());
4180    /// assert!(x.vpc_connector().is_none());
4181    /// assert!(x.direct_vpc_egress_connection().is_none());
4182    /// assert!(x.serverless_external_connection().is_none());
4183    /// assert!(x.deliver().is_none());
4184    /// assert!(x.forward().is_none());
4185    /// assert!(x.abort().is_none());
4186    /// assert!(x.drop().is_none());
4187    /// assert!(x.load_balancer().is_none());
4188    /// assert!(x.network().is_none());
4189    /// assert!(x.gke_master().is_none());
4190    /// assert!(x.gke_pod().is_none());
4191    /// assert!(x.ip_masquerading_skipped().is_none());
4192    /// assert!(x.gke_network_policy().is_none());
4193    /// assert!(x.gke_network_policy_skipped().is_none());
4194    /// assert!(x.cloud_sql_instance().is_none());
4195    /// assert!(x.redis_instance().is_none());
4196    /// assert!(x.redis_cluster().is_none());
4197    /// assert!(x.cloud_function().is_none());
4198    /// assert!(x.app_engine_version().is_none());
4199    /// assert!(x.cloud_run_revision().is_none());
4200    /// assert!(x.nat().is_none());
4201    /// assert!(x.proxy_connection().is_none());
4202    /// assert!(x.load_balancer_backend_info().is_none());
4203    /// assert!(x.storage_bucket().is_none());
4204    /// assert!(x.serverless_neg().is_none());
4205    /// assert!(x.ngfw_packet_inspection().is_none());
4206    /// ```
4207    pub fn set_interconnect_attachment<
4208        T: std::convert::Into<std::boxed::Box<crate::model::InterconnectAttachmentInfo>>,
4209    >(
4210        mut self,
4211        v: T,
4212    ) -> Self {
4213        self.step_info = std::option::Option::Some(
4214            crate::model::step::StepInfo::InterconnectAttachment(v.into()),
4215        );
4216        self
4217    }
4218
4219    /// The value of [step_info][crate::model::Step::step_info]
4220    /// if it holds a `VpcConnector`, `None` if the field is not set or
4221    /// holds a different branch.
4222    pub fn vpc_connector(
4223        &self,
4224    ) -> std::option::Option<&std::boxed::Box<crate::model::VpcConnectorInfo>> {
4225        #[allow(unreachable_patterns)]
4226        self.step_info.as_ref().and_then(|v| match v {
4227            crate::model::step::StepInfo::VpcConnector(v) => std::option::Option::Some(v),
4228            _ => std::option::Option::None,
4229        })
4230    }
4231
4232    /// Sets the value of [step_info][crate::model::Step::step_info]
4233    /// to hold a `VpcConnector`.
4234    ///
4235    /// Note that all the setters affecting `step_info` are
4236    /// mutually exclusive.
4237    ///
4238    /// # Example
4239    /// ```ignore,no_run
4240    /// # use google_cloud_networkmanagement_v1::model::Step;
4241    /// use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
4242    /// let x = Step::new().set_vpc_connector(VpcConnectorInfo::default()/* use setters */);
4243    /// assert!(x.vpc_connector().is_some());
4244    /// assert!(x.instance().is_none());
4245    /// assert!(x.firewall().is_none());
4246    /// assert!(x.route().is_none());
4247    /// assert!(x.endpoint().is_none());
4248    /// assert!(x.google_service().is_none());
4249    /// assert!(x.forwarding_rule().is_none());
4250    /// assert!(x.hybrid_subnet().is_none());
4251    /// assert!(x.vpn_gateway().is_none());
4252    /// assert!(x.vpn_tunnel().is_none());
4253    /// assert!(x.interconnect_attachment().is_none());
4254    /// assert!(x.direct_vpc_egress_connection().is_none());
4255    /// assert!(x.serverless_external_connection().is_none());
4256    /// assert!(x.deliver().is_none());
4257    /// assert!(x.forward().is_none());
4258    /// assert!(x.abort().is_none());
4259    /// assert!(x.drop().is_none());
4260    /// assert!(x.load_balancer().is_none());
4261    /// assert!(x.network().is_none());
4262    /// assert!(x.gke_master().is_none());
4263    /// assert!(x.gke_pod().is_none());
4264    /// assert!(x.ip_masquerading_skipped().is_none());
4265    /// assert!(x.gke_network_policy().is_none());
4266    /// assert!(x.gke_network_policy_skipped().is_none());
4267    /// assert!(x.cloud_sql_instance().is_none());
4268    /// assert!(x.redis_instance().is_none());
4269    /// assert!(x.redis_cluster().is_none());
4270    /// assert!(x.cloud_function().is_none());
4271    /// assert!(x.app_engine_version().is_none());
4272    /// assert!(x.cloud_run_revision().is_none());
4273    /// assert!(x.nat().is_none());
4274    /// assert!(x.proxy_connection().is_none());
4275    /// assert!(x.load_balancer_backend_info().is_none());
4276    /// assert!(x.storage_bucket().is_none());
4277    /// assert!(x.serverless_neg().is_none());
4278    /// assert!(x.ngfw_packet_inspection().is_none());
4279    /// ```
4280    pub fn set_vpc_connector<
4281        T: std::convert::Into<std::boxed::Box<crate::model::VpcConnectorInfo>>,
4282    >(
4283        mut self,
4284        v: T,
4285    ) -> Self {
4286        self.step_info =
4287            std::option::Option::Some(crate::model::step::StepInfo::VpcConnector(v.into()));
4288        self
4289    }
4290
4291    /// The value of [step_info][crate::model::Step::step_info]
4292    /// if it holds a `DirectVpcEgressConnection`, `None` if the field is not set or
4293    /// holds a different branch.
4294    pub fn direct_vpc_egress_connection(
4295        &self,
4296    ) -> std::option::Option<&std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>> {
4297        #[allow(unreachable_patterns)]
4298        self.step_info.as_ref().and_then(|v| match v {
4299            crate::model::step::StepInfo::DirectVpcEgressConnection(v) => {
4300                std::option::Option::Some(v)
4301            }
4302            _ => std::option::Option::None,
4303        })
4304    }
4305
4306    /// Sets the value of [step_info][crate::model::Step::step_info]
4307    /// to hold a `DirectVpcEgressConnection`.
4308    ///
4309    /// Note that all the setters affecting `step_info` are
4310    /// mutually exclusive.
4311    ///
4312    /// # Example
4313    /// ```ignore,no_run
4314    /// # use google_cloud_networkmanagement_v1::model::Step;
4315    /// use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
4316    /// let x = Step::new().set_direct_vpc_egress_connection(DirectVpcEgressConnectionInfo::default()/* use setters */);
4317    /// assert!(x.direct_vpc_egress_connection().is_some());
4318    /// assert!(x.instance().is_none());
4319    /// assert!(x.firewall().is_none());
4320    /// assert!(x.route().is_none());
4321    /// assert!(x.endpoint().is_none());
4322    /// assert!(x.google_service().is_none());
4323    /// assert!(x.forwarding_rule().is_none());
4324    /// assert!(x.hybrid_subnet().is_none());
4325    /// assert!(x.vpn_gateway().is_none());
4326    /// assert!(x.vpn_tunnel().is_none());
4327    /// assert!(x.interconnect_attachment().is_none());
4328    /// assert!(x.vpc_connector().is_none());
4329    /// assert!(x.serverless_external_connection().is_none());
4330    /// assert!(x.deliver().is_none());
4331    /// assert!(x.forward().is_none());
4332    /// assert!(x.abort().is_none());
4333    /// assert!(x.drop().is_none());
4334    /// assert!(x.load_balancer().is_none());
4335    /// assert!(x.network().is_none());
4336    /// assert!(x.gke_master().is_none());
4337    /// assert!(x.gke_pod().is_none());
4338    /// assert!(x.ip_masquerading_skipped().is_none());
4339    /// assert!(x.gke_network_policy().is_none());
4340    /// assert!(x.gke_network_policy_skipped().is_none());
4341    /// assert!(x.cloud_sql_instance().is_none());
4342    /// assert!(x.redis_instance().is_none());
4343    /// assert!(x.redis_cluster().is_none());
4344    /// assert!(x.cloud_function().is_none());
4345    /// assert!(x.app_engine_version().is_none());
4346    /// assert!(x.cloud_run_revision().is_none());
4347    /// assert!(x.nat().is_none());
4348    /// assert!(x.proxy_connection().is_none());
4349    /// assert!(x.load_balancer_backend_info().is_none());
4350    /// assert!(x.storage_bucket().is_none());
4351    /// assert!(x.serverless_neg().is_none());
4352    /// assert!(x.ngfw_packet_inspection().is_none());
4353    /// ```
4354    pub fn set_direct_vpc_egress_connection<
4355        T: std::convert::Into<std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>>,
4356    >(
4357        mut self,
4358        v: T,
4359    ) -> Self {
4360        self.step_info = std::option::Option::Some(
4361            crate::model::step::StepInfo::DirectVpcEgressConnection(v.into()),
4362        );
4363        self
4364    }
4365
4366    /// The value of [step_info][crate::model::Step::step_info]
4367    /// if it holds a `ServerlessExternalConnection`, `None` if the field is not set or
4368    /// holds a different branch.
4369    pub fn serverless_external_connection(
4370        &self,
4371    ) -> std::option::Option<&std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>> {
4372        #[allow(unreachable_patterns)]
4373        self.step_info.as_ref().and_then(|v| match v {
4374            crate::model::step::StepInfo::ServerlessExternalConnection(v) => {
4375                std::option::Option::Some(v)
4376            }
4377            _ => std::option::Option::None,
4378        })
4379    }
4380
4381    /// Sets the value of [step_info][crate::model::Step::step_info]
4382    /// to hold a `ServerlessExternalConnection`.
4383    ///
4384    /// Note that all the setters affecting `step_info` are
4385    /// mutually exclusive.
4386    ///
4387    /// # Example
4388    /// ```ignore,no_run
4389    /// # use google_cloud_networkmanagement_v1::model::Step;
4390    /// use google_cloud_networkmanagement_v1::model::ServerlessExternalConnectionInfo;
4391    /// let x = Step::new().set_serverless_external_connection(ServerlessExternalConnectionInfo::default()/* use setters */);
4392    /// assert!(x.serverless_external_connection().is_some());
4393    /// assert!(x.instance().is_none());
4394    /// assert!(x.firewall().is_none());
4395    /// assert!(x.route().is_none());
4396    /// assert!(x.endpoint().is_none());
4397    /// assert!(x.google_service().is_none());
4398    /// assert!(x.forwarding_rule().is_none());
4399    /// assert!(x.hybrid_subnet().is_none());
4400    /// assert!(x.vpn_gateway().is_none());
4401    /// assert!(x.vpn_tunnel().is_none());
4402    /// assert!(x.interconnect_attachment().is_none());
4403    /// assert!(x.vpc_connector().is_none());
4404    /// assert!(x.direct_vpc_egress_connection().is_none());
4405    /// assert!(x.deliver().is_none());
4406    /// assert!(x.forward().is_none());
4407    /// assert!(x.abort().is_none());
4408    /// assert!(x.drop().is_none());
4409    /// assert!(x.load_balancer().is_none());
4410    /// assert!(x.network().is_none());
4411    /// assert!(x.gke_master().is_none());
4412    /// assert!(x.gke_pod().is_none());
4413    /// assert!(x.ip_masquerading_skipped().is_none());
4414    /// assert!(x.gke_network_policy().is_none());
4415    /// assert!(x.gke_network_policy_skipped().is_none());
4416    /// assert!(x.cloud_sql_instance().is_none());
4417    /// assert!(x.redis_instance().is_none());
4418    /// assert!(x.redis_cluster().is_none());
4419    /// assert!(x.cloud_function().is_none());
4420    /// assert!(x.app_engine_version().is_none());
4421    /// assert!(x.cloud_run_revision().is_none());
4422    /// assert!(x.nat().is_none());
4423    /// assert!(x.proxy_connection().is_none());
4424    /// assert!(x.load_balancer_backend_info().is_none());
4425    /// assert!(x.storage_bucket().is_none());
4426    /// assert!(x.serverless_neg().is_none());
4427    /// assert!(x.ngfw_packet_inspection().is_none());
4428    /// ```
4429    pub fn set_serverless_external_connection<
4430        T: std::convert::Into<std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>>,
4431    >(
4432        mut self,
4433        v: T,
4434    ) -> Self {
4435        self.step_info = std::option::Option::Some(
4436            crate::model::step::StepInfo::ServerlessExternalConnection(v.into()),
4437        );
4438        self
4439    }
4440
4441    /// The value of [step_info][crate::model::Step::step_info]
4442    /// if it holds a `Deliver`, `None` if the field is not set or
4443    /// holds a different branch.
4444    pub fn deliver(&self) -> std::option::Option<&std::boxed::Box<crate::model::DeliverInfo>> {
4445        #[allow(unreachable_patterns)]
4446        self.step_info.as_ref().and_then(|v| match v {
4447            crate::model::step::StepInfo::Deliver(v) => std::option::Option::Some(v),
4448            _ => std::option::Option::None,
4449        })
4450    }
4451
4452    /// Sets the value of [step_info][crate::model::Step::step_info]
4453    /// to hold a `Deliver`.
4454    ///
4455    /// Note that all the setters affecting `step_info` are
4456    /// mutually exclusive.
4457    ///
4458    /// # Example
4459    /// ```ignore,no_run
4460    /// # use google_cloud_networkmanagement_v1::model::Step;
4461    /// use google_cloud_networkmanagement_v1::model::DeliverInfo;
4462    /// let x = Step::new().set_deliver(DeliverInfo::default()/* use setters */);
4463    /// assert!(x.deliver().is_some());
4464    /// assert!(x.instance().is_none());
4465    /// assert!(x.firewall().is_none());
4466    /// assert!(x.route().is_none());
4467    /// assert!(x.endpoint().is_none());
4468    /// assert!(x.google_service().is_none());
4469    /// assert!(x.forwarding_rule().is_none());
4470    /// assert!(x.hybrid_subnet().is_none());
4471    /// assert!(x.vpn_gateway().is_none());
4472    /// assert!(x.vpn_tunnel().is_none());
4473    /// assert!(x.interconnect_attachment().is_none());
4474    /// assert!(x.vpc_connector().is_none());
4475    /// assert!(x.direct_vpc_egress_connection().is_none());
4476    /// assert!(x.serverless_external_connection().is_none());
4477    /// assert!(x.forward().is_none());
4478    /// assert!(x.abort().is_none());
4479    /// assert!(x.drop().is_none());
4480    /// assert!(x.load_balancer().is_none());
4481    /// assert!(x.network().is_none());
4482    /// assert!(x.gke_master().is_none());
4483    /// assert!(x.gke_pod().is_none());
4484    /// assert!(x.ip_masquerading_skipped().is_none());
4485    /// assert!(x.gke_network_policy().is_none());
4486    /// assert!(x.gke_network_policy_skipped().is_none());
4487    /// assert!(x.cloud_sql_instance().is_none());
4488    /// assert!(x.redis_instance().is_none());
4489    /// assert!(x.redis_cluster().is_none());
4490    /// assert!(x.cloud_function().is_none());
4491    /// assert!(x.app_engine_version().is_none());
4492    /// assert!(x.cloud_run_revision().is_none());
4493    /// assert!(x.nat().is_none());
4494    /// assert!(x.proxy_connection().is_none());
4495    /// assert!(x.load_balancer_backend_info().is_none());
4496    /// assert!(x.storage_bucket().is_none());
4497    /// assert!(x.serverless_neg().is_none());
4498    /// assert!(x.ngfw_packet_inspection().is_none());
4499    /// ```
4500    pub fn set_deliver<T: std::convert::Into<std::boxed::Box<crate::model::DeliverInfo>>>(
4501        mut self,
4502        v: T,
4503    ) -> Self {
4504        self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Deliver(v.into()));
4505        self
4506    }
4507
4508    /// The value of [step_info][crate::model::Step::step_info]
4509    /// if it holds a `Forward`, `None` if the field is not set or
4510    /// holds a different branch.
4511    pub fn forward(&self) -> std::option::Option<&std::boxed::Box<crate::model::ForwardInfo>> {
4512        #[allow(unreachable_patterns)]
4513        self.step_info.as_ref().and_then(|v| match v {
4514            crate::model::step::StepInfo::Forward(v) => std::option::Option::Some(v),
4515            _ => std::option::Option::None,
4516        })
4517    }
4518
4519    /// Sets the value of [step_info][crate::model::Step::step_info]
4520    /// to hold a `Forward`.
4521    ///
4522    /// Note that all the setters affecting `step_info` are
4523    /// mutually exclusive.
4524    ///
4525    /// # Example
4526    /// ```ignore,no_run
4527    /// # use google_cloud_networkmanagement_v1::model::Step;
4528    /// use google_cloud_networkmanagement_v1::model::ForwardInfo;
4529    /// let x = Step::new().set_forward(ForwardInfo::default()/* use setters */);
4530    /// assert!(x.forward().is_some());
4531    /// assert!(x.instance().is_none());
4532    /// assert!(x.firewall().is_none());
4533    /// assert!(x.route().is_none());
4534    /// assert!(x.endpoint().is_none());
4535    /// assert!(x.google_service().is_none());
4536    /// assert!(x.forwarding_rule().is_none());
4537    /// assert!(x.hybrid_subnet().is_none());
4538    /// assert!(x.vpn_gateway().is_none());
4539    /// assert!(x.vpn_tunnel().is_none());
4540    /// assert!(x.interconnect_attachment().is_none());
4541    /// assert!(x.vpc_connector().is_none());
4542    /// assert!(x.direct_vpc_egress_connection().is_none());
4543    /// assert!(x.serverless_external_connection().is_none());
4544    /// assert!(x.deliver().is_none());
4545    /// assert!(x.abort().is_none());
4546    /// assert!(x.drop().is_none());
4547    /// assert!(x.load_balancer().is_none());
4548    /// assert!(x.network().is_none());
4549    /// assert!(x.gke_master().is_none());
4550    /// assert!(x.gke_pod().is_none());
4551    /// assert!(x.ip_masquerading_skipped().is_none());
4552    /// assert!(x.gke_network_policy().is_none());
4553    /// assert!(x.gke_network_policy_skipped().is_none());
4554    /// assert!(x.cloud_sql_instance().is_none());
4555    /// assert!(x.redis_instance().is_none());
4556    /// assert!(x.redis_cluster().is_none());
4557    /// assert!(x.cloud_function().is_none());
4558    /// assert!(x.app_engine_version().is_none());
4559    /// assert!(x.cloud_run_revision().is_none());
4560    /// assert!(x.nat().is_none());
4561    /// assert!(x.proxy_connection().is_none());
4562    /// assert!(x.load_balancer_backend_info().is_none());
4563    /// assert!(x.storage_bucket().is_none());
4564    /// assert!(x.serverless_neg().is_none());
4565    /// assert!(x.ngfw_packet_inspection().is_none());
4566    /// ```
4567    pub fn set_forward<T: std::convert::Into<std::boxed::Box<crate::model::ForwardInfo>>>(
4568        mut self,
4569        v: T,
4570    ) -> Self {
4571        self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Forward(v.into()));
4572        self
4573    }
4574
4575    /// The value of [step_info][crate::model::Step::step_info]
4576    /// if it holds a `Abort`, `None` if the field is not set or
4577    /// holds a different branch.
4578    pub fn abort(&self) -> std::option::Option<&std::boxed::Box<crate::model::AbortInfo>> {
4579        #[allow(unreachable_patterns)]
4580        self.step_info.as_ref().and_then(|v| match v {
4581            crate::model::step::StepInfo::Abort(v) => std::option::Option::Some(v),
4582            _ => std::option::Option::None,
4583        })
4584    }
4585
4586    /// Sets the value of [step_info][crate::model::Step::step_info]
4587    /// to hold a `Abort`.
4588    ///
4589    /// Note that all the setters affecting `step_info` are
4590    /// mutually exclusive.
4591    ///
4592    /// # Example
4593    /// ```ignore,no_run
4594    /// # use google_cloud_networkmanagement_v1::model::Step;
4595    /// use google_cloud_networkmanagement_v1::model::AbortInfo;
4596    /// let x = Step::new().set_abort(AbortInfo::default()/* use setters */);
4597    /// assert!(x.abort().is_some());
4598    /// assert!(x.instance().is_none());
4599    /// assert!(x.firewall().is_none());
4600    /// assert!(x.route().is_none());
4601    /// assert!(x.endpoint().is_none());
4602    /// assert!(x.google_service().is_none());
4603    /// assert!(x.forwarding_rule().is_none());
4604    /// assert!(x.hybrid_subnet().is_none());
4605    /// assert!(x.vpn_gateway().is_none());
4606    /// assert!(x.vpn_tunnel().is_none());
4607    /// assert!(x.interconnect_attachment().is_none());
4608    /// assert!(x.vpc_connector().is_none());
4609    /// assert!(x.direct_vpc_egress_connection().is_none());
4610    /// assert!(x.serverless_external_connection().is_none());
4611    /// assert!(x.deliver().is_none());
4612    /// assert!(x.forward().is_none());
4613    /// assert!(x.drop().is_none());
4614    /// assert!(x.load_balancer().is_none());
4615    /// assert!(x.network().is_none());
4616    /// assert!(x.gke_master().is_none());
4617    /// assert!(x.gke_pod().is_none());
4618    /// assert!(x.ip_masquerading_skipped().is_none());
4619    /// assert!(x.gke_network_policy().is_none());
4620    /// assert!(x.gke_network_policy_skipped().is_none());
4621    /// assert!(x.cloud_sql_instance().is_none());
4622    /// assert!(x.redis_instance().is_none());
4623    /// assert!(x.redis_cluster().is_none());
4624    /// assert!(x.cloud_function().is_none());
4625    /// assert!(x.app_engine_version().is_none());
4626    /// assert!(x.cloud_run_revision().is_none());
4627    /// assert!(x.nat().is_none());
4628    /// assert!(x.proxy_connection().is_none());
4629    /// assert!(x.load_balancer_backend_info().is_none());
4630    /// assert!(x.storage_bucket().is_none());
4631    /// assert!(x.serverless_neg().is_none());
4632    /// assert!(x.ngfw_packet_inspection().is_none());
4633    /// ```
4634    pub fn set_abort<T: std::convert::Into<std::boxed::Box<crate::model::AbortInfo>>>(
4635        mut self,
4636        v: T,
4637    ) -> Self {
4638        self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Abort(v.into()));
4639        self
4640    }
4641
4642    /// The value of [step_info][crate::model::Step::step_info]
4643    /// if it holds a `Drop`, `None` if the field is not set or
4644    /// holds a different branch.
4645    pub fn drop(&self) -> std::option::Option<&std::boxed::Box<crate::model::DropInfo>> {
4646        #[allow(unreachable_patterns)]
4647        self.step_info.as_ref().and_then(|v| match v {
4648            crate::model::step::StepInfo::Drop(v) => std::option::Option::Some(v),
4649            _ => std::option::Option::None,
4650        })
4651    }
4652
4653    /// Sets the value of [step_info][crate::model::Step::step_info]
4654    /// to hold a `Drop`.
4655    ///
4656    /// Note that all the setters affecting `step_info` are
4657    /// mutually exclusive.
4658    ///
4659    /// # Example
4660    /// ```ignore,no_run
4661    /// # use google_cloud_networkmanagement_v1::model::Step;
4662    /// use google_cloud_networkmanagement_v1::model::DropInfo;
4663    /// let x = Step::new().set_drop(DropInfo::default()/* use setters */);
4664    /// assert!(x.drop().is_some());
4665    /// assert!(x.instance().is_none());
4666    /// assert!(x.firewall().is_none());
4667    /// assert!(x.route().is_none());
4668    /// assert!(x.endpoint().is_none());
4669    /// assert!(x.google_service().is_none());
4670    /// assert!(x.forwarding_rule().is_none());
4671    /// assert!(x.hybrid_subnet().is_none());
4672    /// assert!(x.vpn_gateway().is_none());
4673    /// assert!(x.vpn_tunnel().is_none());
4674    /// assert!(x.interconnect_attachment().is_none());
4675    /// assert!(x.vpc_connector().is_none());
4676    /// assert!(x.direct_vpc_egress_connection().is_none());
4677    /// assert!(x.serverless_external_connection().is_none());
4678    /// assert!(x.deliver().is_none());
4679    /// assert!(x.forward().is_none());
4680    /// assert!(x.abort().is_none());
4681    /// assert!(x.load_balancer().is_none());
4682    /// assert!(x.network().is_none());
4683    /// assert!(x.gke_master().is_none());
4684    /// assert!(x.gke_pod().is_none());
4685    /// assert!(x.ip_masquerading_skipped().is_none());
4686    /// assert!(x.gke_network_policy().is_none());
4687    /// assert!(x.gke_network_policy_skipped().is_none());
4688    /// assert!(x.cloud_sql_instance().is_none());
4689    /// assert!(x.redis_instance().is_none());
4690    /// assert!(x.redis_cluster().is_none());
4691    /// assert!(x.cloud_function().is_none());
4692    /// assert!(x.app_engine_version().is_none());
4693    /// assert!(x.cloud_run_revision().is_none());
4694    /// assert!(x.nat().is_none());
4695    /// assert!(x.proxy_connection().is_none());
4696    /// assert!(x.load_balancer_backend_info().is_none());
4697    /// assert!(x.storage_bucket().is_none());
4698    /// assert!(x.serverless_neg().is_none());
4699    /// assert!(x.ngfw_packet_inspection().is_none());
4700    /// ```
4701    pub fn set_drop<T: std::convert::Into<std::boxed::Box<crate::model::DropInfo>>>(
4702        mut self,
4703        v: T,
4704    ) -> Self {
4705        self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Drop(v.into()));
4706        self
4707    }
4708
4709    /// The value of [step_info][crate::model::Step::step_info]
4710    /// if it holds a `LoadBalancer`, `None` if the field is not set or
4711    /// holds a different branch.
4712    #[deprecated]
4713    pub fn load_balancer(
4714        &self,
4715    ) -> std::option::Option<&std::boxed::Box<crate::model::LoadBalancerInfo>> {
4716        #[allow(unreachable_patterns)]
4717        self.step_info.as_ref().and_then(|v| match v {
4718            crate::model::step::StepInfo::LoadBalancer(v) => std::option::Option::Some(v),
4719            _ => std::option::Option::None,
4720        })
4721    }
4722
4723    /// Sets the value of [step_info][crate::model::Step::step_info]
4724    /// to hold a `LoadBalancer`.
4725    ///
4726    /// Note that all the setters affecting `step_info` are
4727    /// mutually exclusive.
4728    ///
4729    /// # Example
4730    /// ```ignore,no_run
4731    /// # use google_cloud_networkmanagement_v1::model::Step;
4732    /// use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
4733    /// let x = Step::new().set_load_balancer(LoadBalancerInfo::default()/* use setters */);
4734    /// assert!(x.load_balancer().is_some());
4735    /// assert!(x.instance().is_none());
4736    /// assert!(x.firewall().is_none());
4737    /// assert!(x.route().is_none());
4738    /// assert!(x.endpoint().is_none());
4739    /// assert!(x.google_service().is_none());
4740    /// assert!(x.forwarding_rule().is_none());
4741    /// assert!(x.hybrid_subnet().is_none());
4742    /// assert!(x.vpn_gateway().is_none());
4743    /// assert!(x.vpn_tunnel().is_none());
4744    /// assert!(x.interconnect_attachment().is_none());
4745    /// assert!(x.vpc_connector().is_none());
4746    /// assert!(x.direct_vpc_egress_connection().is_none());
4747    /// assert!(x.serverless_external_connection().is_none());
4748    /// assert!(x.deliver().is_none());
4749    /// assert!(x.forward().is_none());
4750    /// assert!(x.abort().is_none());
4751    /// assert!(x.drop().is_none());
4752    /// assert!(x.network().is_none());
4753    /// assert!(x.gke_master().is_none());
4754    /// assert!(x.gke_pod().is_none());
4755    /// assert!(x.ip_masquerading_skipped().is_none());
4756    /// assert!(x.gke_network_policy().is_none());
4757    /// assert!(x.gke_network_policy_skipped().is_none());
4758    /// assert!(x.cloud_sql_instance().is_none());
4759    /// assert!(x.redis_instance().is_none());
4760    /// assert!(x.redis_cluster().is_none());
4761    /// assert!(x.cloud_function().is_none());
4762    /// assert!(x.app_engine_version().is_none());
4763    /// assert!(x.cloud_run_revision().is_none());
4764    /// assert!(x.nat().is_none());
4765    /// assert!(x.proxy_connection().is_none());
4766    /// assert!(x.load_balancer_backend_info().is_none());
4767    /// assert!(x.storage_bucket().is_none());
4768    /// assert!(x.serverless_neg().is_none());
4769    /// assert!(x.ngfw_packet_inspection().is_none());
4770    /// ```
4771    #[deprecated]
4772    pub fn set_load_balancer<
4773        T: std::convert::Into<std::boxed::Box<crate::model::LoadBalancerInfo>>,
4774    >(
4775        mut self,
4776        v: T,
4777    ) -> Self {
4778        self.step_info =
4779            std::option::Option::Some(crate::model::step::StepInfo::LoadBalancer(v.into()));
4780        self
4781    }
4782
4783    /// The value of [step_info][crate::model::Step::step_info]
4784    /// if it holds a `Network`, `None` if the field is not set or
4785    /// holds a different branch.
4786    pub fn network(&self) -> std::option::Option<&std::boxed::Box<crate::model::NetworkInfo>> {
4787        #[allow(unreachable_patterns)]
4788        self.step_info.as_ref().and_then(|v| match v {
4789            crate::model::step::StepInfo::Network(v) => std::option::Option::Some(v),
4790            _ => std::option::Option::None,
4791        })
4792    }
4793
4794    /// Sets the value of [step_info][crate::model::Step::step_info]
4795    /// to hold a `Network`.
4796    ///
4797    /// Note that all the setters affecting `step_info` are
4798    /// mutually exclusive.
4799    ///
4800    /// # Example
4801    /// ```ignore,no_run
4802    /// # use google_cloud_networkmanagement_v1::model::Step;
4803    /// use google_cloud_networkmanagement_v1::model::NetworkInfo;
4804    /// let x = Step::new().set_network(NetworkInfo::default()/* use setters */);
4805    /// assert!(x.network().is_some());
4806    /// assert!(x.instance().is_none());
4807    /// assert!(x.firewall().is_none());
4808    /// assert!(x.route().is_none());
4809    /// assert!(x.endpoint().is_none());
4810    /// assert!(x.google_service().is_none());
4811    /// assert!(x.forwarding_rule().is_none());
4812    /// assert!(x.hybrid_subnet().is_none());
4813    /// assert!(x.vpn_gateway().is_none());
4814    /// assert!(x.vpn_tunnel().is_none());
4815    /// assert!(x.interconnect_attachment().is_none());
4816    /// assert!(x.vpc_connector().is_none());
4817    /// assert!(x.direct_vpc_egress_connection().is_none());
4818    /// assert!(x.serverless_external_connection().is_none());
4819    /// assert!(x.deliver().is_none());
4820    /// assert!(x.forward().is_none());
4821    /// assert!(x.abort().is_none());
4822    /// assert!(x.drop().is_none());
4823    /// assert!(x.load_balancer().is_none());
4824    /// assert!(x.gke_master().is_none());
4825    /// assert!(x.gke_pod().is_none());
4826    /// assert!(x.ip_masquerading_skipped().is_none());
4827    /// assert!(x.gke_network_policy().is_none());
4828    /// assert!(x.gke_network_policy_skipped().is_none());
4829    /// assert!(x.cloud_sql_instance().is_none());
4830    /// assert!(x.redis_instance().is_none());
4831    /// assert!(x.redis_cluster().is_none());
4832    /// assert!(x.cloud_function().is_none());
4833    /// assert!(x.app_engine_version().is_none());
4834    /// assert!(x.cloud_run_revision().is_none());
4835    /// assert!(x.nat().is_none());
4836    /// assert!(x.proxy_connection().is_none());
4837    /// assert!(x.load_balancer_backend_info().is_none());
4838    /// assert!(x.storage_bucket().is_none());
4839    /// assert!(x.serverless_neg().is_none());
4840    /// assert!(x.ngfw_packet_inspection().is_none());
4841    /// ```
4842    pub fn set_network<T: std::convert::Into<std::boxed::Box<crate::model::NetworkInfo>>>(
4843        mut self,
4844        v: T,
4845    ) -> Self {
4846        self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Network(v.into()));
4847        self
4848    }
4849
4850    /// The value of [step_info][crate::model::Step::step_info]
4851    /// if it holds a `GkeMaster`, `None` if the field is not set or
4852    /// holds a different branch.
4853    pub fn gke_master(&self) -> std::option::Option<&std::boxed::Box<crate::model::GKEMasterInfo>> {
4854        #[allow(unreachable_patterns)]
4855        self.step_info.as_ref().and_then(|v| match v {
4856            crate::model::step::StepInfo::GkeMaster(v) => std::option::Option::Some(v),
4857            _ => std::option::Option::None,
4858        })
4859    }
4860
4861    /// Sets the value of [step_info][crate::model::Step::step_info]
4862    /// to hold a `GkeMaster`.
4863    ///
4864    /// Note that all the setters affecting `step_info` are
4865    /// mutually exclusive.
4866    ///
4867    /// # Example
4868    /// ```ignore,no_run
4869    /// # use google_cloud_networkmanagement_v1::model::Step;
4870    /// use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
4871    /// let x = Step::new().set_gke_master(GKEMasterInfo::default()/* use setters */);
4872    /// assert!(x.gke_master().is_some());
4873    /// assert!(x.instance().is_none());
4874    /// assert!(x.firewall().is_none());
4875    /// assert!(x.route().is_none());
4876    /// assert!(x.endpoint().is_none());
4877    /// assert!(x.google_service().is_none());
4878    /// assert!(x.forwarding_rule().is_none());
4879    /// assert!(x.hybrid_subnet().is_none());
4880    /// assert!(x.vpn_gateway().is_none());
4881    /// assert!(x.vpn_tunnel().is_none());
4882    /// assert!(x.interconnect_attachment().is_none());
4883    /// assert!(x.vpc_connector().is_none());
4884    /// assert!(x.direct_vpc_egress_connection().is_none());
4885    /// assert!(x.serverless_external_connection().is_none());
4886    /// assert!(x.deliver().is_none());
4887    /// assert!(x.forward().is_none());
4888    /// assert!(x.abort().is_none());
4889    /// assert!(x.drop().is_none());
4890    /// assert!(x.load_balancer().is_none());
4891    /// assert!(x.network().is_none());
4892    /// assert!(x.gke_pod().is_none());
4893    /// assert!(x.ip_masquerading_skipped().is_none());
4894    /// assert!(x.gke_network_policy().is_none());
4895    /// assert!(x.gke_network_policy_skipped().is_none());
4896    /// assert!(x.cloud_sql_instance().is_none());
4897    /// assert!(x.redis_instance().is_none());
4898    /// assert!(x.redis_cluster().is_none());
4899    /// assert!(x.cloud_function().is_none());
4900    /// assert!(x.app_engine_version().is_none());
4901    /// assert!(x.cloud_run_revision().is_none());
4902    /// assert!(x.nat().is_none());
4903    /// assert!(x.proxy_connection().is_none());
4904    /// assert!(x.load_balancer_backend_info().is_none());
4905    /// assert!(x.storage_bucket().is_none());
4906    /// assert!(x.serverless_neg().is_none());
4907    /// assert!(x.ngfw_packet_inspection().is_none());
4908    /// ```
4909    pub fn set_gke_master<T: std::convert::Into<std::boxed::Box<crate::model::GKEMasterInfo>>>(
4910        mut self,
4911        v: T,
4912    ) -> Self {
4913        self.step_info =
4914            std::option::Option::Some(crate::model::step::StepInfo::GkeMaster(v.into()));
4915        self
4916    }
4917
4918    /// The value of [step_info][crate::model::Step::step_info]
4919    /// if it holds a `GkePod`, `None` if the field is not set or
4920    /// holds a different branch.
4921    pub fn gke_pod(&self) -> std::option::Option<&std::boxed::Box<crate::model::GkePodInfo>> {
4922        #[allow(unreachable_patterns)]
4923        self.step_info.as_ref().and_then(|v| match v {
4924            crate::model::step::StepInfo::GkePod(v) => std::option::Option::Some(v),
4925            _ => std::option::Option::None,
4926        })
4927    }
4928
4929    /// Sets the value of [step_info][crate::model::Step::step_info]
4930    /// to hold a `GkePod`.
4931    ///
4932    /// Note that all the setters affecting `step_info` are
4933    /// mutually exclusive.
4934    ///
4935    /// # Example
4936    /// ```ignore,no_run
4937    /// # use google_cloud_networkmanagement_v1::model::Step;
4938    /// use google_cloud_networkmanagement_v1::model::GkePodInfo;
4939    /// let x = Step::new().set_gke_pod(GkePodInfo::default()/* use setters */);
4940    /// assert!(x.gke_pod().is_some());
4941    /// assert!(x.instance().is_none());
4942    /// assert!(x.firewall().is_none());
4943    /// assert!(x.route().is_none());
4944    /// assert!(x.endpoint().is_none());
4945    /// assert!(x.google_service().is_none());
4946    /// assert!(x.forwarding_rule().is_none());
4947    /// assert!(x.hybrid_subnet().is_none());
4948    /// assert!(x.vpn_gateway().is_none());
4949    /// assert!(x.vpn_tunnel().is_none());
4950    /// assert!(x.interconnect_attachment().is_none());
4951    /// assert!(x.vpc_connector().is_none());
4952    /// assert!(x.direct_vpc_egress_connection().is_none());
4953    /// assert!(x.serverless_external_connection().is_none());
4954    /// assert!(x.deliver().is_none());
4955    /// assert!(x.forward().is_none());
4956    /// assert!(x.abort().is_none());
4957    /// assert!(x.drop().is_none());
4958    /// assert!(x.load_balancer().is_none());
4959    /// assert!(x.network().is_none());
4960    /// assert!(x.gke_master().is_none());
4961    /// assert!(x.ip_masquerading_skipped().is_none());
4962    /// assert!(x.gke_network_policy().is_none());
4963    /// assert!(x.gke_network_policy_skipped().is_none());
4964    /// assert!(x.cloud_sql_instance().is_none());
4965    /// assert!(x.redis_instance().is_none());
4966    /// assert!(x.redis_cluster().is_none());
4967    /// assert!(x.cloud_function().is_none());
4968    /// assert!(x.app_engine_version().is_none());
4969    /// assert!(x.cloud_run_revision().is_none());
4970    /// assert!(x.nat().is_none());
4971    /// assert!(x.proxy_connection().is_none());
4972    /// assert!(x.load_balancer_backend_info().is_none());
4973    /// assert!(x.storage_bucket().is_none());
4974    /// assert!(x.serverless_neg().is_none());
4975    /// assert!(x.ngfw_packet_inspection().is_none());
4976    /// ```
4977    pub fn set_gke_pod<T: std::convert::Into<std::boxed::Box<crate::model::GkePodInfo>>>(
4978        mut self,
4979        v: T,
4980    ) -> Self {
4981        self.step_info = std::option::Option::Some(crate::model::step::StepInfo::GkePod(v.into()));
4982        self
4983    }
4984
4985    /// The value of [step_info][crate::model::Step::step_info]
4986    /// if it holds a `IpMasqueradingSkipped`, `None` if the field is not set or
4987    /// holds a different branch.
4988    pub fn ip_masquerading_skipped(
4989        &self,
4990    ) -> std::option::Option<&std::boxed::Box<crate::model::IpMasqueradingSkippedInfo>> {
4991        #[allow(unreachable_patterns)]
4992        self.step_info.as_ref().and_then(|v| match v {
4993            crate::model::step::StepInfo::IpMasqueradingSkipped(v) => std::option::Option::Some(v),
4994            _ => std::option::Option::None,
4995        })
4996    }
4997
4998    /// Sets the value of [step_info][crate::model::Step::step_info]
4999    /// to hold a `IpMasqueradingSkipped`.
5000    ///
5001    /// Note that all the setters affecting `step_info` are
5002    /// mutually exclusive.
5003    ///
5004    /// # Example
5005    /// ```ignore,no_run
5006    /// # use google_cloud_networkmanagement_v1::model::Step;
5007    /// use google_cloud_networkmanagement_v1::model::IpMasqueradingSkippedInfo;
5008    /// let x = Step::new().set_ip_masquerading_skipped(IpMasqueradingSkippedInfo::default()/* use setters */);
5009    /// assert!(x.ip_masquerading_skipped().is_some());
5010    /// assert!(x.instance().is_none());
5011    /// assert!(x.firewall().is_none());
5012    /// assert!(x.route().is_none());
5013    /// assert!(x.endpoint().is_none());
5014    /// assert!(x.google_service().is_none());
5015    /// assert!(x.forwarding_rule().is_none());
5016    /// assert!(x.hybrid_subnet().is_none());
5017    /// assert!(x.vpn_gateway().is_none());
5018    /// assert!(x.vpn_tunnel().is_none());
5019    /// assert!(x.interconnect_attachment().is_none());
5020    /// assert!(x.vpc_connector().is_none());
5021    /// assert!(x.direct_vpc_egress_connection().is_none());
5022    /// assert!(x.serverless_external_connection().is_none());
5023    /// assert!(x.deliver().is_none());
5024    /// assert!(x.forward().is_none());
5025    /// assert!(x.abort().is_none());
5026    /// assert!(x.drop().is_none());
5027    /// assert!(x.load_balancer().is_none());
5028    /// assert!(x.network().is_none());
5029    /// assert!(x.gke_master().is_none());
5030    /// assert!(x.gke_pod().is_none());
5031    /// assert!(x.gke_network_policy().is_none());
5032    /// assert!(x.gke_network_policy_skipped().is_none());
5033    /// assert!(x.cloud_sql_instance().is_none());
5034    /// assert!(x.redis_instance().is_none());
5035    /// assert!(x.redis_cluster().is_none());
5036    /// assert!(x.cloud_function().is_none());
5037    /// assert!(x.app_engine_version().is_none());
5038    /// assert!(x.cloud_run_revision().is_none());
5039    /// assert!(x.nat().is_none());
5040    /// assert!(x.proxy_connection().is_none());
5041    /// assert!(x.load_balancer_backend_info().is_none());
5042    /// assert!(x.storage_bucket().is_none());
5043    /// assert!(x.serverless_neg().is_none());
5044    /// assert!(x.ngfw_packet_inspection().is_none());
5045    /// ```
5046    pub fn set_ip_masquerading_skipped<
5047        T: std::convert::Into<std::boxed::Box<crate::model::IpMasqueradingSkippedInfo>>,
5048    >(
5049        mut self,
5050        v: T,
5051    ) -> Self {
5052        self.step_info = std::option::Option::Some(
5053            crate::model::step::StepInfo::IpMasqueradingSkipped(v.into()),
5054        );
5055        self
5056    }
5057
5058    /// The value of [step_info][crate::model::Step::step_info]
5059    /// if it holds a `GkeNetworkPolicy`, `None` if the field is not set or
5060    /// holds a different branch.
5061    pub fn gke_network_policy(
5062        &self,
5063    ) -> std::option::Option<&std::boxed::Box<crate::model::GkeNetworkPolicyInfo>> {
5064        #[allow(unreachable_patterns)]
5065        self.step_info.as_ref().and_then(|v| match v {
5066            crate::model::step::StepInfo::GkeNetworkPolicy(v) => std::option::Option::Some(v),
5067            _ => std::option::Option::None,
5068        })
5069    }
5070
5071    /// Sets the value of [step_info][crate::model::Step::step_info]
5072    /// to hold a `GkeNetworkPolicy`.
5073    ///
5074    /// Note that all the setters affecting `step_info` are
5075    /// mutually exclusive.
5076    ///
5077    /// # Example
5078    /// ```ignore,no_run
5079    /// # use google_cloud_networkmanagement_v1::model::Step;
5080    /// use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
5081    /// let x = Step::new().set_gke_network_policy(GkeNetworkPolicyInfo::default()/* use setters */);
5082    /// assert!(x.gke_network_policy().is_some());
5083    /// assert!(x.instance().is_none());
5084    /// assert!(x.firewall().is_none());
5085    /// assert!(x.route().is_none());
5086    /// assert!(x.endpoint().is_none());
5087    /// assert!(x.google_service().is_none());
5088    /// assert!(x.forwarding_rule().is_none());
5089    /// assert!(x.hybrid_subnet().is_none());
5090    /// assert!(x.vpn_gateway().is_none());
5091    /// assert!(x.vpn_tunnel().is_none());
5092    /// assert!(x.interconnect_attachment().is_none());
5093    /// assert!(x.vpc_connector().is_none());
5094    /// assert!(x.direct_vpc_egress_connection().is_none());
5095    /// assert!(x.serverless_external_connection().is_none());
5096    /// assert!(x.deliver().is_none());
5097    /// assert!(x.forward().is_none());
5098    /// assert!(x.abort().is_none());
5099    /// assert!(x.drop().is_none());
5100    /// assert!(x.load_balancer().is_none());
5101    /// assert!(x.network().is_none());
5102    /// assert!(x.gke_master().is_none());
5103    /// assert!(x.gke_pod().is_none());
5104    /// assert!(x.ip_masquerading_skipped().is_none());
5105    /// assert!(x.gke_network_policy_skipped().is_none());
5106    /// assert!(x.cloud_sql_instance().is_none());
5107    /// assert!(x.redis_instance().is_none());
5108    /// assert!(x.redis_cluster().is_none());
5109    /// assert!(x.cloud_function().is_none());
5110    /// assert!(x.app_engine_version().is_none());
5111    /// assert!(x.cloud_run_revision().is_none());
5112    /// assert!(x.nat().is_none());
5113    /// assert!(x.proxy_connection().is_none());
5114    /// assert!(x.load_balancer_backend_info().is_none());
5115    /// assert!(x.storage_bucket().is_none());
5116    /// assert!(x.serverless_neg().is_none());
5117    /// assert!(x.ngfw_packet_inspection().is_none());
5118    /// ```
5119    pub fn set_gke_network_policy<
5120        T: std::convert::Into<std::boxed::Box<crate::model::GkeNetworkPolicyInfo>>,
5121    >(
5122        mut self,
5123        v: T,
5124    ) -> Self {
5125        self.step_info =
5126            std::option::Option::Some(crate::model::step::StepInfo::GkeNetworkPolicy(v.into()));
5127        self
5128    }
5129
5130    /// The value of [step_info][crate::model::Step::step_info]
5131    /// if it holds a `GkeNetworkPolicySkipped`, `None` if the field is not set or
5132    /// holds a different branch.
5133    pub fn gke_network_policy_skipped(
5134        &self,
5135    ) -> std::option::Option<&std::boxed::Box<crate::model::GkeNetworkPolicySkippedInfo>> {
5136        #[allow(unreachable_patterns)]
5137        self.step_info.as_ref().and_then(|v| match v {
5138            crate::model::step::StepInfo::GkeNetworkPolicySkipped(v) => {
5139                std::option::Option::Some(v)
5140            }
5141            _ => std::option::Option::None,
5142        })
5143    }
5144
5145    /// Sets the value of [step_info][crate::model::Step::step_info]
5146    /// to hold a `GkeNetworkPolicySkipped`.
5147    ///
5148    /// Note that all the setters affecting `step_info` are
5149    /// mutually exclusive.
5150    ///
5151    /// # Example
5152    /// ```ignore,no_run
5153    /// # use google_cloud_networkmanagement_v1::model::Step;
5154    /// use google_cloud_networkmanagement_v1::model::GkeNetworkPolicySkippedInfo;
5155    /// let x = Step::new().set_gke_network_policy_skipped(GkeNetworkPolicySkippedInfo::default()/* use setters */);
5156    /// assert!(x.gke_network_policy_skipped().is_some());
5157    /// assert!(x.instance().is_none());
5158    /// assert!(x.firewall().is_none());
5159    /// assert!(x.route().is_none());
5160    /// assert!(x.endpoint().is_none());
5161    /// assert!(x.google_service().is_none());
5162    /// assert!(x.forwarding_rule().is_none());
5163    /// assert!(x.hybrid_subnet().is_none());
5164    /// assert!(x.vpn_gateway().is_none());
5165    /// assert!(x.vpn_tunnel().is_none());
5166    /// assert!(x.interconnect_attachment().is_none());
5167    /// assert!(x.vpc_connector().is_none());
5168    /// assert!(x.direct_vpc_egress_connection().is_none());
5169    /// assert!(x.serverless_external_connection().is_none());
5170    /// assert!(x.deliver().is_none());
5171    /// assert!(x.forward().is_none());
5172    /// assert!(x.abort().is_none());
5173    /// assert!(x.drop().is_none());
5174    /// assert!(x.load_balancer().is_none());
5175    /// assert!(x.network().is_none());
5176    /// assert!(x.gke_master().is_none());
5177    /// assert!(x.gke_pod().is_none());
5178    /// assert!(x.ip_masquerading_skipped().is_none());
5179    /// assert!(x.gke_network_policy().is_none());
5180    /// assert!(x.cloud_sql_instance().is_none());
5181    /// assert!(x.redis_instance().is_none());
5182    /// assert!(x.redis_cluster().is_none());
5183    /// assert!(x.cloud_function().is_none());
5184    /// assert!(x.app_engine_version().is_none());
5185    /// assert!(x.cloud_run_revision().is_none());
5186    /// assert!(x.nat().is_none());
5187    /// assert!(x.proxy_connection().is_none());
5188    /// assert!(x.load_balancer_backend_info().is_none());
5189    /// assert!(x.storage_bucket().is_none());
5190    /// assert!(x.serverless_neg().is_none());
5191    /// assert!(x.ngfw_packet_inspection().is_none());
5192    /// ```
5193    pub fn set_gke_network_policy_skipped<
5194        T: std::convert::Into<std::boxed::Box<crate::model::GkeNetworkPolicySkippedInfo>>,
5195    >(
5196        mut self,
5197        v: T,
5198    ) -> Self {
5199        self.step_info = std::option::Option::Some(
5200            crate::model::step::StepInfo::GkeNetworkPolicySkipped(v.into()),
5201        );
5202        self
5203    }
5204
5205    /// The value of [step_info][crate::model::Step::step_info]
5206    /// if it holds a `CloudSqlInstance`, `None` if the field is not set or
5207    /// holds a different branch.
5208    pub fn cloud_sql_instance(
5209        &self,
5210    ) -> std::option::Option<&std::boxed::Box<crate::model::CloudSQLInstanceInfo>> {
5211        #[allow(unreachable_patterns)]
5212        self.step_info.as_ref().and_then(|v| match v {
5213            crate::model::step::StepInfo::CloudSqlInstance(v) => std::option::Option::Some(v),
5214            _ => std::option::Option::None,
5215        })
5216    }
5217
5218    /// Sets the value of [step_info][crate::model::Step::step_info]
5219    /// to hold a `CloudSqlInstance`.
5220    ///
5221    /// Note that all the setters affecting `step_info` are
5222    /// mutually exclusive.
5223    ///
5224    /// # Example
5225    /// ```ignore,no_run
5226    /// # use google_cloud_networkmanagement_v1::model::Step;
5227    /// use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
5228    /// let x = Step::new().set_cloud_sql_instance(CloudSQLInstanceInfo::default()/* use setters */);
5229    /// assert!(x.cloud_sql_instance().is_some());
5230    /// assert!(x.instance().is_none());
5231    /// assert!(x.firewall().is_none());
5232    /// assert!(x.route().is_none());
5233    /// assert!(x.endpoint().is_none());
5234    /// assert!(x.google_service().is_none());
5235    /// assert!(x.forwarding_rule().is_none());
5236    /// assert!(x.hybrid_subnet().is_none());
5237    /// assert!(x.vpn_gateway().is_none());
5238    /// assert!(x.vpn_tunnel().is_none());
5239    /// assert!(x.interconnect_attachment().is_none());
5240    /// assert!(x.vpc_connector().is_none());
5241    /// assert!(x.direct_vpc_egress_connection().is_none());
5242    /// assert!(x.serverless_external_connection().is_none());
5243    /// assert!(x.deliver().is_none());
5244    /// assert!(x.forward().is_none());
5245    /// assert!(x.abort().is_none());
5246    /// assert!(x.drop().is_none());
5247    /// assert!(x.load_balancer().is_none());
5248    /// assert!(x.network().is_none());
5249    /// assert!(x.gke_master().is_none());
5250    /// assert!(x.gke_pod().is_none());
5251    /// assert!(x.ip_masquerading_skipped().is_none());
5252    /// assert!(x.gke_network_policy().is_none());
5253    /// assert!(x.gke_network_policy_skipped().is_none());
5254    /// assert!(x.redis_instance().is_none());
5255    /// assert!(x.redis_cluster().is_none());
5256    /// assert!(x.cloud_function().is_none());
5257    /// assert!(x.app_engine_version().is_none());
5258    /// assert!(x.cloud_run_revision().is_none());
5259    /// assert!(x.nat().is_none());
5260    /// assert!(x.proxy_connection().is_none());
5261    /// assert!(x.load_balancer_backend_info().is_none());
5262    /// assert!(x.storage_bucket().is_none());
5263    /// assert!(x.serverless_neg().is_none());
5264    /// assert!(x.ngfw_packet_inspection().is_none());
5265    /// ```
5266    pub fn set_cloud_sql_instance<
5267        T: std::convert::Into<std::boxed::Box<crate::model::CloudSQLInstanceInfo>>,
5268    >(
5269        mut self,
5270        v: T,
5271    ) -> Self {
5272        self.step_info =
5273            std::option::Option::Some(crate::model::step::StepInfo::CloudSqlInstance(v.into()));
5274        self
5275    }
5276
5277    /// The value of [step_info][crate::model::Step::step_info]
5278    /// if it holds a `RedisInstance`, `None` if the field is not set or
5279    /// holds a different branch.
5280    pub fn redis_instance(
5281        &self,
5282    ) -> std::option::Option<&std::boxed::Box<crate::model::RedisInstanceInfo>> {
5283        #[allow(unreachable_patterns)]
5284        self.step_info.as_ref().and_then(|v| match v {
5285            crate::model::step::StepInfo::RedisInstance(v) => std::option::Option::Some(v),
5286            _ => std::option::Option::None,
5287        })
5288    }
5289
5290    /// Sets the value of [step_info][crate::model::Step::step_info]
5291    /// to hold a `RedisInstance`.
5292    ///
5293    /// Note that all the setters affecting `step_info` are
5294    /// mutually exclusive.
5295    ///
5296    /// # Example
5297    /// ```ignore,no_run
5298    /// # use google_cloud_networkmanagement_v1::model::Step;
5299    /// use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
5300    /// let x = Step::new().set_redis_instance(RedisInstanceInfo::default()/* use setters */);
5301    /// assert!(x.redis_instance().is_some());
5302    /// assert!(x.instance().is_none());
5303    /// assert!(x.firewall().is_none());
5304    /// assert!(x.route().is_none());
5305    /// assert!(x.endpoint().is_none());
5306    /// assert!(x.google_service().is_none());
5307    /// assert!(x.forwarding_rule().is_none());
5308    /// assert!(x.hybrid_subnet().is_none());
5309    /// assert!(x.vpn_gateway().is_none());
5310    /// assert!(x.vpn_tunnel().is_none());
5311    /// assert!(x.interconnect_attachment().is_none());
5312    /// assert!(x.vpc_connector().is_none());
5313    /// assert!(x.direct_vpc_egress_connection().is_none());
5314    /// assert!(x.serverless_external_connection().is_none());
5315    /// assert!(x.deliver().is_none());
5316    /// assert!(x.forward().is_none());
5317    /// assert!(x.abort().is_none());
5318    /// assert!(x.drop().is_none());
5319    /// assert!(x.load_balancer().is_none());
5320    /// assert!(x.network().is_none());
5321    /// assert!(x.gke_master().is_none());
5322    /// assert!(x.gke_pod().is_none());
5323    /// assert!(x.ip_masquerading_skipped().is_none());
5324    /// assert!(x.gke_network_policy().is_none());
5325    /// assert!(x.gke_network_policy_skipped().is_none());
5326    /// assert!(x.cloud_sql_instance().is_none());
5327    /// assert!(x.redis_cluster().is_none());
5328    /// assert!(x.cloud_function().is_none());
5329    /// assert!(x.app_engine_version().is_none());
5330    /// assert!(x.cloud_run_revision().is_none());
5331    /// assert!(x.nat().is_none());
5332    /// assert!(x.proxy_connection().is_none());
5333    /// assert!(x.load_balancer_backend_info().is_none());
5334    /// assert!(x.storage_bucket().is_none());
5335    /// assert!(x.serverless_neg().is_none());
5336    /// assert!(x.ngfw_packet_inspection().is_none());
5337    /// ```
5338    pub fn set_redis_instance<
5339        T: std::convert::Into<std::boxed::Box<crate::model::RedisInstanceInfo>>,
5340    >(
5341        mut self,
5342        v: T,
5343    ) -> Self {
5344        self.step_info =
5345            std::option::Option::Some(crate::model::step::StepInfo::RedisInstance(v.into()));
5346        self
5347    }
5348
5349    /// The value of [step_info][crate::model::Step::step_info]
5350    /// if it holds a `RedisCluster`, `None` if the field is not set or
5351    /// holds a different branch.
5352    pub fn redis_cluster(
5353        &self,
5354    ) -> std::option::Option<&std::boxed::Box<crate::model::RedisClusterInfo>> {
5355        #[allow(unreachable_patterns)]
5356        self.step_info.as_ref().and_then(|v| match v {
5357            crate::model::step::StepInfo::RedisCluster(v) => std::option::Option::Some(v),
5358            _ => std::option::Option::None,
5359        })
5360    }
5361
5362    /// Sets the value of [step_info][crate::model::Step::step_info]
5363    /// to hold a `RedisCluster`.
5364    ///
5365    /// Note that all the setters affecting `step_info` are
5366    /// mutually exclusive.
5367    ///
5368    /// # Example
5369    /// ```ignore,no_run
5370    /// # use google_cloud_networkmanagement_v1::model::Step;
5371    /// use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
5372    /// let x = Step::new().set_redis_cluster(RedisClusterInfo::default()/* use setters */);
5373    /// assert!(x.redis_cluster().is_some());
5374    /// assert!(x.instance().is_none());
5375    /// assert!(x.firewall().is_none());
5376    /// assert!(x.route().is_none());
5377    /// assert!(x.endpoint().is_none());
5378    /// assert!(x.google_service().is_none());
5379    /// assert!(x.forwarding_rule().is_none());
5380    /// assert!(x.hybrid_subnet().is_none());
5381    /// assert!(x.vpn_gateway().is_none());
5382    /// assert!(x.vpn_tunnel().is_none());
5383    /// assert!(x.interconnect_attachment().is_none());
5384    /// assert!(x.vpc_connector().is_none());
5385    /// assert!(x.direct_vpc_egress_connection().is_none());
5386    /// assert!(x.serverless_external_connection().is_none());
5387    /// assert!(x.deliver().is_none());
5388    /// assert!(x.forward().is_none());
5389    /// assert!(x.abort().is_none());
5390    /// assert!(x.drop().is_none());
5391    /// assert!(x.load_balancer().is_none());
5392    /// assert!(x.network().is_none());
5393    /// assert!(x.gke_master().is_none());
5394    /// assert!(x.gke_pod().is_none());
5395    /// assert!(x.ip_masquerading_skipped().is_none());
5396    /// assert!(x.gke_network_policy().is_none());
5397    /// assert!(x.gke_network_policy_skipped().is_none());
5398    /// assert!(x.cloud_sql_instance().is_none());
5399    /// assert!(x.redis_instance().is_none());
5400    /// assert!(x.cloud_function().is_none());
5401    /// assert!(x.app_engine_version().is_none());
5402    /// assert!(x.cloud_run_revision().is_none());
5403    /// assert!(x.nat().is_none());
5404    /// assert!(x.proxy_connection().is_none());
5405    /// assert!(x.load_balancer_backend_info().is_none());
5406    /// assert!(x.storage_bucket().is_none());
5407    /// assert!(x.serverless_neg().is_none());
5408    /// assert!(x.ngfw_packet_inspection().is_none());
5409    /// ```
5410    pub fn set_redis_cluster<
5411        T: std::convert::Into<std::boxed::Box<crate::model::RedisClusterInfo>>,
5412    >(
5413        mut self,
5414        v: T,
5415    ) -> Self {
5416        self.step_info =
5417            std::option::Option::Some(crate::model::step::StepInfo::RedisCluster(v.into()));
5418        self
5419    }
5420
5421    /// The value of [step_info][crate::model::Step::step_info]
5422    /// if it holds a `CloudFunction`, `None` if the field is not set or
5423    /// holds a different branch.
5424    pub fn cloud_function(
5425        &self,
5426    ) -> std::option::Option<&std::boxed::Box<crate::model::CloudFunctionInfo>> {
5427        #[allow(unreachable_patterns)]
5428        self.step_info.as_ref().and_then(|v| match v {
5429            crate::model::step::StepInfo::CloudFunction(v) => std::option::Option::Some(v),
5430            _ => std::option::Option::None,
5431        })
5432    }
5433
5434    /// Sets the value of [step_info][crate::model::Step::step_info]
5435    /// to hold a `CloudFunction`.
5436    ///
5437    /// Note that all the setters affecting `step_info` are
5438    /// mutually exclusive.
5439    ///
5440    /// # Example
5441    /// ```ignore,no_run
5442    /// # use google_cloud_networkmanagement_v1::model::Step;
5443    /// use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
5444    /// let x = Step::new().set_cloud_function(CloudFunctionInfo::default()/* use setters */);
5445    /// assert!(x.cloud_function().is_some());
5446    /// assert!(x.instance().is_none());
5447    /// assert!(x.firewall().is_none());
5448    /// assert!(x.route().is_none());
5449    /// assert!(x.endpoint().is_none());
5450    /// assert!(x.google_service().is_none());
5451    /// assert!(x.forwarding_rule().is_none());
5452    /// assert!(x.hybrid_subnet().is_none());
5453    /// assert!(x.vpn_gateway().is_none());
5454    /// assert!(x.vpn_tunnel().is_none());
5455    /// assert!(x.interconnect_attachment().is_none());
5456    /// assert!(x.vpc_connector().is_none());
5457    /// assert!(x.direct_vpc_egress_connection().is_none());
5458    /// assert!(x.serverless_external_connection().is_none());
5459    /// assert!(x.deliver().is_none());
5460    /// assert!(x.forward().is_none());
5461    /// assert!(x.abort().is_none());
5462    /// assert!(x.drop().is_none());
5463    /// assert!(x.load_balancer().is_none());
5464    /// assert!(x.network().is_none());
5465    /// assert!(x.gke_master().is_none());
5466    /// assert!(x.gke_pod().is_none());
5467    /// assert!(x.ip_masquerading_skipped().is_none());
5468    /// assert!(x.gke_network_policy().is_none());
5469    /// assert!(x.gke_network_policy_skipped().is_none());
5470    /// assert!(x.cloud_sql_instance().is_none());
5471    /// assert!(x.redis_instance().is_none());
5472    /// assert!(x.redis_cluster().is_none());
5473    /// assert!(x.app_engine_version().is_none());
5474    /// assert!(x.cloud_run_revision().is_none());
5475    /// assert!(x.nat().is_none());
5476    /// assert!(x.proxy_connection().is_none());
5477    /// assert!(x.load_balancer_backend_info().is_none());
5478    /// assert!(x.storage_bucket().is_none());
5479    /// assert!(x.serverless_neg().is_none());
5480    /// assert!(x.ngfw_packet_inspection().is_none());
5481    /// ```
5482    pub fn set_cloud_function<
5483        T: std::convert::Into<std::boxed::Box<crate::model::CloudFunctionInfo>>,
5484    >(
5485        mut self,
5486        v: T,
5487    ) -> Self {
5488        self.step_info =
5489            std::option::Option::Some(crate::model::step::StepInfo::CloudFunction(v.into()));
5490        self
5491    }
5492
5493    /// The value of [step_info][crate::model::Step::step_info]
5494    /// if it holds a `AppEngineVersion`, `None` if the field is not set or
5495    /// holds a different branch.
5496    pub fn app_engine_version(
5497        &self,
5498    ) -> std::option::Option<&std::boxed::Box<crate::model::AppEngineVersionInfo>> {
5499        #[allow(unreachable_patterns)]
5500        self.step_info.as_ref().and_then(|v| match v {
5501            crate::model::step::StepInfo::AppEngineVersion(v) => std::option::Option::Some(v),
5502            _ => std::option::Option::None,
5503        })
5504    }
5505
5506    /// Sets the value of [step_info][crate::model::Step::step_info]
5507    /// to hold a `AppEngineVersion`.
5508    ///
5509    /// Note that all the setters affecting `step_info` are
5510    /// mutually exclusive.
5511    ///
5512    /// # Example
5513    /// ```ignore,no_run
5514    /// # use google_cloud_networkmanagement_v1::model::Step;
5515    /// use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
5516    /// let x = Step::new().set_app_engine_version(AppEngineVersionInfo::default()/* use setters */);
5517    /// assert!(x.app_engine_version().is_some());
5518    /// assert!(x.instance().is_none());
5519    /// assert!(x.firewall().is_none());
5520    /// assert!(x.route().is_none());
5521    /// assert!(x.endpoint().is_none());
5522    /// assert!(x.google_service().is_none());
5523    /// assert!(x.forwarding_rule().is_none());
5524    /// assert!(x.hybrid_subnet().is_none());
5525    /// assert!(x.vpn_gateway().is_none());
5526    /// assert!(x.vpn_tunnel().is_none());
5527    /// assert!(x.interconnect_attachment().is_none());
5528    /// assert!(x.vpc_connector().is_none());
5529    /// assert!(x.direct_vpc_egress_connection().is_none());
5530    /// assert!(x.serverless_external_connection().is_none());
5531    /// assert!(x.deliver().is_none());
5532    /// assert!(x.forward().is_none());
5533    /// assert!(x.abort().is_none());
5534    /// assert!(x.drop().is_none());
5535    /// assert!(x.load_balancer().is_none());
5536    /// assert!(x.network().is_none());
5537    /// assert!(x.gke_master().is_none());
5538    /// assert!(x.gke_pod().is_none());
5539    /// assert!(x.ip_masquerading_skipped().is_none());
5540    /// assert!(x.gke_network_policy().is_none());
5541    /// assert!(x.gke_network_policy_skipped().is_none());
5542    /// assert!(x.cloud_sql_instance().is_none());
5543    /// assert!(x.redis_instance().is_none());
5544    /// assert!(x.redis_cluster().is_none());
5545    /// assert!(x.cloud_function().is_none());
5546    /// assert!(x.cloud_run_revision().is_none());
5547    /// assert!(x.nat().is_none());
5548    /// assert!(x.proxy_connection().is_none());
5549    /// assert!(x.load_balancer_backend_info().is_none());
5550    /// assert!(x.storage_bucket().is_none());
5551    /// assert!(x.serverless_neg().is_none());
5552    /// assert!(x.ngfw_packet_inspection().is_none());
5553    /// ```
5554    pub fn set_app_engine_version<
5555        T: std::convert::Into<std::boxed::Box<crate::model::AppEngineVersionInfo>>,
5556    >(
5557        mut self,
5558        v: T,
5559    ) -> Self {
5560        self.step_info =
5561            std::option::Option::Some(crate::model::step::StepInfo::AppEngineVersion(v.into()));
5562        self
5563    }
5564
5565    /// The value of [step_info][crate::model::Step::step_info]
5566    /// if it holds a `CloudRunRevision`, `None` if the field is not set or
5567    /// holds a different branch.
5568    pub fn cloud_run_revision(
5569        &self,
5570    ) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunRevisionInfo>> {
5571        #[allow(unreachable_patterns)]
5572        self.step_info.as_ref().and_then(|v| match v {
5573            crate::model::step::StepInfo::CloudRunRevision(v) => std::option::Option::Some(v),
5574            _ => std::option::Option::None,
5575        })
5576    }
5577
5578    /// Sets the value of [step_info][crate::model::Step::step_info]
5579    /// to hold a `CloudRunRevision`.
5580    ///
5581    /// Note that all the setters affecting `step_info` are
5582    /// mutually exclusive.
5583    ///
5584    /// # Example
5585    /// ```ignore,no_run
5586    /// # use google_cloud_networkmanagement_v1::model::Step;
5587    /// use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
5588    /// let x = Step::new().set_cloud_run_revision(CloudRunRevisionInfo::default()/* use setters */);
5589    /// assert!(x.cloud_run_revision().is_some());
5590    /// assert!(x.instance().is_none());
5591    /// assert!(x.firewall().is_none());
5592    /// assert!(x.route().is_none());
5593    /// assert!(x.endpoint().is_none());
5594    /// assert!(x.google_service().is_none());
5595    /// assert!(x.forwarding_rule().is_none());
5596    /// assert!(x.hybrid_subnet().is_none());
5597    /// assert!(x.vpn_gateway().is_none());
5598    /// assert!(x.vpn_tunnel().is_none());
5599    /// assert!(x.interconnect_attachment().is_none());
5600    /// assert!(x.vpc_connector().is_none());
5601    /// assert!(x.direct_vpc_egress_connection().is_none());
5602    /// assert!(x.serverless_external_connection().is_none());
5603    /// assert!(x.deliver().is_none());
5604    /// assert!(x.forward().is_none());
5605    /// assert!(x.abort().is_none());
5606    /// assert!(x.drop().is_none());
5607    /// assert!(x.load_balancer().is_none());
5608    /// assert!(x.network().is_none());
5609    /// assert!(x.gke_master().is_none());
5610    /// assert!(x.gke_pod().is_none());
5611    /// assert!(x.ip_masquerading_skipped().is_none());
5612    /// assert!(x.gke_network_policy().is_none());
5613    /// assert!(x.gke_network_policy_skipped().is_none());
5614    /// assert!(x.cloud_sql_instance().is_none());
5615    /// assert!(x.redis_instance().is_none());
5616    /// assert!(x.redis_cluster().is_none());
5617    /// assert!(x.cloud_function().is_none());
5618    /// assert!(x.app_engine_version().is_none());
5619    /// assert!(x.nat().is_none());
5620    /// assert!(x.proxy_connection().is_none());
5621    /// assert!(x.load_balancer_backend_info().is_none());
5622    /// assert!(x.storage_bucket().is_none());
5623    /// assert!(x.serverless_neg().is_none());
5624    /// assert!(x.ngfw_packet_inspection().is_none());
5625    /// ```
5626    pub fn set_cloud_run_revision<
5627        T: std::convert::Into<std::boxed::Box<crate::model::CloudRunRevisionInfo>>,
5628    >(
5629        mut self,
5630        v: T,
5631    ) -> Self {
5632        self.step_info =
5633            std::option::Option::Some(crate::model::step::StepInfo::CloudRunRevision(v.into()));
5634        self
5635    }
5636
5637    /// The value of [step_info][crate::model::Step::step_info]
5638    /// if it holds a `Nat`, `None` if the field is not set or
5639    /// holds a different branch.
5640    pub fn nat(&self) -> std::option::Option<&std::boxed::Box<crate::model::NatInfo>> {
5641        #[allow(unreachable_patterns)]
5642        self.step_info.as_ref().and_then(|v| match v {
5643            crate::model::step::StepInfo::Nat(v) => std::option::Option::Some(v),
5644            _ => std::option::Option::None,
5645        })
5646    }
5647
5648    /// Sets the value of [step_info][crate::model::Step::step_info]
5649    /// to hold a `Nat`.
5650    ///
5651    /// Note that all the setters affecting `step_info` are
5652    /// mutually exclusive.
5653    ///
5654    /// # Example
5655    /// ```ignore,no_run
5656    /// # use google_cloud_networkmanagement_v1::model::Step;
5657    /// use google_cloud_networkmanagement_v1::model::NatInfo;
5658    /// let x = Step::new().set_nat(NatInfo::default()/* use setters */);
5659    /// assert!(x.nat().is_some());
5660    /// assert!(x.instance().is_none());
5661    /// assert!(x.firewall().is_none());
5662    /// assert!(x.route().is_none());
5663    /// assert!(x.endpoint().is_none());
5664    /// assert!(x.google_service().is_none());
5665    /// assert!(x.forwarding_rule().is_none());
5666    /// assert!(x.hybrid_subnet().is_none());
5667    /// assert!(x.vpn_gateway().is_none());
5668    /// assert!(x.vpn_tunnel().is_none());
5669    /// assert!(x.interconnect_attachment().is_none());
5670    /// assert!(x.vpc_connector().is_none());
5671    /// assert!(x.direct_vpc_egress_connection().is_none());
5672    /// assert!(x.serverless_external_connection().is_none());
5673    /// assert!(x.deliver().is_none());
5674    /// assert!(x.forward().is_none());
5675    /// assert!(x.abort().is_none());
5676    /// assert!(x.drop().is_none());
5677    /// assert!(x.load_balancer().is_none());
5678    /// assert!(x.network().is_none());
5679    /// assert!(x.gke_master().is_none());
5680    /// assert!(x.gke_pod().is_none());
5681    /// assert!(x.ip_masquerading_skipped().is_none());
5682    /// assert!(x.gke_network_policy().is_none());
5683    /// assert!(x.gke_network_policy_skipped().is_none());
5684    /// assert!(x.cloud_sql_instance().is_none());
5685    /// assert!(x.redis_instance().is_none());
5686    /// assert!(x.redis_cluster().is_none());
5687    /// assert!(x.cloud_function().is_none());
5688    /// assert!(x.app_engine_version().is_none());
5689    /// assert!(x.cloud_run_revision().is_none());
5690    /// assert!(x.proxy_connection().is_none());
5691    /// assert!(x.load_balancer_backend_info().is_none());
5692    /// assert!(x.storage_bucket().is_none());
5693    /// assert!(x.serverless_neg().is_none());
5694    /// assert!(x.ngfw_packet_inspection().is_none());
5695    /// ```
5696    pub fn set_nat<T: std::convert::Into<std::boxed::Box<crate::model::NatInfo>>>(
5697        mut self,
5698        v: T,
5699    ) -> Self {
5700        self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Nat(v.into()));
5701        self
5702    }
5703
5704    /// The value of [step_info][crate::model::Step::step_info]
5705    /// if it holds a `ProxyConnection`, `None` if the field is not set or
5706    /// holds a different branch.
5707    pub fn proxy_connection(
5708        &self,
5709    ) -> std::option::Option<&std::boxed::Box<crate::model::ProxyConnectionInfo>> {
5710        #[allow(unreachable_patterns)]
5711        self.step_info.as_ref().and_then(|v| match v {
5712            crate::model::step::StepInfo::ProxyConnection(v) => std::option::Option::Some(v),
5713            _ => std::option::Option::None,
5714        })
5715    }
5716
5717    /// Sets the value of [step_info][crate::model::Step::step_info]
5718    /// to hold a `ProxyConnection`.
5719    ///
5720    /// Note that all the setters affecting `step_info` are
5721    /// mutually exclusive.
5722    ///
5723    /// # Example
5724    /// ```ignore,no_run
5725    /// # use google_cloud_networkmanagement_v1::model::Step;
5726    /// use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
5727    /// let x = Step::new().set_proxy_connection(ProxyConnectionInfo::default()/* use setters */);
5728    /// assert!(x.proxy_connection().is_some());
5729    /// assert!(x.instance().is_none());
5730    /// assert!(x.firewall().is_none());
5731    /// assert!(x.route().is_none());
5732    /// assert!(x.endpoint().is_none());
5733    /// assert!(x.google_service().is_none());
5734    /// assert!(x.forwarding_rule().is_none());
5735    /// assert!(x.hybrid_subnet().is_none());
5736    /// assert!(x.vpn_gateway().is_none());
5737    /// assert!(x.vpn_tunnel().is_none());
5738    /// assert!(x.interconnect_attachment().is_none());
5739    /// assert!(x.vpc_connector().is_none());
5740    /// assert!(x.direct_vpc_egress_connection().is_none());
5741    /// assert!(x.serverless_external_connection().is_none());
5742    /// assert!(x.deliver().is_none());
5743    /// assert!(x.forward().is_none());
5744    /// assert!(x.abort().is_none());
5745    /// assert!(x.drop().is_none());
5746    /// assert!(x.load_balancer().is_none());
5747    /// assert!(x.network().is_none());
5748    /// assert!(x.gke_master().is_none());
5749    /// assert!(x.gke_pod().is_none());
5750    /// assert!(x.ip_masquerading_skipped().is_none());
5751    /// assert!(x.gke_network_policy().is_none());
5752    /// assert!(x.gke_network_policy_skipped().is_none());
5753    /// assert!(x.cloud_sql_instance().is_none());
5754    /// assert!(x.redis_instance().is_none());
5755    /// assert!(x.redis_cluster().is_none());
5756    /// assert!(x.cloud_function().is_none());
5757    /// assert!(x.app_engine_version().is_none());
5758    /// assert!(x.cloud_run_revision().is_none());
5759    /// assert!(x.nat().is_none());
5760    /// assert!(x.load_balancer_backend_info().is_none());
5761    /// assert!(x.storage_bucket().is_none());
5762    /// assert!(x.serverless_neg().is_none());
5763    /// assert!(x.ngfw_packet_inspection().is_none());
5764    /// ```
5765    pub fn set_proxy_connection<
5766        T: std::convert::Into<std::boxed::Box<crate::model::ProxyConnectionInfo>>,
5767    >(
5768        mut self,
5769        v: T,
5770    ) -> Self {
5771        self.step_info =
5772            std::option::Option::Some(crate::model::step::StepInfo::ProxyConnection(v.into()));
5773        self
5774    }
5775
5776    /// The value of [step_info][crate::model::Step::step_info]
5777    /// if it holds a `LoadBalancerBackendInfo`, `None` if the field is not set or
5778    /// holds a different branch.
5779    pub fn load_balancer_backend_info(
5780        &self,
5781    ) -> std::option::Option<&std::boxed::Box<crate::model::LoadBalancerBackendInfo>> {
5782        #[allow(unreachable_patterns)]
5783        self.step_info.as_ref().and_then(|v| match v {
5784            crate::model::step::StepInfo::LoadBalancerBackendInfo(v) => {
5785                std::option::Option::Some(v)
5786            }
5787            _ => std::option::Option::None,
5788        })
5789    }
5790
5791    /// Sets the value of [step_info][crate::model::Step::step_info]
5792    /// to hold a `LoadBalancerBackendInfo`.
5793    ///
5794    /// Note that all the setters affecting `step_info` are
5795    /// mutually exclusive.
5796    ///
5797    /// # Example
5798    /// ```ignore,no_run
5799    /// # use google_cloud_networkmanagement_v1::model::Step;
5800    /// use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
5801    /// let x = Step::new().set_load_balancer_backend_info(LoadBalancerBackendInfo::default()/* use setters */);
5802    /// assert!(x.load_balancer_backend_info().is_some());
5803    /// assert!(x.instance().is_none());
5804    /// assert!(x.firewall().is_none());
5805    /// assert!(x.route().is_none());
5806    /// assert!(x.endpoint().is_none());
5807    /// assert!(x.google_service().is_none());
5808    /// assert!(x.forwarding_rule().is_none());
5809    /// assert!(x.hybrid_subnet().is_none());
5810    /// assert!(x.vpn_gateway().is_none());
5811    /// assert!(x.vpn_tunnel().is_none());
5812    /// assert!(x.interconnect_attachment().is_none());
5813    /// assert!(x.vpc_connector().is_none());
5814    /// assert!(x.direct_vpc_egress_connection().is_none());
5815    /// assert!(x.serverless_external_connection().is_none());
5816    /// assert!(x.deliver().is_none());
5817    /// assert!(x.forward().is_none());
5818    /// assert!(x.abort().is_none());
5819    /// assert!(x.drop().is_none());
5820    /// assert!(x.load_balancer().is_none());
5821    /// assert!(x.network().is_none());
5822    /// assert!(x.gke_master().is_none());
5823    /// assert!(x.gke_pod().is_none());
5824    /// assert!(x.ip_masquerading_skipped().is_none());
5825    /// assert!(x.gke_network_policy().is_none());
5826    /// assert!(x.gke_network_policy_skipped().is_none());
5827    /// assert!(x.cloud_sql_instance().is_none());
5828    /// assert!(x.redis_instance().is_none());
5829    /// assert!(x.redis_cluster().is_none());
5830    /// assert!(x.cloud_function().is_none());
5831    /// assert!(x.app_engine_version().is_none());
5832    /// assert!(x.cloud_run_revision().is_none());
5833    /// assert!(x.nat().is_none());
5834    /// assert!(x.proxy_connection().is_none());
5835    /// assert!(x.storage_bucket().is_none());
5836    /// assert!(x.serverless_neg().is_none());
5837    /// assert!(x.ngfw_packet_inspection().is_none());
5838    /// ```
5839    pub fn set_load_balancer_backend_info<
5840        T: std::convert::Into<std::boxed::Box<crate::model::LoadBalancerBackendInfo>>,
5841    >(
5842        mut self,
5843        v: T,
5844    ) -> Self {
5845        self.step_info = std::option::Option::Some(
5846            crate::model::step::StepInfo::LoadBalancerBackendInfo(v.into()),
5847        );
5848        self
5849    }
5850
5851    /// The value of [step_info][crate::model::Step::step_info]
5852    /// if it holds a `StorageBucket`, `None` if the field is not set or
5853    /// holds a different branch.
5854    pub fn storage_bucket(
5855        &self,
5856    ) -> std::option::Option<&std::boxed::Box<crate::model::StorageBucketInfo>> {
5857        #[allow(unreachable_patterns)]
5858        self.step_info.as_ref().and_then(|v| match v {
5859            crate::model::step::StepInfo::StorageBucket(v) => std::option::Option::Some(v),
5860            _ => std::option::Option::None,
5861        })
5862    }
5863
5864    /// Sets the value of [step_info][crate::model::Step::step_info]
5865    /// to hold a `StorageBucket`.
5866    ///
5867    /// Note that all the setters affecting `step_info` are
5868    /// mutually exclusive.
5869    ///
5870    /// # Example
5871    /// ```ignore,no_run
5872    /// # use google_cloud_networkmanagement_v1::model::Step;
5873    /// use google_cloud_networkmanagement_v1::model::StorageBucketInfo;
5874    /// let x = Step::new().set_storage_bucket(StorageBucketInfo::default()/* use setters */);
5875    /// assert!(x.storage_bucket().is_some());
5876    /// assert!(x.instance().is_none());
5877    /// assert!(x.firewall().is_none());
5878    /// assert!(x.route().is_none());
5879    /// assert!(x.endpoint().is_none());
5880    /// assert!(x.google_service().is_none());
5881    /// assert!(x.forwarding_rule().is_none());
5882    /// assert!(x.hybrid_subnet().is_none());
5883    /// assert!(x.vpn_gateway().is_none());
5884    /// assert!(x.vpn_tunnel().is_none());
5885    /// assert!(x.interconnect_attachment().is_none());
5886    /// assert!(x.vpc_connector().is_none());
5887    /// assert!(x.direct_vpc_egress_connection().is_none());
5888    /// assert!(x.serverless_external_connection().is_none());
5889    /// assert!(x.deliver().is_none());
5890    /// assert!(x.forward().is_none());
5891    /// assert!(x.abort().is_none());
5892    /// assert!(x.drop().is_none());
5893    /// assert!(x.load_balancer().is_none());
5894    /// assert!(x.network().is_none());
5895    /// assert!(x.gke_master().is_none());
5896    /// assert!(x.gke_pod().is_none());
5897    /// assert!(x.ip_masquerading_skipped().is_none());
5898    /// assert!(x.gke_network_policy().is_none());
5899    /// assert!(x.gke_network_policy_skipped().is_none());
5900    /// assert!(x.cloud_sql_instance().is_none());
5901    /// assert!(x.redis_instance().is_none());
5902    /// assert!(x.redis_cluster().is_none());
5903    /// assert!(x.cloud_function().is_none());
5904    /// assert!(x.app_engine_version().is_none());
5905    /// assert!(x.cloud_run_revision().is_none());
5906    /// assert!(x.nat().is_none());
5907    /// assert!(x.proxy_connection().is_none());
5908    /// assert!(x.load_balancer_backend_info().is_none());
5909    /// assert!(x.serverless_neg().is_none());
5910    /// assert!(x.ngfw_packet_inspection().is_none());
5911    /// ```
5912    pub fn set_storage_bucket<
5913        T: std::convert::Into<std::boxed::Box<crate::model::StorageBucketInfo>>,
5914    >(
5915        mut self,
5916        v: T,
5917    ) -> Self {
5918        self.step_info =
5919            std::option::Option::Some(crate::model::step::StepInfo::StorageBucket(v.into()));
5920        self
5921    }
5922
5923    /// The value of [step_info][crate::model::Step::step_info]
5924    /// if it holds a `ServerlessNeg`, `None` if the field is not set or
5925    /// holds a different branch.
5926    pub fn serverless_neg(
5927        &self,
5928    ) -> std::option::Option<&std::boxed::Box<crate::model::ServerlessNegInfo>> {
5929        #[allow(unreachable_patterns)]
5930        self.step_info.as_ref().and_then(|v| match v {
5931            crate::model::step::StepInfo::ServerlessNeg(v) => std::option::Option::Some(v),
5932            _ => std::option::Option::None,
5933        })
5934    }
5935
5936    /// Sets the value of [step_info][crate::model::Step::step_info]
5937    /// to hold a `ServerlessNeg`.
5938    ///
5939    /// Note that all the setters affecting `step_info` are
5940    /// mutually exclusive.
5941    ///
5942    /// # Example
5943    /// ```ignore,no_run
5944    /// # use google_cloud_networkmanagement_v1::model::Step;
5945    /// use google_cloud_networkmanagement_v1::model::ServerlessNegInfo;
5946    /// let x = Step::new().set_serverless_neg(ServerlessNegInfo::default()/* use setters */);
5947    /// assert!(x.serverless_neg().is_some());
5948    /// assert!(x.instance().is_none());
5949    /// assert!(x.firewall().is_none());
5950    /// assert!(x.route().is_none());
5951    /// assert!(x.endpoint().is_none());
5952    /// assert!(x.google_service().is_none());
5953    /// assert!(x.forwarding_rule().is_none());
5954    /// assert!(x.hybrid_subnet().is_none());
5955    /// assert!(x.vpn_gateway().is_none());
5956    /// assert!(x.vpn_tunnel().is_none());
5957    /// assert!(x.interconnect_attachment().is_none());
5958    /// assert!(x.vpc_connector().is_none());
5959    /// assert!(x.direct_vpc_egress_connection().is_none());
5960    /// assert!(x.serverless_external_connection().is_none());
5961    /// assert!(x.deliver().is_none());
5962    /// assert!(x.forward().is_none());
5963    /// assert!(x.abort().is_none());
5964    /// assert!(x.drop().is_none());
5965    /// assert!(x.load_balancer().is_none());
5966    /// assert!(x.network().is_none());
5967    /// assert!(x.gke_master().is_none());
5968    /// assert!(x.gke_pod().is_none());
5969    /// assert!(x.ip_masquerading_skipped().is_none());
5970    /// assert!(x.gke_network_policy().is_none());
5971    /// assert!(x.gke_network_policy_skipped().is_none());
5972    /// assert!(x.cloud_sql_instance().is_none());
5973    /// assert!(x.redis_instance().is_none());
5974    /// assert!(x.redis_cluster().is_none());
5975    /// assert!(x.cloud_function().is_none());
5976    /// assert!(x.app_engine_version().is_none());
5977    /// assert!(x.cloud_run_revision().is_none());
5978    /// assert!(x.nat().is_none());
5979    /// assert!(x.proxy_connection().is_none());
5980    /// assert!(x.load_balancer_backend_info().is_none());
5981    /// assert!(x.storage_bucket().is_none());
5982    /// assert!(x.ngfw_packet_inspection().is_none());
5983    /// ```
5984    pub fn set_serverless_neg<
5985        T: std::convert::Into<std::boxed::Box<crate::model::ServerlessNegInfo>>,
5986    >(
5987        mut self,
5988        v: T,
5989    ) -> Self {
5990        self.step_info =
5991            std::option::Option::Some(crate::model::step::StepInfo::ServerlessNeg(v.into()));
5992        self
5993    }
5994
5995    /// The value of [step_info][crate::model::Step::step_info]
5996    /// if it holds a `NgfwPacketInspection`, `None` if the field is not set or
5997    /// holds a different branch.
5998    pub fn ngfw_packet_inspection(
5999        &self,
6000    ) -> std::option::Option<&std::boxed::Box<crate::model::NgfwPacketInspectionInfo>> {
6001        #[allow(unreachable_patterns)]
6002        self.step_info.as_ref().and_then(|v| match v {
6003            crate::model::step::StepInfo::NgfwPacketInspection(v) => std::option::Option::Some(v),
6004            _ => std::option::Option::None,
6005        })
6006    }
6007
6008    /// Sets the value of [step_info][crate::model::Step::step_info]
6009    /// to hold a `NgfwPacketInspection`.
6010    ///
6011    /// Note that all the setters affecting `step_info` are
6012    /// mutually exclusive.
6013    ///
6014    /// # Example
6015    /// ```ignore,no_run
6016    /// # use google_cloud_networkmanagement_v1::model::Step;
6017    /// use google_cloud_networkmanagement_v1::model::NgfwPacketInspectionInfo;
6018    /// let x = Step::new().set_ngfw_packet_inspection(NgfwPacketInspectionInfo::default()/* use setters */);
6019    /// assert!(x.ngfw_packet_inspection().is_some());
6020    /// assert!(x.instance().is_none());
6021    /// assert!(x.firewall().is_none());
6022    /// assert!(x.route().is_none());
6023    /// assert!(x.endpoint().is_none());
6024    /// assert!(x.google_service().is_none());
6025    /// assert!(x.forwarding_rule().is_none());
6026    /// assert!(x.hybrid_subnet().is_none());
6027    /// assert!(x.vpn_gateway().is_none());
6028    /// assert!(x.vpn_tunnel().is_none());
6029    /// assert!(x.interconnect_attachment().is_none());
6030    /// assert!(x.vpc_connector().is_none());
6031    /// assert!(x.direct_vpc_egress_connection().is_none());
6032    /// assert!(x.serverless_external_connection().is_none());
6033    /// assert!(x.deliver().is_none());
6034    /// assert!(x.forward().is_none());
6035    /// assert!(x.abort().is_none());
6036    /// assert!(x.drop().is_none());
6037    /// assert!(x.load_balancer().is_none());
6038    /// assert!(x.network().is_none());
6039    /// assert!(x.gke_master().is_none());
6040    /// assert!(x.gke_pod().is_none());
6041    /// assert!(x.ip_masquerading_skipped().is_none());
6042    /// assert!(x.gke_network_policy().is_none());
6043    /// assert!(x.gke_network_policy_skipped().is_none());
6044    /// assert!(x.cloud_sql_instance().is_none());
6045    /// assert!(x.redis_instance().is_none());
6046    /// assert!(x.redis_cluster().is_none());
6047    /// assert!(x.cloud_function().is_none());
6048    /// assert!(x.app_engine_version().is_none());
6049    /// assert!(x.cloud_run_revision().is_none());
6050    /// assert!(x.nat().is_none());
6051    /// assert!(x.proxy_connection().is_none());
6052    /// assert!(x.load_balancer_backend_info().is_none());
6053    /// assert!(x.storage_bucket().is_none());
6054    /// assert!(x.serverless_neg().is_none());
6055    /// ```
6056    pub fn set_ngfw_packet_inspection<
6057        T: std::convert::Into<std::boxed::Box<crate::model::NgfwPacketInspectionInfo>>,
6058    >(
6059        mut self,
6060        v: T,
6061    ) -> Self {
6062        self.step_info =
6063            std::option::Option::Some(crate::model::step::StepInfo::NgfwPacketInspection(v.into()));
6064        self
6065    }
6066}
6067
6068impl wkt::message::Message for Step {
6069    fn typename() -> &'static str {
6070        "type.googleapis.com/google.cloud.networkmanagement.v1.Step"
6071    }
6072}
6073
6074/// Defines additional types related to [Step].
6075pub mod step {
6076    #[allow(unused_imports)]
6077    use super::*;
6078
6079    /// Type of states that are defined in the network state machine.
6080    /// Each step in the packet trace is in a specific state.
6081    ///
6082    /// # Working with unknown values
6083    ///
6084    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6085    /// additional enum variants at any time. Adding new variants is not considered
6086    /// a breaking change. Applications should write their code in anticipation of:
6087    ///
6088    /// - New values appearing in future releases of the client library, **and**
6089    /// - New values received dynamically, without application changes.
6090    ///
6091    /// Please consult the [Working with enums] section in the user guide for some
6092    /// guidelines.
6093    ///
6094    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6095    #[derive(Clone, Debug, PartialEq)]
6096    #[non_exhaustive]
6097    pub enum State {
6098        /// Unspecified state.
6099        Unspecified,
6100        /// Initial state: packet originating from a Compute Engine instance.
6101        /// An InstanceInfo is populated with starting instance information.
6102        StartFromInstance,
6103        /// Initial state: packet originating from the internet.
6104        /// The endpoint information is populated.
6105        StartFromInternet,
6106        /// Initial state: packet originating from a Google service.
6107        /// The google_service information is populated.
6108        StartFromGoogleService,
6109        /// Initial state: packet originating from a VPC or on-premises network
6110        /// with internal source IP.
6111        /// If the source is a VPC network visible to the user, a NetworkInfo
6112        /// is populated with details of the network.
6113        StartFromPrivateNetwork,
6114        /// Initial state: packet originating from a Google Kubernetes Engine cluster
6115        /// master. A GKEMasterInfo is populated with starting instance information.
6116        StartFromGkeMaster,
6117        /// Initial state: packet originating from a Cloud SQL instance.
6118        /// A CloudSQLInstanceInfo is populated with starting instance information.
6119        StartFromCloudSqlInstance,
6120        /// Initial state: packet originating from a Google Kubernetes Engine Pod.
6121        /// A GkePodInfo is populated with starting Pod information.
6122        StartFromGkePod,
6123        /// Initial state: packet originating from a Redis instance.
6124        /// A RedisInstanceInfo is populated with starting instance information.
6125        StartFromRedisInstance,
6126        /// Initial state: packet originating from a Redis Cluster.
6127        /// A RedisClusterInfo is populated with starting Cluster information.
6128        StartFromRedisCluster,
6129        /// Initial state: packet originating from a Cloud Function.
6130        /// A CloudFunctionInfo is populated with starting function information.
6131        StartFromCloudFunction,
6132        /// Initial state: packet originating from an App Engine service version.
6133        /// An AppEngineVersionInfo is populated with starting version information.
6134        StartFromAppEngineVersion,
6135        /// Initial state: packet originating from a Cloud Run revision.
6136        /// A CloudRunRevisionInfo is populated with starting revision information.
6137        StartFromCloudRunRevision,
6138        /// Initial state: packet originating from a Storage Bucket. Used only for
6139        /// return traces.
6140        /// The storage_bucket information is populated.
6141        StartFromStorageBucket,
6142        /// Initial state: packet originating from a published service that uses
6143        /// Private Service Connect. Used only for return traces.
6144        StartFromPscPublishedService,
6145        /// Initial state: packet originating from a serverless network endpoint
6146        /// group backend. Used only for return traces.
6147        /// The serverless_neg information is populated.
6148        StartFromServerlessNeg,
6149        /// Config checking state: verify ingress firewall rule.
6150        ApplyIngressFirewallRule,
6151        /// Config checking state: verify egress firewall rule.
6152        ApplyEgressFirewallRule,
6153        /// Config checking state: verify route.
6154        ApplyRoute,
6155        /// Config checking state: match forwarding rule.
6156        ApplyForwardingRule,
6157        /// Config checking state: verify load balancer backend configuration.
6158        AnalyzeLoadBalancerBackend,
6159        /// Config checking state: packet sent or received under foreign IP
6160        /// address and allowed.
6161        SpoofingApproved,
6162        /// Forwarding state: arriving at a Compute Engine instance.
6163        ArriveAtInstance,
6164        /// Forwarding state: arriving at a Compute Engine internal load balancer.
6165        #[deprecated]
6166        ArriveAtInternalLoadBalancer,
6167        /// Forwarding state: arriving at a Compute Engine external load balancer.
6168        #[deprecated]
6169        ArriveAtExternalLoadBalancer,
6170        /// Forwarding state: arriving at a hybrid subnet. Appropriate routing
6171        /// configuration will be determined here.
6172        ArriveAtHybridSubnet,
6173        /// Forwarding state: arriving at a Cloud VPN gateway.
6174        ArriveAtVpnGateway,
6175        /// Forwarding state: arriving at a Cloud VPN tunnel.
6176        ArriveAtVpnTunnel,
6177        /// Forwarding state: arriving at an interconnect attachment.
6178        ArriveAtInterconnectAttachment,
6179        /// Forwarding state: arriving at a VPC connector.
6180        ArriveAtVpcConnector,
6181        /// Forwarding state: arriving at a GKE Pod.
6182        ArriveAtGkePod,
6183        /// Forwarding state: for packets originating from a serverless endpoint
6184        /// forwarded through Direct VPC egress.
6185        DirectVpcEgressConnection,
6186        /// Forwarding state: for packets originating from a serverless endpoint
6187        /// forwarded through public (external) connectivity.
6188        ServerlessExternalConnection,
6189        /// Forwarding state: Layer 7 packet inspection by the firewall endpoint
6190        /// based on the configured security profile group.
6191        NgfwPacketInspection,
6192        /// Transition state: packet header translated. The `nat` field is populated
6193        /// with the translation information.
6194        Nat,
6195        /// Transition state: GKE Pod IP masquerading is skipped. The
6196        /// `ip_masquerading_skipped` field is populated with the reason.
6197        SkipGkePodIpMasquerading,
6198        /// Transition state: GKE Ingress Network Policy is skipped. The
6199        /// `gke_network_policy_skipped` field is populated with the reason.
6200        SkipGkeIngressNetworkPolicy,
6201        /// Transition state: GKE Egress Network Policy is skipped. The
6202        /// `gke_network_policy_skipped` field is populated with the reason.
6203        SkipGkeEgressNetworkPolicy,
6204        /// Config checking state: verify ingress GKE network policy.
6205        ApplyIngressGkeNetworkPolicy,
6206        /// Config checking state: verify egress GKE network policy.
6207        ApplyEgressGkeNetworkPolicy,
6208        /// Transition state: original connection is terminated and a new proxied
6209        /// connection is initiated.
6210        ProxyConnection,
6211        /// Final state: packet could be delivered.
6212        Deliver,
6213        /// Final state: packet could be dropped.
6214        Drop,
6215        /// Final state: packet could be forwarded to a network with an unknown
6216        /// configuration.
6217        Forward,
6218        /// Final state: analysis is aborted.
6219        Abort,
6220        /// Special state: viewer of the test result does not have permission to
6221        /// see the configuration in this step.
6222        ViewerPermissionMissing,
6223        /// If set, the enum was initialized with an unknown value.
6224        ///
6225        /// Applications can examine the value using [State::value] or
6226        /// [State::name].
6227        UnknownValue(state::UnknownValue),
6228    }
6229
6230    #[doc(hidden)]
6231    pub mod state {
6232        #[allow(unused_imports)]
6233        use super::*;
6234        #[derive(Clone, Debug, PartialEq)]
6235        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6236    }
6237
6238    impl State {
6239        /// Gets the enum value.
6240        ///
6241        /// Returns `None` if the enum contains an unknown value deserialized from
6242        /// the string representation of enums.
6243        pub fn value(&self) -> std::option::Option<i32> {
6244            match self {
6245                Self::Unspecified => std::option::Option::Some(0),
6246                Self::StartFromInstance => std::option::Option::Some(1),
6247                Self::StartFromInternet => std::option::Option::Some(2),
6248                Self::StartFromGoogleService => std::option::Option::Some(27),
6249                Self::StartFromPrivateNetwork => std::option::Option::Some(3),
6250                Self::StartFromGkeMaster => std::option::Option::Some(21),
6251                Self::StartFromCloudSqlInstance => std::option::Option::Some(22),
6252                Self::StartFromGkePod => std::option::Option::Some(39),
6253                Self::StartFromRedisInstance => std::option::Option::Some(32),
6254                Self::StartFromRedisCluster => std::option::Option::Some(33),
6255                Self::StartFromCloudFunction => std::option::Option::Some(23),
6256                Self::StartFromAppEngineVersion => std::option::Option::Some(25),
6257                Self::StartFromCloudRunRevision => std::option::Option::Some(26),
6258                Self::StartFromStorageBucket => std::option::Option::Some(29),
6259                Self::StartFromPscPublishedService => std::option::Option::Some(30),
6260                Self::StartFromServerlessNeg => std::option::Option::Some(31),
6261                Self::ApplyIngressFirewallRule => std::option::Option::Some(4),
6262                Self::ApplyEgressFirewallRule => std::option::Option::Some(5),
6263                Self::ApplyRoute => std::option::Option::Some(6),
6264                Self::ApplyForwardingRule => std::option::Option::Some(7),
6265                Self::AnalyzeLoadBalancerBackend => std::option::Option::Some(28),
6266                Self::SpoofingApproved => std::option::Option::Some(8),
6267                Self::ArriveAtInstance => std::option::Option::Some(9),
6268                Self::ArriveAtInternalLoadBalancer => std::option::Option::Some(10),
6269                Self::ArriveAtExternalLoadBalancer => std::option::Option::Some(11),
6270                Self::ArriveAtHybridSubnet => std::option::Option::Some(38),
6271                Self::ArriveAtVpnGateway => std::option::Option::Some(12),
6272                Self::ArriveAtVpnTunnel => std::option::Option::Some(13),
6273                Self::ArriveAtInterconnectAttachment => std::option::Option::Some(37),
6274                Self::ArriveAtVpcConnector => std::option::Option::Some(24),
6275                Self::ArriveAtGkePod => std::option::Option::Some(44),
6276                Self::DirectVpcEgressConnection => std::option::Option::Some(35),
6277                Self::ServerlessExternalConnection => std::option::Option::Some(36),
6278                Self::NgfwPacketInspection => std::option::Option::Some(47),
6279                Self::Nat => std::option::Option::Some(14),
6280                Self::SkipGkePodIpMasquerading => std::option::Option::Some(40),
6281                Self::SkipGkeIngressNetworkPolicy => std::option::Option::Some(41),
6282                Self::SkipGkeEgressNetworkPolicy => std::option::Option::Some(42),
6283                Self::ApplyIngressGkeNetworkPolicy => std::option::Option::Some(45),
6284                Self::ApplyEgressGkeNetworkPolicy => std::option::Option::Some(46),
6285                Self::ProxyConnection => std::option::Option::Some(15),
6286                Self::Deliver => std::option::Option::Some(16),
6287                Self::Drop => std::option::Option::Some(17),
6288                Self::Forward => std::option::Option::Some(18),
6289                Self::Abort => std::option::Option::Some(19),
6290                Self::ViewerPermissionMissing => std::option::Option::Some(20),
6291                Self::UnknownValue(u) => u.0.value(),
6292            }
6293        }
6294
6295        /// Gets the enum value as a string.
6296        ///
6297        /// Returns `None` if the enum contains an unknown value deserialized from
6298        /// the integer representation of enums.
6299        pub fn name(&self) -> std::option::Option<&str> {
6300            match self {
6301                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6302                Self::StartFromInstance => std::option::Option::Some("START_FROM_INSTANCE"),
6303                Self::StartFromInternet => std::option::Option::Some("START_FROM_INTERNET"),
6304                Self::StartFromGoogleService => {
6305                    std::option::Option::Some("START_FROM_GOOGLE_SERVICE")
6306                }
6307                Self::StartFromPrivateNetwork => {
6308                    std::option::Option::Some("START_FROM_PRIVATE_NETWORK")
6309                }
6310                Self::StartFromGkeMaster => std::option::Option::Some("START_FROM_GKE_MASTER"),
6311                Self::StartFromCloudSqlInstance => {
6312                    std::option::Option::Some("START_FROM_CLOUD_SQL_INSTANCE")
6313                }
6314                Self::StartFromGkePod => std::option::Option::Some("START_FROM_GKE_POD"),
6315                Self::StartFromRedisInstance => {
6316                    std::option::Option::Some("START_FROM_REDIS_INSTANCE")
6317                }
6318                Self::StartFromRedisCluster => {
6319                    std::option::Option::Some("START_FROM_REDIS_CLUSTER")
6320                }
6321                Self::StartFromCloudFunction => {
6322                    std::option::Option::Some("START_FROM_CLOUD_FUNCTION")
6323                }
6324                Self::StartFromAppEngineVersion => {
6325                    std::option::Option::Some("START_FROM_APP_ENGINE_VERSION")
6326                }
6327                Self::StartFromCloudRunRevision => {
6328                    std::option::Option::Some("START_FROM_CLOUD_RUN_REVISION")
6329                }
6330                Self::StartFromStorageBucket => {
6331                    std::option::Option::Some("START_FROM_STORAGE_BUCKET")
6332                }
6333                Self::StartFromPscPublishedService => {
6334                    std::option::Option::Some("START_FROM_PSC_PUBLISHED_SERVICE")
6335                }
6336                Self::StartFromServerlessNeg => {
6337                    std::option::Option::Some("START_FROM_SERVERLESS_NEG")
6338                }
6339                Self::ApplyIngressFirewallRule => {
6340                    std::option::Option::Some("APPLY_INGRESS_FIREWALL_RULE")
6341                }
6342                Self::ApplyEgressFirewallRule => {
6343                    std::option::Option::Some("APPLY_EGRESS_FIREWALL_RULE")
6344                }
6345                Self::ApplyRoute => std::option::Option::Some("APPLY_ROUTE"),
6346                Self::ApplyForwardingRule => std::option::Option::Some("APPLY_FORWARDING_RULE"),
6347                Self::AnalyzeLoadBalancerBackend => {
6348                    std::option::Option::Some("ANALYZE_LOAD_BALANCER_BACKEND")
6349                }
6350                Self::SpoofingApproved => std::option::Option::Some("SPOOFING_APPROVED"),
6351                Self::ArriveAtInstance => std::option::Option::Some("ARRIVE_AT_INSTANCE"),
6352                Self::ArriveAtInternalLoadBalancer => {
6353                    std::option::Option::Some("ARRIVE_AT_INTERNAL_LOAD_BALANCER")
6354                }
6355                Self::ArriveAtExternalLoadBalancer => {
6356                    std::option::Option::Some("ARRIVE_AT_EXTERNAL_LOAD_BALANCER")
6357                }
6358                Self::ArriveAtHybridSubnet => std::option::Option::Some("ARRIVE_AT_HYBRID_SUBNET"),
6359                Self::ArriveAtVpnGateway => std::option::Option::Some("ARRIVE_AT_VPN_GATEWAY"),
6360                Self::ArriveAtVpnTunnel => std::option::Option::Some("ARRIVE_AT_VPN_TUNNEL"),
6361                Self::ArriveAtInterconnectAttachment => {
6362                    std::option::Option::Some("ARRIVE_AT_INTERCONNECT_ATTACHMENT")
6363                }
6364                Self::ArriveAtVpcConnector => std::option::Option::Some("ARRIVE_AT_VPC_CONNECTOR"),
6365                Self::ArriveAtGkePod => std::option::Option::Some("ARRIVE_AT_GKE_POD"),
6366                Self::DirectVpcEgressConnection => {
6367                    std::option::Option::Some("DIRECT_VPC_EGRESS_CONNECTION")
6368                }
6369                Self::ServerlessExternalConnection => {
6370                    std::option::Option::Some("SERVERLESS_EXTERNAL_CONNECTION")
6371                }
6372                Self::NgfwPacketInspection => std::option::Option::Some("NGFW_PACKET_INSPECTION"),
6373                Self::Nat => std::option::Option::Some("NAT"),
6374                Self::SkipGkePodIpMasquerading => {
6375                    std::option::Option::Some("SKIP_GKE_POD_IP_MASQUERADING")
6376                }
6377                Self::SkipGkeIngressNetworkPolicy => {
6378                    std::option::Option::Some("SKIP_GKE_INGRESS_NETWORK_POLICY")
6379                }
6380                Self::SkipGkeEgressNetworkPolicy => {
6381                    std::option::Option::Some("SKIP_GKE_EGRESS_NETWORK_POLICY")
6382                }
6383                Self::ApplyIngressGkeNetworkPolicy => {
6384                    std::option::Option::Some("APPLY_INGRESS_GKE_NETWORK_POLICY")
6385                }
6386                Self::ApplyEgressGkeNetworkPolicy => {
6387                    std::option::Option::Some("APPLY_EGRESS_GKE_NETWORK_POLICY")
6388                }
6389                Self::ProxyConnection => std::option::Option::Some("PROXY_CONNECTION"),
6390                Self::Deliver => std::option::Option::Some("DELIVER"),
6391                Self::Drop => std::option::Option::Some("DROP"),
6392                Self::Forward => std::option::Option::Some("FORWARD"),
6393                Self::Abort => std::option::Option::Some("ABORT"),
6394                Self::ViewerPermissionMissing => {
6395                    std::option::Option::Some("VIEWER_PERMISSION_MISSING")
6396                }
6397                Self::UnknownValue(u) => u.0.name(),
6398            }
6399        }
6400    }
6401
6402    impl std::default::Default for State {
6403        fn default() -> Self {
6404            use std::convert::From;
6405            Self::from(0)
6406        }
6407    }
6408
6409    impl std::fmt::Display for State {
6410        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6411            wkt::internal::display_enum(f, self.name(), self.value())
6412        }
6413    }
6414
6415    impl std::convert::From<i32> for State {
6416        fn from(value: i32) -> Self {
6417            match value {
6418                0 => Self::Unspecified,
6419                1 => Self::StartFromInstance,
6420                2 => Self::StartFromInternet,
6421                3 => Self::StartFromPrivateNetwork,
6422                4 => Self::ApplyIngressFirewallRule,
6423                5 => Self::ApplyEgressFirewallRule,
6424                6 => Self::ApplyRoute,
6425                7 => Self::ApplyForwardingRule,
6426                8 => Self::SpoofingApproved,
6427                9 => Self::ArriveAtInstance,
6428                10 => Self::ArriveAtInternalLoadBalancer,
6429                11 => Self::ArriveAtExternalLoadBalancer,
6430                12 => Self::ArriveAtVpnGateway,
6431                13 => Self::ArriveAtVpnTunnel,
6432                14 => Self::Nat,
6433                15 => Self::ProxyConnection,
6434                16 => Self::Deliver,
6435                17 => Self::Drop,
6436                18 => Self::Forward,
6437                19 => Self::Abort,
6438                20 => Self::ViewerPermissionMissing,
6439                21 => Self::StartFromGkeMaster,
6440                22 => Self::StartFromCloudSqlInstance,
6441                23 => Self::StartFromCloudFunction,
6442                24 => Self::ArriveAtVpcConnector,
6443                25 => Self::StartFromAppEngineVersion,
6444                26 => Self::StartFromCloudRunRevision,
6445                27 => Self::StartFromGoogleService,
6446                28 => Self::AnalyzeLoadBalancerBackend,
6447                29 => Self::StartFromStorageBucket,
6448                30 => Self::StartFromPscPublishedService,
6449                31 => Self::StartFromServerlessNeg,
6450                32 => Self::StartFromRedisInstance,
6451                33 => Self::StartFromRedisCluster,
6452                35 => Self::DirectVpcEgressConnection,
6453                36 => Self::ServerlessExternalConnection,
6454                37 => Self::ArriveAtInterconnectAttachment,
6455                38 => Self::ArriveAtHybridSubnet,
6456                39 => Self::StartFromGkePod,
6457                40 => Self::SkipGkePodIpMasquerading,
6458                41 => Self::SkipGkeIngressNetworkPolicy,
6459                42 => Self::SkipGkeEgressNetworkPolicy,
6460                44 => Self::ArriveAtGkePod,
6461                45 => Self::ApplyIngressGkeNetworkPolicy,
6462                46 => Self::ApplyEgressGkeNetworkPolicy,
6463                47 => Self::NgfwPacketInspection,
6464                _ => Self::UnknownValue(state::UnknownValue(
6465                    wkt::internal::UnknownEnumValue::Integer(value),
6466                )),
6467            }
6468        }
6469    }
6470
6471    impl std::convert::From<&str> for State {
6472        fn from(value: &str) -> Self {
6473            use std::string::ToString;
6474            match value {
6475                "STATE_UNSPECIFIED" => Self::Unspecified,
6476                "START_FROM_INSTANCE" => Self::StartFromInstance,
6477                "START_FROM_INTERNET" => Self::StartFromInternet,
6478                "START_FROM_GOOGLE_SERVICE" => Self::StartFromGoogleService,
6479                "START_FROM_PRIVATE_NETWORK" => Self::StartFromPrivateNetwork,
6480                "START_FROM_GKE_MASTER" => Self::StartFromGkeMaster,
6481                "START_FROM_CLOUD_SQL_INSTANCE" => Self::StartFromCloudSqlInstance,
6482                "START_FROM_GKE_POD" => Self::StartFromGkePod,
6483                "START_FROM_REDIS_INSTANCE" => Self::StartFromRedisInstance,
6484                "START_FROM_REDIS_CLUSTER" => Self::StartFromRedisCluster,
6485                "START_FROM_CLOUD_FUNCTION" => Self::StartFromCloudFunction,
6486                "START_FROM_APP_ENGINE_VERSION" => Self::StartFromAppEngineVersion,
6487                "START_FROM_CLOUD_RUN_REVISION" => Self::StartFromCloudRunRevision,
6488                "START_FROM_STORAGE_BUCKET" => Self::StartFromStorageBucket,
6489                "START_FROM_PSC_PUBLISHED_SERVICE" => Self::StartFromPscPublishedService,
6490                "START_FROM_SERVERLESS_NEG" => Self::StartFromServerlessNeg,
6491                "APPLY_INGRESS_FIREWALL_RULE" => Self::ApplyIngressFirewallRule,
6492                "APPLY_EGRESS_FIREWALL_RULE" => Self::ApplyEgressFirewallRule,
6493                "APPLY_ROUTE" => Self::ApplyRoute,
6494                "APPLY_FORWARDING_RULE" => Self::ApplyForwardingRule,
6495                "ANALYZE_LOAD_BALANCER_BACKEND" => Self::AnalyzeLoadBalancerBackend,
6496                "SPOOFING_APPROVED" => Self::SpoofingApproved,
6497                "ARRIVE_AT_INSTANCE" => Self::ArriveAtInstance,
6498                "ARRIVE_AT_INTERNAL_LOAD_BALANCER" => Self::ArriveAtInternalLoadBalancer,
6499                "ARRIVE_AT_EXTERNAL_LOAD_BALANCER" => Self::ArriveAtExternalLoadBalancer,
6500                "ARRIVE_AT_HYBRID_SUBNET" => Self::ArriveAtHybridSubnet,
6501                "ARRIVE_AT_VPN_GATEWAY" => Self::ArriveAtVpnGateway,
6502                "ARRIVE_AT_VPN_TUNNEL" => Self::ArriveAtVpnTunnel,
6503                "ARRIVE_AT_INTERCONNECT_ATTACHMENT" => Self::ArriveAtInterconnectAttachment,
6504                "ARRIVE_AT_VPC_CONNECTOR" => Self::ArriveAtVpcConnector,
6505                "ARRIVE_AT_GKE_POD" => Self::ArriveAtGkePod,
6506                "DIRECT_VPC_EGRESS_CONNECTION" => Self::DirectVpcEgressConnection,
6507                "SERVERLESS_EXTERNAL_CONNECTION" => Self::ServerlessExternalConnection,
6508                "NGFW_PACKET_INSPECTION" => Self::NgfwPacketInspection,
6509                "NAT" => Self::Nat,
6510                "SKIP_GKE_POD_IP_MASQUERADING" => Self::SkipGkePodIpMasquerading,
6511                "SKIP_GKE_INGRESS_NETWORK_POLICY" => Self::SkipGkeIngressNetworkPolicy,
6512                "SKIP_GKE_EGRESS_NETWORK_POLICY" => Self::SkipGkeEgressNetworkPolicy,
6513                "APPLY_INGRESS_GKE_NETWORK_POLICY" => Self::ApplyIngressGkeNetworkPolicy,
6514                "APPLY_EGRESS_GKE_NETWORK_POLICY" => Self::ApplyEgressGkeNetworkPolicy,
6515                "PROXY_CONNECTION" => Self::ProxyConnection,
6516                "DELIVER" => Self::Deliver,
6517                "DROP" => Self::Drop,
6518                "FORWARD" => Self::Forward,
6519                "ABORT" => Self::Abort,
6520                "VIEWER_PERMISSION_MISSING" => Self::ViewerPermissionMissing,
6521                _ => Self::UnknownValue(state::UnknownValue(
6522                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6523                )),
6524            }
6525        }
6526    }
6527
6528    impl serde::ser::Serialize for State {
6529        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6530        where
6531            S: serde::Serializer,
6532        {
6533            match self {
6534                Self::Unspecified => serializer.serialize_i32(0),
6535                Self::StartFromInstance => serializer.serialize_i32(1),
6536                Self::StartFromInternet => serializer.serialize_i32(2),
6537                Self::StartFromGoogleService => serializer.serialize_i32(27),
6538                Self::StartFromPrivateNetwork => serializer.serialize_i32(3),
6539                Self::StartFromGkeMaster => serializer.serialize_i32(21),
6540                Self::StartFromCloudSqlInstance => serializer.serialize_i32(22),
6541                Self::StartFromGkePod => serializer.serialize_i32(39),
6542                Self::StartFromRedisInstance => serializer.serialize_i32(32),
6543                Self::StartFromRedisCluster => serializer.serialize_i32(33),
6544                Self::StartFromCloudFunction => serializer.serialize_i32(23),
6545                Self::StartFromAppEngineVersion => serializer.serialize_i32(25),
6546                Self::StartFromCloudRunRevision => serializer.serialize_i32(26),
6547                Self::StartFromStorageBucket => serializer.serialize_i32(29),
6548                Self::StartFromPscPublishedService => serializer.serialize_i32(30),
6549                Self::StartFromServerlessNeg => serializer.serialize_i32(31),
6550                Self::ApplyIngressFirewallRule => serializer.serialize_i32(4),
6551                Self::ApplyEgressFirewallRule => serializer.serialize_i32(5),
6552                Self::ApplyRoute => serializer.serialize_i32(6),
6553                Self::ApplyForwardingRule => serializer.serialize_i32(7),
6554                Self::AnalyzeLoadBalancerBackend => serializer.serialize_i32(28),
6555                Self::SpoofingApproved => serializer.serialize_i32(8),
6556                Self::ArriveAtInstance => serializer.serialize_i32(9),
6557                Self::ArriveAtInternalLoadBalancer => serializer.serialize_i32(10),
6558                Self::ArriveAtExternalLoadBalancer => serializer.serialize_i32(11),
6559                Self::ArriveAtHybridSubnet => serializer.serialize_i32(38),
6560                Self::ArriveAtVpnGateway => serializer.serialize_i32(12),
6561                Self::ArriveAtVpnTunnel => serializer.serialize_i32(13),
6562                Self::ArriveAtInterconnectAttachment => serializer.serialize_i32(37),
6563                Self::ArriveAtVpcConnector => serializer.serialize_i32(24),
6564                Self::ArriveAtGkePod => serializer.serialize_i32(44),
6565                Self::DirectVpcEgressConnection => serializer.serialize_i32(35),
6566                Self::ServerlessExternalConnection => serializer.serialize_i32(36),
6567                Self::NgfwPacketInspection => serializer.serialize_i32(47),
6568                Self::Nat => serializer.serialize_i32(14),
6569                Self::SkipGkePodIpMasquerading => serializer.serialize_i32(40),
6570                Self::SkipGkeIngressNetworkPolicy => serializer.serialize_i32(41),
6571                Self::SkipGkeEgressNetworkPolicy => serializer.serialize_i32(42),
6572                Self::ApplyIngressGkeNetworkPolicy => serializer.serialize_i32(45),
6573                Self::ApplyEgressGkeNetworkPolicy => serializer.serialize_i32(46),
6574                Self::ProxyConnection => serializer.serialize_i32(15),
6575                Self::Deliver => serializer.serialize_i32(16),
6576                Self::Drop => serializer.serialize_i32(17),
6577                Self::Forward => serializer.serialize_i32(18),
6578                Self::Abort => serializer.serialize_i32(19),
6579                Self::ViewerPermissionMissing => serializer.serialize_i32(20),
6580                Self::UnknownValue(u) => u.0.serialize(serializer),
6581            }
6582        }
6583    }
6584
6585    impl<'de> serde::de::Deserialize<'de> for State {
6586        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6587        where
6588            D: serde::Deserializer<'de>,
6589        {
6590            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6591                ".google.cloud.networkmanagement.v1.Step.State",
6592            ))
6593        }
6594    }
6595
6596    /// Configuration or metadata associated with each step.
6597    /// The configuration is filtered based on viewer's permission. If a viewer
6598    /// has no permission to view the configuration in this step, for non-final
6599    /// states a special state is populated (VIEWER_PERMISSION_MISSING), and for
6600    /// final state the configuration is cleared.
6601    #[derive(Clone, Debug, PartialEq)]
6602    #[non_exhaustive]
6603    pub enum StepInfo {
6604        /// Display information of a Compute Engine instance.
6605        Instance(std::boxed::Box<crate::model::InstanceInfo>),
6606        /// Display information of a Compute Engine firewall rule.
6607        Firewall(std::boxed::Box<crate::model::FirewallInfo>),
6608        /// Display information of a Compute Engine route.
6609        Route(std::boxed::Box<crate::model::RouteInfo>),
6610        /// Display information of the source and destination under analysis.
6611        /// The endpoint information in an intermediate state may differ with the
6612        /// initial input, as it might be modified by state like NAT,
6613        /// or Connection Proxy.
6614        Endpoint(std::boxed::Box<crate::model::EndpointInfo>),
6615        /// Display information of a Google service
6616        GoogleService(std::boxed::Box<crate::model::GoogleServiceInfo>),
6617        /// Display information of a Compute Engine forwarding rule.
6618        ForwardingRule(std::boxed::Box<crate::model::ForwardingRuleInfo>),
6619        /// Display information of a hybrid subnet.
6620        HybridSubnet(std::boxed::Box<crate::model::HybridSubnetInfo>),
6621        /// Display information of a Compute Engine VPN gateway.
6622        VpnGateway(std::boxed::Box<crate::model::VpnGatewayInfo>),
6623        /// Display information of a Compute Engine VPN tunnel.
6624        VpnTunnel(std::boxed::Box<crate::model::VpnTunnelInfo>),
6625        /// Display information of an interconnect attachment.
6626        InterconnectAttachment(std::boxed::Box<crate::model::InterconnectAttachmentInfo>),
6627        /// Display information of a VPC connector.
6628        VpcConnector(std::boxed::Box<crate::model::VpcConnectorInfo>),
6629        /// Display information of a serverless direct VPC egress connection.
6630        DirectVpcEgressConnection(std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>),
6631        /// Display information of a serverless public (external) connection.
6632        ServerlessExternalConnection(
6633            std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>,
6634        ),
6635        /// Display information of the final state "deliver" and reason.
6636        Deliver(std::boxed::Box<crate::model::DeliverInfo>),
6637        /// Display information of the final state "forward" and reason.
6638        Forward(std::boxed::Box<crate::model::ForwardInfo>),
6639        /// Display information of the final state "abort" and reason.
6640        Abort(std::boxed::Box<crate::model::AbortInfo>),
6641        /// Display information of the final state "drop" and reason.
6642        Drop(std::boxed::Box<crate::model::DropInfo>),
6643        /// Display information of the load balancers. Deprecated in favor of the
6644        /// `load_balancer_backend_info` field, not used in new tests.
6645        #[deprecated]
6646        LoadBalancer(std::boxed::Box<crate::model::LoadBalancerInfo>),
6647        /// Display information of a Google Cloud network.
6648        Network(std::boxed::Box<crate::model::NetworkInfo>),
6649        /// Display information of a Google Kubernetes Engine cluster master.
6650        GkeMaster(std::boxed::Box<crate::model::GKEMasterInfo>),
6651        /// Display information of a Google Kubernetes Engine Pod.
6652        GkePod(std::boxed::Box<crate::model::GkePodInfo>),
6653        /// Display information of the reason why GKE Pod IP masquerading was
6654        /// skipped.
6655        IpMasqueradingSkipped(std::boxed::Box<crate::model::IpMasqueradingSkippedInfo>),
6656        /// Display information of a GKE Network Policy.
6657        GkeNetworkPolicy(std::boxed::Box<crate::model::GkeNetworkPolicyInfo>),
6658        /// Display information of the reason why GKE Network Policy evaluation was
6659        /// skipped.
6660        GkeNetworkPolicySkipped(std::boxed::Box<crate::model::GkeNetworkPolicySkippedInfo>),
6661        /// Display information of a Cloud SQL instance.
6662        CloudSqlInstance(std::boxed::Box<crate::model::CloudSQLInstanceInfo>),
6663        /// Display information of a Redis Instance.
6664        RedisInstance(std::boxed::Box<crate::model::RedisInstanceInfo>),
6665        /// Display information of a Redis Cluster.
6666        RedisCluster(std::boxed::Box<crate::model::RedisClusterInfo>),
6667        /// Display information of a Cloud Function.
6668        CloudFunction(std::boxed::Box<crate::model::CloudFunctionInfo>),
6669        /// Display information of an App Engine service version.
6670        AppEngineVersion(std::boxed::Box<crate::model::AppEngineVersionInfo>),
6671        /// Display information of a Cloud Run revision.
6672        CloudRunRevision(std::boxed::Box<crate::model::CloudRunRevisionInfo>),
6673        /// Display information of a NAT.
6674        Nat(std::boxed::Box<crate::model::NatInfo>),
6675        /// Display information of a ProxyConnection.
6676        ProxyConnection(std::boxed::Box<crate::model::ProxyConnectionInfo>),
6677        /// Display information of a specific load balancer backend.
6678        LoadBalancerBackendInfo(std::boxed::Box<crate::model::LoadBalancerBackendInfo>),
6679        /// Display information of a Storage Bucket. Used only for return traces.
6680        StorageBucket(std::boxed::Box<crate::model::StorageBucketInfo>),
6681        /// Display information of a Serverless network endpoint group backend. Used
6682        /// only for return traces.
6683        ServerlessNeg(std::boxed::Box<crate::model::ServerlessNegInfo>),
6684        /// Display information of a layer 7 packet inspection by the firewall.
6685        NgfwPacketInspection(std::boxed::Box<crate::model::NgfwPacketInspectionInfo>),
6686    }
6687}
6688
6689/// For display only. Metadata associated with a Compute Engine instance.
6690#[derive(Clone, Default, PartialEq)]
6691#[non_exhaustive]
6692pub struct InstanceInfo {
6693    /// Name of a Compute Engine instance.
6694    pub display_name: std::string::String,
6695
6696    /// URI of a Compute Engine instance.
6697    pub uri: std::string::String,
6698
6699    /// Name of the network interface of a Compute Engine instance.
6700    pub interface: std::string::String,
6701
6702    /// URI of a Compute Engine network.
6703    pub network_uri: std::string::String,
6704
6705    /// Internal IP address of the network interface.
6706    pub internal_ip: std::string::String,
6707
6708    /// External IP address of the network interface.
6709    pub external_ip: std::string::String,
6710
6711    /// Network tags configured on the instance.
6712    pub network_tags: std::vec::Vec<std::string::String>,
6713
6714    /// Service account authorized for the instance.
6715    #[deprecated]
6716    pub service_account: std::string::String,
6717
6718    /// URI of the PSC network attachment the NIC is attached to (if relevant).
6719    pub psc_network_attachment_uri: std::string::String,
6720
6721    /// Indicates whether the Compute Engine instance is running.
6722    /// Deprecated: use the `status` field instead.
6723    #[deprecated]
6724    pub running: bool,
6725
6726    /// The status of the instance.
6727    pub status: crate::model::instance_info::Status,
6728
6729    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6730}
6731
6732impl InstanceInfo {
6733    /// Creates a new default instance.
6734    pub fn new() -> Self {
6735        std::default::Default::default()
6736    }
6737
6738    /// Sets the value of [display_name][crate::model::InstanceInfo::display_name].
6739    ///
6740    /// # Example
6741    /// ```ignore,no_run
6742    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6743    /// let x = InstanceInfo::new().set_display_name("example");
6744    /// ```
6745    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6746        self.display_name = v.into();
6747        self
6748    }
6749
6750    /// Sets the value of [uri][crate::model::InstanceInfo::uri].
6751    ///
6752    /// # Example
6753    /// ```ignore,no_run
6754    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6755    /// let x = InstanceInfo::new().set_uri("example");
6756    /// ```
6757    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6758        self.uri = v.into();
6759        self
6760    }
6761
6762    /// Sets the value of [interface][crate::model::InstanceInfo::interface].
6763    ///
6764    /// # Example
6765    /// ```ignore,no_run
6766    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6767    /// let x = InstanceInfo::new().set_interface("example");
6768    /// ```
6769    pub fn set_interface<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6770        self.interface = v.into();
6771        self
6772    }
6773
6774    /// Sets the value of [network_uri][crate::model::InstanceInfo::network_uri].
6775    ///
6776    /// # Example
6777    /// ```ignore,no_run
6778    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6779    /// let x = InstanceInfo::new().set_network_uri("example");
6780    /// ```
6781    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6782        self.network_uri = v.into();
6783        self
6784    }
6785
6786    /// Sets the value of [internal_ip][crate::model::InstanceInfo::internal_ip].
6787    ///
6788    /// # Example
6789    /// ```ignore,no_run
6790    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6791    /// let x = InstanceInfo::new().set_internal_ip("example");
6792    /// ```
6793    pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6794        self.internal_ip = v.into();
6795        self
6796    }
6797
6798    /// Sets the value of [external_ip][crate::model::InstanceInfo::external_ip].
6799    ///
6800    /// # Example
6801    /// ```ignore,no_run
6802    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6803    /// let x = InstanceInfo::new().set_external_ip("example");
6804    /// ```
6805    pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6806        self.external_ip = v.into();
6807        self
6808    }
6809
6810    /// Sets the value of [network_tags][crate::model::InstanceInfo::network_tags].
6811    ///
6812    /// # Example
6813    /// ```ignore,no_run
6814    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6815    /// let x = InstanceInfo::new().set_network_tags(["a", "b", "c"]);
6816    /// ```
6817    pub fn set_network_tags<T, V>(mut self, v: T) -> Self
6818    where
6819        T: std::iter::IntoIterator<Item = V>,
6820        V: std::convert::Into<std::string::String>,
6821    {
6822        use std::iter::Iterator;
6823        self.network_tags = v.into_iter().map(|i| i.into()).collect();
6824        self
6825    }
6826
6827    /// Sets the value of [service_account][crate::model::InstanceInfo::service_account].
6828    ///
6829    /// # Example
6830    /// ```ignore,no_run
6831    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6832    /// let x = InstanceInfo::new().set_service_account("example");
6833    /// ```
6834    #[deprecated]
6835    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6836        self.service_account = v.into();
6837        self
6838    }
6839
6840    /// Sets the value of [psc_network_attachment_uri][crate::model::InstanceInfo::psc_network_attachment_uri].
6841    ///
6842    /// # Example
6843    /// ```ignore,no_run
6844    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6845    /// let x = InstanceInfo::new().set_psc_network_attachment_uri("example");
6846    /// ```
6847    pub fn set_psc_network_attachment_uri<T: std::convert::Into<std::string::String>>(
6848        mut self,
6849        v: T,
6850    ) -> Self {
6851        self.psc_network_attachment_uri = v.into();
6852        self
6853    }
6854
6855    /// Sets the value of [running][crate::model::InstanceInfo::running].
6856    ///
6857    /// # Example
6858    /// ```ignore,no_run
6859    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6860    /// let x = InstanceInfo::new().set_running(true);
6861    /// ```
6862    #[deprecated]
6863    pub fn set_running<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6864        self.running = v.into();
6865        self
6866    }
6867
6868    /// Sets the value of [status][crate::model::InstanceInfo::status].
6869    ///
6870    /// # Example
6871    /// ```ignore,no_run
6872    /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6873    /// use google_cloud_networkmanagement_v1::model::instance_info::Status;
6874    /// let x0 = InstanceInfo::new().set_status(Status::Running);
6875    /// let x1 = InstanceInfo::new().set_status(Status::NotRunning);
6876    /// ```
6877    pub fn set_status<T: std::convert::Into<crate::model::instance_info::Status>>(
6878        mut self,
6879        v: T,
6880    ) -> Self {
6881        self.status = v.into();
6882        self
6883    }
6884}
6885
6886impl wkt::message::Message for InstanceInfo {
6887    fn typename() -> &'static str {
6888        "type.googleapis.com/google.cloud.networkmanagement.v1.InstanceInfo"
6889    }
6890}
6891
6892/// Defines additional types related to [InstanceInfo].
6893pub mod instance_info {
6894    #[allow(unused_imports)]
6895    use super::*;
6896
6897    /// The status of the instance. We treat all states other than "RUNNING" as
6898    /// not running.
6899    ///
6900    /// # Working with unknown values
6901    ///
6902    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6903    /// additional enum variants at any time. Adding new variants is not considered
6904    /// a breaking change. Applications should write their code in anticipation of:
6905    ///
6906    /// - New values appearing in future releases of the client library, **and**
6907    /// - New values received dynamically, without application changes.
6908    ///
6909    /// Please consult the [Working with enums] section in the user guide for some
6910    /// guidelines.
6911    ///
6912    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6913    #[derive(Clone, Debug, PartialEq)]
6914    #[non_exhaustive]
6915    pub enum Status {
6916        /// Default unspecified value.
6917        Unspecified,
6918        /// The instance is running.
6919        Running,
6920        /// The instance has any status other than "RUNNING".
6921        NotRunning,
6922        /// If set, the enum was initialized with an unknown value.
6923        ///
6924        /// Applications can examine the value using [Status::value] or
6925        /// [Status::name].
6926        UnknownValue(status::UnknownValue),
6927    }
6928
6929    #[doc(hidden)]
6930    pub mod status {
6931        #[allow(unused_imports)]
6932        use super::*;
6933        #[derive(Clone, Debug, PartialEq)]
6934        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6935    }
6936
6937    impl Status {
6938        /// Gets the enum value.
6939        ///
6940        /// Returns `None` if the enum contains an unknown value deserialized from
6941        /// the string representation of enums.
6942        pub fn value(&self) -> std::option::Option<i32> {
6943            match self {
6944                Self::Unspecified => std::option::Option::Some(0),
6945                Self::Running => std::option::Option::Some(1),
6946                Self::NotRunning => std::option::Option::Some(2),
6947                Self::UnknownValue(u) => u.0.value(),
6948            }
6949        }
6950
6951        /// Gets the enum value as a string.
6952        ///
6953        /// Returns `None` if the enum contains an unknown value deserialized from
6954        /// the integer representation of enums.
6955        pub fn name(&self) -> std::option::Option<&str> {
6956            match self {
6957                Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
6958                Self::Running => std::option::Option::Some("RUNNING"),
6959                Self::NotRunning => std::option::Option::Some("NOT_RUNNING"),
6960                Self::UnknownValue(u) => u.0.name(),
6961            }
6962        }
6963    }
6964
6965    impl std::default::Default for Status {
6966        fn default() -> Self {
6967            use std::convert::From;
6968            Self::from(0)
6969        }
6970    }
6971
6972    impl std::fmt::Display for Status {
6973        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6974            wkt::internal::display_enum(f, self.name(), self.value())
6975        }
6976    }
6977
6978    impl std::convert::From<i32> for Status {
6979        fn from(value: i32) -> Self {
6980            match value {
6981                0 => Self::Unspecified,
6982                1 => Self::Running,
6983                2 => Self::NotRunning,
6984                _ => Self::UnknownValue(status::UnknownValue(
6985                    wkt::internal::UnknownEnumValue::Integer(value),
6986                )),
6987            }
6988        }
6989    }
6990
6991    impl std::convert::From<&str> for Status {
6992        fn from(value: &str) -> Self {
6993            use std::string::ToString;
6994            match value {
6995                "STATUS_UNSPECIFIED" => Self::Unspecified,
6996                "RUNNING" => Self::Running,
6997                "NOT_RUNNING" => Self::NotRunning,
6998                _ => Self::UnknownValue(status::UnknownValue(
6999                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7000                )),
7001            }
7002        }
7003    }
7004
7005    impl serde::ser::Serialize for Status {
7006        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7007        where
7008            S: serde::Serializer,
7009        {
7010            match self {
7011                Self::Unspecified => serializer.serialize_i32(0),
7012                Self::Running => serializer.serialize_i32(1),
7013                Self::NotRunning => serializer.serialize_i32(2),
7014                Self::UnknownValue(u) => u.0.serialize(serializer),
7015            }
7016        }
7017    }
7018
7019    impl<'de> serde::de::Deserialize<'de> for Status {
7020        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7021        where
7022            D: serde::Deserializer<'de>,
7023        {
7024            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
7025                ".google.cloud.networkmanagement.v1.InstanceInfo.Status",
7026            ))
7027        }
7028    }
7029}
7030
7031/// For display only. Metadata associated with a Compute Engine network.
7032#[derive(Clone, Default, PartialEq)]
7033#[non_exhaustive]
7034pub struct NetworkInfo {
7035    /// Name of a Compute Engine network.
7036    pub display_name: std::string::String,
7037
7038    /// URI of a Compute Engine network.
7039    pub uri: std::string::String,
7040
7041    /// URI of the subnet matching the source IP address of the test.
7042    pub matched_subnet_uri: std::string::String,
7043
7044    /// The IP range of the subnet matching the source IP address of the test.
7045    pub matched_ip_range: std::string::String,
7046
7047    /// The region of the subnet matching the source IP address of the test.
7048    pub region: std::string::String,
7049
7050    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7051}
7052
7053impl NetworkInfo {
7054    /// Creates a new default instance.
7055    pub fn new() -> Self {
7056        std::default::Default::default()
7057    }
7058
7059    /// Sets the value of [display_name][crate::model::NetworkInfo::display_name].
7060    ///
7061    /// # Example
7062    /// ```ignore,no_run
7063    /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7064    /// let x = NetworkInfo::new().set_display_name("example");
7065    /// ```
7066    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7067        self.display_name = v.into();
7068        self
7069    }
7070
7071    /// Sets the value of [uri][crate::model::NetworkInfo::uri].
7072    ///
7073    /// # Example
7074    /// ```ignore,no_run
7075    /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7076    /// let x = NetworkInfo::new().set_uri("example");
7077    /// ```
7078    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7079        self.uri = v.into();
7080        self
7081    }
7082
7083    /// Sets the value of [matched_subnet_uri][crate::model::NetworkInfo::matched_subnet_uri].
7084    ///
7085    /// # Example
7086    /// ```ignore,no_run
7087    /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7088    /// let x = NetworkInfo::new().set_matched_subnet_uri("example");
7089    /// ```
7090    pub fn set_matched_subnet_uri<T: std::convert::Into<std::string::String>>(
7091        mut self,
7092        v: T,
7093    ) -> Self {
7094        self.matched_subnet_uri = v.into();
7095        self
7096    }
7097
7098    /// Sets the value of [matched_ip_range][crate::model::NetworkInfo::matched_ip_range].
7099    ///
7100    /// # Example
7101    /// ```ignore,no_run
7102    /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7103    /// let x = NetworkInfo::new().set_matched_ip_range("example");
7104    /// ```
7105    pub fn set_matched_ip_range<T: std::convert::Into<std::string::String>>(
7106        mut self,
7107        v: T,
7108    ) -> Self {
7109        self.matched_ip_range = v.into();
7110        self
7111    }
7112
7113    /// Sets the value of [region][crate::model::NetworkInfo::region].
7114    ///
7115    /// # Example
7116    /// ```ignore,no_run
7117    /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7118    /// let x = NetworkInfo::new().set_region("example");
7119    /// ```
7120    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7121        self.region = v.into();
7122        self
7123    }
7124}
7125
7126impl wkt::message::Message for NetworkInfo {
7127    fn typename() -> &'static str {
7128        "type.googleapis.com/google.cloud.networkmanagement.v1.NetworkInfo"
7129    }
7130}
7131
7132/// For display only. Metadata associated with a VPC firewall rule, an implied
7133/// VPC firewall rule, or a firewall policy rule.
7134#[derive(Clone, Default, PartialEq)]
7135#[non_exhaustive]
7136pub struct FirewallInfo {
7137    /// The display name of the firewall rule. This field might be empty for
7138    /// firewall policy rules.
7139    pub display_name: std::string::String,
7140
7141    /// The URI of the firewall rule. This field is not applicable to implied
7142    /// VPC firewall rules.
7143    pub uri: std::string::String,
7144
7145    /// Possible values: INGRESS, EGRESS
7146    pub direction: std::string::String,
7147
7148    /// Possible values: ALLOW, DENY, APPLY_SECURITY_PROFILE_GROUP
7149    pub action: std::string::String,
7150
7151    /// The priority of the firewall rule.
7152    pub priority: i32,
7153
7154    /// The URI of the VPC network that the firewall rule is associated with.
7155    /// This field is not applicable to hierarchical firewall policy rules.
7156    pub network_uri: std::string::String,
7157
7158    /// The target tags defined by the VPC firewall rule. This field is not
7159    /// applicable to firewall policy rules.
7160    pub target_tags: std::vec::Vec<std::string::String>,
7161
7162    /// The target service accounts specified by the firewall rule.
7163    pub target_service_accounts: std::vec::Vec<std::string::String>,
7164
7165    /// The name of the firewall policy that this rule is associated with.
7166    /// This field is not applicable to VPC firewall rules and implied VPC firewall
7167    /// rules.
7168    pub policy: std::string::String,
7169
7170    /// The URI of the firewall policy that this rule is associated with.
7171    /// This field is not applicable to VPC firewall rules and implied VPC firewall
7172    /// rules.
7173    pub policy_uri: std::string::String,
7174
7175    /// The firewall rule's type.
7176    pub firewall_rule_type: crate::model::firewall_info::FirewallRuleType,
7177
7178    /// The priority of the firewall policy that this rule is associated with.
7179    /// This field is not applicable to VPC firewall rules and implied VPC firewall
7180    /// rules.
7181    pub policy_priority: i32,
7182
7183    /// Target type of the firewall rule.
7184    pub target_type: crate::model::firewall_info::TargetType,
7185
7186    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7187}
7188
7189impl FirewallInfo {
7190    /// Creates a new default instance.
7191    pub fn new() -> Self {
7192        std::default::Default::default()
7193    }
7194
7195    /// Sets the value of [display_name][crate::model::FirewallInfo::display_name].
7196    ///
7197    /// # Example
7198    /// ```ignore,no_run
7199    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7200    /// let x = FirewallInfo::new().set_display_name("example");
7201    /// ```
7202    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7203        self.display_name = v.into();
7204        self
7205    }
7206
7207    /// Sets the value of [uri][crate::model::FirewallInfo::uri].
7208    ///
7209    /// # Example
7210    /// ```ignore,no_run
7211    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7212    /// let x = FirewallInfo::new().set_uri("example");
7213    /// ```
7214    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7215        self.uri = v.into();
7216        self
7217    }
7218
7219    /// Sets the value of [direction][crate::model::FirewallInfo::direction].
7220    ///
7221    /// # Example
7222    /// ```ignore,no_run
7223    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7224    /// let x = FirewallInfo::new().set_direction("example");
7225    /// ```
7226    pub fn set_direction<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7227        self.direction = v.into();
7228        self
7229    }
7230
7231    /// Sets the value of [action][crate::model::FirewallInfo::action].
7232    ///
7233    /// # Example
7234    /// ```ignore,no_run
7235    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7236    /// let x = FirewallInfo::new().set_action("example");
7237    /// ```
7238    pub fn set_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7239        self.action = v.into();
7240        self
7241    }
7242
7243    /// Sets the value of [priority][crate::model::FirewallInfo::priority].
7244    ///
7245    /// # Example
7246    /// ```ignore,no_run
7247    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7248    /// let x = FirewallInfo::new().set_priority(42);
7249    /// ```
7250    pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7251        self.priority = v.into();
7252        self
7253    }
7254
7255    /// Sets the value of [network_uri][crate::model::FirewallInfo::network_uri].
7256    ///
7257    /// # Example
7258    /// ```ignore,no_run
7259    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7260    /// let x = FirewallInfo::new().set_network_uri("example");
7261    /// ```
7262    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7263        self.network_uri = v.into();
7264        self
7265    }
7266
7267    /// Sets the value of [target_tags][crate::model::FirewallInfo::target_tags].
7268    ///
7269    /// # Example
7270    /// ```ignore,no_run
7271    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7272    /// let x = FirewallInfo::new().set_target_tags(["a", "b", "c"]);
7273    /// ```
7274    pub fn set_target_tags<T, V>(mut self, v: T) -> Self
7275    where
7276        T: std::iter::IntoIterator<Item = V>,
7277        V: std::convert::Into<std::string::String>,
7278    {
7279        use std::iter::Iterator;
7280        self.target_tags = v.into_iter().map(|i| i.into()).collect();
7281        self
7282    }
7283
7284    /// Sets the value of [target_service_accounts][crate::model::FirewallInfo::target_service_accounts].
7285    ///
7286    /// # Example
7287    /// ```ignore,no_run
7288    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7289    /// let x = FirewallInfo::new().set_target_service_accounts(["a", "b", "c"]);
7290    /// ```
7291    pub fn set_target_service_accounts<T, V>(mut self, v: T) -> Self
7292    where
7293        T: std::iter::IntoIterator<Item = V>,
7294        V: std::convert::Into<std::string::String>,
7295    {
7296        use std::iter::Iterator;
7297        self.target_service_accounts = v.into_iter().map(|i| i.into()).collect();
7298        self
7299    }
7300
7301    /// Sets the value of [policy][crate::model::FirewallInfo::policy].
7302    ///
7303    /// # Example
7304    /// ```ignore,no_run
7305    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7306    /// let x = FirewallInfo::new().set_policy("example");
7307    /// ```
7308    pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7309        self.policy = v.into();
7310        self
7311    }
7312
7313    /// Sets the value of [policy_uri][crate::model::FirewallInfo::policy_uri].
7314    ///
7315    /// # Example
7316    /// ```ignore,no_run
7317    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7318    /// let x = FirewallInfo::new().set_policy_uri("example");
7319    /// ```
7320    pub fn set_policy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7321        self.policy_uri = v.into();
7322        self
7323    }
7324
7325    /// Sets the value of [firewall_rule_type][crate::model::FirewallInfo::firewall_rule_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::FirewallRuleType;
7331    /// let x0 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::HierarchicalFirewallPolicyRule);
7332    /// let x1 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::VpcFirewallRule);
7333    /// let x2 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::ImpliedVpcFirewallRule);
7334    /// ```
7335    pub fn set_firewall_rule_type<
7336        T: std::convert::Into<crate::model::firewall_info::FirewallRuleType>,
7337    >(
7338        mut self,
7339        v: T,
7340    ) -> Self {
7341        self.firewall_rule_type = v.into();
7342        self
7343    }
7344
7345    /// Sets the value of [policy_priority][crate::model::FirewallInfo::policy_priority].
7346    ///
7347    /// # Example
7348    /// ```ignore,no_run
7349    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7350    /// let x = FirewallInfo::new().set_policy_priority(42);
7351    /// ```
7352    pub fn set_policy_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7353        self.policy_priority = v.into();
7354        self
7355    }
7356
7357    /// Sets the value of [target_type][crate::model::FirewallInfo::target_type].
7358    ///
7359    /// # Example
7360    /// ```ignore,no_run
7361    /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7362    /// use google_cloud_networkmanagement_v1::model::firewall_info::TargetType;
7363    /// let x0 = FirewallInfo::new().set_target_type(TargetType::Instances);
7364    /// let x1 = FirewallInfo::new().set_target_type(TargetType::InternalManagedLb);
7365    /// ```
7366    pub fn set_target_type<T: std::convert::Into<crate::model::firewall_info::TargetType>>(
7367        mut self,
7368        v: T,
7369    ) -> Self {
7370        self.target_type = v.into();
7371        self
7372    }
7373}
7374
7375impl wkt::message::Message for FirewallInfo {
7376    fn typename() -> &'static str {
7377        "type.googleapis.com/google.cloud.networkmanagement.v1.FirewallInfo"
7378    }
7379}
7380
7381/// Defines additional types related to [FirewallInfo].
7382pub mod firewall_info {
7383    #[allow(unused_imports)]
7384    use super::*;
7385
7386    /// The firewall rule's type.
7387    ///
7388    /// # Working with unknown values
7389    ///
7390    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7391    /// additional enum variants at any time. Adding new variants is not considered
7392    /// a breaking change. Applications should write their code in anticipation of:
7393    ///
7394    /// - New values appearing in future releases of the client library, **and**
7395    /// - New values received dynamically, without application changes.
7396    ///
7397    /// Please consult the [Working with enums] section in the user guide for some
7398    /// guidelines.
7399    ///
7400    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7401    #[derive(Clone, Debug, PartialEq)]
7402    #[non_exhaustive]
7403    pub enum FirewallRuleType {
7404        /// Unspecified type.
7405        Unspecified,
7406        /// Hierarchical firewall policy rule. For details, see
7407        /// [Hierarchical firewall policies
7408        /// overview](https://cloud.google.com/vpc/docs/firewall-policies).
7409        HierarchicalFirewallPolicyRule,
7410        /// VPC firewall rule. For details, see
7411        /// [VPC firewall rules
7412        /// overview](https://cloud.google.com/vpc/docs/firewalls).
7413        VpcFirewallRule,
7414        /// Implied VPC firewall rule. For details, see
7415        /// [Implied
7416        /// rules](https://cloud.google.com/vpc/docs/firewalls#default_firewall_rules).
7417        ImpliedVpcFirewallRule,
7418        /// Implicit firewall rules that are managed by serverless VPC access to
7419        /// allow ingress access. They are not visible in the Google Cloud console.
7420        /// For details, see [VPC connector's implicit
7421        /// rules](https://cloud.google.com/functions/docs/networking/connecting-vpc#restrict-access).
7422        ServerlessVpcAccessManagedFirewallRule,
7423        /// User-defined global network firewall policy rule.
7424        /// For details, see [Network firewall
7425        /// policies](https://cloud.google.com/vpc/docs/network-firewall-policies).
7426        NetworkFirewallPolicyRule,
7427        /// User-defined regional network firewall policy rule.
7428        /// For details, see [Regional network firewall
7429        /// policies](https://cloud.google.com/firewall/docs/regional-firewall-policies).
7430        NetworkRegionalFirewallPolicyRule,
7431        /// System-defined global network firewall policy rule.
7432        SystemNetworkFirewallPolicyRule,
7433        /// System-defined regional network firewall policy rule.
7434        SystemRegionalNetworkFirewallPolicyRule,
7435        /// Firewall policy rule containing attributes not yet supported in
7436        /// Connectivity tests. Firewall analysis is skipped if such a rule can
7437        /// potentially be matched. Please see the [list of unsupported
7438        /// configurations](https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/concepts/overview#unsupported-configs).
7439        UnsupportedFirewallPolicyRule,
7440        /// Tracking state for response traffic created when request traffic goes
7441        /// through allow firewall rule.
7442        /// For details, see [firewall rules
7443        /// specifications](https://cloud.google.com/firewall/docs/firewalls#specifications)
7444        TrackingState,
7445        /// Firewall analysis was skipped due to executing Connectivity Test in the
7446        /// BypassFirewallChecks mode
7447        AnalysisSkipped,
7448        /// If set, the enum was initialized with an unknown value.
7449        ///
7450        /// Applications can examine the value using [FirewallRuleType::value] or
7451        /// [FirewallRuleType::name].
7452        UnknownValue(firewall_rule_type::UnknownValue),
7453    }
7454
7455    #[doc(hidden)]
7456    pub mod firewall_rule_type {
7457        #[allow(unused_imports)]
7458        use super::*;
7459        #[derive(Clone, Debug, PartialEq)]
7460        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7461    }
7462
7463    impl FirewallRuleType {
7464        /// Gets the enum value.
7465        ///
7466        /// Returns `None` if the enum contains an unknown value deserialized from
7467        /// the string representation of enums.
7468        pub fn value(&self) -> std::option::Option<i32> {
7469            match self {
7470                Self::Unspecified => std::option::Option::Some(0),
7471                Self::HierarchicalFirewallPolicyRule => std::option::Option::Some(1),
7472                Self::VpcFirewallRule => std::option::Option::Some(2),
7473                Self::ImpliedVpcFirewallRule => std::option::Option::Some(3),
7474                Self::ServerlessVpcAccessManagedFirewallRule => std::option::Option::Some(4),
7475                Self::NetworkFirewallPolicyRule => std::option::Option::Some(5),
7476                Self::NetworkRegionalFirewallPolicyRule => std::option::Option::Some(6),
7477                Self::SystemNetworkFirewallPolicyRule => std::option::Option::Some(7),
7478                Self::SystemRegionalNetworkFirewallPolicyRule => std::option::Option::Some(8),
7479                Self::UnsupportedFirewallPolicyRule => std::option::Option::Some(100),
7480                Self::TrackingState => std::option::Option::Some(101),
7481                Self::AnalysisSkipped => std::option::Option::Some(102),
7482                Self::UnknownValue(u) => u.0.value(),
7483            }
7484        }
7485
7486        /// Gets the enum value as a string.
7487        ///
7488        /// Returns `None` if the enum contains an unknown value deserialized from
7489        /// the integer representation of enums.
7490        pub fn name(&self) -> std::option::Option<&str> {
7491            match self {
7492                Self::Unspecified => std::option::Option::Some("FIREWALL_RULE_TYPE_UNSPECIFIED"),
7493                Self::HierarchicalFirewallPolicyRule => {
7494                    std::option::Option::Some("HIERARCHICAL_FIREWALL_POLICY_RULE")
7495                }
7496                Self::VpcFirewallRule => std::option::Option::Some("VPC_FIREWALL_RULE"),
7497                Self::ImpliedVpcFirewallRule => {
7498                    std::option::Option::Some("IMPLIED_VPC_FIREWALL_RULE")
7499                }
7500                Self::ServerlessVpcAccessManagedFirewallRule => {
7501                    std::option::Option::Some("SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE")
7502                }
7503                Self::NetworkFirewallPolicyRule => {
7504                    std::option::Option::Some("NETWORK_FIREWALL_POLICY_RULE")
7505                }
7506                Self::NetworkRegionalFirewallPolicyRule => {
7507                    std::option::Option::Some("NETWORK_REGIONAL_FIREWALL_POLICY_RULE")
7508                }
7509                Self::SystemNetworkFirewallPolicyRule => {
7510                    std::option::Option::Some("SYSTEM_NETWORK_FIREWALL_POLICY_RULE")
7511                }
7512                Self::SystemRegionalNetworkFirewallPolicyRule => {
7513                    std::option::Option::Some("SYSTEM_REGIONAL_NETWORK_FIREWALL_POLICY_RULE")
7514                }
7515                Self::UnsupportedFirewallPolicyRule => {
7516                    std::option::Option::Some("UNSUPPORTED_FIREWALL_POLICY_RULE")
7517                }
7518                Self::TrackingState => std::option::Option::Some("TRACKING_STATE"),
7519                Self::AnalysisSkipped => std::option::Option::Some("ANALYSIS_SKIPPED"),
7520                Self::UnknownValue(u) => u.0.name(),
7521            }
7522        }
7523    }
7524
7525    impl std::default::Default for FirewallRuleType {
7526        fn default() -> Self {
7527            use std::convert::From;
7528            Self::from(0)
7529        }
7530    }
7531
7532    impl std::fmt::Display for FirewallRuleType {
7533        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7534            wkt::internal::display_enum(f, self.name(), self.value())
7535        }
7536    }
7537
7538    impl std::convert::From<i32> for FirewallRuleType {
7539        fn from(value: i32) -> Self {
7540            match value {
7541                0 => Self::Unspecified,
7542                1 => Self::HierarchicalFirewallPolicyRule,
7543                2 => Self::VpcFirewallRule,
7544                3 => Self::ImpliedVpcFirewallRule,
7545                4 => Self::ServerlessVpcAccessManagedFirewallRule,
7546                5 => Self::NetworkFirewallPolicyRule,
7547                6 => Self::NetworkRegionalFirewallPolicyRule,
7548                7 => Self::SystemNetworkFirewallPolicyRule,
7549                8 => Self::SystemRegionalNetworkFirewallPolicyRule,
7550                100 => Self::UnsupportedFirewallPolicyRule,
7551                101 => Self::TrackingState,
7552                102 => Self::AnalysisSkipped,
7553                _ => Self::UnknownValue(firewall_rule_type::UnknownValue(
7554                    wkt::internal::UnknownEnumValue::Integer(value),
7555                )),
7556            }
7557        }
7558    }
7559
7560    impl std::convert::From<&str> for FirewallRuleType {
7561        fn from(value: &str) -> Self {
7562            use std::string::ToString;
7563            match value {
7564                "FIREWALL_RULE_TYPE_UNSPECIFIED" => Self::Unspecified,
7565                "HIERARCHICAL_FIREWALL_POLICY_RULE" => Self::HierarchicalFirewallPolicyRule,
7566                "VPC_FIREWALL_RULE" => Self::VpcFirewallRule,
7567                "IMPLIED_VPC_FIREWALL_RULE" => Self::ImpliedVpcFirewallRule,
7568                "SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE" => {
7569                    Self::ServerlessVpcAccessManagedFirewallRule
7570                }
7571                "NETWORK_FIREWALL_POLICY_RULE" => Self::NetworkFirewallPolicyRule,
7572                "NETWORK_REGIONAL_FIREWALL_POLICY_RULE" => Self::NetworkRegionalFirewallPolicyRule,
7573                "SYSTEM_NETWORK_FIREWALL_POLICY_RULE" => Self::SystemNetworkFirewallPolicyRule,
7574                "SYSTEM_REGIONAL_NETWORK_FIREWALL_POLICY_RULE" => {
7575                    Self::SystemRegionalNetworkFirewallPolicyRule
7576                }
7577                "UNSUPPORTED_FIREWALL_POLICY_RULE" => Self::UnsupportedFirewallPolicyRule,
7578                "TRACKING_STATE" => Self::TrackingState,
7579                "ANALYSIS_SKIPPED" => Self::AnalysisSkipped,
7580                _ => Self::UnknownValue(firewall_rule_type::UnknownValue(
7581                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7582                )),
7583            }
7584        }
7585    }
7586
7587    impl serde::ser::Serialize for FirewallRuleType {
7588        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7589        where
7590            S: serde::Serializer,
7591        {
7592            match self {
7593                Self::Unspecified => serializer.serialize_i32(0),
7594                Self::HierarchicalFirewallPolicyRule => serializer.serialize_i32(1),
7595                Self::VpcFirewallRule => serializer.serialize_i32(2),
7596                Self::ImpliedVpcFirewallRule => serializer.serialize_i32(3),
7597                Self::ServerlessVpcAccessManagedFirewallRule => serializer.serialize_i32(4),
7598                Self::NetworkFirewallPolicyRule => serializer.serialize_i32(5),
7599                Self::NetworkRegionalFirewallPolicyRule => serializer.serialize_i32(6),
7600                Self::SystemNetworkFirewallPolicyRule => serializer.serialize_i32(7),
7601                Self::SystemRegionalNetworkFirewallPolicyRule => serializer.serialize_i32(8),
7602                Self::UnsupportedFirewallPolicyRule => serializer.serialize_i32(100),
7603                Self::TrackingState => serializer.serialize_i32(101),
7604                Self::AnalysisSkipped => serializer.serialize_i32(102),
7605                Self::UnknownValue(u) => u.0.serialize(serializer),
7606            }
7607        }
7608    }
7609
7610    impl<'de> serde::de::Deserialize<'de> for FirewallRuleType {
7611        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7612        where
7613            D: serde::Deserializer<'de>,
7614        {
7615            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FirewallRuleType>::new(
7616                ".google.cloud.networkmanagement.v1.FirewallInfo.FirewallRuleType",
7617            ))
7618        }
7619    }
7620
7621    /// Target type of the firewall rule.
7622    ///
7623    /// # Working with unknown values
7624    ///
7625    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7626    /// additional enum variants at any time. Adding new variants is not considered
7627    /// a breaking change. Applications should write their code in anticipation of:
7628    ///
7629    /// - New values appearing in future releases of the client library, **and**
7630    /// - New values received dynamically, without application changes.
7631    ///
7632    /// Please consult the [Working with enums] section in the user guide for some
7633    /// guidelines.
7634    ///
7635    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7636    #[derive(Clone, Debug, PartialEq)]
7637    #[non_exhaustive]
7638    pub enum TargetType {
7639        /// Target type is not specified. In this case we treat the rule as applying
7640        /// to INSTANCES target type.
7641        Unspecified,
7642        /// Firewall rule applies to instances.
7643        Instances,
7644        /// Firewall rule applies to internal managed load balancers.
7645        InternalManagedLb,
7646        /// If set, the enum was initialized with an unknown value.
7647        ///
7648        /// Applications can examine the value using [TargetType::value] or
7649        /// [TargetType::name].
7650        UnknownValue(target_type::UnknownValue),
7651    }
7652
7653    #[doc(hidden)]
7654    pub mod target_type {
7655        #[allow(unused_imports)]
7656        use super::*;
7657        #[derive(Clone, Debug, PartialEq)]
7658        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7659    }
7660
7661    impl TargetType {
7662        /// Gets the enum value.
7663        ///
7664        /// Returns `None` if the enum contains an unknown value deserialized from
7665        /// the string representation of enums.
7666        pub fn value(&self) -> std::option::Option<i32> {
7667            match self {
7668                Self::Unspecified => std::option::Option::Some(0),
7669                Self::Instances => std::option::Option::Some(1),
7670                Self::InternalManagedLb => std::option::Option::Some(2),
7671                Self::UnknownValue(u) => u.0.value(),
7672            }
7673        }
7674
7675        /// Gets the enum value as a string.
7676        ///
7677        /// Returns `None` if the enum contains an unknown value deserialized from
7678        /// the integer representation of enums.
7679        pub fn name(&self) -> std::option::Option<&str> {
7680            match self {
7681                Self::Unspecified => std::option::Option::Some("TARGET_TYPE_UNSPECIFIED"),
7682                Self::Instances => std::option::Option::Some("INSTANCES"),
7683                Self::InternalManagedLb => std::option::Option::Some("INTERNAL_MANAGED_LB"),
7684                Self::UnknownValue(u) => u.0.name(),
7685            }
7686        }
7687    }
7688
7689    impl std::default::Default for TargetType {
7690        fn default() -> Self {
7691            use std::convert::From;
7692            Self::from(0)
7693        }
7694    }
7695
7696    impl std::fmt::Display for TargetType {
7697        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7698            wkt::internal::display_enum(f, self.name(), self.value())
7699        }
7700    }
7701
7702    impl std::convert::From<i32> for TargetType {
7703        fn from(value: i32) -> Self {
7704            match value {
7705                0 => Self::Unspecified,
7706                1 => Self::Instances,
7707                2 => Self::InternalManagedLb,
7708                _ => Self::UnknownValue(target_type::UnknownValue(
7709                    wkt::internal::UnknownEnumValue::Integer(value),
7710                )),
7711            }
7712        }
7713    }
7714
7715    impl std::convert::From<&str> for TargetType {
7716        fn from(value: &str) -> Self {
7717            use std::string::ToString;
7718            match value {
7719                "TARGET_TYPE_UNSPECIFIED" => Self::Unspecified,
7720                "INSTANCES" => Self::Instances,
7721                "INTERNAL_MANAGED_LB" => Self::InternalManagedLb,
7722                _ => Self::UnknownValue(target_type::UnknownValue(
7723                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7724                )),
7725            }
7726        }
7727    }
7728
7729    impl serde::ser::Serialize for TargetType {
7730        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7731        where
7732            S: serde::Serializer,
7733        {
7734            match self {
7735                Self::Unspecified => serializer.serialize_i32(0),
7736                Self::Instances => serializer.serialize_i32(1),
7737                Self::InternalManagedLb => serializer.serialize_i32(2),
7738                Self::UnknownValue(u) => u.0.serialize(serializer),
7739            }
7740        }
7741    }
7742
7743    impl<'de> serde::de::Deserialize<'de> for TargetType {
7744        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7745        where
7746            D: serde::Deserializer<'de>,
7747        {
7748            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetType>::new(
7749                ".google.cloud.networkmanagement.v1.FirewallInfo.TargetType",
7750            ))
7751        }
7752    }
7753}
7754
7755/// For display only. Metadata associated with a Compute Engine route.
7756#[derive(Clone, Default, PartialEq)]
7757#[non_exhaustive]
7758pub struct RouteInfo {
7759    /// Type of route.
7760    pub route_type: crate::model::route_info::RouteType,
7761
7762    /// Type of next hop.
7763    pub next_hop_type: crate::model::route_info::NextHopType,
7764
7765    /// Indicates where route is applicable. Deprecated, routes with NCC_HUB scope
7766    /// are not included in the trace in new tests.
7767    #[deprecated]
7768    pub route_scope: crate::model::route_info::RouteScope,
7769
7770    /// Name of a route.
7771    pub display_name: std::string::String,
7772
7773    /// URI of a route. SUBNET, STATIC, PEERING_SUBNET (only for peering network)
7774    /// and POLICY_BASED routes only.
7775    pub uri: std::string::String,
7776
7777    /// Region of the route. DYNAMIC, PEERING_DYNAMIC, POLICY_BASED and ADVERTISED
7778    /// routes only. If set for POLICY_BASED route, this is a region of VLAN
7779    /// attachments for Cloud Interconnect the route applies to. If set to "all"
7780    /// for POLICY_BASED route, the route applies to VLAN attachments of Cloud
7781    /// Interconnect in all regions.
7782    pub region: std::string::String,
7783
7784    /// Destination IP range of the route.
7785    pub dest_ip_range: std::string::String,
7786
7787    /// String type of the next hop of the route (for example, "VPN tunnel").
7788    /// Deprecated in favor of the next_hop_type and next_hop_uri fields, not used
7789    /// in new tests.
7790    #[deprecated]
7791    pub next_hop: std::string::String,
7792
7793    /// URI of a VPC network where route is located.
7794    pub network_uri: std::string::String,
7795
7796    /// Priority of the route.
7797    pub priority: i32,
7798
7799    /// Instance tags of the route.
7800    pub instance_tags: std::vec::Vec<std::string::String>,
7801
7802    /// Source IP address range of the route. POLICY_BASED routes only.
7803    pub src_ip_range: std::string::String,
7804
7805    /// Destination port ranges of the route. POLICY_BASED routes only.
7806    pub dest_port_ranges: std::vec::Vec<std::string::String>,
7807
7808    /// Source port ranges of the route. POLICY_BASED routes only.
7809    pub src_port_ranges: std::vec::Vec<std::string::String>,
7810
7811    /// Protocols of the route. POLICY_BASED routes only.
7812    pub protocols: std::vec::Vec<std::string::String>,
7813
7814    /// URI of the NCC Hub the route is advertised by. PEERING_SUBNET and
7815    /// PEERING_DYNAMIC routes that are advertised by NCC Hub only.
7816    pub ncc_hub_uri: std::option::Option<std::string::String>,
7817
7818    /// URI of the destination NCC Spoke. PEERING_SUBNET and PEERING_DYNAMIC routes
7819    /// that are advertised by NCC Hub only.
7820    pub ncc_spoke_uri: std::option::Option<std::string::String>,
7821
7822    /// For ADVERTISED dynamic routes, the URI of the Cloud Router that advertised
7823    /// the corresponding IP prefix.
7824    pub advertised_route_source_router_uri: std::option::Option<std::string::String>,
7825
7826    /// For ADVERTISED routes, the URI of their next hop, i.e. the URI of the
7827    /// hybrid endpoint (VPN tunnel, Interconnect attachment, NCC router appliance)
7828    /// the advertised prefix is advertised through, or URI of the source peered
7829    /// network. Deprecated in favor of the next_hop_uri field, not used in new
7830    /// tests.
7831    #[deprecated]
7832    pub advertised_route_next_hop_uri: std::option::Option<std::string::String>,
7833
7834    /// URI of the next hop resource.
7835    pub next_hop_uri: std::string::String,
7836
7837    /// URI of a VPC network where the next hop resource is located.
7838    pub next_hop_network_uri: std::string::String,
7839
7840    /// For PEERING_SUBNET and PEERING_STATIC routes, the URI of the originating
7841    /// SUBNET/STATIC route.
7842    pub originating_route_uri: std::string::String,
7843
7844    /// For PEERING_SUBNET, PEERING_STATIC and PEERING_DYNAMIC routes, the name of
7845    /// the originating SUBNET/STATIC/DYNAMIC route.
7846    pub originating_route_display_name: std::string::String,
7847
7848    /// For PEERING_SUBNET and PEERING_DYNAMIC routes that are advertised by NCC
7849    /// Hub, the URI of the corresponding route in NCC Hub's routing table.
7850    pub ncc_hub_route_uri: std::string::String,
7851
7852    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7853}
7854
7855impl RouteInfo {
7856    /// Creates a new default instance.
7857    pub fn new() -> Self {
7858        std::default::Default::default()
7859    }
7860
7861    /// Sets the value of [route_type][crate::model::RouteInfo::route_type].
7862    ///
7863    /// # Example
7864    /// ```ignore,no_run
7865    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7866    /// use google_cloud_networkmanagement_v1::model::route_info::RouteType;
7867    /// let x0 = RouteInfo::new().set_route_type(RouteType::Subnet);
7868    /// let x1 = RouteInfo::new().set_route_type(RouteType::Static);
7869    /// let x2 = RouteInfo::new().set_route_type(RouteType::Dynamic);
7870    /// ```
7871    pub fn set_route_type<T: std::convert::Into<crate::model::route_info::RouteType>>(
7872        mut self,
7873        v: T,
7874    ) -> Self {
7875        self.route_type = v.into();
7876        self
7877    }
7878
7879    /// Sets the value of [next_hop_type][crate::model::RouteInfo::next_hop_type].
7880    ///
7881    /// # Example
7882    /// ```ignore,no_run
7883    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7884    /// use google_cloud_networkmanagement_v1::model::route_info::NextHopType;
7885    /// let x0 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopIp);
7886    /// let x1 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopInstance);
7887    /// let x2 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopNetwork);
7888    /// ```
7889    pub fn set_next_hop_type<T: std::convert::Into<crate::model::route_info::NextHopType>>(
7890        mut self,
7891        v: T,
7892    ) -> Self {
7893        self.next_hop_type = v.into();
7894        self
7895    }
7896
7897    /// Sets the value of [route_scope][crate::model::RouteInfo::route_scope].
7898    ///
7899    /// # Example
7900    /// ```ignore,no_run
7901    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7902    /// use google_cloud_networkmanagement_v1::model::route_info::RouteScope;
7903    /// let x0 = RouteInfo::new().set_route_scope(RouteScope::Network);
7904    /// let x1 = RouteInfo::new().set_route_scope(RouteScope::NccHub);
7905    /// ```
7906    #[deprecated]
7907    pub fn set_route_scope<T: std::convert::Into<crate::model::route_info::RouteScope>>(
7908        mut self,
7909        v: T,
7910    ) -> Self {
7911        self.route_scope = v.into();
7912        self
7913    }
7914
7915    /// Sets the value of [display_name][crate::model::RouteInfo::display_name].
7916    ///
7917    /// # Example
7918    /// ```ignore,no_run
7919    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7920    /// let x = RouteInfo::new().set_display_name("example");
7921    /// ```
7922    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7923        self.display_name = v.into();
7924        self
7925    }
7926
7927    /// Sets the value of [uri][crate::model::RouteInfo::uri].
7928    ///
7929    /// # Example
7930    /// ```ignore,no_run
7931    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7932    /// let x = RouteInfo::new().set_uri("example");
7933    /// ```
7934    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7935        self.uri = v.into();
7936        self
7937    }
7938
7939    /// Sets the value of [region][crate::model::RouteInfo::region].
7940    ///
7941    /// # Example
7942    /// ```ignore,no_run
7943    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7944    /// let x = RouteInfo::new().set_region("example");
7945    /// ```
7946    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7947        self.region = v.into();
7948        self
7949    }
7950
7951    /// Sets the value of [dest_ip_range][crate::model::RouteInfo::dest_ip_range].
7952    ///
7953    /// # Example
7954    /// ```ignore,no_run
7955    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7956    /// let x = RouteInfo::new().set_dest_ip_range("example");
7957    /// ```
7958    pub fn set_dest_ip_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7959        self.dest_ip_range = v.into();
7960        self
7961    }
7962
7963    /// Sets the value of [next_hop][crate::model::RouteInfo::next_hop].
7964    ///
7965    /// # Example
7966    /// ```ignore,no_run
7967    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7968    /// let x = RouteInfo::new().set_next_hop("example");
7969    /// ```
7970    #[deprecated]
7971    pub fn set_next_hop<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7972        self.next_hop = v.into();
7973        self
7974    }
7975
7976    /// Sets the value of [network_uri][crate::model::RouteInfo::network_uri].
7977    ///
7978    /// # Example
7979    /// ```ignore,no_run
7980    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7981    /// let x = RouteInfo::new().set_network_uri("example");
7982    /// ```
7983    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7984        self.network_uri = v.into();
7985        self
7986    }
7987
7988    /// Sets the value of [priority][crate::model::RouteInfo::priority].
7989    ///
7990    /// # Example
7991    /// ```ignore,no_run
7992    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7993    /// let x = RouteInfo::new().set_priority(42);
7994    /// ```
7995    pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7996        self.priority = v.into();
7997        self
7998    }
7999
8000    /// Sets the value of [instance_tags][crate::model::RouteInfo::instance_tags].
8001    ///
8002    /// # Example
8003    /// ```ignore,no_run
8004    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8005    /// let x = RouteInfo::new().set_instance_tags(["a", "b", "c"]);
8006    /// ```
8007    pub fn set_instance_tags<T, V>(mut self, v: T) -> Self
8008    where
8009        T: std::iter::IntoIterator<Item = V>,
8010        V: std::convert::Into<std::string::String>,
8011    {
8012        use std::iter::Iterator;
8013        self.instance_tags = v.into_iter().map(|i| i.into()).collect();
8014        self
8015    }
8016
8017    /// Sets the value of [src_ip_range][crate::model::RouteInfo::src_ip_range].
8018    ///
8019    /// # Example
8020    /// ```ignore,no_run
8021    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8022    /// let x = RouteInfo::new().set_src_ip_range("example");
8023    /// ```
8024    pub fn set_src_ip_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8025        self.src_ip_range = v.into();
8026        self
8027    }
8028
8029    /// Sets the value of [dest_port_ranges][crate::model::RouteInfo::dest_port_ranges].
8030    ///
8031    /// # Example
8032    /// ```ignore,no_run
8033    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8034    /// let x = RouteInfo::new().set_dest_port_ranges(["a", "b", "c"]);
8035    /// ```
8036    pub fn set_dest_port_ranges<T, V>(mut self, v: T) -> Self
8037    where
8038        T: std::iter::IntoIterator<Item = V>,
8039        V: std::convert::Into<std::string::String>,
8040    {
8041        use std::iter::Iterator;
8042        self.dest_port_ranges = v.into_iter().map(|i| i.into()).collect();
8043        self
8044    }
8045
8046    /// Sets the value of [src_port_ranges][crate::model::RouteInfo::src_port_ranges].
8047    ///
8048    /// # Example
8049    /// ```ignore,no_run
8050    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8051    /// let x = RouteInfo::new().set_src_port_ranges(["a", "b", "c"]);
8052    /// ```
8053    pub fn set_src_port_ranges<T, V>(mut self, v: T) -> Self
8054    where
8055        T: std::iter::IntoIterator<Item = V>,
8056        V: std::convert::Into<std::string::String>,
8057    {
8058        use std::iter::Iterator;
8059        self.src_port_ranges = v.into_iter().map(|i| i.into()).collect();
8060        self
8061    }
8062
8063    /// Sets the value of [protocols][crate::model::RouteInfo::protocols].
8064    ///
8065    /// # Example
8066    /// ```ignore,no_run
8067    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8068    /// let x = RouteInfo::new().set_protocols(["a", "b", "c"]);
8069    /// ```
8070    pub fn set_protocols<T, V>(mut self, v: T) -> Self
8071    where
8072        T: std::iter::IntoIterator<Item = V>,
8073        V: std::convert::Into<std::string::String>,
8074    {
8075        use std::iter::Iterator;
8076        self.protocols = v.into_iter().map(|i| i.into()).collect();
8077        self
8078    }
8079
8080    /// Sets the value of [ncc_hub_uri][crate::model::RouteInfo::ncc_hub_uri].
8081    ///
8082    /// # Example
8083    /// ```ignore,no_run
8084    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8085    /// let x = RouteInfo::new().set_ncc_hub_uri("example");
8086    /// ```
8087    pub fn set_ncc_hub_uri<T>(mut self, v: T) -> Self
8088    where
8089        T: std::convert::Into<std::string::String>,
8090    {
8091        self.ncc_hub_uri = std::option::Option::Some(v.into());
8092        self
8093    }
8094
8095    /// Sets or clears the value of [ncc_hub_uri][crate::model::RouteInfo::ncc_hub_uri].
8096    ///
8097    /// # Example
8098    /// ```ignore,no_run
8099    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8100    /// let x = RouteInfo::new().set_or_clear_ncc_hub_uri(Some("example"));
8101    /// let x = RouteInfo::new().set_or_clear_ncc_hub_uri(None::<String>);
8102    /// ```
8103    pub fn set_or_clear_ncc_hub_uri<T>(mut self, v: std::option::Option<T>) -> Self
8104    where
8105        T: std::convert::Into<std::string::String>,
8106    {
8107        self.ncc_hub_uri = v.map(|x| x.into());
8108        self
8109    }
8110
8111    /// Sets the value of [ncc_spoke_uri][crate::model::RouteInfo::ncc_spoke_uri].
8112    ///
8113    /// # Example
8114    /// ```ignore,no_run
8115    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8116    /// let x = RouteInfo::new().set_ncc_spoke_uri("example");
8117    /// ```
8118    pub fn set_ncc_spoke_uri<T>(mut self, v: T) -> Self
8119    where
8120        T: std::convert::Into<std::string::String>,
8121    {
8122        self.ncc_spoke_uri = std::option::Option::Some(v.into());
8123        self
8124    }
8125
8126    /// Sets or clears the value of [ncc_spoke_uri][crate::model::RouteInfo::ncc_spoke_uri].
8127    ///
8128    /// # Example
8129    /// ```ignore,no_run
8130    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8131    /// let x = RouteInfo::new().set_or_clear_ncc_spoke_uri(Some("example"));
8132    /// let x = RouteInfo::new().set_or_clear_ncc_spoke_uri(None::<String>);
8133    /// ```
8134    pub fn set_or_clear_ncc_spoke_uri<T>(mut self, v: std::option::Option<T>) -> Self
8135    where
8136        T: std::convert::Into<std::string::String>,
8137    {
8138        self.ncc_spoke_uri = v.map(|x| x.into());
8139        self
8140    }
8141
8142    /// Sets the value of [advertised_route_source_router_uri][crate::model::RouteInfo::advertised_route_source_router_uri].
8143    ///
8144    /// # Example
8145    /// ```ignore,no_run
8146    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8147    /// let x = RouteInfo::new().set_advertised_route_source_router_uri("example");
8148    /// ```
8149    pub fn set_advertised_route_source_router_uri<T>(mut self, v: T) -> Self
8150    where
8151        T: std::convert::Into<std::string::String>,
8152    {
8153        self.advertised_route_source_router_uri = std::option::Option::Some(v.into());
8154        self
8155    }
8156
8157    /// Sets or clears the value of [advertised_route_source_router_uri][crate::model::RouteInfo::advertised_route_source_router_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_source_router_uri(Some("example"));
8163    /// let x = RouteInfo::new().set_or_clear_advertised_route_source_router_uri(None::<String>);
8164    /// ```
8165    pub fn set_or_clear_advertised_route_source_router_uri<T>(
8166        mut self,
8167        v: std::option::Option<T>,
8168    ) -> Self
8169    where
8170        T: std::convert::Into<std::string::String>,
8171    {
8172        self.advertised_route_source_router_uri = v.map(|x| x.into());
8173        self
8174    }
8175
8176    /// Sets the value of [advertised_route_next_hop_uri][crate::model::RouteInfo::advertised_route_next_hop_uri].
8177    ///
8178    /// # Example
8179    /// ```ignore,no_run
8180    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8181    /// let x = RouteInfo::new().set_advertised_route_next_hop_uri("example");
8182    /// ```
8183    #[deprecated]
8184    pub fn set_advertised_route_next_hop_uri<T>(mut self, v: T) -> Self
8185    where
8186        T: std::convert::Into<std::string::String>,
8187    {
8188        self.advertised_route_next_hop_uri = std::option::Option::Some(v.into());
8189        self
8190    }
8191
8192    /// Sets or clears the value of [advertised_route_next_hop_uri][crate::model::RouteInfo::advertised_route_next_hop_uri].
8193    ///
8194    /// # Example
8195    /// ```ignore,no_run
8196    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8197    /// let x = RouteInfo::new().set_or_clear_advertised_route_next_hop_uri(Some("example"));
8198    /// let x = RouteInfo::new().set_or_clear_advertised_route_next_hop_uri(None::<String>);
8199    /// ```
8200    #[deprecated]
8201    pub fn set_or_clear_advertised_route_next_hop_uri<T>(
8202        mut self,
8203        v: std::option::Option<T>,
8204    ) -> Self
8205    where
8206        T: std::convert::Into<std::string::String>,
8207    {
8208        self.advertised_route_next_hop_uri = v.map(|x| x.into());
8209        self
8210    }
8211
8212    /// Sets the value of [next_hop_uri][crate::model::RouteInfo::next_hop_uri].
8213    ///
8214    /// # Example
8215    /// ```ignore,no_run
8216    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8217    /// let x = RouteInfo::new().set_next_hop_uri("example");
8218    /// ```
8219    pub fn set_next_hop_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8220        self.next_hop_uri = v.into();
8221        self
8222    }
8223
8224    /// Sets the value of [next_hop_network_uri][crate::model::RouteInfo::next_hop_network_uri].
8225    ///
8226    /// # Example
8227    /// ```ignore,no_run
8228    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8229    /// let x = RouteInfo::new().set_next_hop_network_uri("example");
8230    /// ```
8231    pub fn set_next_hop_network_uri<T: std::convert::Into<std::string::String>>(
8232        mut self,
8233        v: T,
8234    ) -> Self {
8235        self.next_hop_network_uri = v.into();
8236        self
8237    }
8238
8239    /// Sets the value of [originating_route_uri][crate::model::RouteInfo::originating_route_uri].
8240    ///
8241    /// # Example
8242    /// ```ignore,no_run
8243    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8244    /// let x = RouteInfo::new().set_originating_route_uri("example");
8245    /// ```
8246    pub fn set_originating_route_uri<T: std::convert::Into<std::string::String>>(
8247        mut self,
8248        v: T,
8249    ) -> Self {
8250        self.originating_route_uri = v.into();
8251        self
8252    }
8253
8254    /// Sets the value of [originating_route_display_name][crate::model::RouteInfo::originating_route_display_name].
8255    ///
8256    /// # Example
8257    /// ```ignore,no_run
8258    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8259    /// let x = RouteInfo::new().set_originating_route_display_name("example");
8260    /// ```
8261    pub fn set_originating_route_display_name<T: std::convert::Into<std::string::String>>(
8262        mut self,
8263        v: T,
8264    ) -> Self {
8265        self.originating_route_display_name = v.into();
8266        self
8267    }
8268
8269    /// Sets the value of [ncc_hub_route_uri][crate::model::RouteInfo::ncc_hub_route_uri].
8270    ///
8271    /// # Example
8272    /// ```ignore,no_run
8273    /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8274    /// let x = RouteInfo::new().set_ncc_hub_route_uri("example");
8275    /// ```
8276    pub fn set_ncc_hub_route_uri<T: std::convert::Into<std::string::String>>(
8277        mut self,
8278        v: T,
8279    ) -> Self {
8280        self.ncc_hub_route_uri = v.into();
8281        self
8282    }
8283}
8284
8285impl wkt::message::Message for RouteInfo {
8286    fn typename() -> &'static str {
8287        "type.googleapis.com/google.cloud.networkmanagement.v1.RouteInfo"
8288    }
8289}
8290
8291/// Defines additional types related to [RouteInfo].
8292pub mod route_info {
8293    #[allow(unused_imports)]
8294    use super::*;
8295
8296    /// Type of route:
8297    ///
8298    /// # Working with unknown values
8299    ///
8300    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8301    /// additional enum variants at any time. Adding new variants is not considered
8302    /// a breaking change. Applications should write their code in anticipation of:
8303    ///
8304    /// - New values appearing in future releases of the client library, **and**
8305    /// - New values received dynamically, without application changes.
8306    ///
8307    /// Please consult the [Working with enums] section in the user guide for some
8308    /// guidelines.
8309    ///
8310    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8311    #[derive(Clone, Debug, PartialEq)]
8312    #[non_exhaustive]
8313    pub enum RouteType {
8314        /// Unspecified type. Default value.
8315        Unspecified,
8316        /// Route is a subnet route automatically created by the system.
8317        Subnet,
8318        /// Static route created by the user, including the default route to the
8319        /// internet.
8320        Static,
8321        /// Dynamic route exchanged between BGP peers.
8322        Dynamic,
8323        /// A subnet route received from peering network or NCC Hub.
8324        PeeringSubnet,
8325        /// A static route received from peering network.
8326        PeeringStatic,
8327        /// A dynamic route received from peering network or NCC Hub.
8328        PeeringDynamic,
8329        /// Policy based route.
8330        PolicyBased,
8331        /// Advertised route. Synthetic route which is used to transition from the
8332        /// StartFromPrivateNetwork state in Connectivity tests.
8333        Advertised,
8334        /// If set, the enum was initialized with an unknown value.
8335        ///
8336        /// Applications can examine the value using [RouteType::value] or
8337        /// [RouteType::name].
8338        UnknownValue(route_type::UnknownValue),
8339    }
8340
8341    #[doc(hidden)]
8342    pub mod route_type {
8343        #[allow(unused_imports)]
8344        use super::*;
8345        #[derive(Clone, Debug, PartialEq)]
8346        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8347    }
8348
8349    impl RouteType {
8350        /// Gets the enum value.
8351        ///
8352        /// Returns `None` if the enum contains an unknown value deserialized from
8353        /// the string representation of enums.
8354        pub fn value(&self) -> std::option::Option<i32> {
8355            match self {
8356                Self::Unspecified => std::option::Option::Some(0),
8357                Self::Subnet => std::option::Option::Some(1),
8358                Self::Static => std::option::Option::Some(2),
8359                Self::Dynamic => std::option::Option::Some(3),
8360                Self::PeeringSubnet => std::option::Option::Some(4),
8361                Self::PeeringStatic => std::option::Option::Some(5),
8362                Self::PeeringDynamic => std::option::Option::Some(6),
8363                Self::PolicyBased => std::option::Option::Some(7),
8364                Self::Advertised => std::option::Option::Some(101),
8365                Self::UnknownValue(u) => u.0.value(),
8366            }
8367        }
8368
8369        /// Gets the enum value as a string.
8370        ///
8371        /// Returns `None` if the enum contains an unknown value deserialized from
8372        /// the integer representation of enums.
8373        pub fn name(&self) -> std::option::Option<&str> {
8374            match self {
8375                Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
8376                Self::Subnet => std::option::Option::Some("SUBNET"),
8377                Self::Static => std::option::Option::Some("STATIC"),
8378                Self::Dynamic => std::option::Option::Some("DYNAMIC"),
8379                Self::PeeringSubnet => std::option::Option::Some("PEERING_SUBNET"),
8380                Self::PeeringStatic => std::option::Option::Some("PEERING_STATIC"),
8381                Self::PeeringDynamic => std::option::Option::Some("PEERING_DYNAMIC"),
8382                Self::PolicyBased => std::option::Option::Some("POLICY_BASED"),
8383                Self::Advertised => std::option::Option::Some("ADVERTISED"),
8384                Self::UnknownValue(u) => u.0.name(),
8385            }
8386        }
8387    }
8388
8389    impl std::default::Default for RouteType {
8390        fn default() -> Self {
8391            use std::convert::From;
8392            Self::from(0)
8393        }
8394    }
8395
8396    impl std::fmt::Display for RouteType {
8397        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8398            wkt::internal::display_enum(f, self.name(), self.value())
8399        }
8400    }
8401
8402    impl std::convert::From<i32> for RouteType {
8403        fn from(value: i32) -> Self {
8404            match value {
8405                0 => Self::Unspecified,
8406                1 => Self::Subnet,
8407                2 => Self::Static,
8408                3 => Self::Dynamic,
8409                4 => Self::PeeringSubnet,
8410                5 => Self::PeeringStatic,
8411                6 => Self::PeeringDynamic,
8412                7 => Self::PolicyBased,
8413                101 => Self::Advertised,
8414                _ => Self::UnknownValue(route_type::UnknownValue(
8415                    wkt::internal::UnknownEnumValue::Integer(value),
8416                )),
8417            }
8418        }
8419    }
8420
8421    impl std::convert::From<&str> for RouteType {
8422        fn from(value: &str) -> Self {
8423            use std::string::ToString;
8424            match value {
8425                "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
8426                "SUBNET" => Self::Subnet,
8427                "STATIC" => Self::Static,
8428                "DYNAMIC" => Self::Dynamic,
8429                "PEERING_SUBNET" => Self::PeeringSubnet,
8430                "PEERING_STATIC" => Self::PeeringStatic,
8431                "PEERING_DYNAMIC" => Self::PeeringDynamic,
8432                "POLICY_BASED" => Self::PolicyBased,
8433                "ADVERTISED" => Self::Advertised,
8434                _ => Self::UnknownValue(route_type::UnknownValue(
8435                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8436                )),
8437            }
8438        }
8439    }
8440
8441    impl serde::ser::Serialize for RouteType {
8442        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8443        where
8444            S: serde::Serializer,
8445        {
8446            match self {
8447                Self::Unspecified => serializer.serialize_i32(0),
8448                Self::Subnet => serializer.serialize_i32(1),
8449                Self::Static => serializer.serialize_i32(2),
8450                Self::Dynamic => serializer.serialize_i32(3),
8451                Self::PeeringSubnet => serializer.serialize_i32(4),
8452                Self::PeeringStatic => serializer.serialize_i32(5),
8453                Self::PeeringDynamic => serializer.serialize_i32(6),
8454                Self::PolicyBased => serializer.serialize_i32(7),
8455                Self::Advertised => serializer.serialize_i32(101),
8456                Self::UnknownValue(u) => u.0.serialize(serializer),
8457            }
8458        }
8459    }
8460
8461    impl<'de> serde::de::Deserialize<'de> for RouteType {
8462        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8463        where
8464            D: serde::Deserializer<'de>,
8465        {
8466            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
8467                ".google.cloud.networkmanagement.v1.RouteInfo.RouteType",
8468            ))
8469        }
8470    }
8471
8472    /// Type of next hop:
8473    ///
8474    /// # Working with unknown values
8475    ///
8476    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8477    /// additional enum variants at any time. Adding new variants is not considered
8478    /// a breaking change. Applications should write their code in anticipation of:
8479    ///
8480    /// - New values appearing in future releases of the client library, **and**
8481    /// - New values received dynamically, without application changes.
8482    ///
8483    /// Please consult the [Working with enums] section in the user guide for some
8484    /// guidelines.
8485    ///
8486    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8487    #[derive(Clone, Debug, PartialEq)]
8488    #[non_exhaustive]
8489    pub enum NextHopType {
8490        /// Unspecified type. Default value.
8491        Unspecified,
8492        /// Next hop is an IP address.
8493        NextHopIp,
8494        /// Next hop is a Compute Engine instance.
8495        NextHopInstance,
8496        /// Next hop is a VPC network gateway.
8497        NextHopNetwork,
8498        /// Next hop is a peering VPC. This scenario only happens when the user
8499        /// doesn't have permissions to the project where the next hop resource is
8500        /// located.
8501        NextHopPeering,
8502        /// Next hop is an interconnect.
8503        NextHopInterconnect,
8504        /// Next hop is a VPN tunnel.
8505        NextHopVpnTunnel,
8506        /// Next hop is a VPN gateway. This scenario only happens when tracing
8507        /// connectivity from an on-premises network to Google Cloud through a VPN.
8508        /// The analysis simulates a packet departing from the on-premises network
8509        /// through a VPN tunnel and arriving at a Cloud VPN gateway.
8510        NextHopVpnGateway,
8511        /// Next hop is an internet gateway.
8512        NextHopInternetGateway,
8513        /// Next hop is blackhole; that is, the next hop either does not exist or is
8514        /// unusable.
8515        NextHopBlackhole,
8516        /// Next hop is the forwarding rule of an Internal Load Balancer.
8517        NextHopIlb,
8518        /// Next hop is a
8519        /// [router appliance
8520        /// instance](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/ra-overview).
8521        NextHopRouterAppliance,
8522        /// Next hop is an NCC hub. This scenario only happens when the user doesn't
8523        /// have permissions to the project where the next hop resource is located.
8524        NextHopNccHub,
8525        /// Next hop is Secure Web Proxy Gateway.
8526        SecureWebProxyGateway,
8527        /// If set, the enum was initialized with an unknown value.
8528        ///
8529        /// Applications can examine the value using [NextHopType::value] or
8530        /// [NextHopType::name].
8531        UnknownValue(next_hop_type::UnknownValue),
8532    }
8533
8534    #[doc(hidden)]
8535    pub mod next_hop_type {
8536        #[allow(unused_imports)]
8537        use super::*;
8538        #[derive(Clone, Debug, PartialEq)]
8539        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8540    }
8541
8542    impl NextHopType {
8543        /// Gets the enum value.
8544        ///
8545        /// Returns `None` if the enum contains an unknown value deserialized from
8546        /// the string representation of enums.
8547        pub fn value(&self) -> std::option::Option<i32> {
8548            match self {
8549                Self::Unspecified => std::option::Option::Some(0),
8550                Self::NextHopIp => std::option::Option::Some(1),
8551                Self::NextHopInstance => std::option::Option::Some(2),
8552                Self::NextHopNetwork => std::option::Option::Some(3),
8553                Self::NextHopPeering => std::option::Option::Some(4),
8554                Self::NextHopInterconnect => std::option::Option::Some(5),
8555                Self::NextHopVpnTunnel => std::option::Option::Some(6),
8556                Self::NextHopVpnGateway => std::option::Option::Some(7),
8557                Self::NextHopInternetGateway => std::option::Option::Some(8),
8558                Self::NextHopBlackhole => std::option::Option::Some(9),
8559                Self::NextHopIlb => std::option::Option::Some(10),
8560                Self::NextHopRouterAppliance => std::option::Option::Some(11),
8561                Self::NextHopNccHub => std::option::Option::Some(12),
8562                Self::SecureWebProxyGateway => std::option::Option::Some(13),
8563                Self::UnknownValue(u) => u.0.value(),
8564            }
8565        }
8566
8567        /// Gets the enum value as a string.
8568        ///
8569        /// Returns `None` if the enum contains an unknown value deserialized from
8570        /// the integer representation of enums.
8571        pub fn name(&self) -> std::option::Option<&str> {
8572            match self {
8573                Self::Unspecified => std::option::Option::Some("NEXT_HOP_TYPE_UNSPECIFIED"),
8574                Self::NextHopIp => std::option::Option::Some("NEXT_HOP_IP"),
8575                Self::NextHopInstance => std::option::Option::Some("NEXT_HOP_INSTANCE"),
8576                Self::NextHopNetwork => std::option::Option::Some("NEXT_HOP_NETWORK"),
8577                Self::NextHopPeering => std::option::Option::Some("NEXT_HOP_PEERING"),
8578                Self::NextHopInterconnect => std::option::Option::Some("NEXT_HOP_INTERCONNECT"),
8579                Self::NextHopVpnTunnel => std::option::Option::Some("NEXT_HOP_VPN_TUNNEL"),
8580                Self::NextHopVpnGateway => std::option::Option::Some("NEXT_HOP_VPN_GATEWAY"),
8581                Self::NextHopInternetGateway => {
8582                    std::option::Option::Some("NEXT_HOP_INTERNET_GATEWAY")
8583                }
8584                Self::NextHopBlackhole => std::option::Option::Some("NEXT_HOP_BLACKHOLE"),
8585                Self::NextHopIlb => std::option::Option::Some("NEXT_HOP_ILB"),
8586                Self::NextHopRouterAppliance => {
8587                    std::option::Option::Some("NEXT_HOP_ROUTER_APPLIANCE")
8588                }
8589                Self::NextHopNccHub => std::option::Option::Some("NEXT_HOP_NCC_HUB"),
8590                Self::SecureWebProxyGateway => {
8591                    std::option::Option::Some("SECURE_WEB_PROXY_GATEWAY")
8592                }
8593                Self::UnknownValue(u) => u.0.name(),
8594            }
8595        }
8596    }
8597
8598    impl std::default::Default for NextHopType {
8599        fn default() -> Self {
8600            use std::convert::From;
8601            Self::from(0)
8602        }
8603    }
8604
8605    impl std::fmt::Display for NextHopType {
8606        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8607            wkt::internal::display_enum(f, self.name(), self.value())
8608        }
8609    }
8610
8611    impl std::convert::From<i32> for NextHopType {
8612        fn from(value: i32) -> Self {
8613            match value {
8614                0 => Self::Unspecified,
8615                1 => Self::NextHopIp,
8616                2 => Self::NextHopInstance,
8617                3 => Self::NextHopNetwork,
8618                4 => Self::NextHopPeering,
8619                5 => Self::NextHopInterconnect,
8620                6 => Self::NextHopVpnTunnel,
8621                7 => Self::NextHopVpnGateway,
8622                8 => Self::NextHopInternetGateway,
8623                9 => Self::NextHopBlackhole,
8624                10 => Self::NextHopIlb,
8625                11 => Self::NextHopRouterAppliance,
8626                12 => Self::NextHopNccHub,
8627                13 => Self::SecureWebProxyGateway,
8628                _ => Self::UnknownValue(next_hop_type::UnknownValue(
8629                    wkt::internal::UnknownEnumValue::Integer(value),
8630                )),
8631            }
8632        }
8633    }
8634
8635    impl std::convert::From<&str> for NextHopType {
8636        fn from(value: &str) -> Self {
8637            use std::string::ToString;
8638            match value {
8639                "NEXT_HOP_TYPE_UNSPECIFIED" => Self::Unspecified,
8640                "NEXT_HOP_IP" => Self::NextHopIp,
8641                "NEXT_HOP_INSTANCE" => Self::NextHopInstance,
8642                "NEXT_HOP_NETWORK" => Self::NextHopNetwork,
8643                "NEXT_HOP_PEERING" => Self::NextHopPeering,
8644                "NEXT_HOP_INTERCONNECT" => Self::NextHopInterconnect,
8645                "NEXT_HOP_VPN_TUNNEL" => Self::NextHopVpnTunnel,
8646                "NEXT_HOP_VPN_GATEWAY" => Self::NextHopVpnGateway,
8647                "NEXT_HOP_INTERNET_GATEWAY" => Self::NextHopInternetGateway,
8648                "NEXT_HOP_BLACKHOLE" => Self::NextHopBlackhole,
8649                "NEXT_HOP_ILB" => Self::NextHopIlb,
8650                "NEXT_HOP_ROUTER_APPLIANCE" => Self::NextHopRouterAppliance,
8651                "NEXT_HOP_NCC_HUB" => Self::NextHopNccHub,
8652                "SECURE_WEB_PROXY_GATEWAY" => Self::SecureWebProxyGateway,
8653                _ => Self::UnknownValue(next_hop_type::UnknownValue(
8654                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8655                )),
8656            }
8657        }
8658    }
8659
8660    impl serde::ser::Serialize for NextHopType {
8661        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8662        where
8663            S: serde::Serializer,
8664        {
8665            match self {
8666                Self::Unspecified => serializer.serialize_i32(0),
8667                Self::NextHopIp => serializer.serialize_i32(1),
8668                Self::NextHopInstance => serializer.serialize_i32(2),
8669                Self::NextHopNetwork => serializer.serialize_i32(3),
8670                Self::NextHopPeering => serializer.serialize_i32(4),
8671                Self::NextHopInterconnect => serializer.serialize_i32(5),
8672                Self::NextHopVpnTunnel => serializer.serialize_i32(6),
8673                Self::NextHopVpnGateway => serializer.serialize_i32(7),
8674                Self::NextHopInternetGateway => serializer.serialize_i32(8),
8675                Self::NextHopBlackhole => serializer.serialize_i32(9),
8676                Self::NextHopIlb => serializer.serialize_i32(10),
8677                Self::NextHopRouterAppliance => serializer.serialize_i32(11),
8678                Self::NextHopNccHub => serializer.serialize_i32(12),
8679                Self::SecureWebProxyGateway => serializer.serialize_i32(13),
8680                Self::UnknownValue(u) => u.0.serialize(serializer),
8681            }
8682        }
8683    }
8684
8685    impl<'de> serde::de::Deserialize<'de> for NextHopType {
8686        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8687        where
8688            D: serde::Deserializer<'de>,
8689        {
8690            deserializer.deserialize_any(wkt::internal::EnumVisitor::<NextHopType>::new(
8691                ".google.cloud.networkmanagement.v1.RouteInfo.NextHopType",
8692            ))
8693        }
8694    }
8695
8696    /// Indicates where routes are applicable.
8697    ///
8698    /// # Working with unknown values
8699    ///
8700    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8701    /// additional enum variants at any time. Adding new variants is not considered
8702    /// a breaking change. Applications should write their code in anticipation of:
8703    ///
8704    /// - New values appearing in future releases of the client library, **and**
8705    /// - New values received dynamically, without application changes.
8706    ///
8707    /// Please consult the [Working with enums] section in the user guide for some
8708    /// guidelines.
8709    ///
8710    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8711    #[derive(Clone, Debug, PartialEq)]
8712    #[non_exhaustive]
8713    pub enum RouteScope {
8714        /// Unspecified scope. Default value.
8715        Unspecified,
8716        /// Route is applicable to packets in Network.
8717        Network,
8718        /// Route is applicable to packets using NCC Hub's routing table.
8719        NccHub,
8720        /// If set, the enum was initialized with an unknown value.
8721        ///
8722        /// Applications can examine the value using [RouteScope::value] or
8723        /// [RouteScope::name].
8724        UnknownValue(route_scope::UnknownValue),
8725    }
8726
8727    #[doc(hidden)]
8728    pub mod route_scope {
8729        #[allow(unused_imports)]
8730        use super::*;
8731        #[derive(Clone, Debug, PartialEq)]
8732        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8733    }
8734
8735    impl RouteScope {
8736        /// Gets the enum value.
8737        ///
8738        /// Returns `None` if the enum contains an unknown value deserialized from
8739        /// the string representation of enums.
8740        pub fn value(&self) -> std::option::Option<i32> {
8741            match self {
8742                Self::Unspecified => std::option::Option::Some(0),
8743                Self::Network => std::option::Option::Some(1),
8744                Self::NccHub => std::option::Option::Some(2),
8745                Self::UnknownValue(u) => u.0.value(),
8746            }
8747        }
8748
8749        /// Gets the enum value as a string.
8750        ///
8751        /// Returns `None` if the enum contains an unknown value deserialized from
8752        /// the integer representation of enums.
8753        pub fn name(&self) -> std::option::Option<&str> {
8754            match self {
8755                Self::Unspecified => std::option::Option::Some("ROUTE_SCOPE_UNSPECIFIED"),
8756                Self::Network => std::option::Option::Some("NETWORK"),
8757                Self::NccHub => std::option::Option::Some("NCC_HUB"),
8758                Self::UnknownValue(u) => u.0.name(),
8759            }
8760        }
8761    }
8762
8763    impl std::default::Default for RouteScope {
8764        fn default() -> Self {
8765            use std::convert::From;
8766            Self::from(0)
8767        }
8768    }
8769
8770    impl std::fmt::Display for RouteScope {
8771        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8772            wkt::internal::display_enum(f, self.name(), self.value())
8773        }
8774    }
8775
8776    impl std::convert::From<i32> for RouteScope {
8777        fn from(value: i32) -> Self {
8778            match value {
8779                0 => Self::Unspecified,
8780                1 => Self::Network,
8781                2 => Self::NccHub,
8782                _ => Self::UnknownValue(route_scope::UnknownValue(
8783                    wkt::internal::UnknownEnumValue::Integer(value),
8784                )),
8785            }
8786        }
8787    }
8788
8789    impl std::convert::From<&str> for RouteScope {
8790        fn from(value: &str) -> Self {
8791            use std::string::ToString;
8792            match value {
8793                "ROUTE_SCOPE_UNSPECIFIED" => Self::Unspecified,
8794                "NETWORK" => Self::Network,
8795                "NCC_HUB" => Self::NccHub,
8796                _ => Self::UnknownValue(route_scope::UnknownValue(
8797                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8798                )),
8799            }
8800        }
8801    }
8802
8803    impl serde::ser::Serialize for RouteScope {
8804        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8805        where
8806            S: serde::Serializer,
8807        {
8808            match self {
8809                Self::Unspecified => serializer.serialize_i32(0),
8810                Self::Network => serializer.serialize_i32(1),
8811                Self::NccHub => serializer.serialize_i32(2),
8812                Self::UnknownValue(u) => u.0.serialize(serializer),
8813            }
8814        }
8815    }
8816
8817    impl<'de> serde::de::Deserialize<'de> for RouteScope {
8818        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8819        where
8820            D: serde::Deserializer<'de>,
8821        {
8822            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteScope>::new(
8823                ".google.cloud.networkmanagement.v1.RouteInfo.RouteScope",
8824            ))
8825        }
8826    }
8827}
8828
8829/// For display only. Details of a Google Service sending packets to a
8830/// VPC network. Although the source IP might be a publicly routable address,
8831/// some Google Services use special routes within Google production
8832/// infrastructure to reach Compute Engine Instances.
8833/// <https://cloud.google.com/vpc/docs/routes#special_return_paths>
8834#[derive(Clone, Default, PartialEq)]
8835#[non_exhaustive]
8836pub struct GoogleServiceInfo {
8837    /// Source IP address.
8838    pub source_ip: std::string::String,
8839
8840    /// Recognized type of a Google Service.
8841    pub google_service_type: crate::model::google_service_info::GoogleServiceType,
8842
8843    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8844}
8845
8846impl GoogleServiceInfo {
8847    /// Creates a new default instance.
8848    pub fn new() -> Self {
8849        std::default::Default::default()
8850    }
8851
8852    /// Sets the value of [source_ip][crate::model::GoogleServiceInfo::source_ip].
8853    ///
8854    /// # Example
8855    /// ```ignore,no_run
8856    /// # use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
8857    /// let x = GoogleServiceInfo::new().set_source_ip("example");
8858    /// ```
8859    pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8860        self.source_ip = v.into();
8861        self
8862    }
8863
8864    /// Sets the value of [google_service_type][crate::model::GoogleServiceInfo::google_service_type].
8865    ///
8866    /// # Example
8867    /// ```ignore,no_run
8868    /// # use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
8869    /// use google_cloud_networkmanagement_v1::model::google_service_info::GoogleServiceType;
8870    /// let x0 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::Iap);
8871    /// let x1 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::GfeProxyOrHealthCheckProber);
8872    /// let x2 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::CloudDns);
8873    /// ```
8874    pub fn set_google_service_type<
8875        T: std::convert::Into<crate::model::google_service_info::GoogleServiceType>,
8876    >(
8877        mut self,
8878        v: T,
8879    ) -> Self {
8880        self.google_service_type = v.into();
8881        self
8882    }
8883}
8884
8885impl wkt::message::Message for GoogleServiceInfo {
8886    fn typename() -> &'static str {
8887        "type.googleapis.com/google.cloud.networkmanagement.v1.GoogleServiceInfo"
8888    }
8889}
8890
8891/// Defines additional types related to [GoogleServiceInfo].
8892pub mod google_service_info {
8893    #[allow(unused_imports)]
8894    use super::*;
8895
8896    /// Recognized type of a Google Service.
8897    ///
8898    /// # Working with unknown values
8899    ///
8900    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8901    /// additional enum variants at any time. Adding new variants is not considered
8902    /// a breaking change. Applications should write their code in anticipation of:
8903    ///
8904    /// - New values appearing in future releases of the client library, **and**
8905    /// - New values received dynamically, without application changes.
8906    ///
8907    /// Please consult the [Working with enums] section in the user guide for some
8908    /// guidelines.
8909    ///
8910    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8911    #[derive(Clone, Debug, PartialEq)]
8912    #[non_exhaustive]
8913    pub enum GoogleServiceType {
8914        /// Unspecified Google Service.
8915        Unspecified,
8916        /// Identity aware proxy.
8917        /// <https://cloud.google.com/iap/docs/using-tcp-forwarding>
8918        Iap,
8919        /// One of two services sharing IP ranges:
8920        ///
8921        /// * Load Balancer proxy
8922        /// * Centralized Health Check prober
8923        ///   <https://cloud.google.com/load-balancing/docs/firewall-rules>
8924        GfeProxyOrHealthCheckProber,
8925        /// Connectivity from Cloud DNS to forwarding targets or alternate name
8926        /// servers that use private routing.
8927        /// <https://cloud.google.com/dns/docs/zones/forwarding-zones#firewall-rules>
8928        /// <https://cloud.google.com/dns/docs/policies#firewall-rules>
8929        CloudDns,
8930        /// private.googleapis.com and restricted.googleapis.com
8931        GoogleApi,
8932        /// Google API via Private Service Connect.
8933        /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
8934        GoogleApiPsc,
8935        /// Google API via VPC Service Controls.
8936        /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
8937        GoogleApiVpcSc,
8938        /// Google API via Serverless VPC Access.
8939        /// <https://cloud.google.com/vpc/docs/serverless-vpc-access>
8940        ServerlessVpcAccess,
8941        /// If set, the enum was initialized with an unknown value.
8942        ///
8943        /// Applications can examine the value using [GoogleServiceType::value] or
8944        /// [GoogleServiceType::name].
8945        UnknownValue(google_service_type::UnknownValue),
8946    }
8947
8948    #[doc(hidden)]
8949    pub mod google_service_type {
8950        #[allow(unused_imports)]
8951        use super::*;
8952        #[derive(Clone, Debug, PartialEq)]
8953        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8954    }
8955
8956    impl GoogleServiceType {
8957        /// Gets the enum value.
8958        ///
8959        /// Returns `None` if the enum contains an unknown value deserialized from
8960        /// the string representation of enums.
8961        pub fn value(&self) -> std::option::Option<i32> {
8962            match self {
8963                Self::Unspecified => std::option::Option::Some(0),
8964                Self::Iap => std::option::Option::Some(1),
8965                Self::GfeProxyOrHealthCheckProber => std::option::Option::Some(2),
8966                Self::CloudDns => std::option::Option::Some(3),
8967                Self::GoogleApi => std::option::Option::Some(4),
8968                Self::GoogleApiPsc => std::option::Option::Some(5),
8969                Self::GoogleApiVpcSc => std::option::Option::Some(6),
8970                Self::ServerlessVpcAccess => std::option::Option::Some(7),
8971                Self::UnknownValue(u) => u.0.value(),
8972            }
8973        }
8974
8975        /// Gets the enum value as a string.
8976        ///
8977        /// Returns `None` if the enum contains an unknown value deserialized from
8978        /// the integer representation of enums.
8979        pub fn name(&self) -> std::option::Option<&str> {
8980            match self {
8981                Self::Unspecified => std::option::Option::Some("GOOGLE_SERVICE_TYPE_UNSPECIFIED"),
8982                Self::Iap => std::option::Option::Some("IAP"),
8983                Self::GfeProxyOrHealthCheckProber => {
8984                    std::option::Option::Some("GFE_PROXY_OR_HEALTH_CHECK_PROBER")
8985                }
8986                Self::CloudDns => std::option::Option::Some("CLOUD_DNS"),
8987                Self::GoogleApi => std::option::Option::Some("GOOGLE_API"),
8988                Self::GoogleApiPsc => std::option::Option::Some("GOOGLE_API_PSC"),
8989                Self::GoogleApiVpcSc => std::option::Option::Some("GOOGLE_API_VPC_SC"),
8990                Self::ServerlessVpcAccess => std::option::Option::Some("SERVERLESS_VPC_ACCESS"),
8991                Self::UnknownValue(u) => u.0.name(),
8992            }
8993        }
8994    }
8995
8996    impl std::default::Default for GoogleServiceType {
8997        fn default() -> Self {
8998            use std::convert::From;
8999            Self::from(0)
9000        }
9001    }
9002
9003    impl std::fmt::Display for GoogleServiceType {
9004        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9005            wkt::internal::display_enum(f, self.name(), self.value())
9006        }
9007    }
9008
9009    impl std::convert::From<i32> for GoogleServiceType {
9010        fn from(value: i32) -> Self {
9011            match value {
9012                0 => Self::Unspecified,
9013                1 => Self::Iap,
9014                2 => Self::GfeProxyOrHealthCheckProber,
9015                3 => Self::CloudDns,
9016                4 => Self::GoogleApi,
9017                5 => Self::GoogleApiPsc,
9018                6 => Self::GoogleApiVpcSc,
9019                7 => Self::ServerlessVpcAccess,
9020                _ => Self::UnknownValue(google_service_type::UnknownValue(
9021                    wkt::internal::UnknownEnumValue::Integer(value),
9022                )),
9023            }
9024        }
9025    }
9026
9027    impl std::convert::From<&str> for GoogleServiceType {
9028        fn from(value: &str) -> Self {
9029            use std::string::ToString;
9030            match value {
9031                "GOOGLE_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
9032                "IAP" => Self::Iap,
9033                "GFE_PROXY_OR_HEALTH_CHECK_PROBER" => Self::GfeProxyOrHealthCheckProber,
9034                "CLOUD_DNS" => Self::CloudDns,
9035                "GOOGLE_API" => Self::GoogleApi,
9036                "GOOGLE_API_PSC" => Self::GoogleApiPsc,
9037                "GOOGLE_API_VPC_SC" => Self::GoogleApiVpcSc,
9038                "SERVERLESS_VPC_ACCESS" => Self::ServerlessVpcAccess,
9039                _ => Self::UnknownValue(google_service_type::UnknownValue(
9040                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9041                )),
9042            }
9043        }
9044    }
9045
9046    impl serde::ser::Serialize for GoogleServiceType {
9047        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9048        where
9049            S: serde::Serializer,
9050        {
9051            match self {
9052                Self::Unspecified => serializer.serialize_i32(0),
9053                Self::Iap => serializer.serialize_i32(1),
9054                Self::GfeProxyOrHealthCheckProber => serializer.serialize_i32(2),
9055                Self::CloudDns => serializer.serialize_i32(3),
9056                Self::GoogleApi => serializer.serialize_i32(4),
9057                Self::GoogleApiPsc => serializer.serialize_i32(5),
9058                Self::GoogleApiVpcSc => serializer.serialize_i32(6),
9059                Self::ServerlessVpcAccess => serializer.serialize_i32(7),
9060                Self::UnknownValue(u) => u.0.serialize(serializer),
9061            }
9062        }
9063    }
9064
9065    impl<'de> serde::de::Deserialize<'de> for GoogleServiceType {
9066        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9067        where
9068            D: serde::Deserializer<'de>,
9069        {
9070            deserializer.deserialize_any(wkt::internal::EnumVisitor::<GoogleServiceType>::new(
9071                ".google.cloud.networkmanagement.v1.GoogleServiceInfo.GoogleServiceType",
9072            ))
9073        }
9074    }
9075}
9076
9077/// For display only. Metadata associated with a Compute Engine forwarding rule.
9078#[derive(Clone, Default, PartialEq)]
9079#[non_exhaustive]
9080pub struct ForwardingRuleInfo {
9081    /// Name of the forwarding rule.
9082    pub display_name: std::string::String,
9083
9084    /// URI of the forwarding rule.
9085    pub uri: std::string::String,
9086
9087    /// Protocol defined in the forwarding rule that matches the packet.
9088    pub matched_protocol: std::string::String,
9089
9090    /// Port range defined in the forwarding rule that matches the packet.
9091    pub matched_port_range: std::string::String,
9092
9093    /// VIP of the forwarding rule.
9094    pub vip: std::string::String,
9095
9096    /// Target type of the forwarding rule.
9097    pub target: std::string::String,
9098
9099    /// Network URI.
9100    pub network_uri: std::string::String,
9101
9102    /// Region of the forwarding rule. Set only for regional forwarding rules.
9103    pub region: std::string::String,
9104
9105    /// Name of the load balancer the forwarding rule belongs to. Empty for
9106    /// forwarding rules not related to load balancers (like PSC forwarding rules).
9107    pub load_balancer_name: std::string::String,
9108
9109    /// URI of the PSC service attachment this forwarding rule targets (if
9110    /// applicable).
9111    pub psc_service_attachment_uri: std::string::String,
9112
9113    /// PSC Google API target this forwarding rule targets (if applicable).
9114    pub psc_google_api_target: std::string::String,
9115
9116    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9117}
9118
9119impl ForwardingRuleInfo {
9120    /// Creates a new default instance.
9121    pub fn new() -> Self {
9122        std::default::Default::default()
9123    }
9124
9125    /// Sets the value of [display_name][crate::model::ForwardingRuleInfo::display_name].
9126    ///
9127    /// # Example
9128    /// ```ignore,no_run
9129    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9130    /// let x = ForwardingRuleInfo::new().set_display_name("example");
9131    /// ```
9132    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9133        self.display_name = v.into();
9134        self
9135    }
9136
9137    /// Sets the value of [uri][crate::model::ForwardingRuleInfo::uri].
9138    ///
9139    /// # Example
9140    /// ```ignore,no_run
9141    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9142    /// let x = ForwardingRuleInfo::new().set_uri("example");
9143    /// ```
9144    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9145        self.uri = v.into();
9146        self
9147    }
9148
9149    /// Sets the value of [matched_protocol][crate::model::ForwardingRuleInfo::matched_protocol].
9150    ///
9151    /// # Example
9152    /// ```ignore,no_run
9153    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9154    /// let x = ForwardingRuleInfo::new().set_matched_protocol("example");
9155    /// ```
9156    pub fn set_matched_protocol<T: std::convert::Into<std::string::String>>(
9157        mut self,
9158        v: T,
9159    ) -> Self {
9160        self.matched_protocol = v.into();
9161        self
9162    }
9163
9164    /// Sets the value of [matched_port_range][crate::model::ForwardingRuleInfo::matched_port_range].
9165    ///
9166    /// # Example
9167    /// ```ignore,no_run
9168    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9169    /// let x = ForwardingRuleInfo::new().set_matched_port_range("example");
9170    /// ```
9171    pub fn set_matched_port_range<T: std::convert::Into<std::string::String>>(
9172        mut self,
9173        v: T,
9174    ) -> Self {
9175        self.matched_port_range = v.into();
9176        self
9177    }
9178
9179    /// Sets the value of [vip][crate::model::ForwardingRuleInfo::vip].
9180    ///
9181    /// # Example
9182    /// ```ignore,no_run
9183    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9184    /// let x = ForwardingRuleInfo::new().set_vip("example");
9185    /// ```
9186    pub fn set_vip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9187        self.vip = v.into();
9188        self
9189    }
9190
9191    /// Sets the value of [target][crate::model::ForwardingRuleInfo::target].
9192    ///
9193    /// # Example
9194    /// ```ignore,no_run
9195    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9196    /// let x = ForwardingRuleInfo::new().set_target("example");
9197    /// ```
9198    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9199        self.target = v.into();
9200        self
9201    }
9202
9203    /// Sets the value of [network_uri][crate::model::ForwardingRuleInfo::network_uri].
9204    ///
9205    /// # Example
9206    /// ```ignore,no_run
9207    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9208    /// let x = ForwardingRuleInfo::new().set_network_uri("example");
9209    /// ```
9210    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9211        self.network_uri = v.into();
9212        self
9213    }
9214
9215    /// Sets the value of [region][crate::model::ForwardingRuleInfo::region].
9216    ///
9217    /// # Example
9218    /// ```ignore,no_run
9219    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9220    /// let x = ForwardingRuleInfo::new().set_region("example");
9221    /// ```
9222    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9223        self.region = v.into();
9224        self
9225    }
9226
9227    /// Sets the value of [load_balancer_name][crate::model::ForwardingRuleInfo::load_balancer_name].
9228    ///
9229    /// # Example
9230    /// ```ignore,no_run
9231    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9232    /// let x = ForwardingRuleInfo::new().set_load_balancer_name("example");
9233    /// ```
9234    pub fn set_load_balancer_name<T: std::convert::Into<std::string::String>>(
9235        mut self,
9236        v: T,
9237    ) -> Self {
9238        self.load_balancer_name = v.into();
9239        self
9240    }
9241
9242    /// Sets the value of [psc_service_attachment_uri][crate::model::ForwardingRuleInfo::psc_service_attachment_uri].
9243    ///
9244    /// # Example
9245    /// ```ignore,no_run
9246    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9247    /// let x = ForwardingRuleInfo::new().set_psc_service_attachment_uri("example");
9248    /// ```
9249    pub fn set_psc_service_attachment_uri<T: std::convert::Into<std::string::String>>(
9250        mut self,
9251        v: T,
9252    ) -> Self {
9253        self.psc_service_attachment_uri = v.into();
9254        self
9255    }
9256
9257    /// Sets the value of [psc_google_api_target][crate::model::ForwardingRuleInfo::psc_google_api_target].
9258    ///
9259    /// # Example
9260    /// ```ignore,no_run
9261    /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9262    /// let x = ForwardingRuleInfo::new().set_psc_google_api_target("example");
9263    /// ```
9264    pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
9265        mut self,
9266        v: T,
9267    ) -> Self {
9268        self.psc_google_api_target = v.into();
9269        self
9270    }
9271}
9272
9273impl wkt::message::Message for ForwardingRuleInfo {
9274    fn typename() -> &'static str {
9275        "type.googleapis.com/google.cloud.networkmanagement.v1.ForwardingRuleInfo"
9276    }
9277}
9278
9279/// For display only. Metadata associated with a load balancer.
9280#[derive(Clone, Default, PartialEq)]
9281#[non_exhaustive]
9282pub struct LoadBalancerInfo {
9283    /// Type of the load balancer.
9284    pub load_balancer_type: crate::model::load_balancer_info::LoadBalancerType,
9285
9286    /// URI of the health check for the load balancer. Deprecated and no longer
9287    /// populated as different load balancer backends might have different health
9288    /// checks.
9289    #[deprecated]
9290    pub health_check_uri: std::string::String,
9291
9292    /// Information for the loadbalancer backends.
9293    pub backends: std::vec::Vec<crate::model::LoadBalancerBackend>,
9294
9295    /// Type of load balancer's backend configuration.
9296    pub backend_type: crate::model::load_balancer_info::BackendType,
9297
9298    /// Backend configuration URI.
9299    pub backend_uri: std::string::String,
9300
9301    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9302}
9303
9304impl LoadBalancerInfo {
9305    /// Creates a new default instance.
9306    pub fn new() -> Self {
9307        std::default::Default::default()
9308    }
9309
9310    /// Sets the value of [load_balancer_type][crate::model::LoadBalancerInfo::load_balancer_type].
9311    ///
9312    /// # Example
9313    /// ```ignore,no_run
9314    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9315    /// use google_cloud_networkmanagement_v1::model::load_balancer_info::LoadBalancerType;
9316    /// let x0 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::InternalTcpUdp);
9317    /// let x1 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::NetworkTcpUdp);
9318    /// let x2 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::HttpProxy);
9319    /// ```
9320    pub fn set_load_balancer_type<
9321        T: std::convert::Into<crate::model::load_balancer_info::LoadBalancerType>,
9322    >(
9323        mut self,
9324        v: T,
9325    ) -> Self {
9326        self.load_balancer_type = v.into();
9327        self
9328    }
9329
9330    /// Sets the value of [health_check_uri][crate::model::LoadBalancerInfo::health_check_uri].
9331    ///
9332    /// # Example
9333    /// ```ignore,no_run
9334    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9335    /// let x = LoadBalancerInfo::new().set_health_check_uri("example");
9336    /// ```
9337    #[deprecated]
9338    pub fn set_health_check_uri<T: std::convert::Into<std::string::String>>(
9339        mut self,
9340        v: T,
9341    ) -> Self {
9342        self.health_check_uri = v.into();
9343        self
9344    }
9345
9346    /// Sets the value of [backends][crate::model::LoadBalancerInfo::backends].
9347    ///
9348    /// # Example
9349    /// ```ignore,no_run
9350    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9351    /// use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9352    /// let x = LoadBalancerInfo::new()
9353    ///     .set_backends([
9354    ///         LoadBalancerBackend::default()/* use setters */,
9355    ///         LoadBalancerBackend::default()/* use (different) setters */,
9356    ///     ]);
9357    /// ```
9358    pub fn set_backends<T, V>(mut self, v: T) -> Self
9359    where
9360        T: std::iter::IntoIterator<Item = V>,
9361        V: std::convert::Into<crate::model::LoadBalancerBackend>,
9362    {
9363        use std::iter::Iterator;
9364        self.backends = v.into_iter().map(|i| i.into()).collect();
9365        self
9366    }
9367
9368    /// Sets the value of [backend_type][crate::model::LoadBalancerInfo::backend_type].
9369    ///
9370    /// # Example
9371    /// ```ignore,no_run
9372    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9373    /// use google_cloud_networkmanagement_v1::model::load_balancer_info::BackendType;
9374    /// let x0 = LoadBalancerInfo::new().set_backend_type(BackendType::BackendService);
9375    /// let x1 = LoadBalancerInfo::new().set_backend_type(BackendType::TargetPool);
9376    /// let x2 = LoadBalancerInfo::new().set_backend_type(BackendType::TargetInstance);
9377    /// ```
9378    pub fn set_backend_type<
9379        T: std::convert::Into<crate::model::load_balancer_info::BackendType>,
9380    >(
9381        mut self,
9382        v: T,
9383    ) -> Self {
9384        self.backend_type = v.into();
9385        self
9386    }
9387
9388    /// Sets the value of [backend_uri][crate::model::LoadBalancerInfo::backend_uri].
9389    ///
9390    /// # Example
9391    /// ```ignore,no_run
9392    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9393    /// let x = LoadBalancerInfo::new().set_backend_uri("example");
9394    /// ```
9395    pub fn set_backend_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9396        self.backend_uri = v.into();
9397        self
9398    }
9399}
9400
9401impl wkt::message::Message for LoadBalancerInfo {
9402    fn typename() -> &'static str {
9403        "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerInfo"
9404    }
9405}
9406
9407/// Defines additional types related to [LoadBalancerInfo].
9408pub mod load_balancer_info {
9409    #[allow(unused_imports)]
9410    use super::*;
9411
9412    /// The type definition for a load balancer:
9413    ///
9414    /// # Working with unknown values
9415    ///
9416    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9417    /// additional enum variants at any time. Adding new variants is not considered
9418    /// a breaking change. Applications should write their code in anticipation of:
9419    ///
9420    /// - New values appearing in future releases of the client library, **and**
9421    /// - New values received dynamically, without application changes.
9422    ///
9423    /// Please consult the [Working with enums] section in the user guide for some
9424    /// guidelines.
9425    ///
9426    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9427    #[derive(Clone, Debug, PartialEq)]
9428    #[non_exhaustive]
9429    pub enum LoadBalancerType {
9430        /// Type is unspecified.
9431        Unspecified,
9432        /// Internal TCP/UDP load balancer.
9433        InternalTcpUdp,
9434        /// Network TCP/UDP load balancer.
9435        NetworkTcpUdp,
9436        /// HTTP(S) proxy load balancer.
9437        HttpProxy,
9438        /// TCP proxy load balancer.
9439        TcpProxy,
9440        /// SSL proxy load balancer.
9441        SslProxy,
9442        /// If set, the enum was initialized with an unknown value.
9443        ///
9444        /// Applications can examine the value using [LoadBalancerType::value] or
9445        /// [LoadBalancerType::name].
9446        UnknownValue(load_balancer_type::UnknownValue),
9447    }
9448
9449    #[doc(hidden)]
9450    pub mod load_balancer_type {
9451        #[allow(unused_imports)]
9452        use super::*;
9453        #[derive(Clone, Debug, PartialEq)]
9454        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9455    }
9456
9457    impl LoadBalancerType {
9458        /// Gets the enum value.
9459        ///
9460        /// Returns `None` if the enum contains an unknown value deserialized from
9461        /// the string representation of enums.
9462        pub fn value(&self) -> std::option::Option<i32> {
9463            match self {
9464                Self::Unspecified => std::option::Option::Some(0),
9465                Self::InternalTcpUdp => std::option::Option::Some(1),
9466                Self::NetworkTcpUdp => std::option::Option::Some(2),
9467                Self::HttpProxy => std::option::Option::Some(3),
9468                Self::TcpProxy => std::option::Option::Some(4),
9469                Self::SslProxy => std::option::Option::Some(5),
9470                Self::UnknownValue(u) => u.0.value(),
9471            }
9472        }
9473
9474        /// Gets the enum value as a string.
9475        ///
9476        /// Returns `None` if the enum contains an unknown value deserialized from
9477        /// the integer representation of enums.
9478        pub fn name(&self) -> std::option::Option<&str> {
9479            match self {
9480                Self::Unspecified => std::option::Option::Some("LOAD_BALANCER_TYPE_UNSPECIFIED"),
9481                Self::InternalTcpUdp => std::option::Option::Some("INTERNAL_TCP_UDP"),
9482                Self::NetworkTcpUdp => std::option::Option::Some("NETWORK_TCP_UDP"),
9483                Self::HttpProxy => std::option::Option::Some("HTTP_PROXY"),
9484                Self::TcpProxy => std::option::Option::Some("TCP_PROXY"),
9485                Self::SslProxy => std::option::Option::Some("SSL_PROXY"),
9486                Self::UnknownValue(u) => u.0.name(),
9487            }
9488        }
9489    }
9490
9491    impl std::default::Default for LoadBalancerType {
9492        fn default() -> Self {
9493            use std::convert::From;
9494            Self::from(0)
9495        }
9496    }
9497
9498    impl std::fmt::Display for LoadBalancerType {
9499        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9500            wkt::internal::display_enum(f, self.name(), self.value())
9501        }
9502    }
9503
9504    impl std::convert::From<i32> for LoadBalancerType {
9505        fn from(value: i32) -> Self {
9506            match value {
9507                0 => Self::Unspecified,
9508                1 => Self::InternalTcpUdp,
9509                2 => Self::NetworkTcpUdp,
9510                3 => Self::HttpProxy,
9511                4 => Self::TcpProxy,
9512                5 => Self::SslProxy,
9513                _ => Self::UnknownValue(load_balancer_type::UnknownValue(
9514                    wkt::internal::UnknownEnumValue::Integer(value),
9515                )),
9516            }
9517        }
9518    }
9519
9520    impl std::convert::From<&str> for LoadBalancerType {
9521        fn from(value: &str) -> Self {
9522            use std::string::ToString;
9523            match value {
9524                "LOAD_BALANCER_TYPE_UNSPECIFIED" => Self::Unspecified,
9525                "INTERNAL_TCP_UDP" => Self::InternalTcpUdp,
9526                "NETWORK_TCP_UDP" => Self::NetworkTcpUdp,
9527                "HTTP_PROXY" => Self::HttpProxy,
9528                "TCP_PROXY" => Self::TcpProxy,
9529                "SSL_PROXY" => Self::SslProxy,
9530                _ => Self::UnknownValue(load_balancer_type::UnknownValue(
9531                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9532                )),
9533            }
9534        }
9535    }
9536
9537    impl serde::ser::Serialize for LoadBalancerType {
9538        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9539        where
9540            S: serde::Serializer,
9541        {
9542            match self {
9543                Self::Unspecified => serializer.serialize_i32(0),
9544                Self::InternalTcpUdp => serializer.serialize_i32(1),
9545                Self::NetworkTcpUdp => serializer.serialize_i32(2),
9546                Self::HttpProxy => serializer.serialize_i32(3),
9547                Self::TcpProxy => serializer.serialize_i32(4),
9548                Self::SslProxy => serializer.serialize_i32(5),
9549                Self::UnknownValue(u) => u.0.serialize(serializer),
9550            }
9551        }
9552    }
9553
9554    impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
9555        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9556        where
9557            D: serde::Deserializer<'de>,
9558        {
9559            deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
9560                ".google.cloud.networkmanagement.v1.LoadBalancerInfo.LoadBalancerType",
9561            ))
9562        }
9563    }
9564
9565    /// The type definition for a load balancer backend configuration:
9566    ///
9567    /// # Working with unknown values
9568    ///
9569    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9570    /// additional enum variants at any time. Adding new variants is not considered
9571    /// a breaking change. Applications should write their code in anticipation of:
9572    ///
9573    /// - New values appearing in future releases of the client library, **and**
9574    /// - New values received dynamically, without application changes.
9575    ///
9576    /// Please consult the [Working with enums] section in the user guide for some
9577    /// guidelines.
9578    ///
9579    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9580    #[derive(Clone, Debug, PartialEq)]
9581    #[non_exhaustive]
9582    pub enum BackendType {
9583        /// Type is unspecified.
9584        Unspecified,
9585        /// Backend Service as the load balancer's backend.
9586        BackendService,
9587        /// Target Pool as the load balancer's backend.
9588        TargetPool,
9589        /// Target Instance as the load balancer's backend.
9590        TargetInstance,
9591        /// If set, the enum was initialized with an unknown value.
9592        ///
9593        /// Applications can examine the value using [BackendType::value] or
9594        /// [BackendType::name].
9595        UnknownValue(backend_type::UnknownValue),
9596    }
9597
9598    #[doc(hidden)]
9599    pub mod backend_type {
9600        #[allow(unused_imports)]
9601        use super::*;
9602        #[derive(Clone, Debug, PartialEq)]
9603        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9604    }
9605
9606    impl BackendType {
9607        /// Gets the enum value.
9608        ///
9609        /// Returns `None` if the enum contains an unknown value deserialized from
9610        /// the string representation of enums.
9611        pub fn value(&self) -> std::option::Option<i32> {
9612            match self {
9613                Self::Unspecified => std::option::Option::Some(0),
9614                Self::BackendService => std::option::Option::Some(1),
9615                Self::TargetPool => std::option::Option::Some(2),
9616                Self::TargetInstance => std::option::Option::Some(3),
9617                Self::UnknownValue(u) => u.0.value(),
9618            }
9619        }
9620
9621        /// Gets the enum value as a string.
9622        ///
9623        /// Returns `None` if the enum contains an unknown value deserialized from
9624        /// the integer representation of enums.
9625        pub fn name(&self) -> std::option::Option<&str> {
9626            match self {
9627                Self::Unspecified => std::option::Option::Some("BACKEND_TYPE_UNSPECIFIED"),
9628                Self::BackendService => std::option::Option::Some("BACKEND_SERVICE"),
9629                Self::TargetPool => std::option::Option::Some("TARGET_POOL"),
9630                Self::TargetInstance => std::option::Option::Some("TARGET_INSTANCE"),
9631                Self::UnknownValue(u) => u.0.name(),
9632            }
9633        }
9634    }
9635
9636    impl std::default::Default for BackendType {
9637        fn default() -> Self {
9638            use std::convert::From;
9639            Self::from(0)
9640        }
9641    }
9642
9643    impl std::fmt::Display for BackendType {
9644        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9645            wkt::internal::display_enum(f, self.name(), self.value())
9646        }
9647    }
9648
9649    impl std::convert::From<i32> for BackendType {
9650        fn from(value: i32) -> Self {
9651            match value {
9652                0 => Self::Unspecified,
9653                1 => Self::BackendService,
9654                2 => Self::TargetPool,
9655                3 => Self::TargetInstance,
9656                _ => Self::UnknownValue(backend_type::UnknownValue(
9657                    wkt::internal::UnknownEnumValue::Integer(value),
9658                )),
9659            }
9660        }
9661    }
9662
9663    impl std::convert::From<&str> for BackendType {
9664        fn from(value: &str) -> Self {
9665            use std::string::ToString;
9666            match value {
9667                "BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
9668                "BACKEND_SERVICE" => Self::BackendService,
9669                "TARGET_POOL" => Self::TargetPool,
9670                "TARGET_INSTANCE" => Self::TargetInstance,
9671                _ => Self::UnknownValue(backend_type::UnknownValue(
9672                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9673                )),
9674            }
9675        }
9676    }
9677
9678    impl serde::ser::Serialize for BackendType {
9679        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9680        where
9681            S: serde::Serializer,
9682        {
9683            match self {
9684                Self::Unspecified => serializer.serialize_i32(0),
9685                Self::BackendService => serializer.serialize_i32(1),
9686                Self::TargetPool => serializer.serialize_i32(2),
9687                Self::TargetInstance => serializer.serialize_i32(3),
9688                Self::UnknownValue(u) => u.0.serialize(serializer),
9689            }
9690        }
9691    }
9692
9693    impl<'de> serde::de::Deserialize<'de> for BackendType {
9694        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9695        where
9696            D: serde::Deserializer<'de>,
9697        {
9698            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackendType>::new(
9699                ".google.cloud.networkmanagement.v1.LoadBalancerInfo.BackendType",
9700            ))
9701        }
9702    }
9703}
9704
9705/// For display only. Metadata associated with a specific load balancer backend.
9706#[derive(Clone, Default, PartialEq)]
9707#[non_exhaustive]
9708pub struct LoadBalancerBackend {
9709    /// Name of a Compute Engine instance or network endpoint.
9710    pub display_name: std::string::String,
9711
9712    /// URI of a Compute Engine instance or network endpoint.
9713    pub uri: std::string::String,
9714
9715    /// State of the health check firewall configuration.
9716    pub health_check_firewall_state: crate::model::load_balancer_backend::HealthCheckFirewallState,
9717
9718    /// A list of firewall rule URIs allowing probes from health check IP ranges.
9719    pub health_check_allowing_firewall_rules: std::vec::Vec<std::string::String>,
9720
9721    /// A list of firewall rule URIs blocking probes from health check IP ranges.
9722    pub health_check_blocking_firewall_rules: std::vec::Vec<std::string::String>,
9723
9724    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9725}
9726
9727impl LoadBalancerBackend {
9728    /// Creates a new default instance.
9729    pub fn new() -> Self {
9730        std::default::Default::default()
9731    }
9732
9733    /// Sets the value of [display_name][crate::model::LoadBalancerBackend::display_name].
9734    ///
9735    /// # Example
9736    /// ```ignore,no_run
9737    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9738    /// let x = LoadBalancerBackend::new().set_display_name("example");
9739    /// ```
9740    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9741        self.display_name = v.into();
9742        self
9743    }
9744
9745    /// Sets the value of [uri][crate::model::LoadBalancerBackend::uri].
9746    ///
9747    /// # Example
9748    /// ```ignore,no_run
9749    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9750    /// let x = LoadBalancerBackend::new().set_uri("example");
9751    /// ```
9752    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9753        self.uri = v.into();
9754        self
9755    }
9756
9757    /// Sets the value of [health_check_firewall_state][crate::model::LoadBalancerBackend::health_check_firewall_state].
9758    ///
9759    /// # Example
9760    /// ```ignore,no_run
9761    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9762    /// use google_cloud_networkmanagement_v1::model::load_balancer_backend::HealthCheckFirewallState;
9763    /// let x0 = LoadBalancerBackend::new().set_health_check_firewall_state(HealthCheckFirewallState::Configured);
9764    /// let x1 = LoadBalancerBackend::new().set_health_check_firewall_state(HealthCheckFirewallState::Misconfigured);
9765    /// ```
9766    pub fn set_health_check_firewall_state<
9767        T: std::convert::Into<crate::model::load_balancer_backend::HealthCheckFirewallState>,
9768    >(
9769        mut self,
9770        v: T,
9771    ) -> Self {
9772        self.health_check_firewall_state = v.into();
9773        self
9774    }
9775
9776    /// Sets the value of [health_check_allowing_firewall_rules][crate::model::LoadBalancerBackend::health_check_allowing_firewall_rules].
9777    ///
9778    /// # Example
9779    /// ```ignore,no_run
9780    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9781    /// let x = LoadBalancerBackend::new().set_health_check_allowing_firewall_rules(["a", "b", "c"]);
9782    /// ```
9783    pub fn set_health_check_allowing_firewall_rules<T, V>(mut self, v: T) -> Self
9784    where
9785        T: std::iter::IntoIterator<Item = V>,
9786        V: std::convert::Into<std::string::String>,
9787    {
9788        use std::iter::Iterator;
9789        self.health_check_allowing_firewall_rules = v.into_iter().map(|i| i.into()).collect();
9790        self
9791    }
9792
9793    /// Sets the value of [health_check_blocking_firewall_rules][crate::model::LoadBalancerBackend::health_check_blocking_firewall_rules].
9794    ///
9795    /// # Example
9796    /// ```ignore,no_run
9797    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9798    /// let x = LoadBalancerBackend::new().set_health_check_blocking_firewall_rules(["a", "b", "c"]);
9799    /// ```
9800    pub fn set_health_check_blocking_firewall_rules<T, V>(mut self, v: T) -> Self
9801    where
9802        T: std::iter::IntoIterator<Item = V>,
9803        V: std::convert::Into<std::string::String>,
9804    {
9805        use std::iter::Iterator;
9806        self.health_check_blocking_firewall_rules = v.into_iter().map(|i| i.into()).collect();
9807        self
9808    }
9809}
9810
9811impl wkt::message::Message for LoadBalancerBackend {
9812    fn typename() -> &'static str {
9813        "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerBackend"
9814    }
9815}
9816
9817/// Defines additional types related to [LoadBalancerBackend].
9818pub mod load_balancer_backend {
9819    #[allow(unused_imports)]
9820    use super::*;
9821
9822    /// State of a health check firewall configuration:
9823    ///
9824    /// # Working with unknown values
9825    ///
9826    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9827    /// additional enum variants at any time. Adding new variants is not considered
9828    /// a breaking change. Applications should write their code in anticipation of:
9829    ///
9830    /// - New values appearing in future releases of the client library, **and**
9831    /// - New values received dynamically, without application changes.
9832    ///
9833    /// Please consult the [Working with enums] section in the user guide for some
9834    /// guidelines.
9835    ///
9836    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9837    #[derive(Clone, Debug, PartialEq)]
9838    #[non_exhaustive]
9839    pub enum HealthCheckFirewallState {
9840        /// State is unspecified. Default state if not populated.
9841        Unspecified,
9842        /// There are configured firewall rules to allow health check probes to the
9843        /// backend.
9844        Configured,
9845        /// There are firewall rules configured to allow partial health check ranges
9846        /// or block all health check ranges.
9847        /// If a health check probe is sent from denied IP ranges,
9848        /// the health check to the backend will fail. Then, the backend will be
9849        /// marked unhealthy and will not receive traffic sent to the load balancer.
9850        Misconfigured,
9851        /// If set, the enum was initialized with an unknown value.
9852        ///
9853        /// Applications can examine the value using [HealthCheckFirewallState::value] or
9854        /// [HealthCheckFirewallState::name].
9855        UnknownValue(health_check_firewall_state::UnknownValue),
9856    }
9857
9858    #[doc(hidden)]
9859    pub mod health_check_firewall_state {
9860        #[allow(unused_imports)]
9861        use super::*;
9862        #[derive(Clone, Debug, PartialEq)]
9863        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9864    }
9865
9866    impl HealthCheckFirewallState {
9867        /// Gets the enum value.
9868        ///
9869        /// Returns `None` if the enum contains an unknown value deserialized from
9870        /// the string representation of enums.
9871        pub fn value(&self) -> std::option::Option<i32> {
9872            match self {
9873                Self::Unspecified => std::option::Option::Some(0),
9874                Self::Configured => std::option::Option::Some(1),
9875                Self::Misconfigured => std::option::Option::Some(2),
9876                Self::UnknownValue(u) => u.0.value(),
9877            }
9878        }
9879
9880        /// Gets the enum value as a string.
9881        ///
9882        /// Returns `None` if the enum contains an unknown value deserialized from
9883        /// the integer representation of enums.
9884        pub fn name(&self) -> std::option::Option<&str> {
9885            match self {
9886                Self::Unspecified => {
9887                    std::option::Option::Some("HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED")
9888                }
9889                Self::Configured => std::option::Option::Some("CONFIGURED"),
9890                Self::Misconfigured => std::option::Option::Some("MISCONFIGURED"),
9891                Self::UnknownValue(u) => u.0.name(),
9892            }
9893        }
9894    }
9895
9896    impl std::default::Default for HealthCheckFirewallState {
9897        fn default() -> Self {
9898            use std::convert::From;
9899            Self::from(0)
9900        }
9901    }
9902
9903    impl std::fmt::Display for HealthCheckFirewallState {
9904        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9905            wkt::internal::display_enum(f, self.name(), self.value())
9906        }
9907    }
9908
9909    impl std::convert::From<i32> for HealthCheckFirewallState {
9910        fn from(value: i32) -> Self {
9911            match value {
9912                0 => Self::Unspecified,
9913                1 => Self::Configured,
9914                2 => Self::Misconfigured,
9915                _ => Self::UnknownValue(health_check_firewall_state::UnknownValue(
9916                    wkt::internal::UnknownEnumValue::Integer(value),
9917                )),
9918            }
9919        }
9920    }
9921
9922    impl std::convert::From<&str> for HealthCheckFirewallState {
9923        fn from(value: &str) -> Self {
9924            use std::string::ToString;
9925            match value {
9926                "HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED" => Self::Unspecified,
9927                "CONFIGURED" => Self::Configured,
9928                "MISCONFIGURED" => Self::Misconfigured,
9929                _ => Self::UnknownValue(health_check_firewall_state::UnknownValue(
9930                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9931                )),
9932            }
9933        }
9934    }
9935
9936    impl serde::ser::Serialize for HealthCheckFirewallState {
9937        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9938        where
9939            S: serde::Serializer,
9940        {
9941            match self {
9942                Self::Unspecified => serializer.serialize_i32(0),
9943                Self::Configured => serializer.serialize_i32(1),
9944                Self::Misconfigured => serializer.serialize_i32(2),
9945                Self::UnknownValue(u) => u.0.serialize(serializer),
9946            }
9947        }
9948    }
9949
9950    impl<'de> serde::de::Deserialize<'de> for HealthCheckFirewallState {
9951        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9952        where
9953            D: serde::Deserializer<'de>,
9954        {
9955            deserializer.deserialize_any(wkt::internal::EnumVisitor::<HealthCheckFirewallState>::new(
9956                ".google.cloud.networkmanagement.v1.LoadBalancerBackend.HealthCheckFirewallState"))
9957        }
9958    }
9959}
9960
9961/// For display only. Metadata associated with a hybrid subnet.
9962#[derive(Clone, Default, PartialEq)]
9963#[non_exhaustive]
9964pub struct HybridSubnetInfo {
9965    /// Name of a hybrid subnet.
9966    pub display_name: std::string::String,
9967
9968    /// URI of a hybrid subnet.
9969    pub uri: std::string::String,
9970
9971    /// Name of a Google Cloud region where the hybrid subnet is configured.
9972    pub region: std::string::String,
9973
9974    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9975}
9976
9977impl HybridSubnetInfo {
9978    /// Creates a new default instance.
9979    pub fn new() -> Self {
9980        std::default::Default::default()
9981    }
9982
9983    /// Sets the value of [display_name][crate::model::HybridSubnetInfo::display_name].
9984    ///
9985    /// # Example
9986    /// ```ignore,no_run
9987    /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
9988    /// let x = HybridSubnetInfo::new().set_display_name("example");
9989    /// ```
9990    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9991        self.display_name = v.into();
9992        self
9993    }
9994
9995    /// Sets the value of [uri][crate::model::HybridSubnetInfo::uri].
9996    ///
9997    /// # Example
9998    /// ```ignore,no_run
9999    /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
10000    /// let x = HybridSubnetInfo::new().set_uri("example");
10001    /// ```
10002    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10003        self.uri = v.into();
10004        self
10005    }
10006
10007    /// Sets the value of [region][crate::model::HybridSubnetInfo::region].
10008    ///
10009    /// # Example
10010    /// ```ignore,no_run
10011    /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
10012    /// let x = HybridSubnetInfo::new().set_region("example");
10013    /// ```
10014    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10015        self.region = v.into();
10016        self
10017    }
10018}
10019
10020impl wkt::message::Message for HybridSubnetInfo {
10021    fn typename() -> &'static str {
10022        "type.googleapis.com/google.cloud.networkmanagement.v1.HybridSubnetInfo"
10023    }
10024}
10025
10026/// For display only. Metadata associated with a Compute Engine VPN gateway.
10027#[derive(Clone, Default, PartialEq)]
10028#[non_exhaustive]
10029pub struct VpnGatewayInfo {
10030    /// Name of a VPN gateway.
10031    pub display_name: std::string::String,
10032
10033    /// URI of a VPN gateway.
10034    pub uri: std::string::String,
10035
10036    /// URI of a Compute Engine network where the VPN gateway is configured.
10037    pub network_uri: std::string::String,
10038
10039    /// IP address of the VPN gateway.
10040    pub ip_address: std::string::String,
10041
10042    /// A VPN tunnel that is associated with this VPN gateway.
10043    /// There may be multiple VPN tunnels configured on a VPN gateway, and only
10044    /// the one relevant to the test is displayed.
10045    pub vpn_tunnel_uri: std::string::String,
10046
10047    /// Name of a Google Cloud region where this VPN gateway is configured.
10048    pub region: std::string::String,
10049
10050    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10051}
10052
10053impl VpnGatewayInfo {
10054    /// Creates a new default instance.
10055    pub fn new() -> Self {
10056        std::default::Default::default()
10057    }
10058
10059    /// Sets the value of [display_name][crate::model::VpnGatewayInfo::display_name].
10060    ///
10061    /// # Example
10062    /// ```ignore,no_run
10063    /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10064    /// let x = VpnGatewayInfo::new().set_display_name("example");
10065    /// ```
10066    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10067        self.display_name = v.into();
10068        self
10069    }
10070
10071    /// Sets the value of [uri][crate::model::VpnGatewayInfo::uri].
10072    ///
10073    /// # Example
10074    /// ```ignore,no_run
10075    /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10076    /// let x = VpnGatewayInfo::new().set_uri("example");
10077    /// ```
10078    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10079        self.uri = v.into();
10080        self
10081    }
10082
10083    /// Sets the value of [network_uri][crate::model::VpnGatewayInfo::network_uri].
10084    ///
10085    /// # Example
10086    /// ```ignore,no_run
10087    /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10088    /// let x = VpnGatewayInfo::new().set_network_uri("example");
10089    /// ```
10090    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10091        self.network_uri = v.into();
10092        self
10093    }
10094
10095    /// Sets the value of [ip_address][crate::model::VpnGatewayInfo::ip_address].
10096    ///
10097    /// # Example
10098    /// ```ignore,no_run
10099    /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10100    /// let x = VpnGatewayInfo::new().set_ip_address("example");
10101    /// ```
10102    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10103        self.ip_address = v.into();
10104        self
10105    }
10106
10107    /// Sets the value of [vpn_tunnel_uri][crate::model::VpnGatewayInfo::vpn_tunnel_uri].
10108    ///
10109    /// # Example
10110    /// ```ignore,no_run
10111    /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10112    /// let x = VpnGatewayInfo::new().set_vpn_tunnel_uri("example");
10113    /// ```
10114    pub fn set_vpn_tunnel_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10115        self.vpn_tunnel_uri = v.into();
10116        self
10117    }
10118
10119    /// Sets the value of [region][crate::model::VpnGatewayInfo::region].
10120    ///
10121    /// # Example
10122    /// ```ignore,no_run
10123    /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10124    /// let x = VpnGatewayInfo::new().set_region("example");
10125    /// ```
10126    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10127        self.region = v.into();
10128        self
10129    }
10130}
10131
10132impl wkt::message::Message for VpnGatewayInfo {
10133    fn typename() -> &'static str {
10134        "type.googleapis.com/google.cloud.networkmanagement.v1.VpnGatewayInfo"
10135    }
10136}
10137
10138/// For display only. Metadata associated with a Compute Engine VPN tunnel.
10139#[derive(Clone, Default, PartialEq)]
10140#[non_exhaustive]
10141pub struct VpnTunnelInfo {
10142    /// Name of a VPN tunnel.
10143    pub display_name: std::string::String,
10144
10145    /// URI of a VPN tunnel.
10146    pub uri: std::string::String,
10147
10148    /// URI of the VPN gateway at local end of the tunnel.
10149    pub source_gateway: std::string::String,
10150
10151    /// URI of a VPN gateway at remote end of the tunnel.
10152    pub remote_gateway: std::string::String,
10153
10154    /// Remote VPN gateway's IP address.
10155    pub remote_gateway_ip: std::string::String,
10156
10157    /// Local VPN gateway's IP address.
10158    pub source_gateway_ip: std::string::String,
10159
10160    /// URI of a Compute Engine network where the VPN tunnel is configured.
10161    pub network_uri: std::string::String,
10162
10163    /// Name of a Google Cloud region where this VPN tunnel is configured.
10164    pub region: std::string::String,
10165
10166    /// Type of the routing policy.
10167    pub routing_type: crate::model::vpn_tunnel_info::RoutingType,
10168
10169    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10170}
10171
10172impl VpnTunnelInfo {
10173    /// Creates a new default instance.
10174    pub fn new() -> Self {
10175        std::default::Default::default()
10176    }
10177
10178    /// Sets the value of [display_name][crate::model::VpnTunnelInfo::display_name].
10179    ///
10180    /// # Example
10181    /// ```ignore,no_run
10182    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10183    /// let x = VpnTunnelInfo::new().set_display_name("example");
10184    /// ```
10185    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10186        self.display_name = v.into();
10187        self
10188    }
10189
10190    /// Sets the value of [uri][crate::model::VpnTunnelInfo::uri].
10191    ///
10192    /// # Example
10193    /// ```ignore,no_run
10194    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10195    /// let x = VpnTunnelInfo::new().set_uri("example");
10196    /// ```
10197    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10198        self.uri = v.into();
10199        self
10200    }
10201
10202    /// Sets the value of [source_gateway][crate::model::VpnTunnelInfo::source_gateway].
10203    ///
10204    /// # Example
10205    /// ```ignore,no_run
10206    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10207    /// let x = VpnTunnelInfo::new().set_source_gateway("example");
10208    /// ```
10209    pub fn set_source_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10210        self.source_gateway = v.into();
10211        self
10212    }
10213
10214    /// Sets the value of [remote_gateway][crate::model::VpnTunnelInfo::remote_gateway].
10215    ///
10216    /// # Example
10217    /// ```ignore,no_run
10218    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10219    /// let x = VpnTunnelInfo::new().set_remote_gateway("example");
10220    /// ```
10221    pub fn set_remote_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10222        self.remote_gateway = v.into();
10223        self
10224    }
10225
10226    /// Sets the value of [remote_gateway_ip][crate::model::VpnTunnelInfo::remote_gateway_ip].
10227    ///
10228    /// # Example
10229    /// ```ignore,no_run
10230    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10231    /// let x = VpnTunnelInfo::new().set_remote_gateway_ip("example");
10232    /// ```
10233    pub fn set_remote_gateway_ip<T: std::convert::Into<std::string::String>>(
10234        mut self,
10235        v: T,
10236    ) -> Self {
10237        self.remote_gateway_ip = v.into();
10238        self
10239    }
10240
10241    /// Sets the value of [source_gateway_ip][crate::model::VpnTunnelInfo::source_gateway_ip].
10242    ///
10243    /// # Example
10244    /// ```ignore,no_run
10245    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10246    /// let x = VpnTunnelInfo::new().set_source_gateway_ip("example");
10247    /// ```
10248    pub fn set_source_gateway_ip<T: std::convert::Into<std::string::String>>(
10249        mut self,
10250        v: T,
10251    ) -> Self {
10252        self.source_gateway_ip = v.into();
10253        self
10254    }
10255
10256    /// Sets the value of [network_uri][crate::model::VpnTunnelInfo::network_uri].
10257    ///
10258    /// # Example
10259    /// ```ignore,no_run
10260    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10261    /// let x = VpnTunnelInfo::new().set_network_uri("example");
10262    /// ```
10263    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10264        self.network_uri = v.into();
10265        self
10266    }
10267
10268    /// Sets the value of [region][crate::model::VpnTunnelInfo::region].
10269    ///
10270    /// # Example
10271    /// ```ignore,no_run
10272    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10273    /// let x = VpnTunnelInfo::new().set_region("example");
10274    /// ```
10275    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10276        self.region = v.into();
10277        self
10278    }
10279
10280    /// Sets the value of [routing_type][crate::model::VpnTunnelInfo::routing_type].
10281    ///
10282    /// # Example
10283    /// ```ignore,no_run
10284    /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10285    /// use google_cloud_networkmanagement_v1::model::vpn_tunnel_info::RoutingType;
10286    /// let x0 = VpnTunnelInfo::new().set_routing_type(RoutingType::RouteBased);
10287    /// let x1 = VpnTunnelInfo::new().set_routing_type(RoutingType::PolicyBased);
10288    /// let x2 = VpnTunnelInfo::new().set_routing_type(RoutingType::Dynamic);
10289    /// ```
10290    pub fn set_routing_type<T: std::convert::Into<crate::model::vpn_tunnel_info::RoutingType>>(
10291        mut self,
10292        v: T,
10293    ) -> Self {
10294        self.routing_type = v.into();
10295        self
10296    }
10297}
10298
10299impl wkt::message::Message for VpnTunnelInfo {
10300    fn typename() -> &'static str {
10301        "type.googleapis.com/google.cloud.networkmanagement.v1.VpnTunnelInfo"
10302    }
10303}
10304
10305/// Defines additional types related to [VpnTunnelInfo].
10306pub mod vpn_tunnel_info {
10307    #[allow(unused_imports)]
10308    use super::*;
10309
10310    /// Types of VPN routing policy. For details, refer to [Networks and Tunnel
10311    /// routing](https://cloud.google.com/network-connectivity/docs/vpn/concepts/choosing-networks-routing/).
10312    ///
10313    /// # Working with unknown values
10314    ///
10315    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10316    /// additional enum variants at any time. Adding new variants is not considered
10317    /// a breaking change. Applications should write their code in anticipation of:
10318    ///
10319    /// - New values appearing in future releases of the client library, **and**
10320    /// - New values received dynamically, without application changes.
10321    ///
10322    /// Please consult the [Working with enums] section in the user guide for some
10323    /// guidelines.
10324    ///
10325    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10326    #[derive(Clone, Debug, PartialEq)]
10327    #[non_exhaustive]
10328    pub enum RoutingType {
10329        /// Unspecified type. Default value.
10330        Unspecified,
10331        /// Route based VPN.
10332        RouteBased,
10333        /// Policy based routing.
10334        PolicyBased,
10335        /// Dynamic (BGP) routing.
10336        Dynamic,
10337        /// If set, the enum was initialized with an unknown value.
10338        ///
10339        /// Applications can examine the value using [RoutingType::value] or
10340        /// [RoutingType::name].
10341        UnknownValue(routing_type::UnknownValue),
10342    }
10343
10344    #[doc(hidden)]
10345    pub mod routing_type {
10346        #[allow(unused_imports)]
10347        use super::*;
10348        #[derive(Clone, Debug, PartialEq)]
10349        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10350    }
10351
10352    impl RoutingType {
10353        /// Gets the enum value.
10354        ///
10355        /// Returns `None` if the enum contains an unknown value deserialized from
10356        /// the string representation of enums.
10357        pub fn value(&self) -> std::option::Option<i32> {
10358            match self {
10359                Self::Unspecified => std::option::Option::Some(0),
10360                Self::RouteBased => std::option::Option::Some(1),
10361                Self::PolicyBased => std::option::Option::Some(2),
10362                Self::Dynamic => std::option::Option::Some(3),
10363                Self::UnknownValue(u) => u.0.value(),
10364            }
10365        }
10366
10367        /// Gets the enum value as a string.
10368        ///
10369        /// Returns `None` if the enum contains an unknown value deserialized from
10370        /// the integer representation of enums.
10371        pub fn name(&self) -> std::option::Option<&str> {
10372            match self {
10373                Self::Unspecified => std::option::Option::Some("ROUTING_TYPE_UNSPECIFIED"),
10374                Self::RouteBased => std::option::Option::Some("ROUTE_BASED"),
10375                Self::PolicyBased => std::option::Option::Some("POLICY_BASED"),
10376                Self::Dynamic => std::option::Option::Some("DYNAMIC"),
10377                Self::UnknownValue(u) => u.0.name(),
10378            }
10379        }
10380    }
10381
10382    impl std::default::Default for RoutingType {
10383        fn default() -> Self {
10384            use std::convert::From;
10385            Self::from(0)
10386        }
10387    }
10388
10389    impl std::fmt::Display for RoutingType {
10390        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10391            wkt::internal::display_enum(f, self.name(), self.value())
10392        }
10393    }
10394
10395    impl std::convert::From<i32> for RoutingType {
10396        fn from(value: i32) -> Self {
10397            match value {
10398                0 => Self::Unspecified,
10399                1 => Self::RouteBased,
10400                2 => Self::PolicyBased,
10401                3 => Self::Dynamic,
10402                _ => Self::UnknownValue(routing_type::UnknownValue(
10403                    wkt::internal::UnknownEnumValue::Integer(value),
10404                )),
10405            }
10406        }
10407    }
10408
10409    impl std::convert::From<&str> for RoutingType {
10410        fn from(value: &str) -> Self {
10411            use std::string::ToString;
10412            match value {
10413                "ROUTING_TYPE_UNSPECIFIED" => Self::Unspecified,
10414                "ROUTE_BASED" => Self::RouteBased,
10415                "POLICY_BASED" => Self::PolicyBased,
10416                "DYNAMIC" => Self::Dynamic,
10417                _ => Self::UnknownValue(routing_type::UnknownValue(
10418                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10419                )),
10420            }
10421        }
10422    }
10423
10424    impl serde::ser::Serialize for RoutingType {
10425        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10426        where
10427            S: serde::Serializer,
10428        {
10429            match self {
10430                Self::Unspecified => serializer.serialize_i32(0),
10431                Self::RouteBased => serializer.serialize_i32(1),
10432                Self::PolicyBased => serializer.serialize_i32(2),
10433                Self::Dynamic => serializer.serialize_i32(3),
10434                Self::UnknownValue(u) => u.0.serialize(serializer),
10435            }
10436        }
10437    }
10438
10439    impl<'de> serde::de::Deserialize<'de> for RoutingType {
10440        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10441        where
10442            D: serde::Deserializer<'de>,
10443        {
10444            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutingType>::new(
10445                ".google.cloud.networkmanagement.v1.VpnTunnelInfo.RoutingType",
10446            ))
10447        }
10448    }
10449}
10450
10451/// For display only. Metadata associated with an Interconnect attachment.
10452#[derive(Clone, Default, PartialEq)]
10453#[non_exhaustive]
10454pub struct InterconnectAttachmentInfo {
10455    /// Name of an Interconnect attachment.
10456    pub display_name: std::string::String,
10457
10458    /// URI of an Interconnect attachment.
10459    pub uri: std::string::String,
10460
10461    /// URI of the Interconnect where the Interconnect attachment is
10462    /// configured.
10463    pub interconnect_uri: std::string::String,
10464
10465    /// Name of a Google Cloud region where the Interconnect attachment is
10466    /// configured.
10467    pub region: std::string::String,
10468
10469    /// URI of the Cloud Router to be used for dynamic routing.
10470    pub cloud_router_uri: std::string::String,
10471
10472    /// The type of interconnect attachment this is.
10473    pub r#type: crate::model::interconnect_attachment_info::Type,
10474
10475    /// Appliance IP address that was matched for L2_DEDICATED attachments.
10476    pub l2_attachment_matched_ip_address: std::string::String,
10477
10478    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10479}
10480
10481impl InterconnectAttachmentInfo {
10482    /// Creates a new default instance.
10483    pub fn new() -> Self {
10484        std::default::Default::default()
10485    }
10486
10487    /// Sets the value of [display_name][crate::model::InterconnectAttachmentInfo::display_name].
10488    ///
10489    /// # Example
10490    /// ```ignore,no_run
10491    /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10492    /// let x = InterconnectAttachmentInfo::new().set_display_name("example");
10493    /// ```
10494    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10495        self.display_name = v.into();
10496        self
10497    }
10498
10499    /// Sets the value of [uri][crate::model::InterconnectAttachmentInfo::uri].
10500    ///
10501    /// # Example
10502    /// ```ignore,no_run
10503    /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10504    /// let x = InterconnectAttachmentInfo::new().set_uri("example");
10505    /// ```
10506    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10507        self.uri = v.into();
10508        self
10509    }
10510
10511    /// Sets the value of [interconnect_uri][crate::model::InterconnectAttachmentInfo::interconnect_uri].
10512    ///
10513    /// # Example
10514    /// ```ignore,no_run
10515    /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10516    /// let x = InterconnectAttachmentInfo::new().set_interconnect_uri("example");
10517    /// ```
10518    pub fn set_interconnect_uri<T: std::convert::Into<std::string::String>>(
10519        mut self,
10520        v: T,
10521    ) -> Self {
10522        self.interconnect_uri = v.into();
10523        self
10524    }
10525
10526    /// Sets the value of [region][crate::model::InterconnectAttachmentInfo::region].
10527    ///
10528    /// # Example
10529    /// ```ignore,no_run
10530    /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10531    /// let x = InterconnectAttachmentInfo::new().set_region("example");
10532    /// ```
10533    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10534        self.region = v.into();
10535        self
10536    }
10537
10538    /// Sets the value of [cloud_router_uri][crate::model::InterconnectAttachmentInfo::cloud_router_uri].
10539    ///
10540    /// # Example
10541    /// ```ignore,no_run
10542    /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10543    /// let x = InterconnectAttachmentInfo::new().set_cloud_router_uri("example");
10544    /// ```
10545    pub fn set_cloud_router_uri<T: std::convert::Into<std::string::String>>(
10546        mut self,
10547        v: T,
10548    ) -> Self {
10549        self.cloud_router_uri = v.into();
10550        self
10551    }
10552
10553    /// Sets the value of [r#type][crate::model::InterconnectAttachmentInfo::type].
10554    ///
10555    /// # Example
10556    /// ```ignore,no_run
10557    /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10558    /// use google_cloud_networkmanagement_v1::model::interconnect_attachment_info::Type;
10559    /// let x0 = InterconnectAttachmentInfo::new().set_type(Type::Dedicated);
10560    /// let x1 = InterconnectAttachmentInfo::new().set_type(Type::Partner);
10561    /// let x2 = InterconnectAttachmentInfo::new().set_type(Type::PartnerProvider);
10562    /// ```
10563    pub fn set_type<T: std::convert::Into<crate::model::interconnect_attachment_info::Type>>(
10564        mut self,
10565        v: T,
10566    ) -> Self {
10567        self.r#type = v.into();
10568        self
10569    }
10570
10571    /// Sets the value of [l2_attachment_matched_ip_address][crate::model::InterconnectAttachmentInfo::l2_attachment_matched_ip_address].
10572    ///
10573    /// # Example
10574    /// ```ignore,no_run
10575    /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10576    /// let x = InterconnectAttachmentInfo::new().set_l2_attachment_matched_ip_address("example");
10577    /// ```
10578    pub fn set_l2_attachment_matched_ip_address<T: std::convert::Into<std::string::String>>(
10579        mut self,
10580        v: T,
10581    ) -> Self {
10582        self.l2_attachment_matched_ip_address = v.into();
10583        self
10584    }
10585}
10586
10587impl wkt::message::Message for InterconnectAttachmentInfo {
10588    fn typename() -> &'static str {
10589        "type.googleapis.com/google.cloud.networkmanagement.v1.InterconnectAttachmentInfo"
10590    }
10591}
10592
10593/// Defines additional types related to [InterconnectAttachmentInfo].
10594pub mod interconnect_attachment_info {
10595    #[allow(unused_imports)]
10596    use super::*;
10597
10598    /// What type of interconnect attachment this is.
10599    ///
10600    /// # Working with unknown values
10601    ///
10602    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10603    /// additional enum variants at any time. Adding new variants is not considered
10604    /// a breaking change. Applications should write their code in anticipation of:
10605    ///
10606    /// - New values appearing in future releases of the client library, **and**
10607    /// - New values received dynamically, without application changes.
10608    ///
10609    /// Please consult the [Working with enums] section in the user guide for some
10610    /// guidelines.
10611    ///
10612    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10613    #[derive(Clone, Debug, PartialEq)]
10614    #[non_exhaustive]
10615    pub enum Type {
10616        /// Unspecified type.
10617        Unspecified,
10618        /// Attachment to a dedicated interconnect.
10619        Dedicated,
10620        /// Attachment to a partner interconnect, created by the customer.
10621        Partner,
10622        /// Attachment to a partner interconnect, created by the partner.
10623        PartnerProvider,
10624        /// Attachment to a L2 interconnect, created by the customer.
10625        L2Dedicated,
10626        /// If set, the enum was initialized with an unknown value.
10627        ///
10628        /// Applications can examine the value using [Type::value] or
10629        /// [Type::name].
10630        UnknownValue(r#type::UnknownValue),
10631    }
10632
10633    #[doc(hidden)]
10634    pub mod r#type {
10635        #[allow(unused_imports)]
10636        use super::*;
10637        #[derive(Clone, Debug, PartialEq)]
10638        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10639    }
10640
10641    impl Type {
10642        /// Gets the enum value.
10643        ///
10644        /// Returns `None` if the enum contains an unknown value deserialized from
10645        /// the string representation of enums.
10646        pub fn value(&self) -> std::option::Option<i32> {
10647            match self {
10648                Self::Unspecified => std::option::Option::Some(0),
10649                Self::Dedicated => std::option::Option::Some(1),
10650                Self::Partner => std::option::Option::Some(2),
10651                Self::PartnerProvider => std::option::Option::Some(3),
10652                Self::L2Dedicated => std::option::Option::Some(4),
10653                Self::UnknownValue(u) => u.0.value(),
10654            }
10655        }
10656
10657        /// Gets the enum value as a string.
10658        ///
10659        /// Returns `None` if the enum contains an unknown value deserialized from
10660        /// the integer representation of enums.
10661        pub fn name(&self) -> std::option::Option<&str> {
10662            match self {
10663                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
10664                Self::Dedicated => std::option::Option::Some("DEDICATED"),
10665                Self::Partner => std::option::Option::Some("PARTNER"),
10666                Self::PartnerProvider => std::option::Option::Some("PARTNER_PROVIDER"),
10667                Self::L2Dedicated => std::option::Option::Some("L2_DEDICATED"),
10668                Self::UnknownValue(u) => u.0.name(),
10669            }
10670        }
10671    }
10672
10673    impl std::default::Default for Type {
10674        fn default() -> Self {
10675            use std::convert::From;
10676            Self::from(0)
10677        }
10678    }
10679
10680    impl std::fmt::Display for Type {
10681        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10682            wkt::internal::display_enum(f, self.name(), self.value())
10683        }
10684    }
10685
10686    impl std::convert::From<i32> for Type {
10687        fn from(value: i32) -> Self {
10688            match value {
10689                0 => Self::Unspecified,
10690                1 => Self::Dedicated,
10691                2 => Self::Partner,
10692                3 => Self::PartnerProvider,
10693                4 => Self::L2Dedicated,
10694                _ => Self::UnknownValue(r#type::UnknownValue(
10695                    wkt::internal::UnknownEnumValue::Integer(value),
10696                )),
10697            }
10698        }
10699    }
10700
10701    impl std::convert::From<&str> for Type {
10702        fn from(value: &str) -> Self {
10703            use std::string::ToString;
10704            match value {
10705                "TYPE_UNSPECIFIED" => Self::Unspecified,
10706                "DEDICATED" => Self::Dedicated,
10707                "PARTNER" => Self::Partner,
10708                "PARTNER_PROVIDER" => Self::PartnerProvider,
10709                "L2_DEDICATED" => Self::L2Dedicated,
10710                _ => Self::UnknownValue(r#type::UnknownValue(
10711                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10712                )),
10713            }
10714        }
10715    }
10716
10717    impl serde::ser::Serialize for Type {
10718        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10719        where
10720            S: serde::Serializer,
10721        {
10722            match self {
10723                Self::Unspecified => serializer.serialize_i32(0),
10724                Self::Dedicated => serializer.serialize_i32(1),
10725                Self::Partner => serializer.serialize_i32(2),
10726                Self::PartnerProvider => serializer.serialize_i32(3),
10727                Self::L2Dedicated => serializer.serialize_i32(4),
10728                Self::UnknownValue(u) => u.0.serialize(serializer),
10729            }
10730        }
10731    }
10732
10733    impl<'de> serde::de::Deserialize<'de> for Type {
10734        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10735        where
10736            D: serde::Deserializer<'de>,
10737        {
10738            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
10739                ".google.cloud.networkmanagement.v1.InterconnectAttachmentInfo.Type",
10740            ))
10741        }
10742    }
10743}
10744
10745/// For display only. The specification of the endpoints for the test.
10746/// EndpointInfo is derived from source and destination Endpoint and validated
10747/// by the backend data plane model.
10748#[derive(Clone, Default, PartialEq)]
10749#[non_exhaustive]
10750pub struct EndpointInfo {
10751    /// Source IP address.
10752    pub source_ip: std::string::String,
10753
10754    /// Destination IP address.
10755    pub destination_ip: std::string::String,
10756
10757    /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
10758    pub protocol: std::string::String,
10759
10760    /// Source port. Only valid when protocol is TCP or UDP.
10761    pub source_port: i32,
10762
10763    /// Destination port. Only valid when protocol is TCP or UDP.
10764    pub destination_port: i32,
10765
10766    /// URI of the network where this packet originates from.
10767    pub source_network_uri: std::string::String,
10768
10769    /// URI of the network where this packet is sent to.
10770    pub destination_network_uri: std::string::String,
10771
10772    /// URI of the source telemetry agent this packet originates from.
10773    pub source_agent_uri: std::string::String,
10774
10775    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10776}
10777
10778impl EndpointInfo {
10779    /// Creates a new default instance.
10780    pub fn new() -> Self {
10781        std::default::Default::default()
10782    }
10783
10784    /// Sets the value of [source_ip][crate::model::EndpointInfo::source_ip].
10785    ///
10786    /// # Example
10787    /// ```ignore,no_run
10788    /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10789    /// let x = EndpointInfo::new().set_source_ip("example");
10790    /// ```
10791    pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10792        self.source_ip = v.into();
10793        self
10794    }
10795
10796    /// Sets the value of [destination_ip][crate::model::EndpointInfo::destination_ip].
10797    ///
10798    /// # Example
10799    /// ```ignore,no_run
10800    /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10801    /// let x = EndpointInfo::new().set_destination_ip("example");
10802    /// ```
10803    pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10804        self.destination_ip = v.into();
10805        self
10806    }
10807
10808    /// Sets the value of [protocol][crate::model::EndpointInfo::protocol].
10809    ///
10810    /// # Example
10811    /// ```ignore,no_run
10812    /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10813    /// let x = EndpointInfo::new().set_protocol("example");
10814    /// ```
10815    pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10816        self.protocol = v.into();
10817        self
10818    }
10819
10820    /// Sets the value of [source_port][crate::model::EndpointInfo::source_port].
10821    ///
10822    /// # Example
10823    /// ```ignore,no_run
10824    /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10825    /// let x = EndpointInfo::new().set_source_port(42);
10826    /// ```
10827    pub fn set_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10828        self.source_port = v.into();
10829        self
10830    }
10831
10832    /// Sets the value of [destination_port][crate::model::EndpointInfo::destination_port].
10833    ///
10834    /// # Example
10835    /// ```ignore,no_run
10836    /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10837    /// let x = EndpointInfo::new().set_destination_port(42);
10838    /// ```
10839    pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10840        self.destination_port = v.into();
10841        self
10842    }
10843
10844    /// Sets the value of [source_network_uri][crate::model::EndpointInfo::source_network_uri].
10845    ///
10846    /// # Example
10847    /// ```ignore,no_run
10848    /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10849    /// let x = EndpointInfo::new().set_source_network_uri("example");
10850    /// ```
10851    pub fn set_source_network_uri<T: std::convert::Into<std::string::String>>(
10852        mut self,
10853        v: T,
10854    ) -> Self {
10855        self.source_network_uri = v.into();
10856        self
10857    }
10858
10859    /// Sets the value of [destination_network_uri][crate::model::EndpointInfo::destination_network_uri].
10860    ///
10861    /// # Example
10862    /// ```ignore,no_run
10863    /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10864    /// let x = EndpointInfo::new().set_destination_network_uri("example");
10865    /// ```
10866    pub fn set_destination_network_uri<T: std::convert::Into<std::string::String>>(
10867        mut self,
10868        v: T,
10869    ) -> Self {
10870        self.destination_network_uri = v.into();
10871        self
10872    }
10873
10874    /// Sets the value of [source_agent_uri][crate::model::EndpointInfo::source_agent_uri].
10875    ///
10876    /// # Example
10877    /// ```ignore,no_run
10878    /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10879    /// let x = EndpointInfo::new().set_source_agent_uri("example");
10880    /// ```
10881    pub fn set_source_agent_uri<T: std::convert::Into<std::string::String>>(
10882        mut self,
10883        v: T,
10884    ) -> Self {
10885        self.source_agent_uri = v.into();
10886        self
10887    }
10888}
10889
10890impl wkt::message::Message for EndpointInfo {
10891    fn typename() -> &'static str {
10892        "type.googleapis.com/google.cloud.networkmanagement.v1.EndpointInfo"
10893    }
10894}
10895
10896/// Details of the final state "deliver" and associated resource.
10897#[derive(Clone, Default, PartialEq)]
10898#[non_exhaustive]
10899pub struct DeliverInfo {
10900    /// Target type where the packet is delivered to.
10901    pub target: crate::model::deliver_info::Target,
10902
10903    /// URI of the resource that the packet is delivered to.
10904    pub resource_uri: std::string::String,
10905
10906    /// IP address of the target (if applicable).
10907    pub ip_address: std::string::String,
10908
10909    /// Name of the Cloud Storage Bucket the packet is delivered to (if
10910    /// applicable).
10911    pub storage_bucket: std::string::String,
10912
10913    /// PSC Google API target the packet is delivered to (if applicable).
10914    pub psc_google_api_target: std::string::String,
10915
10916    /// Recognized type of a Google Service the packet is delivered to (if
10917    /// applicable).
10918    pub google_service_type: crate::model::deliver_info::GoogleServiceType,
10919
10920    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10921}
10922
10923impl DeliverInfo {
10924    /// Creates a new default instance.
10925    pub fn new() -> Self {
10926        std::default::Default::default()
10927    }
10928
10929    /// Sets the value of [target][crate::model::DeliverInfo::target].
10930    ///
10931    /// # Example
10932    /// ```ignore,no_run
10933    /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10934    /// use google_cloud_networkmanagement_v1::model::deliver_info::Target;
10935    /// let x0 = DeliverInfo::new().set_target(Target::Instance);
10936    /// let x1 = DeliverInfo::new().set_target(Target::Internet);
10937    /// let x2 = DeliverInfo::new().set_target(Target::GoogleApi);
10938    /// ```
10939    pub fn set_target<T: std::convert::Into<crate::model::deliver_info::Target>>(
10940        mut self,
10941        v: T,
10942    ) -> Self {
10943        self.target = v.into();
10944        self
10945    }
10946
10947    /// Sets the value of [resource_uri][crate::model::DeliverInfo::resource_uri].
10948    ///
10949    /// # Example
10950    /// ```ignore,no_run
10951    /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10952    /// let x = DeliverInfo::new().set_resource_uri("example");
10953    /// ```
10954    pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10955        self.resource_uri = v.into();
10956        self
10957    }
10958
10959    /// Sets the value of [ip_address][crate::model::DeliverInfo::ip_address].
10960    ///
10961    /// # Example
10962    /// ```ignore,no_run
10963    /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10964    /// let x = DeliverInfo::new().set_ip_address("example");
10965    /// ```
10966    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10967        self.ip_address = v.into();
10968        self
10969    }
10970
10971    /// Sets the value of [storage_bucket][crate::model::DeliverInfo::storage_bucket].
10972    ///
10973    /// # Example
10974    /// ```ignore,no_run
10975    /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10976    /// let x = DeliverInfo::new().set_storage_bucket("example");
10977    /// ```
10978    pub fn set_storage_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10979        self.storage_bucket = v.into();
10980        self
10981    }
10982
10983    /// Sets the value of [psc_google_api_target][crate::model::DeliverInfo::psc_google_api_target].
10984    ///
10985    /// # Example
10986    /// ```ignore,no_run
10987    /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10988    /// let x = DeliverInfo::new().set_psc_google_api_target("example");
10989    /// ```
10990    pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
10991        mut self,
10992        v: T,
10993    ) -> Self {
10994        self.psc_google_api_target = v.into();
10995        self
10996    }
10997
10998    /// Sets the value of [google_service_type][crate::model::DeliverInfo::google_service_type].
10999    ///
11000    /// # Example
11001    /// ```ignore,no_run
11002    /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
11003    /// use google_cloud_networkmanagement_v1::model::deliver_info::GoogleServiceType;
11004    /// let x0 = DeliverInfo::new().set_google_service_type(GoogleServiceType::Iap);
11005    /// let x1 = DeliverInfo::new().set_google_service_type(GoogleServiceType::GfeProxyOrHealthCheckProber);
11006    /// let x2 = DeliverInfo::new().set_google_service_type(GoogleServiceType::CloudDns);
11007    /// ```
11008    pub fn set_google_service_type<
11009        T: std::convert::Into<crate::model::deliver_info::GoogleServiceType>,
11010    >(
11011        mut self,
11012        v: T,
11013    ) -> Self {
11014        self.google_service_type = v.into();
11015        self
11016    }
11017}
11018
11019impl wkt::message::Message for DeliverInfo {
11020    fn typename() -> &'static str {
11021        "type.googleapis.com/google.cloud.networkmanagement.v1.DeliverInfo"
11022    }
11023}
11024
11025/// Defines additional types related to [DeliverInfo].
11026pub mod deliver_info {
11027    #[allow(unused_imports)]
11028    use super::*;
11029
11030    /// Deliver target types:
11031    ///
11032    /// # Working with unknown values
11033    ///
11034    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11035    /// additional enum variants at any time. Adding new variants is not considered
11036    /// a breaking change. Applications should write their code in anticipation of:
11037    ///
11038    /// - New values appearing in future releases of the client library, **and**
11039    /// - New values received dynamically, without application changes.
11040    ///
11041    /// Please consult the [Working with enums] section in the user guide for some
11042    /// guidelines.
11043    ///
11044    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11045    #[derive(Clone, Debug, PartialEq)]
11046    #[non_exhaustive]
11047    pub enum Target {
11048        /// Target not specified.
11049        Unspecified,
11050        /// Target is a Compute Engine instance.
11051        Instance,
11052        /// Target is the internet.
11053        Internet,
11054        /// Target is a Google API.
11055        GoogleApi,
11056        /// Target is a Google Kubernetes Engine cluster master.
11057        GkeMaster,
11058        /// Target is a Cloud SQL instance.
11059        CloudSqlInstance,
11060        /// Target is a published service that uses [Private Service
11061        /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
11062        PscPublishedService,
11063        /// Target is Google APIs that use [Private Service
11064        /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-apis).
11065        PscGoogleApi,
11066        /// Target is a VPC-SC that uses [Private Service
11067        /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-apis).
11068        PscVpcSc,
11069        /// Target is a serverless network endpoint group.
11070        ServerlessNeg,
11071        /// Target is a Cloud Storage bucket.
11072        StorageBucket,
11073        /// Target is a private network. Used only for return traces.
11074        PrivateNetwork,
11075        /// Target is a Cloud Function. Used only for return traces.
11076        CloudFunction,
11077        /// Target is a App Engine service version. Used only for return traces.
11078        AppEngineVersion,
11079        /// Target is a Cloud Run revision. Used only for return traces.
11080        CloudRunRevision,
11081        /// Target is a Google-managed service. Used only for return traces.
11082        GoogleManagedService,
11083        /// Target is a Redis Instance.
11084        RedisInstance,
11085        /// Target is a Redis Cluster.
11086        RedisCluster,
11087        /// Target is a GKE Pod.
11088        GkePod,
11089        /// If set, the enum was initialized with an unknown value.
11090        ///
11091        /// Applications can examine the value using [Target::value] or
11092        /// [Target::name].
11093        UnknownValue(target::UnknownValue),
11094    }
11095
11096    #[doc(hidden)]
11097    pub mod target {
11098        #[allow(unused_imports)]
11099        use super::*;
11100        #[derive(Clone, Debug, PartialEq)]
11101        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11102    }
11103
11104    impl Target {
11105        /// Gets the enum value.
11106        ///
11107        /// Returns `None` if the enum contains an unknown value deserialized from
11108        /// the string representation of enums.
11109        pub fn value(&self) -> std::option::Option<i32> {
11110            match self {
11111                Self::Unspecified => std::option::Option::Some(0),
11112                Self::Instance => std::option::Option::Some(1),
11113                Self::Internet => std::option::Option::Some(2),
11114                Self::GoogleApi => std::option::Option::Some(3),
11115                Self::GkeMaster => std::option::Option::Some(4),
11116                Self::CloudSqlInstance => std::option::Option::Some(5),
11117                Self::PscPublishedService => std::option::Option::Some(6),
11118                Self::PscGoogleApi => std::option::Option::Some(7),
11119                Self::PscVpcSc => std::option::Option::Some(8),
11120                Self::ServerlessNeg => std::option::Option::Some(9),
11121                Self::StorageBucket => std::option::Option::Some(10),
11122                Self::PrivateNetwork => std::option::Option::Some(11),
11123                Self::CloudFunction => std::option::Option::Some(12),
11124                Self::AppEngineVersion => std::option::Option::Some(13),
11125                Self::CloudRunRevision => std::option::Option::Some(14),
11126                Self::GoogleManagedService => std::option::Option::Some(15),
11127                Self::RedisInstance => std::option::Option::Some(16),
11128                Self::RedisCluster => std::option::Option::Some(17),
11129                Self::GkePod => std::option::Option::Some(19),
11130                Self::UnknownValue(u) => u.0.value(),
11131            }
11132        }
11133
11134        /// Gets the enum value as a string.
11135        ///
11136        /// Returns `None` if the enum contains an unknown value deserialized from
11137        /// the integer representation of enums.
11138        pub fn name(&self) -> std::option::Option<&str> {
11139            match self {
11140                Self::Unspecified => std::option::Option::Some("TARGET_UNSPECIFIED"),
11141                Self::Instance => std::option::Option::Some("INSTANCE"),
11142                Self::Internet => std::option::Option::Some("INTERNET"),
11143                Self::GoogleApi => std::option::Option::Some("GOOGLE_API"),
11144                Self::GkeMaster => std::option::Option::Some("GKE_MASTER"),
11145                Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
11146                Self::PscPublishedService => std::option::Option::Some("PSC_PUBLISHED_SERVICE"),
11147                Self::PscGoogleApi => std::option::Option::Some("PSC_GOOGLE_API"),
11148                Self::PscVpcSc => std::option::Option::Some("PSC_VPC_SC"),
11149                Self::ServerlessNeg => std::option::Option::Some("SERVERLESS_NEG"),
11150                Self::StorageBucket => std::option::Option::Some("STORAGE_BUCKET"),
11151                Self::PrivateNetwork => std::option::Option::Some("PRIVATE_NETWORK"),
11152                Self::CloudFunction => std::option::Option::Some("CLOUD_FUNCTION"),
11153                Self::AppEngineVersion => std::option::Option::Some("APP_ENGINE_VERSION"),
11154                Self::CloudRunRevision => std::option::Option::Some("CLOUD_RUN_REVISION"),
11155                Self::GoogleManagedService => std::option::Option::Some("GOOGLE_MANAGED_SERVICE"),
11156                Self::RedisInstance => std::option::Option::Some("REDIS_INSTANCE"),
11157                Self::RedisCluster => std::option::Option::Some("REDIS_CLUSTER"),
11158                Self::GkePod => std::option::Option::Some("GKE_POD"),
11159                Self::UnknownValue(u) => u.0.name(),
11160            }
11161        }
11162    }
11163
11164    impl std::default::Default for Target {
11165        fn default() -> Self {
11166            use std::convert::From;
11167            Self::from(0)
11168        }
11169    }
11170
11171    impl std::fmt::Display for Target {
11172        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11173            wkt::internal::display_enum(f, self.name(), self.value())
11174        }
11175    }
11176
11177    impl std::convert::From<i32> for Target {
11178        fn from(value: i32) -> Self {
11179            match value {
11180                0 => Self::Unspecified,
11181                1 => Self::Instance,
11182                2 => Self::Internet,
11183                3 => Self::GoogleApi,
11184                4 => Self::GkeMaster,
11185                5 => Self::CloudSqlInstance,
11186                6 => Self::PscPublishedService,
11187                7 => Self::PscGoogleApi,
11188                8 => Self::PscVpcSc,
11189                9 => Self::ServerlessNeg,
11190                10 => Self::StorageBucket,
11191                11 => Self::PrivateNetwork,
11192                12 => Self::CloudFunction,
11193                13 => Self::AppEngineVersion,
11194                14 => Self::CloudRunRevision,
11195                15 => Self::GoogleManagedService,
11196                16 => Self::RedisInstance,
11197                17 => Self::RedisCluster,
11198                19 => Self::GkePod,
11199                _ => Self::UnknownValue(target::UnknownValue(
11200                    wkt::internal::UnknownEnumValue::Integer(value),
11201                )),
11202            }
11203        }
11204    }
11205
11206    impl std::convert::From<&str> for Target {
11207        fn from(value: &str) -> Self {
11208            use std::string::ToString;
11209            match value {
11210                "TARGET_UNSPECIFIED" => Self::Unspecified,
11211                "INSTANCE" => Self::Instance,
11212                "INTERNET" => Self::Internet,
11213                "GOOGLE_API" => Self::GoogleApi,
11214                "GKE_MASTER" => Self::GkeMaster,
11215                "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
11216                "PSC_PUBLISHED_SERVICE" => Self::PscPublishedService,
11217                "PSC_GOOGLE_API" => Self::PscGoogleApi,
11218                "PSC_VPC_SC" => Self::PscVpcSc,
11219                "SERVERLESS_NEG" => Self::ServerlessNeg,
11220                "STORAGE_BUCKET" => Self::StorageBucket,
11221                "PRIVATE_NETWORK" => Self::PrivateNetwork,
11222                "CLOUD_FUNCTION" => Self::CloudFunction,
11223                "APP_ENGINE_VERSION" => Self::AppEngineVersion,
11224                "CLOUD_RUN_REVISION" => Self::CloudRunRevision,
11225                "GOOGLE_MANAGED_SERVICE" => Self::GoogleManagedService,
11226                "REDIS_INSTANCE" => Self::RedisInstance,
11227                "REDIS_CLUSTER" => Self::RedisCluster,
11228                "GKE_POD" => Self::GkePod,
11229                _ => Self::UnknownValue(target::UnknownValue(
11230                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11231                )),
11232            }
11233        }
11234    }
11235
11236    impl serde::ser::Serialize for Target {
11237        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11238        where
11239            S: serde::Serializer,
11240        {
11241            match self {
11242                Self::Unspecified => serializer.serialize_i32(0),
11243                Self::Instance => serializer.serialize_i32(1),
11244                Self::Internet => serializer.serialize_i32(2),
11245                Self::GoogleApi => serializer.serialize_i32(3),
11246                Self::GkeMaster => serializer.serialize_i32(4),
11247                Self::CloudSqlInstance => serializer.serialize_i32(5),
11248                Self::PscPublishedService => serializer.serialize_i32(6),
11249                Self::PscGoogleApi => serializer.serialize_i32(7),
11250                Self::PscVpcSc => serializer.serialize_i32(8),
11251                Self::ServerlessNeg => serializer.serialize_i32(9),
11252                Self::StorageBucket => serializer.serialize_i32(10),
11253                Self::PrivateNetwork => serializer.serialize_i32(11),
11254                Self::CloudFunction => serializer.serialize_i32(12),
11255                Self::AppEngineVersion => serializer.serialize_i32(13),
11256                Self::CloudRunRevision => serializer.serialize_i32(14),
11257                Self::GoogleManagedService => serializer.serialize_i32(15),
11258                Self::RedisInstance => serializer.serialize_i32(16),
11259                Self::RedisCluster => serializer.serialize_i32(17),
11260                Self::GkePod => serializer.serialize_i32(19),
11261                Self::UnknownValue(u) => u.0.serialize(serializer),
11262            }
11263        }
11264    }
11265
11266    impl<'de> serde::de::Deserialize<'de> for Target {
11267        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11268        where
11269            D: serde::Deserializer<'de>,
11270        {
11271            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Target>::new(
11272                ".google.cloud.networkmanagement.v1.DeliverInfo.Target",
11273            ))
11274        }
11275    }
11276
11277    /// Recognized type of a Google Service.
11278    ///
11279    /// # Working with unknown values
11280    ///
11281    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11282    /// additional enum variants at any time. Adding new variants is not considered
11283    /// a breaking change. Applications should write their code in anticipation of:
11284    ///
11285    /// - New values appearing in future releases of the client library, **and**
11286    /// - New values received dynamically, without application changes.
11287    ///
11288    /// Please consult the [Working with enums] section in the user guide for some
11289    /// guidelines.
11290    ///
11291    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11292    #[derive(Clone, Debug, PartialEq)]
11293    #[non_exhaustive]
11294    pub enum GoogleServiceType {
11295        /// Unspecified Google Service.
11296        Unspecified,
11297        /// Identity aware proxy.
11298        /// <https://cloud.google.com/iap/docs/using-tcp-forwarding>
11299        Iap,
11300        /// One of two services sharing IP ranges:
11301        ///
11302        /// * Load Balancer proxy
11303        /// * Centralized Health Check prober
11304        ///   <https://cloud.google.com/load-balancing/docs/firewall-rules>
11305        GfeProxyOrHealthCheckProber,
11306        /// Connectivity from Cloud DNS to forwarding targets or alternate name
11307        /// servers that use private routing.
11308        /// <https://cloud.google.com/dns/docs/zones/forwarding-zones#firewall-rules>
11309        /// <https://cloud.google.com/dns/docs/policies#firewall-rules>
11310        CloudDns,
11311        /// private.googleapis.com and restricted.googleapis.com
11312        PrivateGoogleAccess,
11313        /// Google API via Private Service Connect.
11314        /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
11315        /// Google API via Serverless VPC Access.
11316        /// <https://cloud.google.com/vpc/docs/serverless-vpc-access>
11317        ServerlessVpcAccess,
11318        /// If set, the enum was initialized with an unknown value.
11319        ///
11320        /// Applications can examine the value using [GoogleServiceType::value] or
11321        /// [GoogleServiceType::name].
11322        UnknownValue(google_service_type::UnknownValue),
11323    }
11324
11325    #[doc(hidden)]
11326    pub mod google_service_type {
11327        #[allow(unused_imports)]
11328        use super::*;
11329        #[derive(Clone, Debug, PartialEq)]
11330        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11331    }
11332
11333    impl GoogleServiceType {
11334        /// Gets the enum value.
11335        ///
11336        /// Returns `None` if the enum contains an unknown value deserialized from
11337        /// the string representation of enums.
11338        pub fn value(&self) -> std::option::Option<i32> {
11339            match self {
11340                Self::Unspecified => std::option::Option::Some(0),
11341                Self::Iap => std::option::Option::Some(1),
11342                Self::GfeProxyOrHealthCheckProber => std::option::Option::Some(2),
11343                Self::CloudDns => std::option::Option::Some(3),
11344                Self::PrivateGoogleAccess => std::option::Option::Some(4),
11345                Self::ServerlessVpcAccess => std::option::Option::Some(5),
11346                Self::UnknownValue(u) => u.0.value(),
11347            }
11348        }
11349
11350        /// Gets the enum value as a string.
11351        ///
11352        /// Returns `None` if the enum contains an unknown value deserialized from
11353        /// the integer representation of enums.
11354        pub fn name(&self) -> std::option::Option<&str> {
11355            match self {
11356                Self::Unspecified => std::option::Option::Some("GOOGLE_SERVICE_TYPE_UNSPECIFIED"),
11357                Self::Iap => std::option::Option::Some("IAP"),
11358                Self::GfeProxyOrHealthCheckProber => {
11359                    std::option::Option::Some("GFE_PROXY_OR_HEALTH_CHECK_PROBER")
11360                }
11361                Self::CloudDns => std::option::Option::Some("CLOUD_DNS"),
11362                Self::PrivateGoogleAccess => std::option::Option::Some("PRIVATE_GOOGLE_ACCESS"),
11363                Self::ServerlessVpcAccess => std::option::Option::Some("SERVERLESS_VPC_ACCESS"),
11364                Self::UnknownValue(u) => u.0.name(),
11365            }
11366        }
11367    }
11368
11369    impl std::default::Default for GoogleServiceType {
11370        fn default() -> Self {
11371            use std::convert::From;
11372            Self::from(0)
11373        }
11374    }
11375
11376    impl std::fmt::Display for GoogleServiceType {
11377        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11378            wkt::internal::display_enum(f, self.name(), self.value())
11379        }
11380    }
11381
11382    impl std::convert::From<i32> for GoogleServiceType {
11383        fn from(value: i32) -> Self {
11384            match value {
11385                0 => Self::Unspecified,
11386                1 => Self::Iap,
11387                2 => Self::GfeProxyOrHealthCheckProber,
11388                3 => Self::CloudDns,
11389                4 => Self::PrivateGoogleAccess,
11390                5 => Self::ServerlessVpcAccess,
11391                _ => Self::UnknownValue(google_service_type::UnknownValue(
11392                    wkt::internal::UnknownEnumValue::Integer(value),
11393                )),
11394            }
11395        }
11396    }
11397
11398    impl std::convert::From<&str> for GoogleServiceType {
11399        fn from(value: &str) -> Self {
11400            use std::string::ToString;
11401            match value {
11402                "GOOGLE_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
11403                "IAP" => Self::Iap,
11404                "GFE_PROXY_OR_HEALTH_CHECK_PROBER" => Self::GfeProxyOrHealthCheckProber,
11405                "CLOUD_DNS" => Self::CloudDns,
11406                "PRIVATE_GOOGLE_ACCESS" => Self::PrivateGoogleAccess,
11407                "SERVERLESS_VPC_ACCESS" => Self::ServerlessVpcAccess,
11408                _ => Self::UnknownValue(google_service_type::UnknownValue(
11409                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11410                )),
11411            }
11412        }
11413    }
11414
11415    impl serde::ser::Serialize for GoogleServiceType {
11416        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11417        where
11418            S: serde::Serializer,
11419        {
11420            match self {
11421                Self::Unspecified => serializer.serialize_i32(0),
11422                Self::Iap => serializer.serialize_i32(1),
11423                Self::GfeProxyOrHealthCheckProber => serializer.serialize_i32(2),
11424                Self::CloudDns => serializer.serialize_i32(3),
11425                Self::PrivateGoogleAccess => serializer.serialize_i32(4),
11426                Self::ServerlessVpcAccess => serializer.serialize_i32(5),
11427                Self::UnknownValue(u) => u.0.serialize(serializer),
11428            }
11429        }
11430    }
11431
11432    impl<'de> serde::de::Deserialize<'de> for GoogleServiceType {
11433        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11434        where
11435            D: serde::Deserializer<'de>,
11436        {
11437            deserializer.deserialize_any(wkt::internal::EnumVisitor::<GoogleServiceType>::new(
11438                ".google.cloud.networkmanagement.v1.DeliverInfo.GoogleServiceType",
11439            ))
11440        }
11441    }
11442}
11443
11444/// Details of the final state "forward" and associated resource.
11445#[derive(Clone, Default, PartialEq)]
11446#[non_exhaustive]
11447pub struct ForwardInfo {
11448    /// Target type where this packet is forwarded to.
11449    pub target: crate::model::forward_info::Target,
11450
11451    /// URI of the resource that the packet is forwarded to.
11452    pub resource_uri: std::string::String,
11453
11454    /// IP address of the target (if applicable).
11455    pub ip_address: std::string::String,
11456
11457    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11458}
11459
11460impl ForwardInfo {
11461    /// Creates a new default instance.
11462    pub fn new() -> Self {
11463        std::default::Default::default()
11464    }
11465
11466    /// Sets the value of [target][crate::model::ForwardInfo::target].
11467    ///
11468    /// # Example
11469    /// ```ignore,no_run
11470    /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
11471    /// use google_cloud_networkmanagement_v1::model::forward_info::Target;
11472    /// let x0 = ForwardInfo::new().set_target(Target::PeeringVpc);
11473    /// let x1 = ForwardInfo::new().set_target(Target::VpnGateway);
11474    /// let x2 = ForwardInfo::new().set_target(Target::Interconnect);
11475    /// ```
11476    pub fn set_target<T: std::convert::Into<crate::model::forward_info::Target>>(
11477        mut self,
11478        v: T,
11479    ) -> Self {
11480        self.target = v.into();
11481        self
11482    }
11483
11484    /// Sets the value of [resource_uri][crate::model::ForwardInfo::resource_uri].
11485    ///
11486    /// # Example
11487    /// ```ignore,no_run
11488    /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
11489    /// let x = ForwardInfo::new().set_resource_uri("example");
11490    /// ```
11491    pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11492        self.resource_uri = v.into();
11493        self
11494    }
11495
11496    /// Sets the value of [ip_address][crate::model::ForwardInfo::ip_address].
11497    ///
11498    /// # Example
11499    /// ```ignore,no_run
11500    /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
11501    /// let x = ForwardInfo::new().set_ip_address("example");
11502    /// ```
11503    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11504        self.ip_address = v.into();
11505        self
11506    }
11507}
11508
11509impl wkt::message::Message for ForwardInfo {
11510    fn typename() -> &'static str {
11511        "type.googleapis.com/google.cloud.networkmanagement.v1.ForwardInfo"
11512    }
11513}
11514
11515/// Defines additional types related to [ForwardInfo].
11516pub mod forward_info {
11517    #[allow(unused_imports)]
11518    use super::*;
11519
11520    /// Forward target types.
11521    ///
11522    /// # Working with unknown values
11523    ///
11524    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11525    /// additional enum variants at any time. Adding new variants is not considered
11526    /// a breaking change. Applications should write their code in anticipation of:
11527    ///
11528    /// - New values appearing in future releases of the client library, **and**
11529    /// - New values received dynamically, without application changes.
11530    ///
11531    /// Please consult the [Working with enums] section in the user guide for some
11532    /// guidelines.
11533    ///
11534    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11535    #[derive(Clone, Debug, PartialEq)]
11536    #[non_exhaustive]
11537    pub enum Target {
11538        /// Target not specified.
11539        Unspecified,
11540        /// Forwarded to a VPC peering network.
11541        PeeringVpc,
11542        /// Forwarded to a Cloud VPN gateway.
11543        VpnGateway,
11544        /// Forwarded to a Cloud Interconnect connection.
11545        Interconnect,
11546        /// Forwarded to a Google Kubernetes Engine Container cluster master.
11547        #[deprecated]
11548        GkeMaster,
11549        /// Forwarded to the next hop of a custom route imported from a peering VPC.
11550        ImportedCustomRouteNextHop,
11551        /// Forwarded to a Cloud SQL instance.
11552        #[deprecated]
11553        CloudSqlInstance,
11554        /// Forwarded to a VPC network in another project.
11555        AnotherProject,
11556        /// Forwarded to an NCC Hub.
11557        NccHub,
11558        /// Forwarded to a router appliance.
11559        RouterAppliance,
11560        /// Forwarded to a Secure Web Proxy Gateway.
11561        SecureWebProxyGateway,
11562        /// If set, the enum was initialized with an unknown value.
11563        ///
11564        /// Applications can examine the value using [Target::value] or
11565        /// [Target::name].
11566        UnknownValue(target::UnknownValue),
11567    }
11568
11569    #[doc(hidden)]
11570    pub mod target {
11571        #[allow(unused_imports)]
11572        use super::*;
11573        #[derive(Clone, Debug, PartialEq)]
11574        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11575    }
11576
11577    impl Target {
11578        /// Gets the enum value.
11579        ///
11580        /// Returns `None` if the enum contains an unknown value deserialized from
11581        /// the string representation of enums.
11582        pub fn value(&self) -> std::option::Option<i32> {
11583            match self {
11584                Self::Unspecified => std::option::Option::Some(0),
11585                Self::PeeringVpc => std::option::Option::Some(1),
11586                Self::VpnGateway => std::option::Option::Some(2),
11587                Self::Interconnect => std::option::Option::Some(3),
11588                Self::GkeMaster => std::option::Option::Some(4),
11589                Self::ImportedCustomRouteNextHop => std::option::Option::Some(5),
11590                Self::CloudSqlInstance => std::option::Option::Some(6),
11591                Self::AnotherProject => std::option::Option::Some(7),
11592                Self::NccHub => std::option::Option::Some(8),
11593                Self::RouterAppliance => std::option::Option::Some(9),
11594                Self::SecureWebProxyGateway => std::option::Option::Some(10),
11595                Self::UnknownValue(u) => u.0.value(),
11596            }
11597        }
11598
11599        /// Gets the enum value as a string.
11600        ///
11601        /// Returns `None` if the enum contains an unknown value deserialized from
11602        /// the integer representation of enums.
11603        pub fn name(&self) -> std::option::Option<&str> {
11604            match self {
11605                Self::Unspecified => std::option::Option::Some("TARGET_UNSPECIFIED"),
11606                Self::PeeringVpc => std::option::Option::Some("PEERING_VPC"),
11607                Self::VpnGateway => std::option::Option::Some("VPN_GATEWAY"),
11608                Self::Interconnect => std::option::Option::Some("INTERCONNECT"),
11609                Self::GkeMaster => std::option::Option::Some("GKE_MASTER"),
11610                Self::ImportedCustomRouteNextHop => {
11611                    std::option::Option::Some("IMPORTED_CUSTOM_ROUTE_NEXT_HOP")
11612                }
11613                Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
11614                Self::AnotherProject => std::option::Option::Some("ANOTHER_PROJECT"),
11615                Self::NccHub => std::option::Option::Some("NCC_HUB"),
11616                Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
11617                Self::SecureWebProxyGateway => {
11618                    std::option::Option::Some("SECURE_WEB_PROXY_GATEWAY")
11619                }
11620                Self::UnknownValue(u) => u.0.name(),
11621            }
11622        }
11623    }
11624
11625    impl std::default::Default for Target {
11626        fn default() -> Self {
11627            use std::convert::From;
11628            Self::from(0)
11629        }
11630    }
11631
11632    impl std::fmt::Display for Target {
11633        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11634            wkt::internal::display_enum(f, self.name(), self.value())
11635        }
11636    }
11637
11638    impl std::convert::From<i32> for Target {
11639        fn from(value: i32) -> Self {
11640            match value {
11641                0 => Self::Unspecified,
11642                1 => Self::PeeringVpc,
11643                2 => Self::VpnGateway,
11644                3 => Self::Interconnect,
11645                4 => Self::GkeMaster,
11646                5 => Self::ImportedCustomRouteNextHop,
11647                6 => Self::CloudSqlInstance,
11648                7 => Self::AnotherProject,
11649                8 => Self::NccHub,
11650                9 => Self::RouterAppliance,
11651                10 => Self::SecureWebProxyGateway,
11652                _ => Self::UnknownValue(target::UnknownValue(
11653                    wkt::internal::UnknownEnumValue::Integer(value),
11654                )),
11655            }
11656        }
11657    }
11658
11659    impl std::convert::From<&str> for Target {
11660        fn from(value: &str) -> Self {
11661            use std::string::ToString;
11662            match value {
11663                "TARGET_UNSPECIFIED" => Self::Unspecified,
11664                "PEERING_VPC" => Self::PeeringVpc,
11665                "VPN_GATEWAY" => Self::VpnGateway,
11666                "INTERCONNECT" => Self::Interconnect,
11667                "GKE_MASTER" => Self::GkeMaster,
11668                "IMPORTED_CUSTOM_ROUTE_NEXT_HOP" => Self::ImportedCustomRouteNextHop,
11669                "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
11670                "ANOTHER_PROJECT" => Self::AnotherProject,
11671                "NCC_HUB" => Self::NccHub,
11672                "ROUTER_APPLIANCE" => Self::RouterAppliance,
11673                "SECURE_WEB_PROXY_GATEWAY" => Self::SecureWebProxyGateway,
11674                _ => Self::UnknownValue(target::UnknownValue(
11675                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11676                )),
11677            }
11678        }
11679    }
11680
11681    impl serde::ser::Serialize for Target {
11682        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11683        where
11684            S: serde::Serializer,
11685        {
11686            match self {
11687                Self::Unspecified => serializer.serialize_i32(0),
11688                Self::PeeringVpc => serializer.serialize_i32(1),
11689                Self::VpnGateway => serializer.serialize_i32(2),
11690                Self::Interconnect => serializer.serialize_i32(3),
11691                Self::GkeMaster => serializer.serialize_i32(4),
11692                Self::ImportedCustomRouteNextHop => serializer.serialize_i32(5),
11693                Self::CloudSqlInstance => serializer.serialize_i32(6),
11694                Self::AnotherProject => serializer.serialize_i32(7),
11695                Self::NccHub => serializer.serialize_i32(8),
11696                Self::RouterAppliance => serializer.serialize_i32(9),
11697                Self::SecureWebProxyGateway => serializer.serialize_i32(10),
11698                Self::UnknownValue(u) => u.0.serialize(serializer),
11699            }
11700        }
11701    }
11702
11703    impl<'de> serde::de::Deserialize<'de> for Target {
11704        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11705        where
11706            D: serde::Deserializer<'de>,
11707        {
11708            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Target>::new(
11709                ".google.cloud.networkmanagement.v1.ForwardInfo.Target",
11710            ))
11711        }
11712    }
11713}
11714
11715/// Details of the final state "abort" and associated resource.
11716#[derive(Clone, Default, PartialEq)]
11717#[non_exhaustive]
11718pub struct AbortInfo {
11719    /// Causes that the analysis is aborted.
11720    pub cause: crate::model::abort_info::Cause,
11721
11722    /// URI of the resource that caused the abort.
11723    pub resource_uri: std::string::String,
11724
11725    /// IP address that caused the abort.
11726    pub ip_address: std::string::String,
11727
11728    /// List of project IDs the user specified in the request but lacks access to.
11729    /// In this case, analysis is aborted with the PERMISSION_DENIED cause.
11730    pub projects_missing_permission: std::vec::Vec<std::string::String>,
11731
11732    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11733}
11734
11735impl AbortInfo {
11736    /// Creates a new default instance.
11737    pub fn new() -> Self {
11738        std::default::Default::default()
11739    }
11740
11741    /// Sets the value of [cause][crate::model::AbortInfo::cause].
11742    ///
11743    /// # Example
11744    /// ```ignore,no_run
11745    /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11746    /// use google_cloud_networkmanagement_v1::model::abort_info::Cause;
11747    /// let x0 = AbortInfo::new().set_cause(Cause::UnknownIp);
11748    /// let x1 = AbortInfo::new().set_cause(Cause::GoogleManagedServiceUnknownIp);
11749    /// let x2 = AbortInfo::new().set_cause(Cause::SourceIpAddressNotInSourceNetwork);
11750    /// ```
11751    pub fn set_cause<T: std::convert::Into<crate::model::abort_info::Cause>>(
11752        mut self,
11753        v: T,
11754    ) -> Self {
11755        self.cause = v.into();
11756        self
11757    }
11758
11759    /// Sets the value of [resource_uri][crate::model::AbortInfo::resource_uri].
11760    ///
11761    /// # Example
11762    /// ```ignore,no_run
11763    /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11764    /// let x = AbortInfo::new().set_resource_uri("example");
11765    /// ```
11766    pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11767        self.resource_uri = v.into();
11768        self
11769    }
11770
11771    /// Sets the value of [ip_address][crate::model::AbortInfo::ip_address].
11772    ///
11773    /// # Example
11774    /// ```ignore,no_run
11775    /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11776    /// let x = AbortInfo::new().set_ip_address("example");
11777    /// ```
11778    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11779        self.ip_address = v.into();
11780        self
11781    }
11782
11783    /// Sets the value of [projects_missing_permission][crate::model::AbortInfo::projects_missing_permission].
11784    ///
11785    /// # Example
11786    /// ```ignore,no_run
11787    /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11788    /// let x = AbortInfo::new().set_projects_missing_permission(["a", "b", "c"]);
11789    /// ```
11790    pub fn set_projects_missing_permission<T, V>(mut self, v: T) -> Self
11791    where
11792        T: std::iter::IntoIterator<Item = V>,
11793        V: std::convert::Into<std::string::String>,
11794    {
11795        use std::iter::Iterator;
11796        self.projects_missing_permission = v.into_iter().map(|i| i.into()).collect();
11797        self
11798    }
11799}
11800
11801impl wkt::message::Message for AbortInfo {
11802    fn typename() -> &'static str {
11803        "type.googleapis.com/google.cloud.networkmanagement.v1.AbortInfo"
11804    }
11805}
11806
11807/// Defines additional types related to [AbortInfo].
11808pub mod abort_info {
11809    #[allow(unused_imports)]
11810    use super::*;
11811
11812    /// Abort cause types:
11813    ///
11814    /// # Working with unknown values
11815    ///
11816    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11817    /// additional enum variants at any time. Adding new variants is not considered
11818    /// a breaking change. Applications should write their code in anticipation of:
11819    ///
11820    /// - New values appearing in future releases of the client library, **and**
11821    /// - New values received dynamically, without application changes.
11822    ///
11823    /// Please consult the [Working with enums] section in the user guide for some
11824    /// guidelines.
11825    ///
11826    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11827    #[derive(Clone, Debug, PartialEq)]
11828    #[non_exhaustive]
11829    pub enum Cause {
11830        /// Cause is unspecified.
11831        Unspecified,
11832        /// Aborted due to unknown network. Deprecated, not used in the new tests.
11833        #[deprecated]
11834        UnknownNetwork,
11835        /// Aborted because no project information can be derived from the test
11836        /// input. Deprecated, not used in the new tests.
11837        #[deprecated]
11838        UnknownProject,
11839        /// Aborted because traffic is sent from a public IP to an instance without
11840        /// an external IP. Deprecated, not used in the new tests.
11841        #[deprecated]
11842        NoExternalIp,
11843        /// Aborted because none of the traces matches destination information
11844        /// specified in the input test request. Deprecated, not used in the new
11845        /// tests.
11846        #[deprecated]
11847        UnintendedDestination,
11848        /// Aborted because the source endpoint could not be found. Deprecated, not
11849        /// used in the new tests.
11850        #[deprecated]
11851        SourceEndpointNotFound,
11852        /// Aborted because the source network does not match the source endpoint.
11853        /// Deprecated, not used in the new tests.
11854        #[deprecated]
11855        MismatchedSourceNetwork,
11856        /// Aborted because the destination endpoint could not be found. Deprecated,
11857        /// not used in the new tests.
11858        #[deprecated]
11859        DestinationEndpointNotFound,
11860        /// Aborted because the destination network does not match the destination
11861        /// endpoint. Deprecated, not used in the new tests.
11862        #[deprecated]
11863        MismatchedDestinationNetwork,
11864        /// Aborted because no endpoint with the packet's destination IP address is
11865        /// found.
11866        UnknownIp,
11867        /// Aborted because no endpoint with the packet's destination IP is found in
11868        /// the Google-managed project.
11869        GoogleManagedServiceUnknownIp,
11870        /// Aborted because the source IP address doesn't belong to any of the
11871        /// subnets of the source VPC network.
11872        SourceIpAddressNotInSourceNetwork,
11873        /// Aborted because user lacks permission to access all or part of the
11874        /// network configurations required to run the test.
11875        PermissionDenied,
11876        /// Aborted because user lacks permission to access Cloud NAT configs
11877        /// required to run the test.
11878        PermissionDeniedNoCloudNatConfigs,
11879        /// Aborted because user lacks permission to access Network endpoint group
11880        /// endpoint configs required to run the test.
11881        PermissionDeniedNoNegEndpointConfigs,
11882        /// Aborted because user lacks permission to access Cloud Router configs
11883        /// required to run the test.
11884        PermissionDeniedNoCloudRouterConfigs,
11885        /// Aborted because no valid source or destination endpoint can be derived
11886        /// from the test request.
11887        NoSourceLocation,
11888        /// Aborted because the source IP address is not contained within the subnet
11889        /// ranges of the provided VPC network.
11890        NoSourceGcpNetworkLocation,
11891        /// Aborted because the source IP address is not contained within the
11892        /// destination ranges of the routes towards non-GCP networks in the provided
11893        /// VPC network.
11894        NoSourceNonGcpNetworkLocation,
11895        /// Aborted because the source IP address can't be resolved as an Internet
11896        /// IP address.
11897        NoSourceInternetLocation,
11898        /// Aborted because the source or destination endpoint specified in
11899        /// the request is invalid. Some examples:
11900        ///
11901        /// - The request might contain malformed resource URI, project ID, or IP
11902        ///   address.
11903        /// - The request might contain inconsistent information (for example, the
11904        ///   request might include both the instance and the network, but the instance
11905        ///   might not have a NIC in that network).
11906        InvalidArgument,
11907        /// Aborted because the number of steps in the trace exceeds a certain
11908        /// limit. It might be caused by a routing loop.
11909        TraceTooLong,
11910        /// Aborted due to internal server error.
11911        InternalError,
11912        /// Aborted because the test scenario is not supported.
11913        Unsupported,
11914        /// Aborted because the source and destination resources have no common IP
11915        /// version.
11916        MismatchedIpVersion,
11917        /// Aborted because the connection between the control plane and the node of
11918        /// the source cluster is initiated by the node and managed by the
11919        /// Konnectivity proxy.
11920        GkeKonnectivityProxyUnsupported,
11921        /// Aborted because expected resource configuration was missing.
11922        ResourceConfigNotFound,
11923        /// Aborted because expected VM instance configuration was missing.
11924        VmInstanceConfigNotFound,
11925        /// Aborted because expected network configuration was missing.
11926        NetworkConfigNotFound,
11927        /// Aborted because expected firewall configuration was missing.
11928        FirewallConfigNotFound,
11929        /// Aborted because expected route configuration was missing.
11930        RouteConfigNotFound,
11931        /// Aborted because PSC endpoint selection for the Google-managed service
11932        /// is ambiguous (several PSC endpoints satisfy test input).
11933        GoogleManagedServiceAmbiguousPscEndpoint,
11934        /// Aborted because endpoint selection for the Google-managed service is
11935        /// ambiguous (several endpoints satisfy test input).
11936        GoogleManagedServiceAmbiguousEndpoint,
11937        /// Aborted because tests with a PSC-based Cloud SQL instance as a source are
11938        /// not supported.
11939        SourcePscCloudSqlUnsupported,
11940        /// Aborted because tests with the external database as a source are not
11941        /// supported. In such replication scenarios, the connection is initiated by
11942        /// the Cloud SQL replica instance.
11943        SourceExternalCloudSqlUnsupported,
11944        /// Aborted because tests with a Redis Cluster as a source are not supported.
11945        SourceRedisClusterUnsupported,
11946        /// Aborted because tests with a Redis Instance as a source are not
11947        /// supported.
11948        SourceRedisInstanceUnsupported,
11949        /// Aborted because tests with a forwarding rule as a source are not
11950        /// supported.
11951        SourceForwardingRuleUnsupported,
11952        /// Aborted because one of the endpoints is a non-routable IP address
11953        /// (loopback, link-local, etc).
11954        NonRoutableIpAddress,
11955        /// Aborted due to an unknown issue in the Google-managed project.
11956        UnknownIssueInGoogleManagedProject,
11957        /// Aborted due to an unsupported configuration of the Google-managed
11958        /// project.
11959        UnsupportedGoogleManagedProjectConfig,
11960        /// Aborted because the source endpoint is a Cloud Run revision with direct
11961        /// VPC access enabled, but there are no reserved serverless IP ranges.
11962        NoServerlessIpRanges,
11963        /// Aborted because the used protocol is not supported for the used IP
11964        /// version.
11965        IpVersionProtocolMismatch,
11966        /// Aborted because selected GKE Pod endpoint location is unknown. This is
11967        /// often the case for "Pending" Pods, which don't have assigned IP addresses
11968        /// yet.
11969        GkePodUnknownEndpointLocation,
11970        /// If set, the enum was initialized with an unknown value.
11971        ///
11972        /// Applications can examine the value using [Cause::value] or
11973        /// [Cause::name].
11974        UnknownValue(cause::UnknownValue),
11975    }
11976
11977    #[doc(hidden)]
11978    pub mod cause {
11979        #[allow(unused_imports)]
11980        use super::*;
11981        #[derive(Clone, Debug, PartialEq)]
11982        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11983    }
11984
11985    impl Cause {
11986        /// Gets the enum value.
11987        ///
11988        /// Returns `None` if the enum contains an unknown value deserialized from
11989        /// the string representation of enums.
11990        pub fn value(&self) -> std::option::Option<i32> {
11991            match self {
11992                Self::Unspecified => std::option::Option::Some(0),
11993                Self::UnknownNetwork => std::option::Option::Some(1),
11994                Self::UnknownProject => std::option::Option::Some(3),
11995                Self::NoExternalIp => std::option::Option::Some(7),
11996                Self::UnintendedDestination => std::option::Option::Some(8),
11997                Self::SourceEndpointNotFound => std::option::Option::Some(11),
11998                Self::MismatchedSourceNetwork => std::option::Option::Some(12),
11999                Self::DestinationEndpointNotFound => std::option::Option::Some(13),
12000                Self::MismatchedDestinationNetwork => std::option::Option::Some(14),
12001                Self::UnknownIp => std::option::Option::Some(2),
12002                Self::GoogleManagedServiceUnknownIp => std::option::Option::Some(32),
12003                Self::SourceIpAddressNotInSourceNetwork => std::option::Option::Some(23),
12004                Self::PermissionDenied => std::option::Option::Some(4),
12005                Self::PermissionDeniedNoCloudNatConfigs => std::option::Option::Some(28),
12006                Self::PermissionDeniedNoNegEndpointConfigs => std::option::Option::Some(29),
12007                Self::PermissionDeniedNoCloudRouterConfigs => std::option::Option::Some(36),
12008                Self::NoSourceLocation => std::option::Option::Some(5),
12009                Self::NoSourceGcpNetworkLocation => std::option::Option::Some(42),
12010                Self::NoSourceNonGcpNetworkLocation => std::option::Option::Some(43),
12011                Self::NoSourceInternetLocation => std::option::Option::Some(44),
12012                Self::InvalidArgument => std::option::Option::Some(6),
12013                Self::TraceTooLong => std::option::Option::Some(9),
12014                Self::InternalError => std::option::Option::Some(10),
12015                Self::Unsupported => std::option::Option::Some(15),
12016                Self::MismatchedIpVersion => std::option::Option::Some(16),
12017                Self::GkeKonnectivityProxyUnsupported => std::option::Option::Some(17),
12018                Self::ResourceConfigNotFound => std::option::Option::Some(18),
12019                Self::VmInstanceConfigNotFound => std::option::Option::Some(24),
12020                Self::NetworkConfigNotFound => std::option::Option::Some(25),
12021                Self::FirewallConfigNotFound => std::option::Option::Some(26),
12022                Self::RouteConfigNotFound => std::option::Option::Some(27),
12023                Self::GoogleManagedServiceAmbiguousPscEndpoint => std::option::Option::Some(19),
12024                Self::GoogleManagedServiceAmbiguousEndpoint => std::option::Option::Some(39),
12025                Self::SourcePscCloudSqlUnsupported => std::option::Option::Some(20),
12026                Self::SourceExternalCloudSqlUnsupported => std::option::Option::Some(45),
12027                Self::SourceRedisClusterUnsupported => std::option::Option::Some(34),
12028                Self::SourceRedisInstanceUnsupported => std::option::Option::Some(35),
12029                Self::SourceForwardingRuleUnsupported => std::option::Option::Some(21),
12030                Self::NonRoutableIpAddress => std::option::Option::Some(22),
12031                Self::UnknownIssueInGoogleManagedProject => std::option::Option::Some(30),
12032                Self::UnsupportedGoogleManagedProjectConfig => std::option::Option::Some(31),
12033                Self::NoServerlessIpRanges => std::option::Option::Some(37),
12034                Self::IpVersionProtocolMismatch => std::option::Option::Some(40),
12035                Self::GkePodUnknownEndpointLocation => std::option::Option::Some(41),
12036                Self::UnknownValue(u) => u.0.value(),
12037            }
12038        }
12039
12040        /// Gets the enum value as a string.
12041        ///
12042        /// Returns `None` if the enum contains an unknown value deserialized from
12043        /// the integer representation of enums.
12044        pub fn name(&self) -> std::option::Option<&str> {
12045            match self {
12046                Self::Unspecified => std::option::Option::Some("CAUSE_UNSPECIFIED"),
12047                Self::UnknownNetwork => std::option::Option::Some("UNKNOWN_NETWORK"),
12048                Self::UnknownProject => std::option::Option::Some("UNKNOWN_PROJECT"),
12049                Self::NoExternalIp => std::option::Option::Some("NO_EXTERNAL_IP"),
12050                Self::UnintendedDestination => std::option::Option::Some("UNINTENDED_DESTINATION"),
12051                Self::SourceEndpointNotFound => {
12052                    std::option::Option::Some("SOURCE_ENDPOINT_NOT_FOUND")
12053                }
12054                Self::MismatchedSourceNetwork => {
12055                    std::option::Option::Some("MISMATCHED_SOURCE_NETWORK")
12056                }
12057                Self::DestinationEndpointNotFound => {
12058                    std::option::Option::Some("DESTINATION_ENDPOINT_NOT_FOUND")
12059                }
12060                Self::MismatchedDestinationNetwork => {
12061                    std::option::Option::Some("MISMATCHED_DESTINATION_NETWORK")
12062                }
12063                Self::UnknownIp => std::option::Option::Some("UNKNOWN_IP"),
12064                Self::GoogleManagedServiceUnknownIp => {
12065                    std::option::Option::Some("GOOGLE_MANAGED_SERVICE_UNKNOWN_IP")
12066                }
12067                Self::SourceIpAddressNotInSourceNetwork => {
12068                    std::option::Option::Some("SOURCE_IP_ADDRESS_NOT_IN_SOURCE_NETWORK")
12069                }
12070                Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
12071                Self::PermissionDeniedNoCloudNatConfigs => {
12072                    std::option::Option::Some("PERMISSION_DENIED_NO_CLOUD_NAT_CONFIGS")
12073                }
12074                Self::PermissionDeniedNoNegEndpointConfigs => {
12075                    std::option::Option::Some("PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS")
12076                }
12077                Self::PermissionDeniedNoCloudRouterConfigs => {
12078                    std::option::Option::Some("PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS")
12079                }
12080                Self::NoSourceLocation => std::option::Option::Some("NO_SOURCE_LOCATION"),
12081                Self::NoSourceGcpNetworkLocation => {
12082                    std::option::Option::Some("NO_SOURCE_GCP_NETWORK_LOCATION")
12083                }
12084                Self::NoSourceNonGcpNetworkLocation => {
12085                    std::option::Option::Some("NO_SOURCE_NON_GCP_NETWORK_LOCATION")
12086                }
12087                Self::NoSourceInternetLocation => {
12088                    std::option::Option::Some("NO_SOURCE_INTERNET_LOCATION")
12089                }
12090                Self::InvalidArgument => std::option::Option::Some("INVALID_ARGUMENT"),
12091                Self::TraceTooLong => std::option::Option::Some("TRACE_TOO_LONG"),
12092                Self::InternalError => std::option::Option::Some("INTERNAL_ERROR"),
12093                Self::Unsupported => std::option::Option::Some("UNSUPPORTED"),
12094                Self::MismatchedIpVersion => std::option::Option::Some("MISMATCHED_IP_VERSION"),
12095                Self::GkeKonnectivityProxyUnsupported => {
12096                    std::option::Option::Some("GKE_KONNECTIVITY_PROXY_UNSUPPORTED")
12097                }
12098                Self::ResourceConfigNotFound => {
12099                    std::option::Option::Some("RESOURCE_CONFIG_NOT_FOUND")
12100                }
12101                Self::VmInstanceConfigNotFound => {
12102                    std::option::Option::Some("VM_INSTANCE_CONFIG_NOT_FOUND")
12103                }
12104                Self::NetworkConfigNotFound => {
12105                    std::option::Option::Some("NETWORK_CONFIG_NOT_FOUND")
12106                }
12107                Self::FirewallConfigNotFound => {
12108                    std::option::Option::Some("FIREWALL_CONFIG_NOT_FOUND")
12109                }
12110                Self::RouteConfigNotFound => std::option::Option::Some("ROUTE_CONFIG_NOT_FOUND"),
12111                Self::GoogleManagedServiceAmbiguousPscEndpoint => {
12112                    std::option::Option::Some("GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT")
12113                }
12114                Self::GoogleManagedServiceAmbiguousEndpoint => {
12115                    std::option::Option::Some("GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT")
12116                }
12117                Self::SourcePscCloudSqlUnsupported => {
12118                    std::option::Option::Some("SOURCE_PSC_CLOUD_SQL_UNSUPPORTED")
12119                }
12120                Self::SourceExternalCloudSqlUnsupported => {
12121                    std::option::Option::Some("SOURCE_EXTERNAL_CLOUD_SQL_UNSUPPORTED")
12122                }
12123                Self::SourceRedisClusterUnsupported => {
12124                    std::option::Option::Some("SOURCE_REDIS_CLUSTER_UNSUPPORTED")
12125                }
12126                Self::SourceRedisInstanceUnsupported => {
12127                    std::option::Option::Some("SOURCE_REDIS_INSTANCE_UNSUPPORTED")
12128                }
12129                Self::SourceForwardingRuleUnsupported => {
12130                    std::option::Option::Some("SOURCE_FORWARDING_RULE_UNSUPPORTED")
12131                }
12132                Self::NonRoutableIpAddress => std::option::Option::Some("NON_ROUTABLE_IP_ADDRESS"),
12133                Self::UnknownIssueInGoogleManagedProject => {
12134                    std::option::Option::Some("UNKNOWN_ISSUE_IN_GOOGLE_MANAGED_PROJECT")
12135                }
12136                Self::UnsupportedGoogleManagedProjectConfig => {
12137                    std::option::Option::Some("UNSUPPORTED_GOOGLE_MANAGED_PROJECT_CONFIG")
12138                }
12139                Self::NoServerlessIpRanges => std::option::Option::Some("NO_SERVERLESS_IP_RANGES"),
12140                Self::IpVersionProtocolMismatch => {
12141                    std::option::Option::Some("IP_VERSION_PROTOCOL_MISMATCH")
12142                }
12143                Self::GkePodUnknownEndpointLocation => {
12144                    std::option::Option::Some("GKE_POD_UNKNOWN_ENDPOINT_LOCATION")
12145                }
12146                Self::UnknownValue(u) => u.0.name(),
12147            }
12148        }
12149    }
12150
12151    impl std::default::Default for Cause {
12152        fn default() -> Self {
12153            use std::convert::From;
12154            Self::from(0)
12155        }
12156    }
12157
12158    impl std::fmt::Display for Cause {
12159        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12160            wkt::internal::display_enum(f, self.name(), self.value())
12161        }
12162    }
12163
12164    impl std::convert::From<i32> for Cause {
12165        fn from(value: i32) -> Self {
12166            match value {
12167                0 => Self::Unspecified,
12168                1 => Self::UnknownNetwork,
12169                2 => Self::UnknownIp,
12170                3 => Self::UnknownProject,
12171                4 => Self::PermissionDenied,
12172                5 => Self::NoSourceLocation,
12173                6 => Self::InvalidArgument,
12174                7 => Self::NoExternalIp,
12175                8 => Self::UnintendedDestination,
12176                9 => Self::TraceTooLong,
12177                10 => Self::InternalError,
12178                11 => Self::SourceEndpointNotFound,
12179                12 => Self::MismatchedSourceNetwork,
12180                13 => Self::DestinationEndpointNotFound,
12181                14 => Self::MismatchedDestinationNetwork,
12182                15 => Self::Unsupported,
12183                16 => Self::MismatchedIpVersion,
12184                17 => Self::GkeKonnectivityProxyUnsupported,
12185                18 => Self::ResourceConfigNotFound,
12186                19 => Self::GoogleManagedServiceAmbiguousPscEndpoint,
12187                20 => Self::SourcePscCloudSqlUnsupported,
12188                21 => Self::SourceForwardingRuleUnsupported,
12189                22 => Self::NonRoutableIpAddress,
12190                23 => Self::SourceIpAddressNotInSourceNetwork,
12191                24 => Self::VmInstanceConfigNotFound,
12192                25 => Self::NetworkConfigNotFound,
12193                26 => Self::FirewallConfigNotFound,
12194                27 => Self::RouteConfigNotFound,
12195                28 => Self::PermissionDeniedNoCloudNatConfigs,
12196                29 => Self::PermissionDeniedNoNegEndpointConfigs,
12197                30 => Self::UnknownIssueInGoogleManagedProject,
12198                31 => Self::UnsupportedGoogleManagedProjectConfig,
12199                32 => Self::GoogleManagedServiceUnknownIp,
12200                34 => Self::SourceRedisClusterUnsupported,
12201                35 => Self::SourceRedisInstanceUnsupported,
12202                36 => Self::PermissionDeniedNoCloudRouterConfigs,
12203                37 => Self::NoServerlessIpRanges,
12204                39 => Self::GoogleManagedServiceAmbiguousEndpoint,
12205                40 => Self::IpVersionProtocolMismatch,
12206                41 => Self::GkePodUnknownEndpointLocation,
12207                42 => Self::NoSourceGcpNetworkLocation,
12208                43 => Self::NoSourceNonGcpNetworkLocation,
12209                44 => Self::NoSourceInternetLocation,
12210                45 => Self::SourceExternalCloudSqlUnsupported,
12211                _ => Self::UnknownValue(cause::UnknownValue(
12212                    wkt::internal::UnknownEnumValue::Integer(value),
12213                )),
12214            }
12215        }
12216    }
12217
12218    impl std::convert::From<&str> for Cause {
12219        fn from(value: &str) -> Self {
12220            use std::string::ToString;
12221            match value {
12222                "CAUSE_UNSPECIFIED" => Self::Unspecified,
12223                "UNKNOWN_NETWORK" => Self::UnknownNetwork,
12224                "UNKNOWN_PROJECT" => Self::UnknownProject,
12225                "NO_EXTERNAL_IP" => Self::NoExternalIp,
12226                "UNINTENDED_DESTINATION" => Self::UnintendedDestination,
12227                "SOURCE_ENDPOINT_NOT_FOUND" => Self::SourceEndpointNotFound,
12228                "MISMATCHED_SOURCE_NETWORK" => Self::MismatchedSourceNetwork,
12229                "DESTINATION_ENDPOINT_NOT_FOUND" => Self::DestinationEndpointNotFound,
12230                "MISMATCHED_DESTINATION_NETWORK" => Self::MismatchedDestinationNetwork,
12231                "UNKNOWN_IP" => Self::UnknownIp,
12232                "GOOGLE_MANAGED_SERVICE_UNKNOWN_IP" => Self::GoogleManagedServiceUnknownIp,
12233                "SOURCE_IP_ADDRESS_NOT_IN_SOURCE_NETWORK" => {
12234                    Self::SourceIpAddressNotInSourceNetwork
12235                }
12236                "PERMISSION_DENIED" => Self::PermissionDenied,
12237                "PERMISSION_DENIED_NO_CLOUD_NAT_CONFIGS" => Self::PermissionDeniedNoCloudNatConfigs,
12238                "PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS" => {
12239                    Self::PermissionDeniedNoNegEndpointConfigs
12240                }
12241                "PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS" => {
12242                    Self::PermissionDeniedNoCloudRouterConfigs
12243                }
12244                "NO_SOURCE_LOCATION" => Self::NoSourceLocation,
12245                "NO_SOURCE_GCP_NETWORK_LOCATION" => Self::NoSourceGcpNetworkLocation,
12246                "NO_SOURCE_NON_GCP_NETWORK_LOCATION" => Self::NoSourceNonGcpNetworkLocation,
12247                "NO_SOURCE_INTERNET_LOCATION" => Self::NoSourceInternetLocation,
12248                "INVALID_ARGUMENT" => Self::InvalidArgument,
12249                "TRACE_TOO_LONG" => Self::TraceTooLong,
12250                "INTERNAL_ERROR" => Self::InternalError,
12251                "UNSUPPORTED" => Self::Unsupported,
12252                "MISMATCHED_IP_VERSION" => Self::MismatchedIpVersion,
12253                "GKE_KONNECTIVITY_PROXY_UNSUPPORTED" => Self::GkeKonnectivityProxyUnsupported,
12254                "RESOURCE_CONFIG_NOT_FOUND" => Self::ResourceConfigNotFound,
12255                "VM_INSTANCE_CONFIG_NOT_FOUND" => Self::VmInstanceConfigNotFound,
12256                "NETWORK_CONFIG_NOT_FOUND" => Self::NetworkConfigNotFound,
12257                "FIREWALL_CONFIG_NOT_FOUND" => Self::FirewallConfigNotFound,
12258                "ROUTE_CONFIG_NOT_FOUND" => Self::RouteConfigNotFound,
12259                "GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT" => {
12260                    Self::GoogleManagedServiceAmbiguousPscEndpoint
12261                }
12262                "GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT" => {
12263                    Self::GoogleManagedServiceAmbiguousEndpoint
12264                }
12265                "SOURCE_PSC_CLOUD_SQL_UNSUPPORTED" => Self::SourcePscCloudSqlUnsupported,
12266                "SOURCE_EXTERNAL_CLOUD_SQL_UNSUPPORTED" => Self::SourceExternalCloudSqlUnsupported,
12267                "SOURCE_REDIS_CLUSTER_UNSUPPORTED" => Self::SourceRedisClusterUnsupported,
12268                "SOURCE_REDIS_INSTANCE_UNSUPPORTED" => Self::SourceRedisInstanceUnsupported,
12269                "SOURCE_FORWARDING_RULE_UNSUPPORTED" => Self::SourceForwardingRuleUnsupported,
12270                "NON_ROUTABLE_IP_ADDRESS" => Self::NonRoutableIpAddress,
12271                "UNKNOWN_ISSUE_IN_GOOGLE_MANAGED_PROJECT" => {
12272                    Self::UnknownIssueInGoogleManagedProject
12273                }
12274                "UNSUPPORTED_GOOGLE_MANAGED_PROJECT_CONFIG" => {
12275                    Self::UnsupportedGoogleManagedProjectConfig
12276                }
12277                "NO_SERVERLESS_IP_RANGES" => Self::NoServerlessIpRanges,
12278                "IP_VERSION_PROTOCOL_MISMATCH" => Self::IpVersionProtocolMismatch,
12279                "GKE_POD_UNKNOWN_ENDPOINT_LOCATION" => Self::GkePodUnknownEndpointLocation,
12280                _ => Self::UnknownValue(cause::UnknownValue(
12281                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12282                )),
12283            }
12284        }
12285    }
12286
12287    impl serde::ser::Serialize for Cause {
12288        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12289        where
12290            S: serde::Serializer,
12291        {
12292            match self {
12293                Self::Unspecified => serializer.serialize_i32(0),
12294                Self::UnknownNetwork => serializer.serialize_i32(1),
12295                Self::UnknownProject => serializer.serialize_i32(3),
12296                Self::NoExternalIp => serializer.serialize_i32(7),
12297                Self::UnintendedDestination => serializer.serialize_i32(8),
12298                Self::SourceEndpointNotFound => serializer.serialize_i32(11),
12299                Self::MismatchedSourceNetwork => serializer.serialize_i32(12),
12300                Self::DestinationEndpointNotFound => serializer.serialize_i32(13),
12301                Self::MismatchedDestinationNetwork => serializer.serialize_i32(14),
12302                Self::UnknownIp => serializer.serialize_i32(2),
12303                Self::GoogleManagedServiceUnknownIp => serializer.serialize_i32(32),
12304                Self::SourceIpAddressNotInSourceNetwork => serializer.serialize_i32(23),
12305                Self::PermissionDenied => serializer.serialize_i32(4),
12306                Self::PermissionDeniedNoCloudNatConfigs => serializer.serialize_i32(28),
12307                Self::PermissionDeniedNoNegEndpointConfigs => serializer.serialize_i32(29),
12308                Self::PermissionDeniedNoCloudRouterConfigs => serializer.serialize_i32(36),
12309                Self::NoSourceLocation => serializer.serialize_i32(5),
12310                Self::NoSourceGcpNetworkLocation => serializer.serialize_i32(42),
12311                Self::NoSourceNonGcpNetworkLocation => serializer.serialize_i32(43),
12312                Self::NoSourceInternetLocation => serializer.serialize_i32(44),
12313                Self::InvalidArgument => serializer.serialize_i32(6),
12314                Self::TraceTooLong => serializer.serialize_i32(9),
12315                Self::InternalError => serializer.serialize_i32(10),
12316                Self::Unsupported => serializer.serialize_i32(15),
12317                Self::MismatchedIpVersion => serializer.serialize_i32(16),
12318                Self::GkeKonnectivityProxyUnsupported => serializer.serialize_i32(17),
12319                Self::ResourceConfigNotFound => serializer.serialize_i32(18),
12320                Self::VmInstanceConfigNotFound => serializer.serialize_i32(24),
12321                Self::NetworkConfigNotFound => serializer.serialize_i32(25),
12322                Self::FirewallConfigNotFound => serializer.serialize_i32(26),
12323                Self::RouteConfigNotFound => serializer.serialize_i32(27),
12324                Self::GoogleManagedServiceAmbiguousPscEndpoint => serializer.serialize_i32(19),
12325                Self::GoogleManagedServiceAmbiguousEndpoint => serializer.serialize_i32(39),
12326                Self::SourcePscCloudSqlUnsupported => serializer.serialize_i32(20),
12327                Self::SourceExternalCloudSqlUnsupported => serializer.serialize_i32(45),
12328                Self::SourceRedisClusterUnsupported => serializer.serialize_i32(34),
12329                Self::SourceRedisInstanceUnsupported => serializer.serialize_i32(35),
12330                Self::SourceForwardingRuleUnsupported => serializer.serialize_i32(21),
12331                Self::NonRoutableIpAddress => serializer.serialize_i32(22),
12332                Self::UnknownIssueInGoogleManagedProject => serializer.serialize_i32(30),
12333                Self::UnsupportedGoogleManagedProjectConfig => serializer.serialize_i32(31),
12334                Self::NoServerlessIpRanges => serializer.serialize_i32(37),
12335                Self::IpVersionProtocolMismatch => serializer.serialize_i32(40),
12336                Self::GkePodUnknownEndpointLocation => serializer.serialize_i32(41),
12337                Self::UnknownValue(u) => u.0.serialize(serializer),
12338            }
12339        }
12340    }
12341
12342    impl<'de> serde::de::Deserialize<'de> for Cause {
12343        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12344        where
12345            D: serde::Deserializer<'de>,
12346        {
12347            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Cause>::new(
12348                ".google.cloud.networkmanagement.v1.AbortInfo.Cause",
12349            ))
12350        }
12351    }
12352}
12353
12354/// Details of the final state "drop" and associated resource.
12355#[derive(Clone, Default, PartialEq)]
12356#[non_exhaustive]
12357pub struct DropInfo {
12358    /// Cause that the packet is dropped.
12359    pub cause: crate::model::drop_info::Cause,
12360
12361    /// URI of the resource that caused the drop.
12362    pub resource_uri: std::string::String,
12363
12364    /// Source IP address of the dropped packet (if relevant).
12365    pub source_ip: std::string::String,
12366
12367    /// Destination IP address of the dropped packet (if relevant).
12368    pub destination_ip: std::string::String,
12369
12370    /// Region of the dropped packet (if relevant).
12371    pub region: std::string::String,
12372
12373    /// Geolocation (region code) of the source IP address (if relevant).
12374    pub source_geolocation_code: std::string::String,
12375
12376    /// Geolocation (region code) of the destination IP address (if relevant).
12377    pub destination_geolocation_code: std::string::String,
12378
12379    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12380}
12381
12382impl DropInfo {
12383    /// Creates a new default instance.
12384    pub fn new() -> Self {
12385        std::default::Default::default()
12386    }
12387
12388    /// Sets the value of [cause][crate::model::DropInfo::cause].
12389    ///
12390    /// # Example
12391    /// ```ignore,no_run
12392    /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12393    /// use google_cloud_networkmanagement_v1::model::drop_info::Cause;
12394    /// let x0 = DropInfo::new().set_cause(Cause::UnknownExternalAddress);
12395    /// let x1 = DropInfo::new().set_cause(Cause::ForeignIpDisallowed);
12396    /// let x2 = DropInfo::new().set_cause(Cause::FirewallRule);
12397    /// ```
12398    pub fn set_cause<T: std::convert::Into<crate::model::drop_info::Cause>>(
12399        mut self,
12400        v: T,
12401    ) -> Self {
12402        self.cause = v.into();
12403        self
12404    }
12405
12406    /// Sets the value of [resource_uri][crate::model::DropInfo::resource_uri].
12407    ///
12408    /// # Example
12409    /// ```ignore,no_run
12410    /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12411    /// let x = DropInfo::new().set_resource_uri("example");
12412    /// ```
12413    pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12414        self.resource_uri = v.into();
12415        self
12416    }
12417
12418    /// Sets the value of [source_ip][crate::model::DropInfo::source_ip].
12419    ///
12420    /// # Example
12421    /// ```ignore,no_run
12422    /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12423    /// let x = DropInfo::new().set_source_ip("example");
12424    /// ```
12425    pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12426        self.source_ip = v.into();
12427        self
12428    }
12429
12430    /// Sets the value of [destination_ip][crate::model::DropInfo::destination_ip].
12431    ///
12432    /// # Example
12433    /// ```ignore,no_run
12434    /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12435    /// let x = DropInfo::new().set_destination_ip("example");
12436    /// ```
12437    pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12438        self.destination_ip = v.into();
12439        self
12440    }
12441
12442    /// Sets the value of [region][crate::model::DropInfo::region].
12443    ///
12444    /// # Example
12445    /// ```ignore,no_run
12446    /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12447    /// let x = DropInfo::new().set_region("example");
12448    /// ```
12449    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12450        self.region = v.into();
12451        self
12452    }
12453
12454    /// Sets the value of [source_geolocation_code][crate::model::DropInfo::source_geolocation_code].
12455    ///
12456    /// # Example
12457    /// ```ignore,no_run
12458    /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12459    /// let x = DropInfo::new().set_source_geolocation_code("example");
12460    /// ```
12461    pub fn set_source_geolocation_code<T: std::convert::Into<std::string::String>>(
12462        mut self,
12463        v: T,
12464    ) -> Self {
12465        self.source_geolocation_code = v.into();
12466        self
12467    }
12468
12469    /// Sets the value of [destination_geolocation_code][crate::model::DropInfo::destination_geolocation_code].
12470    ///
12471    /// # Example
12472    /// ```ignore,no_run
12473    /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12474    /// let x = DropInfo::new().set_destination_geolocation_code("example");
12475    /// ```
12476    pub fn set_destination_geolocation_code<T: std::convert::Into<std::string::String>>(
12477        mut self,
12478        v: T,
12479    ) -> Self {
12480        self.destination_geolocation_code = v.into();
12481        self
12482    }
12483}
12484
12485impl wkt::message::Message for DropInfo {
12486    fn typename() -> &'static str {
12487        "type.googleapis.com/google.cloud.networkmanagement.v1.DropInfo"
12488    }
12489}
12490
12491/// Defines additional types related to [DropInfo].
12492pub mod drop_info {
12493    #[allow(unused_imports)]
12494    use super::*;
12495
12496    /// Drop cause types:
12497    ///
12498    /// # Working with unknown values
12499    ///
12500    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12501    /// additional enum variants at any time. Adding new variants is not considered
12502    /// a breaking change. Applications should write their code in anticipation of:
12503    ///
12504    /// - New values appearing in future releases of the client library, **and**
12505    /// - New values received dynamically, without application changes.
12506    ///
12507    /// Please consult the [Working with enums] section in the user guide for some
12508    /// guidelines.
12509    ///
12510    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12511    #[derive(Clone, Debug, PartialEq)]
12512    #[non_exhaustive]
12513    pub enum Cause {
12514        /// Cause is unspecified.
12515        Unspecified,
12516        /// Destination external address cannot be resolved to a known target. If
12517        /// the address is used in a Google Cloud project, provide the project ID
12518        /// as test input.
12519        UnknownExternalAddress,
12520        /// A Compute Engine instance can only send or receive a packet with a
12521        /// foreign IP address if ip_forward is enabled.
12522        ForeignIpDisallowed,
12523        /// Dropped due to a firewall rule, unless allowed due to connection
12524        /// tracking.
12525        FirewallRule,
12526        /// Dropped due to no matching routes.
12527        NoRoute,
12528        /// Dropped due to invalid route. Route's next hop is a blackhole.
12529        RouteBlackhole,
12530        /// Packet is sent to a wrong (unintended) network. Example: you trace a
12531        /// packet from VM1:Network1 to VM2:Network2, however, the route configured
12532        /// in Network1 sends the packet destined for VM2's IP address to Network3.
12533        RouteWrongNetwork,
12534        /// Route's next hop IP address cannot be resolved to a GCP resource.
12535        RouteNextHopIpAddressNotResolved,
12536        /// Route's next hop resource is not found.
12537        RouteNextHopResourceNotFound,
12538        /// Route's next hop instance doesn't have a NIC in the route's network.
12539        RouteNextHopInstanceWrongNetwork,
12540        /// Route's next hop IP address is not a primary IP address of the next hop
12541        /// instance.
12542        RouteNextHopInstanceNonPrimaryIp,
12543        /// Route's next hop forwarding rule doesn't match next hop IP address.
12544        RouteNextHopForwardingRuleIpMismatch,
12545        /// Route's next hop VPN tunnel is down (does not have valid IKE SAs).
12546        RouteNextHopVpnTunnelNotEstablished,
12547        /// Route's next hop forwarding rule type is invalid (it's not a forwarding
12548        /// rule of the internal passthrough load balancer).
12549        RouteNextHopForwardingRuleTypeInvalid,
12550        /// Packet is sent from the Internet to the private IPv6 address.
12551        NoRouteFromInternetToPrivateIpv6Address,
12552        /// Packet is sent from the Internet to the private IPv4 address.
12553        NoRouteFromInternetToPrivateIpv4Address,
12554        /// Packet is sent from the external IPv6 source address of an instance to
12555        /// the private IPv6 address of an instance.
12556        NoRouteFromExternalIpv6SourceToPrivateIpv6Address,
12557        /// The packet does not match a policy-based VPN tunnel local selector.
12558        VpnTunnelLocalSelectorMismatch,
12559        /// The packet does not match a policy-based VPN tunnel remote selector.
12560        VpnTunnelRemoteSelectorMismatch,
12561        /// Packet with internal destination address sent to the internet gateway.
12562        PrivateTrafficToInternet,
12563        /// Endpoint with only an internal IP address tries to access Google API and
12564        /// services, but Private Google Access is not enabled in the subnet or is
12565        /// not applicable.
12566        PrivateGoogleAccessDisallowed,
12567        /// Source endpoint tries to access Google API and services through the VPN
12568        /// tunnel to another network, but Private Google Access needs to be enabled
12569        /// in the source endpoint network.
12570        PrivateGoogleAccessViaVpnTunnelUnsupported,
12571        /// Endpoint with only an internal IP address tries to access external hosts,
12572        /// but there is no matching Cloud NAT gateway in the subnet.
12573        NoExternalAddress,
12574        /// Destination internal address cannot be resolved to a known target. If
12575        /// this is a shared VPC scenario, verify if the service project ID is
12576        /// provided as test input. Otherwise, verify if the IP address is being
12577        /// used in the project.
12578        UnknownInternalAddress,
12579        /// Forwarding rule's protocol and ports do not match the packet header.
12580        ForwardingRuleMismatch,
12581        /// Forwarding rule does not have backends configured.
12582        ForwardingRuleNoInstances,
12583        /// Firewalls block the health check probes to the backends and cause
12584        /// the backends to be unavailable for traffic from the load balancer.
12585        /// For more details, see [Health check firewall
12586        /// rules](https://cloud.google.com/load-balancing/docs/health-checks#firewall_rules).
12587        FirewallBlockingLoadBalancerBackendHealthCheck,
12588        /// Matching ingress firewall rules by network tags for packets sent via
12589        /// serverless VPC direct egress is unsupported. Behavior is undefined.
12590        /// <https://cloud.google.com/run/docs/configuring/vpc-direct-vpc#limitations>
12591        IngressFirewallTagsUnsupportedByDirectVpcEgress,
12592        /// Packet is sent from or to a Compute Engine instance that is not in a
12593        /// running state.
12594        InstanceNotRunning,
12595        /// Packet sent from or to a GKE cluster that is not in running state.
12596        GkeClusterNotRunning,
12597        /// Packet sent from or to a GKE Pod that is not in running state.
12598        GkePodNotRunning,
12599        /// Packet sent from or to a Cloud SQL instance that is not in running state.
12600        CloudSqlInstanceNotRunning,
12601        /// Packet sent from or to a Redis Instance that is not in running state.
12602        RedisInstanceNotRunning,
12603        /// Packet sent from or to a Redis Cluster that is not in running state.
12604        RedisClusterNotRunning,
12605        /// The type of traffic is blocked and the user cannot configure a firewall
12606        /// rule to enable it. See [Always blocked
12607        /// traffic](https://cloud.google.com/vpc/docs/firewalls#blockedtraffic) for
12608        /// more details.
12609        TrafficTypeBlocked,
12610        /// Access to Google Kubernetes Engine cluster master's endpoint is not
12611        /// authorized. See [Access to the cluster
12612        /// endpoints](https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#access_to_the_cluster_endpoints)
12613        /// for more details.
12614        GkeMasterUnauthorizedAccess,
12615        /// Access to the Cloud SQL instance endpoint is not authorized.
12616        /// See [Authorizing with authorized
12617        /// networks](https://cloud.google.com/sql/docs/mysql/authorize-networks) for
12618        /// more details.
12619        CloudSqlInstanceUnauthorizedAccess,
12620        /// Packet was dropped inside Google Kubernetes Engine Service.
12621        DroppedInsideGkeService,
12622        /// Packet was dropped inside Cloud SQL Service.
12623        DroppedInsideCloudSqlService,
12624        /// Packet was dropped because there is no peering between the originating
12625        /// network and the Google Managed Services Network.
12626        GoogleManagedServiceNoPeering,
12627        /// Packet was dropped because the Google-managed service uses Private
12628        /// Service Connect (PSC), but the PSC endpoint is not found in the project.
12629        GoogleManagedServiceNoPscEndpoint,
12630        /// Packet was dropped because the GKE cluster uses Private Service Connect
12631        /// (PSC), but the PSC endpoint is not found in the project.
12632        GkePscEndpointMissing,
12633        /// Packet was dropped because the Cloud SQL instance has neither a private
12634        /// nor a public IP address.
12635        CloudSqlInstanceNoIpAddress,
12636        /// Packet was dropped because a GKE cluster private endpoint is
12637        /// unreachable from a region different from the cluster's region.
12638        GkeControlPlaneRegionMismatch,
12639        /// Packet sent from a public GKE cluster control plane to a private
12640        /// IP address.
12641        PublicGkeControlPlaneToPrivateDestination,
12642        /// Packet was dropped because there is no route from a GKE cluster
12643        /// control plane to a destination network.
12644        GkeControlPlaneNoRoute,
12645        /// Packet sent from a Cloud SQL instance to an external IP address is not
12646        /// allowed. The Cloud SQL instance is not configured to send packets to
12647        /// external IP addresses.
12648        CloudSqlInstanceNotConfiguredForExternalTraffic,
12649        /// Packet sent from a Cloud SQL instance with only a public IP address to a
12650        /// private IP address.
12651        PublicCloudSqlInstanceToPrivateDestination,
12652        /// Packet was dropped because there is no route from a Cloud SQL
12653        /// instance to a destination network.
12654        CloudSqlInstanceNoRoute,
12655        /// Packet was dropped because the Cloud SQL instance requires all
12656        /// connections to use Cloud SQL connectors and to target the Cloud SQL proxy
12657        /// port (3307).
12658        CloudSqlConnectorRequired,
12659        /// Packet could be dropped because the Cloud Function is not in an active
12660        /// status.
12661        CloudFunctionNotActive,
12662        /// Packet could be dropped because no VPC connector is set.
12663        VpcConnectorNotSet,
12664        /// Packet could be dropped because the VPC connector is not in a running
12665        /// state.
12666        VpcConnectorNotRunning,
12667        /// Packet could be dropped because the traffic from the serverless service
12668        /// to the VPC connector is not allowed.
12669        VpcConnectorServerlessTrafficBlocked,
12670        /// Packet could be dropped because the health check traffic to the VPC
12671        /// connector is not allowed.
12672        VpcConnectorHealthCheckTrafficBlocked,
12673        /// Packet could be dropped because it was sent from a different region
12674        /// to a regional forwarding without global access.
12675        ForwardingRuleRegionMismatch,
12676        /// The Private Service Connect endpoint is in a project that is not approved
12677        /// to connect to the service.
12678        PscConnectionNotAccepted,
12679        /// The packet is sent to the Private Service Connect endpoint over the
12680        /// peering, but [it's not
12681        /// supported](https://cloud.google.com/vpc/docs/configure-private-service-connect-services#on-premises).
12682        PscEndpointAccessedFromPeeredNetwork,
12683        /// The packet is sent to the Private Service Connect backend (network
12684        /// endpoint group), but the producer PSC forwarding rule does not have
12685        /// global access enabled.
12686        PscNegProducerEndpointNoGlobalAccess,
12687        /// The packet is sent to the Private Service Connect backend (network
12688        /// endpoint group), but the producer PSC forwarding rule has multiple ports
12689        /// specified.
12690        PscNegProducerForwardingRuleMultiplePorts,
12691        /// The packet is sent to the Private Service Connect backend (network
12692        /// endpoint group) targeting a Cloud SQL service attachment, but this
12693        /// configuration is not supported.
12694        CloudSqlPscNegUnsupported,
12695        /// No NAT subnets are defined for the PSC service attachment.
12696        NoNatSubnetsForPscServiceAttachment,
12697        /// PSC endpoint is accessed via NCC, but PSC transitivity configuration is
12698        /// not yet propagated.
12699        PscTransitivityNotPropagated,
12700        /// The packet sent from the hybrid NEG proxy matches a non-dynamic route,
12701        /// but such a configuration is not supported.
12702        HybridNegNonDynamicRouteMatched,
12703        /// The packet sent from the hybrid NEG proxy matches a dynamic route with a
12704        /// next hop in a different region, but such a configuration is not
12705        /// supported.
12706        HybridNegNonLocalDynamicRouteMatched,
12707        /// Packet sent from a Cloud Run revision that is not ready.
12708        CloudRunRevisionNotReady,
12709        /// Packet was dropped inside Private Service Connect service producer.
12710        DroppedInsidePscServiceProducer,
12711        /// Packet sent to a load balancer, which requires a proxy-only subnet and
12712        /// the subnet is not found.
12713        LoadBalancerHasNoProxySubnet,
12714        /// Packet sent to Cloud Nat without active NAT IPs.
12715        CloudNatNoAddresses,
12716        /// Packet is stuck in a routing loop.
12717        RoutingLoop,
12718        /// Packet is dropped inside a Google-managed service due to being delivered
12719        /// in return trace to an endpoint that doesn't match the endpoint the packet
12720        /// was sent from in forward trace. Used only for return traces.
12721        DroppedInsideGoogleManagedService,
12722        /// Packet is dropped due to a load balancer backend instance not having a
12723        /// network interface in the network expected by the load balancer.
12724        LoadBalancerBackendInvalidNetwork,
12725        /// Packet is dropped due to a backend service named port not being defined
12726        /// on the instance group level.
12727        BackendServiceNamedPortNotDefined,
12728        /// Packet is dropped due to a destination IP range being part of a Private
12729        /// NAT IP range.
12730        DestinationIsPrivateNatIpRange,
12731        /// Generic drop cause for a packet being dropped inside a Redis Instance
12732        /// service project.
12733        DroppedInsideRedisInstanceService,
12734        /// Packet is dropped due to an unsupported port being used to connect to a
12735        /// Redis Instance. Port 6379 should be used to connect to a Redis Instance.
12736        RedisInstanceUnsupportedPort,
12737        /// Packet is dropped due to connecting from PUPI address to a PSA based
12738        /// Redis Instance.
12739        RedisInstanceConnectingFromPupiAddress,
12740        /// Packet is dropped due to no route to the destination network.
12741        RedisInstanceNoRouteToDestinationNetwork,
12742        /// Redis Instance does not have an external IP address.
12743        RedisInstanceNoExternalIp,
12744        /// Packet is dropped due to an unsupported protocol being used to connect to
12745        /// a Redis Instance. Only TCP connections are accepted by a Redis Instance.
12746        RedisInstanceUnsupportedProtocol,
12747        /// Generic drop cause for a packet being dropped inside a Redis Cluster
12748        /// service project.
12749        DroppedInsideRedisClusterService,
12750        /// Packet is dropped due to an unsupported port being used to connect to a
12751        /// Redis Cluster. Ports 6379 and 11000 to 13047 should be used to connect to
12752        /// a Redis Cluster.
12753        RedisClusterUnsupportedPort,
12754        /// Redis Cluster does not have an external IP address.
12755        RedisClusterNoExternalIp,
12756        /// Packet is dropped due to an unsupported protocol being used to connect to
12757        /// a Redis Cluster. Only TCP connections are accepted by a Redis Cluster.
12758        RedisClusterUnsupportedProtocol,
12759        /// Packet from the non-GCP (on-prem) or unknown GCP network is dropped due
12760        /// to the destination IP address not belonging to any IP prefix advertised
12761        /// via BGP by the Cloud Router.
12762        NoAdvertisedRouteToGcpDestination,
12763        /// Packet from the non-GCP (on-prem) or unknown GCP network is dropped due
12764        /// to the destination IP address not belonging to any IP prefix included to
12765        /// the local traffic selector of the VPN tunnel.
12766        NoTrafficSelectorToGcpDestination,
12767        /// Packet from the unknown peered network is dropped due to no known route
12768        /// from the source network to the destination IP address.
12769        NoKnownRouteFromPeeredNetworkToDestination,
12770        /// Sending packets processed by the Private NAT Gateways to the Private
12771        /// Service Connect endpoints is not supported.
12772        PrivateNatToPscEndpointUnsupported,
12773        /// Packet is sent to the PSC port mapping service, but its destination port
12774        /// does not match any port mapping rules.
12775        PscPortMappingPortMismatch,
12776        /// Sending packets directly to the PSC port mapping service without going
12777        /// through the PSC connection is not supported.
12778        PscPortMappingWithoutPscConnectionUnsupported,
12779        /// Packet with destination IP address within the reserved NAT64 range is
12780        /// dropped due to matching a route of an unsupported type.
12781        UnsupportedRouteMatchedForNat64Destination,
12782        /// Packet could be dropped because hybrid endpoint like a VPN gateway or
12783        /// Interconnect is not allowed to send traffic to the Internet.
12784        TrafficFromHybridEndpointToInternetDisallowed,
12785        /// Packet with destination IP address within the reserved NAT64 range is
12786        /// dropped due to no matching NAT gateway in the subnet.
12787        NoMatchingNat64Gateway,
12788        /// Packet is dropped due to matching a Private NAT64 gateway with no rules
12789        /// for source IPv6 addresses.
12790        NoConfiguredPrivateNat64Rule,
12791        /// Packet is dropped due to being sent to a backend of a passthrough load
12792        /// balancer that doesn't use the same IP version as the frontend.
12793        LoadBalancerBackendIpVersionMismatch,
12794        /// Packet from the unknown NCC network is dropped due to no known route
12795        /// from the source network to the destination IP address.
12796        NoKnownRouteFromNccNetworkToDestination,
12797        /// Packet is dropped by Cloud NAT due to using an unsupported protocol.
12798        CloudNatProtocolUnsupported,
12799        /// Packet is dropped due to using an unsupported protocol (any other than
12800        /// UDP) for L2 Interconnect.
12801        L2InterconnectUnsupportedProtocol,
12802        /// Packet is dropped due to using an unsupported port (any other than
12803        /// 6081) for L2 Interconnect.
12804        L2InterconnectUnsupportedPort,
12805        /// Packet is dropped due to destination IP not matching the appliance
12806        /// mapping IPs configured on the L2 Interconnect attachment.
12807        L2InterconnectDestinationIpMismatch,
12808        /// Packet could be dropped because it matches a route associated with an NCC
12809        /// spoke in the hybrid subnet context, but such a configuration is not
12810        /// supported.
12811        NccRouteWithinHybridSubnetUnsupported,
12812        /// Packet is dropped because the region of the hybrid subnet is different
12813        /// from the region of the next hop of the route matched within this hybrid
12814        /// subnet.
12815        HybridSubnetRegionMismatch,
12816        /// Packet is dropped because no matching route was found in the hybrid
12817        /// subnet.
12818        HybridSubnetNoRoute,
12819        /// Packet is dropped by GKE Network Policy.
12820        GkeNetworkPolicy,
12821        /// Packet is dropped because there is no valid matching route from the
12822        /// network of the Google-managed service to the destination.
12823        NoValidRouteFromGoogleManagedNetworkToDestination,
12824        /// If set, the enum was initialized with an unknown value.
12825        ///
12826        /// Applications can examine the value using [Cause::value] or
12827        /// [Cause::name].
12828        UnknownValue(cause::UnknownValue),
12829    }
12830
12831    #[doc(hidden)]
12832    pub mod cause {
12833        #[allow(unused_imports)]
12834        use super::*;
12835        #[derive(Clone, Debug, PartialEq)]
12836        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12837    }
12838
12839    impl Cause {
12840        /// Gets the enum value.
12841        ///
12842        /// Returns `None` if the enum contains an unknown value deserialized from
12843        /// the string representation of enums.
12844        pub fn value(&self) -> std::option::Option<i32> {
12845            match self {
12846                Self::Unspecified => std::option::Option::Some(0),
12847                Self::UnknownExternalAddress => std::option::Option::Some(1),
12848                Self::ForeignIpDisallowed => std::option::Option::Some(2),
12849                Self::FirewallRule => std::option::Option::Some(3),
12850                Self::NoRoute => std::option::Option::Some(4),
12851                Self::RouteBlackhole => std::option::Option::Some(5),
12852                Self::RouteWrongNetwork => std::option::Option::Some(6),
12853                Self::RouteNextHopIpAddressNotResolved => std::option::Option::Some(42),
12854                Self::RouteNextHopResourceNotFound => std::option::Option::Some(43),
12855                Self::RouteNextHopInstanceWrongNetwork => std::option::Option::Some(49),
12856                Self::RouteNextHopInstanceNonPrimaryIp => std::option::Option::Some(50),
12857                Self::RouteNextHopForwardingRuleIpMismatch => std::option::Option::Some(51),
12858                Self::RouteNextHopVpnTunnelNotEstablished => std::option::Option::Some(52),
12859                Self::RouteNextHopForwardingRuleTypeInvalid => std::option::Option::Some(53),
12860                Self::NoRouteFromInternetToPrivateIpv6Address => std::option::Option::Some(44),
12861                Self::NoRouteFromInternetToPrivateIpv4Address => std::option::Option::Some(109),
12862                Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
12863                    std::option::Option::Some(98)
12864                }
12865                Self::VpnTunnelLocalSelectorMismatch => std::option::Option::Some(45),
12866                Self::VpnTunnelRemoteSelectorMismatch => std::option::Option::Some(46),
12867                Self::PrivateTrafficToInternet => std::option::Option::Some(7),
12868                Self::PrivateGoogleAccessDisallowed => std::option::Option::Some(8),
12869                Self::PrivateGoogleAccessViaVpnTunnelUnsupported => std::option::Option::Some(47),
12870                Self::NoExternalAddress => std::option::Option::Some(9),
12871                Self::UnknownInternalAddress => std::option::Option::Some(10),
12872                Self::ForwardingRuleMismatch => std::option::Option::Some(11),
12873                Self::ForwardingRuleNoInstances => std::option::Option::Some(12),
12874                Self::FirewallBlockingLoadBalancerBackendHealthCheck => {
12875                    std::option::Option::Some(13)
12876                }
12877                Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => {
12878                    std::option::Option::Some(85)
12879                }
12880                Self::InstanceNotRunning => std::option::Option::Some(14),
12881                Self::GkeClusterNotRunning => std::option::Option::Some(27),
12882                Self::GkePodNotRunning => std::option::Option::Some(103),
12883                Self::CloudSqlInstanceNotRunning => std::option::Option::Some(28),
12884                Self::RedisInstanceNotRunning => std::option::Option::Some(68),
12885                Self::RedisClusterNotRunning => std::option::Option::Some(69),
12886                Self::TrafficTypeBlocked => std::option::Option::Some(15),
12887                Self::GkeMasterUnauthorizedAccess => std::option::Option::Some(16),
12888                Self::CloudSqlInstanceUnauthorizedAccess => std::option::Option::Some(17),
12889                Self::DroppedInsideGkeService => std::option::Option::Some(18),
12890                Self::DroppedInsideCloudSqlService => std::option::Option::Some(19),
12891                Self::GoogleManagedServiceNoPeering => std::option::Option::Some(20),
12892                Self::GoogleManagedServiceNoPscEndpoint => std::option::Option::Some(38),
12893                Self::GkePscEndpointMissing => std::option::Option::Some(36),
12894                Self::CloudSqlInstanceNoIpAddress => std::option::Option::Some(21),
12895                Self::GkeControlPlaneRegionMismatch => std::option::Option::Some(30),
12896                Self::PublicGkeControlPlaneToPrivateDestination => std::option::Option::Some(31),
12897                Self::GkeControlPlaneNoRoute => std::option::Option::Some(32),
12898                Self::CloudSqlInstanceNotConfiguredForExternalTraffic => {
12899                    std::option::Option::Some(33)
12900                }
12901                Self::PublicCloudSqlInstanceToPrivateDestination => std::option::Option::Some(34),
12902                Self::CloudSqlInstanceNoRoute => std::option::Option::Some(35),
12903                Self::CloudSqlConnectorRequired => std::option::Option::Some(63),
12904                Self::CloudFunctionNotActive => std::option::Option::Some(22),
12905                Self::VpcConnectorNotSet => std::option::Option::Some(23),
12906                Self::VpcConnectorNotRunning => std::option::Option::Some(24),
12907                Self::VpcConnectorServerlessTrafficBlocked => std::option::Option::Some(60),
12908                Self::VpcConnectorHealthCheckTrafficBlocked => std::option::Option::Some(61),
12909                Self::ForwardingRuleRegionMismatch => std::option::Option::Some(25),
12910                Self::PscConnectionNotAccepted => std::option::Option::Some(26),
12911                Self::PscEndpointAccessedFromPeeredNetwork => std::option::Option::Some(41),
12912                Self::PscNegProducerEndpointNoGlobalAccess => std::option::Option::Some(48),
12913                Self::PscNegProducerForwardingRuleMultiplePorts => std::option::Option::Some(54),
12914                Self::CloudSqlPscNegUnsupported => std::option::Option::Some(58),
12915                Self::NoNatSubnetsForPscServiceAttachment => std::option::Option::Some(57),
12916                Self::PscTransitivityNotPropagated => std::option::Option::Some(64),
12917                Self::HybridNegNonDynamicRouteMatched => std::option::Option::Some(55),
12918                Self::HybridNegNonLocalDynamicRouteMatched => std::option::Option::Some(56),
12919                Self::CloudRunRevisionNotReady => std::option::Option::Some(29),
12920                Self::DroppedInsidePscServiceProducer => std::option::Option::Some(37),
12921                Self::LoadBalancerHasNoProxySubnet => std::option::Option::Some(39),
12922                Self::CloudNatNoAddresses => std::option::Option::Some(40),
12923                Self::RoutingLoop => std::option::Option::Some(59),
12924                Self::DroppedInsideGoogleManagedService => std::option::Option::Some(62),
12925                Self::LoadBalancerBackendInvalidNetwork => std::option::Option::Some(65),
12926                Self::BackendServiceNamedPortNotDefined => std::option::Option::Some(66),
12927                Self::DestinationIsPrivateNatIpRange => std::option::Option::Some(67),
12928                Self::DroppedInsideRedisInstanceService => std::option::Option::Some(70),
12929                Self::RedisInstanceUnsupportedPort => std::option::Option::Some(71),
12930                Self::RedisInstanceConnectingFromPupiAddress => std::option::Option::Some(72),
12931                Self::RedisInstanceNoRouteToDestinationNetwork => std::option::Option::Some(73),
12932                Self::RedisInstanceNoExternalIp => std::option::Option::Some(74),
12933                Self::RedisInstanceUnsupportedProtocol => std::option::Option::Some(78),
12934                Self::DroppedInsideRedisClusterService => std::option::Option::Some(75),
12935                Self::RedisClusterUnsupportedPort => std::option::Option::Some(76),
12936                Self::RedisClusterNoExternalIp => std::option::Option::Some(77),
12937                Self::RedisClusterUnsupportedProtocol => std::option::Option::Some(79),
12938                Self::NoAdvertisedRouteToGcpDestination => std::option::Option::Some(80),
12939                Self::NoTrafficSelectorToGcpDestination => std::option::Option::Some(81),
12940                Self::NoKnownRouteFromPeeredNetworkToDestination => std::option::Option::Some(82),
12941                Self::PrivateNatToPscEndpointUnsupported => std::option::Option::Some(83),
12942                Self::PscPortMappingPortMismatch => std::option::Option::Some(86),
12943                Self::PscPortMappingWithoutPscConnectionUnsupported => {
12944                    std::option::Option::Some(87)
12945                }
12946                Self::UnsupportedRouteMatchedForNat64Destination => std::option::Option::Some(88),
12947                Self::TrafficFromHybridEndpointToInternetDisallowed => {
12948                    std::option::Option::Some(89)
12949                }
12950                Self::NoMatchingNat64Gateway => std::option::Option::Some(90),
12951                Self::NoConfiguredPrivateNat64Rule => std::option::Option::Some(107),
12952                Self::LoadBalancerBackendIpVersionMismatch => std::option::Option::Some(96),
12953                Self::NoKnownRouteFromNccNetworkToDestination => std::option::Option::Some(97),
12954                Self::CloudNatProtocolUnsupported => std::option::Option::Some(99),
12955                Self::L2InterconnectUnsupportedProtocol => std::option::Option::Some(100),
12956                Self::L2InterconnectUnsupportedPort => std::option::Option::Some(101),
12957                Self::L2InterconnectDestinationIpMismatch => std::option::Option::Some(102),
12958                Self::NccRouteWithinHybridSubnetUnsupported => std::option::Option::Some(104),
12959                Self::HybridSubnetRegionMismatch => std::option::Option::Some(105),
12960                Self::HybridSubnetNoRoute => std::option::Option::Some(106),
12961                Self::GkeNetworkPolicy => std::option::Option::Some(108),
12962                Self::NoValidRouteFromGoogleManagedNetworkToDestination => {
12963                    std::option::Option::Some(110)
12964                }
12965                Self::UnknownValue(u) => u.0.value(),
12966            }
12967        }
12968
12969        /// Gets the enum value as a string.
12970        ///
12971        /// Returns `None` if the enum contains an unknown value deserialized from
12972        /// the integer representation of enums.
12973        pub fn name(&self) -> std::option::Option<&str> {
12974            match self {
12975                Self::Unspecified => std::option::Option::Some("CAUSE_UNSPECIFIED"),
12976                Self::UnknownExternalAddress => {
12977                    std::option::Option::Some("UNKNOWN_EXTERNAL_ADDRESS")
12978                }
12979                Self::ForeignIpDisallowed => std::option::Option::Some("FOREIGN_IP_DISALLOWED"),
12980                Self::FirewallRule => std::option::Option::Some("FIREWALL_RULE"),
12981                Self::NoRoute => std::option::Option::Some("NO_ROUTE"),
12982                Self::RouteBlackhole => std::option::Option::Some("ROUTE_BLACKHOLE"),
12983                Self::RouteWrongNetwork => std::option::Option::Some("ROUTE_WRONG_NETWORK"),
12984                Self::RouteNextHopIpAddressNotResolved => {
12985                    std::option::Option::Some("ROUTE_NEXT_HOP_IP_ADDRESS_NOT_RESOLVED")
12986                }
12987                Self::RouteNextHopResourceNotFound => {
12988                    std::option::Option::Some("ROUTE_NEXT_HOP_RESOURCE_NOT_FOUND")
12989                }
12990                Self::RouteNextHopInstanceWrongNetwork => {
12991                    std::option::Option::Some("ROUTE_NEXT_HOP_INSTANCE_WRONG_NETWORK")
12992                }
12993                Self::RouteNextHopInstanceNonPrimaryIp => {
12994                    std::option::Option::Some("ROUTE_NEXT_HOP_INSTANCE_NON_PRIMARY_IP")
12995                }
12996                Self::RouteNextHopForwardingRuleIpMismatch => {
12997                    std::option::Option::Some("ROUTE_NEXT_HOP_FORWARDING_RULE_IP_MISMATCH")
12998                }
12999                Self::RouteNextHopVpnTunnelNotEstablished => {
13000                    std::option::Option::Some("ROUTE_NEXT_HOP_VPN_TUNNEL_NOT_ESTABLISHED")
13001                }
13002                Self::RouteNextHopForwardingRuleTypeInvalid => {
13003                    std::option::Option::Some("ROUTE_NEXT_HOP_FORWARDING_RULE_TYPE_INVALID")
13004                }
13005                Self::NoRouteFromInternetToPrivateIpv6Address => {
13006                    std::option::Option::Some("NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV6_ADDRESS")
13007                }
13008                Self::NoRouteFromInternetToPrivateIpv4Address => {
13009                    std::option::Option::Some("NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV4_ADDRESS")
13010                }
13011                Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
13012                    std::option::Option::Some(
13013                        "NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS",
13014                    )
13015                }
13016                Self::VpnTunnelLocalSelectorMismatch => {
13017                    std::option::Option::Some("VPN_TUNNEL_LOCAL_SELECTOR_MISMATCH")
13018                }
13019                Self::VpnTunnelRemoteSelectorMismatch => {
13020                    std::option::Option::Some("VPN_TUNNEL_REMOTE_SELECTOR_MISMATCH")
13021                }
13022                Self::PrivateTrafficToInternet => {
13023                    std::option::Option::Some("PRIVATE_TRAFFIC_TO_INTERNET")
13024                }
13025                Self::PrivateGoogleAccessDisallowed => {
13026                    std::option::Option::Some("PRIVATE_GOOGLE_ACCESS_DISALLOWED")
13027                }
13028                Self::PrivateGoogleAccessViaVpnTunnelUnsupported => {
13029                    std::option::Option::Some("PRIVATE_GOOGLE_ACCESS_VIA_VPN_TUNNEL_UNSUPPORTED")
13030                }
13031                Self::NoExternalAddress => std::option::Option::Some("NO_EXTERNAL_ADDRESS"),
13032                Self::UnknownInternalAddress => {
13033                    std::option::Option::Some("UNKNOWN_INTERNAL_ADDRESS")
13034                }
13035                Self::ForwardingRuleMismatch => {
13036                    std::option::Option::Some("FORWARDING_RULE_MISMATCH")
13037                }
13038                Self::ForwardingRuleNoInstances => {
13039                    std::option::Option::Some("FORWARDING_RULE_NO_INSTANCES")
13040                }
13041                Self::FirewallBlockingLoadBalancerBackendHealthCheck => std::option::Option::Some(
13042                    "FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK",
13043                ),
13044                Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => std::option::Option::Some(
13045                    "INGRESS_FIREWALL_TAGS_UNSUPPORTED_BY_DIRECT_VPC_EGRESS",
13046                ),
13047                Self::InstanceNotRunning => std::option::Option::Some("INSTANCE_NOT_RUNNING"),
13048                Self::GkeClusterNotRunning => std::option::Option::Some("GKE_CLUSTER_NOT_RUNNING"),
13049                Self::GkePodNotRunning => std::option::Option::Some("GKE_POD_NOT_RUNNING"),
13050                Self::CloudSqlInstanceNotRunning => {
13051                    std::option::Option::Some("CLOUD_SQL_INSTANCE_NOT_RUNNING")
13052                }
13053                Self::RedisInstanceNotRunning => {
13054                    std::option::Option::Some("REDIS_INSTANCE_NOT_RUNNING")
13055                }
13056                Self::RedisClusterNotRunning => {
13057                    std::option::Option::Some("REDIS_CLUSTER_NOT_RUNNING")
13058                }
13059                Self::TrafficTypeBlocked => std::option::Option::Some("TRAFFIC_TYPE_BLOCKED"),
13060                Self::GkeMasterUnauthorizedAccess => {
13061                    std::option::Option::Some("GKE_MASTER_UNAUTHORIZED_ACCESS")
13062                }
13063                Self::CloudSqlInstanceUnauthorizedAccess => {
13064                    std::option::Option::Some("CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS")
13065                }
13066                Self::DroppedInsideGkeService => {
13067                    std::option::Option::Some("DROPPED_INSIDE_GKE_SERVICE")
13068                }
13069                Self::DroppedInsideCloudSqlService => {
13070                    std::option::Option::Some("DROPPED_INSIDE_CLOUD_SQL_SERVICE")
13071                }
13072                Self::GoogleManagedServiceNoPeering => {
13073                    std::option::Option::Some("GOOGLE_MANAGED_SERVICE_NO_PEERING")
13074                }
13075                Self::GoogleManagedServiceNoPscEndpoint => {
13076                    std::option::Option::Some("GOOGLE_MANAGED_SERVICE_NO_PSC_ENDPOINT")
13077                }
13078                Self::GkePscEndpointMissing => {
13079                    std::option::Option::Some("GKE_PSC_ENDPOINT_MISSING")
13080                }
13081                Self::CloudSqlInstanceNoIpAddress => {
13082                    std::option::Option::Some("CLOUD_SQL_INSTANCE_NO_IP_ADDRESS")
13083                }
13084                Self::GkeControlPlaneRegionMismatch => {
13085                    std::option::Option::Some("GKE_CONTROL_PLANE_REGION_MISMATCH")
13086                }
13087                Self::PublicGkeControlPlaneToPrivateDestination => {
13088                    std::option::Option::Some("PUBLIC_GKE_CONTROL_PLANE_TO_PRIVATE_DESTINATION")
13089                }
13090                Self::GkeControlPlaneNoRoute => {
13091                    std::option::Option::Some("GKE_CONTROL_PLANE_NO_ROUTE")
13092                }
13093                Self::CloudSqlInstanceNotConfiguredForExternalTraffic => std::option::Option::Some(
13094                    "CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC",
13095                ),
13096                Self::PublicCloudSqlInstanceToPrivateDestination => {
13097                    std::option::Option::Some("PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION")
13098                }
13099                Self::CloudSqlInstanceNoRoute => {
13100                    std::option::Option::Some("CLOUD_SQL_INSTANCE_NO_ROUTE")
13101                }
13102                Self::CloudSqlConnectorRequired => {
13103                    std::option::Option::Some("CLOUD_SQL_CONNECTOR_REQUIRED")
13104                }
13105                Self::CloudFunctionNotActive => {
13106                    std::option::Option::Some("CLOUD_FUNCTION_NOT_ACTIVE")
13107                }
13108                Self::VpcConnectorNotSet => std::option::Option::Some("VPC_CONNECTOR_NOT_SET"),
13109                Self::VpcConnectorNotRunning => {
13110                    std::option::Option::Some("VPC_CONNECTOR_NOT_RUNNING")
13111                }
13112                Self::VpcConnectorServerlessTrafficBlocked => {
13113                    std::option::Option::Some("VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED")
13114                }
13115                Self::VpcConnectorHealthCheckTrafficBlocked => {
13116                    std::option::Option::Some("VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED")
13117                }
13118                Self::ForwardingRuleRegionMismatch => {
13119                    std::option::Option::Some("FORWARDING_RULE_REGION_MISMATCH")
13120                }
13121                Self::PscConnectionNotAccepted => {
13122                    std::option::Option::Some("PSC_CONNECTION_NOT_ACCEPTED")
13123                }
13124                Self::PscEndpointAccessedFromPeeredNetwork => {
13125                    std::option::Option::Some("PSC_ENDPOINT_ACCESSED_FROM_PEERED_NETWORK")
13126                }
13127                Self::PscNegProducerEndpointNoGlobalAccess => {
13128                    std::option::Option::Some("PSC_NEG_PRODUCER_ENDPOINT_NO_GLOBAL_ACCESS")
13129                }
13130                Self::PscNegProducerForwardingRuleMultiplePorts => {
13131                    std::option::Option::Some("PSC_NEG_PRODUCER_FORWARDING_RULE_MULTIPLE_PORTS")
13132                }
13133                Self::CloudSqlPscNegUnsupported => {
13134                    std::option::Option::Some("CLOUD_SQL_PSC_NEG_UNSUPPORTED")
13135                }
13136                Self::NoNatSubnetsForPscServiceAttachment => {
13137                    std::option::Option::Some("NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT")
13138                }
13139                Self::PscTransitivityNotPropagated => {
13140                    std::option::Option::Some("PSC_TRANSITIVITY_NOT_PROPAGATED")
13141                }
13142                Self::HybridNegNonDynamicRouteMatched => {
13143                    std::option::Option::Some("HYBRID_NEG_NON_DYNAMIC_ROUTE_MATCHED")
13144                }
13145                Self::HybridNegNonLocalDynamicRouteMatched => {
13146                    std::option::Option::Some("HYBRID_NEG_NON_LOCAL_DYNAMIC_ROUTE_MATCHED")
13147                }
13148                Self::CloudRunRevisionNotReady => {
13149                    std::option::Option::Some("CLOUD_RUN_REVISION_NOT_READY")
13150                }
13151                Self::DroppedInsidePscServiceProducer => {
13152                    std::option::Option::Some("DROPPED_INSIDE_PSC_SERVICE_PRODUCER")
13153                }
13154                Self::LoadBalancerHasNoProxySubnet => {
13155                    std::option::Option::Some("LOAD_BALANCER_HAS_NO_PROXY_SUBNET")
13156                }
13157                Self::CloudNatNoAddresses => std::option::Option::Some("CLOUD_NAT_NO_ADDRESSES"),
13158                Self::RoutingLoop => std::option::Option::Some("ROUTING_LOOP"),
13159                Self::DroppedInsideGoogleManagedService => {
13160                    std::option::Option::Some("DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE")
13161                }
13162                Self::LoadBalancerBackendInvalidNetwork => {
13163                    std::option::Option::Some("LOAD_BALANCER_BACKEND_INVALID_NETWORK")
13164                }
13165                Self::BackendServiceNamedPortNotDefined => {
13166                    std::option::Option::Some("BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED")
13167                }
13168                Self::DestinationIsPrivateNatIpRange => {
13169                    std::option::Option::Some("DESTINATION_IS_PRIVATE_NAT_IP_RANGE")
13170                }
13171                Self::DroppedInsideRedisInstanceService => {
13172                    std::option::Option::Some("DROPPED_INSIDE_REDIS_INSTANCE_SERVICE")
13173                }
13174                Self::RedisInstanceUnsupportedPort => {
13175                    std::option::Option::Some("REDIS_INSTANCE_UNSUPPORTED_PORT")
13176                }
13177                Self::RedisInstanceConnectingFromPupiAddress => {
13178                    std::option::Option::Some("REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS")
13179                }
13180                Self::RedisInstanceNoRouteToDestinationNetwork => {
13181                    std::option::Option::Some("REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK")
13182                }
13183                Self::RedisInstanceNoExternalIp => {
13184                    std::option::Option::Some("REDIS_INSTANCE_NO_EXTERNAL_IP")
13185                }
13186                Self::RedisInstanceUnsupportedProtocol => {
13187                    std::option::Option::Some("REDIS_INSTANCE_UNSUPPORTED_PROTOCOL")
13188                }
13189                Self::DroppedInsideRedisClusterService => {
13190                    std::option::Option::Some("DROPPED_INSIDE_REDIS_CLUSTER_SERVICE")
13191                }
13192                Self::RedisClusterUnsupportedPort => {
13193                    std::option::Option::Some("REDIS_CLUSTER_UNSUPPORTED_PORT")
13194                }
13195                Self::RedisClusterNoExternalIp => {
13196                    std::option::Option::Some("REDIS_CLUSTER_NO_EXTERNAL_IP")
13197                }
13198                Self::RedisClusterUnsupportedProtocol => {
13199                    std::option::Option::Some("REDIS_CLUSTER_UNSUPPORTED_PROTOCOL")
13200                }
13201                Self::NoAdvertisedRouteToGcpDestination => {
13202                    std::option::Option::Some("NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION")
13203                }
13204                Self::NoTrafficSelectorToGcpDestination => {
13205                    std::option::Option::Some("NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION")
13206                }
13207                Self::NoKnownRouteFromPeeredNetworkToDestination => {
13208                    std::option::Option::Some("NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION")
13209                }
13210                Self::PrivateNatToPscEndpointUnsupported => {
13211                    std::option::Option::Some("PRIVATE_NAT_TO_PSC_ENDPOINT_UNSUPPORTED")
13212                }
13213                Self::PscPortMappingPortMismatch => {
13214                    std::option::Option::Some("PSC_PORT_MAPPING_PORT_MISMATCH")
13215                }
13216                Self::PscPortMappingWithoutPscConnectionUnsupported => {
13217                    std::option::Option::Some("PSC_PORT_MAPPING_WITHOUT_PSC_CONNECTION_UNSUPPORTED")
13218                }
13219                Self::UnsupportedRouteMatchedForNat64Destination => {
13220                    std::option::Option::Some("UNSUPPORTED_ROUTE_MATCHED_FOR_NAT64_DESTINATION")
13221                }
13222                Self::TrafficFromHybridEndpointToInternetDisallowed => {
13223                    std::option::Option::Some("TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED")
13224                }
13225                Self::NoMatchingNat64Gateway => {
13226                    std::option::Option::Some("NO_MATCHING_NAT64_GATEWAY")
13227                }
13228                Self::NoConfiguredPrivateNat64Rule => {
13229                    std::option::Option::Some("NO_CONFIGURED_PRIVATE_NAT64_RULE")
13230                }
13231                Self::LoadBalancerBackendIpVersionMismatch => {
13232                    std::option::Option::Some("LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH")
13233                }
13234                Self::NoKnownRouteFromNccNetworkToDestination => {
13235                    std::option::Option::Some("NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION")
13236                }
13237                Self::CloudNatProtocolUnsupported => {
13238                    std::option::Option::Some("CLOUD_NAT_PROTOCOL_UNSUPPORTED")
13239                }
13240                Self::L2InterconnectUnsupportedProtocol => {
13241                    std::option::Option::Some("L2_INTERCONNECT_UNSUPPORTED_PROTOCOL")
13242                }
13243                Self::L2InterconnectUnsupportedPort => {
13244                    std::option::Option::Some("L2_INTERCONNECT_UNSUPPORTED_PORT")
13245                }
13246                Self::L2InterconnectDestinationIpMismatch => {
13247                    std::option::Option::Some("L2_INTERCONNECT_DESTINATION_IP_MISMATCH")
13248                }
13249                Self::NccRouteWithinHybridSubnetUnsupported => {
13250                    std::option::Option::Some("NCC_ROUTE_WITHIN_HYBRID_SUBNET_UNSUPPORTED")
13251                }
13252                Self::HybridSubnetRegionMismatch => {
13253                    std::option::Option::Some("HYBRID_SUBNET_REGION_MISMATCH")
13254                }
13255                Self::HybridSubnetNoRoute => std::option::Option::Some("HYBRID_SUBNET_NO_ROUTE"),
13256                Self::GkeNetworkPolicy => std::option::Option::Some("GKE_NETWORK_POLICY"),
13257                Self::NoValidRouteFromGoogleManagedNetworkToDestination => {
13258                    std::option::Option::Some(
13259                        "NO_VALID_ROUTE_FROM_GOOGLE_MANAGED_NETWORK_TO_DESTINATION",
13260                    )
13261                }
13262                Self::UnknownValue(u) => u.0.name(),
13263            }
13264        }
13265    }
13266
13267    impl std::default::Default for Cause {
13268        fn default() -> Self {
13269            use std::convert::From;
13270            Self::from(0)
13271        }
13272    }
13273
13274    impl std::fmt::Display for Cause {
13275        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13276            wkt::internal::display_enum(f, self.name(), self.value())
13277        }
13278    }
13279
13280    impl std::convert::From<i32> for Cause {
13281        fn from(value: i32) -> Self {
13282            match value {
13283                0 => Self::Unspecified,
13284                1 => Self::UnknownExternalAddress,
13285                2 => Self::ForeignIpDisallowed,
13286                3 => Self::FirewallRule,
13287                4 => Self::NoRoute,
13288                5 => Self::RouteBlackhole,
13289                6 => Self::RouteWrongNetwork,
13290                7 => Self::PrivateTrafficToInternet,
13291                8 => Self::PrivateGoogleAccessDisallowed,
13292                9 => Self::NoExternalAddress,
13293                10 => Self::UnknownInternalAddress,
13294                11 => Self::ForwardingRuleMismatch,
13295                12 => Self::ForwardingRuleNoInstances,
13296                13 => Self::FirewallBlockingLoadBalancerBackendHealthCheck,
13297                14 => Self::InstanceNotRunning,
13298                15 => Self::TrafficTypeBlocked,
13299                16 => Self::GkeMasterUnauthorizedAccess,
13300                17 => Self::CloudSqlInstanceUnauthorizedAccess,
13301                18 => Self::DroppedInsideGkeService,
13302                19 => Self::DroppedInsideCloudSqlService,
13303                20 => Self::GoogleManagedServiceNoPeering,
13304                21 => Self::CloudSqlInstanceNoIpAddress,
13305                22 => Self::CloudFunctionNotActive,
13306                23 => Self::VpcConnectorNotSet,
13307                24 => Self::VpcConnectorNotRunning,
13308                25 => Self::ForwardingRuleRegionMismatch,
13309                26 => Self::PscConnectionNotAccepted,
13310                27 => Self::GkeClusterNotRunning,
13311                28 => Self::CloudSqlInstanceNotRunning,
13312                29 => Self::CloudRunRevisionNotReady,
13313                30 => Self::GkeControlPlaneRegionMismatch,
13314                31 => Self::PublicGkeControlPlaneToPrivateDestination,
13315                32 => Self::GkeControlPlaneNoRoute,
13316                33 => Self::CloudSqlInstanceNotConfiguredForExternalTraffic,
13317                34 => Self::PublicCloudSqlInstanceToPrivateDestination,
13318                35 => Self::CloudSqlInstanceNoRoute,
13319                36 => Self::GkePscEndpointMissing,
13320                37 => Self::DroppedInsidePscServiceProducer,
13321                38 => Self::GoogleManagedServiceNoPscEndpoint,
13322                39 => Self::LoadBalancerHasNoProxySubnet,
13323                40 => Self::CloudNatNoAddresses,
13324                41 => Self::PscEndpointAccessedFromPeeredNetwork,
13325                42 => Self::RouteNextHopIpAddressNotResolved,
13326                43 => Self::RouteNextHopResourceNotFound,
13327                44 => Self::NoRouteFromInternetToPrivateIpv6Address,
13328                45 => Self::VpnTunnelLocalSelectorMismatch,
13329                46 => Self::VpnTunnelRemoteSelectorMismatch,
13330                47 => Self::PrivateGoogleAccessViaVpnTunnelUnsupported,
13331                48 => Self::PscNegProducerEndpointNoGlobalAccess,
13332                49 => Self::RouteNextHopInstanceWrongNetwork,
13333                50 => Self::RouteNextHopInstanceNonPrimaryIp,
13334                51 => Self::RouteNextHopForwardingRuleIpMismatch,
13335                52 => Self::RouteNextHopVpnTunnelNotEstablished,
13336                53 => Self::RouteNextHopForwardingRuleTypeInvalid,
13337                54 => Self::PscNegProducerForwardingRuleMultiplePorts,
13338                55 => Self::HybridNegNonDynamicRouteMatched,
13339                56 => Self::HybridNegNonLocalDynamicRouteMatched,
13340                57 => Self::NoNatSubnetsForPscServiceAttachment,
13341                58 => Self::CloudSqlPscNegUnsupported,
13342                59 => Self::RoutingLoop,
13343                60 => Self::VpcConnectorServerlessTrafficBlocked,
13344                61 => Self::VpcConnectorHealthCheckTrafficBlocked,
13345                62 => Self::DroppedInsideGoogleManagedService,
13346                63 => Self::CloudSqlConnectorRequired,
13347                64 => Self::PscTransitivityNotPropagated,
13348                65 => Self::LoadBalancerBackendInvalidNetwork,
13349                66 => Self::BackendServiceNamedPortNotDefined,
13350                67 => Self::DestinationIsPrivateNatIpRange,
13351                68 => Self::RedisInstanceNotRunning,
13352                69 => Self::RedisClusterNotRunning,
13353                70 => Self::DroppedInsideRedisInstanceService,
13354                71 => Self::RedisInstanceUnsupportedPort,
13355                72 => Self::RedisInstanceConnectingFromPupiAddress,
13356                73 => Self::RedisInstanceNoRouteToDestinationNetwork,
13357                74 => Self::RedisInstanceNoExternalIp,
13358                75 => Self::DroppedInsideRedisClusterService,
13359                76 => Self::RedisClusterUnsupportedPort,
13360                77 => Self::RedisClusterNoExternalIp,
13361                78 => Self::RedisInstanceUnsupportedProtocol,
13362                79 => Self::RedisClusterUnsupportedProtocol,
13363                80 => Self::NoAdvertisedRouteToGcpDestination,
13364                81 => Self::NoTrafficSelectorToGcpDestination,
13365                82 => Self::NoKnownRouteFromPeeredNetworkToDestination,
13366                83 => Self::PrivateNatToPscEndpointUnsupported,
13367                85 => Self::IngressFirewallTagsUnsupportedByDirectVpcEgress,
13368                86 => Self::PscPortMappingPortMismatch,
13369                87 => Self::PscPortMappingWithoutPscConnectionUnsupported,
13370                88 => Self::UnsupportedRouteMatchedForNat64Destination,
13371                89 => Self::TrafficFromHybridEndpointToInternetDisallowed,
13372                90 => Self::NoMatchingNat64Gateway,
13373                96 => Self::LoadBalancerBackendIpVersionMismatch,
13374                97 => Self::NoKnownRouteFromNccNetworkToDestination,
13375                98 => Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address,
13376                99 => Self::CloudNatProtocolUnsupported,
13377                100 => Self::L2InterconnectUnsupportedProtocol,
13378                101 => Self::L2InterconnectUnsupportedPort,
13379                102 => Self::L2InterconnectDestinationIpMismatch,
13380                103 => Self::GkePodNotRunning,
13381                104 => Self::NccRouteWithinHybridSubnetUnsupported,
13382                105 => Self::HybridSubnetRegionMismatch,
13383                106 => Self::HybridSubnetNoRoute,
13384                107 => Self::NoConfiguredPrivateNat64Rule,
13385                108 => Self::GkeNetworkPolicy,
13386                109 => Self::NoRouteFromInternetToPrivateIpv4Address,
13387                110 => Self::NoValidRouteFromGoogleManagedNetworkToDestination,
13388                _ => Self::UnknownValue(cause::UnknownValue(
13389                    wkt::internal::UnknownEnumValue::Integer(value),
13390                )),
13391            }
13392        }
13393    }
13394
13395    impl std::convert::From<&str> for Cause {
13396        fn from(value: &str) -> Self {
13397            use std::string::ToString;
13398            match value {
13399                "CAUSE_UNSPECIFIED" => Self::Unspecified,
13400                "UNKNOWN_EXTERNAL_ADDRESS" => Self::UnknownExternalAddress,
13401                "FOREIGN_IP_DISALLOWED" => Self::ForeignIpDisallowed,
13402                "FIREWALL_RULE" => Self::FirewallRule,
13403                "NO_ROUTE" => Self::NoRoute,
13404                "ROUTE_BLACKHOLE" => Self::RouteBlackhole,
13405                "ROUTE_WRONG_NETWORK" => Self::RouteWrongNetwork,
13406                "ROUTE_NEXT_HOP_IP_ADDRESS_NOT_RESOLVED" => Self::RouteNextHopIpAddressNotResolved,
13407                "ROUTE_NEXT_HOP_RESOURCE_NOT_FOUND" => Self::RouteNextHopResourceNotFound,
13408                "ROUTE_NEXT_HOP_INSTANCE_WRONG_NETWORK" => Self::RouteNextHopInstanceWrongNetwork,
13409                "ROUTE_NEXT_HOP_INSTANCE_NON_PRIMARY_IP" => Self::RouteNextHopInstanceNonPrimaryIp,
13410                "ROUTE_NEXT_HOP_FORWARDING_RULE_IP_MISMATCH" => {
13411                    Self::RouteNextHopForwardingRuleIpMismatch
13412                }
13413                "ROUTE_NEXT_HOP_VPN_TUNNEL_NOT_ESTABLISHED" => {
13414                    Self::RouteNextHopVpnTunnelNotEstablished
13415                }
13416                "ROUTE_NEXT_HOP_FORWARDING_RULE_TYPE_INVALID" => {
13417                    Self::RouteNextHopForwardingRuleTypeInvalid
13418                }
13419                "NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV6_ADDRESS" => {
13420                    Self::NoRouteFromInternetToPrivateIpv6Address
13421                }
13422                "NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV4_ADDRESS" => {
13423                    Self::NoRouteFromInternetToPrivateIpv4Address
13424                }
13425                "NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS" => {
13426                    Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address
13427                }
13428                "VPN_TUNNEL_LOCAL_SELECTOR_MISMATCH" => Self::VpnTunnelLocalSelectorMismatch,
13429                "VPN_TUNNEL_REMOTE_SELECTOR_MISMATCH" => Self::VpnTunnelRemoteSelectorMismatch,
13430                "PRIVATE_TRAFFIC_TO_INTERNET" => Self::PrivateTrafficToInternet,
13431                "PRIVATE_GOOGLE_ACCESS_DISALLOWED" => Self::PrivateGoogleAccessDisallowed,
13432                "PRIVATE_GOOGLE_ACCESS_VIA_VPN_TUNNEL_UNSUPPORTED" => {
13433                    Self::PrivateGoogleAccessViaVpnTunnelUnsupported
13434                }
13435                "NO_EXTERNAL_ADDRESS" => Self::NoExternalAddress,
13436                "UNKNOWN_INTERNAL_ADDRESS" => Self::UnknownInternalAddress,
13437                "FORWARDING_RULE_MISMATCH" => Self::ForwardingRuleMismatch,
13438                "FORWARDING_RULE_NO_INSTANCES" => Self::ForwardingRuleNoInstances,
13439                "FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK" => {
13440                    Self::FirewallBlockingLoadBalancerBackendHealthCheck
13441                }
13442                "INGRESS_FIREWALL_TAGS_UNSUPPORTED_BY_DIRECT_VPC_EGRESS" => {
13443                    Self::IngressFirewallTagsUnsupportedByDirectVpcEgress
13444                }
13445                "INSTANCE_NOT_RUNNING" => Self::InstanceNotRunning,
13446                "GKE_CLUSTER_NOT_RUNNING" => Self::GkeClusterNotRunning,
13447                "GKE_POD_NOT_RUNNING" => Self::GkePodNotRunning,
13448                "CLOUD_SQL_INSTANCE_NOT_RUNNING" => Self::CloudSqlInstanceNotRunning,
13449                "REDIS_INSTANCE_NOT_RUNNING" => Self::RedisInstanceNotRunning,
13450                "REDIS_CLUSTER_NOT_RUNNING" => Self::RedisClusterNotRunning,
13451                "TRAFFIC_TYPE_BLOCKED" => Self::TrafficTypeBlocked,
13452                "GKE_MASTER_UNAUTHORIZED_ACCESS" => Self::GkeMasterUnauthorizedAccess,
13453                "CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS" => {
13454                    Self::CloudSqlInstanceUnauthorizedAccess
13455                }
13456                "DROPPED_INSIDE_GKE_SERVICE" => Self::DroppedInsideGkeService,
13457                "DROPPED_INSIDE_CLOUD_SQL_SERVICE" => Self::DroppedInsideCloudSqlService,
13458                "GOOGLE_MANAGED_SERVICE_NO_PEERING" => Self::GoogleManagedServiceNoPeering,
13459                "GOOGLE_MANAGED_SERVICE_NO_PSC_ENDPOINT" => Self::GoogleManagedServiceNoPscEndpoint,
13460                "GKE_PSC_ENDPOINT_MISSING" => Self::GkePscEndpointMissing,
13461                "CLOUD_SQL_INSTANCE_NO_IP_ADDRESS" => Self::CloudSqlInstanceNoIpAddress,
13462                "GKE_CONTROL_PLANE_REGION_MISMATCH" => Self::GkeControlPlaneRegionMismatch,
13463                "PUBLIC_GKE_CONTROL_PLANE_TO_PRIVATE_DESTINATION" => {
13464                    Self::PublicGkeControlPlaneToPrivateDestination
13465                }
13466                "GKE_CONTROL_PLANE_NO_ROUTE" => Self::GkeControlPlaneNoRoute,
13467                "CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC" => {
13468                    Self::CloudSqlInstanceNotConfiguredForExternalTraffic
13469                }
13470                "PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION" => {
13471                    Self::PublicCloudSqlInstanceToPrivateDestination
13472                }
13473                "CLOUD_SQL_INSTANCE_NO_ROUTE" => Self::CloudSqlInstanceNoRoute,
13474                "CLOUD_SQL_CONNECTOR_REQUIRED" => Self::CloudSqlConnectorRequired,
13475                "CLOUD_FUNCTION_NOT_ACTIVE" => Self::CloudFunctionNotActive,
13476                "VPC_CONNECTOR_NOT_SET" => Self::VpcConnectorNotSet,
13477                "VPC_CONNECTOR_NOT_RUNNING" => Self::VpcConnectorNotRunning,
13478                "VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED" => {
13479                    Self::VpcConnectorServerlessTrafficBlocked
13480                }
13481                "VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED" => {
13482                    Self::VpcConnectorHealthCheckTrafficBlocked
13483                }
13484                "FORWARDING_RULE_REGION_MISMATCH" => Self::ForwardingRuleRegionMismatch,
13485                "PSC_CONNECTION_NOT_ACCEPTED" => Self::PscConnectionNotAccepted,
13486                "PSC_ENDPOINT_ACCESSED_FROM_PEERED_NETWORK" => {
13487                    Self::PscEndpointAccessedFromPeeredNetwork
13488                }
13489                "PSC_NEG_PRODUCER_ENDPOINT_NO_GLOBAL_ACCESS" => {
13490                    Self::PscNegProducerEndpointNoGlobalAccess
13491                }
13492                "PSC_NEG_PRODUCER_FORWARDING_RULE_MULTIPLE_PORTS" => {
13493                    Self::PscNegProducerForwardingRuleMultiplePorts
13494                }
13495                "CLOUD_SQL_PSC_NEG_UNSUPPORTED" => Self::CloudSqlPscNegUnsupported,
13496                "NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT" => {
13497                    Self::NoNatSubnetsForPscServiceAttachment
13498                }
13499                "PSC_TRANSITIVITY_NOT_PROPAGATED" => Self::PscTransitivityNotPropagated,
13500                "HYBRID_NEG_NON_DYNAMIC_ROUTE_MATCHED" => Self::HybridNegNonDynamicRouteMatched,
13501                "HYBRID_NEG_NON_LOCAL_DYNAMIC_ROUTE_MATCHED" => {
13502                    Self::HybridNegNonLocalDynamicRouteMatched
13503                }
13504                "CLOUD_RUN_REVISION_NOT_READY" => Self::CloudRunRevisionNotReady,
13505                "DROPPED_INSIDE_PSC_SERVICE_PRODUCER" => Self::DroppedInsidePscServiceProducer,
13506                "LOAD_BALANCER_HAS_NO_PROXY_SUBNET" => Self::LoadBalancerHasNoProxySubnet,
13507                "CLOUD_NAT_NO_ADDRESSES" => Self::CloudNatNoAddresses,
13508                "ROUTING_LOOP" => Self::RoutingLoop,
13509                "DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE" => Self::DroppedInsideGoogleManagedService,
13510                "LOAD_BALANCER_BACKEND_INVALID_NETWORK" => Self::LoadBalancerBackendInvalidNetwork,
13511                "BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED" => Self::BackendServiceNamedPortNotDefined,
13512                "DESTINATION_IS_PRIVATE_NAT_IP_RANGE" => Self::DestinationIsPrivateNatIpRange,
13513                "DROPPED_INSIDE_REDIS_INSTANCE_SERVICE" => Self::DroppedInsideRedisInstanceService,
13514                "REDIS_INSTANCE_UNSUPPORTED_PORT" => Self::RedisInstanceUnsupportedPort,
13515                "REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS" => {
13516                    Self::RedisInstanceConnectingFromPupiAddress
13517                }
13518                "REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK" => {
13519                    Self::RedisInstanceNoRouteToDestinationNetwork
13520                }
13521                "REDIS_INSTANCE_NO_EXTERNAL_IP" => Self::RedisInstanceNoExternalIp,
13522                "REDIS_INSTANCE_UNSUPPORTED_PROTOCOL" => Self::RedisInstanceUnsupportedProtocol,
13523                "DROPPED_INSIDE_REDIS_CLUSTER_SERVICE" => Self::DroppedInsideRedisClusterService,
13524                "REDIS_CLUSTER_UNSUPPORTED_PORT" => Self::RedisClusterUnsupportedPort,
13525                "REDIS_CLUSTER_NO_EXTERNAL_IP" => Self::RedisClusterNoExternalIp,
13526                "REDIS_CLUSTER_UNSUPPORTED_PROTOCOL" => Self::RedisClusterUnsupportedProtocol,
13527                "NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION" => Self::NoAdvertisedRouteToGcpDestination,
13528                "NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION" => Self::NoTrafficSelectorToGcpDestination,
13529                "NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION" => {
13530                    Self::NoKnownRouteFromPeeredNetworkToDestination
13531                }
13532                "PRIVATE_NAT_TO_PSC_ENDPOINT_UNSUPPORTED" => {
13533                    Self::PrivateNatToPscEndpointUnsupported
13534                }
13535                "PSC_PORT_MAPPING_PORT_MISMATCH" => Self::PscPortMappingPortMismatch,
13536                "PSC_PORT_MAPPING_WITHOUT_PSC_CONNECTION_UNSUPPORTED" => {
13537                    Self::PscPortMappingWithoutPscConnectionUnsupported
13538                }
13539                "UNSUPPORTED_ROUTE_MATCHED_FOR_NAT64_DESTINATION" => {
13540                    Self::UnsupportedRouteMatchedForNat64Destination
13541                }
13542                "TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED" => {
13543                    Self::TrafficFromHybridEndpointToInternetDisallowed
13544                }
13545                "NO_MATCHING_NAT64_GATEWAY" => Self::NoMatchingNat64Gateway,
13546                "NO_CONFIGURED_PRIVATE_NAT64_RULE" => Self::NoConfiguredPrivateNat64Rule,
13547                "LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH" => {
13548                    Self::LoadBalancerBackendIpVersionMismatch
13549                }
13550                "NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION" => {
13551                    Self::NoKnownRouteFromNccNetworkToDestination
13552                }
13553                "CLOUD_NAT_PROTOCOL_UNSUPPORTED" => Self::CloudNatProtocolUnsupported,
13554                "L2_INTERCONNECT_UNSUPPORTED_PROTOCOL" => Self::L2InterconnectUnsupportedProtocol,
13555                "L2_INTERCONNECT_UNSUPPORTED_PORT" => Self::L2InterconnectUnsupportedPort,
13556                "L2_INTERCONNECT_DESTINATION_IP_MISMATCH" => {
13557                    Self::L2InterconnectDestinationIpMismatch
13558                }
13559                "NCC_ROUTE_WITHIN_HYBRID_SUBNET_UNSUPPORTED" => {
13560                    Self::NccRouteWithinHybridSubnetUnsupported
13561                }
13562                "HYBRID_SUBNET_REGION_MISMATCH" => Self::HybridSubnetRegionMismatch,
13563                "HYBRID_SUBNET_NO_ROUTE" => Self::HybridSubnetNoRoute,
13564                "GKE_NETWORK_POLICY" => Self::GkeNetworkPolicy,
13565                "NO_VALID_ROUTE_FROM_GOOGLE_MANAGED_NETWORK_TO_DESTINATION" => {
13566                    Self::NoValidRouteFromGoogleManagedNetworkToDestination
13567                }
13568                _ => Self::UnknownValue(cause::UnknownValue(
13569                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13570                )),
13571            }
13572        }
13573    }
13574
13575    impl serde::ser::Serialize for Cause {
13576        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13577        where
13578            S: serde::Serializer,
13579        {
13580            match self {
13581                Self::Unspecified => serializer.serialize_i32(0),
13582                Self::UnknownExternalAddress => serializer.serialize_i32(1),
13583                Self::ForeignIpDisallowed => serializer.serialize_i32(2),
13584                Self::FirewallRule => serializer.serialize_i32(3),
13585                Self::NoRoute => serializer.serialize_i32(4),
13586                Self::RouteBlackhole => serializer.serialize_i32(5),
13587                Self::RouteWrongNetwork => serializer.serialize_i32(6),
13588                Self::RouteNextHopIpAddressNotResolved => serializer.serialize_i32(42),
13589                Self::RouteNextHopResourceNotFound => serializer.serialize_i32(43),
13590                Self::RouteNextHopInstanceWrongNetwork => serializer.serialize_i32(49),
13591                Self::RouteNextHopInstanceNonPrimaryIp => serializer.serialize_i32(50),
13592                Self::RouteNextHopForwardingRuleIpMismatch => serializer.serialize_i32(51),
13593                Self::RouteNextHopVpnTunnelNotEstablished => serializer.serialize_i32(52),
13594                Self::RouteNextHopForwardingRuleTypeInvalid => serializer.serialize_i32(53),
13595                Self::NoRouteFromInternetToPrivateIpv6Address => serializer.serialize_i32(44),
13596                Self::NoRouteFromInternetToPrivateIpv4Address => serializer.serialize_i32(109),
13597                Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
13598                    serializer.serialize_i32(98)
13599                }
13600                Self::VpnTunnelLocalSelectorMismatch => serializer.serialize_i32(45),
13601                Self::VpnTunnelRemoteSelectorMismatch => serializer.serialize_i32(46),
13602                Self::PrivateTrafficToInternet => serializer.serialize_i32(7),
13603                Self::PrivateGoogleAccessDisallowed => serializer.serialize_i32(8),
13604                Self::PrivateGoogleAccessViaVpnTunnelUnsupported => serializer.serialize_i32(47),
13605                Self::NoExternalAddress => serializer.serialize_i32(9),
13606                Self::UnknownInternalAddress => serializer.serialize_i32(10),
13607                Self::ForwardingRuleMismatch => serializer.serialize_i32(11),
13608                Self::ForwardingRuleNoInstances => serializer.serialize_i32(12),
13609                Self::FirewallBlockingLoadBalancerBackendHealthCheck => {
13610                    serializer.serialize_i32(13)
13611                }
13612                Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => {
13613                    serializer.serialize_i32(85)
13614                }
13615                Self::InstanceNotRunning => serializer.serialize_i32(14),
13616                Self::GkeClusterNotRunning => serializer.serialize_i32(27),
13617                Self::GkePodNotRunning => serializer.serialize_i32(103),
13618                Self::CloudSqlInstanceNotRunning => serializer.serialize_i32(28),
13619                Self::RedisInstanceNotRunning => serializer.serialize_i32(68),
13620                Self::RedisClusterNotRunning => serializer.serialize_i32(69),
13621                Self::TrafficTypeBlocked => serializer.serialize_i32(15),
13622                Self::GkeMasterUnauthorizedAccess => serializer.serialize_i32(16),
13623                Self::CloudSqlInstanceUnauthorizedAccess => serializer.serialize_i32(17),
13624                Self::DroppedInsideGkeService => serializer.serialize_i32(18),
13625                Self::DroppedInsideCloudSqlService => serializer.serialize_i32(19),
13626                Self::GoogleManagedServiceNoPeering => serializer.serialize_i32(20),
13627                Self::GoogleManagedServiceNoPscEndpoint => serializer.serialize_i32(38),
13628                Self::GkePscEndpointMissing => serializer.serialize_i32(36),
13629                Self::CloudSqlInstanceNoIpAddress => serializer.serialize_i32(21),
13630                Self::GkeControlPlaneRegionMismatch => serializer.serialize_i32(30),
13631                Self::PublicGkeControlPlaneToPrivateDestination => serializer.serialize_i32(31),
13632                Self::GkeControlPlaneNoRoute => serializer.serialize_i32(32),
13633                Self::CloudSqlInstanceNotConfiguredForExternalTraffic => {
13634                    serializer.serialize_i32(33)
13635                }
13636                Self::PublicCloudSqlInstanceToPrivateDestination => serializer.serialize_i32(34),
13637                Self::CloudSqlInstanceNoRoute => serializer.serialize_i32(35),
13638                Self::CloudSqlConnectorRequired => serializer.serialize_i32(63),
13639                Self::CloudFunctionNotActive => serializer.serialize_i32(22),
13640                Self::VpcConnectorNotSet => serializer.serialize_i32(23),
13641                Self::VpcConnectorNotRunning => serializer.serialize_i32(24),
13642                Self::VpcConnectorServerlessTrafficBlocked => serializer.serialize_i32(60),
13643                Self::VpcConnectorHealthCheckTrafficBlocked => serializer.serialize_i32(61),
13644                Self::ForwardingRuleRegionMismatch => serializer.serialize_i32(25),
13645                Self::PscConnectionNotAccepted => serializer.serialize_i32(26),
13646                Self::PscEndpointAccessedFromPeeredNetwork => serializer.serialize_i32(41),
13647                Self::PscNegProducerEndpointNoGlobalAccess => serializer.serialize_i32(48),
13648                Self::PscNegProducerForwardingRuleMultiplePorts => serializer.serialize_i32(54),
13649                Self::CloudSqlPscNegUnsupported => serializer.serialize_i32(58),
13650                Self::NoNatSubnetsForPscServiceAttachment => serializer.serialize_i32(57),
13651                Self::PscTransitivityNotPropagated => serializer.serialize_i32(64),
13652                Self::HybridNegNonDynamicRouteMatched => serializer.serialize_i32(55),
13653                Self::HybridNegNonLocalDynamicRouteMatched => serializer.serialize_i32(56),
13654                Self::CloudRunRevisionNotReady => serializer.serialize_i32(29),
13655                Self::DroppedInsidePscServiceProducer => serializer.serialize_i32(37),
13656                Self::LoadBalancerHasNoProxySubnet => serializer.serialize_i32(39),
13657                Self::CloudNatNoAddresses => serializer.serialize_i32(40),
13658                Self::RoutingLoop => serializer.serialize_i32(59),
13659                Self::DroppedInsideGoogleManagedService => serializer.serialize_i32(62),
13660                Self::LoadBalancerBackendInvalidNetwork => serializer.serialize_i32(65),
13661                Self::BackendServiceNamedPortNotDefined => serializer.serialize_i32(66),
13662                Self::DestinationIsPrivateNatIpRange => serializer.serialize_i32(67),
13663                Self::DroppedInsideRedisInstanceService => serializer.serialize_i32(70),
13664                Self::RedisInstanceUnsupportedPort => serializer.serialize_i32(71),
13665                Self::RedisInstanceConnectingFromPupiAddress => serializer.serialize_i32(72),
13666                Self::RedisInstanceNoRouteToDestinationNetwork => serializer.serialize_i32(73),
13667                Self::RedisInstanceNoExternalIp => serializer.serialize_i32(74),
13668                Self::RedisInstanceUnsupportedProtocol => serializer.serialize_i32(78),
13669                Self::DroppedInsideRedisClusterService => serializer.serialize_i32(75),
13670                Self::RedisClusterUnsupportedPort => serializer.serialize_i32(76),
13671                Self::RedisClusterNoExternalIp => serializer.serialize_i32(77),
13672                Self::RedisClusterUnsupportedProtocol => serializer.serialize_i32(79),
13673                Self::NoAdvertisedRouteToGcpDestination => serializer.serialize_i32(80),
13674                Self::NoTrafficSelectorToGcpDestination => serializer.serialize_i32(81),
13675                Self::NoKnownRouteFromPeeredNetworkToDestination => serializer.serialize_i32(82),
13676                Self::PrivateNatToPscEndpointUnsupported => serializer.serialize_i32(83),
13677                Self::PscPortMappingPortMismatch => serializer.serialize_i32(86),
13678                Self::PscPortMappingWithoutPscConnectionUnsupported => serializer.serialize_i32(87),
13679                Self::UnsupportedRouteMatchedForNat64Destination => serializer.serialize_i32(88),
13680                Self::TrafficFromHybridEndpointToInternetDisallowed => serializer.serialize_i32(89),
13681                Self::NoMatchingNat64Gateway => serializer.serialize_i32(90),
13682                Self::NoConfiguredPrivateNat64Rule => serializer.serialize_i32(107),
13683                Self::LoadBalancerBackendIpVersionMismatch => serializer.serialize_i32(96),
13684                Self::NoKnownRouteFromNccNetworkToDestination => serializer.serialize_i32(97),
13685                Self::CloudNatProtocolUnsupported => serializer.serialize_i32(99),
13686                Self::L2InterconnectUnsupportedProtocol => serializer.serialize_i32(100),
13687                Self::L2InterconnectUnsupportedPort => serializer.serialize_i32(101),
13688                Self::L2InterconnectDestinationIpMismatch => serializer.serialize_i32(102),
13689                Self::NccRouteWithinHybridSubnetUnsupported => serializer.serialize_i32(104),
13690                Self::HybridSubnetRegionMismatch => serializer.serialize_i32(105),
13691                Self::HybridSubnetNoRoute => serializer.serialize_i32(106),
13692                Self::GkeNetworkPolicy => serializer.serialize_i32(108),
13693                Self::NoValidRouteFromGoogleManagedNetworkToDestination => {
13694                    serializer.serialize_i32(110)
13695                }
13696                Self::UnknownValue(u) => u.0.serialize(serializer),
13697            }
13698        }
13699    }
13700
13701    impl<'de> serde::de::Deserialize<'de> for Cause {
13702        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13703        where
13704            D: serde::Deserializer<'de>,
13705        {
13706            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Cause>::new(
13707                ".google.cloud.networkmanagement.v1.DropInfo.Cause",
13708            ))
13709        }
13710    }
13711}
13712
13713/// For display only. Metadata associated with a Google Kubernetes Engine (GKE)
13714/// cluster master.
13715#[derive(Clone, Default, PartialEq)]
13716#[non_exhaustive]
13717pub struct GKEMasterInfo {
13718    /// URI of a GKE cluster.
13719    pub cluster_uri: std::string::String,
13720
13721    /// URI of a GKE cluster network.
13722    pub cluster_network_uri: std::string::String,
13723
13724    /// Internal IP address of a GKE cluster control plane.
13725    pub internal_ip: std::string::String,
13726
13727    /// External IP address of a GKE cluster control plane.
13728    pub external_ip: std::string::String,
13729
13730    /// DNS endpoint of a GKE cluster control plane.
13731    pub dns_endpoint: std::string::String,
13732
13733    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13734}
13735
13736impl GKEMasterInfo {
13737    /// Creates a new default instance.
13738    pub fn new() -> Self {
13739        std::default::Default::default()
13740    }
13741
13742    /// Sets the value of [cluster_uri][crate::model::GKEMasterInfo::cluster_uri].
13743    ///
13744    /// # Example
13745    /// ```ignore,no_run
13746    /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13747    /// let x = GKEMasterInfo::new().set_cluster_uri("example");
13748    /// ```
13749    pub fn set_cluster_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13750        self.cluster_uri = v.into();
13751        self
13752    }
13753
13754    /// Sets the value of [cluster_network_uri][crate::model::GKEMasterInfo::cluster_network_uri].
13755    ///
13756    /// # Example
13757    /// ```ignore,no_run
13758    /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13759    /// let x = GKEMasterInfo::new().set_cluster_network_uri("example");
13760    /// ```
13761    pub fn set_cluster_network_uri<T: std::convert::Into<std::string::String>>(
13762        mut self,
13763        v: T,
13764    ) -> Self {
13765        self.cluster_network_uri = v.into();
13766        self
13767    }
13768
13769    /// Sets the value of [internal_ip][crate::model::GKEMasterInfo::internal_ip].
13770    ///
13771    /// # Example
13772    /// ```ignore,no_run
13773    /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13774    /// let x = GKEMasterInfo::new().set_internal_ip("example");
13775    /// ```
13776    pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13777        self.internal_ip = v.into();
13778        self
13779    }
13780
13781    /// Sets the value of [external_ip][crate::model::GKEMasterInfo::external_ip].
13782    ///
13783    /// # Example
13784    /// ```ignore,no_run
13785    /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13786    /// let x = GKEMasterInfo::new().set_external_ip("example");
13787    /// ```
13788    pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13789        self.external_ip = v.into();
13790        self
13791    }
13792
13793    /// Sets the value of [dns_endpoint][crate::model::GKEMasterInfo::dns_endpoint].
13794    ///
13795    /// # Example
13796    /// ```ignore,no_run
13797    /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13798    /// let x = GKEMasterInfo::new().set_dns_endpoint("example");
13799    /// ```
13800    pub fn set_dns_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13801        self.dns_endpoint = v.into();
13802        self
13803    }
13804}
13805
13806impl wkt::message::Message for GKEMasterInfo {
13807    fn typename() -> &'static str {
13808        "type.googleapis.com/google.cloud.networkmanagement.v1.GKEMasterInfo"
13809    }
13810}
13811
13812/// For display only. Metadata associated with a Google Kubernetes Engine (GKE)
13813/// Pod.
13814#[derive(Clone, Default, PartialEq)]
13815#[non_exhaustive]
13816pub struct GkePodInfo {
13817    /// URI of a GKE Pod.
13818    /// For Pods in regional Clusters, the URI format is:
13819    /// `projects/{project}/locations/{location}/clusters/{cluster}/k8s/namespaces/{namespace}/pods/{pod}`
13820    /// For Pods in zonal Clusters, the URI format is:
13821    /// `projects/{project}/zones/{zone}/clusters/{cluster}/k8s/namespaces/{namespace}/pods/{pod}`
13822    pub pod_uri: std::string::String,
13823
13824    /// IP address of a GKE Pod. If the Pod is dual-stack, this is the IP address
13825    /// relevant to the trace.
13826    pub ip_address: std::string::String,
13827
13828    /// URI of the network containing the GKE Pod.
13829    pub network_uri: std::string::String,
13830
13831    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13832}
13833
13834impl GkePodInfo {
13835    /// Creates a new default instance.
13836    pub fn new() -> Self {
13837        std::default::Default::default()
13838    }
13839
13840    /// Sets the value of [pod_uri][crate::model::GkePodInfo::pod_uri].
13841    ///
13842    /// # Example
13843    /// ```ignore,no_run
13844    /// # use google_cloud_networkmanagement_v1::model::GkePodInfo;
13845    /// let x = GkePodInfo::new().set_pod_uri("example");
13846    /// ```
13847    pub fn set_pod_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13848        self.pod_uri = v.into();
13849        self
13850    }
13851
13852    /// Sets the value of [ip_address][crate::model::GkePodInfo::ip_address].
13853    ///
13854    /// # Example
13855    /// ```ignore,no_run
13856    /// # use google_cloud_networkmanagement_v1::model::GkePodInfo;
13857    /// let x = GkePodInfo::new().set_ip_address("example");
13858    /// ```
13859    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13860        self.ip_address = v.into();
13861        self
13862    }
13863
13864    /// Sets the value of [network_uri][crate::model::GkePodInfo::network_uri].
13865    ///
13866    /// # Example
13867    /// ```ignore,no_run
13868    /// # use google_cloud_networkmanagement_v1::model::GkePodInfo;
13869    /// let x = GkePodInfo::new().set_network_uri("example");
13870    /// ```
13871    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13872        self.network_uri = v.into();
13873        self
13874    }
13875}
13876
13877impl wkt::message::Message for GkePodInfo {
13878    fn typename() -> &'static str {
13879        "type.googleapis.com/google.cloud.networkmanagement.v1.GkePodInfo"
13880    }
13881}
13882
13883/// For display only. Contains information about why IP masquerading was skipped
13884/// for the packet.
13885#[derive(Clone, Default, PartialEq)]
13886#[non_exhaustive]
13887pub struct IpMasqueradingSkippedInfo {
13888    /// Reason why IP masquerading was not applied.
13889    pub reason: crate::model::ip_masquerading_skipped_info::Reason,
13890
13891    /// The matched non-masquerade IP range. Only set if reason is
13892    /// DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE or
13893    /// DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE.
13894    pub non_masquerade_range: std::string::String,
13895
13896    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13897}
13898
13899impl IpMasqueradingSkippedInfo {
13900    /// Creates a new default instance.
13901    pub fn new() -> Self {
13902        std::default::Default::default()
13903    }
13904
13905    /// Sets the value of [reason][crate::model::IpMasqueradingSkippedInfo::reason].
13906    ///
13907    /// # Example
13908    /// ```ignore,no_run
13909    /// # use google_cloud_networkmanagement_v1::model::IpMasqueradingSkippedInfo;
13910    /// use google_cloud_networkmanagement_v1::model::ip_masquerading_skipped_info::Reason;
13911    /// let x0 = IpMasqueradingSkippedInfo::new().set_reason(Reason::DestinationIpInConfiguredNonMasqueradeRange);
13912    /// let x1 = IpMasqueradingSkippedInfo::new().set_reason(Reason::DestinationIpInDefaultNonMasqueradeRange);
13913    /// let x2 = IpMasqueradingSkippedInfo::new().set_reason(Reason::DestinationOnSameNode);
13914    /// ```
13915    pub fn set_reason<T: std::convert::Into<crate::model::ip_masquerading_skipped_info::Reason>>(
13916        mut self,
13917        v: T,
13918    ) -> Self {
13919        self.reason = v.into();
13920        self
13921    }
13922
13923    /// Sets the value of [non_masquerade_range][crate::model::IpMasqueradingSkippedInfo::non_masquerade_range].
13924    ///
13925    /// # Example
13926    /// ```ignore,no_run
13927    /// # use google_cloud_networkmanagement_v1::model::IpMasqueradingSkippedInfo;
13928    /// let x = IpMasqueradingSkippedInfo::new().set_non_masquerade_range("example");
13929    /// ```
13930    pub fn set_non_masquerade_range<T: std::convert::Into<std::string::String>>(
13931        mut self,
13932        v: T,
13933    ) -> Self {
13934        self.non_masquerade_range = v.into();
13935        self
13936    }
13937}
13938
13939impl wkt::message::Message for IpMasqueradingSkippedInfo {
13940    fn typename() -> &'static str {
13941        "type.googleapis.com/google.cloud.networkmanagement.v1.IpMasqueradingSkippedInfo"
13942    }
13943}
13944
13945/// Defines additional types related to [IpMasqueradingSkippedInfo].
13946pub mod ip_masquerading_skipped_info {
13947    #[allow(unused_imports)]
13948    use super::*;
13949
13950    /// Reason why IP masquerading was skipped.
13951    ///
13952    /// # Working with unknown values
13953    ///
13954    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13955    /// additional enum variants at any time. Adding new variants is not considered
13956    /// a breaking change. Applications should write their code in anticipation of:
13957    ///
13958    /// - New values appearing in future releases of the client library, **and**
13959    /// - New values received dynamically, without application changes.
13960    ///
13961    /// Please consult the [Working with enums] section in the user guide for some
13962    /// guidelines.
13963    ///
13964    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13965    #[derive(Clone, Debug, PartialEq)]
13966    #[non_exhaustive]
13967    pub enum Reason {
13968        /// Unused default value.
13969        Unspecified,
13970        /// Masquerading not applied because destination IP is in one of configured
13971        /// non-masquerade ranges.
13972        DestinationIpInConfiguredNonMasqueradeRange,
13973        /// Masquerading not applied because destination IP is in one of default
13974        /// non-masquerade ranges.
13975        DestinationIpInDefaultNonMasqueradeRange,
13976        /// Masquerading not applied because destination is on the same Node.
13977        DestinationOnSameNode,
13978        /// Masquerading not applied because ip-masq-agent doesn't exist and default
13979        /// SNAT is disabled.
13980        DefaultSnatDisabled,
13981        /// Masquerading not applied because the packet's IP version is IPv6.
13982        NoMasqueradingForIpv6,
13983        /// Masquerading not applied because the source Pod uses the host Node's
13984        /// network namespace, including the Node's IP address.
13985        PodUsesNodeNetworkNamespace,
13986        /// Masquerading not applied because the packet is a return packet.
13987        NoMasqueradingForReturnPacket,
13988        /// If set, the enum was initialized with an unknown value.
13989        ///
13990        /// Applications can examine the value using [Reason::value] or
13991        /// [Reason::name].
13992        UnknownValue(reason::UnknownValue),
13993    }
13994
13995    #[doc(hidden)]
13996    pub mod reason {
13997        #[allow(unused_imports)]
13998        use super::*;
13999        #[derive(Clone, Debug, PartialEq)]
14000        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14001    }
14002
14003    impl Reason {
14004        /// Gets the enum value.
14005        ///
14006        /// Returns `None` if the enum contains an unknown value deserialized from
14007        /// the string representation of enums.
14008        pub fn value(&self) -> std::option::Option<i32> {
14009            match self {
14010                Self::Unspecified => std::option::Option::Some(0),
14011                Self::DestinationIpInConfiguredNonMasqueradeRange => std::option::Option::Some(1),
14012                Self::DestinationIpInDefaultNonMasqueradeRange => std::option::Option::Some(2),
14013                Self::DestinationOnSameNode => std::option::Option::Some(3),
14014                Self::DefaultSnatDisabled => std::option::Option::Some(4),
14015                Self::NoMasqueradingForIpv6 => std::option::Option::Some(5),
14016                Self::PodUsesNodeNetworkNamespace => std::option::Option::Some(6),
14017                Self::NoMasqueradingForReturnPacket => std::option::Option::Some(7),
14018                Self::UnknownValue(u) => u.0.value(),
14019            }
14020        }
14021
14022        /// Gets the enum value as a string.
14023        ///
14024        /// Returns `None` if the enum contains an unknown value deserialized from
14025        /// the integer representation of enums.
14026        pub fn name(&self) -> std::option::Option<&str> {
14027            match self {
14028                Self::Unspecified => std::option::Option::Some("REASON_UNSPECIFIED"),
14029                Self::DestinationIpInConfiguredNonMasqueradeRange => {
14030                    std::option::Option::Some("DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE")
14031                }
14032                Self::DestinationIpInDefaultNonMasqueradeRange => {
14033                    std::option::Option::Some("DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE")
14034                }
14035                Self::DestinationOnSameNode => {
14036                    std::option::Option::Some("DESTINATION_ON_SAME_NODE")
14037                }
14038                Self::DefaultSnatDisabled => std::option::Option::Some("DEFAULT_SNAT_DISABLED"),
14039                Self::NoMasqueradingForIpv6 => {
14040                    std::option::Option::Some("NO_MASQUERADING_FOR_IPV6")
14041                }
14042                Self::PodUsesNodeNetworkNamespace => {
14043                    std::option::Option::Some("POD_USES_NODE_NETWORK_NAMESPACE")
14044                }
14045                Self::NoMasqueradingForReturnPacket => {
14046                    std::option::Option::Some("NO_MASQUERADING_FOR_RETURN_PACKET")
14047                }
14048                Self::UnknownValue(u) => u.0.name(),
14049            }
14050        }
14051    }
14052
14053    impl std::default::Default for Reason {
14054        fn default() -> Self {
14055            use std::convert::From;
14056            Self::from(0)
14057        }
14058    }
14059
14060    impl std::fmt::Display for Reason {
14061        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14062            wkt::internal::display_enum(f, self.name(), self.value())
14063        }
14064    }
14065
14066    impl std::convert::From<i32> for Reason {
14067        fn from(value: i32) -> Self {
14068            match value {
14069                0 => Self::Unspecified,
14070                1 => Self::DestinationIpInConfiguredNonMasqueradeRange,
14071                2 => Self::DestinationIpInDefaultNonMasqueradeRange,
14072                3 => Self::DestinationOnSameNode,
14073                4 => Self::DefaultSnatDisabled,
14074                5 => Self::NoMasqueradingForIpv6,
14075                6 => Self::PodUsesNodeNetworkNamespace,
14076                7 => Self::NoMasqueradingForReturnPacket,
14077                _ => Self::UnknownValue(reason::UnknownValue(
14078                    wkt::internal::UnknownEnumValue::Integer(value),
14079                )),
14080            }
14081        }
14082    }
14083
14084    impl std::convert::From<&str> for Reason {
14085        fn from(value: &str) -> Self {
14086            use std::string::ToString;
14087            match value {
14088                "REASON_UNSPECIFIED" => Self::Unspecified,
14089                "DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE" => {
14090                    Self::DestinationIpInConfiguredNonMasqueradeRange
14091                }
14092                "DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE" => {
14093                    Self::DestinationIpInDefaultNonMasqueradeRange
14094                }
14095                "DESTINATION_ON_SAME_NODE" => Self::DestinationOnSameNode,
14096                "DEFAULT_SNAT_DISABLED" => Self::DefaultSnatDisabled,
14097                "NO_MASQUERADING_FOR_IPV6" => Self::NoMasqueradingForIpv6,
14098                "POD_USES_NODE_NETWORK_NAMESPACE" => Self::PodUsesNodeNetworkNamespace,
14099                "NO_MASQUERADING_FOR_RETURN_PACKET" => Self::NoMasqueradingForReturnPacket,
14100                _ => Self::UnknownValue(reason::UnknownValue(
14101                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14102                )),
14103            }
14104        }
14105    }
14106
14107    impl serde::ser::Serialize for Reason {
14108        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14109        where
14110            S: serde::Serializer,
14111        {
14112            match self {
14113                Self::Unspecified => serializer.serialize_i32(0),
14114                Self::DestinationIpInConfiguredNonMasqueradeRange => serializer.serialize_i32(1),
14115                Self::DestinationIpInDefaultNonMasqueradeRange => serializer.serialize_i32(2),
14116                Self::DestinationOnSameNode => serializer.serialize_i32(3),
14117                Self::DefaultSnatDisabled => serializer.serialize_i32(4),
14118                Self::NoMasqueradingForIpv6 => serializer.serialize_i32(5),
14119                Self::PodUsesNodeNetworkNamespace => serializer.serialize_i32(6),
14120                Self::NoMasqueradingForReturnPacket => serializer.serialize_i32(7),
14121                Self::UnknownValue(u) => u.0.serialize(serializer),
14122            }
14123        }
14124    }
14125
14126    impl<'de> serde::de::Deserialize<'de> for Reason {
14127        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14128        where
14129            D: serde::Deserializer<'de>,
14130        {
14131            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Reason>::new(
14132                ".google.cloud.networkmanagement.v1.IpMasqueradingSkippedInfo.Reason",
14133            ))
14134        }
14135    }
14136}
14137
14138/// For display only. Metadata associated with a GKE Network Policy.
14139#[derive(Clone, Default, PartialEq)]
14140#[non_exhaustive]
14141pub struct GkeNetworkPolicyInfo {
14142    /// The name of the Network Policy.
14143    pub display_name: std::string::String,
14144
14145    /// The URI of the Network Policy.
14146    /// Format for a Network Policy in a zonal cluster:
14147    /// `projects/<project_id>/zones/<zone>/clusters/<cluster>/k8s/namespaces/<namespace>/networking.k8s.io/networkpolicies/<networkpolicy>`
14148    /// Format for a Network Policy in a regional cluster:
14149    /// `projects/<project_id>/locations/<location>/clusters/<cluster>/k8s/namespaces/<namespace>/networking.k8s.io/networkpolicies/<networkpolicy>`
14150    pub uri: std::string::String,
14151
14152    /// Possible values: INGRESS, EGRESS
14153    pub direction: std::string::String,
14154
14155    /// Possible values: ALLOW, DENY
14156    pub action: std::string::String,
14157
14158    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14159}
14160
14161impl GkeNetworkPolicyInfo {
14162    /// Creates a new default instance.
14163    pub fn new() -> Self {
14164        std::default::Default::default()
14165    }
14166
14167    /// Sets the value of [display_name][crate::model::GkeNetworkPolicyInfo::display_name].
14168    ///
14169    /// # Example
14170    /// ```ignore,no_run
14171    /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
14172    /// let x = GkeNetworkPolicyInfo::new().set_display_name("example");
14173    /// ```
14174    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14175        self.display_name = v.into();
14176        self
14177    }
14178
14179    /// Sets the value of [uri][crate::model::GkeNetworkPolicyInfo::uri].
14180    ///
14181    /// # Example
14182    /// ```ignore,no_run
14183    /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
14184    /// let x = GkeNetworkPolicyInfo::new().set_uri("example");
14185    /// ```
14186    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14187        self.uri = v.into();
14188        self
14189    }
14190
14191    /// Sets the value of [direction][crate::model::GkeNetworkPolicyInfo::direction].
14192    ///
14193    /// # Example
14194    /// ```ignore,no_run
14195    /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
14196    /// let x = GkeNetworkPolicyInfo::new().set_direction("example");
14197    /// ```
14198    pub fn set_direction<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14199        self.direction = v.into();
14200        self
14201    }
14202
14203    /// Sets the value of [action][crate::model::GkeNetworkPolicyInfo::action].
14204    ///
14205    /// # Example
14206    /// ```ignore,no_run
14207    /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
14208    /// let x = GkeNetworkPolicyInfo::new().set_action("example");
14209    /// ```
14210    pub fn set_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14211        self.action = v.into();
14212        self
14213    }
14214}
14215
14216impl wkt::message::Message for GkeNetworkPolicyInfo {
14217    fn typename() -> &'static str {
14218        "type.googleapis.com/google.cloud.networkmanagement.v1.GkeNetworkPolicyInfo"
14219    }
14220}
14221
14222/// For display only. Contains information about why GKE Network Policy
14223/// evaluation was skipped.
14224#[derive(Clone, Default, PartialEq)]
14225#[non_exhaustive]
14226pub struct GkeNetworkPolicySkippedInfo {
14227    /// Reason why Network Policy evaluation was skipped.
14228    pub reason: crate::model::gke_network_policy_skipped_info::Reason,
14229
14230    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14231}
14232
14233impl GkeNetworkPolicySkippedInfo {
14234    /// Creates a new default instance.
14235    pub fn new() -> Self {
14236        std::default::Default::default()
14237    }
14238
14239    /// Sets the value of [reason][crate::model::GkeNetworkPolicySkippedInfo::reason].
14240    ///
14241    /// # Example
14242    /// ```ignore,no_run
14243    /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicySkippedInfo;
14244    /// use google_cloud_networkmanagement_v1::model::gke_network_policy_skipped_info::Reason;
14245    /// let x0 = GkeNetworkPolicySkippedInfo::new().set_reason(Reason::NetworkPolicyDisabled);
14246    /// let x1 = GkeNetworkPolicySkippedInfo::new().set_reason(Reason::IngressSourceOnSameNode);
14247    /// let x2 = GkeNetworkPolicySkippedInfo::new().set_reason(Reason::EgressFromNodeNetworkNamespacePod);
14248    /// ```
14249    pub fn set_reason<
14250        T: std::convert::Into<crate::model::gke_network_policy_skipped_info::Reason>,
14251    >(
14252        mut self,
14253        v: T,
14254    ) -> Self {
14255        self.reason = v.into();
14256        self
14257    }
14258}
14259
14260impl wkt::message::Message for GkeNetworkPolicySkippedInfo {
14261    fn typename() -> &'static str {
14262        "type.googleapis.com/google.cloud.networkmanagement.v1.GkeNetworkPolicySkippedInfo"
14263    }
14264}
14265
14266/// Defines additional types related to [GkeNetworkPolicySkippedInfo].
14267pub mod gke_network_policy_skipped_info {
14268    #[allow(unused_imports)]
14269    use super::*;
14270
14271    /// Enum for [Reason].
14272    ///
14273    /// # Working with unknown values
14274    ///
14275    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14276    /// additional enum variants at any time. Adding new variants is not considered
14277    /// a breaking change. Applications should write their code in anticipation of:
14278    ///
14279    /// - New values appearing in future releases of the client library, **and**
14280    /// - New values received dynamically, without application changes.
14281    ///
14282    /// Please consult the [Working with enums] section in the user guide for some
14283    /// guidelines.
14284    ///
14285    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14286    #[derive(Clone, Debug, PartialEq)]
14287    #[non_exhaustive]
14288    pub enum Reason {
14289        /// Unused default value.
14290        Unspecified,
14291        /// Network Policy is disabled on the cluster.
14292        NetworkPolicyDisabled,
14293        /// Ingress traffic to a Pod from a source on the same Node is always
14294        /// allowed.
14295        IngressSourceOnSameNode,
14296        /// Egress traffic from a Pod that uses the Node's network namespace is not
14297        /// subject to Network Policy.
14298        EgressFromNodeNetworkNamespacePod,
14299        /// Network Policy is not applied to response traffic. This is because GKE
14300        /// Network Policy evaluation is stateful in both GKE Dataplane V2 (eBPF) and
14301        /// legacy (iptables) implementations.
14302        NetworkPolicyNotAppliedToResponseTraffic,
14303        /// Network Policy evaluation is currently not supported for clusters with
14304        /// FQDN Network Policies enabled.
14305        NetworkPolicyAnalysisUnsupported,
14306        /// If set, the enum was initialized with an unknown value.
14307        ///
14308        /// Applications can examine the value using [Reason::value] or
14309        /// [Reason::name].
14310        UnknownValue(reason::UnknownValue),
14311    }
14312
14313    #[doc(hidden)]
14314    pub mod reason {
14315        #[allow(unused_imports)]
14316        use super::*;
14317        #[derive(Clone, Debug, PartialEq)]
14318        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14319    }
14320
14321    impl Reason {
14322        /// Gets the enum value.
14323        ///
14324        /// Returns `None` if the enum contains an unknown value deserialized from
14325        /// the string representation of enums.
14326        pub fn value(&self) -> std::option::Option<i32> {
14327            match self {
14328                Self::Unspecified => std::option::Option::Some(0),
14329                Self::NetworkPolicyDisabled => std::option::Option::Some(1),
14330                Self::IngressSourceOnSameNode => std::option::Option::Some(2),
14331                Self::EgressFromNodeNetworkNamespacePod => std::option::Option::Some(3),
14332                Self::NetworkPolicyNotAppliedToResponseTraffic => std::option::Option::Some(4),
14333                Self::NetworkPolicyAnalysisUnsupported => std::option::Option::Some(100),
14334                Self::UnknownValue(u) => u.0.value(),
14335            }
14336        }
14337
14338        /// Gets the enum value as a string.
14339        ///
14340        /// Returns `None` if the enum contains an unknown value deserialized from
14341        /// the integer representation of enums.
14342        pub fn name(&self) -> std::option::Option<&str> {
14343            match self {
14344                Self::Unspecified => std::option::Option::Some("REASON_UNSPECIFIED"),
14345                Self::NetworkPolicyDisabled => std::option::Option::Some("NETWORK_POLICY_DISABLED"),
14346                Self::IngressSourceOnSameNode => {
14347                    std::option::Option::Some("INGRESS_SOURCE_ON_SAME_NODE")
14348                }
14349                Self::EgressFromNodeNetworkNamespacePod => {
14350                    std::option::Option::Some("EGRESS_FROM_NODE_NETWORK_NAMESPACE_POD")
14351                }
14352                Self::NetworkPolicyNotAppliedToResponseTraffic => {
14353                    std::option::Option::Some("NETWORK_POLICY_NOT_APPLIED_TO_RESPONSE_TRAFFIC")
14354                }
14355                Self::NetworkPolicyAnalysisUnsupported => {
14356                    std::option::Option::Some("NETWORK_POLICY_ANALYSIS_UNSUPPORTED")
14357                }
14358                Self::UnknownValue(u) => u.0.name(),
14359            }
14360        }
14361    }
14362
14363    impl std::default::Default for Reason {
14364        fn default() -> Self {
14365            use std::convert::From;
14366            Self::from(0)
14367        }
14368    }
14369
14370    impl std::fmt::Display for Reason {
14371        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14372            wkt::internal::display_enum(f, self.name(), self.value())
14373        }
14374    }
14375
14376    impl std::convert::From<i32> for Reason {
14377        fn from(value: i32) -> Self {
14378            match value {
14379                0 => Self::Unspecified,
14380                1 => Self::NetworkPolicyDisabled,
14381                2 => Self::IngressSourceOnSameNode,
14382                3 => Self::EgressFromNodeNetworkNamespacePod,
14383                4 => Self::NetworkPolicyNotAppliedToResponseTraffic,
14384                100 => Self::NetworkPolicyAnalysisUnsupported,
14385                _ => Self::UnknownValue(reason::UnknownValue(
14386                    wkt::internal::UnknownEnumValue::Integer(value),
14387                )),
14388            }
14389        }
14390    }
14391
14392    impl std::convert::From<&str> for Reason {
14393        fn from(value: &str) -> Self {
14394            use std::string::ToString;
14395            match value {
14396                "REASON_UNSPECIFIED" => Self::Unspecified,
14397                "NETWORK_POLICY_DISABLED" => Self::NetworkPolicyDisabled,
14398                "INGRESS_SOURCE_ON_SAME_NODE" => Self::IngressSourceOnSameNode,
14399                "EGRESS_FROM_NODE_NETWORK_NAMESPACE_POD" => Self::EgressFromNodeNetworkNamespacePod,
14400                "NETWORK_POLICY_NOT_APPLIED_TO_RESPONSE_TRAFFIC" => {
14401                    Self::NetworkPolicyNotAppliedToResponseTraffic
14402                }
14403                "NETWORK_POLICY_ANALYSIS_UNSUPPORTED" => Self::NetworkPolicyAnalysisUnsupported,
14404                _ => Self::UnknownValue(reason::UnknownValue(
14405                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14406                )),
14407            }
14408        }
14409    }
14410
14411    impl serde::ser::Serialize for Reason {
14412        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14413        where
14414            S: serde::Serializer,
14415        {
14416            match self {
14417                Self::Unspecified => serializer.serialize_i32(0),
14418                Self::NetworkPolicyDisabled => serializer.serialize_i32(1),
14419                Self::IngressSourceOnSameNode => serializer.serialize_i32(2),
14420                Self::EgressFromNodeNetworkNamespacePod => serializer.serialize_i32(3),
14421                Self::NetworkPolicyNotAppliedToResponseTraffic => serializer.serialize_i32(4),
14422                Self::NetworkPolicyAnalysisUnsupported => serializer.serialize_i32(100),
14423                Self::UnknownValue(u) => u.0.serialize(serializer),
14424            }
14425        }
14426    }
14427
14428    impl<'de> serde::de::Deserialize<'de> for Reason {
14429        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14430        where
14431            D: serde::Deserializer<'de>,
14432        {
14433            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Reason>::new(
14434                ".google.cloud.networkmanagement.v1.GkeNetworkPolicySkippedInfo.Reason",
14435            ))
14436        }
14437    }
14438}
14439
14440/// For display only. Metadata associated with a Cloud SQL instance.
14441#[derive(Clone, Default, PartialEq)]
14442#[non_exhaustive]
14443pub struct CloudSQLInstanceInfo {
14444    /// Name of a Cloud SQL instance.
14445    pub display_name: std::string::String,
14446
14447    /// URI of a Cloud SQL instance.
14448    pub uri: std::string::String,
14449
14450    /// URI of a Cloud SQL instance network or empty string if the instance does
14451    /// not have one.
14452    pub network_uri: std::string::String,
14453
14454    /// Internal IP address of a Cloud SQL instance.
14455    pub internal_ip: std::string::String,
14456
14457    /// External IP address of a Cloud SQL instance.
14458    pub external_ip: std::string::String,
14459
14460    /// Region in which the Cloud SQL instance is running.
14461    pub region: std::string::String,
14462
14463    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14464}
14465
14466impl CloudSQLInstanceInfo {
14467    /// Creates a new default instance.
14468    pub fn new() -> Self {
14469        std::default::Default::default()
14470    }
14471
14472    /// Sets the value of [display_name][crate::model::CloudSQLInstanceInfo::display_name].
14473    ///
14474    /// # Example
14475    /// ```ignore,no_run
14476    /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14477    /// let x = CloudSQLInstanceInfo::new().set_display_name("example");
14478    /// ```
14479    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14480        self.display_name = v.into();
14481        self
14482    }
14483
14484    /// Sets the value of [uri][crate::model::CloudSQLInstanceInfo::uri].
14485    ///
14486    /// # Example
14487    /// ```ignore,no_run
14488    /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14489    /// let x = CloudSQLInstanceInfo::new().set_uri("example");
14490    /// ```
14491    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14492        self.uri = v.into();
14493        self
14494    }
14495
14496    /// Sets the value of [network_uri][crate::model::CloudSQLInstanceInfo::network_uri].
14497    ///
14498    /// # Example
14499    /// ```ignore,no_run
14500    /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14501    /// let x = CloudSQLInstanceInfo::new().set_network_uri("example");
14502    /// ```
14503    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14504        self.network_uri = v.into();
14505        self
14506    }
14507
14508    /// Sets the value of [internal_ip][crate::model::CloudSQLInstanceInfo::internal_ip].
14509    ///
14510    /// # Example
14511    /// ```ignore,no_run
14512    /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14513    /// let x = CloudSQLInstanceInfo::new().set_internal_ip("example");
14514    /// ```
14515    pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14516        self.internal_ip = v.into();
14517        self
14518    }
14519
14520    /// Sets the value of [external_ip][crate::model::CloudSQLInstanceInfo::external_ip].
14521    ///
14522    /// # Example
14523    /// ```ignore,no_run
14524    /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14525    /// let x = CloudSQLInstanceInfo::new().set_external_ip("example");
14526    /// ```
14527    pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14528        self.external_ip = v.into();
14529        self
14530    }
14531
14532    /// Sets the value of [region][crate::model::CloudSQLInstanceInfo::region].
14533    ///
14534    /// # Example
14535    /// ```ignore,no_run
14536    /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14537    /// let x = CloudSQLInstanceInfo::new().set_region("example");
14538    /// ```
14539    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14540        self.region = v.into();
14541        self
14542    }
14543}
14544
14545impl wkt::message::Message for CloudSQLInstanceInfo {
14546    fn typename() -> &'static str {
14547        "type.googleapis.com/google.cloud.networkmanagement.v1.CloudSQLInstanceInfo"
14548    }
14549}
14550
14551/// For display only. Metadata associated with a Cloud Redis Instance.
14552#[derive(Clone, Default, PartialEq)]
14553#[non_exhaustive]
14554pub struct RedisInstanceInfo {
14555    /// Name of a Cloud Redis Instance.
14556    pub display_name: std::string::String,
14557
14558    /// URI of a Cloud Redis Instance.
14559    pub uri: std::string::String,
14560
14561    /// URI of a Cloud Redis Instance network.
14562    pub network_uri: std::string::String,
14563
14564    /// Primary endpoint IP address of a Cloud Redis Instance.
14565    pub primary_endpoint_ip: std::string::String,
14566
14567    /// Read endpoint IP address of a Cloud Redis Instance (if applicable).
14568    pub read_endpoint_ip: std::string::String,
14569
14570    /// Region in which the Cloud Redis Instance is defined.
14571    pub region: std::string::String,
14572
14573    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14574}
14575
14576impl RedisInstanceInfo {
14577    /// Creates a new default instance.
14578    pub fn new() -> Self {
14579        std::default::Default::default()
14580    }
14581
14582    /// Sets the value of [display_name][crate::model::RedisInstanceInfo::display_name].
14583    ///
14584    /// # Example
14585    /// ```ignore,no_run
14586    /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14587    /// let x = RedisInstanceInfo::new().set_display_name("example");
14588    /// ```
14589    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14590        self.display_name = v.into();
14591        self
14592    }
14593
14594    /// Sets the value of [uri][crate::model::RedisInstanceInfo::uri].
14595    ///
14596    /// # Example
14597    /// ```ignore,no_run
14598    /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14599    /// let x = RedisInstanceInfo::new().set_uri("example");
14600    /// ```
14601    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14602        self.uri = v.into();
14603        self
14604    }
14605
14606    /// Sets the value of [network_uri][crate::model::RedisInstanceInfo::network_uri].
14607    ///
14608    /// # Example
14609    /// ```ignore,no_run
14610    /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14611    /// let x = RedisInstanceInfo::new().set_network_uri("example");
14612    /// ```
14613    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14614        self.network_uri = v.into();
14615        self
14616    }
14617
14618    /// Sets the value of [primary_endpoint_ip][crate::model::RedisInstanceInfo::primary_endpoint_ip].
14619    ///
14620    /// # Example
14621    /// ```ignore,no_run
14622    /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14623    /// let x = RedisInstanceInfo::new().set_primary_endpoint_ip("example");
14624    /// ```
14625    pub fn set_primary_endpoint_ip<T: std::convert::Into<std::string::String>>(
14626        mut self,
14627        v: T,
14628    ) -> Self {
14629        self.primary_endpoint_ip = v.into();
14630        self
14631    }
14632
14633    /// Sets the value of [read_endpoint_ip][crate::model::RedisInstanceInfo::read_endpoint_ip].
14634    ///
14635    /// # Example
14636    /// ```ignore,no_run
14637    /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14638    /// let x = RedisInstanceInfo::new().set_read_endpoint_ip("example");
14639    /// ```
14640    pub fn set_read_endpoint_ip<T: std::convert::Into<std::string::String>>(
14641        mut self,
14642        v: T,
14643    ) -> Self {
14644        self.read_endpoint_ip = v.into();
14645        self
14646    }
14647
14648    /// Sets the value of [region][crate::model::RedisInstanceInfo::region].
14649    ///
14650    /// # Example
14651    /// ```ignore,no_run
14652    /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14653    /// let x = RedisInstanceInfo::new().set_region("example");
14654    /// ```
14655    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14656        self.region = v.into();
14657        self
14658    }
14659}
14660
14661impl wkt::message::Message for RedisInstanceInfo {
14662    fn typename() -> &'static str {
14663        "type.googleapis.com/google.cloud.networkmanagement.v1.RedisInstanceInfo"
14664    }
14665}
14666
14667/// For display only. Metadata associated with a Redis Cluster.
14668#[derive(Clone, Default, PartialEq)]
14669#[non_exhaustive]
14670pub struct RedisClusterInfo {
14671    /// Name of a Redis Cluster.
14672    pub display_name: std::string::String,
14673
14674    /// URI of a Redis Cluster in format
14675    /// "projects/{project_id}/locations/{location}/clusters/{cluster_id}"
14676    pub uri: std::string::String,
14677
14678    /// URI of the network containing the Redis Cluster endpoints in format
14679    /// "projects/{project_id}/global/networks/{network_id}".
14680    pub network_uri: std::string::String,
14681
14682    /// Discovery endpoint IP address of a Redis Cluster.
14683    pub discovery_endpoint_ip_address: std::string::String,
14684
14685    /// Secondary endpoint IP address of a Redis Cluster.
14686    pub secondary_endpoint_ip_address: std::string::String,
14687
14688    /// Name of the region in which the Redis Cluster is defined. For example,
14689    /// "us-central1".
14690    pub location: std::string::String,
14691
14692    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14693}
14694
14695impl RedisClusterInfo {
14696    /// Creates a new default instance.
14697    pub fn new() -> Self {
14698        std::default::Default::default()
14699    }
14700
14701    /// Sets the value of [display_name][crate::model::RedisClusterInfo::display_name].
14702    ///
14703    /// # Example
14704    /// ```ignore,no_run
14705    /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14706    /// let x = RedisClusterInfo::new().set_display_name("example");
14707    /// ```
14708    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14709        self.display_name = v.into();
14710        self
14711    }
14712
14713    /// Sets the value of [uri][crate::model::RedisClusterInfo::uri].
14714    ///
14715    /// # Example
14716    /// ```ignore,no_run
14717    /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14718    /// let x = RedisClusterInfo::new().set_uri("example");
14719    /// ```
14720    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14721        self.uri = v.into();
14722        self
14723    }
14724
14725    /// Sets the value of [network_uri][crate::model::RedisClusterInfo::network_uri].
14726    ///
14727    /// # Example
14728    /// ```ignore,no_run
14729    /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14730    /// let x = RedisClusterInfo::new().set_network_uri("example");
14731    /// ```
14732    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14733        self.network_uri = v.into();
14734        self
14735    }
14736
14737    /// Sets the value of [discovery_endpoint_ip_address][crate::model::RedisClusterInfo::discovery_endpoint_ip_address].
14738    ///
14739    /// # Example
14740    /// ```ignore,no_run
14741    /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14742    /// let x = RedisClusterInfo::new().set_discovery_endpoint_ip_address("example");
14743    /// ```
14744    pub fn set_discovery_endpoint_ip_address<T: std::convert::Into<std::string::String>>(
14745        mut self,
14746        v: T,
14747    ) -> Self {
14748        self.discovery_endpoint_ip_address = v.into();
14749        self
14750    }
14751
14752    /// Sets the value of [secondary_endpoint_ip_address][crate::model::RedisClusterInfo::secondary_endpoint_ip_address].
14753    ///
14754    /// # Example
14755    /// ```ignore,no_run
14756    /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14757    /// let x = RedisClusterInfo::new().set_secondary_endpoint_ip_address("example");
14758    /// ```
14759    pub fn set_secondary_endpoint_ip_address<T: std::convert::Into<std::string::String>>(
14760        mut self,
14761        v: T,
14762    ) -> Self {
14763        self.secondary_endpoint_ip_address = v.into();
14764        self
14765    }
14766
14767    /// Sets the value of [location][crate::model::RedisClusterInfo::location].
14768    ///
14769    /// # Example
14770    /// ```ignore,no_run
14771    /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14772    /// let x = RedisClusterInfo::new().set_location("example");
14773    /// ```
14774    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14775        self.location = v.into();
14776        self
14777    }
14778}
14779
14780impl wkt::message::Message for RedisClusterInfo {
14781    fn typename() -> &'static str {
14782        "type.googleapis.com/google.cloud.networkmanagement.v1.RedisClusterInfo"
14783    }
14784}
14785
14786/// For display only. Metadata associated with a Cloud Function.
14787#[derive(Clone, Default, PartialEq)]
14788#[non_exhaustive]
14789pub struct CloudFunctionInfo {
14790    /// Name of a Cloud Function.
14791    pub display_name: std::string::String,
14792
14793    /// URI of a Cloud Function.
14794    pub uri: std::string::String,
14795
14796    /// Location in which the Cloud Function is deployed.
14797    pub location: std::string::String,
14798
14799    /// Latest successfully deployed version id of the Cloud Function.
14800    pub version_id: i64,
14801
14802    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14803}
14804
14805impl CloudFunctionInfo {
14806    /// Creates a new default instance.
14807    pub fn new() -> Self {
14808        std::default::Default::default()
14809    }
14810
14811    /// Sets the value of [display_name][crate::model::CloudFunctionInfo::display_name].
14812    ///
14813    /// # Example
14814    /// ```ignore,no_run
14815    /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
14816    /// let x = CloudFunctionInfo::new().set_display_name("example");
14817    /// ```
14818    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14819        self.display_name = v.into();
14820        self
14821    }
14822
14823    /// Sets the value of [uri][crate::model::CloudFunctionInfo::uri].
14824    ///
14825    /// # Example
14826    /// ```ignore,no_run
14827    /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
14828    /// let x = CloudFunctionInfo::new().set_uri("example");
14829    /// ```
14830    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14831        self.uri = v.into();
14832        self
14833    }
14834
14835    /// Sets the value of [location][crate::model::CloudFunctionInfo::location].
14836    ///
14837    /// # Example
14838    /// ```ignore,no_run
14839    /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
14840    /// let x = CloudFunctionInfo::new().set_location("example");
14841    /// ```
14842    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14843        self.location = v.into();
14844        self
14845    }
14846
14847    /// Sets the value of [version_id][crate::model::CloudFunctionInfo::version_id].
14848    ///
14849    /// # Example
14850    /// ```ignore,no_run
14851    /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
14852    /// let x = CloudFunctionInfo::new().set_version_id(42);
14853    /// ```
14854    pub fn set_version_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14855        self.version_id = v.into();
14856        self
14857    }
14858}
14859
14860impl wkt::message::Message for CloudFunctionInfo {
14861    fn typename() -> &'static str {
14862        "type.googleapis.com/google.cloud.networkmanagement.v1.CloudFunctionInfo"
14863    }
14864}
14865
14866/// For display only. Metadata associated with a Cloud Run revision.
14867#[derive(Clone, Default, PartialEq)]
14868#[non_exhaustive]
14869pub struct CloudRunRevisionInfo {
14870    /// Name of a Cloud Run revision.
14871    pub display_name: std::string::String,
14872
14873    /// URI of a Cloud Run revision.
14874    pub uri: std::string::String,
14875
14876    /// Location in which this revision is deployed.
14877    pub location: std::string::String,
14878
14879    /// URI of Cloud Run service this revision belongs to.
14880    pub service_uri: std::string::String,
14881
14882    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14883}
14884
14885impl CloudRunRevisionInfo {
14886    /// Creates a new default instance.
14887    pub fn new() -> Self {
14888        std::default::Default::default()
14889    }
14890
14891    /// Sets the value of [display_name][crate::model::CloudRunRevisionInfo::display_name].
14892    ///
14893    /// # Example
14894    /// ```ignore,no_run
14895    /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
14896    /// let x = CloudRunRevisionInfo::new().set_display_name("example");
14897    /// ```
14898    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14899        self.display_name = v.into();
14900        self
14901    }
14902
14903    /// Sets the value of [uri][crate::model::CloudRunRevisionInfo::uri].
14904    ///
14905    /// # Example
14906    /// ```ignore,no_run
14907    /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
14908    /// let x = CloudRunRevisionInfo::new().set_uri("example");
14909    /// ```
14910    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14911        self.uri = v.into();
14912        self
14913    }
14914
14915    /// Sets the value of [location][crate::model::CloudRunRevisionInfo::location].
14916    ///
14917    /// # Example
14918    /// ```ignore,no_run
14919    /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
14920    /// let x = CloudRunRevisionInfo::new().set_location("example");
14921    /// ```
14922    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14923        self.location = v.into();
14924        self
14925    }
14926
14927    /// Sets the value of [service_uri][crate::model::CloudRunRevisionInfo::service_uri].
14928    ///
14929    /// # Example
14930    /// ```ignore,no_run
14931    /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
14932    /// let x = CloudRunRevisionInfo::new().set_service_uri("example");
14933    /// ```
14934    pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14935        self.service_uri = v.into();
14936        self
14937    }
14938}
14939
14940impl wkt::message::Message for CloudRunRevisionInfo {
14941    fn typename() -> &'static str {
14942        "type.googleapis.com/google.cloud.networkmanagement.v1.CloudRunRevisionInfo"
14943    }
14944}
14945
14946/// For display only. Metadata associated with an App Engine version.
14947#[derive(Clone, Default, PartialEq)]
14948#[non_exhaustive]
14949pub struct AppEngineVersionInfo {
14950    /// Name of an App Engine version.
14951    pub display_name: std::string::String,
14952
14953    /// URI of an App Engine version.
14954    pub uri: std::string::String,
14955
14956    /// Runtime of the App Engine version.
14957    pub runtime: std::string::String,
14958
14959    /// App Engine execution environment for a version.
14960    pub environment: std::string::String,
14961
14962    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14963}
14964
14965impl AppEngineVersionInfo {
14966    /// Creates a new default instance.
14967    pub fn new() -> Self {
14968        std::default::Default::default()
14969    }
14970
14971    /// Sets the value of [display_name][crate::model::AppEngineVersionInfo::display_name].
14972    ///
14973    /// # Example
14974    /// ```ignore,no_run
14975    /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
14976    /// let x = AppEngineVersionInfo::new().set_display_name("example");
14977    /// ```
14978    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14979        self.display_name = v.into();
14980        self
14981    }
14982
14983    /// Sets the value of [uri][crate::model::AppEngineVersionInfo::uri].
14984    ///
14985    /// # Example
14986    /// ```ignore,no_run
14987    /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
14988    /// let x = AppEngineVersionInfo::new().set_uri("example");
14989    /// ```
14990    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14991        self.uri = v.into();
14992        self
14993    }
14994
14995    /// Sets the value of [runtime][crate::model::AppEngineVersionInfo::runtime].
14996    ///
14997    /// # Example
14998    /// ```ignore,no_run
14999    /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
15000    /// let x = AppEngineVersionInfo::new().set_runtime("example");
15001    /// ```
15002    pub fn set_runtime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15003        self.runtime = v.into();
15004        self
15005    }
15006
15007    /// Sets the value of [environment][crate::model::AppEngineVersionInfo::environment].
15008    ///
15009    /// # Example
15010    /// ```ignore,no_run
15011    /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
15012    /// let x = AppEngineVersionInfo::new().set_environment("example");
15013    /// ```
15014    pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15015        self.environment = v.into();
15016        self
15017    }
15018}
15019
15020impl wkt::message::Message for AppEngineVersionInfo {
15021    fn typename() -> &'static str {
15022        "type.googleapis.com/google.cloud.networkmanagement.v1.AppEngineVersionInfo"
15023    }
15024}
15025
15026/// For display only. Metadata associated with a VPC connector.
15027#[derive(Clone, Default, PartialEq)]
15028#[non_exhaustive]
15029pub struct VpcConnectorInfo {
15030    /// Name of a VPC connector.
15031    pub display_name: std::string::String,
15032
15033    /// URI of a VPC connector.
15034    pub uri: std::string::String,
15035
15036    /// Location in which the VPC connector is deployed.
15037    pub location: std::string::String,
15038
15039    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15040}
15041
15042impl VpcConnectorInfo {
15043    /// Creates a new default instance.
15044    pub fn new() -> Self {
15045        std::default::Default::default()
15046    }
15047
15048    /// Sets the value of [display_name][crate::model::VpcConnectorInfo::display_name].
15049    ///
15050    /// # Example
15051    /// ```ignore,no_run
15052    /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
15053    /// let x = VpcConnectorInfo::new().set_display_name("example");
15054    /// ```
15055    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15056        self.display_name = v.into();
15057        self
15058    }
15059
15060    /// Sets the value of [uri][crate::model::VpcConnectorInfo::uri].
15061    ///
15062    /// # Example
15063    /// ```ignore,no_run
15064    /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
15065    /// let x = VpcConnectorInfo::new().set_uri("example");
15066    /// ```
15067    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15068        self.uri = v.into();
15069        self
15070    }
15071
15072    /// Sets the value of [location][crate::model::VpcConnectorInfo::location].
15073    ///
15074    /// # Example
15075    /// ```ignore,no_run
15076    /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
15077    /// let x = VpcConnectorInfo::new().set_location("example");
15078    /// ```
15079    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15080        self.location = v.into();
15081        self
15082    }
15083}
15084
15085impl wkt::message::Message for VpcConnectorInfo {
15086    fn typename() -> &'static str {
15087        "type.googleapis.com/google.cloud.networkmanagement.v1.VpcConnectorInfo"
15088    }
15089}
15090
15091/// For display only. Metadata associated with a serverless direct VPC egress
15092/// connection.
15093#[derive(Clone, Default, PartialEq)]
15094#[non_exhaustive]
15095pub struct DirectVpcEgressConnectionInfo {
15096    /// URI of direct access network.
15097    pub network_uri: std::string::String,
15098
15099    /// URI of direct access subnetwork.
15100    pub subnetwork_uri: std::string::String,
15101
15102    /// Selected IP range.
15103    pub selected_ip_range: std::string::String,
15104
15105    /// Selected starting IP address, from the selected IP range.
15106    pub selected_ip_address: std::string::String,
15107
15108    /// Region in which the Direct VPC egress is deployed.
15109    pub region: std::string::String,
15110
15111    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15112}
15113
15114impl DirectVpcEgressConnectionInfo {
15115    /// Creates a new default instance.
15116    pub fn new() -> Self {
15117        std::default::Default::default()
15118    }
15119
15120    /// Sets the value of [network_uri][crate::model::DirectVpcEgressConnectionInfo::network_uri].
15121    ///
15122    /// # Example
15123    /// ```ignore,no_run
15124    /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15125    /// let x = DirectVpcEgressConnectionInfo::new().set_network_uri("example");
15126    /// ```
15127    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15128        self.network_uri = v.into();
15129        self
15130    }
15131
15132    /// Sets the value of [subnetwork_uri][crate::model::DirectVpcEgressConnectionInfo::subnetwork_uri].
15133    ///
15134    /// # Example
15135    /// ```ignore,no_run
15136    /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15137    /// let x = DirectVpcEgressConnectionInfo::new().set_subnetwork_uri("example");
15138    /// ```
15139    pub fn set_subnetwork_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15140        self.subnetwork_uri = v.into();
15141        self
15142    }
15143
15144    /// Sets the value of [selected_ip_range][crate::model::DirectVpcEgressConnectionInfo::selected_ip_range].
15145    ///
15146    /// # Example
15147    /// ```ignore,no_run
15148    /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15149    /// let x = DirectVpcEgressConnectionInfo::new().set_selected_ip_range("example");
15150    /// ```
15151    pub fn set_selected_ip_range<T: std::convert::Into<std::string::String>>(
15152        mut self,
15153        v: T,
15154    ) -> Self {
15155        self.selected_ip_range = v.into();
15156        self
15157    }
15158
15159    /// Sets the value of [selected_ip_address][crate::model::DirectVpcEgressConnectionInfo::selected_ip_address].
15160    ///
15161    /// # Example
15162    /// ```ignore,no_run
15163    /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15164    /// let x = DirectVpcEgressConnectionInfo::new().set_selected_ip_address("example");
15165    /// ```
15166    pub fn set_selected_ip_address<T: std::convert::Into<std::string::String>>(
15167        mut self,
15168        v: T,
15169    ) -> Self {
15170        self.selected_ip_address = v.into();
15171        self
15172    }
15173
15174    /// Sets the value of [region][crate::model::DirectVpcEgressConnectionInfo::region].
15175    ///
15176    /// # Example
15177    /// ```ignore,no_run
15178    /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15179    /// let x = DirectVpcEgressConnectionInfo::new().set_region("example");
15180    /// ```
15181    pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15182        self.region = v.into();
15183        self
15184    }
15185}
15186
15187impl wkt::message::Message for DirectVpcEgressConnectionInfo {
15188    fn typename() -> &'static str {
15189        "type.googleapis.com/google.cloud.networkmanagement.v1.DirectVpcEgressConnectionInfo"
15190    }
15191}
15192
15193/// For display only. Metadata associated with a serverless public connection.
15194#[derive(Clone, Default, PartialEq)]
15195#[non_exhaustive]
15196pub struct ServerlessExternalConnectionInfo {
15197    /// Selected starting IP address, from the Google dynamic address pool.
15198    pub selected_ip_address: std::string::String,
15199
15200    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15201}
15202
15203impl ServerlessExternalConnectionInfo {
15204    /// Creates a new default instance.
15205    pub fn new() -> Self {
15206        std::default::Default::default()
15207    }
15208
15209    /// Sets the value of [selected_ip_address][crate::model::ServerlessExternalConnectionInfo::selected_ip_address].
15210    ///
15211    /// # Example
15212    /// ```ignore,no_run
15213    /// # use google_cloud_networkmanagement_v1::model::ServerlessExternalConnectionInfo;
15214    /// let x = ServerlessExternalConnectionInfo::new().set_selected_ip_address("example");
15215    /// ```
15216    pub fn set_selected_ip_address<T: std::convert::Into<std::string::String>>(
15217        mut self,
15218        v: T,
15219    ) -> Self {
15220        self.selected_ip_address = v.into();
15221        self
15222    }
15223}
15224
15225impl wkt::message::Message for ServerlessExternalConnectionInfo {
15226    fn typename() -> &'static str {
15227        "type.googleapis.com/google.cloud.networkmanagement.v1.ServerlessExternalConnectionInfo"
15228    }
15229}
15230
15231/// For display only. Metadata associated with NAT.
15232#[derive(Clone, Default, PartialEq)]
15233#[non_exhaustive]
15234pub struct NatInfo {
15235    /// Type of NAT.
15236    pub r#type: crate::model::nat_info::Type,
15237
15238    /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
15239    pub protocol: std::string::String,
15240
15241    /// URI of the network where NAT translation takes place.
15242    pub network_uri: std::string::String,
15243
15244    /// Source IP address before NAT translation.
15245    pub old_source_ip: std::string::String,
15246
15247    /// Source IP address after NAT translation.
15248    pub new_source_ip: std::string::String,
15249
15250    /// Destination IP address before NAT translation.
15251    pub old_destination_ip: std::string::String,
15252
15253    /// Destination IP address after NAT translation.
15254    pub new_destination_ip: std::string::String,
15255
15256    /// Source port before NAT translation. Only valid when protocol is TCP or UDP.
15257    pub old_source_port: i32,
15258
15259    /// Source port after NAT translation. Only valid when protocol is TCP or UDP.
15260    pub new_source_port: i32,
15261
15262    /// Destination port before NAT translation. Only valid when protocol is TCP or
15263    /// UDP.
15264    pub old_destination_port: i32,
15265
15266    /// Destination port after NAT translation. Only valid when protocol is TCP or
15267    /// UDP.
15268    pub new_destination_port: i32,
15269
15270    /// Uri of the Cloud Router. Only valid when type is CLOUD_NAT.
15271    pub router_uri: std::string::String,
15272
15273    /// The name of Cloud NAT Gateway. Only valid when type is CLOUD_NAT.
15274    pub nat_gateway_name: std::string::String,
15275
15276    /// Type of Cloud NAT gateway. Only valid when `type` is CLOUD_NAT.
15277    pub cloud_nat_gateway_type: crate::model::nat_info::CloudNatGatewayType,
15278
15279    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15280}
15281
15282impl NatInfo {
15283    /// Creates a new default instance.
15284    pub fn new() -> Self {
15285        std::default::Default::default()
15286    }
15287
15288    /// Sets the value of [r#type][crate::model::NatInfo::type].
15289    ///
15290    /// # Example
15291    /// ```ignore,no_run
15292    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15293    /// use google_cloud_networkmanagement_v1::model::nat_info::Type;
15294    /// let x0 = NatInfo::new().set_type(Type::InternalToExternal);
15295    /// let x1 = NatInfo::new().set_type(Type::ExternalToInternal);
15296    /// let x2 = NatInfo::new().set_type(Type::CloudNat);
15297    /// ```
15298    pub fn set_type<T: std::convert::Into<crate::model::nat_info::Type>>(mut self, v: T) -> Self {
15299        self.r#type = v.into();
15300        self
15301    }
15302
15303    /// Sets the value of [protocol][crate::model::NatInfo::protocol].
15304    ///
15305    /// # Example
15306    /// ```ignore,no_run
15307    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15308    /// let x = NatInfo::new().set_protocol("example");
15309    /// ```
15310    pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15311        self.protocol = v.into();
15312        self
15313    }
15314
15315    /// Sets the value of [network_uri][crate::model::NatInfo::network_uri].
15316    ///
15317    /// # Example
15318    /// ```ignore,no_run
15319    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15320    /// let x = NatInfo::new().set_network_uri("example");
15321    /// ```
15322    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15323        self.network_uri = v.into();
15324        self
15325    }
15326
15327    /// Sets the value of [old_source_ip][crate::model::NatInfo::old_source_ip].
15328    ///
15329    /// # Example
15330    /// ```ignore,no_run
15331    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15332    /// let x = NatInfo::new().set_old_source_ip("example");
15333    /// ```
15334    pub fn set_old_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15335        self.old_source_ip = v.into();
15336        self
15337    }
15338
15339    /// Sets the value of [new_source_ip][crate::model::NatInfo::new_source_ip].
15340    ///
15341    /// # Example
15342    /// ```ignore,no_run
15343    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15344    /// let x = NatInfo::new().set_new_source_ip("example");
15345    /// ```
15346    pub fn set_new_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15347        self.new_source_ip = v.into();
15348        self
15349    }
15350
15351    /// Sets the value of [old_destination_ip][crate::model::NatInfo::old_destination_ip].
15352    ///
15353    /// # Example
15354    /// ```ignore,no_run
15355    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15356    /// let x = NatInfo::new().set_old_destination_ip("example");
15357    /// ```
15358    pub fn set_old_destination_ip<T: std::convert::Into<std::string::String>>(
15359        mut self,
15360        v: T,
15361    ) -> Self {
15362        self.old_destination_ip = v.into();
15363        self
15364    }
15365
15366    /// Sets the value of [new_destination_ip][crate::model::NatInfo::new_destination_ip].
15367    ///
15368    /// # Example
15369    /// ```ignore,no_run
15370    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15371    /// let x = NatInfo::new().set_new_destination_ip("example");
15372    /// ```
15373    pub fn set_new_destination_ip<T: std::convert::Into<std::string::String>>(
15374        mut self,
15375        v: T,
15376    ) -> Self {
15377        self.new_destination_ip = v.into();
15378        self
15379    }
15380
15381    /// Sets the value of [old_source_port][crate::model::NatInfo::old_source_port].
15382    ///
15383    /// # Example
15384    /// ```ignore,no_run
15385    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15386    /// let x = NatInfo::new().set_old_source_port(42);
15387    /// ```
15388    pub fn set_old_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15389        self.old_source_port = v.into();
15390        self
15391    }
15392
15393    /// Sets the value of [new_source_port][crate::model::NatInfo::new_source_port].
15394    ///
15395    /// # Example
15396    /// ```ignore,no_run
15397    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15398    /// let x = NatInfo::new().set_new_source_port(42);
15399    /// ```
15400    pub fn set_new_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15401        self.new_source_port = v.into();
15402        self
15403    }
15404
15405    /// Sets the value of [old_destination_port][crate::model::NatInfo::old_destination_port].
15406    ///
15407    /// # Example
15408    /// ```ignore,no_run
15409    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15410    /// let x = NatInfo::new().set_old_destination_port(42);
15411    /// ```
15412    pub fn set_old_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15413        self.old_destination_port = v.into();
15414        self
15415    }
15416
15417    /// Sets the value of [new_destination_port][crate::model::NatInfo::new_destination_port].
15418    ///
15419    /// # Example
15420    /// ```ignore,no_run
15421    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15422    /// let x = NatInfo::new().set_new_destination_port(42);
15423    /// ```
15424    pub fn set_new_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15425        self.new_destination_port = v.into();
15426        self
15427    }
15428
15429    /// Sets the value of [router_uri][crate::model::NatInfo::router_uri].
15430    ///
15431    /// # Example
15432    /// ```ignore,no_run
15433    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15434    /// let x = NatInfo::new().set_router_uri("example");
15435    /// ```
15436    pub fn set_router_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15437        self.router_uri = v.into();
15438        self
15439    }
15440
15441    /// Sets the value of [nat_gateway_name][crate::model::NatInfo::nat_gateway_name].
15442    ///
15443    /// # Example
15444    /// ```ignore,no_run
15445    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15446    /// let x = NatInfo::new().set_nat_gateway_name("example");
15447    /// ```
15448    pub fn set_nat_gateway_name<T: std::convert::Into<std::string::String>>(
15449        mut self,
15450        v: T,
15451    ) -> Self {
15452        self.nat_gateway_name = v.into();
15453        self
15454    }
15455
15456    /// Sets the value of [cloud_nat_gateway_type][crate::model::NatInfo::cloud_nat_gateway_type].
15457    ///
15458    /// # Example
15459    /// ```ignore,no_run
15460    /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15461    /// use google_cloud_networkmanagement_v1::model::nat_info::CloudNatGatewayType;
15462    /// let x0 = NatInfo::new().set_cloud_nat_gateway_type(CloudNatGatewayType::PublicNat44);
15463    /// let x1 = NatInfo::new().set_cloud_nat_gateway_type(CloudNatGatewayType::PublicNat64);
15464    /// let x2 = NatInfo::new().set_cloud_nat_gateway_type(CloudNatGatewayType::PrivateNatNcc);
15465    /// ```
15466    pub fn set_cloud_nat_gateway_type<
15467        T: std::convert::Into<crate::model::nat_info::CloudNatGatewayType>,
15468    >(
15469        mut self,
15470        v: T,
15471    ) -> Self {
15472        self.cloud_nat_gateway_type = v.into();
15473        self
15474    }
15475}
15476
15477impl wkt::message::Message for NatInfo {
15478    fn typename() -> &'static str {
15479        "type.googleapis.com/google.cloud.networkmanagement.v1.NatInfo"
15480    }
15481}
15482
15483/// Defines additional types related to [NatInfo].
15484pub mod nat_info {
15485    #[allow(unused_imports)]
15486    use super::*;
15487
15488    /// Types of NAT.
15489    ///
15490    /// # Working with unknown values
15491    ///
15492    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15493    /// additional enum variants at any time. Adding new variants is not considered
15494    /// a breaking change. Applications should write their code in anticipation of:
15495    ///
15496    /// - New values appearing in future releases of the client library, **and**
15497    /// - New values received dynamically, without application changes.
15498    ///
15499    /// Please consult the [Working with enums] section in the user guide for some
15500    /// guidelines.
15501    ///
15502    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15503    #[derive(Clone, Debug, PartialEq)]
15504    #[non_exhaustive]
15505    pub enum Type {
15506        /// Type is unspecified.
15507        Unspecified,
15508        /// From Compute Engine instance's internal address to external address.
15509        InternalToExternal,
15510        /// From Compute Engine instance's external address to internal address.
15511        ExternalToInternal,
15512        /// Cloud NAT Gateway.
15513        CloudNat,
15514        /// Private service connect NAT.
15515        PrivateServiceConnect,
15516        /// GKE Pod IP address masquerading.
15517        GkePodIpMasquerading,
15518        /// If set, the enum was initialized with an unknown value.
15519        ///
15520        /// Applications can examine the value using [Type::value] or
15521        /// [Type::name].
15522        UnknownValue(r#type::UnknownValue),
15523    }
15524
15525    #[doc(hidden)]
15526    pub mod r#type {
15527        #[allow(unused_imports)]
15528        use super::*;
15529        #[derive(Clone, Debug, PartialEq)]
15530        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15531    }
15532
15533    impl Type {
15534        /// Gets the enum value.
15535        ///
15536        /// Returns `None` if the enum contains an unknown value deserialized from
15537        /// the string representation of enums.
15538        pub fn value(&self) -> std::option::Option<i32> {
15539            match self {
15540                Self::Unspecified => std::option::Option::Some(0),
15541                Self::InternalToExternal => std::option::Option::Some(1),
15542                Self::ExternalToInternal => std::option::Option::Some(2),
15543                Self::CloudNat => std::option::Option::Some(3),
15544                Self::PrivateServiceConnect => std::option::Option::Some(4),
15545                Self::GkePodIpMasquerading => std::option::Option::Some(5),
15546                Self::UnknownValue(u) => u.0.value(),
15547            }
15548        }
15549
15550        /// Gets the enum value as a string.
15551        ///
15552        /// Returns `None` if the enum contains an unknown value deserialized from
15553        /// the integer representation of enums.
15554        pub fn name(&self) -> std::option::Option<&str> {
15555            match self {
15556                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
15557                Self::InternalToExternal => std::option::Option::Some("INTERNAL_TO_EXTERNAL"),
15558                Self::ExternalToInternal => std::option::Option::Some("EXTERNAL_TO_INTERNAL"),
15559                Self::CloudNat => std::option::Option::Some("CLOUD_NAT"),
15560                Self::PrivateServiceConnect => std::option::Option::Some("PRIVATE_SERVICE_CONNECT"),
15561                Self::GkePodIpMasquerading => std::option::Option::Some("GKE_POD_IP_MASQUERADING"),
15562                Self::UnknownValue(u) => u.0.name(),
15563            }
15564        }
15565    }
15566
15567    impl std::default::Default for Type {
15568        fn default() -> Self {
15569            use std::convert::From;
15570            Self::from(0)
15571        }
15572    }
15573
15574    impl std::fmt::Display for Type {
15575        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15576            wkt::internal::display_enum(f, self.name(), self.value())
15577        }
15578    }
15579
15580    impl std::convert::From<i32> for Type {
15581        fn from(value: i32) -> Self {
15582            match value {
15583                0 => Self::Unspecified,
15584                1 => Self::InternalToExternal,
15585                2 => Self::ExternalToInternal,
15586                3 => Self::CloudNat,
15587                4 => Self::PrivateServiceConnect,
15588                5 => Self::GkePodIpMasquerading,
15589                _ => Self::UnknownValue(r#type::UnknownValue(
15590                    wkt::internal::UnknownEnumValue::Integer(value),
15591                )),
15592            }
15593        }
15594    }
15595
15596    impl std::convert::From<&str> for Type {
15597        fn from(value: &str) -> Self {
15598            use std::string::ToString;
15599            match value {
15600                "TYPE_UNSPECIFIED" => Self::Unspecified,
15601                "INTERNAL_TO_EXTERNAL" => Self::InternalToExternal,
15602                "EXTERNAL_TO_INTERNAL" => Self::ExternalToInternal,
15603                "CLOUD_NAT" => Self::CloudNat,
15604                "PRIVATE_SERVICE_CONNECT" => Self::PrivateServiceConnect,
15605                "GKE_POD_IP_MASQUERADING" => Self::GkePodIpMasquerading,
15606                _ => Self::UnknownValue(r#type::UnknownValue(
15607                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15608                )),
15609            }
15610        }
15611    }
15612
15613    impl serde::ser::Serialize for Type {
15614        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15615        where
15616            S: serde::Serializer,
15617        {
15618            match self {
15619                Self::Unspecified => serializer.serialize_i32(0),
15620                Self::InternalToExternal => serializer.serialize_i32(1),
15621                Self::ExternalToInternal => serializer.serialize_i32(2),
15622                Self::CloudNat => serializer.serialize_i32(3),
15623                Self::PrivateServiceConnect => serializer.serialize_i32(4),
15624                Self::GkePodIpMasquerading => serializer.serialize_i32(5),
15625                Self::UnknownValue(u) => u.0.serialize(serializer),
15626            }
15627        }
15628    }
15629
15630    impl<'de> serde::de::Deserialize<'de> for Type {
15631        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15632        where
15633            D: serde::Deserializer<'de>,
15634        {
15635            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
15636                ".google.cloud.networkmanagement.v1.NatInfo.Type",
15637            ))
15638        }
15639    }
15640
15641    /// Types of Cloud NAT gateway.
15642    ///
15643    /// # Working with unknown values
15644    ///
15645    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15646    /// additional enum variants at any time. Adding new variants is not considered
15647    /// a breaking change. Applications should write their code in anticipation of:
15648    ///
15649    /// - New values appearing in future releases of the client library, **and**
15650    /// - New values received dynamically, without application changes.
15651    ///
15652    /// Please consult the [Working with enums] section in the user guide for some
15653    /// guidelines.
15654    ///
15655    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15656    #[derive(Clone, Debug, PartialEq)]
15657    #[non_exhaustive]
15658    pub enum CloudNatGatewayType {
15659        /// Type is unspecified.
15660        Unspecified,
15661        /// Public NAT gateway.
15662        PublicNat44,
15663        /// Public NAT64 gateway.
15664        PublicNat64,
15665        /// Private NAT gateway for NCC.
15666        PrivateNatNcc,
15667        /// Private NAT gateway for hybrid connectivity.
15668        PrivateNatHybrid,
15669        /// Private NAT64 gateway.
15670        PrivateNat64,
15671        /// If set, the enum was initialized with an unknown value.
15672        ///
15673        /// Applications can examine the value using [CloudNatGatewayType::value] or
15674        /// [CloudNatGatewayType::name].
15675        UnknownValue(cloud_nat_gateway_type::UnknownValue),
15676    }
15677
15678    #[doc(hidden)]
15679    pub mod cloud_nat_gateway_type {
15680        #[allow(unused_imports)]
15681        use super::*;
15682        #[derive(Clone, Debug, PartialEq)]
15683        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15684    }
15685
15686    impl CloudNatGatewayType {
15687        /// Gets the enum value.
15688        ///
15689        /// Returns `None` if the enum contains an unknown value deserialized from
15690        /// the string representation of enums.
15691        pub fn value(&self) -> std::option::Option<i32> {
15692            match self {
15693                Self::Unspecified => std::option::Option::Some(0),
15694                Self::PublicNat44 => std::option::Option::Some(1),
15695                Self::PublicNat64 => std::option::Option::Some(2),
15696                Self::PrivateNatNcc => std::option::Option::Some(3),
15697                Self::PrivateNatHybrid => std::option::Option::Some(4),
15698                Self::PrivateNat64 => std::option::Option::Some(5),
15699                Self::UnknownValue(u) => u.0.value(),
15700            }
15701        }
15702
15703        /// Gets the enum value as a string.
15704        ///
15705        /// Returns `None` if the enum contains an unknown value deserialized from
15706        /// the integer representation of enums.
15707        pub fn name(&self) -> std::option::Option<&str> {
15708            match self {
15709                Self::Unspecified => {
15710                    std::option::Option::Some("CLOUD_NAT_GATEWAY_TYPE_UNSPECIFIED")
15711                }
15712                Self::PublicNat44 => std::option::Option::Some("PUBLIC_NAT44"),
15713                Self::PublicNat64 => std::option::Option::Some("PUBLIC_NAT64"),
15714                Self::PrivateNatNcc => std::option::Option::Some("PRIVATE_NAT_NCC"),
15715                Self::PrivateNatHybrid => std::option::Option::Some("PRIVATE_NAT_HYBRID"),
15716                Self::PrivateNat64 => std::option::Option::Some("PRIVATE_NAT64"),
15717                Self::UnknownValue(u) => u.0.name(),
15718            }
15719        }
15720    }
15721
15722    impl std::default::Default for CloudNatGatewayType {
15723        fn default() -> Self {
15724            use std::convert::From;
15725            Self::from(0)
15726        }
15727    }
15728
15729    impl std::fmt::Display for CloudNatGatewayType {
15730        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15731            wkt::internal::display_enum(f, self.name(), self.value())
15732        }
15733    }
15734
15735    impl std::convert::From<i32> for CloudNatGatewayType {
15736        fn from(value: i32) -> Self {
15737            match value {
15738                0 => Self::Unspecified,
15739                1 => Self::PublicNat44,
15740                2 => Self::PublicNat64,
15741                3 => Self::PrivateNatNcc,
15742                4 => Self::PrivateNatHybrid,
15743                5 => Self::PrivateNat64,
15744                _ => Self::UnknownValue(cloud_nat_gateway_type::UnknownValue(
15745                    wkt::internal::UnknownEnumValue::Integer(value),
15746                )),
15747            }
15748        }
15749    }
15750
15751    impl std::convert::From<&str> for CloudNatGatewayType {
15752        fn from(value: &str) -> Self {
15753            use std::string::ToString;
15754            match value {
15755                "CLOUD_NAT_GATEWAY_TYPE_UNSPECIFIED" => Self::Unspecified,
15756                "PUBLIC_NAT44" => Self::PublicNat44,
15757                "PUBLIC_NAT64" => Self::PublicNat64,
15758                "PRIVATE_NAT_NCC" => Self::PrivateNatNcc,
15759                "PRIVATE_NAT_HYBRID" => Self::PrivateNatHybrid,
15760                "PRIVATE_NAT64" => Self::PrivateNat64,
15761                _ => Self::UnknownValue(cloud_nat_gateway_type::UnknownValue(
15762                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15763                )),
15764            }
15765        }
15766    }
15767
15768    impl serde::ser::Serialize for CloudNatGatewayType {
15769        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15770        where
15771            S: serde::Serializer,
15772        {
15773            match self {
15774                Self::Unspecified => serializer.serialize_i32(0),
15775                Self::PublicNat44 => serializer.serialize_i32(1),
15776                Self::PublicNat64 => serializer.serialize_i32(2),
15777                Self::PrivateNatNcc => serializer.serialize_i32(3),
15778                Self::PrivateNatHybrid => serializer.serialize_i32(4),
15779                Self::PrivateNat64 => serializer.serialize_i32(5),
15780                Self::UnknownValue(u) => u.0.serialize(serializer),
15781            }
15782        }
15783    }
15784
15785    impl<'de> serde::de::Deserialize<'de> for CloudNatGatewayType {
15786        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15787        where
15788            D: serde::Deserializer<'de>,
15789        {
15790            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudNatGatewayType>::new(
15791                ".google.cloud.networkmanagement.v1.NatInfo.CloudNatGatewayType",
15792            ))
15793        }
15794    }
15795}
15796
15797/// For display only. Metadata associated with ProxyConnection.
15798#[derive(Clone, Default, PartialEq)]
15799#[non_exhaustive]
15800pub struct ProxyConnectionInfo {
15801    /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
15802    pub protocol: std::string::String,
15803
15804    /// Source IP address of an original connection.
15805    pub old_source_ip: std::string::String,
15806
15807    /// Source IP address of a new connection.
15808    pub new_source_ip: std::string::String,
15809
15810    /// Destination IP address of an original connection
15811    pub old_destination_ip: std::string::String,
15812
15813    /// Destination IP address of a new connection.
15814    pub new_destination_ip: std::string::String,
15815
15816    /// Source port of an original connection. Only valid when protocol is TCP or
15817    /// UDP.
15818    pub old_source_port: i32,
15819
15820    /// Source port of a new connection. Only valid when protocol is TCP or UDP.
15821    pub new_source_port: i32,
15822
15823    /// Destination port of an original connection. Only valid when protocol is TCP
15824    /// or UDP.
15825    pub old_destination_port: i32,
15826
15827    /// Destination port of a new connection. Only valid when protocol is TCP or
15828    /// UDP.
15829    pub new_destination_port: i32,
15830
15831    /// Uri of proxy subnet.
15832    pub subnet_uri: std::string::String,
15833
15834    /// URI of the network where connection is proxied.
15835    pub network_uri: std::string::String,
15836
15837    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15838}
15839
15840impl ProxyConnectionInfo {
15841    /// Creates a new default instance.
15842    pub fn new() -> Self {
15843        std::default::Default::default()
15844    }
15845
15846    /// Sets the value of [protocol][crate::model::ProxyConnectionInfo::protocol].
15847    ///
15848    /// # Example
15849    /// ```ignore,no_run
15850    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15851    /// let x = ProxyConnectionInfo::new().set_protocol("example");
15852    /// ```
15853    pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15854        self.protocol = v.into();
15855        self
15856    }
15857
15858    /// Sets the value of [old_source_ip][crate::model::ProxyConnectionInfo::old_source_ip].
15859    ///
15860    /// # Example
15861    /// ```ignore,no_run
15862    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15863    /// let x = ProxyConnectionInfo::new().set_old_source_ip("example");
15864    /// ```
15865    pub fn set_old_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15866        self.old_source_ip = v.into();
15867        self
15868    }
15869
15870    /// Sets the value of [new_source_ip][crate::model::ProxyConnectionInfo::new_source_ip].
15871    ///
15872    /// # Example
15873    /// ```ignore,no_run
15874    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15875    /// let x = ProxyConnectionInfo::new().set_new_source_ip("example");
15876    /// ```
15877    pub fn set_new_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15878        self.new_source_ip = v.into();
15879        self
15880    }
15881
15882    /// Sets the value of [old_destination_ip][crate::model::ProxyConnectionInfo::old_destination_ip].
15883    ///
15884    /// # Example
15885    /// ```ignore,no_run
15886    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15887    /// let x = ProxyConnectionInfo::new().set_old_destination_ip("example");
15888    /// ```
15889    pub fn set_old_destination_ip<T: std::convert::Into<std::string::String>>(
15890        mut self,
15891        v: T,
15892    ) -> Self {
15893        self.old_destination_ip = v.into();
15894        self
15895    }
15896
15897    /// Sets the value of [new_destination_ip][crate::model::ProxyConnectionInfo::new_destination_ip].
15898    ///
15899    /// # Example
15900    /// ```ignore,no_run
15901    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15902    /// let x = ProxyConnectionInfo::new().set_new_destination_ip("example");
15903    /// ```
15904    pub fn set_new_destination_ip<T: std::convert::Into<std::string::String>>(
15905        mut self,
15906        v: T,
15907    ) -> Self {
15908        self.new_destination_ip = v.into();
15909        self
15910    }
15911
15912    /// Sets the value of [old_source_port][crate::model::ProxyConnectionInfo::old_source_port].
15913    ///
15914    /// # Example
15915    /// ```ignore,no_run
15916    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15917    /// let x = ProxyConnectionInfo::new().set_old_source_port(42);
15918    /// ```
15919    pub fn set_old_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15920        self.old_source_port = v.into();
15921        self
15922    }
15923
15924    /// Sets the value of [new_source_port][crate::model::ProxyConnectionInfo::new_source_port].
15925    ///
15926    /// # Example
15927    /// ```ignore,no_run
15928    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15929    /// let x = ProxyConnectionInfo::new().set_new_source_port(42);
15930    /// ```
15931    pub fn set_new_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15932        self.new_source_port = v.into();
15933        self
15934    }
15935
15936    /// Sets the value of [old_destination_port][crate::model::ProxyConnectionInfo::old_destination_port].
15937    ///
15938    /// # Example
15939    /// ```ignore,no_run
15940    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15941    /// let x = ProxyConnectionInfo::new().set_old_destination_port(42);
15942    /// ```
15943    pub fn set_old_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15944        self.old_destination_port = v.into();
15945        self
15946    }
15947
15948    /// Sets the value of [new_destination_port][crate::model::ProxyConnectionInfo::new_destination_port].
15949    ///
15950    /// # Example
15951    /// ```ignore,no_run
15952    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15953    /// let x = ProxyConnectionInfo::new().set_new_destination_port(42);
15954    /// ```
15955    pub fn set_new_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15956        self.new_destination_port = v.into();
15957        self
15958    }
15959
15960    /// Sets the value of [subnet_uri][crate::model::ProxyConnectionInfo::subnet_uri].
15961    ///
15962    /// # Example
15963    /// ```ignore,no_run
15964    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15965    /// let x = ProxyConnectionInfo::new().set_subnet_uri("example");
15966    /// ```
15967    pub fn set_subnet_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15968        self.subnet_uri = v.into();
15969        self
15970    }
15971
15972    /// Sets the value of [network_uri][crate::model::ProxyConnectionInfo::network_uri].
15973    ///
15974    /// # Example
15975    /// ```ignore,no_run
15976    /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15977    /// let x = ProxyConnectionInfo::new().set_network_uri("example");
15978    /// ```
15979    pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15980        self.network_uri = v.into();
15981        self
15982    }
15983}
15984
15985impl wkt::message::Message for ProxyConnectionInfo {
15986    fn typename() -> &'static str {
15987        "type.googleapis.com/google.cloud.networkmanagement.v1.ProxyConnectionInfo"
15988    }
15989}
15990
15991/// For display only. Metadata associated with the load balancer backend.
15992#[derive(Clone, Default, PartialEq)]
15993#[non_exhaustive]
15994pub struct LoadBalancerBackendInfo {
15995    /// Display name of the backend. For example, it might be an instance name for
15996    /// the instance group backends, or an IP address and port for zonal network
15997    /// endpoint group backends.
15998    pub name: std::string::String,
15999
16000    /// URI of the backend instance (if applicable). Populated for instance group
16001    /// backends, and zonal NEG backends.
16002    pub instance_uri: std::string::String,
16003
16004    /// URI of the backend service this backend belongs to (if applicable).
16005    pub backend_service_uri: std::string::String,
16006
16007    /// URI of the instance group this backend belongs to (if applicable).
16008    pub instance_group_uri: std::string::String,
16009
16010    /// URI of the network endpoint group this backend belongs to (if applicable).
16011    pub network_endpoint_group_uri: std::string::String,
16012
16013    /// URI of the backend bucket this backend targets (if applicable).
16014    pub backend_bucket_uri: std::string::String,
16015
16016    /// URI of the PSC service attachment this PSC NEG backend targets (if
16017    /// applicable).
16018    pub psc_service_attachment_uri: std::string::String,
16019
16020    /// PSC Google API target this PSC NEG backend targets (if applicable).
16021    pub psc_google_api_target: std::string::String,
16022
16023    /// URI of the health check attached to this backend (if applicable).
16024    pub health_check_uri: std::string::String,
16025
16026    /// Output only. Health check firewalls configuration state for the backend.
16027    /// This is a result of the static firewall analysis (verifying that health
16028    /// check traffic from required IP ranges to the backend is allowed or not).
16029    /// The backend might still be unhealthy even if these firewalls are
16030    /// configured. Please refer to the documentation for more information:
16031    /// <https://cloud.google.com/load-balancing/docs/firewall-rules>
16032    pub health_check_firewalls_config_state:
16033        crate::model::load_balancer_backend_info::HealthCheckFirewallsConfigState,
16034
16035    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16036}
16037
16038impl LoadBalancerBackendInfo {
16039    /// Creates a new default instance.
16040    pub fn new() -> Self {
16041        std::default::Default::default()
16042    }
16043
16044    /// Sets the value of [name][crate::model::LoadBalancerBackendInfo::name].
16045    ///
16046    /// # Example
16047    /// ```ignore,no_run
16048    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16049    /// let x = LoadBalancerBackendInfo::new().set_name("example");
16050    /// ```
16051    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16052        self.name = v.into();
16053        self
16054    }
16055
16056    /// Sets the value of [instance_uri][crate::model::LoadBalancerBackendInfo::instance_uri].
16057    ///
16058    /// # Example
16059    /// ```ignore,no_run
16060    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16061    /// let x = LoadBalancerBackendInfo::new().set_instance_uri("example");
16062    /// ```
16063    pub fn set_instance_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16064        self.instance_uri = v.into();
16065        self
16066    }
16067
16068    /// Sets the value of [backend_service_uri][crate::model::LoadBalancerBackendInfo::backend_service_uri].
16069    ///
16070    /// # Example
16071    /// ```ignore,no_run
16072    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16073    /// let x = LoadBalancerBackendInfo::new().set_backend_service_uri("example");
16074    /// ```
16075    pub fn set_backend_service_uri<T: std::convert::Into<std::string::String>>(
16076        mut self,
16077        v: T,
16078    ) -> Self {
16079        self.backend_service_uri = v.into();
16080        self
16081    }
16082
16083    /// Sets the value of [instance_group_uri][crate::model::LoadBalancerBackendInfo::instance_group_uri].
16084    ///
16085    /// # Example
16086    /// ```ignore,no_run
16087    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16088    /// let x = LoadBalancerBackendInfo::new().set_instance_group_uri("example");
16089    /// ```
16090    pub fn set_instance_group_uri<T: std::convert::Into<std::string::String>>(
16091        mut self,
16092        v: T,
16093    ) -> Self {
16094        self.instance_group_uri = v.into();
16095        self
16096    }
16097
16098    /// Sets the value of [network_endpoint_group_uri][crate::model::LoadBalancerBackendInfo::network_endpoint_group_uri].
16099    ///
16100    /// # Example
16101    /// ```ignore,no_run
16102    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16103    /// let x = LoadBalancerBackendInfo::new().set_network_endpoint_group_uri("example");
16104    /// ```
16105    pub fn set_network_endpoint_group_uri<T: std::convert::Into<std::string::String>>(
16106        mut self,
16107        v: T,
16108    ) -> Self {
16109        self.network_endpoint_group_uri = v.into();
16110        self
16111    }
16112
16113    /// Sets the value of [backend_bucket_uri][crate::model::LoadBalancerBackendInfo::backend_bucket_uri].
16114    ///
16115    /// # Example
16116    /// ```ignore,no_run
16117    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16118    /// let x = LoadBalancerBackendInfo::new().set_backend_bucket_uri("example");
16119    /// ```
16120    pub fn set_backend_bucket_uri<T: std::convert::Into<std::string::String>>(
16121        mut self,
16122        v: T,
16123    ) -> Self {
16124        self.backend_bucket_uri = v.into();
16125        self
16126    }
16127
16128    /// Sets the value of [psc_service_attachment_uri][crate::model::LoadBalancerBackendInfo::psc_service_attachment_uri].
16129    ///
16130    /// # Example
16131    /// ```ignore,no_run
16132    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16133    /// let x = LoadBalancerBackendInfo::new().set_psc_service_attachment_uri("example");
16134    /// ```
16135    pub fn set_psc_service_attachment_uri<T: std::convert::Into<std::string::String>>(
16136        mut self,
16137        v: T,
16138    ) -> Self {
16139        self.psc_service_attachment_uri = v.into();
16140        self
16141    }
16142
16143    /// Sets the value of [psc_google_api_target][crate::model::LoadBalancerBackendInfo::psc_google_api_target].
16144    ///
16145    /// # Example
16146    /// ```ignore,no_run
16147    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16148    /// let x = LoadBalancerBackendInfo::new().set_psc_google_api_target("example");
16149    /// ```
16150    pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
16151        mut self,
16152        v: T,
16153    ) -> Self {
16154        self.psc_google_api_target = v.into();
16155        self
16156    }
16157
16158    /// Sets the value of [health_check_uri][crate::model::LoadBalancerBackendInfo::health_check_uri].
16159    ///
16160    /// # Example
16161    /// ```ignore,no_run
16162    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16163    /// let x = LoadBalancerBackendInfo::new().set_health_check_uri("example");
16164    /// ```
16165    pub fn set_health_check_uri<T: std::convert::Into<std::string::String>>(
16166        mut self,
16167        v: T,
16168    ) -> Self {
16169        self.health_check_uri = v.into();
16170        self
16171    }
16172
16173    /// Sets the value of [health_check_firewalls_config_state][crate::model::LoadBalancerBackendInfo::health_check_firewalls_config_state].
16174    ///
16175    /// # Example
16176    /// ```ignore,no_run
16177    /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16178    /// use google_cloud_networkmanagement_v1::model::load_balancer_backend_info::HealthCheckFirewallsConfigState;
16179    /// let x0 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsConfigured);
16180    /// let x1 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsPartiallyConfigured);
16181    /// let x2 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsNotConfigured);
16182    /// ```
16183    pub fn set_health_check_firewalls_config_state<
16184        T: std::convert::Into<
16185                crate::model::load_balancer_backend_info::HealthCheckFirewallsConfigState,
16186            >,
16187    >(
16188        mut self,
16189        v: T,
16190    ) -> Self {
16191        self.health_check_firewalls_config_state = v.into();
16192        self
16193    }
16194}
16195
16196impl wkt::message::Message for LoadBalancerBackendInfo {
16197    fn typename() -> &'static str {
16198        "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerBackendInfo"
16199    }
16200}
16201
16202/// Defines additional types related to [LoadBalancerBackendInfo].
16203pub mod load_balancer_backend_info {
16204    #[allow(unused_imports)]
16205    use super::*;
16206
16207    /// Health check firewalls configuration state enum.
16208    ///
16209    /// # Working with unknown values
16210    ///
16211    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16212    /// additional enum variants at any time. Adding new variants is not considered
16213    /// a breaking change. Applications should write their code in anticipation of:
16214    ///
16215    /// - New values appearing in future releases of the client library, **and**
16216    /// - New values received dynamically, without application changes.
16217    ///
16218    /// Please consult the [Working with enums] section in the user guide for some
16219    /// guidelines.
16220    ///
16221    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16222    #[derive(Clone, Debug, PartialEq)]
16223    #[non_exhaustive]
16224    pub enum HealthCheckFirewallsConfigState {
16225        /// Configuration state unspecified. It usually means that the backend has
16226        /// no health check attached, or there was an unexpected configuration error
16227        /// preventing Connectivity tests from verifying health check configuration.
16228        Unspecified,
16229        /// Firewall rules (policies) allowing health check traffic from all required
16230        /// IP ranges to the backend are configured.
16231        FirewallsConfigured,
16232        /// Firewall rules (policies) allow health check traffic only from a part of
16233        /// required IP ranges.
16234        FirewallsPartiallyConfigured,
16235        /// Firewall rules (policies) deny health check traffic from all required
16236        /// IP ranges to the backend.
16237        FirewallsNotConfigured,
16238        /// The network contains firewall rules of unsupported types, so Connectivity
16239        /// tests were not able to verify health check configuration status. Please
16240        /// refer to the documentation for the list of unsupported configurations:
16241        /// <https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/concepts/overview#unsupported-configs>
16242        FirewallsUnsupported,
16243        /// If set, the enum was initialized with an unknown value.
16244        ///
16245        /// Applications can examine the value using [HealthCheckFirewallsConfigState::value] or
16246        /// [HealthCheckFirewallsConfigState::name].
16247        UnknownValue(health_check_firewalls_config_state::UnknownValue),
16248    }
16249
16250    #[doc(hidden)]
16251    pub mod health_check_firewalls_config_state {
16252        #[allow(unused_imports)]
16253        use super::*;
16254        #[derive(Clone, Debug, PartialEq)]
16255        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16256    }
16257
16258    impl HealthCheckFirewallsConfigState {
16259        /// Gets the enum value.
16260        ///
16261        /// Returns `None` if the enum contains an unknown value deserialized from
16262        /// the string representation of enums.
16263        pub fn value(&self) -> std::option::Option<i32> {
16264            match self {
16265                Self::Unspecified => std::option::Option::Some(0),
16266                Self::FirewallsConfigured => std::option::Option::Some(1),
16267                Self::FirewallsPartiallyConfigured => std::option::Option::Some(2),
16268                Self::FirewallsNotConfigured => std::option::Option::Some(3),
16269                Self::FirewallsUnsupported => std::option::Option::Some(4),
16270                Self::UnknownValue(u) => u.0.value(),
16271            }
16272        }
16273
16274        /// Gets the enum value as a string.
16275        ///
16276        /// Returns `None` if the enum contains an unknown value deserialized from
16277        /// the integer representation of enums.
16278        pub fn name(&self) -> std::option::Option<&str> {
16279            match self {
16280                Self::Unspecified => {
16281                    std::option::Option::Some("HEALTH_CHECK_FIREWALLS_CONFIG_STATE_UNSPECIFIED")
16282                }
16283                Self::FirewallsConfigured => std::option::Option::Some("FIREWALLS_CONFIGURED"),
16284                Self::FirewallsPartiallyConfigured => {
16285                    std::option::Option::Some("FIREWALLS_PARTIALLY_CONFIGURED")
16286                }
16287                Self::FirewallsNotConfigured => {
16288                    std::option::Option::Some("FIREWALLS_NOT_CONFIGURED")
16289                }
16290                Self::FirewallsUnsupported => std::option::Option::Some("FIREWALLS_UNSUPPORTED"),
16291                Self::UnknownValue(u) => u.0.name(),
16292            }
16293        }
16294    }
16295
16296    impl std::default::Default for HealthCheckFirewallsConfigState {
16297        fn default() -> Self {
16298            use std::convert::From;
16299            Self::from(0)
16300        }
16301    }
16302
16303    impl std::fmt::Display for HealthCheckFirewallsConfigState {
16304        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16305            wkt::internal::display_enum(f, self.name(), self.value())
16306        }
16307    }
16308
16309    impl std::convert::From<i32> for HealthCheckFirewallsConfigState {
16310        fn from(value: i32) -> Self {
16311            match value {
16312                0 => Self::Unspecified,
16313                1 => Self::FirewallsConfigured,
16314                2 => Self::FirewallsPartiallyConfigured,
16315                3 => Self::FirewallsNotConfigured,
16316                4 => Self::FirewallsUnsupported,
16317                _ => Self::UnknownValue(health_check_firewalls_config_state::UnknownValue(
16318                    wkt::internal::UnknownEnumValue::Integer(value),
16319                )),
16320            }
16321        }
16322    }
16323
16324    impl std::convert::From<&str> for HealthCheckFirewallsConfigState {
16325        fn from(value: &str) -> Self {
16326            use std::string::ToString;
16327            match value {
16328                "HEALTH_CHECK_FIREWALLS_CONFIG_STATE_UNSPECIFIED" => Self::Unspecified,
16329                "FIREWALLS_CONFIGURED" => Self::FirewallsConfigured,
16330                "FIREWALLS_PARTIALLY_CONFIGURED" => Self::FirewallsPartiallyConfigured,
16331                "FIREWALLS_NOT_CONFIGURED" => Self::FirewallsNotConfigured,
16332                "FIREWALLS_UNSUPPORTED" => Self::FirewallsUnsupported,
16333                _ => Self::UnknownValue(health_check_firewalls_config_state::UnknownValue(
16334                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16335                )),
16336            }
16337        }
16338    }
16339
16340    impl serde::ser::Serialize for HealthCheckFirewallsConfigState {
16341        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16342        where
16343            S: serde::Serializer,
16344        {
16345            match self {
16346                Self::Unspecified => serializer.serialize_i32(0),
16347                Self::FirewallsConfigured => serializer.serialize_i32(1),
16348                Self::FirewallsPartiallyConfigured => serializer.serialize_i32(2),
16349                Self::FirewallsNotConfigured => serializer.serialize_i32(3),
16350                Self::FirewallsUnsupported => serializer.serialize_i32(4),
16351                Self::UnknownValue(u) => u.0.serialize(serializer),
16352            }
16353        }
16354    }
16355
16356    impl<'de> serde::de::Deserialize<'de> for HealthCheckFirewallsConfigState {
16357        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16358        where
16359            D: serde::Deserializer<'de>,
16360        {
16361            deserializer.deserialize_any(wkt::internal::EnumVisitor::<HealthCheckFirewallsConfigState>::new(
16362                ".google.cloud.networkmanagement.v1.LoadBalancerBackendInfo.HealthCheckFirewallsConfigState"))
16363        }
16364    }
16365}
16366
16367/// For display only. Metadata associated with Storage Bucket.
16368#[derive(Clone, Default, PartialEq)]
16369#[non_exhaustive]
16370pub struct StorageBucketInfo {
16371    /// Cloud Storage Bucket name.
16372    pub bucket: std::string::String,
16373
16374    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16375}
16376
16377impl StorageBucketInfo {
16378    /// Creates a new default instance.
16379    pub fn new() -> Self {
16380        std::default::Default::default()
16381    }
16382
16383    /// Sets the value of [bucket][crate::model::StorageBucketInfo::bucket].
16384    ///
16385    /// # Example
16386    /// ```ignore,no_run
16387    /// # use google_cloud_networkmanagement_v1::model::StorageBucketInfo;
16388    /// let x = StorageBucketInfo::new().set_bucket("example");
16389    /// ```
16390    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16391        self.bucket = v.into();
16392        self
16393    }
16394}
16395
16396impl wkt::message::Message for StorageBucketInfo {
16397    fn typename() -> &'static str {
16398        "type.googleapis.com/google.cloud.networkmanagement.v1.StorageBucketInfo"
16399    }
16400}
16401
16402/// For display only. Metadata associated with the serverless network endpoint
16403/// group backend.
16404#[derive(Clone, Default, PartialEq)]
16405#[non_exhaustive]
16406pub struct ServerlessNegInfo {
16407    /// URI of the serverless network endpoint group.
16408    pub neg_uri: std::string::String,
16409
16410    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16411}
16412
16413impl ServerlessNegInfo {
16414    /// Creates a new default instance.
16415    pub fn new() -> Self {
16416        std::default::Default::default()
16417    }
16418
16419    /// Sets the value of [neg_uri][crate::model::ServerlessNegInfo::neg_uri].
16420    ///
16421    /// # Example
16422    /// ```ignore,no_run
16423    /// # use google_cloud_networkmanagement_v1::model::ServerlessNegInfo;
16424    /// let x = ServerlessNegInfo::new().set_neg_uri("example");
16425    /// ```
16426    pub fn set_neg_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16427        self.neg_uri = v.into();
16428        self
16429    }
16430}
16431
16432impl wkt::message::Message for ServerlessNegInfo {
16433    fn typename() -> &'static str {
16434        "type.googleapis.com/google.cloud.networkmanagement.v1.ServerlessNegInfo"
16435    }
16436}
16437
16438/// For display only. Metadata associated with a layer 7 packet inspection by the
16439/// firewall.
16440#[derive(Clone, Default, PartialEq)]
16441#[non_exhaustive]
16442pub struct NgfwPacketInspectionInfo {
16443    /// URI of the security profile group associated with this firewall packet
16444    /// inspection.
16445    pub security_profile_group_uri: std::string::String,
16446
16447    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16448}
16449
16450impl NgfwPacketInspectionInfo {
16451    /// Creates a new default instance.
16452    pub fn new() -> Self {
16453        std::default::Default::default()
16454    }
16455
16456    /// Sets the value of [security_profile_group_uri][crate::model::NgfwPacketInspectionInfo::security_profile_group_uri].
16457    ///
16458    /// # Example
16459    /// ```ignore,no_run
16460    /// # use google_cloud_networkmanagement_v1::model::NgfwPacketInspectionInfo;
16461    /// let x = NgfwPacketInspectionInfo::new().set_security_profile_group_uri("example");
16462    /// ```
16463    pub fn set_security_profile_group_uri<T: std::convert::Into<std::string::String>>(
16464        mut self,
16465        v: T,
16466    ) -> Self {
16467        self.security_profile_group_uri = v.into();
16468        self
16469    }
16470}
16471
16472impl wkt::message::Message for NgfwPacketInspectionInfo {
16473    fn typename() -> &'static str {
16474        "type.googleapis.com/google.cloud.networkmanagement.v1.NgfwPacketInspectionInfo"
16475    }
16476}
16477
16478/// Request for the `ListVpcFlowLogsConfigs` method.
16479#[derive(Clone, Default, PartialEq)]
16480#[non_exhaustive]
16481pub struct ListVpcFlowLogsConfigsRequest {
16482    /// Required. The parent resource of the VpcFlowLogsConfig,
16483    /// in one of the following formats:
16484    ///
16485    /// - For project-level resources: `projects/{project_id}/locations/global`
16486    ///
16487    /// - For organization-level resources:
16488    ///   `organizations/{organization_id}/locations/global`
16489    ///
16490    pub parent: std::string::String,
16491
16492    /// Optional. Number of `VpcFlowLogsConfigs` to return.
16493    pub page_size: i32,
16494
16495    /// Optional. Page token from an earlier query, as returned in
16496    /// `next_page_token`.
16497    pub page_token: std::string::String,
16498
16499    /// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
16500    /// A filter expression must use the supported [CEL logic operators]
16501    /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
16502    pub filter: std::string::String,
16503
16504    /// Optional. Field to use to sort the list.
16505    pub order_by: std::string::String,
16506
16507    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16508}
16509
16510impl ListVpcFlowLogsConfigsRequest {
16511    /// Creates a new default instance.
16512    pub fn new() -> Self {
16513        std::default::Default::default()
16514    }
16515
16516    /// Sets the value of [parent][crate::model::ListVpcFlowLogsConfigsRequest::parent].
16517    ///
16518    /// # Example
16519    /// ```ignore,no_run
16520    /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16521    /// # let project_id = "project_id";
16522    /// # let location_id = "location_id";
16523    /// let x = ListVpcFlowLogsConfigsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
16524    /// ```
16525    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16526        self.parent = v.into();
16527        self
16528    }
16529
16530    /// Sets the value of [page_size][crate::model::ListVpcFlowLogsConfigsRequest::page_size].
16531    ///
16532    /// # Example
16533    /// ```ignore,no_run
16534    /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16535    /// let x = ListVpcFlowLogsConfigsRequest::new().set_page_size(42);
16536    /// ```
16537    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16538        self.page_size = v.into();
16539        self
16540    }
16541
16542    /// Sets the value of [page_token][crate::model::ListVpcFlowLogsConfigsRequest::page_token].
16543    ///
16544    /// # Example
16545    /// ```ignore,no_run
16546    /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16547    /// let x = ListVpcFlowLogsConfigsRequest::new().set_page_token("example");
16548    /// ```
16549    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16550        self.page_token = v.into();
16551        self
16552    }
16553
16554    /// Sets the value of [filter][crate::model::ListVpcFlowLogsConfigsRequest::filter].
16555    ///
16556    /// # Example
16557    /// ```ignore,no_run
16558    /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16559    /// let x = ListVpcFlowLogsConfigsRequest::new().set_filter("example");
16560    /// ```
16561    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16562        self.filter = v.into();
16563        self
16564    }
16565
16566    /// Sets the value of [order_by][crate::model::ListVpcFlowLogsConfigsRequest::order_by].
16567    ///
16568    /// # Example
16569    /// ```ignore,no_run
16570    /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16571    /// let x = ListVpcFlowLogsConfigsRequest::new().set_order_by("example");
16572    /// ```
16573    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16574        self.order_by = v.into();
16575        self
16576    }
16577}
16578
16579impl wkt::message::Message for ListVpcFlowLogsConfigsRequest {
16580    fn typename() -> &'static str {
16581        "type.googleapis.com/google.cloud.networkmanagement.v1.ListVpcFlowLogsConfigsRequest"
16582    }
16583}
16584
16585/// Response for the `ListVpcFlowLogsConfigs` method.
16586#[derive(Clone, Default, PartialEq)]
16587#[non_exhaustive]
16588pub struct ListVpcFlowLogsConfigsResponse {
16589    /// List of VPC Flow Log configurations.
16590    pub vpc_flow_logs_configs: std::vec::Vec<crate::model::VpcFlowLogsConfig>,
16591
16592    /// Page token to fetch the next set of configurations.
16593    pub next_page_token: std::string::String,
16594
16595    /// Locations that could not be reached (when querying all locations with `-`).
16596    pub unreachable: std::vec::Vec<std::string::String>,
16597
16598    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16599}
16600
16601impl ListVpcFlowLogsConfigsResponse {
16602    /// Creates a new default instance.
16603    pub fn new() -> Self {
16604        std::default::Default::default()
16605    }
16606
16607    /// Sets the value of [vpc_flow_logs_configs][crate::model::ListVpcFlowLogsConfigsResponse::vpc_flow_logs_configs].
16608    ///
16609    /// # Example
16610    /// ```ignore,no_run
16611    /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
16612    /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16613    /// let x = ListVpcFlowLogsConfigsResponse::new()
16614    ///     .set_vpc_flow_logs_configs([
16615    ///         VpcFlowLogsConfig::default()/* use setters */,
16616    ///         VpcFlowLogsConfig::default()/* use (different) setters */,
16617    ///     ]);
16618    /// ```
16619    pub fn set_vpc_flow_logs_configs<T, V>(mut self, v: T) -> Self
16620    where
16621        T: std::iter::IntoIterator<Item = V>,
16622        V: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16623    {
16624        use std::iter::Iterator;
16625        self.vpc_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
16626        self
16627    }
16628
16629    /// Sets the value of [next_page_token][crate::model::ListVpcFlowLogsConfigsResponse::next_page_token].
16630    ///
16631    /// # Example
16632    /// ```ignore,no_run
16633    /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
16634    /// let x = ListVpcFlowLogsConfigsResponse::new().set_next_page_token("example");
16635    /// ```
16636    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16637        self.next_page_token = v.into();
16638        self
16639    }
16640
16641    /// Sets the value of [unreachable][crate::model::ListVpcFlowLogsConfigsResponse::unreachable].
16642    ///
16643    /// # Example
16644    /// ```ignore,no_run
16645    /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
16646    /// let x = ListVpcFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
16647    /// ```
16648    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
16649    where
16650        T: std::iter::IntoIterator<Item = V>,
16651        V: std::convert::Into<std::string::String>,
16652    {
16653        use std::iter::Iterator;
16654        self.unreachable = v.into_iter().map(|i| i.into()).collect();
16655        self
16656    }
16657}
16658
16659impl wkt::message::Message for ListVpcFlowLogsConfigsResponse {
16660    fn typename() -> &'static str {
16661        "type.googleapis.com/google.cloud.networkmanagement.v1.ListVpcFlowLogsConfigsResponse"
16662    }
16663}
16664
16665#[doc(hidden)]
16666impl google_cloud_gax::paginator::internal::PageableResponse for ListVpcFlowLogsConfigsResponse {
16667    type PageItem = crate::model::VpcFlowLogsConfig;
16668
16669    fn items(self) -> std::vec::Vec<Self::PageItem> {
16670        self.vpc_flow_logs_configs
16671    }
16672
16673    fn next_page_token(&self) -> std::string::String {
16674        use std::clone::Clone;
16675        self.next_page_token.clone()
16676    }
16677}
16678
16679/// Request for the `GetVpcFlowLogsConfig` method.
16680#[derive(Clone, Default, PartialEq)]
16681#[non_exhaustive]
16682pub struct GetVpcFlowLogsConfigRequest {
16683    /// Required. The resource name of the VpcFlowLogsConfig,
16684    /// in one of the following formats:
16685    ///
16686    /// - For project-level resources:
16687    ///   `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
16688    ///
16689    /// - For organization-level resources:
16690    ///   `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
16691    ///
16692    pub name: std::string::String,
16693
16694    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16695}
16696
16697impl GetVpcFlowLogsConfigRequest {
16698    /// Creates a new default instance.
16699    pub fn new() -> Self {
16700        std::default::Default::default()
16701    }
16702
16703    /// Sets the value of [name][crate::model::GetVpcFlowLogsConfigRequest::name].
16704    ///
16705    /// # Example
16706    /// ```ignore,no_run
16707    /// # use google_cloud_networkmanagement_v1::model::GetVpcFlowLogsConfigRequest;
16708    /// # let project_id = "project_id";
16709    /// # let location_id = "location_id";
16710    /// # let vpc_flow_logs_config_id = "vpc_flow_logs_config_id";
16711    /// let x = GetVpcFlowLogsConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}"));
16712    /// ```
16713    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16714        self.name = v.into();
16715        self
16716    }
16717}
16718
16719impl wkt::message::Message for GetVpcFlowLogsConfigRequest {
16720    fn typename() -> &'static str {
16721        "type.googleapis.com/google.cloud.networkmanagement.v1.GetVpcFlowLogsConfigRequest"
16722    }
16723}
16724
16725/// Request for the `CreateVpcFlowLogsConfig` method.
16726#[derive(Clone, Default, PartialEq)]
16727#[non_exhaustive]
16728pub struct CreateVpcFlowLogsConfigRequest {
16729    /// Required. The parent resource of the VpcFlowLogsConfig to create,
16730    /// in one of the following formats:
16731    ///
16732    /// - For project-level resources: `projects/{project_id}/locations/global`
16733    ///
16734    /// - For organization-level resources:
16735    ///   `organizations/{organization_id}/locations/global`
16736    ///
16737    pub parent: std::string::String,
16738
16739    /// Required. ID of the `VpcFlowLogsConfig`.
16740    pub vpc_flow_logs_config_id: std::string::String,
16741
16742    /// Required. A `VpcFlowLogsConfig` resource
16743    pub vpc_flow_logs_config: std::option::Option<crate::model::VpcFlowLogsConfig>,
16744
16745    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16746}
16747
16748impl CreateVpcFlowLogsConfigRequest {
16749    /// Creates a new default instance.
16750    pub fn new() -> Self {
16751        std::default::Default::default()
16752    }
16753
16754    /// Sets the value of [parent][crate::model::CreateVpcFlowLogsConfigRequest::parent].
16755    ///
16756    /// # Example
16757    /// ```ignore,no_run
16758    /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
16759    /// # let project_id = "project_id";
16760    /// # let location_id = "location_id";
16761    /// let x = CreateVpcFlowLogsConfigRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
16762    /// ```
16763    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16764        self.parent = v.into();
16765        self
16766    }
16767
16768    /// Sets the value of [vpc_flow_logs_config_id][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config_id].
16769    ///
16770    /// # Example
16771    /// ```ignore,no_run
16772    /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
16773    /// # let project_id = "project_id";
16774    /// # let location_id = "location_id";
16775    /// # let vpc_flow_logs_config_id = "vpc_flow_logs_config_id";
16776    /// let x = CreateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config_id(format!("projects/{project_id}/locations/{location_id}/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}"));
16777    /// ```
16778    pub fn set_vpc_flow_logs_config_id<T: std::convert::Into<std::string::String>>(
16779        mut self,
16780        v: T,
16781    ) -> Self {
16782        self.vpc_flow_logs_config_id = v.into();
16783        self
16784    }
16785
16786    /// Sets the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
16787    ///
16788    /// # Example
16789    /// ```ignore,no_run
16790    /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
16791    /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16792    /// let x = CreateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config(VpcFlowLogsConfig::default()/* use setters */);
16793    /// ```
16794    pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
16795    where
16796        T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16797    {
16798        self.vpc_flow_logs_config = std::option::Option::Some(v.into());
16799        self
16800    }
16801
16802    /// Sets or clears the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
16803    ///
16804    /// # Example
16805    /// ```ignore,no_run
16806    /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
16807    /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16808    /// let x = CreateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(Some(VpcFlowLogsConfig::default()/* use setters */));
16809    /// let x = CreateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(None::<VpcFlowLogsConfig>);
16810    /// ```
16811    pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
16812    where
16813        T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16814    {
16815        self.vpc_flow_logs_config = v.map(|x| x.into());
16816        self
16817    }
16818}
16819
16820impl wkt::message::Message for CreateVpcFlowLogsConfigRequest {
16821    fn typename() -> &'static str {
16822        "type.googleapis.com/google.cloud.networkmanagement.v1.CreateVpcFlowLogsConfigRequest"
16823    }
16824}
16825
16826/// Request for the `UpdateVpcFlowLogsConfig` method.
16827#[derive(Clone, Default, PartialEq)]
16828#[non_exhaustive]
16829pub struct UpdateVpcFlowLogsConfigRequest {
16830    /// Required. Mask of fields to update. At least one path must be supplied in
16831    /// this field.
16832    /// For example, to change the state of the configuration to ENABLED, specify
16833    /// `update_mask` = `"state"`, and the `vpc_flow_logs_config` would be:
16834    /// `vpc_flow_logs_config = {
16835    /// name =
16836    /// "projects/my-project/locations/global/vpcFlowLogsConfigs/my-config"
16837    /// state = "ENABLED" }`
16838    pub update_mask: std::option::Option<wkt::FieldMask>,
16839
16840    /// Required. Only fields specified in update_mask are updated.
16841    pub vpc_flow_logs_config: std::option::Option<crate::model::VpcFlowLogsConfig>,
16842
16843    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16844}
16845
16846impl UpdateVpcFlowLogsConfigRequest {
16847    /// Creates a new default instance.
16848    pub fn new() -> Self {
16849        std::default::Default::default()
16850    }
16851
16852    /// Sets the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
16853    ///
16854    /// # Example
16855    /// ```ignore,no_run
16856    /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
16857    /// use wkt::FieldMask;
16858    /// let x = UpdateVpcFlowLogsConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
16859    /// ```
16860    pub fn set_update_mask<T>(mut self, v: T) -> Self
16861    where
16862        T: std::convert::Into<wkt::FieldMask>,
16863    {
16864        self.update_mask = std::option::Option::Some(v.into());
16865        self
16866    }
16867
16868    /// Sets or clears the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
16869    ///
16870    /// # Example
16871    /// ```ignore,no_run
16872    /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
16873    /// use wkt::FieldMask;
16874    /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
16875    /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
16876    /// ```
16877    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16878    where
16879        T: std::convert::Into<wkt::FieldMask>,
16880    {
16881        self.update_mask = v.map(|x| x.into());
16882        self
16883    }
16884
16885    /// Sets the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
16886    ///
16887    /// # Example
16888    /// ```ignore,no_run
16889    /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
16890    /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16891    /// let x = UpdateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config(VpcFlowLogsConfig::default()/* use setters */);
16892    /// ```
16893    pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
16894    where
16895        T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16896    {
16897        self.vpc_flow_logs_config = std::option::Option::Some(v.into());
16898        self
16899    }
16900
16901    /// Sets or clears the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
16902    ///
16903    /// # Example
16904    /// ```ignore,no_run
16905    /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
16906    /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16907    /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(Some(VpcFlowLogsConfig::default()/* use setters */));
16908    /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(None::<VpcFlowLogsConfig>);
16909    /// ```
16910    pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
16911    where
16912        T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16913    {
16914        self.vpc_flow_logs_config = v.map(|x| x.into());
16915        self
16916    }
16917}
16918
16919impl wkt::message::Message for UpdateVpcFlowLogsConfigRequest {
16920    fn typename() -> &'static str {
16921        "type.googleapis.com/google.cloud.networkmanagement.v1.UpdateVpcFlowLogsConfigRequest"
16922    }
16923}
16924
16925/// Request for the `DeleteVpcFlowLogsConfig` method.
16926#[derive(Clone, Default, PartialEq)]
16927#[non_exhaustive]
16928pub struct DeleteVpcFlowLogsConfigRequest {
16929    /// Required. The resource name of the VpcFlowLogsConfig,
16930    /// in one of the following formats:
16931    ///
16932    /// - For a project-level resource:
16933    ///   `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
16934    ///
16935    /// - For an organization-level resource:
16936    ///   `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
16937    ///
16938    pub name: std::string::String,
16939
16940    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16941}
16942
16943impl DeleteVpcFlowLogsConfigRequest {
16944    /// Creates a new default instance.
16945    pub fn new() -> Self {
16946        std::default::Default::default()
16947    }
16948
16949    /// Sets the value of [name][crate::model::DeleteVpcFlowLogsConfigRequest::name].
16950    ///
16951    /// # Example
16952    /// ```ignore,no_run
16953    /// # use google_cloud_networkmanagement_v1::model::DeleteVpcFlowLogsConfigRequest;
16954    /// # let project_id = "project_id";
16955    /// # let location_id = "location_id";
16956    /// # let vpc_flow_logs_config_id = "vpc_flow_logs_config_id";
16957    /// let x = DeleteVpcFlowLogsConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}"));
16958    /// ```
16959    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16960        self.name = v.into();
16961        self
16962    }
16963}
16964
16965impl wkt::message::Message for DeleteVpcFlowLogsConfigRequest {
16966    fn typename() -> &'static str {
16967        "type.googleapis.com/google.cloud.networkmanagement.v1.DeleteVpcFlowLogsConfigRequest"
16968    }
16969}
16970
16971/// Request for the `QueryOrgVpcFlowLogsConfigs` method.
16972#[derive(Clone, Default, PartialEq)]
16973#[non_exhaustive]
16974pub struct QueryOrgVpcFlowLogsConfigsRequest {
16975    /// Required. The parent resource of the VpcFlowLogsConfig, specified in
16976    /// the following format: `projects/{project_id}/locations/global`
16977    pub parent: std::string::String,
16978
16979    /// Optional. Number of `VpcFlowLogsConfigs` to return.
16980    pub page_size: i32,
16981
16982    /// Optional. Page token from an earlier query, as returned in
16983    /// `next_page_token`.
16984    pub page_token: std::string::String,
16985
16986    /// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
16987    /// A filter expression must use the supported [CEL logic operators]
16988    /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
16989    pub filter: std::string::String,
16990
16991    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16992}
16993
16994impl QueryOrgVpcFlowLogsConfigsRequest {
16995    /// Creates a new default instance.
16996    pub fn new() -> Self {
16997        std::default::Default::default()
16998    }
16999
17000    /// Sets the value of [parent][crate::model::QueryOrgVpcFlowLogsConfigsRequest::parent].
17001    ///
17002    /// # Example
17003    /// ```ignore,no_run
17004    /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
17005    /// # let project_id = "project_id";
17006    /// # let location_id = "location_id";
17007    /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
17008    /// ```
17009    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17010        self.parent = v.into();
17011        self
17012    }
17013
17014    /// Sets the value of [page_size][crate::model::QueryOrgVpcFlowLogsConfigsRequest::page_size].
17015    ///
17016    /// # Example
17017    /// ```ignore,no_run
17018    /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
17019    /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_page_size(42);
17020    /// ```
17021    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17022        self.page_size = v.into();
17023        self
17024    }
17025
17026    /// Sets the value of [page_token][crate::model::QueryOrgVpcFlowLogsConfigsRequest::page_token].
17027    ///
17028    /// # Example
17029    /// ```ignore,no_run
17030    /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
17031    /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_page_token("example");
17032    /// ```
17033    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17034        self.page_token = v.into();
17035        self
17036    }
17037
17038    /// Sets the value of [filter][crate::model::QueryOrgVpcFlowLogsConfigsRequest::filter].
17039    ///
17040    /// # Example
17041    /// ```ignore,no_run
17042    /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
17043    /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_filter("example");
17044    /// ```
17045    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17046        self.filter = v.into();
17047        self
17048    }
17049}
17050
17051impl wkt::message::Message for QueryOrgVpcFlowLogsConfigsRequest {
17052    fn typename() -> &'static str {
17053        "type.googleapis.com/google.cloud.networkmanagement.v1.QueryOrgVpcFlowLogsConfigsRequest"
17054    }
17055}
17056
17057/// Response for the `QueryVpcFlowLogsConfigs` method.
17058#[derive(Clone, Default, PartialEq)]
17059#[non_exhaustive]
17060pub struct QueryOrgVpcFlowLogsConfigsResponse {
17061    /// List of VPC Flow Log configurations.
17062    pub vpc_flow_logs_configs: std::vec::Vec<crate::model::VpcFlowLogsConfig>,
17063
17064    /// Page token to fetch the next set of configurations.
17065    pub next_page_token: std::string::String,
17066
17067    /// Locations that could not be reached (when querying all locations with `-`).
17068    pub unreachable: std::vec::Vec<std::string::String>,
17069
17070    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17071}
17072
17073impl QueryOrgVpcFlowLogsConfigsResponse {
17074    /// Creates a new default instance.
17075    pub fn new() -> Self {
17076        std::default::Default::default()
17077    }
17078
17079    /// Sets the value of [vpc_flow_logs_configs][crate::model::QueryOrgVpcFlowLogsConfigsResponse::vpc_flow_logs_configs].
17080    ///
17081    /// # Example
17082    /// ```ignore,no_run
17083    /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
17084    /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17085    /// let x = QueryOrgVpcFlowLogsConfigsResponse::new()
17086    ///     .set_vpc_flow_logs_configs([
17087    ///         VpcFlowLogsConfig::default()/* use setters */,
17088    ///         VpcFlowLogsConfig::default()/* use (different) setters */,
17089    ///     ]);
17090    /// ```
17091    pub fn set_vpc_flow_logs_configs<T, V>(mut self, v: T) -> Self
17092    where
17093        T: std::iter::IntoIterator<Item = V>,
17094        V: std::convert::Into<crate::model::VpcFlowLogsConfig>,
17095    {
17096        use std::iter::Iterator;
17097        self.vpc_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
17098        self
17099    }
17100
17101    /// Sets the value of [next_page_token][crate::model::QueryOrgVpcFlowLogsConfigsResponse::next_page_token].
17102    ///
17103    /// # Example
17104    /// ```ignore,no_run
17105    /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
17106    /// let x = QueryOrgVpcFlowLogsConfigsResponse::new().set_next_page_token("example");
17107    /// ```
17108    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17109        self.next_page_token = v.into();
17110        self
17111    }
17112
17113    /// Sets the value of [unreachable][crate::model::QueryOrgVpcFlowLogsConfigsResponse::unreachable].
17114    ///
17115    /// # Example
17116    /// ```ignore,no_run
17117    /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
17118    /// let x = QueryOrgVpcFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
17119    /// ```
17120    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17121    where
17122        T: std::iter::IntoIterator<Item = V>,
17123        V: std::convert::Into<std::string::String>,
17124    {
17125        use std::iter::Iterator;
17126        self.unreachable = v.into_iter().map(|i| i.into()).collect();
17127        self
17128    }
17129}
17130
17131impl wkt::message::Message for QueryOrgVpcFlowLogsConfigsResponse {
17132    fn typename() -> &'static str {
17133        "type.googleapis.com/google.cloud.networkmanagement.v1.QueryOrgVpcFlowLogsConfigsResponse"
17134    }
17135}
17136
17137#[doc(hidden)]
17138impl google_cloud_gax::paginator::internal::PageableResponse
17139    for QueryOrgVpcFlowLogsConfigsResponse
17140{
17141    type PageItem = crate::model::VpcFlowLogsConfig;
17142
17143    fn items(self) -> std::vec::Vec<Self::PageItem> {
17144        self.vpc_flow_logs_configs
17145    }
17146
17147    fn next_page_token(&self) -> std::string::String {
17148        use std::clone::Clone;
17149        self.next_page_token.clone()
17150    }
17151}
17152
17153/// Request for the `ShowEffectiveFlowLogsConfigs` method.
17154#[derive(Clone, Default, PartialEq)]
17155#[non_exhaustive]
17156pub struct ShowEffectiveFlowLogsConfigsRequest {
17157    /// Required. The parent resource of the VpcFlowLogsConfig, specified in
17158    /// the following format: `projects/{project_id}/locations/global`
17159    pub parent: std::string::String,
17160
17161    /// Required. The resource to get the effective VPC Flow Logs configuration
17162    /// for. The resource must belong to the same project as the parent. The
17163    /// resource must be a network, subnetwork, interconnect attachment, VPN
17164    /// tunnel, or a project.
17165    pub resource: std::string::String,
17166
17167    /// Optional. Number of `EffectiveVpcFlowLogsConfigs` to return. Default is 30.
17168    pub page_size: i32,
17169
17170    /// Optional. Page token from an earlier query, as returned in
17171    /// `next_page_token`.
17172    pub page_token: std::string::String,
17173
17174    /// Optional. Lists the `EffectiveVpcFlowLogsConfigs` that match the filter
17175    /// expression. A filter expression must use the supported [CEL logic
17176    /// operators]
17177    /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
17178    pub filter: std::string::String,
17179
17180    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17181}
17182
17183impl ShowEffectiveFlowLogsConfigsRequest {
17184    /// Creates a new default instance.
17185    pub fn new() -> Self {
17186        std::default::Default::default()
17187    }
17188
17189    /// Sets the value of [parent][crate::model::ShowEffectiveFlowLogsConfigsRequest::parent].
17190    ///
17191    /// # Example
17192    /// ```ignore,no_run
17193    /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17194    /// # let project_id = "project_id";
17195    /// # let location_id = "location_id";
17196    /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
17197    /// ```
17198    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17199        self.parent = v.into();
17200        self
17201    }
17202
17203    /// Sets the value of [resource][crate::model::ShowEffectiveFlowLogsConfigsRequest::resource].
17204    ///
17205    /// # Example
17206    /// ```ignore,no_run
17207    /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17208    /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_resource("example");
17209    /// ```
17210    pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17211        self.resource = v.into();
17212        self
17213    }
17214
17215    /// Sets the value of [page_size][crate::model::ShowEffectiveFlowLogsConfigsRequest::page_size].
17216    ///
17217    /// # Example
17218    /// ```ignore,no_run
17219    /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17220    /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_page_size(42);
17221    /// ```
17222    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17223        self.page_size = v.into();
17224        self
17225    }
17226
17227    /// Sets the value of [page_token][crate::model::ShowEffectiveFlowLogsConfigsRequest::page_token].
17228    ///
17229    /// # Example
17230    /// ```ignore,no_run
17231    /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17232    /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_page_token("example");
17233    /// ```
17234    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17235        self.page_token = v.into();
17236        self
17237    }
17238
17239    /// Sets the value of [filter][crate::model::ShowEffectiveFlowLogsConfigsRequest::filter].
17240    ///
17241    /// # Example
17242    /// ```ignore,no_run
17243    /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17244    /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_filter("example");
17245    /// ```
17246    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17247        self.filter = v.into();
17248        self
17249    }
17250}
17251
17252impl wkt::message::Message for ShowEffectiveFlowLogsConfigsRequest {
17253    fn typename() -> &'static str {
17254        "type.googleapis.com/google.cloud.networkmanagement.v1.ShowEffectiveFlowLogsConfigsRequest"
17255    }
17256}
17257
17258/// Response for the `ShowEffectiveFlowLogsConfigs` method.
17259#[derive(Clone, Default, PartialEq)]
17260#[non_exhaustive]
17261pub struct ShowEffectiveFlowLogsConfigsResponse {
17262    /// List of Effective Vpc Flow Logs configurations.
17263    pub effective_flow_logs_configs: std::vec::Vec<crate::model::EffectiveVpcFlowLogsConfig>,
17264
17265    /// Page token to fetch the next set of configurations.
17266    pub next_page_token: std::string::String,
17267
17268    /// Locations that could not be reached (when querying all locations with `-`).
17269    pub unreachable: std::vec::Vec<std::string::String>,
17270
17271    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17272}
17273
17274impl ShowEffectiveFlowLogsConfigsResponse {
17275    /// Creates a new default instance.
17276    pub fn new() -> Self {
17277        std::default::Default::default()
17278    }
17279
17280    /// Sets the value of [effective_flow_logs_configs][crate::model::ShowEffectiveFlowLogsConfigsResponse::effective_flow_logs_configs].
17281    ///
17282    /// # Example
17283    /// ```ignore,no_run
17284    /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
17285    /// use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17286    /// let x = ShowEffectiveFlowLogsConfigsResponse::new()
17287    ///     .set_effective_flow_logs_configs([
17288    ///         EffectiveVpcFlowLogsConfig::default()/* use setters */,
17289    ///         EffectiveVpcFlowLogsConfig::default()/* use (different) setters */,
17290    ///     ]);
17291    /// ```
17292    pub fn set_effective_flow_logs_configs<T, V>(mut self, v: T) -> Self
17293    where
17294        T: std::iter::IntoIterator<Item = V>,
17295        V: std::convert::Into<crate::model::EffectiveVpcFlowLogsConfig>,
17296    {
17297        use std::iter::Iterator;
17298        self.effective_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
17299        self
17300    }
17301
17302    /// Sets the value of [next_page_token][crate::model::ShowEffectiveFlowLogsConfigsResponse::next_page_token].
17303    ///
17304    /// # Example
17305    /// ```ignore,no_run
17306    /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
17307    /// let x = ShowEffectiveFlowLogsConfigsResponse::new().set_next_page_token("example");
17308    /// ```
17309    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17310        self.next_page_token = v.into();
17311        self
17312    }
17313
17314    /// Sets the value of [unreachable][crate::model::ShowEffectiveFlowLogsConfigsResponse::unreachable].
17315    ///
17316    /// # Example
17317    /// ```ignore,no_run
17318    /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
17319    /// let x = ShowEffectiveFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
17320    /// ```
17321    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17322    where
17323        T: std::iter::IntoIterator<Item = V>,
17324        V: std::convert::Into<std::string::String>,
17325    {
17326        use std::iter::Iterator;
17327        self.unreachable = v.into_iter().map(|i| i.into()).collect();
17328        self
17329    }
17330}
17331
17332impl wkt::message::Message for ShowEffectiveFlowLogsConfigsResponse {
17333    fn typename() -> &'static str {
17334        "type.googleapis.com/google.cloud.networkmanagement.v1.ShowEffectiveFlowLogsConfigsResponse"
17335    }
17336}
17337
17338#[doc(hidden)]
17339impl google_cloud_gax::paginator::internal::PageableResponse
17340    for ShowEffectiveFlowLogsConfigsResponse
17341{
17342    type PageItem = crate::model::EffectiveVpcFlowLogsConfig;
17343
17344    fn items(self) -> std::vec::Vec<Self::PageItem> {
17345        self.effective_flow_logs_configs
17346    }
17347
17348    fn next_page_token(&self) -> std::string::String {
17349        use std::clone::Clone;
17350        self.next_page_token.clone()
17351    }
17352}
17353
17354/// A configuration to generate VPC Flow Logs.
17355#[derive(Clone, Default, PartialEq)]
17356#[non_exhaustive]
17357pub struct VpcFlowLogsConfig {
17358    /// Identifier. Unique name of the configuration. The name can have one of the
17359    /// following forms:
17360    ///
17361    /// - For project-level configurations:
17362    ///   `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
17363    ///
17364    /// - For organization-level configurations:
17365    ///   `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
17366    ///
17367    pub name: std::string::String,
17368
17369    /// Optional. The user-supplied description of the VPC Flow Logs configuration.
17370    /// Maximum of 512 characters.
17371    pub description: std::option::Option<std::string::String>,
17372
17373    /// Optional. The state of the VPC Flow Log configuration. Default value is
17374    /// ENABLED. When creating a new configuration, it must be enabled. Setting
17375    /// state=DISABLED will pause the log generation for this config.
17376    pub state: std::option::Option<crate::model::vpc_flow_logs_config::State>,
17377
17378    /// Optional. The aggregation interval for the logs. Default value is
17379    /// INTERVAL_5_SEC.
17380    pub aggregation_interval:
17381        std::option::Option<crate::model::vpc_flow_logs_config::AggregationInterval>,
17382
17383    /// Optional. The value of the field must be in (0, 1]. The sampling rate of
17384    /// VPC Flow Logs where 1.0 means all collected logs are reported. Setting the
17385    /// sampling rate to 0.0 is not allowed. If you want to disable VPC Flow Logs,
17386    /// use the state field instead. Default value is 1.0.
17387    pub flow_sampling: std::option::Option<f32>,
17388
17389    /// Optional. Configures whether all, none or a subset of metadata fields
17390    /// should be added to the reported VPC flow logs. Default value is
17391    /// INCLUDE_ALL_METADATA.
17392    pub metadata: std::option::Option<crate::model::vpc_flow_logs_config::Metadata>,
17393
17394    /// Optional. Custom metadata fields to include in the reported VPC flow logs.
17395    /// Can only be specified if "metadata" was set to CUSTOM_METADATA.
17396    pub metadata_fields: std::vec::Vec<std::string::String>,
17397
17398    /// Optional. Export filter used to define which VPC Flow Logs should be
17399    /// logged.
17400    pub filter_expr: std::option::Option<std::string::String>,
17401
17402    /// Optional. Determines whether to include cross project annotations in the
17403    /// logs. This field is available only for organization configurations. If not
17404    /// specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
17405    pub cross_project_metadata:
17406        std::option::Option<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
17407
17408    /// Output only. Describes the state of the configured target resource for
17409    /// diagnostic purposes.
17410    pub target_resource_state:
17411        std::option::Option<crate::model::vpc_flow_logs_config::TargetResourceState>,
17412
17413    /// Optional. Resource labels to represent user-provided metadata.
17414    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
17415
17416    /// Output only. The time the config was created.
17417    pub create_time: std::option::Option<wkt::Timestamp>,
17418
17419    /// Output only. The time the config was updated.
17420    pub update_time: std::option::Option<wkt::Timestamp>,
17421
17422    /// Reference to the resource of the config scope. That is, the scope from
17423    /// which traffic is logged. The target resource must belong to the same
17424    /// project as the configuration.
17425    /// This field is not supported for organization level configurations.
17426    pub target_resource: std::option::Option<crate::model::vpc_flow_logs_config::TargetResource>,
17427
17428    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17429}
17430
17431impl VpcFlowLogsConfig {
17432    /// Creates a new default instance.
17433    pub fn new() -> Self {
17434        std::default::Default::default()
17435    }
17436
17437    /// Sets the value of [name][crate::model::VpcFlowLogsConfig::name].
17438    ///
17439    /// # Example
17440    /// ```ignore,no_run
17441    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17442    /// # let project_id = "project_id";
17443    /// # let location_id = "location_id";
17444    /// # let vpc_flow_logs_config_id = "vpc_flow_logs_config_id";
17445    /// let x = VpcFlowLogsConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}"));
17446    /// ```
17447    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17448        self.name = v.into();
17449        self
17450    }
17451
17452    /// Sets the value of [description][crate::model::VpcFlowLogsConfig::description].
17453    ///
17454    /// # Example
17455    /// ```ignore,no_run
17456    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17457    /// let x = VpcFlowLogsConfig::new().set_description("example");
17458    /// ```
17459    pub fn set_description<T>(mut self, v: T) -> Self
17460    where
17461        T: std::convert::Into<std::string::String>,
17462    {
17463        self.description = std::option::Option::Some(v.into());
17464        self
17465    }
17466
17467    /// Sets or clears the value of [description][crate::model::VpcFlowLogsConfig::description].
17468    ///
17469    /// # Example
17470    /// ```ignore,no_run
17471    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17472    /// let x = VpcFlowLogsConfig::new().set_or_clear_description(Some("example"));
17473    /// let x = VpcFlowLogsConfig::new().set_or_clear_description(None::<String>);
17474    /// ```
17475    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
17476    where
17477        T: std::convert::Into<std::string::String>,
17478    {
17479        self.description = v.map(|x| x.into());
17480        self
17481    }
17482
17483    /// Sets the value of [state][crate::model::VpcFlowLogsConfig::state].
17484    ///
17485    /// # Example
17486    /// ```ignore,no_run
17487    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17488    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
17489    /// let x0 = VpcFlowLogsConfig::new().set_state(State::Enabled);
17490    /// let x1 = VpcFlowLogsConfig::new().set_state(State::Disabled);
17491    /// ```
17492    pub fn set_state<T>(mut self, v: T) -> Self
17493    where
17494        T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
17495    {
17496        self.state = std::option::Option::Some(v.into());
17497        self
17498    }
17499
17500    /// Sets or clears the value of [state][crate::model::VpcFlowLogsConfig::state].
17501    ///
17502    /// # Example
17503    /// ```ignore,no_run
17504    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17505    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
17506    /// let x0 = VpcFlowLogsConfig::new().set_or_clear_state(Some(State::Enabled));
17507    /// let x1 = VpcFlowLogsConfig::new().set_or_clear_state(Some(State::Disabled));
17508    /// let x_none = VpcFlowLogsConfig::new().set_or_clear_state(None::<State>);
17509    /// ```
17510    pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
17511    where
17512        T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
17513    {
17514        self.state = v.map(|x| x.into());
17515        self
17516    }
17517
17518    /// Sets the value of [aggregation_interval][crate::model::VpcFlowLogsConfig::aggregation_interval].
17519    ///
17520    /// # Example
17521    /// ```ignore,no_run
17522    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17523    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
17524    /// let x0 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval5Sec);
17525    /// let x1 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval30Sec);
17526    /// let x2 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval1Min);
17527    /// ```
17528    pub fn set_aggregation_interval<T>(mut self, v: T) -> Self
17529    where
17530        T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
17531    {
17532        self.aggregation_interval = std::option::Option::Some(v.into());
17533        self
17534    }
17535
17536    /// Sets or clears the value of [aggregation_interval][crate::model::VpcFlowLogsConfig::aggregation_interval].
17537    ///
17538    /// # Example
17539    /// ```ignore,no_run
17540    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17541    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
17542    /// let x0 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval5Sec));
17543    /// let x1 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval30Sec));
17544    /// let x2 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval1Min));
17545    /// let x_none = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(None::<AggregationInterval>);
17546    /// ```
17547    pub fn set_or_clear_aggregation_interval<T>(mut self, v: std::option::Option<T>) -> Self
17548    where
17549        T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
17550    {
17551        self.aggregation_interval = v.map(|x| x.into());
17552        self
17553    }
17554
17555    /// Sets the value of [flow_sampling][crate::model::VpcFlowLogsConfig::flow_sampling].
17556    ///
17557    /// # Example
17558    /// ```ignore,no_run
17559    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17560    /// let x = VpcFlowLogsConfig::new().set_flow_sampling(42.0);
17561    /// ```
17562    pub fn set_flow_sampling<T>(mut self, v: T) -> Self
17563    where
17564        T: std::convert::Into<f32>,
17565    {
17566        self.flow_sampling = std::option::Option::Some(v.into());
17567        self
17568    }
17569
17570    /// Sets or clears the value of [flow_sampling][crate::model::VpcFlowLogsConfig::flow_sampling].
17571    ///
17572    /// # Example
17573    /// ```ignore,no_run
17574    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17575    /// let x = VpcFlowLogsConfig::new().set_or_clear_flow_sampling(Some(42.0));
17576    /// let x = VpcFlowLogsConfig::new().set_or_clear_flow_sampling(None::<f32>);
17577    /// ```
17578    pub fn set_or_clear_flow_sampling<T>(mut self, v: std::option::Option<T>) -> Self
17579    where
17580        T: std::convert::Into<f32>,
17581    {
17582        self.flow_sampling = v.map(|x| x.into());
17583        self
17584    }
17585
17586    /// Sets the value of [metadata][crate::model::VpcFlowLogsConfig::metadata].
17587    ///
17588    /// # Example
17589    /// ```ignore,no_run
17590    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17591    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
17592    /// let x0 = VpcFlowLogsConfig::new().set_metadata(Metadata::IncludeAllMetadata);
17593    /// let x1 = VpcFlowLogsConfig::new().set_metadata(Metadata::ExcludeAllMetadata);
17594    /// let x2 = VpcFlowLogsConfig::new().set_metadata(Metadata::CustomMetadata);
17595    /// ```
17596    pub fn set_metadata<T>(mut self, v: T) -> Self
17597    where
17598        T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
17599    {
17600        self.metadata = std::option::Option::Some(v.into());
17601        self
17602    }
17603
17604    /// Sets or clears the value of [metadata][crate::model::VpcFlowLogsConfig::metadata].
17605    ///
17606    /// # Example
17607    /// ```ignore,no_run
17608    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17609    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
17610    /// let x0 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::IncludeAllMetadata));
17611    /// let x1 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::ExcludeAllMetadata));
17612    /// let x2 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::CustomMetadata));
17613    /// let x_none = VpcFlowLogsConfig::new().set_or_clear_metadata(None::<Metadata>);
17614    /// ```
17615    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
17616    where
17617        T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
17618    {
17619        self.metadata = v.map(|x| x.into());
17620        self
17621    }
17622
17623    /// Sets the value of [metadata_fields][crate::model::VpcFlowLogsConfig::metadata_fields].
17624    ///
17625    /// # Example
17626    /// ```ignore,no_run
17627    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17628    /// let x = VpcFlowLogsConfig::new().set_metadata_fields(["a", "b", "c"]);
17629    /// ```
17630    pub fn set_metadata_fields<T, V>(mut self, v: T) -> Self
17631    where
17632        T: std::iter::IntoIterator<Item = V>,
17633        V: std::convert::Into<std::string::String>,
17634    {
17635        use std::iter::Iterator;
17636        self.metadata_fields = v.into_iter().map(|i| i.into()).collect();
17637        self
17638    }
17639
17640    /// Sets the value of [filter_expr][crate::model::VpcFlowLogsConfig::filter_expr].
17641    ///
17642    /// # Example
17643    /// ```ignore,no_run
17644    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17645    /// let x = VpcFlowLogsConfig::new().set_filter_expr("example");
17646    /// ```
17647    pub fn set_filter_expr<T>(mut self, v: T) -> Self
17648    where
17649        T: std::convert::Into<std::string::String>,
17650    {
17651        self.filter_expr = std::option::Option::Some(v.into());
17652        self
17653    }
17654
17655    /// Sets or clears the value of [filter_expr][crate::model::VpcFlowLogsConfig::filter_expr].
17656    ///
17657    /// # Example
17658    /// ```ignore,no_run
17659    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17660    /// let x = VpcFlowLogsConfig::new().set_or_clear_filter_expr(Some("example"));
17661    /// let x = VpcFlowLogsConfig::new().set_or_clear_filter_expr(None::<String>);
17662    /// ```
17663    pub fn set_or_clear_filter_expr<T>(mut self, v: std::option::Option<T>) -> Self
17664    where
17665        T: std::convert::Into<std::string::String>,
17666    {
17667        self.filter_expr = v.map(|x| x.into());
17668        self
17669    }
17670
17671    /// Sets the value of [cross_project_metadata][crate::model::VpcFlowLogsConfig::cross_project_metadata].
17672    ///
17673    /// # Example
17674    /// ```ignore,no_run
17675    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17676    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
17677    /// let x0 = VpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Enabled);
17678    /// let x1 = VpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Disabled);
17679    /// ```
17680    pub fn set_cross_project_metadata<T>(mut self, v: T) -> Self
17681    where
17682        T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
17683    {
17684        self.cross_project_metadata = std::option::Option::Some(v.into());
17685        self
17686    }
17687
17688    /// Sets or clears the value of [cross_project_metadata][crate::model::VpcFlowLogsConfig::cross_project_metadata].
17689    ///
17690    /// # Example
17691    /// ```ignore,no_run
17692    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17693    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
17694    /// let x0 = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Enabled));
17695    /// let x1 = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Disabled));
17696    /// let x_none = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(None::<CrossProjectMetadata>);
17697    /// ```
17698    pub fn set_or_clear_cross_project_metadata<T>(mut self, v: std::option::Option<T>) -> Self
17699    where
17700        T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
17701    {
17702        self.cross_project_metadata = v.map(|x| x.into());
17703        self
17704    }
17705
17706    /// Sets the value of [target_resource_state][crate::model::VpcFlowLogsConfig::target_resource_state].
17707    ///
17708    /// # Example
17709    /// ```ignore,no_run
17710    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17711    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResourceState;
17712    /// let x0 = VpcFlowLogsConfig::new().set_target_resource_state(TargetResourceState::TargetResourceExists);
17713    /// let x1 = VpcFlowLogsConfig::new().set_target_resource_state(TargetResourceState::TargetResourceDoesNotExist);
17714    /// ```
17715    pub fn set_target_resource_state<T>(mut self, v: T) -> Self
17716    where
17717        T: std::convert::Into<crate::model::vpc_flow_logs_config::TargetResourceState>,
17718    {
17719        self.target_resource_state = std::option::Option::Some(v.into());
17720        self
17721    }
17722
17723    /// Sets or clears the value of [target_resource_state][crate::model::VpcFlowLogsConfig::target_resource_state].
17724    ///
17725    /// # Example
17726    /// ```ignore,no_run
17727    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17728    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResourceState;
17729    /// let x0 = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(Some(TargetResourceState::TargetResourceExists));
17730    /// let x1 = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(Some(TargetResourceState::TargetResourceDoesNotExist));
17731    /// let x_none = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(None::<TargetResourceState>);
17732    /// ```
17733    pub fn set_or_clear_target_resource_state<T>(mut self, v: std::option::Option<T>) -> Self
17734    where
17735        T: std::convert::Into<crate::model::vpc_flow_logs_config::TargetResourceState>,
17736    {
17737        self.target_resource_state = v.map(|x| x.into());
17738        self
17739    }
17740
17741    /// Sets the value of [labels][crate::model::VpcFlowLogsConfig::labels].
17742    ///
17743    /// # Example
17744    /// ```ignore,no_run
17745    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17746    /// let x = VpcFlowLogsConfig::new().set_labels([
17747    ///     ("key0", "abc"),
17748    ///     ("key1", "xyz"),
17749    /// ]);
17750    /// ```
17751    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
17752    where
17753        T: std::iter::IntoIterator<Item = (K, V)>,
17754        K: std::convert::Into<std::string::String>,
17755        V: std::convert::Into<std::string::String>,
17756    {
17757        use std::iter::Iterator;
17758        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17759        self
17760    }
17761
17762    /// Sets the value of [create_time][crate::model::VpcFlowLogsConfig::create_time].
17763    ///
17764    /// # Example
17765    /// ```ignore,no_run
17766    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17767    /// use wkt::Timestamp;
17768    /// let x = VpcFlowLogsConfig::new().set_create_time(Timestamp::default()/* use setters */);
17769    /// ```
17770    pub fn set_create_time<T>(mut self, v: T) -> Self
17771    where
17772        T: std::convert::Into<wkt::Timestamp>,
17773    {
17774        self.create_time = std::option::Option::Some(v.into());
17775        self
17776    }
17777
17778    /// Sets or clears the value of [create_time][crate::model::VpcFlowLogsConfig::create_time].
17779    ///
17780    /// # Example
17781    /// ```ignore,no_run
17782    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17783    /// use wkt::Timestamp;
17784    /// let x = VpcFlowLogsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17785    /// let x = VpcFlowLogsConfig::new().set_or_clear_create_time(None::<Timestamp>);
17786    /// ```
17787    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17788    where
17789        T: std::convert::Into<wkt::Timestamp>,
17790    {
17791        self.create_time = v.map(|x| x.into());
17792        self
17793    }
17794
17795    /// Sets the value of [update_time][crate::model::VpcFlowLogsConfig::update_time].
17796    ///
17797    /// # Example
17798    /// ```ignore,no_run
17799    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17800    /// use wkt::Timestamp;
17801    /// let x = VpcFlowLogsConfig::new().set_update_time(Timestamp::default()/* use setters */);
17802    /// ```
17803    pub fn set_update_time<T>(mut self, v: T) -> Self
17804    where
17805        T: std::convert::Into<wkt::Timestamp>,
17806    {
17807        self.update_time = std::option::Option::Some(v.into());
17808        self
17809    }
17810
17811    /// Sets or clears the value of [update_time][crate::model::VpcFlowLogsConfig::update_time].
17812    ///
17813    /// # Example
17814    /// ```ignore,no_run
17815    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17816    /// use wkt::Timestamp;
17817    /// let x = VpcFlowLogsConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
17818    /// let x = VpcFlowLogsConfig::new().set_or_clear_update_time(None::<Timestamp>);
17819    /// ```
17820    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
17821    where
17822        T: std::convert::Into<wkt::Timestamp>,
17823    {
17824        self.update_time = v.map(|x| x.into());
17825        self
17826    }
17827
17828    /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource].
17829    ///
17830    /// Note that all the setters affecting `target_resource` are mutually
17831    /// exclusive.
17832    ///
17833    /// # Example
17834    /// ```ignore,no_run
17835    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17836    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResource;
17837    /// let x = VpcFlowLogsConfig::new().set_target_resource(Some(TargetResource::Network("example".to_string())));
17838    /// ```
17839    pub fn set_target_resource<
17840        T: std::convert::Into<std::option::Option<crate::model::vpc_flow_logs_config::TargetResource>>,
17841    >(
17842        mut self,
17843        v: T,
17844    ) -> Self {
17845        self.target_resource = v.into();
17846        self
17847    }
17848
17849    /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17850    /// if it holds a `Network`, `None` if the field is not set or
17851    /// holds a different branch.
17852    pub fn network(&self) -> std::option::Option<&std::string::String> {
17853        #[allow(unreachable_patterns)]
17854        self.target_resource.as_ref().and_then(|v| match v {
17855            crate::model::vpc_flow_logs_config::TargetResource::Network(v) => {
17856                std::option::Option::Some(v)
17857            }
17858            _ => std::option::Option::None,
17859        })
17860    }
17861
17862    /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17863    /// to hold a `Network`.
17864    ///
17865    /// Note that all the setters affecting `target_resource` are
17866    /// mutually exclusive.
17867    ///
17868    /// # Example
17869    /// ```ignore,no_run
17870    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17871    /// let x = VpcFlowLogsConfig::new().set_network("example");
17872    /// assert!(x.network().is_some());
17873    /// assert!(x.subnet().is_none());
17874    /// assert!(x.interconnect_attachment().is_none());
17875    /// assert!(x.vpn_tunnel().is_none());
17876    /// ```
17877    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17878        self.target_resource = std::option::Option::Some(
17879            crate::model::vpc_flow_logs_config::TargetResource::Network(v.into()),
17880        );
17881        self
17882    }
17883
17884    /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17885    /// if it holds a `Subnet`, `None` if the field is not set or
17886    /// holds a different branch.
17887    pub fn subnet(&self) -> std::option::Option<&std::string::String> {
17888        #[allow(unreachable_patterns)]
17889        self.target_resource.as_ref().and_then(|v| match v {
17890            crate::model::vpc_flow_logs_config::TargetResource::Subnet(v) => {
17891                std::option::Option::Some(v)
17892            }
17893            _ => std::option::Option::None,
17894        })
17895    }
17896
17897    /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17898    /// to hold a `Subnet`.
17899    ///
17900    /// Note that all the setters affecting `target_resource` are
17901    /// mutually exclusive.
17902    ///
17903    /// # Example
17904    /// ```ignore,no_run
17905    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17906    /// let x = VpcFlowLogsConfig::new().set_subnet("example");
17907    /// assert!(x.subnet().is_some());
17908    /// assert!(x.network().is_none());
17909    /// assert!(x.interconnect_attachment().is_none());
17910    /// assert!(x.vpn_tunnel().is_none());
17911    /// ```
17912    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17913        self.target_resource = std::option::Option::Some(
17914            crate::model::vpc_flow_logs_config::TargetResource::Subnet(v.into()),
17915        );
17916        self
17917    }
17918
17919    /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17920    /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
17921    /// holds a different branch.
17922    pub fn interconnect_attachment(&self) -> std::option::Option<&std::string::String> {
17923        #[allow(unreachable_patterns)]
17924        self.target_resource.as_ref().and_then(|v| match v {
17925            crate::model::vpc_flow_logs_config::TargetResource::InterconnectAttachment(v) => {
17926                std::option::Option::Some(v)
17927            }
17928            _ => std::option::Option::None,
17929        })
17930    }
17931
17932    /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17933    /// to hold a `InterconnectAttachment`.
17934    ///
17935    /// Note that all the setters affecting `target_resource` are
17936    /// mutually exclusive.
17937    ///
17938    /// # Example
17939    /// ```ignore,no_run
17940    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17941    /// let x = VpcFlowLogsConfig::new().set_interconnect_attachment("example");
17942    /// assert!(x.interconnect_attachment().is_some());
17943    /// assert!(x.network().is_none());
17944    /// assert!(x.subnet().is_none());
17945    /// assert!(x.vpn_tunnel().is_none());
17946    /// ```
17947    pub fn set_interconnect_attachment<T: std::convert::Into<std::string::String>>(
17948        mut self,
17949        v: T,
17950    ) -> Self {
17951        self.target_resource = std::option::Option::Some(
17952            crate::model::vpc_flow_logs_config::TargetResource::InterconnectAttachment(v.into()),
17953        );
17954        self
17955    }
17956
17957    /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17958    /// if it holds a `VpnTunnel`, `None` if the field is not set or
17959    /// holds a different branch.
17960    pub fn vpn_tunnel(&self) -> std::option::Option<&std::string::String> {
17961        #[allow(unreachable_patterns)]
17962        self.target_resource.as_ref().and_then(|v| match v {
17963            crate::model::vpc_flow_logs_config::TargetResource::VpnTunnel(v) => {
17964                std::option::Option::Some(v)
17965            }
17966            _ => std::option::Option::None,
17967        })
17968    }
17969
17970    /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17971    /// to hold a `VpnTunnel`.
17972    ///
17973    /// Note that all the setters affecting `target_resource` are
17974    /// mutually exclusive.
17975    ///
17976    /// # Example
17977    /// ```ignore,no_run
17978    /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17979    /// let x = VpcFlowLogsConfig::new().set_vpn_tunnel("example");
17980    /// assert!(x.vpn_tunnel().is_some());
17981    /// assert!(x.network().is_none());
17982    /// assert!(x.subnet().is_none());
17983    /// assert!(x.interconnect_attachment().is_none());
17984    /// ```
17985    pub fn set_vpn_tunnel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17986        self.target_resource = std::option::Option::Some(
17987            crate::model::vpc_flow_logs_config::TargetResource::VpnTunnel(v.into()),
17988        );
17989        self
17990    }
17991}
17992
17993impl wkt::message::Message for VpcFlowLogsConfig {
17994    fn typename() -> &'static str {
17995        "type.googleapis.com/google.cloud.networkmanagement.v1.VpcFlowLogsConfig"
17996    }
17997}
17998
17999/// Defines additional types related to [VpcFlowLogsConfig].
18000pub mod vpc_flow_logs_config {
18001    #[allow(unused_imports)]
18002    use super::*;
18003
18004    /// Determines whether this configuration will be generating logs.
18005    ///
18006    /// # Working with unknown values
18007    ///
18008    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18009    /// additional enum variants at any time. Adding new variants is not considered
18010    /// a breaking change. Applications should write their code in anticipation of:
18011    ///
18012    /// - New values appearing in future releases of the client library, **and**
18013    /// - New values received dynamically, without application changes.
18014    ///
18015    /// Please consult the [Working with enums] section in the user guide for some
18016    /// guidelines.
18017    ///
18018    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18019    #[derive(Clone, Debug, PartialEq)]
18020    #[non_exhaustive]
18021    pub enum State {
18022        /// If not specified, will default to ENABLED.
18023        Unspecified,
18024        /// When ENABLED, this configuration will generate logs.
18025        Enabled,
18026        /// When DISABLED, this configuration will not generate logs.
18027        Disabled,
18028        /// If set, the enum was initialized with an unknown value.
18029        ///
18030        /// Applications can examine the value using [State::value] or
18031        /// [State::name].
18032        UnknownValue(state::UnknownValue),
18033    }
18034
18035    #[doc(hidden)]
18036    pub mod state {
18037        #[allow(unused_imports)]
18038        use super::*;
18039        #[derive(Clone, Debug, PartialEq)]
18040        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18041    }
18042
18043    impl State {
18044        /// Gets the enum value.
18045        ///
18046        /// Returns `None` if the enum contains an unknown value deserialized from
18047        /// the string representation of enums.
18048        pub fn value(&self) -> std::option::Option<i32> {
18049            match self {
18050                Self::Unspecified => std::option::Option::Some(0),
18051                Self::Enabled => std::option::Option::Some(1),
18052                Self::Disabled => std::option::Option::Some(2),
18053                Self::UnknownValue(u) => u.0.value(),
18054            }
18055        }
18056
18057        /// Gets the enum value as a string.
18058        ///
18059        /// Returns `None` if the enum contains an unknown value deserialized from
18060        /// the integer representation of enums.
18061        pub fn name(&self) -> std::option::Option<&str> {
18062            match self {
18063                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18064                Self::Enabled => std::option::Option::Some("ENABLED"),
18065                Self::Disabled => std::option::Option::Some("DISABLED"),
18066                Self::UnknownValue(u) => u.0.name(),
18067            }
18068        }
18069    }
18070
18071    impl std::default::Default for State {
18072        fn default() -> Self {
18073            use std::convert::From;
18074            Self::from(0)
18075        }
18076    }
18077
18078    impl std::fmt::Display for State {
18079        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18080            wkt::internal::display_enum(f, self.name(), self.value())
18081        }
18082    }
18083
18084    impl std::convert::From<i32> for State {
18085        fn from(value: i32) -> Self {
18086            match value {
18087                0 => Self::Unspecified,
18088                1 => Self::Enabled,
18089                2 => Self::Disabled,
18090                _ => Self::UnknownValue(state::UnknownValue(
18091                    wkt::internal::UnknownEnumValue::Integer(value),
18092                )),
18093            }
18094        }
18095    }
18096
18097    impl std::convert::From<&str> for State {
18098        fn from(value: &str) -> Self {
18099            use std::string::ToString;
18100            match value {
18101                "STATE_UNSPECIFIED" => Self::Unspecified,
18102                "ENABLED" => Self::Enabled,
18103                "DISABLED" => Self::Disabled,
18104                _ => Self::UnknownValue(state::UnknownValue(
18105                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18106                )),
18107            }
18108        }
18109    }
18110
18111    impl serde::ser::Serialize for State {
18112        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18113        where
18114            S: serde::Serializer,
18115        {
18116            match self {
18117                Self::Unspecified => serializer.serialize_i32(0),
18118                Self::Enabled => serializer.serialize_i32(1),
18119                Self::Disabled => serializer.serialize_i32(2),
18120                Self::UnknownValue(u) => u.0.serialize(serializer),
18121            }
18122        }
18123    }
18124
18125    impl<'de> serde::de::Deserialize<'de> for State {
18126        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18127        where
18128            D: serde::Deserializer<'de>,
18129        {
18130            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18131                ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.State",
18132            ))
18133        }
18134    }
18135
18136    /// Toggles the aggregation interval for collecting flow logs by 5-tuple.
18137    ///
18138    /// # Working with unknown values
18139    ///
18140    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18141    /// additional enum variants at any time. Adding new variants is not considered
18142    /// a breaking change. Applications should write their code in anticipation of:
18143    ///
18144    /// - New values appearing in future releases of the client library, **and**
18145    /// - New values received dynamically, without application changes.
18146    ///
18147    /// Please consult the [Working with enums] section in the user guide for some
18148    /// guidelines.
18149    ///
18150    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18151    #[derive(Clone, Debug, PartialEq)]
18152    #[non_exhaustive]
18153    pub enum AggregationInterval {
18154        /// If not specified, will default to INTERVAL_5_SEC.
18155        Unspecified,
18156        /// Aggregate logs in 5s intervals.
18157        Interval5Sec,
18158        /// Aggregate logs in 30s intervals.
18159        Interval30Sec,
18160        /// Aggregate logs in 1m intervals.
18161        Interval1Min,
18162        /// Aggregate logs in 5m intervals.
18163        Interval5Min,
18164        /// Aggregate logs in 10m intervals.
18165        Interval10Min,
18166        /// Aggregate logs in 15m intervals.
18167        Interval15Min,
18168        /// If set, the enum was initialized with an unknown value.
18169        ///
18170        /// Applications can examine the value using [AggregationInterval::value] or
18171        /// [AggregationInterval::name].
18172        UnknownValue(aggregation_interval::UnknownValue),
18173    }
18174
18175    #[doc(hidden)]
18176    pub mod aggregation_interval {
18177        #[allow(unused_imports)]
18178        use super::*;
18179        #[derive(Clone, Debug, PartialEq)]
18180        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18181    }
18182
18183    impl AggregationInterval {
18184        /// Gets the enum value.
18185        ///
18186        /// Returns `None` if the enum contains an unknown value deserialized from
18187        /// the string representation of enums.
18188        pub fn value(&self) -> std::option::Option<i32> {
18189            match self {
18190                Self::Unspecified => std::option::Option::Some(0),
18191                Self::Interval5Sec => std::option::Option::Some(1),
18192                Self::Interval30Sec => std::option::Option::Some(2),
18193                Self::Interval1Min => std::option::Option::Some(3),
18194                Self::Interval5Min => std::option::Option::Some(4),
18195                Self::Interval10Min => std::option::Option::Some(5),
18196                Self::Interval15Min => std::option::Option::Some(6),
18197                Self::UnknownValue(u) => u.0.value(),
18198            }
18199        }
18200
18201        /// Gets the enum value as a string.
18202        ///
18203        /// Returns `None` if the enum contains an unknown value deserialized from
18204        /// the integer representation of enums.
18205        pub fn name(&self) -> std::option::Option<&str> {
18206            match self {
18207                Self::Unspecified => std::option::Option::Some("AGGREGATION_INTERVAL_UNSPECIFIED"),
18208                Self::Interval5Sec => std::option::Option::Some("INTERVAL_5_SEC"),
18209                Self::Interval30Sec => std::option::Option::Some("INTERVAL_30_SEC"),
18210                Self::Interval1Min => std::option::Option::Some("INTERVAL_1_MIN"),
18211                Self::Interval5Min => std::option::Option::Some("INTERVAL_5_MIN"),
18212                Self::Interval10Min => std::option::Option::Some("INTERVAL_10_MIN"),
18213                Self::Interval15Min => std::option::Option::Some("INTERVAL_15_MIN"),
18214                Self::UnknownValue(u) => u.0.name(),
18215            }
18216        }
18217    }
18218
18219    impl std::default::Default for AggregationInterval {
18220        fn default() -> Self {
18221            use std::convert::From;
18222            Self::from(0)
18223        }
18224    }
18225
18226    impl std::fmt::Display for AggregationInterval {
18227        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18228            wkt::internal::display_enum(f, self.name(), self.value())
18229        }
18230    }
18231
18232    impl std::convert::From<i32> for AggregationInterval {
18233        fn from(value: i32) -> Self {
18234            match value {
18235                0 => Self::Unspecified,
18236                1 => Self::Interval5Sec,
18237                2 => Self::Interval30Sec,
18238                3 => Self::Interval1Min,
18239                4 => Self::Interval5Min,
18240                5 => Self::Interval10Min,
18241                6 => Self::Interval15Min,
18242                _ => Self::UnknownValue(aggregation_interval::UnknownValue(
18243                    wkt::internal::UnknownEnumValue::Integer(value),
18244                )),
18245            }
18246        }
18247    }
18248
18249    impl std::convert::From<&str> for AggregationInterval {
18250        fn from(value: &str) -> Self {
18251            use std::string::ToString;
18252            match value {
18253                "AGGREGATION_INTERVAL_UNSPECIFIED" => Self::Unspecified,
18254                "INTERVAL_5_SEC" => Self::Interval5Sec,
18255                "INTERVAL_30_SEC" => Self::Interval30Sec,
18256                "INTERVAL_1_MIN" => Self::Interval1Min,
18257                "INTERVAL_5_MIN" => Self::Interval5Min,
18258                "INTERVAL_10_MIN" => Self::Interval10Min,
18259                "INTERVAL_15_MIN" => Self::Interval15Min,
18260                _ => Self::UnknownValue(aggregation_interval::UnknownValue(
18261                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18262                )),
18263            }
18264        }
18265    }
18266
18267    impl serde::ser::Serialize for AggregationInterval {
18268        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18269        where
18270            S: serde::Serializer,
18271        {
18272            match self {
18273                Self::Unspecified => serializer.serialize_i32(0),
18274                Self::Interval5Sec => serializer.serialize_i32(1),
18275                Self::Interval30Sec => serializer.serialize_i32(2),
18276                Self::Interval1Min => serializer.serialize_i32(3),
18277                Self::Interval5Min => serializer.serialize_i32(4),
18278                Self::Interval10Min => serializer.serialize_i32(5),
18279                Self::Interval15Min => serializer.serialize_i32(6),
18280                Self::UnknownValue(u) => u.0.serialize(serializer),
18281            }
18282        }
18283    }
18284
18285    impl<'de> serde::de::Deserialize<'de> for AggregationInterval {
18286        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18287        where
18288            D: serde::Deserializer<'de>,
18289        {
18290            deserializer.deserialize_any(wkt::internal::EnumVisitor::<AggregationInterval>::new(
18291                ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.AggregationInterval",
18292            ))
18293        }
18294    }
18295
18296    /// Configures which log fields would be included.
18297    ///
18298    /// # Working with unknown values
18299    ///
18300    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18301    /// additional enum variants at any time. Adding new variants is not considered
18302    /// a breaking change. Applications should write their code in anticipation of:
18303    ///
18304    /// - New values appearing in future releases of the client library, **and**
18305    /// - New values received dynamically, without application changes.
18306    ///
18307    /// Please consult the [Working with enums] section in the user guide for some
18308    /// guidelines.
18309    ///
18310    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18311    #[derive(Clone, Debug, PartialEq)]
18312    #[non_exhaustive]
18313    pub enum Metadata {
18314        /// If not specified, will default to INCLUDE_ALL_METADATA.
18315        Unspecified,
18316        /// Include all metadata fields.
18317        IncludeAllMetadata,
18318        /// Exclude all metadata fields.
18319        ExcludeAllMetadata,
18320        /// Include only custom fields (specified in metadata_fields).
18321        CustomMetadata,
18322        /// If set, the enum was initialized with an unknown value.
18323        ///
18324        /// Applications can examine the value using [Metadata::value] or
18325        /// [Metadata::name].
18326        UnknownValue(metadata::UnknownValue),
18327    }
18328
18329    #[doc(hidden)]
18330    pub mod metadata {
18331        #[allow(unused_imports)]
18332        use super::*;
18333        #[derive(Clone, Debug, PartialEq)]
18334        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18335    }
18336
18337    impl Metadata {
18338        /// Gets the enum value.
18339        ///
18340        /// Returns `None` if the enum contains an unknown value deserialized from
18341        /// the string representation of enums.
18342        pub fn value(&self) -> std::option::Option<i32> {
18343            match self {
18344                Self::Unspecified => std::option::Option::Some(0),
18345                Self::IncludeAllMetadata => std::option::Option::Some(1),
18346                Self::ExcludeAllMetadata => std::option::Option::Some(2),
18347                Self::CustomMetadata => std::option::Option::Some(3),
18348                Self::UnknownValue(u) => u.0.value(),
18349            }
18350        }
18351
18352        /// Gets the enum value as a string.
18353        ///
18354        /// Returns `None` if the enum contains an unknown value deserialized from
18355        /// the integer representation of enums.
18356        pub fn name(&self) -> std::option::Option<&str> {
18357            match self {
18358                Self::Unspecified => std::option::Option::Some("METADATA_UNSPECIFIED"),
18359                Self::IncludeAllMetadata => std::option::Option::Some("INCLUDE_ALL_METADATA"),
18360                Self::ExcludeAllMetadata => std::option::Option::Some("EXCLUDE_ALL_METADATA"),
18361                Self::CustomMetadata => std::option::Option::Some("CUSTOM_METADATA"),
18362                Self::UnknownValue(u) => u.0.name(),
18363            }
18364        }
18365    }
18366
18367    impl std::default::Default for Metadata {
18368        fn default() -> Self {
18369            use std::convert::From;
18370            Self::from(0)
18371        }
18372    }
18373
18374    impl std::fmt::Display for Metadata {
18375        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18376            wkt::internal::display_enum(f, self.name(), self.value())
18377        }
18378    }
18379
18380    impl std::convert::From<i32> for Metadata {
18381        fn from(value: i32) -> Self {
18382            match value {
18383                0 => Self::Unspecified,
18384                1 => Self::IncludeAllMetadata,
18385                2 => Self::ExcludeAllMetadata,
18386                3 => Self::CustomMetadata,
18387                _ => Self::UnknownValue(metadata::UnknownValue(
18388                    wkt::internal::UnknownEnumValue::Integer(value),
18389                )),
18390            }
18391        }
18392    }
18393
18394    impl std::convert::From<&str> for Metadata {
18395        fn from(value: &str) -> Self {
18396            use std::string::ToString;
18397            match value {
18398                "METADATA_UNSPECIFIED" => Self::Unspecified,
18399                "INCLUDE_ALL_METADATA" => Self::IncludeAllMetadata,
18400                "EXCLUDE_ALL_METADATA" => Self::ExcludeAllMetadata,
18401                "CUSTOM_METADATA" => Self::CustomMetadata,
18402                _ => Self::UnknownValue(metadata::UnknownValue(
18403                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18404                )),
18405            }
18406        }
18407    }
18408
18409    impl serde::ser::Serialize for Metadata {
18410        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18411        where
18412            S: serde::Serializer,
18413        {
18414            match self {
18415                Self::Unspecified => serializer.serialize_i32(0),
18416                Self::IncludeAllMetadata => serializer.serialize_i32(1),
18417                Self::ExcludeAllMetadata => serializer.serialize_i32(2),
18418                Self::CustomMetadata => serializer.serialize_i32(3),
18419                Self::UnknownValue(u) => u.0.serialize(serializer),
18420            }
18421        }
18422    }
18423
18424    impl<'de> serde::de::Deserialize<'de> for Metadata {
18425        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18426        where
18427            D: serde::Deserializer<'de>,
18428        {
18429            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Metadata>::new(
18430                ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.Metadata",
18431            ))
18432        }
18433    }
18434
18435    /// Determines whether to include cross project annotations in the logs.
18436    /// Project configurations will always have CROSS_PROJECT_METADATA_DISABLED.
18437    ///
18438    /// # Working with unknown values
18439    ///
18440    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18441    /// additional enum variants at any time. Adding new variants is not considered
18442    /// a breaking change. Applications should write their code in anticipation of:
18443    ///
18444    /// - New values appearing in future releases of the client library, **and**
18445    /// - New values received dynamically, without application changes.
18446    ///
18447    /// Please consult the [Working with enums] section in the user guide for some
18448    /// guidelines.
18449    ///
18450    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18451    #[derive(Clone, Debug, PartialEq)]
18452    #[non_exhaustive]
18453    pub enum CrossProjectMetadata {
18454        /// If not specified, the default is CROSS_PROJECT_METADATA_ENABLED.
18455        Unspecified,
18456        /// When CROSS_PROJECT_METADATA_ENABLED, metadata from other projects will be
18457        /// included in the logs.
18458        Enabled,
18459        /// When CROSS_PROJECT_METADATA_DISABLED, metadata from other projects will
18460        /// not be included in the logs.
18461        Disabled,
18462        /// If set, the enum was initialized with an unknown value.
18463        ///
18464        /// Applications can examine the value using [CrossProjectMetadata::value] or
18465        /// [CrossProjectMetadata::name].
18466        UnknownValue(cross_project_metadata::UnknownValue),
18467    }
18468
18469    #[doc(hidden)]
18470    pub mod cross_project_metadata {
18471        #[allow(unused_imports)]
18472        use super::*;
18473        #[derive(Clone, Debug, PartialEq)]
18474        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18475    }
18476
18477    impl CrossProjectMetadata {
18478        /// Gets the enum value.
18479        ///
18480        /// Returns `None` if the enum contains an unknown value deserialized from
18481        /// the string representation of enums.
18482        pub fn value(&self) -> std::option::Option<i32> {
18483            match self {
18484                Self::Unspecified => std::option::Option::Some(0),
18485                Self::Enabled => std::option::Option::Some(1),
18486                Self::Disabled => std::option::Option::Some(2),
18487                Self::UnknownValue(u) => u.0.value(),
18488            }
18489        }
18490
18491        /// Gets the enum value as a string.
18492        ///
18493        /// Returns `None` if the enum contains an unknown value deserialized from
18494        /// the integer representation of enums.
18495        pub fn name(&self) -> std::option::Option<&str> {
18496            match self {
18497                Self::Unspecified => {
18498                    std::option::Option::Some("CROSS_PROJECT_METADATA_UNSPECIFIED")
18499                }
18500                Self::Enabled => std::option::Option::Some("CROSS_PROJECT_METADATA_ENABLED"),
18501                Self::Disabled => std::option::Option::Some("CROSS_PROJECT_METADATA_DISABLED"),
18502                Self::UnknownValue(u) => u.0.name(),
18503            }
18504        }
18505    }
18506
18507    impl std::default::Default for CrossProjectMetadata {
18508        fn default() -> Self {
18509            use std::convert::From;
18510            Self::from(0)
18511        }
18512    }
18513
18514    impl std::fmt::Display for CrossProjectMetadata {
18515        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18516            wkt::internal::display_enum(f, self.name(), self.value())
18517        }
18518    }
18519
18520    impl std::convert::From<i32> for CrossProjectMetadata {
18521        fn from(value: i32) -> Self {
18522            match value {
18523                0 => Self::Unspecified,
18524                1 => Self::Enabled,
18525                2 => Self::Disabled,
18526                _ => Self::UnknownValue(cross_project_metadata::UnknownValue(
18527                    wkt::internal::UnknownEnumValue::Integer(value),
18528                )),
18529            }
18530        }
18531    }
18532
18533    impl std::convert::From<&str> for CrossProjectMetadata {
18534        fn from(value: &str) -> Self {
18535            use std::string::ToString;
18536            match value {
18537                "CROSS_PROJECT_METADATA_UNSPECIFIED" => Self::Unspecified,
18538                "CROSS_PROJECT_METADATA_ENABLED" => Self::Enabled,
18539                "CROSS_PROJECT_METADATA_DISABLED" => Self::Disabled,
18540                _ => Self::UnknownValue(cross_project_metadata::UnknownValue(
18541                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18542                )),
18543            }
18544        }
18545    }
18546
18547    impl serde::ser::Serialize for CrossProjectMetadata {
18548        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18549        where
18550            S: serde::Serializer,
18551        {
18552            match self {
18553                Self::Unspecified => serializer.serialize_i32(0),
18554                Self::Enabled => serializer.serialize_i32(1),
18555                Self::Disabled => serializer.serialize_i32(2),
18556                Self::UnknownValue(u) => u.0.serialize(serializer),
18557            }
18558        }
18559    }
18560
18561    impl<'de> serde::de::Deserialize<'de> for CrossProjectMetadata {
18562        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18563        where
18564            D: serde::Deserializer<'de>,
18565        {
18566            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CrossProjectMetadata>::new(
18567                ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.CrossProjectMetadata",
18568            ))
18569        }
18570    }
18571
18572    /// Output only. Indicates whether the target resource exists, for diagnostic
18573    /// purposes.
18574    ///
18575    /// # Working with unknown values
18576    ///
18577    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18578    /// additional enum variants at any time. Adding new variants is not considered
18579    /// a breaking change. Applications should write their code in anticipation of:
18580    ///
18581    /// - New values appearing in future releases of the client library, **and**
18582    /// - New values received dynamically, without application changes.
18583    ///
18584    /// Please consult the [Working with enums] section in the user guide for some
18585    /// guidelines.
18586    ///
18587    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18588    #[derive(Clone, Debug, PartialEq)]
18589    #[non_exhaustive]
18590    pub enum TargetResourceState {
18591        /// Unspecified target resource state.
18592        Unspecified,
18593        /// Indicates that the target resource exists.
18594        TargetResourceExists,
18595        /// Indicates that the target resource does not exist.
18596        TargetResourceDoesNotExist,
18597        /// If set, the enum was initialized with an unknown value.
18598        ///
18599        /// Applications can examine the value using [TargetResourceState::value] or
18600        /// [TargetResourceState::name].
18601        UnknownValue(target_resource_state::UnknownValue),
18602    }
18603
18604    #[doc(hidden)]
18605    pub mod target_resource_state {
18606        #[allow(unused_imports)]
18607        use super::*;
18608        #[derive(Clone, Debug, PartialEq)]
18609        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18610    }
18611
18612    impl TargetResourceState {
18613        /// Gets the enum value.
18614        ///
18615        /// Returns `None` if the enum contains an unknown value deserialized from
18616        /// the string representation of enums.
18617        pub fn value(&self) -> std::option::Option<i32> {
18618            match self {
18619                Self::Unspecified => std::option::Option::Some(0),
18620                Self::TargetResourceExists => std::option::Option::Some(1),
18621                Self::TargetResourceDoesNotExist => std::option::Option::Some(2),
18622                Self::UnknownValue(u) => u.0.value(),
18623            }
18624        }
18625
18626        /// Gets the enum value as a string.
18627        ///
18628        /// Returns `None` if the enum contains an unknown value deserialized from
18629        /// the integer representation of enums.
18630        pub fn name(&self) -> std::option::Option<&str> {
18631            match self {
18632                Self::Unspecified => std::option::Option::Some("TARGET_RESOURCE_STATE_UNSPECIFIED"),
18633                Self::TargetResourceExists => std::option::Option::Some("TARGET_RESOURCE_EXISTS"),
18634                Self::TargetResourceDoesNotExist => {
18635                    std::option::Option::Some("TARGET_RESOURCE_DOES_NOT_EXIST")
18636                }
18637                Self::UnknownValue(u) => u.0.name(),
18638            }
18639        }
18640    }
18641
18642    impl std::default::Default for TargetResourceState {
18643        fn default() -> Self {
18644            use std::convert::From;
18645            Self::from(0)
18646        }
18647    }
18648
18649    impl std::fmt::Display for TargetResourceState {
18650        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18651            wkt::internal::display_enum(f, self.name(), self.value())
18652        }
18653    }
18654
18655    impl std::convert::From<i32> for TargetResourceState {
18656        fn from(value: i32) -> Self {
18657            match value {
18658                0 => Self::Unspecified,
18659                1 => Self::TargetResourceExists,
18660                2 => Self::TargetResourceDoesNotExist,
18661                _ => Self::UnknownValue(target_resource_state::UnknownValue(
18662                    wkt::internal::UnknownEnumValue::Integer(value),
18663                )),
18664            }
18665        }
18666    }
18667
18668    impl std::convert::From<&str> for TargetResourceState {
18669        fn from(value: &str) -> Self {
18670            use std::string::ToString;
18671            match value {
18672                "TARGET_RESOURCE_STATE_UNSPECIFIED" => Self::Unspecified,
18673                "TARGET_RESOURCE_EXISTS" => Self::TargetResourceExists,
18674                "TARGET_RESOURCE_DOES_NOT_EXIST" => Self::TargetResourceDoesNotExist,
18675                _ => Self::UnknownValue(target_resource_state::UnknownValue(
18676                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18677                )),
18678            }
18679        }
18680    }
18681
18682    impl serde::ser::Serialize for TargetResourceState {
18683        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18684        where
18685            S: serde::Serializer,
18686        {
18687            match self {
18688                Self::Unspecified => serializer.serialize_i32(0),
18689                Self::TargetResourceExists => serializer.serialize_i32(1),
18690                Self::TargetResourceDoesNotExist => serializer.serialize_i32(2),
18691                Self::UnknownValue(u) => u.0.serialize(serializer),
18692            }
18693        }
18694    }
18695
18696    impl<'de> serde::de::Deserialize<'de> for TargetResourceState {
18697        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18698        where
18699            D: serde::Deserializer<'de>,
18700        {
18701            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetResourceState>::new(
18702                ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.TargetResourceState",
18703            ))
18704        }
18705    }
18706
18707    /// Reference to the resource of the config scope. That is, the scope from
18708    /// which traffic is logged. The target resource must belong to the same
18709    /// project as the configuration.
18710    /// This field is not supported for organization level configurations.
18711    #[derive(Clone, Debug, PartialEq)]
18712    #[non_exhaustive]
18713    pub enum TargetResource {
18714        /// Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
18715        /// within the network.
18716        /// Format: projects/{project_id}/global/networks/{name}
18717        Network(std::string::String),
18718        /// Traffic will be logged from VMs within the subnetwork.
18719        /// Format: projects/{project_id}/regions/{region}/subnetworks/{name}
18720        Subnet(std::string::String),
18721        /// Traffic will be logged from the Interconnect Attachment.
18722        /// Format:
18723        /// projects/{project_id}/regions/{region}/interconnectAttachments/{name}
18724        InterconnectAttachment(std::string::String),
18725        /// Traffic will be logged from the VPN Tunnel.
18726        /// Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
18727        VpnTunnel(std::string::String),
18728    }
18729}
18730
18731/// A configuration to generate a response for GetEffectiveVpcFlowLogsConfig
18732/// request.
18733#[derive(Clone, Default, PartialEq)]
18734#[non_exhaustive]
18735pub struct EffectiveVpcFlowLogsConfig {
18736    /// Unique name of the configuration. The name can have one of the following
18737    /// forms:
18738    ///
18739    /// - For project-level configurations:
18740    ///   `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
18741    ///
18742    /// - For organization-level configurations:
18743    ///   `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
18744    ///
18745    /// - For a Compute config, the name will be the path of the subnet:
18746    ///   `projects/{project_id}/regions/{region}/subnetworks/{subnet_id}`
18747    ///
18748    pub name: std::string::String,
18749
18750    /// The state of the VPC Flow Log configuration. Default value is ENABLED.
18751    /// When creating a new configuration, it must be enabled.
18752    /// Setting state=DISABLED will pause the log generation for this config.
18753    pub state: std::option::Option<crate::model::vpc_flow_logs_config::State>,
18754
18755    /// The aggregation interval for the logs. Default value is INTERVAL_5_SEC.
18756    pub aggregation_interval:
18757        std::option::Option<crate::model::vpc_flow_logs_config::AggregationInterval>,
18758
18759    /// The value of the field must be in (0, 1]. The sampling rate of VPC Flow
18760    /// Logs where 1.0 means all collected logs are reported.
18761    /// Setting the sampling rate to 0.0 is not allowed. If you want to disable VPC
18762    /// Flow Logs, use the state field instead.
18763    /// Default value is 1.0.
18764    pub flow_sampling: std::option::Option<f32>,
18765
18766    /// Configures whether all, none or a subset of metadata fields should be
18767    /// added to the reported VPC flow logs.
18768    /// Default value is INCLUDE_ALL_METADATA.
18769    pub metadata: std::option::Option<crate::model::vpc_flow_logs_config::Metadata>,
18770
18771    /// Custom metadata fields to include in the reported VPC flow logs.
18772    /// Can only be specified if "metadata" was set to CUSTOM_METADATA.
18773    pub metadata_fields: std::vec::Vec<std::string::String>,
18774
18775    /// Export filter used to define which VPC Flow Logs should be logged.
18776    pub filter_expr: std::option::Option<std::string::String>,
18777
18778    /// Determines whether to include cross project annotations in the logs.
18779    /// This field is available only for organization configurations. If not
18780    /// specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
18781    pub cross_project_metadata:
18782        std::option::Option<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
18783
18784    /// Specifies the scope of the config (e.g., SUBNET, NETWORK, ORGANIZATION..).
18785    pub scope: std::option::Option<crate::model::effective_vpc_flow_logs_config::Scope>,
18786
18787    /// Reference to the resource of the config scope. That is, the scope from
18788    /// which traffic is logged. The target resource must belong to the same
18789    /// project as the configuration.
18790    /// This field is not supported for organization level configurations.
18791    pub target_resource:
18792        std::option::Option<crate::model::effective_vpc_flow_logs_config::TargetResource>,
18793
18794    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18795}
18796
18797impl EffectiveVpcFlowLogsConfig {
18798    /// Creates a new default instance.
18799    pub fn new() -> Self {
18800        std::default::Default::default()
18801    }
18802
18803    /// Sets the value of [name][crate::model::EffectiveVpcFlowLogsConfig::name].
18804    ///
18805    /// # Example
18806    /// ```ignore,no_run
18807    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18808    /// let x = EffectiveVpcFlowLogsConfig::new().set_name("example");
18809    /// ```
18810    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18811        self.name = v.into();
18812        self
18813    }
18814
18815    /// Sets the value of [state][crate::model::EffectiveVpcFlowLogsConfig::state].
18816    ///
18817    /// # Example
18818    /// ```ignore,no_run
18819    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18820    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
18821    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_state(State::Enabled);
18822    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_state(State::Disabled);
18823    /// ```
18824    pub fn set_state<T>(mut self, v: T) -> Self
18825    where
18826        T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
18827    {
18828        self.state = std::option::Option::Some(v.into());
18829        self
18830    }
18831
18832    /// Sets or clears the value of [state][crate::model::EffectiveVpcFlowLogsConfig::state].
18833    ///
18834    /// # Example
18835    /// ```ignore,no_run
18836    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18837    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
18838    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(Some(State::Enabled));
18839    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(Some(State::Disabled));
18840    /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(None::<State>);
18841    /// ```
18842    pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
18843    where
18844        T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
18845    {
18846        self.state = v.map(|x| x.into());
18847        self
18848    }
18849
18850    /// Sets the value of [aggregation_interval][crate::model::EffectiveVpcFlowLogsConfig::aggregation_interval].
18851    ///
18852    /// # Example
18853    /// ```ignore,no_run
18854    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18855    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
18856    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval5Sec);
18857    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval30Sec);
18858    /// let x2 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval1Min);
18859    /// ```
18860    pub fn set_aggregation_interval<T>(mut self, v: T) -> Self
18861    where
18862        T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
18863    {
18864        self.aggregation_interval = std::option::Option::Some(v.into());
18865        self
18866    }
18867
18868    /// Sets or clears the value of [aggregation_interval][crate::model::EffectiveVpcFlowLogsConfig::aggregation_interval].
18869    ///
18870    /// # Example
18871    /// ```ignore,no_run
18872    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18873    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
18874    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval5Sec));
18875    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval30Sec));
18876    /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval1Min));
18877    /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(None::<AggregationInterval>);
18878    /// ```
18879    pub fn set_or_clear_aggregation_interval<T>(mut self, v: std::option::Option<T>) -> Self
18880    where
18881        T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
18882    {
18883        self.aggregation_interval = v.map(|x| x.into());
18884        self
18885    }
18886
18887    /// Sets the value of [flow_sampling][crate::model::EffectiveVpcFlowLogsConfig::flow_sampling].
18888    ///
18889    /// # Example
18890    /// ```ignore,no_run
18891    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18892    /// let x = EffectiveVpcFlowLogsConfig::new().set_flow_sampling(42.0);
18893    /// ```
18894    pub fn set_flow_sampling<T>(mut self, v: T) -> Self
18895    where
18896        T: std::convert::Into<f32>,
18897    {
18898        self.flow_sampling = std::option::Option::Some(v.into());
18899        self
18900    }
18901
18902    /// Sets or clears the value of [flow_sampling][crate::model::EffectiveVpcFlowLogsConfig::flow_sampling].
18903    ///
18904    /// # Example
18905    /// ```ignore,no_run
18906    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18907    /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_flow_sampling(Some(42.0));
18908    /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_flow_sampling(None::<f32>);
18909    /// ```
18910    pub fn set_or_clear_flow_sampling<T>(mut self, v: std::option::Option<T>) -> Self
18911    where
18912        T: std::convert::Into<f32>,
18913    {
18914        self.flow_sampling = v.map(|x| x.into());
18915        self
18916    }
18917
18918    /// Sets the value of [metadata][crate::model::EffectiveVpcFlowLogsConfig::metadata].
18919    ///
18920    /// # Example
18921    /// ```ignore,no_run
18922    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18923    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
18924    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::IncludeAllMetadata);
18925    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::ExcludeAllMetadata);
18926    /// let x2 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::CustomMetadata);
18927    /// ```
18928    pub fn set_metadata<T>(mut self, v: T) -> Self
18929    where
18930        T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
18931    {
18932        self.metadata = std::option::Option::Some(v.into());
18933        self
18934    }
18935
18936    /// Sets or clears the value of [metadata][crate::model::EffectiveVpcFlowLogsConfig::metadata].
18937    ///
18938    /// # Example
18939    /// ```ignore,no_run
18940    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18941    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
18942    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::IncludeAllMetadata));
18943    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::ExcludeAllMetadata));
18944    /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::CustomMetadata));
18945    /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(None::<Metadata>);
18946    /// ```
18947    pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
18948    where
18949        T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
18950    {
18951        self.metadata = v.map(|x| x.into());
18952        self
18953    }
18954
18955    /// Sets the value of [metadata_fields][crate::model::EffectiveVpcFlowLogsConfig::metadata_fields].
18956    ///
18957    /// # Example
18958    /// ```ignore,no_run
18959    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18960    /// let x = EffectiveVpcFlowLogsConfig::new().set_metadata_fields(["a", "b", "c"]);
18961    /// ```
18962    pub fn set_metadata_fields<T, V>(mut self, v: T) -> Self
18963    where
18964        T: std::iter::IntoIterator<Item = V>,
18965        V: std::convert::Into<std::string::String>,
18966    {
18967        use std::iter::Iterator;
18968        self.metadata_fields = v.into_iter().map(|i| i.into()).collect();
18969        self
18970    }
18971
18972    /// Sets the value of [filter_expr][crate::model::EffectiveVpcFlowLogsConfig::filter_expr].
18973    ///
18974    /// # Example
18975    /// ```ignore,no_run
18976    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18977    /// let x = EffectiveVpcFlowLogsConfig::new().set_filter_expr("example");
18978    /// ```
18979    pub fn set_filter_expr<T>(mut self, v: T) -> Self
18980    where
18981        T: std::convert::Into<std::string::String>,
18982    {
18983        self.filter_expr = std::option::Option::Some(v.into());
18984        self
18985    }
18986
18987    /// Sets or clears the value of [filter_expr][crate::model::EffectiveVpcFlowLogsConfig::filter_expr].
18988    ///
18989    /// # Example
18990    /// ```ignore,no_run
18991    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18992    /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_filter_expr(Some("example"));
18993    /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_filter_expr(None::<String>);
18994    /// ```
18995    pub fn set_or_clear_filter_expr<T>(mut self, v: std::option::Option<T>) -> Self
18996    where
18997        T: std::convert::Into<std::string::String>,
18998    {
18999        self.filter_expr = v.map(|x| x.into());
19000        self
19001    }
19002
19003    /// Sets the value of [cross_project_metadata][crate::model::EffectiveVpcFlowLogsConfig::cross_project_metadata].
19004    ///
19005    /// # Example
19006    /// ```ignore,no_run
19007    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19008    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
19009    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Enabled);
19010    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Disabled);
19011    /// ```
19012    pub fn set_cross_project_metadata<T>(mut self, v: T) -> Self
19013    where
19014        T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
19015    {
19016        self.cross_project_metadata = std::option::Option::Some(v.into());
19017        self
19018    }
19019
19020    /// Sets or clears the value of [cross_project_metadata][crate::model::EffectiveVpcFlowLogsConfig::cross_project_metadata].
19021    ///
19022    /// # Example
19023    /// ```ignore,no_run
19024    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19025    /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
19026    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Enabled));
19027    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Disabled));
19028    /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(None::<CrossProjectMetadata>);
19029    /// ```
19030    pub fn set_or_clear_cross_project_metadata<T>(mut self, v: std::option::Option<T>) -> Self
19031    where
19032        T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
19033    {
19034        self.cross_project_metadata = v.map(|x| x.into());
19035        self
19036    }
19037
19038    /// Sets the value of [scope][crate::model::EffectiveVpcFlowLogsConfig::scope].
19039    ///
19040    /// # Example
19041    /// ```ignore,no_run
19042    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19043    /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::Scope;
19044    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::Subnet);
19045    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::ComputeApiSubnet);
19046    /// let x2 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::Network);
19047    /// ```
19048    pub fn set_scope<T>(mut self, v: T) -> Self
19049    where
19050        T: std::convert::Into<crate::model::effective_vpc_flow_logs_config::Scope>,
19051    {
19052        self.scope = std::option::Option::Some(v.into());
19053        self
19054    }
19055
19056    /// Sets or clears the value of [scope][crate::model::EffectiveVpcFlowLogsConfig::scope].
19057    ///
19058    /// # Example
19059    /// ```ignore,no_run
19060    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19061    /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::Scope;
19062    /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::Subnet));
19063    /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::ComputeApiSubnet));
19064    /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::Network));
19065    /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(None::<Scope>);
19066    /// ```
19067    pub fn set_or_clear_scope<T>(mut self, v: std::option::Option<T>) -> Self
19068    where
19069        T: std::convert::Into<crate::model::effective_vpc_flow_logs_config::Scope>,
19070    {
19071        self.scope = v.map(|x| x.into());
19072        self
19073    }
19074
19075    /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource].
19076    ///
19077    /// Note that all the setters affecting `target_resource` are mutually
19078    /// exclusive.
19079    ///
19080    /// # Example
19081    /// ```ignore,no_run
19082    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19083    /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::TargetResource;
19084    /// let x = EffectiveVpcFlowLogsConfig::new().set_target_resource(Some(TargetResource::Network("example".to_string())));
19085    /// ```
19086    pub fn set_target_resource<
19087        T: std::convert::Into<
19088                std::option::Option<crate::model::effective_vpc_flow_logs_config::TargetResource>,
19089            >,
19090    >(
19091        mut self,
19092        v: T,
19093    ) -> Self {
19094        self.target_resource = v.into();
19095        self
19096    }
19097
19098    /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19099    /// if it holds a `Network`, `None` if the field is not set or
19100    /// holds a different branch.
19101    pub fn network(&self) -> std::option::Option<&std::string::String> {
19102        #[allow(unreachable_patterns)]
19103        self.target_resource.as_ref().and_then(|v| match v {
19104            crate::model::effective_vpc_flow_logs_config::TargetResource::Network(v) => {
19105                std::option::Option::Some(v)
19106            }
19107            _ => std::option::Option::None,
19108        })
19109    }
19110
19111    /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19112    /// to hold a `Network`.
19113    ///
19114    /// Note that all the setters affecting `target_resource` are
19115    /// mutually exclusive.
19116    ///
19117    /// # Example
19118    /// ```ignore,no_run
19119    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19120    /// let x = EffectiveVpcFlowLogsConfig::new().set_network("example");
19121    /// assert!(x.network().is_some());
19122    /// assert!(x.subnet().is_none());
19123    /// assert!(x.interconnect_attachment().is_none());
19124    /// assert!(x.vpn_tunnel().is_none());
19125    /// ```
19126    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19127        self.target_resource = std::option::Option::Some(
19128            crate::model::effective_vpc_flow_logs_config::TargetResource::Network(v.into()),
19129        );
19130        self
19131    }
19132
19133    /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19134    /// if it holds a `Subnet`, `None` if the field is not set or
19135    /// holds a different branch.
19136    pub fn subnet(&self) -> std::option::Option<&std::string::String> {
19137        #[allow(unreachable_patterns)]
19138        self.target_resource.as_ref().and_then(|v| match v {
19139            crate::model::effective_vpc_flow_logs_config::TargetResource::Subnet(v) => {
19140                std::option::Option::Some(v)
19141            }
19142            _ => std::option::Option::None,
19143        })
19144    }
19145
19146    /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19147    /// to hold a `Subnet`.
19148    ///
19149    /// Note that all the setters affecting `target_resource` are
19150    /// mutually exclusive.
19151    ///
19152    /// # Example
19153    /// ```ignore,no_run
19154    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19155    /// let x = EffectiveVpcFlowLogsConfig::new().set_subnet("example");
19156    /// assert!(x.subnet().is_some());
19157    /// assert!(x.network().is_none());
19158    /// assert!(x.interconnect_attachment().is_none());
19159    /// assert!(x.vpn_tunnel().is_none());
19160    /// ```
19161    pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19162        self.target_resource = std::option::Option::Some(
19163            crate::model::effective_vpc_flow_logs_config::TargetResource::Subnet(v.into()),
19164        );
19165        self
19166    }
19167
19168    /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19169    /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
19170    /// holds a different branch.
19171    pub fn interconnect_attachment(&self) -> std::option::Option<&std::string::String> {
19172        #[allow(unreachable_patterns)]
19173        self.target_resource.as_ref().and_then(|v| match v {
19174            crate::model::effective_vpc_flow_logs_config::TargetResource::InterconnectAttachment(v) => std::option::Option::Some(v),
19175            _ => std::option::Option::None,
19176        })
19177    }
19178
19179    /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19180    /// to hold a `InterconnectAttachment`.
19181    ///
19182    /// Note that all the setters affecting `target_resource` are
19183    /// mutually exclusive.
19184    ///
19185    /// # Example
19186    /// ```ignore,no_run
19187    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19188    /// let x = EffectiveVpcFlowLogsConfig::new().set_interconnect_attachment("example");
19189    /// assert!(x.interconnect_attachment().is_some());
19190    /// assert!(x.network().is_none());
19191    /// assert!(x.subnet().is_none());
19192    /// assert!(x.vpn_tunnel().is_none());
19193    /// ```
19194    pub fn set_interconnect_attachment<T: std::convert::Into<std::string::String>>(
19195        mut self,
19196        v: T,
19197    ) -> Self {
19198        self.target_resource = std::option::Option::Some(
19199            crate::model::effective_vpc_flow_logs_config::TargetResource::InterconnectAttachment(
19200                v.into(),
19201            ),
19202        );
19203        self
19204    }
19205
19206    /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19207    /// if it holds a `VpnTunnel`, `None` if the field is not set or
19208    /// holds a different branch.
19209    pub fn vpn_tunnel(&self) -> std::option::Option<&std::string::String> {
19210        #[allow(unreachable_patterns)]
19211        self.target_resource.as_ref().and_then(|v| match v {
19212            crate::model::effective_vpc_flow_logs_config::TargetResource::VpnTunnel(v) => {
19213                std::option::Option::Some(v)
19214            }
19215            _ => std::option::Option::None,
19216        })
19217    }
19218
19219    /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19220    /// to hold a `VpnTunnel`.
19221    ///
19222    /// Note that all the setters affecting `target_resource` are
19223    /// mutually exclusive.
19224    ///
19225    /// # Example
19226    /// ```ignore,no_run
19227    /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19228    /// let x = EffectiveVpcFlowLogsConfig::new().set_vpn_tunnel("example");
19229    /// assert!(x.vpn_tunnel().is_some());
19230    /// assert!(x.network().is_none());
19231    /// assert!(x.subnet().is_none());
19232    /// assert!(x.interconnect_attachment().is_none());
19233    /// ```
19234    pub fn set_vpn_tunnel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19235        self.target_resource = std::option::Option::Some(
19236            crate::model::effective_vpc_flow_logs_config::TargetResource::VpnTunnel(v.into()),
19237        );
19238        self
19239    }
19240}
19241
19242impl wkt::message::Message for EffectiveVpcFlowLogsConfig {
19243    fn typename() -> &'static str {
19244        "type.googleapis.com/google.cloud.networkmanagement.v1.EffectiveVpcFlowLogsConfig"
19245    }
19246}
19247
19248/// Defines additional types related to [EffectiveVpcFlowLogsConfig].
19249pub mod effective_vpc_flow_logs_config {
19250    #[allow(unused_imports)]
19251    use super::*;
19252
19253    /// The scope for this flow log configuration.
19254    ///
19255    /// # Working with unknown values
19256    ///
19257    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19258    /// additional enum variants at any time. Adding new variants is not considered
19259    /// a breaking change. Applications should write their code in anticipation of:
19260    ///
19261    /// - New values appearing in future releases of the client library, **and**
19262    /// - New values received dynamically, without application changes.
19263    ///
19264    /// Please consult the [Working with enums] section in the user guide for some
19265    /// guidelines.
19266    ///
19267    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19268    #[derive(Clone, Debug, PartialEq)]
19269    #[non_exhaustive]
19270    pub enum Scope {
19271        /// Scope is unspecified.
19272        Unspecified,
19273        /// Target resource is a subnet (Network Management API).
19274        Subnet,
19275        /// Target resource is a subnet, and the config originates from the Compute
19276        /// API.
19277        ComputeApiSubnet,
19278        /// Target resource is a network.
19279        Network,
19280        /// Target resource is a VPN tunnel.
19281        VpnTunnel,
19282        /// Target resource is an interconnect attachment.
19283        InterconnectAttachment,
19284        /// Configuration applies to an entire organization.
19285        Organization,
19286        /// If set, the enum was initialized with an unknown value.
19287        ///
19288        /// Applications can examine the value using [Scope::value] or
19289        /// [Scope::name].
19290        UnknownValue(scope::UnknownValue),
19291    }
19292
19293    #[doc(hidden)]
19294    pub mod scope {
19295        #[allow(unused_imports)]
19296        use super::*;
19297        #[derive(Clone, Debug, PartialEq)]
19298        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19299    }
19300
19301    impl Scope {
19302        /// Gets the enum value.
19303        ///
19304        /// Returns `None` if the enum contains an unknown value deserialized from
19305        /// the string representation of enums.
19306        pub fn value(&self) -> std::option::Option<i32> {
19307            match self {
19308                Self::Unspecified => std::option::Option::Some(0),
19309                Self::Subnet => std::option::Option::Some(1),
19310                Self::ComputeApiSubnet => std::option::Option::Some(2),
19311                Self::Network => std::option::Option::Some(3),
19312                Self::VpnTunnel => std::option::Option::Some(4),
19313                Self::InterconnectAttachment => std::option::Option::Some(5),
19314                Self::Organization => std::option::Option::Some(6),
19315                Self::UnknownValue(u) => u.0.value(),
19316            }
19317        }
19318
19319        /// Gets the enum value as a string.
19320        ///
19321        /// Returns `None` if the enum contains an unknown value deserialized from
19322        /// the integer representation of enums.
19323        pub fn name(&self) -> std::option::Option<&str> {
19324            match self {
19325                Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
19326                Self::Subnet => std::option::Option::Some("SUBNET"),
19327                Self::ComputeApiSubnet => std::option::Option::Some("COMPUTE_API_SUBNET"),
19328                Self::Network => std::option::Option::Some("NETWORK"),
19329                Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
19330                Self::InterconnectAttachment => {
19331                    std::option::Option::Some("INTERCONNECT_ATTACHMENT")
19332                }
19333                Self::Organization => std::option::Option::Some("ORGANIZATION"),
19334                Self::UnknownValue(u) => u.0.name(),
19335            }
19336        }
19337    }
19338
19339    impl std::default::Default for Scope {
19340        fn default() -> Self {
19341            use std::convert::From;
19342            Self::from(0)
19343        }
19344    }
19345
19346    impl std::fmt::Display for Scope {
19347        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19348            wkt::internal::display_enum(f, self.name(), self.value())
19349        }
19350    }
19351
19352    impl std::convert::From<i32> for Scope {
19353        fn from(value: i32) -> Self {
19354            match value {
19355                0 => Self::Unspecified,
19356                1 => Self::Subnet,
19357                2 => Self::ComputeApiSubnet,
19358                3 => Self::Network,
19359                4 => Self::VpnTunnel,
19360                5 => Self::InterconnectAttachment,
19361                6 => Self::Organization,
19362                _ => Self::UnknownValue(scope::UnknownValue(
19363                    wkt::internal::UnknownEnumValue::Integer(value),
19364                )),
19365            }
19366        }
19367    }
19368
19369    impl std::convert::From<&str> for Scope {
19370        fn from(value: &str) -> Self {
19371            use std::string::ToString;
19372            match value {
19373                "SCOPE_UNSPECIFIED" => Self::Unspecified,
19374                "SUBNET" => Self::Subnet,
19375                "COMPUTE_API_SUBNET" => Self::ComputeApiSubnet,
19376                "NETWORK" => Self::Network,
19377                "VPN_TUNNEL" => Self::VpnTunnel,
19378                "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
19379                "ORGANIZATION" => Self::Organization,
19380                _ => Self::UnknownValue(scope::UnknownValue(
19381                    wkt::internal::UnknownEnumValue::String(value.to_string()),
19382                )),
19383            }
19384        }
19385    }
19386
19387    impl serde::ser::Serialize for Scope {
19388        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19389        where
19390            S: serde::Serializer,
19391        {
19392            match self {
19393                Self::Unspecified => serializer.serialize_i32(0),
19394                Self::Subnet => serializer.serialize_i32(1),
19395                Self::ComputeApiSubnet => serializer.serialize_i32(2),
19396                Self::Network => serializer.serialize_i32(3),
19397                Self::VpnTunnel => serializer.serialize_i32(4),
19398                Self::InterconnectAttachment => serializer.serialize_i32(5),
19399                Self::Organization => serializer.serialize_i32(6),
19400                Self::UnknownValue(u) => u.0.serialize(serializer),
19401            }
19402        }
19403    }
19404
19405    impl<'de> serde::de::Deserialize<'de> for Scope {
19406        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19407        where
19408            D: serde::Deserializer<'de>,
19409        {
19410            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
19411                ".google.cloud.networkmanagement.v1.EffectiveVpcFlowLogsConfig.Scope",
19412            ))
19413        }
19414    }
19415
19416    /// Reference to the resource of the config scope. That is, the scope from
19417    /// which traffic is logged. The target resource must belong to the same
19418    /// project as the configuration.
19419    /// This field is not supported for organization level configurations.
19420    #[derive(Clone, Debug, PartialEq)]
19421    #[non_exhaustive]
19422    pub enum TargetResource {
19423        /// Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
19424        /// within the network.
19425        /// Format: projects/{project_id}/global/networks/{name}
19426        Network(std::string::String),
19427        /// Traffic will be logged from VMs within the subnetwork.
19428        /// Format: projects/{project_id}/regions/{region}/subnetworks/{name}
19429        Subnet(std::string::String),
19430        /// Traffic will be logged from the Interconnect Attachment.
19431        /// Format:
19432        /// projects/{project_id}/regions/{region}/interconnectAttachments/{name}
19433        InterconnectAttachment(std::string::String),
19434        /// Traffic will be logged from the VPN Tunnel.
19435        /// Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
19436        VpnTunnel(std::string::String),
19437    }
19438}
19439
19440/// Type of a load balancer. For more information, see [Summary of Google Cloud
19441/// load
19442/// balancers](https://cloud.google.com/load-balancing/docs/load-balancing-overview#summary-of-google-cloud-load-balancers).
19443///
19444/// # Working with unknown values
19445///
19446/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19447/// additional enum variants at any time. Adding new variants is not considered
19448/// a breaking change. Applications should write their code in anticipation of:
19449///
19450/// - New values appearing in future releases of the client library, **and**
19451/// - New values received dynamically, without application changes.
19452///
19453/// Please consult the [Working with enums] section in the user guide for some
19454/// guidelines.
19455///
19456/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19457#[derive(Clone, Debug, PartialEq)]
19458#[non_exhaustive]
19459pub enum LoadBalancerType {
19460    /// Forwarding rule points to a different target than a load balancer or a
19461    /// load balancer type is unknown.
19462    Unspecified,
19463    /// Global external HTTP(S) load balancer.
19464    HttpsAdvancedLoadBalancer,
19465    /// Global external HTTP(S) load balancer (classic)
19466    HttpsLoadBalancer,
19467    /// Regional external HTTP(S) load balancer.
19468    RegionalHttpsLoadBalancer,
19469    /// Internal HTTP(S) load balancer.
19470    InternalHttpsLoadBalancer,
19471    /// External SSL proxy load balancer.
19472    SslProxyLoadBalancer,
19473    /// External TCP proxy load balancer.
19474    TcpProxyLoadBalancer,
19475    /// Internal regional TCP proxy load balancer.
19476    InternalTcpProxyLoadBalancer,
19477    /// External TCP/UDP Network load balancer.
19478    NetworkLoadBalancer,
19479    /// Target-pool based external TCP/UDP Network load balancer.
19480    LegacyNetworkLoadBalancer,
19481    /// Internal TCP/UDP load balancer.
19482    TcpUdpInternalLoadBalancer,
19483    /// If set, the enum was initialized with an unknown value.
19484    ///
19485    /// Applications can examine the value using [LoadBalancerType::value] or
19486    /// [LoadBalancerType::name].
19487    UnknownValue(load_balancer_type::UnknownValue),
19488}
19489
19490#[doc(hidden)]
19491pub mod load_balancer_type {
19492    #[allow(unused_imports)]
19493    use super::*;
19494    #[derive(Clone, Debug, PartialEq)]
19495    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19496}
19497
19498impl LoadBalancerType {
19499    /// Gets the enum value.
19500    ///
19501    /// Returns `None` if the enum contains an unknown value deserialized from
19502    /// the string representation of enums.
19503    pub fn value(&self) -> std::option::Option<i32> {
19504        match self {
19505            Self::Unspecified => std::option::Option::Some(0),
19506            Self::HttpsAdvancedLoadBalancer => std::option::Option::Some(1),
19507            Self::HttpsLoadBalancer => std::option::Option::Some(2),
19508            Self::RegionalHttpsLoadBalancer => std::option::Option::Some(3),
19509            Self::InternalHttpsLoadBalancer => std::option::Option::Some(4),
19510            Self::SslProxyLoadBalancer => std::option::Option::Some(5),
19511            Self::TcpProxyLoadBalancer => std::option::Option::Some(6),
19512            Self::InternalTcpProxyLoadBalancer => std::option::Option::Some(7),
19513            Self::NetworkLoadBalancer => std::option::Option::Some(8),
19514            Self::LegacyNetworkLoadBalancer => std::option::Option::Some(9),
19515            Self::TcpUdpInternalLoadBalancer => std::option::Option::Some(10),
19516            Self::UnknownValue(u) => u.0.value(),
19517        }
19518    }
19519
19520    /// Gets the enum value as a string.
19521    ///
19522    /// Returns `None` if the enum contains an unknown value deserialized from
19523    /// the integer representation of enums.
19524    pub fn name(&self) -> std::option::Option<&str> {
19525        match self {
19526            Self::Unspecified => std::option::Option::Some("LOAD_BALANCER_TYPE_UNSPECIFIED"),
19527            Self::HttpsAdvancedLoadBalancer => {
19528                std::option::Option::Some("HTTPS_ADVANCED_LOAD_BALANCER")
19529            }
19530            Self::HttpsLoadBalancer => std::option::Option::Some("HTTPS_LOAD_BALANCER"),
19531            Self::RegionalHttpsLoadBalancer => {
19532                std::option::Option::Some("REGIONAL_HTTPS_LOAD_BALANCER")
19533            }
19534            Self::InternalHttpsLoadBalancer => {
19535                std::option::Option::Some("INTERNAL_HTTPS_LOAD_BALANCER")
19536            }
19537            Self::SslProxyLoadBalancer => std::option::Option::Some("SSL_PROXY_LOAD_BALANCER"),
19538            Self::TcpProxyLoadBalancer => std::option::Option::Some("TCP_PROXY_LOAD_BALANCER"),
19539            Self::InternalTcpProxyLoadBalancer => {
19540                std::option::Option::Some("INTERNAL_TCP_PROXY_LOAD_BALANCER")
19541            }
19542            Self::NetworkLoadBalancer => std::option::Option::Some("NETWORK_LOAD_BALANCER"),
19543            Self::LegacyNetworkLoadBalancer => {
19544                std::option::Option::Some("LEGACY_NETWORK_LOAD_BALANCER")
19545            }
19546            Self::TcpUdpInternalLoadBalancer => {
19547                std::option::Option::Some("TCP_UDP_INTERNAL_LOAD_BALANCER")
19548            }
19549            Self::UnknownValue(u) => u.0.name(),
19550        }
19551    }
19552}
19553
19554impl std::default::Default for LoadBalancerType {
19555    fn default() -> Self {
19556        use std::convert::From;
19557        Self::from(0)
19558    }
19559}
19560
19561impl std::fmt::Display for LoadBalancerType {
19562    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19563        wkt::internal::display_enum(f, self.name(), self.value())
19564    }
19565}
19566
19567impl std::convert::From<i32> for LoadBalancerType {
19568    fn from(value: i32) -> Self {
19569        match value {
19570            0 => Self::Unspecified,
19571            1 => Self::HttpsAdvancedLoadBalancer,
19572            2 => Self::HttpsLoadBalancer,
19573            3 => Self::RegionalHttpsLoadBalancer,
19574            4 => Self::InternalHttpsLoadBalancer,
19575            5 => Self::SslProxyLoadBalancer,
19576            6 => Self::TcpProxyLoadBalancer,
19577            7 => Self::InternalTcpProxyLoadBalancer,
19578            8 => Self::NetworkLoadBalancer,
19579            9 => Self::LegacyNetworkLoadBalancer,
19580            10 => Self::TcpUdpInternalLoadBalancer,
19581            _ => Self::UnknownValue(load_balancer_type::UnknownValue(
19582                wkt::internal::UnknownEnumValue::Integer(value),
19583            )),
19584        }
19585    }
19586}
19587
19588impl std::convert::From<&str> for LoadBalancerType {
19589    fn from(value: &str) -> Self {
19590        use std::string::ToString;
19591        match value {
19592            "LOAD_BALANCER_TYPE_UNSPECIFIED" => Self::Unspecified,
19593            "HTTPS_ADVANCED_LOAD_BALANCER" => Self::HttpsAdvancedLoadBalancer,
19594            "HTTPS_LOAD_BALANCER" => Self::HttpsLoadBalancer,
19595            "REGIONAL_HTTPS_LOAD_BALANCER" => Self::RegionalHttpsLoadBalancer,
19596            "INTERNAL_HTTPS_LOAD_BALANCER" => Self::InternalHttpsLoadBalancer,
19597            "SSL_PROXY_LOAD_BALANCER" => Self::SslProxyLoadBalancer,
19598            "TCP_PROXY_LOAD_BALANCER" => Self::TcpProxyLoadBalancer,
19599            "INTERNAL_TCP_PROXY_LOAD_BALANCER" => Self::InternalTcpProxyLoadBalancer,
19600            "NETWORK_LOAD_BALANCER" => Self::NetworkLoadBalancer,
19601            "LEGACY_NETWORK_LOAD_BALANCER" => Self::LegacyNetworkLoadBalancer,
19602            "TCP_UDP_INTERNAL_LOAD_BALANCER" => Self::TcpUdpInternalLoadBalancer,
19603            _ => Self::UnknownValue(load_balancer_type::UnknownValue(
19604                wkt::internal::UnknownEnumValue::String(value.to_string()),
19605            )),
19606        }
19607    }
19608}
19609
19610impl serde::ser::Serialize for LoadBalancerType {
19611    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19612    where
19613        S: serde::Serializer,
19614    {
19615        match self {
19616            Self::Unspecified => serializer.serialize_i32(0),
19617            Self::HttpsAdvancedLoadBalancer => serializer.serialize_i32(1),
19618            Self::HttpsLoadBalancer => serializer.serialize_i32(2),
19619            Self::RegionalHttpsLoadBalancer => serializer.serialize_i32(3),
19620            Self::InternalHttpsLoadBalancer => serializer.serialize_i32(4),
19621            Self::SslProxyLoadBalancer => serializer.serialize_i32(5),
19622            Self::TcpProxyLoadBalancer => serializer.serialize_i32(6),
19623            Self::InternalTcpProxyLoadBalancer => serializer.serialize_i32(7),
19624            Self::NetworkLoadBalancer => serializer.serialize_i32(8),
19625            Self::LegacyNetworkLoadBalancer => serializer.serialize_i32(9),
19626            Self::TcpUdpInternalLoadBalancer => serializer.serialize_i32(10),
19627            Self::UnknownValue(u) => u.0.serialize(serializer),
19628        }
19629    }
19630}
19631
19632impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
19633    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19634    where
19635        D: serde::Deserializer<'de>,
19636    {
19637        deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
19638            ".google.cloud.networkmanagement.v1.LoadBalancerType",
19639        ))
19640    }
19641}