google_cloud_networkmanagement_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate iam_v1;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate rpc;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// A Connectivity Test for a network reachability analysis.
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct ConnectivityTest {
46 /// Identifier. Unique name of the resource using the form:
47 /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
48 pub name: std::string::String,
49
50 /// The user-supplied description of the Connectivity Test.
51 /// Maximum of 512 characters.
52 pub description: std::string::String,
53
54 /// Required. Source specification of the Connectivity Test.
55 ///
56 /// You can use a combination of source IP address, URI of a supported
57 /// endpoint, project ID, or VPC network to identify the source location.
58 ///
59 /// Reachability analysis might proceed even if the source location is
60 /// ambiguous. However, the test result might include endpoints or use a source
61 /// that you don't intend to test.
62 pub source: std::option::Option<crate::model::Endpoint>,
63
64 /// Required. Destination specification of the Connectivity Test.
65 ///
66 /// You can use a combination of destination IP address, URI of a supported
67 /// endpoint, project ID, or VPC network to identify the destination location.
68 ///
69 /// Reachability analysis proceeds even if the destination location is
70 /// ambiguous. However, the test result might include endpoints or use a
71 /// destination that you don't intend to test.
72 pub destination: std::option::Option<crate::model::Endpoint>,
73
74 /// IP Protocol of the test. When not provided, "TCP" is assumed.
75 pub protocol: std::string::String,
76
77 /// Other projects that may be relevant for reachability analysis.
78 /// This is applicable to scenarios where a test can cross project boundaries.
79 pub related_projects: std::vec::Vec<std::string::String>,
80
81 /// Output only. The display name of a Connectivity Test.
82 pub display_name: std::string::String,
83
84 /// Resource labels to represent user-provided metadata.
85 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
86
87 /// Output only. The time the test was created.
88 pub create_time: std::option::Option<wkt::Timestamp>,
89
90 /// Output only. The time the test's configuration was updated.
91 pub update_time: std::option::Option<wkt::Timestamp>,
92
93 /// Output only. The reachability details of this test from the latest run.
94 /// The details are updated when creating a new test, updating an
95 /// existing test, or triggering a one-time rerun of an existing test.
96 pub reachability_details: std::option::Option<crate::model::ReachabilityDetails>,
97
98 /// Output only. The probing details of this test from the latest run, present
99 /// for applicable tests only. The details are updated when creating a new
100 /// test, updating an existing test, or triggering a one-time rerun of an
101 /// existing test.
102 pub probing_details: std::option::Option<crate::model::ProbingDetails>,
103
104 /// Whether run analysis for the return path from destination to source.
105 /// Default value is false.
106 pub round_trip: bool,
107
108 /// Output only. The reachability details of this test from the latest run for
109 /// the return path. The details are updated when creating a new test,
110 /// updating an existing test, or triggering a one-time rerun of an existing
111 /// test.
112 pub return_reachability_details: std::option::Option<crate::model::ReachabilityDetails>,
113
114 /// Whether the analysis should skip firewall checking. Default value is false.
115 pub bypass_firewall_checks: bool,
116
117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
118}
119
120impl ConnectivityTest {
121 pub fn new() -> Self {
122 std::default::Default::default()
123 }
124
125 /// Sets the value of [name][crate::model::ConnectivityTest::name].
126 ///
127 /// # Example
128 /// ```ignore,no_run
129 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
130 /// let x = ConnectivityTest::new().set_name("example");
131 /// ```
132 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
133 self.name = v.into();
134 self
135 }
136
137 /// Sets the value of [description][crate::model::ConnectivityTest::description].
138 ///
139 /// # Example
140 /// ```ignore,no_run
141 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
142 /// let x = ConnectivityTest::new().set_description("example");
143 /// ```
144 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
145 self.description = v.into();
146 self
147 }
148
149 /// Sets the value of [source][crate::model::ConnectivityTest::source].
150 ///
151 /// # Example
152 /// ```ignore,no_run
153 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
154 /// use google_cloud_networkmanagement_v1::model::Endpoint;
155 /// let x = ConnectivityTest::new().set_source(Endpoint::default()/* use setters */);
156 /// ```
157 pub fn set_source<T>(mut self, v: T) -> Self
158 where
159 T: std::convert::Into<crate::model::Endpoint>,
160 {
161 self.source = std::option::Option::Some(v.into());
162 self
163 }
164
165 /// Sets or clears the value of [source][crate::model::ConnectivityTest::source].
166 ///
167 /// # Example
168 /// ```ignore,no_run
169 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
170 /// use google_cloud_networkmanagement_v1::model::Endpoint;
171 /// let x = ConnectivityTest::new().set_or_clear_source(Some(Endpoint::default()/* use setters */));
172 /// let x = ConnectivityTest::new().set_or_clear_source(None::<Endpoint>);
173 /// ```
174 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
175 where
176 T: std::convert::Into<crate::model::Endpoint>,
177 {
178 self.source = v.map(|x| x.into());
179 self
180 }
181
182 /// Sets the value of [destination][crate::model::ConnectivityTest::destination].
183 ///
184 /// # Example
185 /// ```ignore,no_run
186 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
187 /// use google_cloud_networkmanagement_v1::model::Endpoint;
188 /// let x = ConnectivityTest::new().set_destination(Endpoint::default()/* use setters */);
189 /// ```
190 pub fn set_destination<T>(mut self, v: T) -> Self
191 where
192 T: std::convert::Into<crate::model::Endpoint>,
193 {
194 self.destination = std::option::Option::Some(v.into());
195 self
196 }
197
198 /// Sets or clears the value of [destination][crate::model::ConnectivityTest::destination].
199 ///
200 /// # Example
201 /// ```ignore,no_run
202 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
203 /// use google_cloud_networkmanagement_v1::model::Endpoint;
204 /// let x = ConnectivityTest::new().set_or_clear_destination(Some(Endpoint::default()/* use setters */));
205 /// let x = ConnectivityTest::new().set_or_clear_destination(None::<Endpoint>);
206 /// ```
207 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
208 where
209 T: std::convert::Into<crate::model::Endpoint>,
210 {
211 self.destination = v.map(|x| x.into());
212 self
213 }
214
215 /// Sets the value of [protocol][crate::model::ConnectivityTest::protocol].
216 ///
217 /// # Example
218 /// ```ignore,no_run
219 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
220 /// let x = ConnectivityTest::new().set_protocol("example");
221 /// ```
222 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
223 self.protocol = v.into();
224 self
225 }
226
227 /// Sets the value of [related_projects][crate::model::ConnectivityTest::related_projects].
228 ///
229 /// # Example
230 /// ```ignore,no_run
231 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
232 /// let x = ConnectivityTest::new().set_related_projects(["a", "b", "c"]);
233 /// ```
234 pub fn set_related_projects<T, V>(mut self, v: T) -> Self
235 where
236 T: std::iter::IntoIterator<Item = V>,
237 V: std::convert::Into<std::string::String>,
238 {
239 use std::iter::Iterator;
240 self.related_projects = v.into_iter().map(|i| i.into()).collect();
241 self
242 }
243
244 /// Sets the value of [display_name][crate::model::ConnectivityTest::display_name].
245 ///
246 /// # Example
247 /// ```ignore,no_run
248 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
249 /// let x = ConnectivityTest::new().set_display_name("example");
250 /// ```
251 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
252 self.display_name = v.into();
253 self
254 }
255
256 /// Sets the value of [labels][crate::model::ConnectivityTest::labels].
257 ///
258 /// # Example
259 /// ```ignore,no_run
260 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
261 /// let x = ConnectivityTest::new().set_labels([
262 /// ("key0", "abc"),
263 /// ("key1", "xyz"),
264 /// ]);
265 /// ```
266 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
267 where
268 T: std::iter::IntoIterator<Item = (K, V)>,
269 K: std::convert::Into<std::string::String>,
270 V: std::convert::Into<std::string::String>,
271 {
272 use std::iter::Iterator;
273 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
274 self
275 }
276
277 /// Sets the value of [create_time][crate::model::ConnectivityTest::create_time].
278 ///
279 /// # Example
280 /// ```ignore,no_run
281 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
282 /// use wkt::Timestamp;
283 /// let x = ConnectivityTest::new().set_create_time(Timestamp::default()/* use setters */);
284 /// ```
285 pub fn set_create_time<T>(mut self, v: T) -> Self
286 where
287 T: std::convert::Into<wkt::Timestamp>,
288 {
289 self.create_time = std::option::Option::Some(v.into());
290 self
291 }
292
293 /// Sets or clears the value of [create_time][crate::model::ConnectivityTest::create_time].
294 ///
295 /// # Example
296 /// ```ignore,no_run
297 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
298 /// use wkt::Timestamp;
299 /// let x = ConnectivityTest::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
300 /// let x = ConnectivityTest::new().set_or_clear_create_time(None::<Timestamp>);
301 /// ```
302 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
303 where
304 T: std::convert::Into<wkt::Timestamp>,
305 {
306 self.create_time = v.map(|x| x.into());
307 self
308 }
309
310 /// Sets the value of [update_time][crate::model::ConnectivityTest::update_time].
311 ///
312 /// # Example
313 /// ```ignore,no_run
314 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
315 /// use wkt::Timestamp;
316 /// let x = ConnectivityTest::new().set_update_time(Timestamp::default()/* use setters */);
317 /// ```
318 pub fn set_update_time<T>(mut self, v: T) -> Self
319 where
320 T: std::convert::Into<wkt::Timestamp>,
321 {
322 self.update_time = std::option::Option::Some(v.into());
323 self
324 }
325
326 /// Sets or clears the value of [update_time][crate::model::ConnectivityTest::update_time].
327 ///
328 /// # Example
329 /// ```ignore,no_run
330 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
331 /// use wkt::Timestamp;
332 /// let x = ConnectivityTest::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
333 /// let x = ConnectivityTest::new().set_or_clear_update_time(None::<Timestamp>);
334 /// ```
335 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
336 where
337 T: std::convert::Into<wkt::Timestamp>,
338 {
339 self.update_time = v.map(|x| x.into());
340 self
341 }
342
343 /// Sets the value of [reachability_details][crate::model::ConnectivityTest::reachability_details].
344 ///
345 /// # Example
346 /// ```ignore,no_run
347 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
348 /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
349 /// let x = ConnectivityTest::new().set_reachability_details(ReachabilityDetails::default()/* use setters */);
350 /// ```
351 pub fn set_reachability_details<T>(mut self, v: T) -> Self
352 where
353 T: std::convert::Into<crate::model::ReachabilityDetails>,
354 {
355 self.reachability_details = std::option::Option::Some(v.into());
356 self
357 }
358
359 /// Sets or clears the value of [reachability_details][crate::model::ConnectivityTest::reachability_details].
360 ///
361 /// # Example
362 /// ```ignore,no_run
363 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
364 /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
365 /// let x = ConnectivityTest::new().set_or_clear_reachability_details(Some(ReachabilityDetails::default()/* use setters */));
366 /// let x = ConnectivityTest::new().set_or_clear_reachability_details(None::<ReachabilityDetails>);
367 /// ```
368 pub fn set_or_clear_reachability_details<T>(mut self, v: std::option::Option<T>) -> Self
369 where
370 T: std::convert::Into<crate::model::ReachabilityDetails>,
371 {
372 self.reachability_details = v.map(|x| x.into());
373 self
374 }
375
376 /// Sets the value of [probing_details][crate::model::ConnectivityTest::probing_details].
377 ///
378 /// # Example
379 /// ```ignore,no_run
380 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
381 /// use google_cloud_networkmanagement_v1::model::ProbingDetails;
382 /// let x = ConnectivityTest::new().set_probing_details(ProbingDetails::default()/* use setters */);
383 /// ```
384 pub fn set_probing_details<T>(mut self, v: T) -> Self
385 where
386 T: std::convert::Into<crate::model::ProbingDetails>,
387 {
388 self.probing_details = std::option::Option::Some(v.into());
389 self
390 }
391
392 /// Sets or clears the value of [probing_details][crate::model::ConnectivityTest::probing_details].
393 ///
394 /// # Example
395 /// ```ignore,no_run
396 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
397 /// use google_cloud_networkmanagement_v1::model::ProbingDetails;
398 /// let x = ConnectivityTest::new().set_or_clear_probing_details(Some(ProbingDetails::default()/* use setters */));
399 /// let x = ConnectivityTest::new().set_or_clear_probing_details(None::<ProbingDetails>);
400 /// ```
401 pub fn set_or_clear_probing_details<T>(mut self, v: std::option::Option<T>) -> Self
402 where
403 T: std::convert::Into<crate::model::ProbingDetails>,
404 {
405 self.probing_details = v.map(|x| x.into());
406 self
407 }
408
409 /// Sets the value of [round_trip][crate::model::ConnectivityTest::round_trip].
410 ///
411 /// # Example
412 /// ```ignore,no_run
413 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
414 /// let x = ConnectivityTest::new().set_round_trip(true);
415 /// ```
416 pub fn set_round_trip<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
417 self.round_trip = v.into();
418 self
419 }
420
421 /// Sets the value of [return_reachability_details][crate::model::ConnectivityTest::return_reachability_details].
422 ///
423 /// # Example
424 /// ```ignore,no_run
425 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
426 /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
427 /// let x = ConnectivityTest::new().set_return_reachability_details(ReachabilityDetails::default()/* use setters */);
428 /// ```
429 pub fn set_return_reachability_details<T>(mut self, v: T) -> Self
430 where
431 T: std::convert::Into<crate::model::ReachabilityDetails>,
432 {
433 self.return_reachability_details = std::option::Option::Some(v.into());
434 self
435 }
436
437 /// Sets or clears the value of [return_reachability_details][crate::model::ConnectivityTest::return_reachability_details].
438 ///
439 /// # Example
440 /// ```ignore,no_run
441 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
442 /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
443 /// let x = ConnectivityTest::new().set_or_clear_return_reachability_details(Some(ReachabilityDetails::default()/* use setters */));
444 /// let x = ConnectivityTest::new().set_or_clear_return_reachability_details(None::<ReachabilityDetails>);
445 /// ```
446 pub fn set_or_clear_return_reachability_details<T>(mut self, v: std::option::Option<T>) -> Self
447 where
448 T: std::convert::Into<crate::model::ReachabilityDetails>,
449 {
450 self.return_reachability_details = v.map(|x| x.into());
451 self
452 }
453
454 /// Sets the value of [bypass_firewall_checks][crate::model::ConnectivityTest::bypass_firewall_checks].
455 ///
456 /// # Example
457 /// ```ignore,no_run
458 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
459 /// let x = ConnectivityTest::new().set_bypass_firewall_checks(true);
460 /// ```
461 pub fn set_bypass_firewall_checks<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
462 self.bypass_firewall_checks = v.into();
463 self
464 }
465}
466
467impl wkt::message::Message for ConnectivityTest {
468 fn typename() -> &'static str {
469 "type.googleapis.com/google.cloud.networkmanagement.v1.ConnectivityTest"
470 }
471}
472
473/// Source or destination of the Connectivity Test.
474#[derive(Clone, Default, PartialEq)]
475#[non_exhaustive]
476pub struct Endpoint {
477 /// The IP address of the endpoint, which can be an external or internal IP.
478 pub ip_address: std::string::String,
479
480 /// The IP protocol port of the endpoint.
481 /// Only applicable when protocol is TCP or UDP.
482 pub port: i32,
483
484 /// A Compute Engine instance URI.
485 pub instance: std::string::String,
486
487 /// A forwarding rule and its corresponding IP address represent the frontend
488 /// configuration of a Google Cloud load balancer. Forwarding rules are also
489 /// used for protocol forwarding, Private Service Connect and other network
490 /// services to provide forwarding information in the control plane. Applicable
491 /// only to destination endpoint. Format:
492 /// `projects/{project}/global/forwardingRules/{id}` or
493 /// `projects/{project}/regions/{region}/forwardingRules/{id}`
494 pub forwarding_rule: std::string::String,
495
496 /// Output only. Specifies the type of the target of the forwarding rule.
497 pub forwarding_rule_target: std::option::Option<crate::model::endpoint::ForwardingRuleTarget>,
498
499 /// Output only. ID of the load balancer the forwarding rule points to. Empty
500 /// for forwarding rules not related to load balancers.
501 pub load_balancer_id: std::option::Option<std::string::String>,
502
503 /// Output only. Type of the load balancer the forwarding rule points to.
504 pub load_balancer_type: std::option::Option<crate::model::LoadBalancerType>,
505
506 /// A cluster URI for [Google Kubernetes Engine cluster control
507 /// plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
508 pub gke_master_cluster: std::string::String,
509
510 /// DNS endpoint of [Google Kubernetes Engine cluster control
511 /// plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
512 /// Requires gke_master_cluster to be set, can't be used simultaneoulsly with
513 /// ip_address or network. Applicable only to destination endpoint.
514 pub fqdn: std::string::String,
515
516 /// A [Cloud SQL](https://cloud.google.com/sql) instance URI.
517 pub cloud_sql_instance: std::string::String,
518
519 /// A [Redis Instance](https://cloud.google.com/memorystore/docs/redis) URI.
520 /// Applicable only to destination endpoint.
521 pub redis_instance: std::string::String,
522
523 /// A [Redis Cluster](https://cloud.google.com/memorystore/docs/cluster) URI.
524 /// Applicable only to destination endpoint.
525 pub redis_cluster: std::string::String,
526
527 /// A [GKE Pod](https://cloud.google.com/kubernetes-engine/docs/concepts/pod)
528 /// URI.
529 pub gke_pod: std::string::String,
530
531 /// A [Cloud Function](https://cloud.google.com/functions). Applicable only to
532 /// source endpoint.
533 pub cloud_function: std::option::Option<crate::model::endpoint::CloudFunctionEndpoint>,
534
535 /// An [App Engine](https://cloud.google.com/appengine) [service
536 /// version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions).
537 /// Applicable only to source endpoint.
538 pub app_engine_version: std::option::Option<crate::model::endpoint::AppEngineVersionEndpoint>,
539
540 /// A [Cloud Run](https://cloud.google.com/run)
541 /// [revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get)
542 /// Applicable only to source endpoint.
543 pub cloud_run_revision: std::option::Option<crate::model::endpoint::CloudRunRevisionEndpoint>,
544
545 /// A VPC network URI. For source endpoints, used according to the
546 /// `network_type`. For destination endpoints, used only when the source is an
547 /// external IP address endpoint, and the destination is an internal IP address
548 /// endpoint.
549 pub network: std::string::String,
550
551 /// For source endpoints, type of the network where the endpoint is located.
552 /// Not relevant for destination endpoints.
553 pub network_type: crate::model::endpoint::NetworkType,
554
555 /// For source endpoints, endpoint project ID. Used according to the
556 /// `network_type`. Not relevant for destination endpoints.
557 pub project_id: std::string::String,
558
559 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
560}
561
562impl Endpoint {
563 pub fn new() -> Self {
564 std::default::Default::default()
565 }
566
567 /// Sets the value of [ip_address][crate::model::Endpoint::ip_address].
568 ///
569 /// # Example
570 /// ```ignore,no_run
571 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
572 /// let x = Endpoint::new().set_ip_address("example");
573 /// ```
574 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
575 self.ip_address = v.into();
576 self
577 }
578
579 /// Sets the value of [port][crate::model::Endpoint::port].
580 ///
581 /// # Example
582 /// ```ignore,no_run
583 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
584 /// let x = Endpoint::new().set_port(42);
585 /// ```
586 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
587 self.port = v.into();
588 self
589 }
590
591 /// Sets the value of [instance][crate::model::Endpoint::instance].
592 ///
593 /// # Example
594 /// ```ignore,no_run
595 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
596 /// let x = Endpoint::new().set_instance("example");
597 /// ```
598 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
599 self.instance = v.into();
600 self
601 }
602
603 /// Sets the value of [forwarding_rule][crate::model::Endpoint::forwarding_rule].
604 ///
605 /// # Example
606 /// ```ignore,no_run
607 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
608 /// let x = Endpoint::new().set_forwarding_rule("example");
609 /// ```
610 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
611 self.forwarding_rule = v.into();
612 self
613 }
614
615 /// Sets the value of [forwarding_rule_target][crate::model::Endpoint::forwarding_rule_target].
616 ///
617 /// # Example
618 /// ```ignore,no_run
619 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
620 /// use google_cloud_networkmanagement_v1::model::endpoint::ForwardingRuleTarget;
621 /// let x0 = Endpoint::new().set_forwarding_rule_target(ForwardingRuleTarget::Instance);
622 /// let x1 = Endpoint::new().set_forwarding_rule_target(ForwardingRuleTarget::LoadBalancer);
623 /// let x2 = Endpoint::new().set_forwarding_rule_target(ForwardingRuleTarget::VpnGateway);
624 /// ```
625 pub fn set_forwarding_rule_target<T>(mut self, v: T) -> Self
626 where
627 T: std::convert::Into<crate::model::endpoint::ForwardingRuleTarget>,
628 {
629 self.forwarding_rule_target = std::option::Option::Some(v.into());
630 self
631 }
632
633 /// Sets or clears the value of [forwarding_rule_target][crate::model::Endpoint::forwarding_rule_target].
634 ///
635 /// # Example
636 /// ```ignore,no_run
637 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
638 /// use google_cloud_networkmanagement_v1::model::endpoint::ForwardingRuleTarget;
639 /// let x0 = Endpoint::new().set_or_clear_forwarding_rule_target(Some(ForwardingRuleTarget::Instance));
640 /// let x1 = Endpoint::new().set_or_clear_forwarding_rule_target(Some(ForwardingRuleTarget::LoadBalancer));
641 /// let x2 = Endpoint::new().set_or_clear_forwarding_rule_target(Some(ForwardingRuleTarget::VpnGateway));
642 /// let x_none = Endpoint::new().set_or_clear_forwarding_rule_target(None::<ForwardingRuleTarget>);
643 /// ```
644 pub fn set_or_clear_forwarding_rule_target<T>(mut self, v: std::option::Option<T>) -> Self
645 where
646 T: std::convert::Into<crate::model::endpoint::ForwardingRuleTarget>,
647 {
648 self.forwarding_rule_target = v.map(|x| x.into());
649 self
650 }
651
652 /// Sets the value of [load_balancer_id][crate::model::Endpoint::load_balancer_id].
653 ///
654 /// # Example
655 /// ```ignore,no_run
656 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
657 /// let x = Endpoint::new().set_load_balancer_id("example");
658 /// ```
659 pub fn set_load_balancer_id<T>(mut self, v: T) -> Self
660 where
661 T: std::convert::Into<std::string::String>,
662 {
663 self.load_balancer_id = std::option::Option::Some(v.into());
664 self
665 }
666
667 /// Sets or clears the value of [load_balancer_id][crate::model::Endpoint::load_balancer_id].
668 ///
669 /// # Example
670 /// ```ignore,no_run
671 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
672 /// let x = Endpoint::new().set_or_clear_load_balancer_id(Some("example"));
673 /// let x = Endpoint::new().set_or_clear_load_balancer_id(None::<String>);
674 /// ```
675 pub fn set_or_clear_load_balancer_id<T>(mut self, v: std::option::Option<T>) -> Self
676 where
677 T: std::convert::Into<std::string::String>,
678 {
679 self.load_balancer_id = v.map(|x| x.into());
680 self
681 }
682
683 /// Sets the value of [load_balancer_type][crate::model::Endpoint::load_balancer_type].
684 ///
685 /// # Example
686 /// ```ignore,no_run
687 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
688 /// use google_cloud_networkmanagement_v1::model::LoadBalancerType;
689 /// let x0 = Endpoint::new().set_load_balancer_type(LoadBalancerType::HttpsAdvancedLoadBalancer);
690 /// let x1 = Endpoint::new().set_load_balancer_type(LoadBalancerType::HttpsLoadBalancer);
691 /// let x2 = Endpoint::new().set_load_balancer_type(LoadBalancerType::RegionalHttpsLoadBalancer);
692 /// ```
693 pub fn set_load_balancer_type<T>(mut self, v: T) -> Self
694 where
695 T: std::convert::Into<crate::model::LoadBalancerType>,
696 {
697 self.load_balancer_type = std::option::Option::Some(v.into());
698 self
699 }
700
701 /// Sets or clears the value of [load_balancer_type][crate::model::Endpoint::load_balancer_type].
702 ///
703 /// # Example
704 /// ```ignore,no_run
705 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
706 /// use google_cloud_networkmanagement_v1::model::LoadBalancerType;
707 /// let x0 = Endpoint::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::HttpsAdvancedLoadBalancer));
708 /// let x1 = Endpoint::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::HttpsLoadBalancer));
709 /// let x2 = Endpoint::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::RegionalHttpsLoadBalancer));
710 /// let x_none = Endpoint::new().set_or_clear_load_balancer_type(None::<LoadBalancerType>);
711 /// ```
712 pub fn set_or_clear_load_balancer_type<T>(mut self, v: std::option::Option<T>) -> Self
713 where
714 T: std::convert::Into<crate::model::LoadBalancerType>,
715 {
716 self.load_balancer_type = v.map(|x| x.into());
717 self
718 }
719
720 /// Sets the value of [gke_master_cluster][crate::model::Endpoint::gke_master_cluster].
721 ///
722 /// # Example
723 /// ```ignore,no_run
724 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
725 /// let x = Endpoint::new().set_gke_master_cluster("example");
726 /// ```
727 pub fn set_gke_master_cluster<T: std::convert::Into<std::string::String>>(
728 mut self,
729 v: T,
730 ) -> Self {
731 self.gke_master_cluster = v.into();
732 self
733 }
734
735 /// Sets the value of [fqdn][crate::model::Endpoint::fqdn].
736 ///
737 /// # Example
738 /// ```ignore,no_run
739 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
740 /// let x = Endpoint::new().set_fqdn("example");
741 /// ```
742 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
743 self.fqdn = v.into();
744 self
745 }
746
747 /// Sets the value of [cloud_sql_instance][crate::model::Endpoint::cloud_sql_instance].
748 ///
749 /// # Example
750 /// ```ignore,no_run
751 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
752 /// let x = Endpoint::new().set_cloud_sql_instance("example");
753 /// ```
754 pub fn set_cloud_sql_instance<T: std::convert::Into<std::string::String>>(
755 mut self,
756 v: T,
757 ) -> Self {
758 self.cloud_sql_instance = v.into();
759 self
760 }
761
762 /// Sets the value of [redis_instance][crate::model::Endpoint::redis_instance].
763 ///
764 /// # Example
765 /// ```ignore,no_run
766 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
767 /// let x = Endpoint::new().set_redis_instance("example");
768 /// ```
769 pub fn set_redis_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
770 self.redis_instance = v.into();
771 self
772 }
773
774 /// Sets the value of [redis_cluster][crate::model::Endpoint::redis_cluster].
775 ///
776 /// # Example
777 /// ```ignore,no_run
778 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
779 /// let x = Endpoint::new().set_redis_cluster("example");
780 /// ```
781 pub fn set_redis_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
782 self.redis_cluster = v.into();
783 self
784 }
785
786 /// Sets the value of [gke_pod][crate::model::Endpoint::gke_pod].
787 ///
788 /// # Example
789 /// ```ignore,no_run
790 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
791 /// let x = Endpoint::new().set_gke_pod("example");
792 /// ```
793 pub fn set_gke_pod<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
794 self.gke_pod = v.into();
795 self
796 }
797
798 /// Sets the value of [cloud_function][crate::model::Endpoint::cloud_function].
799 ///
800 /// # Example
801 /// ```ignore,no_run
802 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
803 /// use google_cloud_networkmanagement_v1::model::endpoint::CloudFunctionEndpoint;
804 /// let x = Endpoint::new().set_cloud_function(CloudFunctionEndpoint::default()/* use setters */);
805 /// ```
806 pub fn set_cloud_function<T>(mut self, v: T) -> Self
807 where
808 T: std::convert::Into<crate::model::endpoint::CloudFunctionEndpoint>,
809 {
810 self.cloud_function = std::option::Option::Some(v.into());
811 self
812 }
813
814 /// Sets or clears the value of [cloud_function][crate::model::Endpoint::cloud_function].
815 ///
816 /// # Example
817 /// ```ignore,no_run
818 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
819 /// use google_cloud_networkmanagement_v1::model::endpoint::CloudFunctionEndpoint;
820 /// let x = Endpoint::new().set_or_clear_cloud_function(Some(CloudFunctionEndpoint::default()/* use setters */));
821 /// let x = Endpoint::new().set_or_clear_cloud_function(None::<CloudFunctionEndpoint>);
822 /// ```
823 pub fn set_or_clear_cloud_function<T>(mut self, v: std::option::Option<T>) -> Self
824 where
825 T: std::convert::Into<crate::model::endpoint::CloudFunctionEndpoint>,
826 {
827 self.cloud_function = v.map(|x| x.into());
828 self
829 }
830
831 /// Sets the value of [app_engine_version][crate::model::Endpoint::app_engine_version].
832 ///
833 /// # Example
834 /// ```ignore,no_run
835 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
836 /// use google_cloud_networkmanagement_v1::model::endpoint::AppEngineVersionEndpoint;
837 /// let x = Endpoint::new().set_app_engine_version(AppEngineVersionEndpoint::default()/* use setters */);
838 /// ```
839 pub fn set_app_engine_version<T>(mut self, v: T) -> Self
840 where
841 T: std::convert::Into<crate::model::endpoint::AppEngineVersionEndpoint>,
842 {
843 self.app_engine_version = std::option::Option::Some(v.into());
844 self
845 }
846
847 /// Sets or clears the value of [app_engine_version][crate::model::Endpoint::app_engine_version].
848 ///
849 /// # Example
850 /// ```ignore,no_run
851 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
852 /// use google_cloud_networkmanagement_v1::model::endpoint::AppEngineVersionEndpoint;
853 /// let x = Endpoint::new().set_or_clear_app_engine_version(Some(AppEngineVersionEndpoint::default()/* use setters */));
854 /// let x = Endpoint::new().set_or_clear_app_engine_version(None::<AppEngineVersionEndpoint>);
855 /// ```
856 pub fn set_or_clear_app_engine_version<T>(mut self, v: std::option::Option<T>) -> Self
857 where
858 T: std::convert::Into<crate::model::endpoint::AppEngineVersionEndpoint>,
859 {
860 self.app_engine_version = v.map(|x| x.into());
861 self
862 }
863
864 /// Sets the value of [cloud_run_revision][crate::model::Endpoint::cloud_run_revision].
865 ///
866 /// # Example
867 /// ```ignore,no_run
868 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
869 /// use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
870 /// let x = Endpoint::new().set_cloud_run_revision(CloudRunRevisionEndpoint::default()/* use setters */);
871 /// ```
872 pub fn set_cloud_run_revision<T>(mut self, v: T) -> Self
873 where
874 T: std::convert::Into<crate::model::endpoint::CloudRunRevisionEndpoint>,
875 {
876 self.cloud_run_revision = std::option::Option::Some(v.into());
877 self
878 }
879
880 /// Sets or clears the value of [cloud_run_revision][crate::model::Endpoint::cloud_run_revision].
881 ///
882 /// # Example
883 /// ```ignore,no_run
884 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
885 /// use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
886 /// let x = Endpoint::new().set_or_clear_cloud_run_revision(Some(CloudRunRevisionEndpoint::default()/* use setters */));
887 /// let x = Endpoint::new().set_or_clear_cloud_run_revision(None::<CloudRunRevisionEndpoint>);
888 /// ```
889 pub fn set_or_clear_cloud_run_revision<T>(mut self, v: std::option::Option<T>) -> Self
890 where
891 T: std::convert::Into<crate::model::endpoint::CloudRunRevisionEndpoint>,
892 {
893 self.cloud_run_revision = v.map(|x| x.into());
894 self
895 }
896
897 /// Sets the value of [network][crate::model::Endpoint::network].
898 ///
899 /// # Example
900 /// ```ignore,no_run
901 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
902 /// let x = Endpoint::new().set_network("example");
903 /// ```
904 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
905 self.network = v.into();
906 self
907 }
908
909 /// Sets the value of [network_type][crate::model::Endpoint::network_type].
910 ///
911 /// # Example
912 /// ```ignore,no_run
913 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
914 /// use google_cloud_networkmanagement_v1::model::endpoint::NetworkType;
915 /// let x0 = Endpoint::new().set_network_type(NetworkType::GcpNetwork);
916 /// let x1 = Endpoint::new().set_network_type(NetworkType::NonGcpNetwork);
917 /// let x2 = Endpoint::new().set_network_type(NetworkType::Internet);
918 /// ```
919 pub fn set_network_type<T: std::convert::Into<crate::model::endpoint::NetworkType>>(
920 mut self,
921 v: T,
922 ) -> Self {
923 self.network_type = v.into();
924 self
925 }
926
927 /// Sets the value of [project_id][crate::model::Endpoint::project_id].
928 ///
929 /// # Example
930 /// ```ignore,no_run
931 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
932 /// let x = Endpoint::new().set_project_id("example");
933 /// ```
934 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
935 self.project_id = v.into();
936 self
937 }
938}
939
940impl wkt::message::Message for Endpoint {
941 fn typename() -> &'static str {
942 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint"
943 }
944}
945
946/// Defines additional types related to [Endpoint].
947pub mod endpoint {
948 #[allow(unused_imports)]
949 use super::*;
950
951 /// Wrapper for Cloud Function attributes.
952 #[derive(Clone, Default, PartialEq)]
953 #[non_exhaustive]
954 pub struct CloudFunctionEndpoint {
955 /// A [Cloud Function](https://cloud.google.com/functions) name.
956 pub uri: std::string::String,
957
958 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
959 }
960
961 impl CloudFunctionEndpoint {
962 pub fn new() -> Self {
963 std::default::Default::default()
964 }
965
966 /// Sets the value of [uri][crate::model::endpoint::CloudFunctionEndpoint::uri].
967 ///
968 /// # Example
969 /// ```ignore,no_run
970 /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudFunctionEndpoint;
971 /// let x = CloudFunctionEndpoint::new().set_uri("example");
972 /// ```
973 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
974 self.uri = v.into();
975 self
976 }
977 }
978
979 impl wkt::message::Message for CloudFunctionEndpoint {
980 fn typename() -> &'static str {
981 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.CloudFunctionEndpoint"
982 }
983 }
984
985 /// Wrapper for the App Engine service version attributes.
986 #[derive(Clone, Default, PartialEq)]
987 #[non_exhaustive]
988 pub struct AppEngineVersionEndpoint {
989 /// An [App Engine](https://cloud.google.com/appengine) [service
990 /// version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions)
991 /// name.
992 pub uri: std::string::String,
993
994 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
995 }
996
997 impl AppEngineVersionEndpoint {
998 pub fn new() -> Self {
999 std::default::Default::default()
1000 }
1001
1002 /// Sets the value of [uri][crate::model::endpoint::AppEngineVersionEndpoint::uri].
1003 ///
1004 /// # Example
1005 /// ```ignore,no_run
1006 /// # use google_cloud_networkmanagement_v1::model::endpoint::AppEngineVersionEndpoint;
1007 /// let x = AppEngineVersionEndpoint::new().set_uri("example");
1008 /// ```
1009 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1010 self.uri = v.into();
1011 self
1012 }
1013 }
1014
1015 impl wkt::message::Message for AppEngineVersionEndpoint {
1016 fn typename() -> &'static str {
1017 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.AppEngineVersionEndpoint"
1018 }
1019 }
1020
1021 /// Wrapper for Cloud Run revision attributes.
1022 #[derive(Clone, Default, PartialEq)]
1023 #[non_exhaustive]
1024 pub struct CloudRunRevisionEndpoint {
1025 /// A [Cloud Run](https://cloud.google.com/run)
1026 /// [revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get)
1027 /// URI. The format is:
1028 /// projects/{project}/locations/{location}/revisions/{revision}
1029 pub uri: std::string::String,
1030
1031 /// Output only. The URI of the Cloud Run service that the revision belongs
1032 /// to. The format is:
1033 /// projects/{project}/locations/{location}/services/{service}
1034 pub service_uri: std::string::String,
1035
1036 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1037 }
1038
1039 impl CloudRunRevisionEndpoint {
1040 pub fn new() -> Self {
1041 std::default::Default::default()
1042 }
1043
1044 /// Sets the value of [uri][crate::model::endpoint::CloudRunRevisionEndpoint::uri].
1045 ///
1046 /// # Example
1047 /// ```ignore,no_run
1048 /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
1049 /// let x = CloudRunRevisionEndpoint::new().set_uri("example");
1050 /// ```
1051 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1052 self.uri = v.into();
1053 self
1054 }
1055
1056 /// Sets the value of [service_uri][crate::model::endpoint::CloudRunRevisionEndpoint::service_uri].
1057 ///
1058 /// # Example
1059 /// ```ignore,no_run
1060 /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
1061 /// let x = CloudRunRevisionEndpoint::new().set_service_uri("example");
1062 /// ```
1063 pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1064 self.service_uri = v.into();
1065 self
1066 }
1067 }
1068
1069 impl wkt::message::Message for CloudRunRevisionEndpoint {
1070 fn typename() -> &'static str {
1071 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.CloudRunRevisionEndpoint"
1072 }
1073 }
1074
1075 /// The type of the network of the IP address endpoint. Relevant for the source
1076 /// IP address endpoints.
1077 ///
1078 /// # Working with unknown values
1079 ///
1080 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1081 /// additional enum variants at any time. Adding new variants is not considered
1082 /// a breaking change. Applications should write their code in anticipation of:
1083 ///
1084 /// - New values appearing in future releases of the client library, **and**
1085 /// - New values received dynamically, without application changes.
1086 ///
1087 /// Please consult the [Working with enums] section in the user guide for some
1088 /// guidelines.
1089 ///
1090 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1091 #[derive(Clone, Debug, PartialEq)]
1092 #[non_exhaustive]
1093 pub enum NetworkType {
1094 /// Unspecified. The test will analyze all possible IP address locations.
1095 /// This might take longer and produce inaccurate or ambiguous results, so
1096 /// prefer specifying an explicit network type.
1097 ///
1098 /// The `project_id` field should be set to the project where the GCP
1099 /// endpoint is located, or where the non-GCP endpoint should be reachable
1100 /// from (via routes to non-GCP networks). The project might also be inferred
1101 /// from the Connectivity Test project or other projects referenced in the
1102 /// request.
1103 Unspecified,
1104 /// A VPC network. Should be used for internal IP addresses in VPC networks.
1105 /// The `network` field should be set to the URI of this network. Only
1106 /// endpoints within this network will be considered.
1107 GcpNetwork,
1108 /// A non-GCP network (for example, an on-premises network or another cloud
1109 /// provider network). Should be used for internal IP addresses outside of
1110 /// Google Cloud. The `network` field should be set to the URI of the VPC
1111 /// network containing a corresponding Cloud VPN tunnel, Cloud Interconnect
1112 /// VLAN attachment, or a router appliance instance. Only endpoints reachable
1113 /// from the provided VPC network via the routes to non-GCP networks will be
1114 /// considered.
1115 NonGcpNetwork,
1116 /// Internet. Should be used for internet-routable external IP addresses or
1117 /// IP addresses for global Google APIs and services.
1118 Internet,
1119 /// If set, the enum was initialized with an unknown value.
1120 ///
1121 /// Applications can examine the value using [NetworkType::value] or
1122 /// [NetworkType::name].
1123 UnknownValue(network_type::UnknownValue),
1124 }
1125
1126 #[doc(hidden)]
1127 pub mod network_type {
1128 #[allow(unused_imports)]
1129 use super::*;
1130 #[derive(Clone, Debug, PartialEq)]
1131 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1132 }
1133
1134 impl NetworkType {
1135 /// Gets the enum value.
1136 ///
1137 /// Returns `None` if the enum contains an unknown value deserialized from
1138 /// the string representation of enums.
1139 pub fn value(&self) -> std::option::Option<i32> {
1140 match self {
1141 Self::Unspecified => std::option::Option::Some(0),
1142 Self::GcpNetwork => std::option::Option::Some(1),
1143 Self::NonGcpNetwork => std::option::Option::Some(2),
1144 Self::Internet => std::option::Option::Some(3),
1145 Self::UnknownValue(u) => u.0.value(),
1146 }
1147 }
1148
1149 /// Gets the enum value as a string.
1150 ///
1151 /// Returns `None` if the enum contains an unknown value deserialized from
1152 /// the integer representation of enums.
1153 pub fn name(&self) -> std::option::Option<&str> {
1154 match self {
1155 Self::Unspecified => std::option::Option::Some("NETWORK_TYPE_UNSPECIFIED"),
1156 Self::GcpNetwork => std::option::Option::Some("GCP_NETWORK"),
1157 Self::NonGcpNetwork => std::option::Option::Some("NON_GCP_NETWORK"),
1158 Self::Internet => std::option::Option::Some("INTERNET"),
1159 Self::UnknownValue(u) => u.0.name(),
1160 }
1161 }
1162 }
1163
1164 impl std::default::Default for NetworkType {
1165 fn default() -> Self {
1166 use std::convert::From;
1167 Self::from(0)
1168 }
1169 }
1170
1171 impl std::fmt::Display for NetworkType {
1172 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1173 wkt::internal::display_enum(f, self.name(), self.value())
1174 }
1175 }
1176
1177 impl std::convert::From<i32> for NetworkType {
1178 fn from(value: i32) -> Self {
1179 match value {
1180 0 => Self::Unspecified,
1181 1 => Self::GcpNetwork,
1182 2 => Self::NonGcpNetwork,
1183 3 => Self::Internet,
1184 _ => Self::UnknownValue(network_type::UnknownValue(
1185 wkt::internal::UnknownEnumValue::Integer(value),
1186 )),
1187 }
1188 }
1189 }
1190
1191 impl std::convert::From<&str> for NetworkType {
1192 fn from(value: &str) -> Self {
1193 use std::string::ToString;
1194 match value {
1195 "NETWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
1196 "GCP_NETWORK" => Self::GcpNetwork,
1197 "NON_GCP_NETWORK" => Self::NonGcpNetwork,
1198 "INTERNET" => Self::Internet,
1199 _ => Self::UnknownValue(network_type::UnknownValue(
1200 wkt::internal::UnknownEnumValue::String(value.to_string()),
1201 )),
1202 }
1203 }
1204 }
1205
1206 impl serde::ser::Serialize for NetworkType {
1207 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1208 where
1209 S: serde::Serializer,
1210 {
1211 match self {
1212 Self::Unspecified => serializer.serialize_i32(0),
1213 Self::GcpNetwork => serializer.serialize_i32(1),
1214 Self::NonGcpNetwork => serializer.serialize_i32(2),
1215 Self::Internet => serializer.serialize_i32(3),
1216 Self::UnknownValue(u) => u.0.serialize(serializer),
1217 }
1218 }
1219 }
1220
1221 impl<'de> serde::de::Deserialize<'de> for NetworkType {
1222 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1223 where
1224 D: serde::Deserializer<'de>,
1225 {
1226 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NetworkType>::new(
1227 ".google.cloud.networkmanagement.v1.Endpoint.NetworkType",
1228 ))
1229 }
1230 }
1231
1232 /// Type of the target of a forwarding rule.
1233 ///
1234 /// # Working with unknown values
1235 ///
1236 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1237 /// additional enum variants at any time. Adding new variants is not considered
1238 /// a breaking change. Applications should write their code in anticipation of:
1239 ///
1240 /// - New values appearing in future releases of the client library, **and**
1241 /// - New values received dynamically, without application changes.
1242 ///
1243 /// Please consult the [Working with enums] section in the user guide for some
1244 /// guidelines.
1245 ///
1246 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1247 #[derive(Clone, Debug, PartialEq)]
1248 #[non_exhaustive]
1249 pub enum ForwardingRuleTarget {
1250 /// Forwarding rule target is unknown.
1251 Unspecified,
1252 /// Compute Engine instance for protocol forwarding.
1253 Instance,
1254 /// Load Balancer. The specific type can be found from [load_balancer_type]
1255 /// [google.cloud.networkmanagement.v1.Endpoint.load_balancer_type].
1256 LoadBalancer,
1257 /// Classic Cloud VPN Gateway.
1258 VpnGateway,
1259 /// Forwarding Rule is a Private Service Connect endpoint.
1260 Psc,
1261 /// If set, the enum was initialized with an unknown value.
1262 ///
1263 /// Applications can examine the value using [ForwardingRuleTarget::value] or
1264 /// [ForwardingRuleTarget::name].
1265 UnknownValue(forwarding_rule_target::UnknownValue),
1266 }
1267
1268 #[doc(hidden)]
1269 pub mod forwarding_rule_target {
1270 #[allow(unused_imports)]
1271 use super::*;
1272 #[derive(Clone, Debug, PartialEq)]
1273 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1274 }
1275
1276 impl ForwardingRuleTarget {
1277 /// Gets the enum value.
1278 ///
1279 /// Returns `None` if the enum contains an unknown value deserialized from
1280 /// the string representation of enums.
1281 pub fn value(&self) -> std::option::Option<i32> {
1282 match self {
1283 Self::Unspecified => std::option::Option::Some(0),
1284 Self::Instance => std::option::Option::Some(1),
1285 Self::LoadBalancer => std::option::Option::Some(2),
1286 Self::VpnGateway => std::option::Option::Some(3),
1287 Self::Psc => std::option::Option::Some(4),
1288 Self::UnknownValue(u) => u.0.value(),
1289 }
1290 }
1291
1292 /// Gets the enum value as a string.
1293 ///
1294 /// Returns `None` if the enum contains an unknown value deserialized from
1295 /// the integer representation of enums.
1296 pub fn name(&self) -> std::option::Option<&str> {
1297 match self {
1298 Self::Unspecified => {
1299 std::option::Option::Some("FORWARDING_RULE_TARGET_UNSPECIFIED")
1300 }
1301 Self::Instance => std::option::Option::Some("INSTANCE"),
1302 Self::LoadBalancer => std::option::Option::Some("LOAD_BALANCER"),
1303 Self::VpnGateway => std::option::Option::Some("VPN_GATEWAY"),
1304 Self::Psc => std::option::Option::Some("PSC"),
1305 Self::UnknownValue(u) => u.0.name(),
1306 }
1307 }
1308 }
1309
1310 impl std::default::Default for ForwardingRuleTarget {
1311 fn default() -> Self {
1312 use std::convert::From;
1313 Self::from(0)
1314 }
1315 }
1316
1317 impl std::fmt::Display for ForwardingRuleTarget {
1318 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1319 wkt::internal::display_enum(f, self.name(), self.value())
1320 }
1321 }
1322
1323 impl std::convert::From<i32> for ForwardingRuleTarget {
1324 fn from(value: i32) -> Self {
1325 match value {
1326 0 => Self::Unspecified,
1327 1 => Self::Instance,
1328 2 => Self::LoadBalancer,
1329 3 => Self::VpnGateway,
1330 4 => Self::Psc,
1331 _ => Self::UnknownValue(forwarding_rule_target::UnknownValue(
1332 wkt::internal::UnknownEnumValue::Integer(value),
1333 )),
1334 }
1335 }
1336 }
1337
1338 impl std::convert::From<&str> for ForwardingRuleTarget {
1339 fn from(value: &str) -> Self {
1340 use std::string::ToString;
1341 match value {
1342 "FORWARDING_RULE_TARGET_UNSPECIFIED" => Self::Unspecified,
1343 "INSTANCE" => Self::Instance,
1344 "LOAD_BALANCER" => Self::LoadBalancer,
1345 "VPN_GATEWAY" => Self::VpnGateway,
1346 "PSC" => Self::Psc,
1347 _ => Self::UnknownValue(forwarding_rule_target::UnknownValue(
1348 wkt::internal::UnknownEnumValue::String(value.to_string()),
1349 )),
1350 }
1351 }
1352 }
1353
1354 impl serde::ser::Serialize for ForwardingRuleTarget {
1355 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1356 where
1357 S: serde::Serializer,
1358 {
1359 match self {
1360 Self::Unspecified => serializer.serialize_i32(0),
1361 Self::Instance => serializer.serialize_i32(1),
1362 Self::LoadBalancer => serializer.serialize_i32(2),
1363 Self::VpnGateway => serializer.serialize_i32(3),
1364 Self::Psc => serializer.serialize_i32(4),
1365 Self::UnknownValue(u) => u.0.serialize(serializer),
1366 }
1367 }
1368 }
1369
1370 impl<'de> serde::de::Deserialize<'de> for ForwardingRuleTarget {
1371 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1372 where
1373 D: serde::Deserializer<'de>,
1374 {
1375 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ForwardingRuleTarget>::new(
1376 ".google.cloud.networkmanagement.v1.Endpoint.ForwardingRuleTarget",
1377 ))
1378 }
1379 }
1380}
1381
1382/// Results of the configuration analysis from the last run of the test.
1383#[derive(Clone, Default, PartialEq)]
1384#[non_exhaustive]
1385pub struct ReachabilityDetails {
1386 /// The overall result of the test's configuration analysis.
1387 pub result: crate::model::reachability_details::Result,
1388
1389 /// The time of the configuration analysis.
1390 pub verify_time: std::option::Option<wkt::Timestamp>,
1391
1392 /// The details of a failure or a cancellation of reachability analysis.
1393 pub error: std::option::Option<rpc::model::Status>,
1394
1395 /// Result may contain a list of traces if a test has multiple possible
1396 /// paths in the network, such as when destination endpoint is a load balancer
1397 /// with multiple backends.
1398 pub traces: std::vec::Vec<crate::model::Trace>,
1399
1400 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1401}
1402
1403impl ReachabilityDetails {
1404 pub fn new() -> Self {
1405 std::default::Default::default()
1406 }
1407
1408 /// Sets the value of [result][crate::model::ReachabilityDetails::result].
1409 ///
1410 /// # Example
1411 /// ```ignore,no_run
1412 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1413 /// use google_cloud_networkmanagement_v1::model::reachability_details::Result;
1414 /// let x0 = ReachabilityDetails::new().set_result(Result::Reachable);
1415 /// let x1 = ReachabilityDetails::new().set_result(Result::Unreachable);
1416 /// let x2 = ReachabilityDetails::new().set_result(Result::Ambiguous);
1417 /// ```
1418 pub fn set_result<T: std::convert::Into<crate::model::reachability_details::Result>>(
1419 mut self,
1420 v: T,
1421 ) -> Self {
1422 self.result = v.into();
1423 self
1424 }
1425
1426 /// Sets the value of [verify_time][crate::model::ReachabilityDetails::verify_time].
1427 ///
1428 /// # Example
1429 /// ```ignore,no_run
1430 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1431 /// use wkt::Timestamp;
1432 /// let x = ReachabilityDetails::new().set_verify_time(Timestamp::default()/* use setters */);
1433 /// ```
1434 pub fn set_verify_time<T>(mut self, v: T) -> Self
1435 where
1436 T: std::convert::Into<wkt::Timestamp>,
1437 {
1438 self.verify_time = std::option::Option::Some(v.into());
1439 self
1440 }
1441
1442 /// Sets or clears the value of [verify_time][crate::model::ReachabilityDetails::verify_time].
1443 ///
1444 /// # Example
1445 /// ```ignore,no_run
1446 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1447 /// use wkt::Timestamp;
1448 /// let x = ReachabilityDetails::new().set_or_clear_verify_time(Some(Timestamp::default()/* use setters */));
1449 /// let x = ReachabilityDetails::new().set_or_clear_verify_time(None::<Timestamp>);
1450 /// ```
1451 pub fn set_or_clear_verify_time<T>(mut self, v: std::option::Option<T>) -> Self
1452 where
1453 T: std::convert::Into<wkt::Timestamp>,
1454 {
1455 self.verify_time = v.map(|x| x.into());
1456 self
1457 }
1458
1459 /// Sets the value of [error][crate::model::ReachabilityDetails::error].
1460 ///
1461 /// # Example
1462 /// ```ignore,no_run
1463 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1464 /// use rpc::model::Status;
1465 /// let x = ReachabilityDetails::new().set_error(Status::default()/* use setters */);
1466 /// ```
1467 pub fn set_error<T>(mut self, v: T) -> Self
1468 where
1469 T: std::convert::Into<rpc::model::Status>,
1470 {
1471 self.error = std::option::Option::Some(v.into());
1472 self
1473 }
1474
1475 /// Sets or clears the value of [error][crate::model::ReachabilityDetails::error].
1476 ///
1477 /// # Example
1478 /// ```ignore,no_run
1479 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1480 /// use rpc::model::Status;
1481 /// let x = ReachabilityDetails::new().set_or_clear_error(Some(Status::default()/* use setters */));
1482 /// let x = ReachabilityDetails::new().set_or_clear_error(None::<Status>);
1483 /// ```
1484 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1485 where
1486 T: std::convert::Into<rpc::model::Status>,
1487 {
1488 self.error = v.map(|x| x.into());
1489 self
1490 }
1491
1492 /// Sets the value of [traces][crate::model::ReachabilityDetails::traces].
1493 ///
1494 /// # Example
1495 /// ```ignore,no_run
1496 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1497 /// use google_cloud_networkmanagement_v1::model::Trace;
1498 /// let x = ReachabilityDetails::new()
1499 /// .set_traces([
1500 /// Trace::default()/* use setters */,
1501 /// Trace::default()/* use (different) setters */,
1502 /// ]);
1503 /// ```
1504 pub fn set_traces<T, V>(mut self, v: T) -> Self
1505 where
1506 T: std::iter::IntoIterator<Item = V>,
1507 V: std::convert::Into<crate::model::Trace>,
1508 {
1509 use std::iter::Iterator;
1510 self.traces = v.into_iter().map(|i| i.into()).collect();
1511 self
1512 }
1513}
1514
1515impl wkt::message::Message for ReachabilityDetails {
1516 fn typename() -> &'static str {
1517 "type.googleapis.com/google.cloud.networkmanagement.v1.ReachabilityDetails"
1518 }
1519}
1520
1521/// Defines additional types related to [ReachabilityDetails].
1522pub mod reachability_details {
1523 #[allow(unused_imports)]
1524 use super::*;
1525
1526 /// The overall result of the test's configuration analysis.
1527 ///
1528 /// # Working with unknown values
1529 ///
1530 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1531 /// additional enum variants at any time. Adding new variants is not considered
1532 /// a breaking change. Applications should write their code in anticipation of:
1533 ///
1534 /// - New values appearing in future releases of the client library, **and**
1535 /// - New values received dynamically, without application changes.
1536 ///
1537 /// Please consult the [Working with enums] section in the user guide for some
1538 /// guidelines.
1539 ///
1540 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1541 #[derive(Clone, Debug, PartialEq)]
1542 #[non_exhaustive]
1543 pub enum Result {
1544 /// No result was specified.
1545 Unspecified,
1546 /// Possible scenarios are:
1547 ///
1548 /// * The configuration analysis determined that a packet originating from
1549 /// the source is expected to reach the destination.
1550 /// * The analysis didn't complete because the user lacks permission for
1551 /// some of the resources in the trace. However, at the time the user's
1552 /// permission became insufficient, the trace had been successful so far.
1553 Reachable,
1554 /// A packet originating from the source is expected to be dropped before
1555 /// reaching the destination.
1556 Unreachable,
1557 /// The source and destination endpoints do not uniquely identify
1558 /// the test location in the network, and the reachability result contains
1559 /// multiple traces. For some traces, a packet could be delivered, and for
1560 /// others, it would not be. This result is also assigned to
1561 /// configuration analysis of return path if on its own it should be
1562 /// REACHABLE, but configuration analysis of forward path is AMBIGUOUS.
1563 Ambiguous,
1564 /// The configuration analysis did not complete. Possible reasons are:
1565 ///
1566 /// * A permissions error occurred--for example, the user might not have
1567 /// read permission for all of the resources named in the test.
1568 /// * An internal error occurred.
1569 /// * The analyzer received an invalid or unsupported argument or was unable
1570 /// to identify a known endpoint.
1571 Undetermined,
1572 /// If set, the enum was initialized with an unknown value.
1573 ///
1574 /// Applications can examine the value using [Result::value] or
1575 /// [Result::name].
1576 UnknownValue(result::UnknownValue),
1577 }
1578
1579 #[doc(hidden)]
1580 pub mod result {
1581 #[allow(unused_imports)]
1582 use super::*;
1583 #[derive(Clone, Debug, PartialEq)]
1584 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1585 }
1586
1587 impl Result {
1588 /// Gets the enum value.
1589 ///
1590 /// Returns `None` if the enum contains an unknown value deserialized from
1591 /// the string representation of enums.
1592 pub fn value(&self) -> std::option::Option<i32> {
1593 match self {
1594 Self::Unspecified => std::option::Option::Some(0),
1595 Self::Reachable => std::option::Option::Some(1),
1596 Self::Unreachable => std::option::Option::Some(2),
1597 Self::Ambiguous => std::option::Option::Some(4),
1598 Self::Undetermined => std::option::Option::Some(5),
1599 Self::UnknownValue(u) => u.0.value(),
1600 }
1601 }
1602
1603 /// Gets the enum value as a string.
1604 ///
1605 /// Returns `None` if the enum contains an unknown value deserialized from
1606 /// the integer representation of enums.
1607 pub fn name(&self) -> std::option::Option<&str> {
1608 match self {
1609 Self::Unspecified => std::option::Option::Some("RESULT_UNSPECIFIED"),
1610 Self::Reachable => std::option::Option::Some("REACHABLE"),
1611 Self::Unreachable => std::option::Option::Some("UNREACHABLE"),
1612 Self::Ambiguous => std::option::Option::Some("AMBIGUOUS"),
1613 Self::Undetermined => std::option::Option::Some("UNDETERMINED"),
1614 Self::UnknownValue(u) => u.0.name(),
1615 }
1616 }
1617 }
1618
1619 impl std::default::Default for Result {
1620 fn default() -> Self {
1621 use std::convert::From;
1622 Self::from(0)
1623 }
1624 }
1625
1626 impl std::fmt::Display for Result {
1627 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1628 wkt::internal::display_enum(f, self.name(), self.value())
1629 }
1630 }
1631
1632 impl std::convert::From<i32> for Result {
1633 fn from(value: i32) -> Self {
1634 match value {
1635 0 => Self::Unspecified,
1636 1 => Self::Reachable,
1637 2 => Self::Unreachable,
1638 4 => Self::Ambiguous,
1639 5 => Self::Undetermined,
1640 _ => Self::UnknownValue(result::UnknownValue(
1641 wkt::internal::UnknownEnumValue::Integer(value),
1642 )),
1643 }
1644 }
1645 }
1646
1647 impl std::convert::From<&str> for Result {
1648 fn from(value: &str) -> Self {
1649 use std::string::ToString;
1650 match value {
1651 "RESULT_UNSPECIFIED" => Self::Unspecified,
1652 "REACHABLE" => Self::Reachable,
1653 "UNREACHABLE" => Self::Unreachable,
1654 "AMBIGUOUS" => Self::Ambiguous,
1655 "UNDETERMINED" => Self::Undetermined,
1656 _ => Self::UnknownValue(result::UnknownValue(
1657 wkt::internal::UnknownEnumValue::String(value.to_string()),
1658 )),
1659 }
1660 }
1661 }
1662
1663 impl serde::ser::Serialize for Result {
1664 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1665 where
1666 S: serde::Serializer,
1667 {
1668 match self {
1669 Self::Unspecified => serializer.serialize_i32(0),
1670 Self::Reachable => serializer.serialize_i32(1),
1671 Self::Unreachable => serializer.serialize_i32(2),
1672 Self::Ambiguous => serializer.serialize_i32(4),
1673 Self::Undetermined => serializer.serialize_i32(5),
1674 Self::UnknownValue(u) => u.0.serialize(serializer),
1675 }
1676 }
1677 }
1678
1679 impl<'de> serde::de::Deserialize<'de> for Result {
1680 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1681 where
1682 D: serde::Deserializer<'de>,
1683 {
1684 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Result>::new(
1685 ".google.cloud.networkmanagement.v1.ReachabilityDetails.Result",
1686 ))
1687 }
1688 }
1689}
1690
1691/// Latency percentile rank and value.
1692#[derive(Clone, Default, PartialEq)]
1693#[non_exhaustive]
1694pub struct LatencyPercentile {
1695 /// Percentage of samples this data point applies to.
1696 pub percent: i32,
1697
1698 /// percent-th percentile of latency observed, in microseconds.
1699 /// Fraction of percent/100 of samples have latency lower or
1700 /// equal to the value of this field.
1701 pub latency_micros: i64,
1702
1703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1704}
1705
1706impl LatencyPercentile {
1707 pub fn new() -> Self {
1708 std::default::Default::default()
1709 }
1710
1711 /// Sets the value of [percent][crate::model::LatencyPercentile::percent].
1712 ///
1713 /// # Example
1714 /// ```ignore,no_run
1715 /// # use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1716 /// let x = LatencyPercentile::new().set_percent(42);
1717 /// ```
1718 pub fn set_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1719 self.percent = v.into();
1720 self
1721 }
1722
1723 /// Sets the value of [latency_micros][crate::model::LatencyPercentile::latency_micros].
1724 ///
1725 /// # Example
1726 /// ```ignore,no_run
1727 /// # use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1728 /// let x = LatencyPercentile::new().set_latency_micros(42);
1729 /// ```
1730 pub fn set_latency_micros<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1731 self.latency_micros = v.into();
1732 self
1733 }
1734}
1735
1736impl wkt::message::Message for LatencyPercentile {
1737 fn typename() -> &'static str {
1738 "type.googleapis.com/google.cloud.networkmanagement.v1.LatencyPercentile"
1739 }
1740}
1741
1742/// Describes measured latency distribution.
1743#[derive(Clone, Default, PartialEq)]
1744#[non_exhaustive]
1745pub struct LatencyDistribution {
1746 /// Representative latency percentiles.
1747 pub latency_percentiles: std::vec::Vec<crate::model::LatencyPercentile>,
1748
1749 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1750}
1751
1752impl LatencyDistribution {
1753 pub fn new() -> Self {
1754 std::default::Default::default()
1755 }
1756
1757 /// Sets the value of [latency_percentiles][crate::model::LatencyDistribution::latency_percentiles].
1758 ///
1759 /// # Example
1760 /// ```ignore,no_run
1761 /// # use google_cloud_networkmanagement_v1::model::LatencyDistribution;
1762 /// use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1763 /// let x = LatencyDistribution::new()
1764 /// .set_latency_percentiles([
1765 /// LatencyPercentile::default()/* use setters */,
1766 /// LatencyPercentile::default()/* use (different) setters */,
1767 /// ]);
1768 /// ```
1769 pub fn set_latency_percentiles<T, V>(mut self, v: T) -> Self
1770 where
1771 T: std::iter::IntoIterator<Item = V>,
1772 V: std::convert::Into<crate::model::LatencyPercentile>,
1773 {
1774 use std::iter::Iterator;
1775 self.latency_percentiles = v.into_iter().map(|i| i.into()).collect();
1776 self
1777 }
1778}
1779
1780impl wkt::message::Message for LatencyDistribution {
1781 fn typename() -> &'static str {
1782 "type.googleapis.com/google.cloud.networkmanagement.v1.LatencyDistribution"
1783 }
1784}
1785
1786/// Results of active probing from the last run of the test.
1787#[derive(Clone, Default, PartialEq)]
1788#[non_exhaustive]
1789pub struct ProbingDetails {
1790 /// The overall result of active probing.
1791 pub result: crate::model::probing_details::ProbingResult,
1792
1793 /// The time that reachability was assessed through active probing.
1794 pub verify_time: std::option::Option<wkt::Timestamp>,
1795
1796 /// Details about an internal failure or the cancellation of active probing.
1797 pub error: std::option::Option<rpc::model::Status>,
1798
1799 /// The reason probing was aborted.
1800 pub abort_cause: crate::model::probing_details::ProbingAbortCause,
1801
1802 /// Number of probes sent.
1803 pub sent_probe_count: i32,
1804
1805 /// Number of probes that reached the destination.
1806 pub successful_probe_count: i32,
1807
1808 /// The source and destination endpoints derived from the test input and used
1809 /// for active probing.
1810 pub endpoint_info: std::option::Option<crate::model::EndpointInfo>,
1811
1812 /// Latency as measured by active probing in one direction:
1813 /// from the source to the destination endpoint.
1814 pub probing_latency: std::option::Option<crate::model::LatencyDistribution>,
1815
1816 /// The EdgeLocation from which a packet, destined to the internet, will egress
1817 /// the Google network.
1818 /// This will only be populated for a connectivity test which has an internet
1819 /// destination address.
1820 /// The absence of this field *must not* be used as an indication that the
1821 /// destination is part of the Google network.
1822 pub destination_egress_location:
1823 std::option::Option<crate::model::probing_details::EdgeLocation>,
1824
1825 /// Probing results for all edge devices.
1826 pub edge_responses: std::vec::Vec<crate::model::probing_details::SingleEdgeResponse>,
1827
1828 /// Whether all relevant edge devices were probed.
1829 pub probed_all_devices: bool,
1830
1831 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1832}
1833
1834impl ProbingDetails {
1835 pub fn new() -> Self {
1836 std::default::Default::default()
1837 }
1838
1839 /// Sets the value of [result][crate::model::ProbingDetails::result].
1840 ///
1841 /// # Example
1842 /// ```ignore,no_run
1843 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1844 /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingResult;
1845 /// let x0 = ProbingDetails::new().set_result(ProbingResult::Reachable);
1846 /// let x1 = ProbingDetails::new().set_result(ProbingResult::Unreachable);
1847 /// let x2 = ProbingDetails::new().set_result(ProbingResult::ReachabilityInconsistent);
1848 /// ```
1849 pub fn set_result<T: std::convert::Into<crate::model::probing_details::ProbingResult>>(
1850 mut self,
1851 v: T,
1852 ) -> Self {
1853 self.result = v.into();
1854 self
1855 }
1856
1857 /// Sets the value of [verify_time][crate::model::ProbingDetails::verify_time].
1858 ///
1859 /// # Example
1860 /// ```ignore,no_run
1861 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1862 /// use wkt::Timestamp;
1863 /// let x = ProbingDetails::new().set_verify_time(Timestamp::default()/* use setters */);
1864 /// ```
1865 pub fn set_verify_time<T>(mut self, v: T) -> Self
1866 where
1867 T: std::convert::Into<wkt::Timestamp>,
1868 {
1869 self.verify_time = std::option::Option::Some(v.into());
1870 self
1871 }
1872
1873 /// Sets or clears the value of [verify_time][crate::model::ProbingDetails::verify_time].
1874 ///
1875 /// # Example
1876 /// ```ignore,no_run
1877 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1878 /// use wkt::Timestamp;
1879 /// let x = ProbingDetails::new().set_or_clear_verify_time(Some(Timestamp::default()/* use setters */));
1880 /// let x = ProbingDetails::new().set_or_clear_verify_time(None::<Timestamp>);
1881 /// ```
1882 pub fn set_or_clear_verify_time<T>(mut self, v: std::option::Option<T>) -> Self
1883 where
1884 T: std::convert::Into<wkt::Timestamp>,
1885 {
1886 self.verify_time = v.map(|x| x.into());
1887 self
1888 }
1889
1890 /// Sets the value of [error][crate::model::ProbingDetails::error].
1891 ///
1892 /// # Example
1893 /// ```ignore,no_run
1894 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1895 /// use rpc::model::Status;
1896 /// let x = ProbingDetails::new().set_error(Status::default()/* use setters */);
1897 /// ```
1898 pub fn set_error<T>(mut self, v: T) -> Self
1899 where
1900 T: std::convert::Into<rpc::model::Status>,
1901 {
1902 self.error = std::option::Option::Some(v.into());
1903 self
1904 }
1905
1906 /// Sets or clears the value of [error][crate::model::ProbingDetails::error].
1907 ///
1908 /// # Example
1909 /// ```ignore,no_run
1910 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1911 /// use rpc::model::Status;
1912 /// let x = ProbingDetails::new().set_or_clear_error(Some(Status::default()/* use setters */));
1913 /// let x = ProbingDetails::new().set_or_clear_error(None::<Status>);
1914 /// ```
1915 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1916 where
1917 T: std::convert::Into<rpc::model::Status>,
1918 {
1919 self.error = v.map(|x| x.into());
1920 self
1921 }
1922
1923 /// Sets the value of [abort_cause][crate::model::ProbingDetails::abort_cause].
1924 ///
1925 /// # Example
1926 /// ```ignore,no_run
1927 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1928 /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingAbortCause;
1929 /// let x0 = ProbingDetails::new().set_abort_cause(ProbingAbortCause::PermissionDenied);
1930 /// let x1 = ProbingDetails::new().set_abort_cause(ProbingAbortCause::NoSourceLocation);
1931 /// ```
1932 pub fn set_abort_cause<
1933 T: std::convert::Into<crate::model::probing_details::ProbingAbortCause>,
1934 >(
1935 mut self,
1936 v: T,
1937 ) -> Self {
1938 self.abort_cause = v.into();
1939 self
1940 }
1941
1942 /// Sets the value of [sent_probe_count][crate::model::ProbingDetails::sent_probe_count].
1943 ///
1944 /// # Example
1945 /// ```ignore,no_run
1946 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1947 /// let x = ProbingDetails::new().set_sent_probe_count(42);
1948 /// ```
1949 pub fn set_sent_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1950 self.sent_probe_count = v.into();
1951 self
1952 }
1953
1954 /// Sets the value of [successful_probe_count][crate::model::ProbingDetails::successful_probe_count].
1955 ///
1956 /// # Example
1957 /// ```ignore,no_run
1958 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1959 /// let x = ProbingDetails::new().set_successful_probe_count(42);
1960 /// ```
1961 pub fn set_successful_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1962 self.successful_probe_count = v.into();
1963 self
1964 }
1965
1966 /// Sets the value of [endpoint_info][crate::model::ProbingDetails::endpoint_info].
1967 ///
1968 /// # Example
1969 /// ```ignore,no_run
1970 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1971 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
1972 /// let x = ProbingDetails::new().set_endpoint_info(EndpointInfo::default()/* use setters */);
1973 /// ```
1974 pub fn set_endpoint_info<T>(mut self, v: T) -> Self
1975 where
1976 T: std::convert::Into<crate::model::EndpointInfo>,
1977 {
1978 self.endpoint_info = std::option::Option::Some(v.into());
1979 self
1980 }
1981
1982 /// Sets or clears the value of [endpoint_info][crate::model::ProbingDetails::endpoint_info].
1983 ///
1984 /// # Example
1985 /// ```ignore,no_run
1986 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1987 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
1988 /// let x = ProbingDetails::new().set_or_clear_endpoint_info(Some(EndpointInfo::default()/* use setters */));
1989 /// let x = ProbingDetails::new().set_or_clear_endpoint_info(None::<EndpointInfo>);
1990 /// ```
1991 pub fn set_or_clear_endpoint_info<T>(mut self, v: std::option::Option<T>) -> Self
1992 where
1993 T: std::convert::Into<crate::model::EndpointInfo>,
1994 {
1995 self.endpoint_info = v.map(|x| x.into());
1996 self
1997 }
1998
1999 /// Sets the value of [probing_latency][crate::model::ProbingDetails::probing_latency].
2000 ///
2001 /// # Example
2002 /// ```ignore,no_run
2003 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2004 /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2005 /// let x = ProbingDetails::new().set_probing_latency(LatencyDistribution::default()/* use setters */);
2006 /// ```
2007 pub fn set_probing_latency<T>(mut self, v: T) -> Self
2008 where
2009 T: std::convert::Into<crate::model::LatencyDistribution>,
2010 {
2011 self.probing_latency = std::option::Option::Some(v.into());
2012 self
2013 }
2014
2015 /// Sets or clears the value of [probing_latency][crate::model::ProbingDetails::probing_latency].
2016 ///
2017 /// # Example
2018 /// ```ignore,no_run
2019 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2020 /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2021 /// let x = ProbingDetails::new().set_or_clear_probing_latency(Some(LatencyDistribution::default()/* use setters */));
2022 /// let x = ProbingDetails::new().set_or_clear_probing_latency(None::<LatencyDistribution>);
2023 /// ```
2024 pub fn set_or_clear_probing_latency<T>(mut self, v: std::option::Option<T>) -> Self
2025 where
2026 T: std::convert::Into<crate::model::LatencyDistribution>,
2027 {
2028 self.probing_latency = v.map(|x| x.into());
2029 self
2030 }
2031
2032 /// Sets the value of [destination_egress_location][crate::model::ProbingDetails::destination_egress_location].
2033 ///
2034 /// # Example
2035 /// ```ignore,no_run
2036 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2037 /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2038 /// let x = ProbingDetails::new().set_destination_egress_location(EdgeLocation::default()/* use setters */);
2039 /// ```
2040 pub fn set_destination_egress_location<T>(mut self, v: T) -> Self
2041 where
2042 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2043 {
2044 self.destination_egress_location = std::option::Option::Some(v.into());
2045 self
2046 }
2047
2048 /// Sets or clears the value of [destination_egress_location][crate::model::ProbingDetails::destination_egress_location].
2049 ///
2050 /// # Example
2051 /// ```ignore,no_run
2052 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2053 /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2054 /// let x = ProbingDetails::new().set_or_clear_destination_egress_location(Some(EdgeLocation::default()/* use setters */));
2055 /// let x = ProbingDetails::new().set_or_clear_destination_egress_location(None::<EdgeLocation>);
2056 /// ```
2057 pub fn set_or_clear_destination_egress_location<T>(mut self, v: std::option::Option<T>) -> Self
2058 where
2059 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2060 {
2061 self.destination_egress_location = v.map(|x| x.into());
2062 self
2063 }
2064
2065 /// Sets the value of [edge_responses][crate::model::ProbingDetails::edge_responses].
2066 ///
2067 /// # Example
2068 /// ```ignore,no_run
2069 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2070 /// use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2071 /// let x = ProbingDetails::new()
2072 /// .set_edge_responses([
2073 /// SingleEdgeResponse::default()/* use setters */,
2074 /// SingleEdgeResponse::default()/* use (different) setters */,
2075 /// ]);
2076 /// ```
2077 pub fn set_edge_responses<T, V>(mut self, v: T) -> Self
2078 where
2079 T: std::iter::IntoIterator<Item = V>,
2080 V: std::convert::Into<crate::model::probing_details::SingleEdgeResponse>,
2081 {
2082 use std::iter::Iterator;
2083 self.edge_responses = v.into_iter().map(|i| i.into()).collect();
2084 self
2085 }
2086
2087 /// Sets the value of [probed_all_devices][crate::model::ProbingDetails::probed_all_devices].
2088 ///
2089 /// # Example
2090 /// ```ignore,no_run
2091 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2092 /// let x = ProbingDetails::new().set_probed_all_devices(true);
2093 /// ```
2094 pub fn set_probed_all_devices<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2095 self.probed_all_devices = v.into();
2096 self
2097 }
2098}
2099
2100impl wkt::message::Message for ProbingDetails {
2101 fn typename() -> &'static str {
2102 "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails"
2103 }
2104}
2105
2106/// Defines additional types related to [ProbingDetails].
2107pub mod probing_details {
2108 #[allow(unused_imports)]
2109 use super::*;
2110
2111 /// Representation of a network edge location as per
2112 /// <https://cloud.google.com/vpc/docs/edge-locations>.
2113 #[derive(Clone, Default, PartialEq)]
2114 #[non_exhaustive]
2115 pub struct EdgeLocation {
2116 /// Name of the metropolitan area.
2117 pub metropolitan_area: std::string::String,
2118
2119 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2120 }
2121
2122 impl EdgeLocation {
2123 pub fn new() -> Self {
2124 std::default::Default::default()
2125 }
2126
2127 /// Sets the value of [metropolitan_area][crate::model::probing_details::EdgeLocation::metropolitan_area].
2128 ///
2129 /// # Example
2130 /// ```ignore,no_run
2131 /// # use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2132 /// let x = EdgeLocation::new().set_metropolitan_area("example");
2133 /// ```
2134 pub fn set_metropolitan_area<T: std::convert::Into<std::string::String>>(
2135 mut self,
2136 v: T,
2137 ) -> Self {
2138 self.metropolitan_area = v.into();
2139 self
2140 }
2141 }
2142
2143 impl wkt::message::Message for EdgeLocation {
2144 fn typename() -> &'static str {
2145 "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails.EdgeLocation"
2146 }
2147 }
2148
2149 /// Probing results for a single edge device.
2150 #[derive(Clone, Default, PartialEq)]
2151 #[non_exhaustive]
2152 pub struct SingleEdgeResponse {
2153 /// The overall result of active probing for this egress device.
2154 pub result: crate::model::probing_details::ProbingResult,
2155
2156 /// Number of probes sent.
2157 pub sent_probe_count: i32,
2158
2159 /// Number of probes that reached the destination.
2160 pub successful_probe_count: i32,
2161
2162 /// Latency as measured by active probing in one direction: from the source
2163 /// to the destination endpoint.
2164 pub probing_latency: std::option::Option<crate::model::LatencyDistribution>,
2165
2166 /// The EdgeLocation from which a packet, destined to the internet, will
2167 /// egress the Google network.
2168 /// This will only be populated for a connectivity test which has an internet
2169 /// destination address.
2170 /// The absence of this field *must not* be used as an indication that the
2171 /// destination is part of the Google network.
2172 pub destination_egress_location:
2173 std::option::Option<crate::model::probing_details::EdgeLocation>,
2174
2175 /// Router name in the format '{router}.{metroshard}'. For example:
2176 /// pf01.aaa01, pr02.aaa01.
2177 pub destination_router: std::string::String,
2178
2179 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2180 }
2181
2182 impl SingleEdgeResponse {
2183 pub fn new() -> Self {
2184 std::default::Default::default()
2185 }
2186
2187 /// Sets the value of [result][crate::model::probing_details::SingleEdgeResponse::result].
2188 ///
2189 /// # Example
2190 /// ```ignore,no_run
2191 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2192 /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingResult;
2193 /// let x0 = SingleEdgeResponse::new().set_result(ProbingResult::Reachable);
2194 /// let x1 = SingleEdgeResponse::new().set_result(ProbingResult::Unreachable);
2195 /// let x2 = SingleEdgeResponse::new().set_result(ProbingResult::ReachabilityInconsistent);
2196 /// ```
2197 pub fn set_result<T: std::convert::Into<crate::model::probing_details::ProbingResult>>(
2198 mut self,
2199 v: T,
2200 ) -> Self {
2201 self.result = v.into();
2202 self
2203 }
2204
2205 /// Sets the value of [sent_probe_count][crate::model::probing_details::SingleEdgeResponse::sent_probe_count].
2206 ///
2207 /// # Example
2208 /// ```ignore,no_run
2209 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2210 /// let x = SingleEdgeResponse::new().set_sent_probe_count(42);
2211 /// ```
2212 pub fn set_sent_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2213 self.sent_probe_count = v.into();
2214 self
2215 }
2216
2217 /// Sets the value of [successful_probe_count][crate::model::probing_details::SingleEdgeResponse::successful_probe_count].
2218 ///
2219 /// # Example
2220 /// ```ignore,no_run
2221 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2222 /// let x = SingleEdgeResponse::new().set_successful_probe_count(42);
2223 /// ```
2224 pub fn set_successful_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2225 self.successful_probe_count = v.into();
2226 self
2227 }
2228
2229 /// Sets the value of [probing_latency][crate::model::probing_details::SingleEdgeResponse::probing_latency].
2230 ///
2231 /// # Example
2232 /// ```ignore,no_run
2233 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2234 /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2235 /// let x = SingleEdgeResponse::new().set_probing_latency(LatencyDistribution::default()/* use setters */);
2236 /// ```
2237 pub fn set_probing_latency<T>(mut self, v: T) -> Self
2238 where
2239 T: std::convert::Into<crate::model::LatencyDistribution>,
2240 {
2241 self.probing_latency = std::option::Option::Some(v.into());
2242 self
2243 }
2244
2245 /// Sets or clears the value of [probing_latency][crate::model::probing_details::SingleEdgeResponse::probing_latency].
2246 ///
2247 /// # Example
2248 /// ```ignore,no_run
2249 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2250 /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2251 /// let x = SingleEdgeResponse::new().set_or_clear_probing_latency(Some(LatencyDistribution::default()/* use setters */));
2252 /// let x = SingleEdgeResponse::new().set_or_clear_probing_latency(None::<LatencyDistribution>);
2253 /// ```
2254 pub fn set_or_clear_probing_latency<T>(mut self, v: std::option::Option<T>) -> Self
2255 where
2256 T: std::convert::Into<crate::model::LatencyDistribution>,
2257 {
2258 self.probing_latency = v.map(|x| x.into());
2259 self
2260 }
2261
2262 /// Sets the value of [destination_egress_location][crate::model::probing_details::SingleEdgeResponse::destination_egress_location].
2263 ///
2264 /// # Example
2265 /// ```ignore,no_run
2266 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2267 /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2268 /// let x = SingleEdgeResponse::new().set_destination_egress_location(EdgeLocation::default()/* use setters */);
2269 /// ```
2270 pub fn set_destination_egress_location<T>(mut self, v: T) -> Self
2271 where
2272 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2273 {
2274 self.destination_egress_location = std::option::Option::Some(v.into());
2275 self
2276 }
2277
2278 /// Sets or clears the value of [destination_egress_location][crate::model::probing_details::SingleEdgeResponse::destination_egress_location].
2279 ///
2280 /// # Example
2281 /// ```ignore,no_run
2282 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2283 /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2284 /// let x = SingleEdgeResponse::new().set_or_clear_destination_egress_location(Some(EdgeLocation::default()/* use setters */));
2285 /// let x = SingleEdgeResponse::new().set_or_clear_destination_egress_location(None::<EdgeLocation>);
2286 /// ```
2287 pub fn set_or_clear_destination_egress_location<T>(
2288 mut self,
2289 v: std::option::Option<T>,
2290 ) -> Self
2291 where
2292 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2293 {
2294 self.destination_egress_location = v.map(|x| x.into());
2295 self
2296 }
2297
2298 /// Sets the value of [destination_router][crate::model::probing_details::SingleEdgeResponse::destination_router].
2299 ///
2300 /// # Example
2301 /// ```ignore,no_run
2302 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2303 /// let x = SingleEdgeResponse::new().set_destination_router("example");
2304 /// ```
2305 pub fn set_destination_router<T: std::convert::Into<std::string::String>>(
2306 mut self,
2307 v: T,
2308 ) -> Self {
2309 self.destination_router = v.into();
2310 self
2311 }
2312 }
2313
2314 impl wkt::message::Message for SingleEdgeResponse {
2315 fn typename() -> &'static str {
2316 "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails.SingleEdgeResponse"
2317 }
2318 }
2319
2320 /// Overall probing result of the test.
2321 ///
2322 /// # Working with unknown values
2323 ///
2324 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2325 /// additional enum variants at any time. Adding new variants is not considered
2326 /// a breaking change. Applications should write their code in anticipation of:
2327 ///
2328 /// - New values appearing in future releases of the client library, **and**
2329 /// - New values received dynamically, without application changes.
2330 ///
2331 /// Please consult the [Working with enums] section in the user guide for some
2332 /// guidelines.
2333 ///
2334 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2335 #[derive(Clone, Debug, PartialEq)]
2336 #[non_exhaustive]
2337 pub enum ProbingResult {
2338 /// No result was specified.
2339 Unspecified,
2340 /// At least 95% of packets reached the destination.
2341 Reachable,
2342 /// No packets reached the destination.
2343 Unreachable,
2344 /// Less than 95% of packets reached the destination.
2345 ReachabilityInconsistent,
2346 /// Reachability could not be determined. Possible reasons are:
2347 ///
2348 /// * The user lacks permission to access some of the network resources
2349 /// required to run the test.
2350 /// * No valid source endpoint could be derived from the request.
2351 /// * An internal error occurred.
2352 Undetermined,
2353 /// If set, the enum was initialized with an unknown value.
2354 ///
2355 /// Applications can examine the value using [ProbingResult::value] or
2356 /// [ProbingResult::name].
2357 UnknownValue(probing_result::UnknownValue),
2358 }
2359
2360 #[doc(hidden)]
2361 pub mod probing_result {
2362 #[allow(unused_imports)]
2363 use super::*;
2364 #[derive(Clone, Debug, PartialEq)]
2365 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2366 }
2367
2368 impl ProbingResult {
2369 /// Gets the enum value.
2370 ///
2371 /// Returns `None` if the enum contains an unknown value deserialized from
2372 /// the string representation of enums.
2373 pub fn value(&self) -> std::option::Option<i32> {
2374 match self {
2375 Self::Unspecified => std::option::Option::Some(0),
2376 Self::Reachable => std::option::Option::Some(1),
2377 Self::Unreachable => std::option::Option::Some(2),
2378 Self::ReachabilityInconsistent => std::option::Option::Some(3),
2379 Self::Undetermined => std::option::Option::Some(4),
2380 Self::UnknownValue(u) => u.0.value(),
2381 }
2382 }
2383
2384 /// Gets the enum value as a string.
2385 ///
2386 /// Returns `None` if the enum contains an unknown value deserialized from
2387 /// the integer representation of enums.
2388 pub fn name(&self) -> std::option::Option<&str> {
2389 match self {
2390 Self::Unspecified => std::option::Option::Some("PROBING_RESULT_UNSPECIFIED"),
2391 Self::Reachable => std::option::Option::Some("REACHABLE"),
2392 Self::Unreachable => std::option::Option::Some("UNREACHABLE"),
2393 Self::ReachabilityInconsistent => {
2394 std::option::Option::Some("REACHABILITY_INCONSISTENT")
2395 }
2396 Self::Undetermined => std::option::Option::Some("UNDETERMINED"),
2397 Self::UnknownValue(u) => u.0.name(),
2398 }
2399 }
2400 }
2401
2402 impl std::default::Default for ProbingResult {
2403 fn default() -> Self {
2404 use std::convert::From;
2405 Self::from(0)
2406 }
2407 }
2408
2409 impl std::fmt::Display for ProbingResult {
2410 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2411 wkt::internal::display_enum(f, self.name(), self.value())
2412 }
2413 }
2414
2415 impl std::convert::From<i32> for ProbingResult {
2416 fn from(value: i32) -> Self {
2417 match value {
2418 0 => Self::Unspecified,
2419 1 => Self::Reachable,
2420 2 => Self::Unreachable,
2421 3 => Self::ReachabilityInconsistent,
2422 4 => Self::Undetermined,
2423 _ => Self::UnknownValue(probing_result::UnknownValue(
2424 wkt::internal::UnknownEnumValue::Integer(value),
2425 )),
2426 }
2427 }
2428 }
2429
2430 impl std::convert::From<&str> for ProbingResult {
2431 fn from(value: &str) -> Self {
2432 use std::string::ToString;
2433 match value {
2434 "PROBING_RESULT_UNSPECIFIED" => Self::Unspecified,
2435 "REACHABLE" => Self::Reachable,
2436 "UNREACHABLE" => Self::Unreachable,
2437 "REACHABILITY_INCONSISTENT" => Self::ReachabilityInconsistent,
2438 "UNDETERMINED" => Self::Undetermined,
2439 _ => Self::UnknownValue(probing_result::UnknownValue(
2440 wkt::internal::UnknownEnumValue::String(value.to_string()),
2441 )),
2442 }
2443 }
2444 }
2445
2446 impl serde::ser::Serialize for ProbingResult {
2447 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2448 where
2449 S: serde::Serializer,
2450 {
2451 match self {
2452 Self::Unspecified => serializer.serialize_i32(0),
2453 Self::Reachable => serializer.serialize_i32(1),
2454 Self::Unreachable => serializer.serialize_i32(2),
2455 Self::ReachabilityInconsistent => serializer.serialize_i32(3),
2456 Self::Undetermined => serializer.serialize_i32(4),
2457 Self::UnknownValue(u) => u.0.serialize(serializer),
2458 }
2459 }
2460 }
2461
2462 impl<'de> serde::de::Deserialize<'de> for ProbingResult {
2463 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2464 where
2465 D: serde::Deserializer<'de>,
2466 {
2467 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProbingResult>::new(
2468 ".google.cloud.networkmanagement.v1.ProbingDetails.ProbingResult",
2469 ))
2470 }
2471 }
2472
2473 /// Abort cause types.
2474 ///
2475 /// # Working with unknown values
2476 ///
2477 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2478 /// additional enum variants at any time. Adding new variants is not considered
2479 /// a breaking change. Applications should write their code in anticipation of:
2480 ///
2481 /// - New values appearing in future releases of the client library, **and**
2482 /// - New values received dynamically, without application changes.
2483 ///
2484 /// Please consult the [Working with enums] section in the user guide for some
2485 /// guidelines.
2486 ///
2487 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2488 #[derive(Clone, Debug, PartialEq)]
2489 #[non_exhaustive]
2490 pub enum ProbingAbortCause {
2491 /// No reason was specified.
2492 Unspecified,
2493 /// The user lacks permission to access some of the
2494 /// network resources required to run the test.
2495 PermissionDenied,
2496 /// No valid source endpoint could be derived from the request.
2497 NoSourceLocation,
2498 /// If set, the enum was initialized with an unknown value.
2499 ///
2500 /// Applications can examine the value using [ProbingAbortCause::value] or
2501 /// [ProbingAbortCause::name].
2502 UnknownValue(probing_abort_cause::UnknownValue),
2503 }
2504
2505 #[doc(hidden)]
2506 pub mod probing_abort_cause {
2507 #[allow(unused_imports)]
2508 use super::*;
2509 #[derive(Clone, Debug, PartialEq)]
2510 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2511 }
2512
2513 impl ProbingAbortCause {
2514 /// Gets the enum value.
2515 ///
2516 /// Returns `None` if the enum contains an unknown value deserialized from
2517 /// the string representation of enums.
2518 pub fn value(&self) -> std::option::Option<i32> {
2519 match self {
2520 Self::Unspecified => std::option::Option::Some(0),
2521 Self::PermissionDenied => std::option::Option::Some(1),
2522 Self::NoSourceLocation => std::option::Option::Some(2),
2523 Self::UnknownValue(u) => u.0.value(),
2524 }
2525 }
2526
2527 /// Gets the enum value as a string.
2528 ///
2529 /// Returns `None` if the enum contains an unknown value deserialized from
2530 /// the integer representation of enums.
2531 pub fn name(&self) -> std::option::Option<&str> {
2532 match self {
2533 Self::Unspecified => std::option::Option::Some("PROBING_ABORT_CAUSE_UNSPECIFIED"),
2534 Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
2535 Self::NoSourceLocation => std::option::Option::Some("NO_SOURCE_LOCATION"),
2536 Self::UnknownValue(u) => u.0.name(),
2537 }
2538 }
2539 }
2540
2541 impl std::default::Default for ProbingAbortCause {
2542 fn default() -> Self {
2543 use std::convert::From;
2544 Self::from(0)
2545 }
2546 }
2547
2548 impl std::fmt::Display for ProbingAbortCause {
2549 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2550 wkt::internal::display_enum(f, self.name(), self.value())
2551 }
2552 }
2553
2554 impl std::convert::From<i32> for ProbingAbortCause {
2555 fn from(value: i32) -> Self {
2556 match value {
2557 0 => Self::Unspecified,
2558 1 => Self::PermissionDenied,
2559 2 => Self::NoSourceLocation,
2560 _ => Self::UnknownValue(probing_abort_cause::UnknownValue(
2561 wkt::internal::UnknownEnumValue::Integer(value),
2562 )),
2563 }
2564 }
2565 }
2566
2567 impl std::convert::From<&str> for ProbingAbortCause {
2568 fn from(value: &str) -> Self {
2569 use std::string::ToString;
2570 match value {
2571 "PROBING_ABORT_CAUSE_UNSPECIFIED" => Self::Unspecified,
2572 "PERMISSION_DENIED" => Self::PermissionDenied,
2573 "NO_SOURCE_LOCATION" => Self::NoSourceLocation,
2574 _ => Self::UnknownValue(probing_abort_cause::UnknownValue(
2575 wkt::internal::UnknownEnumValue::String(value.to_string()),
2576 )),
2577 }
2578 }
2579 }
2580
2581 impl serde::ser::Serialize for ProbingAbortCause {
2582 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2583 where
2584 S: serde::Serializer,
2585 {
2586 match self {
2587 Self::Unspecified => serializer.serialize_i32(0),
2588 Self::PermissionDenied => serializer.serialize_i32(1),
2589 Self::NoSourceLocation => serializer.serialize_i32(2),
2590 Self::UnknownValue(u) => u.0.serialize(serializer),
2591 }
2592 }
2593 }
2594
2595 impl<'de> serde::de::Deserialize<'de> for ProbingAbortCause {
2596 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2597 where
2598 D: serde::Deserializer<'de>,
2599 {
2600 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProbingAbortCause>::new(
2601 ".google.cloud.networkmanagement.v1.ProbingDetails.ProbingAbortCause",
2602 ))
2603 }
2604 }
2605}
2606
2607/// Request for the `ListConnectivityTests` method.
2608#[derive(Clone, Default, PartialEq)]
2609#[non_exhaustive]
2610pub struct ListConnectivityTestsRequest {
2611 /// Required. The parent resource of the Connectivity Tests:
2612 /// `projects/{project_id}/locations/global`
2613 pub parent: std::string::String,
2614
2615 /// Number of `ConnectivityTests` to return.
2616 pub page_size: i32,
2617
2618 /// Page token from an earlier query, as returned in `next_page_token`.
2619 pub page_token: std::string::String,
2620
2621 /// Lists the `ConnectivityTests` that match the filter expression. A filter
2622 /// expression filters the resources listed in the response. The expression
2623 /// must be of the form `<field> <operator> <value>` where operators: `<`, `>`,
2624 /// `<=`,
2625 /// `>=`,
2626 /// `!=`, `=`, `:` are supported (colon `:` represents a HAS operator which is
2627 /// roughly synonymous with equality). \<field\> can refer to a proto or JSON
2628 /// field, or a synthetic field. Field names can be camelCase or snake_case.
2629 ///
2630 /// Examples:
2631 ///
2632 /// - Filter by name:
2633 /// name = "projects/proj-1/locations/global/connectivityTests/test-1
2634 ///
2635 /// - Filter by labels:
2636 ///
2637 /// - Resources that have a key called `foo`
2638 /// labels.foo:*
2639 /// - Resources that have a key called `foo` whose value is `bar`
2640 /// labels.foo = bar
2641 pub filter: std::string::String,
2642
2643 /// Field to use to sort the list.
2644 pub order_by: std::string::String,
2645
2646 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2647}
2648
2649impl ListConnectivityTestsRequest {
2650 pub fn new() -> Self {
2651 std::default::Default::default()
2652 }
2653
2654 /// Sets the value of [parent][crate::model::ListConnectivityTestsRequest::parent].
2655 ///
2656 /// # Example
2657 /// ```ignore,no_run
2658 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2659 /// let x = ListConnectivityTestsRequest::new().set_parent("example");
2660 /// ```
2661 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2662 self.parent = v.into();
2663 self
2664 }
2665
2666 /// Sets the value of [page_size][crate::model::ListConnectivityTestsRequest::page_size].
2667 ///
2668 /// # Example
2669 /// ```ignore,no_run
2670 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2671 /// let x = ListConnectivityTestsRequest::new().set_page_size(42);
2672 /// ```
2673 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2674 self.page_size = v.into();
2675 self
2676 }
2677
2678 /// Sets the value of [page_token][crate::model::ListConnectivityTestsRequest::page_token].
2679 ///
2680 /// # Example
2681 /// ```ignore,no_run
2682 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2683 /// let x = ListConnectivityTestsRequest::new().set_page_token("example");
2684 /// ```
2685 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2686 self.page_token = v.into();
2687 self
2688 }
2689
2690 /// Sets the value of [filter][crate::model::ListConnectivityTestsRequest::filter].
2691 ///
2692 /// # Example
2693 /// ```ignore,no_run
2694 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2695 /// let x = ListConnectivityTestsRequest::new().set_filter("example");
2696 /// ```
2697 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2698 self.filter = v.into();
2699 self
2700 }
2701
2702 /// Sets the value of [order_by][crate::model::ListConnectivityTestsRequest::order_by].
2703 ///
2704 /// # Example
2705 /// ```ignore,no_run
2706 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2707 /// let x = ListConnectivityTestsRequest::new().set_order_by("example");
2708 /// ```
2709 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2710 self.order_by = v.into();
2711 self
2712 }
2713}
2714
2715impl wkt::message::Message for ListConnectivityTestsRequest {
2716 fn typename() -> &'static str {
2717 "type.googleapis.com/google.cloud.networkmanagement.v1.ListConnectivityTestsRequest"
2718 }
2719}
2720
2721/// Response for the `ListConnectivityTests` method.
2722#[derive(Clone, Default, PartialEq)]
2723#[non_exhaustive]
2724pub struct ListConnectivityTestsResponse {
2725 /// List of Connectivity Tests.
2726 pub resources: std::vec::Vec<crate::model::ConnectivityTest>,
2727
2728 /// Page token to fetch the next set of Connectivity Tests.
2729 pub next_page_token: std::string::String,
2730
2731 /// Locations that could not be reached (when querying all locations with `-`).
2732 pub unreachable: std::vec::Vec<std::string::String>,
2733
2734 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2735}
2736
2737impl ListConnectivityTestsResponse {
2738 pub fn new() -> Self {
2739 std::default::Default::default()
2740 }
2741
2742 /// Sets the value of [resources][crate::model::ListConnectivityTestsResponse::resources].
2743 ///
2744 /// # Example
2745 /// ```ignore,no_run
2746 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2747 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2748 /// let x = ListConnectivityTestsResponse::new()
2749 /// .set_resources([
2750 /// ConnectivityTest::default()/* use setters */,
2751 /// ConnectivityTest::default()/* use (different) setters */,
2752 /// ]);
2753 /// ```
2754 pub fn set_resources<T, V>(mut self, v: T) -> Self
2755 where
2756 T: std::iter::IntoIterator<Item = V>,
2757 V: std::convert::Into<crate::model::ConnectivityTest>,
2758 {
2759 use std::iter::Iterator;
2760 self.resources = v.into_iter().map(|i| i.into()).collect();
2761 self
2762 }
2763
2764 /// Sets the value of [next_page_token][crate::model::ListConnectivityTestsResponse::next_page_token].
2765 ///
2766 /// # Example
2767 /// ```ignore,no_run
2768 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2769 /// let x = ListConnectivityTestsResponse::new().set_next_page_token("example");
2770 /// ```
2771 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2772 self.next_page_token = v.into();
2773 self
2774 }
2775
2776 /// Sets the value of [unreachable][crate::model::ListConnectivityTestsResponse::unreachable].
2777 ///
2778 /// # Example
2779 /// ```ignore,no_run
2780 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2781 /// let x = ListConnectivityTestsResponse::new().set_unreachable(["a", "b", "c"]);
2782 /// ```
2783 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2784 where
2785 T: std::iter::IntoIterator<Item = V>,
2786 V: std::convert::Into<std::string::String>,
2787 {
2788 use std::iter::Iterator;
2789 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2790 self
2791 }
2792}
2793
2794impl wkt::message::Message for ListConnectivityTestsResponse {
2795 fn typename() -> &'static str {
2796 "type.googleapis.com/google.cloud.networkmanagement.v1.ListConnectivityTestsResponse"
2797 }
2798}
2799
2800#[doc(hidden)]
2801impl gax::paginator::internal::PageableResponse for ListConnectivityTestsResponse {
2802 type PageItem = crate::model::ConnectivityTest;
2803
2804 fn items(self) -> std::vec::Vec<Self::PageItem> {
2805 self.resources
2806 }
2807
2808 fn next_page_token(&self) -> std::string::String {
2809 use std::clone::Clone;
2810 self.next_page_token.clone()
2811 }
2812}
2813
2814/// Request for the `GetConnectivityTest` method.
2815#[derive(Clone, Default, PartialEq)]
2816#[non_exhaustive]
2817pub struct GetConnectivityTestRequest {
2818 /// Required. `ConnectivityTest` resource name using the form:
2819 /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
2820 pub name: std::string::String,
2821
2822 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2823}
2824
2825impl GetConnectivityTestRequest {
2826 pub fn new() -> Self {
2827 std::default::Default::default()
2828 }
2829
2830 /// Sets the value of [name][crate::model::GetConnectivityTestRequest::name].
2831 ///
2832 /// # Example
2833 /// ```ignore,no_run
2834 /// # use google_cloud_networkmanagement_v1::model::GetConnectivityTestRequest;
2835 /// let x = GetConnectivityTestRequest::new().set_name("example");
2836 /// ```
2837 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2838 self.name = v.into();
2839 self
2840 }
2841}
2842
2843impl wkt::message::Message for GetConnectivityTestRequest {
2844 fn typename() -> &'static str {
2845 "type.googleapis.com/google.cloud.networkmanagement.v1.GetConnectivityTestRequest"
2846 }
2847}
2848
2849/// Request for the `CreateConnectivityTest` method.
2850#[derive(Clone, Default, PartialEq)]
2851#[non_exhaustive]
2852pub struct CreateConnectivityTestRequest {
2853 /// Required. The parent resource of the Connectivity Test to create:
2854 /// `projects/{project_id}/locations/global`
2855 pub parent: std::string::String,
2856
2857 /// Required. The logical name of the Connectivity Test in your project
2858 /// with the following restrictions:
2859 ///
2860 /// * Must contain only lowercase letters, numbers, and hyphens.
2861 /// * Must start with a letter.
2862 /// * Must be between 1-40 characters.
2863 /// * Must end with a number or a letter.
2864 /// * Must be unique within the customer project
2865 pub test_id: std::string::String,
2866
2867 /// Required. A `ConnectivityTest` resource
2868 pub resource: std::option::Option<crate::model::ConnectivityTest>,
2869
2870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2871}
2872
2873impl CreateConnectivityTestRequest {
2874 pub fn new() -> Self {
2875 std::default::Default::default()
2876 }
2877
2878 /// Sets the value of [parent][crate::model::CreateConnectivityTestRequest::parent].
2879 ///
2880 /// # Example
2881 /// ```ignore,no_run
2882 /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2883 /// let x = CreateConnectivityTestRequest::new().set_parent("example");
2884 /// ```
2885 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2886 self.parent = v.into();
2887 self
2888 }
2889
2890 /// Sets the value of [test_id][crate::model::CreateConnectivityTestRequest::test_id].
2891 ///
2892 /// # Example
2893 /// ```ignore,no_run
2894 /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2895 /// let x = CreateConnectivityTestRequest::new().set_test_id("example");
2896 /// ```
2897 pub fn set_test_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2898 self.test_id = v.into();
2899 self
2900 }
2901
2902 /// Sets the value of [resource][crate::model::CreateConnectivityTestRequest::resource].
2903 ///
2904 /// # Example
2905 /// ```ignore,no_run
2906 /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2907 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2908 /// let x = CreateConnectivityTestRequest::new().set_resource(ConnectivityTest::default()/* use setters */);
2909 /// ```
2910 pub fn set_resource<T>(mut self, v: T) -> Self
2911 where
2912 T: std::convert::Into<crate::model::ConnectivityTest>,
2913 {
2914 self.resource = std::option::Option::Some(v.into());
2915 self
2916 }
2917
2918 /// Sets or clears the value of [resource][crate::model::CreateConnectivityTestRequest::resource].
2919 ///
2920 /// # Example
2921 /// ```ignore,no_run
2922 /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2923 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2924 /// let x = CreateConnectivityTestRequest::new().set_or_clear_resource(Some(ConnectivityTest::default()/* use setters */));
2925 /// let x = CreateConnectivityTestRequest::new().set_or_clear_resource(None::<ConnectivityTest>);
2926 /// ```
2927 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
2928 where
2929 T: std::convert::Into<crate::model::ConnectivityTest>,
2930 {
2931 self.resource = v.map(|x| x.into());
2932 self
2933 }
2934}
2935
2936impl wkt::message::Message for CreateConnectivityTestRequest {
2937 fn typename() -> &'static str {
2938 "type.googleapis.com/google.cloud.networkmanagement.v1.CreateConnectivityTestRequest"
2939 }
2940}
2941
2942/// Request for the `UpdateConnectivityTest` method.
2943#[derive(Clone, Default, PartialEq)]
2944#[non_exhaustive]
2945pub struct UpdateConnectivityTestRequest {
2946 /// Required. Mask of fields to update. At least one path must be supplied in
2947 /// this field.
2948 pub update_mask: std::option::Option<wkt::FieldMask>,
2949
2950 /// Required. Only fields specified in update_mask are updated.
2951 pub resource: std::option::Option<crate::model::ConnectivityTest>,
2952
2953 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2954}
2955
2956impl UpdateConnectivityTestRequest {
2957 pub fn new() -> Self {
2958 std::default::Default::default()
2959 }
2960
2961 /// Sets the value of [update_mask][crate::model::UpdateConnectivityTestRequest::update_mask].
2962 ///
2963 /// # Example
2964 /// ```ignore,no_run
2965 /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
2966 /// use wkt::FieldMask;
2967 /// let x = UpdateConnectivityTestRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2968 /// ```
2969 pub fn set_update_mask<T>(mut self, v: T) -> Self
2970 where
2971 T: std::convert::Into<wkt::FieldMask>,
2972 {
2973 self.update_mask = std::option::Option::Some(v.into());
2974 self
2975 }
2976
2977 /// Sets or clears the value of [update_mask][crate::model::UpdateConnectivityTestRequest::update_mask].
2978 ///
2979 /// # Example
2980 /// ```ignore,no_run
2981 /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
2982 /// use wkt::FieldMask;
2983 /// let x = UpdateConnectivityTestRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2984 /// let x = UpdateConnectivityTestRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2985 /// ```
2986 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2987 where
2988 T: std::convert::Into<wkt::FieldMask>,
2989 {
2990 self.update_mask = v.map(|x| x.into());
2991 self
2992 }
2993
2994 /// Sets the value of [resource][crate::model::UpdateConnectivityTestRequest::resource].
2995 ///
2996 /// # Example
2997 /// ```ignore,no_run
2998 /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
2999 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
3000 /// let x = UpdateConnectivityTestRequest::new().set_resource(ConnectivityTest::default()/* use setters */);
3001 /// ```
3002 pub fn set_resource<T>(mut self, v: T) -> Self
3003 where
3004 T: std::convert::Into<crate::model::ConnectivityTest>,
3005 {
3006 self.resource = std::option::Option::Some(v.into());
3007 self
3008 }
3009
3010 /// Sets or clears the value of [resource][crate::model::UpdateConnectivityTestRequest::resource].
3011 ///
3012 /// # Example
3013 /// ```ignore,no_run
3014 /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
3015 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
3016 /// let x = UpdateConnectivityTestRequest::new().set_or_clear_resource(Some(ConnectivityTest::default()/* use setters */));
3017 /// let x = UpdateConnectivityTestRequest::new().set_or_clear_resource(None::<ConnectivityTest>);
3018 /// ```
3019 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
3020 where
3021 T: std::convert::Into<crate::model::ConnectivityTest>,
3022 {
3023 self.resource = v.map(|x| x.into());
3024 self
3025 }
3026}
3027
3028impl wkt::message::Message for UpdateConnectivityTestRequest {
3029 fn typename() -> &'static str {
3030 "type.googleapis.com/google.cloud.networkmanagement.v1.UpdateConnectivityTestRequest"
3031 }
3032}
3033
3034/// Request for the `DeleteConnectivityTest` method.
3035#[derive(Clone, Default, PartialEq)]
3036#[non_exhaustive]
3037pub struct DeleteConnectivityTestRequest {
3038 /// Required. Connectivity Test resource name using the form:
3039 /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
3040 pub name: std::string::String,
3041
3042 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3043}
3044
3045impl DeleteConnectivityTestRequest {
3046 pub fn new() -> Self {
3047 std::default::Default::default()
3048 }
3049
3050 /// Sets the value of [name][crate::model::DeleteConnectivityTestRequest::name].
3051 ///
3052 /// # Example
3053 /// ```ignore,no_run
3054 /// # use google_cloud_networkmanagement_v1::model::DeleteConnectivityTestRequest;
3055 /// let x = DeleteConnectivityTestRequest::new().set_name("example");
3056 /// ```
3057 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3058 self.name = v.into();
3059 self
3060 }
3061}
3062
3063impl wkt::message::Message for DeleteConnectivityTestRequest {
3064 fn typename() -> &'static str {
3065 "type.googleapis.com/google.cloud.networkmanagement.v1.DeleteConnectivityTestRequest"
3066 }
3067}
3068
3069/// Request for the `RerunConnectivityTest` method.
3070#[derive(Clone, Default, PartialEq)]
3071#[non_exhaustive]
3072pub struct RerunConnectivityTestRequest {
3073 /// Required. Connectivity Test resource name using the form:
3074 /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
3075 pub name: std::string::String,
3076
3077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3078}
3079
3080impl RerunConnectivityTestRequest {
3081 pub fn new() -> Self {
3082 std::default::Default::default()
3083 }
3084
3085 /// Sets the value of [name][crate::model::RerunConnectivityTestRequest::name].
3086 ///
3087 /// # Example
3088 /// ```ignore,no_run
3089 /// # use google_cloud_networkmanagement_v1::model::RerunConnectivityTestRequest;
3090 /// let x = RerunConnectivityTestRequest::new().set_name("example");
3091 /// ```
3092 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3093 self.name = v.into();
3094 self
3095 }
3096}
3097
3098impl wkt::message::Message for RerunConnectivityTestRequest {
3099 fn typename() -> &'static str {
3100 "type.googleapis.com/google.cloud.networkmanagement.v1.RerunConnectivityTestRequest"
3101 }
3102}
3103
3104/// Metadata describing an [Operation][google.longrunning.Operation]
3105///
3106/// [google.longrunning.Operation]: longrunning::model::Operation
3107#[derive(Clone, Default, PartialEq)]
3108#[non_exhaustive]
3109pub struct OperationMetadata {
3110 /// The time the operation was created.
3111 pub create_time: std::option::Option<wkt::Timestamp>,
3112
3113 /// The time the operation finished running.
3114 pub end_time: std::option::Option<wkt::Timestamp>,
3115
3116 /// Target of the operation - for example
3117 /// projects/project-1/locations/global/connectivityTests/test-1
3118 pub target: std::string::String,
3119
3120 /// Name of the verb executed by the operation.
3121 pub verb: std::string::String,
3122
3123 /// Human-readable status of the operation, if any.
3124 pub status_detail: std::string::String,
3125
3126 /// Specifies if cancellation was requested for the operation.
3127 pub cancel_requested: bool,
3128
3129 /// API version.
3130 pub api_version: std::string::String,
3131
3132 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3133}
3134
3135impl OperationMetadata {
3136 pub fn new() -> Self {
3137 std::default::Default::default()
3138 }
3139
3140 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3141 ///
3142 /// # Example
3143 /// ```ignore,no_run
3144 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3145 /// use wkt::Timestamp;
3146 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
3147 /// ```
3148 pub fn set_create_time<T>(mut self, v: T) -> Self
3149 where
3150 T: std::convert::Into<wkt::Timestamp>,
3151 {
3152 self.create_time = std::option::Option::Some(v.into());
3153 self
3154 }
3155
3156 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3157 ///
3158 /// # Example
3159 /// ```ignore,no_run
3160 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3161 /// use wkt::Timestamp;
3162 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3163 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
3164 /// ```
3165 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3166 where
3167 T: std::convert::Into<wkt::Timestamp>,
3168 {
3169 self.create_time = v.map(|x| x.into());
3170 self
3171 }
3172
3173 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3174 ///
3175 /// # Example
3176 /// ```ignore,no_run
3177 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3178 /// use wkt::Timestamp;
3179 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3180 /// ```
3181 pub fn set_end_time<T>(mut self, v: T) -> Self
3182 where
3183 T: std::convert::Into<wkt::Timestamp>,
3184 {
3185 self.end_time = std::option::Option::Some(v.into());
3186 self
3187 }
3188
3189 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3190 ///
3191 /// # Example
3192 /// ```ignore,no_run
3193 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3194 /// use wkt::Timestamp;
3195 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3196 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3197 /// ```
3198 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3199 where
3200 T: std::convert::Into<wkt::Timestamp>,
3201 {
3202 self.end_time = v.map(|x| x.into());
3203 self
3204 }
3205
3206 /// Sets the value of [target][crate::model::OperationMetadata::target].
3207 ///
3208 /// # Example
3209 /// ```ignore,no_run
3210 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3211 /// let x = OperationMetadata::new().set_target("example");
3212 /// ```
3213 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3214 self.target = v.into();
3215 self
3216 }
3217
3218 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3219 ///
3220 /// # Example
3221 /// ```ignore,no_run
3222 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3223 /// let x = OperationMetadata::new().set_verb("example");
3224 /// ```
3225 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3226 self.verb = v.into();
3227 self
3228 }
3229
3230 /// Sets the value of [status_detail][crate::model::OperationMetadata::status_detail].
3231 ///
3232 /// # Example
3233 /// ```ignore,no_run
3234 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3235 /// let x = OperationMetadata::new().set_status_detail("example");
3236 /// ```
3237 pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3238 self.status_detail = v.into();
3239 self
3240 }
3241
3242 /// Sets the value of [cancel_requested][crate::model::OperationMetadata::cancel_requested].
3243 ///
3244 /// # Example
3245 /// ```ignore,no_run
3246 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3247 /// let x = OperationMetadata::new().set_cancel_requested(true);
3248 /// ```
3249 pub fn set_cancel_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3250 self.cancel_requested = v.into();
3251 self
3252 }
3253
3254 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3255 ///
3256 /// # Example
3257 /// ```ignore,no_run
3258 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3259 /// let x = OperationMetadata::new().set_api_version("example");
3260 /// ```
3261 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3262 self.api_version = v.into();
3263 self
3264 }
3265}
3266
3267impl wkt::message::Message for OperationMetadata {
3268 fn typename() -> &'static str {
3269 "type.googleapis.com/google.cloud.networkmanagement.v1.OperationMetadata"
3270 }
3271}
3272
3273/// Trace represents one simulated packet forwarding path.
3274///
3275/// * Each trace contains multiple ordered steps.
3276/// * Each step is in a particular state with associated configuration.
3277/// * State is categorized as final or non-final states.
3278/// * Each final state has a reason associated.
3279/// * Each trace must end with a final state (the last step).
3280///
3281/// ```norust
3282/// |---------------------Trace----------------------|
3283/// Step1(State) Step2(State) --- StepN(State(final))
3284/// ```
3285#[derive(Clone, Default, PartialEq)]
3286#[non_exhaustive]
3287pub struct Trace {
3288 /// Derived from the source and destination endpoints definition specified by
3289 /// user request, and validated by the data plane model.
3290 /// If there are multiple traces starting from different source locations, then
3291 /// the endpoint_info may be different between traces.
3292 pub endpoint_info: std::option::Option<crate::model::EndpointInfo>,
3293
3294 /// A trace of a test contains multiple steps from the initial state to the
3295 /// final state (delivered, dropped, forwarded, or aborted).
3296 ///
3297 /// The steps are ordered by the processing sequence within the simulated
3298 /// network state machine. It is critical to preserve the order of the steps
3299 /// and avoid reordering or sorting them.
3300 pub steps: std::vec::Vec<crate::model::Step>,
3301
3302 /// ID of trace. For forward traces, this ID is unique for each trace. For
3303 /// return traces, it matches ID of associated forward trace. A single forward
3304 /// trace can be associated with none, one or more than one return trace.
3305 pub forward_trace_id: i32,
3306
3307 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3308}
3309
3310impl Trace {
3311 pub fn new() -> Self {
3312 std::default::Default::default()
3313 }
3314
3315 /// Sets the value of [endpoint_info][crate::model::Trace::endpoint_info].
3316 ///
3317 /// # Example
3318 /// ```ignore,no_run
3319 /// # use google_cloud_networkmanagement_v1::model::Trace;
3320 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3321 /// let x = Trace::new().set_endpoint_info(EndpointInfo::default()/* use setters */);
3322 /// ```
3323 pub fn set_endpoint_info<T>(mut self, v: T) -> Self
3324 where
3325 T: std::convert::Into<crate::model::EndpointInfo>,
3326 {
3327 self.endpoint_info = std::option::Option::Some(v.into());
3328 self
3329 }
3330
3331 /// Sets or clears the value of [endpoint_info][crate::model::Trace::endpoint_info].
3332 ///
3333 /// # Example
3334 /// ```ignore,no_run
3335 /// # use google_cloud_networkmanagement_v1::model::Trace;
3336 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3337 /// let x = Trace::new().set_or_clear_endpoint_info(Some(EndpointInfo::default()/* use setters */));
3338 /// let x = Trace::new().set_or_clear_endpoint_info(None::<EndpointInfo>);
3339 /// ```
3340 pub fn set_or_clear_endpoint_info<T>(mut self, v: std::option::Option<T>) -> Self
3341 where
3342 T: std::convert::Into<crate::model::EndpointInfo>,
3343 {
3344 self.endpoint_info = v.map(|x| x.into());
3345 self
3346 }
3347
3348 /// Sets the value of [steps][crate::model::Trace::steps].
3349 ///
3350 /// # Example
3351 /// ```ignore,no_run
3352 /// # use google_cloud_networkmanagement_v1::model::Trace;
3353 /// use google_cloud_networkmanagement_v1::model::Step;
3354 /// let x = Trace::new()
3355 /// .set_steps([
3356 /// Step::default()/* use setters */,
3357 /// Step::default()/* use (different) setters */,
3358 /// ]);
3359 /// ```
3360 pub fn set_steps<T, V>(mut self, v: T) -> Self
3361 where
3362 T: std::iter::IntoIterator<Item = V>,
3363 V: std::convert::Into<crate::model::Step>,
3364 {
3365 use std::iter::Iterator;
3366 self.steps = v.into_iter().map(|i| i.into()).collect();
3367 self
3368 }
3369
3370 /// Sets the value of [forward_trace_id][crate::model::Trace::forward_trace_id].
3371 ///
3372 /// # Example
3373 /// ```ignore,no_run
3374 /// # use google_cloud_networkmanagement_v1::model::Trace;
3375 /// let x = Trace::new().set_forward_trace_id(42);
3376 /// ```
3377 pub fn set_forward_trace_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3378 self.forward_trace_id = v.into();
3379 self
3380 }
3381}
3382
3383impl wkt::message::Message for Trace {
3384 fn typename() -> &'static str {
3385 "type.googleapis.com/google.cloud.networkmanagement.v1.Trace"
3386 }
3387}
3388
3389/// A simulated forwarding path is composed of multiple steps.
3390/// Each step has a well-defined state and an associated configuration.
3391#[derive(Clone, Default, PartialEq)]
3392#[non_exhaustive]
3393pub struct Step {
3394 /// A description of the step. Usually this is a summary of the state.
3395 pub description: std::string::String,
3396
3397 /// Each step is in one of the pre-defined states.
3398 pub state: crate::model::step::State,
3399
3400 /// This is a step that leads to the final state Drop.
3401 pub causes_drop: bool,
3402
3403 /// Project ID that contains the configuration this step is validating.
3404 pub project_id: std::string::String,
3405
3406 /// Configuration or metadata associated with each step.
3407 /// The configuration is filtered based on viewer's permission. If a viewer
3408 /// has no permission to view the configuration in this step, for non-final
3409 /// states a special state is populated (VIEWER_PERMISSION_MISSING), and for
3410 /// final state the configuration is cleared.
3411 pub step_info: std::option::Option<crate::model::step::StepInfo>,
3412
3413 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3414}
3415
3416impl Step {
3417 pub fn new() -> Self {
3418 std::default::Default::default()
3419 }
3420
3421 /// Sets the value of [description][crate::model::Step::description].
3422 ///
3423 /// # Example
3424 /// ```ignore,no_run
3425 /// # use google_cloud_networkmanagement_v1::model::Step;
3426 /// let x = Step::new().set_description("example");
3427 /// ```
3428 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3429 self.description = v.into();
3430 self
3431 }
3432
3433 /// Sets the value of [state][crate::model::Step::state].
3434 ///
3435 /// # Example
3436 /// ```ignore,no_run
3437 /// # use google_cloud_networkmanagement_v1::model::Step;
3438 /// use google_cloud_networkmanagement_v1::model::step::State;
3439 /// let x0 = Step::new().set_state(State::StartFromInstance);
3440 /// let x1 = Step::new().set_state(State::StartFromInternet);
3441 /// let x2 = Step::new().set_state(State::StartFromGoogleService);
3442 /// ```
3443 pub fn set_state<T: std::convert::Into<crate::model::step::State>>(mut self, v: T) -> Self {
3444 self.state = v.into();
3445 self
3446 }
3447
3448 /// Sets the value of [causes_drop][crate::model::Step::causes_drop].
3449 ///
3450 /// # Example
3451 /// ```ignore,no_run
3452 /// # use google_cloud_networkmanagement_v1::model::Step;
3453 /// let x = Step::new().set_causes_drop(true);
3454 /// ```
3455 pub fn set_causes_drop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3456 self.causes_drop = v.into();
3457 self
3458 }
3459
3460 /// Sets the value of [project_id][crate::model::Step::project_id].
3461 ///
3462 /// # Example
3463 /// ```ignore,no_run
3464 /// # use google_cloud_networkmanagement_v1::model::Step;
3465 /// let x = Step::new().set_project_id("example");
3466 /// ```
3467 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3468 self.project_id = v.into();
3469 self
3470 }
3471
3472 /// Sets the value of [step_info][crate::model::Step::step_info].
3473 ///
3474 /// Note that all the setters affecting `step_info` are mutually
3475 /// exclusive.
3476 ///
3477 /// # Example
3478 /// ```ignore,no_run
3479 /// # use google_cloud_networkmanagement_v1::model::Step;
3480 /// use google_cloud_networkmanagement_v1::model::InstanceInfo;
3481 /// let x = Step::new().set_step_info(Some(
3482 /// google_cloud_networkmanagement_v1::model::step::StepInfo::Instance(InstanceInfo::default().into())));
3483 /// ```
3484 pub fn set_step_info<
3485 T: std::convert::Into<std::option::Option<crate::model::step::StepInfo>>,
3486 >(
3487 mut self,
3488 v: T,
3489 ) -> Self {
3490 self.step_info = v.into();
3491 self
3492 }
3493
3494 /// The value of [step_info][crate::model::Step::step_info]
3495 /// if it holds a `Instance`, `None` if the field is not set or
3496 /// holds a different branch.
3497 pub fn instance(&self) -> std::option::Option<&std::boxed::Box<crate::model::InstanceInfo>> {
3498 #[allow(unreachable_patterns)]
3499 self.step_info.as_ref().and_then(|v| match v {
3500 crate::model::step::StepInfo::Instance(v) => std::option::Option::Some(v),
3501 _ => std::option::Option::None,
3502 })
3503 }
3504
3505 /// Sets the value of [step_info][crate::model::Step::step_info]
3506 /// to hold a `Instance`.
3507 ///
3508 /// Note that all the setters affecting `step_info` are
3509 /// mutually exclusive.
3510 ///
3511 /// # Example
3512 /// ```ignore,no_run
3513 /// # use google_cloud_networkmanagement_v1::model::Step;
3514 /// use google_cloud_networkmanagement_v1::model::InstanceInfo;
3515 /// let x = Step::new().set_instance(InstanceInfo::default()/* use setters */);
3516 /// assert!(x.instance().is_some());
3517 /// assert!(x.firewall().is_none());
3518 /// assert!(x.route().is_none());
3519 /// assert!(x.endpoint().is_none());
3520 /// assert!(x.google_service().is_none());
3521 /// assert!(x.forwarding_rule().is_none());
3522 /// assert!(x.hybrid_subnet().is_none());
3523 /// assert!(x.vpn_gateway().is_none());
3524 /// assert!(x.vpn_tunnel().is_none());
3525 /// assert!(x.interconnect_attachment().is_none());
3526 /// assert!(x.vpc_connector().is_none());
3527 /// assert!(x.direct_vpc_egress_connection().is_none());
3528 /// assert!(x.serverless_external_connection().is_none());
3529 /// assert!(x.deliver().is_none());
3530 /// assert!(x.forward().is_none());
3531 /// assert!(x.abort().is_none());
3532 /// assert!(x.drop().is_none());
3533 /// assert!(x.load_balancer().is_none());
3534 /// assert!(x.network().is_none());
3535 /// assert!(x.gke_master().is_none());
3536 /// assert!(x.gke_pod().is_none());
3537 /// assert!(x.ip_masquerading_skipped().is_none());
3538 /// assert!(x.cloud_sql_instance().is_none());
3539 /// assert!(x.redis_instance().is_none());
3540 /// assert!(x.redis_cluster().is_none());
3541 /// assert!(x.cloud_function().is_none());
3542 /// assert!(x.app_engine_version().is_none());
3543 /// assert!(x.cloud_run_revision().is_none());
3544 /// assert!(x.nat().is_none());
3545 /// assert!(x.proxy_connection().is_none());
3546 /// assert!(x.load_balancer_backend_info().is_none());
3547 /// assert!(x.storage_bucket().is_none());
3548 /// assert!(x.serverless_neg().is_none());
3549 /// ```
3550 pub fn set_instance<T: std::convert::Into<std::boxed::Box<crate::model::InstanceInfo>>>(
3551 mut self,
3552 v: T,
3553 ) -> Self {
3554 self.step_info =
3555 std::option::Option::Some(crate::model::step::StepInfo::Instance(v.into()));
3556 self
3557 }
3558
3559 /// The value of [step_info][crate::model::Step::step_info]
3560 /// if it holds a `Firewall`, `None` if the field is not set or
3561 /// holds a different branch.
3562 pub fn firewall(&self) -> std::option::Option<&std::boxed::Box<crate::model::FirewallInfo>> {
3563 #[allow(unreachable_patterns)]
3564 self.step_info.as_ref().and_then(|v| match v {
3565 crate::model::step::StepInfo::Firewall(v) => std::option::Option::Some(v),
3566 _ => std::option::Option::None,
3567 })
3568 }
3569
3570 /// Sets the value of [step_info][crate::model::Step::step_info]
3571 /// to hold a `Firewall`.
3572 ///
3573 /// Note that all the setters affecting `step_info` are
3574 /// mutually exclusive.
3575 ///
3576 /// # Example
3577 /// ```ignore,no_run
3578 /// # use google_cloud_networkmanagement_v1::model::Step;
3579 /// use google_cloud_networkmanagement_v1::model::FirewallInfo;
3580 /// let x = Step::new().set_firewall(FirewallInfo::default()/* use setters */);
3581 /// assert!(x.firewall().is_some());
3582 /// assert!(x.instance().is_none());
3583 /// assert!(x.route().is_none());
3584 /// assert!(x.endpoint().is_none());
3585 /// assert!(x.google_service().is_none());
3586 /// assert!(x.forwarding_rule().is_none());
3587 /// assert!(x.hybrid_subnet().is_none());
3588 /// assert!(x.vpn_gateway().is_none());
3589 /// assert!(x.vpn_tunnel().is_none());
3590 /// assert!(x.interconnect_attachment().is_none());
3591 /// assert!(x.vpc_connector().is_none());
3592 /// assert!(x.direct_vpc_egress_connection().is_none());
3593 /// assert!(x.serverless_external_connection().is_none());
3594 /// assert!(x.deliver().is_none());
3595 /// assert!(x.forward().is_none());
3596 /// assert!(x.abort().is_none());
3597 /// assert!(x.drop().is_none());
3598 /// assert!(x.load_balancer().is_none());
3599 /// assert!(x.network().is_none());
3600 /// assert!(x.gke_master().is_none());
3601 /// assert!(x.gke_pod().is_none());
3602 /// assert!(x.ip_masquerading_skipped().is_none());
3603 /// assert!(x.cloud_sql_instance().is_none());
3604 /// assert!(x.redis_instance().is_none());
3605 /// assert!(x.redis_cluster().is_none());
3606 /// assert!(x.cloud_function().is_none());
3607 /// assert!(x.app_engine_version().is_none());
3608 /// assert!(x.cloud_run_revision().is_none());
3609 /// assert!(x.nat().is_none());
3610 /// assert!(x.proxy_connection().is_none());
3611 /// assert!(x.load_balancer_backend_info().is_none());
3612 /// assert!(x.storage_bucket().is_none());
3613 /// assert!(x.serverless_neg().is_none());
3614 /// ```
3615 pub fn set_firewall<T: std::convert::Into<std::boxed::Box<crate::model::FirewallInfo>>>(
3616 mut self,
3617 v: T,
3618 ) -> Self {
3619 self.step_info =
3620 std::option::Option::Some(crate::model::step::StepInfo::Firewall(v.into()));
3621 self
3622 }
3623
3624 /// The value of [step_info][crate::model::Step::step_info]
3625 /// if it holds a `Route`, `None` if the field is not set or
3626 /// holds a different branch.
3627 pub fn route(&self) -> std::option::Option<&std::boxed::Box<crate::model::RouteInfo>> {
3628 #[allow(unreachable_patterns)]
3629 self.step_info.as_ref().and_then(|v| match v {
3630 crate::model::step::StepInfo::Route(v) => std::option::Option::Some(v),
3631 _ => std::option::Option::None,
3632 })
3633 }
3634
3635 /// Sets the value of [step_info][crate::model::Step::step_info]
3636 /// to hold a `Route`.
3637 ///
3638 /// Note that all the setters affecting `step_info` are
3639 /// mutually exclusive.
3640 ///
3641 /// # Example
3642 /// ```ignore,no_run
3643 /// # use google_cloud_networkmanagement_v1::model::Step;
3644 /// use google_cloud_networkmanagement_v1::model::RouteInfo;
3645 /// let x = Step::new().set_route(RouteInfo::default()/* use setters */);
3646 /// assert!(x.route().is_some());
3647 /// assert!(x.instance().is_none());
3648 /// assert!(x.firewall().is_none());
3649 /// assert!(x.endpoint().is_none());
3650 /// assert!(x.google_service().is_none());
3651 /// assert!(x.forwarding_rule().is_none());
3652 /// assert!(x.hybrid_subnet().is_none());
3653 /// assert!(x.vpn_gateway().is_none());
3654 /// assert!(x.vpn_tunnel().is_none());
3655 /// assert!(x.interconnect_attachment().is_none());
3656 /// assert!(x.vpc_connector().is_none());
3657 /// assert!(x.direct_vpc_egress_connection().is_none());
3658 /// assert!(x.serverless_external_connection().is_none());
3659 /// assert!(x.deliver().is_none());
3660 /// assert!(x.forward().is_none());
3661 /// assert!(x.abort().is_none());
3662 /// assert!(x.drop().is_none());
3663 /// assert!(x.load_balancer().is_none());
3664 /// assert!(x.network().is_none());
3665 /// assert!(x.gke_master().is_none());
3666 /// assert!(x.gke_pod().is_none());
3667 /// assert!(x.ip_masquerading_skipped().is_none());
3668 /// assert!(x.cloud_sql_instance().is_none());
3669 /// assert!(x.redis_instance().is_none());
3670 /// assert!(x.redis_cluster().is_none());
3671 /// assert!(x.cloud_function().is_none());
3672 /// assert!(x.app_engine_version().is_none());
3673 /// assert!(x.cloud_run_revision().is_none());
3674 /// assert!(x.nat().is_none());
3675 /// assert!(x.proxy_connection().is_none());
3676 /// assert!(x.load_balancer_backend_info().is_none());
3677 /// assert!(x.storage_bucket().is_none());
3678 /// assert!(x.serverless_neg().is_none());
3679 /// ```
3680 pub fn set_route<T: std::convert::Into<std::boxed::Box<crate::model::RouteInfo>>>(
3681 mut self,
3682 v: T,
3683 ) -> Self {
3684 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Route(v.into()));
3685 self
3686 }
3687
3688 /// The value of [step_info][crate::model::Step::step_info]
3689 /// if it holds a `Endpoint`, `None` if the field is not set or
3690 /// holds a different branch.
3691 pub fn endpoint(&self) -> std::option::Option<&std::boxed::Box<crate::model::EndpointInfo>> {
3692 #[allow(unreachable_patterns)]
3693 self.step_info.as_ref().and_then(|v| match v {
3694 crate::model::step::StepInfo::Endpoint(v) => std::option::Option::Some(v),
3695 _ => std::option::Option::None,
3696 })
3697 }
3698
3699 /// Sets the value of [step_info][crate::model::Step::step_info]
3700 /// to hold a `Endpoint`.
3701 ///
3702 /// Note that all the setters affecting `step_info` are
3703 /// mutually exclusive.
3704 ///
3705 /// # Example
3706 /// ```ignore,no_run
3707 /// # use google_cloud_networkmanagement_v1::model::Step;
3708 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3709 /// let x = Step::new().set_endpoint(EndpointInfo::default()/* use setters */);
3710 /// assert!(x.endpoint().is_some());
3711 /// assert!(x.instance().is_none());
3712 /// assert!(x.firewall().is_none());
3713 /// assert!(x.route().is_none());
3714 /// assert!(x.google_service().is_none());
3715 /// assert!(x.forwarding_rule().is_none());
3716 /// assert!(x.hybrid_subnet().is_none());
3717 /// assert!(x.vpn_gateway().is_none());
3718 /// assert!(x.vpn_tunnel().is_none());
3719 /// assert!(x.interconnect_attachment().is_none());
3720 /// assert!(x.vpc_connector().is_none());
3721 /// assert!(x.direct_vpc_egress_connection().is_none());
3722 /// assert!(x.serverless_external_connection().is_none());
3723 /// assert!(x.deliver().is_none());
3724 /// assert!(x.forward().is_none());
3725 /// assert!(x.abort().is_none());
3726 /// assert!(x.drop().is_none());
3727 /// assert!(x.load_balancer().is_none());
3728 /// assert!(x.network().is_none());
3729 /// assert!(x.gke_master().is_none());
3730 /// assert!(x.gke_pod().is_none());
3731 /// assert!(x.ip_masquerading_skipped().is_none());
3732 /// assert!(x.cloud_sql_instance().is_none());
3733 /// assert!(x.redis_instance().is_none());
3734 /// assert!(x.redis_cluster().is_none());
3735 /// assert!(x.cloud_function().is_none());
3736 /// assert!(x.app_engine_version().is_none());
3737 /// assert!(x.cloud_run_revision().is_none());
3738 /// assert!(x.nat().is_none());
3739 /// assert!(x.proxy_connection().is_none());
3740 /// assert!(x.load_balancer_backend_info().is_none());
3741 /// assert!(x.storage_bucket().is_none());
3742 /// assert!(x.serverless_neg().is_none());
3743 /// ```
3744 pub fn set_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::EndpointInfo>>>(
3745 mut self,
3746 v: T,
3747 ) -> Self {
3748 self.step_info =
3749 std::option::Option::Some(crate::model::step::StepInfo::Endpoint(v.into()));
3750 self
3751 }
3752
3753 /// The value of [step_info][crate::model::Step::step_info]
3754 /// if it holds a `GoogleService`, `None` if the field is not set or
3755 /// holds a different branch.
3756 pub fn google_service(
3757 &self,
3758 ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleServiceInfo>> {
3759 #[allow(unreachable_patterns)]
3760 self.step_info.as_ref().and_then(|v| match v {
3761 crate::model::step::StepInfo::GoogleService(v) => std::option::Option::Some(v),
3762 _ => std::option::Option::None,
3763 })
3764 }
3765
3766 /// Sets the value of [step_info][crate::model::Step::step_info]
3767 /// to hold a `GoogleService`.
3768 ///
3769 /// Note that all the setters affecting `step_info` are
3770 /// mutually exclusive.
3771 ///
3772 /// # Example
3773 /// ```ignore,no_run
3774 /// # use google_cloud_networkmanagement_v1::model::Step;
3775 /// use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
3776 /// let x = Step::new().set_google_service(GoogleServiceInfo::default()/* use setters */);
3777 /// assert!(x.google_service().is_some());
3778 /// assert!(x.instance().is_none());
3779 /// assert!(x.firewall().is_none());
3780 /// assert!(x.route().is_none());
3781 /// assert!(x.endpoint().is_none());
3782 /// assert!(x.forwarding_rule().is_none());
3783 /// assert!(x.hybrid_subnet().is_none());
3784 /// assert!(x.vpn_gateway().is_none());
3785 /// assert!(x.vpn_tunnel().is_none());
3786 /// assert!(x.interconnect_attachment().is_none());
3787 /// assert!(x.vpc_connector().is_none());
3788 /// assert!(x.direct_vpc_egress_connection().is_none());
3789 /// assert!(x.serverless_external_connection().is_none());
3790 /// assert!(x.deliver().is_none());
3791 /// assert!(x.forward().is_none());
3792 /// assert!(x.abort().is_none());
3793 /// assert!(x.drop().is_none());
3794 /// assert!(x.load_balancer().is_none());
3795 /// assert!(x.network().is_none());
3796 /// assert!(x.gke_master().is_none());
3797 /// assert!(x.gke_pod().is_none());
3798 /// assert!(x.ip_masquerading_skipped().is_none());
3799 /// assert!(x.cloud_sql_instance().is_none());
3800 /// assert!(x.redis_instance().is_none());
3801 /// assert!(x.redis_cluster().is_none());
3802 /// assert!(x.cloud_function().is_none());
3803 /// assert!(x.app_engine_version().is_none());
3804 /// assert!(x.cloud_run_revision().is_none());
3805 /// assert!(x.nat().is_none());
3806 /// assert!(x.proxy_connection().is_none());
3807 /// assert!(x.load_balancer_backend_info().is_none());
3808 /// assert!(x.storage_bucket().is_none());
3809 /// assert!(x.serverless_neg().is_none());
3810 /// ```
3811 pub fn set_google_service<
3812 T: std::convert::Into<std::boxed::Box<crate::model::GoogleServiceInfo>>,
3813 >(
3814 mut self,
3815 v: T,
3816 ) -> Self {
3817 self.step_info =
3818 std::option::Option::Some(crate::model::step::StepInfo::GoogleService(v.into()));
3819 self
3820 }
3821
3822 /// The value of [step_info][crate::model::Step::step_info]
3823 /// if it holds a `ForwardingRule`, `None` if the field is not set or
3824 /// holds a different branch.
3825 pub fn forwarding_rule(
3826 &self,
3827 ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardingRuleInfo>> {
3828 #[allow(unreachable_patterns)]
3829 self.step_info.as_ref().and_then(|v| match v {
3830 crate::model::step::StepInfo::ForwardingRule(v) => std::option::Option::Some(v),
3831 _ => std::option::Option::None,
3832 })
3833 }
3834
3835 /// Sets the value of [step_info][crate::model::Step::step_info]
3836 /// to hold a `ForwardingRule`.
3837 ///
3838 /// Note that all the setters affecting `step_info` are
3839 /// mutually exclusive.
3840 ///
3841 /// # Example
3842 /// ```ignore,no_run
3843 /// # use google_cloud_networkmanagement_v1::model::Step;
3844 /// use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
3845 /// let x = Step::new().set_forwarding_rule(ForwardingRuleInfo::default()/* use setters */);
3846 /// assert!(x.forwarding_rule().is_some());
3847 /// assert!(x.instance().is_none());
3848 /// assert!(x.firewall().is_none());
3849 /// assert!(x.route().is_none());
3850 /// assert!(x.endpoint().is_none());
3851 /// assert!(x.google_service().is_none());
3852 /// assert!(x.hybrid_subnet().is_none());
3853 /// assert!(x.vpn_gateway().is_none());
3854 /// assert!(x.vpn_tunnel().is_none());
3855 /// assert!(x.interconnect_attachment().is_none());
3856 /// assert!(x.vpc_connector().is_none());
3857 /// assert!(x.direct_vpc_egress_connection().is_none());
3858 /// assert!(x.serverless_external_connection().is_none());
3859 /// assert!(x.deliver().is_none());
3860 /// assert!(x.forward().is_none());
3861 /// assert!(x.abort().is_none());
3862 /// assert!(x.drop().is_none());
3863 /// assert!(x.load_balancer().is_none());
3864 /// assert!(x.network().is_none());
3865 /// assert!(x.gke_master().is_none());
3866 /// assert!(x.gke_pod().is_none());
3867 /// assert!(x.ip_masquerading_skipped().is_none());
3868 /// assert!(x.cloud_sql_instance().is_none());
3869 /// assert!(x.redis_instance().is_none());
3870 /// assert!(x.redis_cluster().is_none());
3871 /// assert!(x.cloud_function().is_none());
3872 /// assert!(x.app_engine_version().is_none());
3873 /// assert!(x.cloud_run_revision().is_none());
3874 /// assert!(x.nat().is_none());
3875 /// assert!(x.proxy_connection().is_none());
3876 /// assert!(x.load_balancer_backend_info().is_none());
3877 /// assert!(x.storage_bucket().is_none());
3878 /// assert!(x.serverless_neg().is_none());
3879 /// ```
3880 pub fn set_forwarding_rule<
3881 T: std::convert::Into<std::boxed::Box<crate::model::ForwardingRuleInfo>>,
3882 >(
3883 mut self,
3884 v: T,
3885 ) -> Self {
3886 self.step_info =
3887 std::option::Option::Some(crate::model::step::StepInfo::ForwardingRule(v.into()));
3888 self
3889 }
3890
3891 /// The value of [step_info][crate::model::Step::step_info]
3892 /// if it holds a `HybridSubnet`, `None` if the field is not set or
3893 /// holds a different branch.
3894 pub fn hybrid_subnet(
3895 &self,
3896 ) -> std::option::Option<&std::boxed::Box<crate::model::HybridSubnetInfo>> {
3897 #[allow(unreachable_patterns)]
3898 self.step_info.as_ref().and_then(|v| match v {
3899 crate::model::step::StepInfo::HybridSubnet(v) => std::option::Option::Some(v),
3900 _ => std::option::Option::None,
3901 })
3902 }
3903
3904 /// Sets the value of [step_info][crate::model::Step::step_info]
3905 /// to hold a `HybridSubnet`.
3906 ///
3907 /// Note that all the setters affecting `step_info` are
3908 /// mutually exclusive.
3909 ///
3910 /// # Example
3911 /// ```ignore,no_run
3912 /// # use google_cloud_networkmanagement_v1::model::Step;
3913 /// use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
3914 /// let x = Step::new().set_hybrid_subnet(HybridSubnetInfo::default()/* use setters */);
3915 /// assert!(x.hybrid_subnet().is_some());
3916 /// assert!(x.instance().is_none());
3917 /// assert!(x.firewall().is_none());
3918 /// assert!(x.route().is_none());
3919 /// assert!(x.endpoint().is_none());
3920 /// assert!(x.google_service().is_none());
3921 /// assert!(x.forwarding_rule().is_none());
3922 /// assert!(x.vpn_gateway().is_none());
3923 /// assert!(x.vpn_tunnel().is_none());
3924 /// assert!(x.interconnect_attachment().is_none());
3925 /// assert!(x.vpc_connector().is_none());
3926 /// assert!(x.direct_vpc_egress_connection().is_none());
3927 /// assert!(x.serverless_external_connection().is_none());
3928 /// assert!(x.deliver().is_none());
3929 /// assert!(x.forward().is_none());
3930 /// assert!(x.abort().is_none());
3931 /// assert!(x.drop().is_none());
3932 /// assert!(x.load_balancer().is_none());
3933 /// assert!(x.network().is_none());
3934 /// assert!(x.gke_master().is_none());
3935 /// assert!(x.gke_pod().is_none());
3936 /// assert!(x.ip_masquerading_skipped().is_none());
3937 /// assert!(x.cloud_sql_instance().is_none());
3938 /// assert!(x.redis_instance().is_none());
3939 /// assert!(x.redis_cluster().is_none());
3940 /// assert!(x.cloud_function().is_none());
3941 /// assert!(x.app_engine_version().is_none());
3942 /// assert!(x.cloud_run_revision().is_none());
3943 /// assert!(x.nat().is_none());
3944 /// assert!(x.proxy_connection().is_none());
3945 /// assert!(x.load_balancer_backend_info().is_none());
3946 /// assert!(x.storage_bucket().is_none());
3947 /// assert!(x.serverless_neg().is_none());
3948 /// ```
3949 pub fn set_hybrid_subnet<
3950 T: std::convert::Into<std::boxed::Box<crate::model::HybridSubnetInfo>>,
3951 >(
3952 mut self,
3953 v: T,
3954 ) -> Self {
3955 self.step_info =
3956 std::option::Option::Some(crate::model::step::StepInfo::HybridSubnet(v.into()));
3957 self
3958 }
3959
3960 /// The value of [step_info][crate::model::Step::step_info]
3961 /// if it holds a `VpnGateway`, `None` if the field is not set or
3962 /// holds a different branch.
3963 pub fn vpn_gateway(
3964 &self,
3965 ) -> std::option::Option<&std::boxed::Box<crate::model::VpnGatewayInfo>> {
3966 #[allow(unreachable_patterns)]
3967 self.step_info.as_ref().and_then(|v| match v {
3968 crate::model::step::StepInfo::VpnGateway(v) => std::option::Option::Some(v),
3969 _ => std::option::Option::None,
3970 })
3971 }
3972
3973 /// Sets the value of [step_info][crate::model::Step::step_info]
3974 /// to hold a `VpnGateway`.
3975 ///
3976 /// Note that all the setters affecting `step_info` are
3977 /// mutually exclusive.
3978 ///
3979 /// # Example
3980 /// ```ignore,no_run
3981 /// # use google_cloud_networkmanagement_v1::model::Step;
3982 /// use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
3983 /// let x = Step::new().set_vpn_gateway(VpnGatewayInfo::default()/* use setters */);
3984 /// assert!(x.vpn_gateway().is_some());
3985 /// assert!(x.instance().is_none());
3986 /// assert!(x.firewall().is_none());
3987 /// assert!(x.route().is_none());
3988 /// assert!(x.endpoint().is_none());
3989 /// assert!(x.google_service().is_none());
3990 /// assert!(x.forwarding_rule().is_none());
3991 /// assert!(x.hybrid_subnet().is_none());
3992 /// assert!(x.vpn_tunnel().is_none());
3993 /// assert!(x.interconnect_attachment().is_none());
3994 /// assert!(x.vpc_connector().is_none());
3995 /// assert!(x.direct_vpc_egress_connection().is_none());
3996 /// assert!(x.serverless_external_connection().is_none());
3997 /// assert!(x.deliver().is_none());
3998 /// assert!(x.forward().is_none());
3999 /// assert!(x.abort().is_none());
4000 /// assert!(x.drop().is_none());
4001 /// assert!(x.load_balancer().is_none());
4002 /// assert!(x.network().is_none());
4003 /// assert!(x.gke_master().is_none());
4004 /// assert!(x.gke_pod().is_none());
4005 /// assert!(x.ip_masquerading_skipped().is_none());
4006 /// assert!(x.cloud_sql_instance().is_none());
4007 /// assert!(x.redis_instance().is_none());
4008 /// assert!(x.redis_cluster().is_none());
4009 /// assert!(x.cloud_function().is_none());
4010 /// assert!(x.app_engine_version().is_none());
4011 /// assert!(x.cloud_run_revision().is_none());
4012 /// assert!(x.nat().is_none());
4013 /// assert!(x.proxy_connection().is_none());
4014 /// assert!(x.load_balancer_backend_info().is_none());
4015 /// assert!(x.storage_bucket().is_none());
4016 /// assert!(x.serverless_neg().is_none());
4017 /// ```
4018 pub fn set_vpn_gateway<T: std::convert::Into<std::boxed::Box<crate::model::VpnGatewayInfo>>>(
4019 mut self,
4020 v: T,
4021 ) -> Self {
4022 self.step_info =
4023 std::option::Option::Some(crate::model::step::StepInfo::VpnGateway(v.into()));
4024 self
4025 }
4026
4027 /// The value of [step_info][crate::model::Step::step_info]
4028 /// if it holds a `VpnTunnel`, `None` if the field is not set or
4029 /// holds a different branch.
4030 pub fn vpn_tunnel(&self) -> std::option::Option<&std::boxed::Box<crate::model::VpnTunnelInfo>> {
4031 #[allow(unreachable_patterns)]
4032 self.step_info.as_ref().and_then(|v| match v {
4033 crate::model::step::StepInfo::VpnTunnel(v) => std::option::Option::Some(v),
4034 _ => std::option::Option::None,
4035 })
4036 }
4037
4038 /// Sets the value of [step_info][crate::model::Step::step_info]
4039 /// to hold a `VpnTunnel`.
4040 ///
4041 /// Note that all the setters affecting `step_info` are
4042 /// mutually exclusive.
4043 ///
4044 /// # Example
4045 /// ```ignore,no_run
4046 /// # use google_cloud_networkmanagement_v1::model::Step;
4047 /// use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
4048 /// let x = Step::new().set_vpn_tunnel(VpnTunnelInfo::default()/* use setters */);
4049 /// assert!(x.vpn_tunnel().is_some());
4050 /// assert!(x.instance().is_none());
4051 /// assert!(x.firewall().is_none());
4052 /// assert!(x.route().is_none());
4053 /// assert!(x.endpoint().is_none());
4054 /// assert!(x.google_service().is_none());
4055 /// assert!(x.forwarding_rule().is_none());
4056 /// assert!(x.hybrid_subnet().is_none());
4057 /// assert!(x.vpn_gateway().is_none());
4058 /// assert!(x.interconnect_attachment().is_none());
4059 /// assert!(x.vpc_connector().is_none());
4060 /// assert!(x.direct_vpc_egress_connection().is_none());
4061 /// assert!(x.serverless_external_connection().is_none());
4062 /// assert!(x.deliver().is_none());
4063 /// assert!(x.forward().is_none());
4064 /// assert!(x.abort().is_none());
4065 /// assert!(x.drop().is_none());
4066 /// assert!(x.load_balancer().is_none());
4067 /// assert!(x.network().is_none());
4068 /// assert!(x.gke_master().is_none());
4069 /// assert!(x.gke_pod().is_none());
4070 /// assert!(x.ip_masquerading_skipped().is_none());
4071 /// assert!(x.cloud_sql_instance().is_none());
4072 /// assert!(x.redis_instance().is_none());
4073 /// assert!(x.redis_cluster().is_none());
4074 /// assert!(x.cloud_function().is_none());
4075 /// assert!(x.app_engine_version().is_none());
4076 /// assert!(x.cloud_run_revision().is_none());
4077 /// assert!(x.nat().is_none());
4078 /// assert!(x.proxy_connection().is_none());
4079 /// assert!(x.load_balancer_backend_info().is_none());
4080 /// assert!(x.storage_bucket().is_none());
4081 /// assert!(x.serverless_neg().is_none());
4082 /// ```
4083 pub fn set_vpn_tunnel<T: std::convert::Into<std::boxed::Box<crate::model::VpnTunnelInfo>>>(
4084 mut self,
4085 v: T,
4086 ) -> Self {
4087 self.step_info =
4088 std::option::Option::Some(crate::model::step::StepInfo::VpnTunnel(v.into()));
4089 self
4090 }
4091
4092 /// The value of [step_info][crate::model::Step::step_info]
4093 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
4094 /// holds a different branch.
4095 pub fn interconnect_attachment(
4096 &self,
4097 ) -> std::option::Option<&std::boxed::Box<crate::model::InterconnectAttachmentInfo>> {
4098 #[allow(unreachable_patterns)]
4099 self.step_info.as_ref().and_then(|v| match v {
4100 crate::model::step::StepInfo::InterconnectAttachment(v) => std::option::Option::Some(v),
4101 _ => std::option::Option::None,
4102 })
4103 }
4104
4105 /// Sets the value of [step_info][crate::model::Step::step_info]
4106 /// to hold a `InterconnectAttachment`.
4107 ///
4108 /// Note that all the setters affecting `step_info` are
4109 /// mutually exclusive.
4110 ///
4111 /// # Example
4112 /// ```ignore,no_run
4113 /// # use google_cloud_networkmanagement_v1::model::Step;
4114 /// use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
4115 /// let x = Step::new().set_interconnect_attachment(InterconnectAttachmentInfo::default()/* use setters */);
4116 /// assert!(x.interconnect_attachment().is_some());
4117 /// assert!(x.instance().is_none());
4118 /// assert!(x.firewall().is_none());
4119 /// assert!(x.route().is_none());
4120 /// assert!(x.endpoint().is_none());
4121 /// assert!(x.google_service().is_none());
4122 /// assert!(x.forwarding_rule().is_none());
4123 /// assert!(x.hybrid_subnet().is_none());
4124 /// assert!(x.vpn_gateway().is_none());
4125 /// assert!(x.vpn_tunnel().is_none());
4126 /// assert!(x.vpc_connector().is_none());
4127 /// assert!(x.direct_vpc_egress_connection().is_none());
4128 /// assert!(x.serverless_external_connection().is_none());
4129 /// assert!(x.deliver().is_none());
4130 /// assert!(x.forward().is_none());
4131 /// assert!(x.abort().is_none());
4132 /// assert!(x.drop().is_none());
4133 /// assert!(x.load_balancer().is_none());
4134 /// assert!(x.network().is_none());
4135 /// assert!(x.gke_master().is_none());
4136 /// assert!(x.gke_pod().is_none());
4137 /// assert!(x.ip_masquerading_skipped().is_none());
4138 /// assert!(x.cloud_sql_instance().is_none());
4139 /// assert!(x.redis_instance().is_none());
4140 /// assert!(x.redis_cluster().is_none());
4141 /// assert!(x.cloud_function().is_none());
4142 /// assert!(x.app_engine_version().is_none());
4143 /// assert!(x.cloud_run_revision().is_none());
4144 /// assert!(x.nat().is_none());
4145 /// assert!(x.proxy_connection().is_none());
4146 /// assert!(x.load_balancer_backend_info().is_none());
4147 /// assert!(x.storage_bucket().is_none());
4148 /// assert!(x.serverless_neg().is_none());
4149 /// ```
4150 pub fn set_interconnect_attachment<
4151 T: std::convert::Into<std::boxed::Box<crate::model::InterconnectAttachmentInfo>>,
4152 >(
4153 mut self,
4154 v: T,
4155 ) -> Self {
4156 self.step_info = std::option::Option::Some(
4157 crate::model::step::StepInfo::InterconnectAttachment(v.into()),
4158 );
4159 self
4160 }
4161
4162 /// The value of [step_info][crate::model::Step::step_info]
4163 /// if it holds a `VpcConnector`, `None` if the field is not set or
4164 /// holds a different branch.
4165 pub fn vpc_connector(
4166 &self,
4167 ) -> std::option::Option<&std::boxed::Box<crate::model::VpcConnectorInfo>> {
4168 #[allow(unreachable_patterns)]
4169 self.step_info.as_ref().and_then(|v| match v {
4170 crate::model::step::StepInfo::VpcConnector(v) => std::option::Option::Some(v),
4171 _ => std::option::Option::None,
4172 })
4173 }
4174
4175 /// Sets the value of [step_info][crate::model::Step::step_info]
4176 /// to hold a `VpcConnector`.
4177 ///
4178 /// Note that all the setters affecting `step_info` are
4179 /// mutually exclusive.
4180 ///
4181 /// # Example
4182 /// ```ignore,no_run
4183 /// # use google_cloud_networkmanagement_v1::model::Step;
4184 /// use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
4185 /// let x = Step::new().set_vpc_connector(VpcConnectorInfo::default()/* use setters */);
4186 /// assert!(x.vpc_connector().is_some());
4187 /// assert!(x.instance().is_none());
4188 /// assert!(x.firewall().is_none());
4189 /// assert!(x.route().is_none());
4190 /// assert!(x.endpoint().is_none());
4191 /// assert!(x.google_service().is_none());
4192 /// assert!(x.forwarding_rule().is_none());
4193 /// assert!(x.hybrid_subnet().is_none());
4194 /// assert!(x.vpn_gateway().is_none());
4195 /// assert!(x.vpn_tunnel().is_none());
4196 /// assert!(x.interconnect_attachment().is_none());
4197 /// assert!(x.direct_vpc_egress_connection().is_none());
4198 /// assert!(x.serverless_external_connection().is_none());
4199 /// assert!(x.deliver().is_none());
4200 /// assert!(x.forward().is_none());
4201 /// assert!(x.abort().is_none());
4202 /// assert!(x.drop().is_none());
4203 /// assert!(x.load_balancer().is_none());
4204 /// assert!(x.network().is_none());
4205 /// assert!(x.gke_master().is_none());
4206 /// assert!(x.gke_pod().is_none());
4207 /// assert!(x.ip_masquerading_skipped().is_none());
4208 /// assert!(x.cloud_sql_instance().is_none());
4209 /// assert!(x.redis_instance().is_none());
4210 /// assert!(x.redis_cluster().is_none());
4211 /// assert!(x.cloud_function().is_none());
4212 /// assert!(x.app_engine_version().is_none());
4213 /// assert!(x.cloud_run_revision().is_none());
4214 /// assert!(x.nat().is_none());
4215 /// assert!(x.proxy_connection().is_none());
4216 /// assert!(x.load_balancer_backend_info().is_none());
4217 /// assert!(x.storage_bucket().is_none());
4218 /// assert!(x.serverless_neg().is_none());
4219 /// ```
4220 pub fn set_vpc_connector<
4221 T: std::convert::Into<std::boxed::Box<crate::model::VpcConnectorInfo>>,
4222 >(
4223 mut self,
4224 v: T,
4225 ) -> Self {
4226 self.step_info =
4227 std::option::Option::Some(crate::model::step::StepInfo::VpcConnector(v.into()));
4228 self
4229 }
4230
4231 /// The value of [step_info][crate::model::Step::step_info]
4232 /// if it holds a `DirectVpcEgressConnection`, `None` if the field is not set or
4233 /// holds a different branch.
4234 pub fn direct_vpc_egress_connection(
4235 &self,
4236 ) -> std::option::Option<&std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>> {
4237 #[allow(unreachable_patterns)]
4238 self.step_info.as_ref().and_then(|v| match v {
4239 crate::model::step::StepInfo::DirectVpcEgressConnection(v) => {
4240 std::option::Option::Some(v)
4241 }
4242 _ => std::option::Option::None,
4243 })
4244 }
4245
4246 /// Sets the value of [step_info][crate::model::Step::step_info]
4247 /// to hold a `DirectVpcEgressConnection`.
4248 ///
4249 /// Note that all the setters affecting `step_info` are
4250 /// mutually exclusive.
4251 ///
4252 /// # Example
4253 /// ```ignore,no_run
4254 /// # use google_cloud_networkmanagement_v1::model::Step;
4255 /// use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
4256 /// let x = Step::new().set_direct_vpc_egress_connection(DirectVpcEgressConnectionInfo::default()/* use setters */);
4257 /// assert!(x.direct_vpc_egress_connection().is_some());
4258 /// assert!(x.instance().is_none());
4259 /// assert!(x.firewall().is_none());
4260 /// assert!(x.route().is_none());
4261 /// assert!(x.endpoint().is_none());
4262 /// assert!(x.google_service().is_none());
4263 /// assert!(x.forwarding_rule().is_none());
4264 /// assert!(x.hybrid_subnet().is_none());
4265 /// assert!(x.vpn_gateway().is_none());
4266 /// assert!(x.vpn_tunnel().is_none());
4267 /// assert!(x.interconnect_attachment().is_none());
4268 /// assert!(x.vpc_connector().is_none());
4269 /// assert!(x.serverless_external_connection().is_none());
4270 /// assert!(x.deliver().is_none());
4271 /// assert!(x.forward().is_none());
4272 /// assert!(x.abort().is_none());
4273 /// assert!(x.drop().is_none());
4274 /// assert!(x.load_balancer().is_none());
4275 /// assert!(x.network().is_none());
4276 /// assert!(x.gke_master().is_none());
4277 /// assert!(x.gke_pod().is_none());
4278 /// assert!(x.ip_masquerading_skipped().is_none());
4279 /// assert!(x.cloud_sql_instance().is_none());
4280 /// assert!(x.redis_instance().is_none());
4281 /// assert!(x.redis_cluster().is_none());
4282 /// assert!(x.cloud_function().is_none());
4283 /// assert!(x.app_engine_version().is_none());
4284 /// assert!(x.cloud_run_revision().is_none());
4285 /// assert!(x.nat().is_none());
4286 /// assert!(x.proxy_connection().is_none());
4287 /// assert!(x.load_balancer_backend_info().is_none());
4288 /// assert!(x.storage_bucket().is_none());
4289 /// assert!(x.serverless_neg().is_none());
4290 /// ```
4291 pub fn set_direct_vpc_egress_connection<
4292 T: std::convert::Into<std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>>,
4293 >(
4294 mut self,
4295 v: T,
4296 ) -> Self {
4297 self.step_info = std::option::Option::Some(
4298 crate::model::step::StepInfo::DirectVpcEgressConnection(v.into()),
4299 );
4300 self
4301 }
4302
4303 /// The value of [step_info][crate::model::Step::step_info]
4304 /// if it holds a `ServerlessExternalConnection`, `None` if the field is not set or
4305 /// holds a different branch.
4306 pub fn serverless_external_connection(
4307 &self,
4308 ) -> std::option::Option<&std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>> {
4309 #[allow(unreachable_patterns)]
4310 self.step_info.as_ref().and_then(|v| match v {
4311 crate::model::step::StepInfo::ServerlessExternalConnection(v) => {
4312 std::option::Option::Some(v)
4313 }
4314 _ => std::option::Option::None,
4315 })
4316 }
4317
4318 /// Sets the value of [step_info][crate::model::Step::step_info]
4319 /// to hold a `ServerlessExternalConnection`.
4320 ///
4321 /// Note that all the setters affecting `step_info` are
4322 /// mutually exclusive.
4323 ///
4324 /// # Example
4325 /// ```ignore,no_run
4326 /// # use google_cloud_networkmanagement_v1::model::Step;
4327 /// use google_cloud_networkmanagement_v1::model::ServerlessExternalConnectionInfo;
4328 /// let x = Step::new().set_serverless_external_connection(ServerlessExternalConnectionInfo::default()/* use setters */);
4329 /// assert!(x.serverless_external_connection().is_some());
4330 /// assert!(x.instance().is_none());
4331 /// assert!(x.firewall().is_none());
4332 /// assert!(x.route().is_none());
4333 /// assert!(x.endpoint().is_none());
4334 /// assert!(x.google_service().is_none());
4335 /// assert!(x.forwarding_rule().is_none());
4336 /// assert!(x.hybrid_subnet().is_none());
4337 /// assert!(x.vpn_gateway().is_none());
4338 /// assert!(x.vpn_tunnel().is_none());
4339 /// assert!(x.interconnect_attachment().is_none());
4340 /// assert!(x.vpc_connector().is_none());
4341 /// assert!(x.direct_vpc_egress_connection().is_none());
4342 /// assert!(x.deliver().is_none());
4343 /// assert!(x.forward().is_none());
4344 /// assert!(x.abort().is_none());
4345 /// assert!(x.drop().is_none());
4346 /// assert!(x.load_balancer().is_none());
4347 /// assert!(x.network().is_none());
4348 /// assert!(x.gke_master().is_none());
4349 /// assert!(x.gke_pod().is_none());
4350 /// assert!(x.ip_masquerading_skipped().is_none());
4351 /// assert!(x.cloud_sql_instance().is_none());
4352 /// assert!(x.redis_instance().is_none());
4353 /// assert!(x.redis_cluster().is_none());
4354 /// assert!(x.cloud_function().is_none());
4355 /// assert!(x.app_engine_version().is_none());
4356 /// assert!(x.cloud_run_revision().is_none());
4357 /// assert!(x.nat().is_none());
4358 /// assert!(x.proxy_connection().is_none());
4359 /// assert!(x.load_balancer_backend_info().is_none());
4360 /// assert!(x.storage_bucket().is_none());
4361 /// assert!(x.serverless_neg().is_none());
4362 /// ```
4363 pub fn set_serverless_external_connection<
4364 T: std::convert::Into<std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>>,
4365 >(
4366 mut self,
4367 v: T,
4368 ) -> Self {
4369 self.step_info = std::option::Option::Some(
4370 crate::model::step::StepInfo::ServerlessExternalConnection(v.into()),
4371 );
4372 self
4373 }
4374
4375 /// The value of [step_info][crate::model::Step::step_info]
4376 /// if it holds a `Deliver`, `None` if the field is not set or
4377 /// holds a different branch.
4378 pub fn deliver(&self) -> std::option::Option<&std::boxed::Box<crate::model::DeliverInfo>> {
4379 #[allow(unreachable_patterns)]
4380 self.step_info.as_ref().and_then(|v| match v {
4381 crate::model::step::StepInfo::Deliver(v) => std::option::Option::Some(v),
4382 _ => std::option::Option::None,
4383 })
4384 }
4385
4386 /// Sets the value of [step_info][crate::model::Step::step_info]
4387 /// to hold a `Deliver`.
4388 ///
4389 /// Note that all the setters affecting `step_info` are
4390 /// mutually exclusive.
4391 ///
4392 /// # Example
4393 /// ```ignore,no_run
4394 /// # use google_cloud_networkmanagement_v1::model::Step;
4395 /// use google_cloud_networkmanagement_v1::model::DeliverInfo;
4396 /// let x = Step::new().set_deliver(DeliverInfo::default()/* use setters */);
4397 /// assert!(x.deliver().is_some());
4398 /// assert!(x.instance().is_none());
4399 /// assert!(x.firewall().is_none());
4400 /// assert!(x.route().is_none());
4401 /// assert!(x.endpoint().is_none());
4402 /// assert!(x.google_service().is_none());
4403 /// assert!(x.forwarding_rule().is_none());
4404 /// assert!(x.hybrid_subnet().is_none());
4405 /// assert!(x.vpn_gateway().is_none());
4406 /// assert!(x.vpn_tunnel().is_none());
4407 /// assert!(x.interconnect_attachment().is_none());
4408 /// assert!(x.vpc_connector().is_none());
4409 /// assert!(x.direct_vpc_egress_connection().is_none());
4410 /// assert!(x.serverless_external_connection().is_none());
4411 /// assert!(x.forward().is_none());
4412 /// assert!(x.abort().is_none());
4413 /// assert!(x.drop().is_none());
4414 /// assert!(x.load_balancer().is_none());
4415 /// assert!(x.network().is_none());
4416 /// assert!(x.gke_master().is_none());
4417 /// assert!(x.gke_pod().is_none());
4418 /// assert!(x.ip_masquerading_skipped().is_none());
4419 /// assert!(x.cloud_sql_instance().is_none());
4420 /// assert!(x.redis_instance().is_none());
4421 /// assert!(x.redis_cluster().is_none());
4422 /// assert!(x.cloud_function().is_none());
4423 /// assert!(x.app_engine_version().is_none());
4424 /// assert!(x.cloud_run_revision().is_none());
4425 /// assert!(x.nat().is_none());
4426 /// assert!(x.proxy_connection().is_none());
4427 /// assert!(x.load_balancer_backend_info().is_none());
4428 /// assert!(x.storage_bucket().is_none());
4429 /// assert!(x.serverless_neg().is_none());
4430 /// ```
4431 pub fn set_deliver<T: std::convert::Into<std::boxed::Box<crate::model::DeliverInfo>>>(
4432 mut self,
4433 v: T,
4434 ) -> Self {
4435 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Deliver(v.into()));
4436 self
4437 }
4438
4439 /// The value of [step_info][crate::model::Step::step_info]
4440 /// if it holds a `Forward`, `None` if the field is not set or
4441 /// holds a different branch.
4442 pub fn forward(&self) -> std::option::Option<&std::boxed::Box<crate::model::ForwardInfo>> {
4443 #[allow(unreachable_patterns)]
4444 self.step_info.as_ref().and_then(|v| match v {
4445 crate::model::step::StepInfo::Forward(v) => std::option::Option::Some(v),
4446 _ => std::option::Option::None,
4447 })
4448 }
4449
4450 /// Sets the value of [step_info][crate::model::Step::step_info]
4451 /// to hold a `Forward`.
4452 ///
4453 /// Note that all the setters affecting `step_info` are
4454 /// mutually exclusive.
4455 ///
4456 /// # Example
4457 /// ```ignore,no_run
4458 /// # use google_cloud_networkmanagement_v1::model::Step;
4459 /// use google_cloud_networkmanagement_v1::model::ForwardInfo;
4460 /// let x = Step::new().set_forward(ForwardInfo::default()/* use setters */);
4461 /// assert!(x.forward().is_some());
4462 /// assert!(x.instance().is_none());
4463 /// assert!(x.firewall().is_none());
4464 /// assert!(x.route().is_none());
4465 /// assert!(x.endpoint().is_none());
4466 /// assert!(x.google_service().is_none());
4467 /// assert!(x.forwarding_rule().is_none());
4468 /// assert!(x.hybrid_subnet().is_none());
4469 /// assert!(x.vpn_gateway().is_none());
4470 /// assert!(x.vpn_tunnel().is_none());
4471 /// assert!(x.interconnect_attachment().is_none());
4472 /// assert!(x.vpc_connector().is_none());
4473 /// assert!(x.direct_vpc_egress_connection().is_none());
4474 /// assert!(x.serverless_external_connection().is_none());
4475 /// assert!(x.deliver().is_none());
4476 /// assert!(x.abort().is_none());
4477 /// assert!(x.drop().is_none());
4478 /// assert!(x.load_balancer().is_none());
4479 /// assert!(x.network().is_none());
4480 /// assert!(x.gke_master().is_none());
4481 /// assert!(x.gke_pod().is_none());
4482 /// assert!(x.ip_masquerading_skipped().is_none());
4483 /// assert!(x.cloud_sql_instance().is_none());
4484 /// assert!(x.redis_instance().is_none());
4485 /// assert!(x.redis_cluster().is_none());
4486 /// assert!(x.cloud_function().is_none());
4487 /// assert!(x.app_engine_version().is_none());
4488 /// assert!(x.cloud_run_revision().is_none());
4489 /// assert!(x.nat().is_none());
4490 /// assert!(x.proxy_connection().is_none());
4491 /// assert!(x.load_balancer_backend_info().is_none());
4492 /// assert!(x.storage_bucket().is_none());
4493 /// assert!(x.serverless_neg().is_none());
4494 /// ```
4495 pub fn set_forward<T: std::convert::Into<std::boxed::Box<crate::model::ForwardInfo>>>(
4496 mut self,
4497 v: T,
4498 ) -> Self {
4499 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Forward(v.into()));
4500 self
4501 }
4502
4503 /// The value of [step_info][crate::model::Step::step_info]
4504 /// if it holds a `Abort`, `None` if the field is not set or
4505 /// holds a different branch.
4506 pub fn abort(&self) -> std::option::Option<&std::boxed::Box<crate::model::AbortInfo>> {
4507 #[allow(unreachable_patterns)]
4508 self.step_info.as_ref().and_then(|v| match v {
4509 crate::model::step::StepInfo::Abort(v) => std::option::Option::Some(v),
4510 _ => std::option::Option::None,
4511 })
4512 }
4513
4514 /// Sets the value of [step_info][crate::model::Step::step_info]
4515 /// to hold a `Abort`.
4516 ///
4517 /// Note that all the setters affecting `step_info` are
4518 /// mutually exclusive.
4519 ///
4520 /// # Example
4521 /// ```ignore,no_run
4522 /// # use google_cloud_networkmanagement_v1::model::Step;
4523 /// use google_cloud_networkmanagement_v1::model::AbortInfo;
4524 /// let x = Step::new().set_abort(AbortInfo::default()/* use setters */);
4525 /// assert!(x.abort().is_some());
4526 /// assert!(x.instance().is_none());
4527 /// assert!(x.firewall().is_none());
4528 /// assert!(x.route().is_none());
4529 /// assert!(x.endpoint().is_none());
4530 /// assert!(x.google_service().is_none());
4531 /// assert!(x.forwarding_rule().is_none());
4532 /// assert!(x.hybrid_subnet().is_none());
4533 /// assert!(x.vpn_gateway().is_none());
4534 /// assert!(x.vpn_tunnel().is_none());
4535 /// assert!(x.interconnect_attachment().is_none());
4536 /// assert!(x.vpc_connector().is_none());
4537 /// assert!(x.direct_vpc_egress_connection().is_none());
4538 /// assert!(x.serverless_external_connection().is_none());
4539 /// assert!(x.deliver().is_none());
4540 /// assert!(x.forward().is_none());
4541 /// assert!(x.drop().is_none());
4542 /// assert!(x.load_balancer().is_none());
4543 /// assert!(x.network().is_none());
4544 /// assert!(x.gke_master().is_none());
4545 /// assert!(x.gke_pod().is_none());
4546 /// assert!(x.ip_masquerading_skipped().is_none());
4547 /// assert!(x.cloud_sql_instance().is_none());
4548 /// assert!(x.redis_instance().is_none());
4549 /// assert!(x.redis_cluster().is_none());
4550 /// assert!(x.cloud_function().is_none());
4551 /// assert!(x.app_engine_version().is_none());
4552 /// assert!(x.cloud_run_revision().is_none());
4553 /// assert!(x.nat().is_none());
4554 /// assert!(x.proxy_connection().is_none());
4555 /// assert!(x.load_balancer_backend_info().is_none());
4556 /// assert!(x.storage_bucket().is_none());
4557 /// assert!(x.serverless_neg().is_none());
4558 /// ```
4559 pub fn set_abort<T: std::convert::Into<std::boxed::Box<crate::model::AbortInfo>>>(
4560 mut self,
4561 v: T,
4562 ) -> Self {
4563 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Abort(v.into()));
4564 self
4565 }
4566
4567 /// The value of [step_info][crate::model::Step::step_info]
4568 /// if it holds a `Drop`, `None` if the field is not set or
4569 /// holds a different branch.
4570 pub fn drop(&self) -> std::option::Option<&std::boxed::Box<crate::model::DropInfo>> {
4571 #[allow(unreachable_patterns)]
4572 self.step_info.as_ref().and_then(|v| match v {
4573 crate::model::step::StepInfo::Drop(v) => std::option::Option::Some(v),
4574 _ => std::option::Option::None,
4575 })
4576 }
4577
4578 /// Sets the value of [step_info][crate::model::Step::step_info]
4579 /// to hold a `Drop`.
4580 ///
4581 /// Note that all the setters affecting `step_info` are
4582 /// mutually exclusive.
4583 ///
4584 /// # Example
4585 /// ```ignore,no_run
4586 /// # use google_cloud_networkmanagement_v1::model::Step;
4587 /// use google_cloud_networkmanagement_v1::model::DropInfo;
4588 /// let x = Step::new().set_drop(DropInfo::default()/* use setters */);
4589 /// assert!(x.drop().is_some());
4590 /// assert!(x.instance().is_none());
4591 /// assert!(x.firewall().is_none());
4592 /// assert!(x.route().is_none());
4593 /// assert!(x.endpoint().is_none());
4594 /// assert!(x.google_service().is_none());
4595 /// assert!(x.forwarding_rule().is_none());
4596 /// assert!(x.hybrid_subnet().is_none());
4597 /// assert!(x.vpn_gateway().is_none());
4598 /// assert!(x.vpn_tunnel().is_none());
4599 /// assert!(x.interconnect_attachment().is_none());
4600 /// assert!(x.vpc_connector().is_none());
4601 /// assert!(x.direct_vpc_egress_connection().is_none());
4602 /// assert!(x.serverless_external_connection().is_none());
4603 /// assert!(x.deliver().is_none());
4604 /// assert!(x.forward().is_none());
4605 /// assert!(x.abort().is_none());
4606 /// assert!(x.load_balancer().is_none());
4607 /// assert!(x.network().is_none());
4608 /// assert!(x.gke_master().is_none());
4609 /// assert!(x.gke_pod().is_none());
4610 /// assert!(x.ip_masquerading_skipped().is_none());
4611 /// assert!(x.cloud_sql_instance().is_none());
4612 /// assert!(x.redis_instance().is_none());
4613 /// assert!(x.redis_cluster().is_none());
4614 /// assert!(x.cloud_function().is_none());
4615 /// assert!(x.app_engine_version().is_none());
4616 /// assert!(x.cloud_run_revision().is_none());
4617 /// assert!(x.nat().is_none());
4618 /// assert!(x.proxy_connection().is_none());
4619 /// assert!(x.load_balancer_backend_info().is_none());
4620 /// assert!(x.storage_bucket().is_none());
4621 /// assert!(x.serverless_neg().is_none());
4622 /// ```
4623 pub fn set_drop<T: std::convert::Into<std::boxed::Box<crate::model::DropInfo>>>(
4624 mut self,
4625 v: T,
4626 ) -> Self {
4627 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Drop(v.into()));
4628 self
4629 }
4630
4631 /// The value of [step_info][crate::model::Step::step_info]
4632 /// if it holds a `LoadBalancer`, `None` if the field is not set or
4633 /// holds a different branch.
4634 #[deprecated]
4635 pub fn load_balancer(
4636 &self,
4637 ) -> std::option::Option<&std::boxed::Box<crate::model::LoadBalancerInfo>> {
4638 #[allow(unreachable_patterns)]
4639 self.step_info.as_ref().and_then(|v| match v {
4640 crate::model::step::StepInfo::LoadBalancer(v) => std::option::Option::Some(v),
4641 _ => std::option::Option::None,
4642 })
4643 }
4644
4645 /// Sets the value of [step_info][crate::model::Step::step_info]
4646 /// to hold a `LoadBalancer`.
4647 ///
4648 /// Note that all the setters affecting `step_info` are
4649 /// mutually exclusive.
4650 ///
4651 /// # Example
4652 /// ```ignore,no_run
4653 /// # use google_cloud_networkmanagement_v1::model::Step;
4654 /// use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
4655 /// let x = Step::new().set_load_balancer(LoadBalancerInfo::default()/* use setters */);
4656 /// assert!(x.load_balancer().is_some());
4657 /// assert!(x.instance().is_none());
4658 /// assert!(x.firewall().is_none());
4659 /// assert!(x.route().is_none());
4660 /// assert!(x.endpoint().is_none());
4661 /// assert!(x.google_service().is_none());
4662 /// assert!(x.forwarding_rule().is_none());
4663 /// assert!(x.hybrid_subnet().is_none());
4664 /// assert!(x.vpn_gateway().is_none());
4665 /// assert!(x.vpn_tunnel().is_none());
4666 /// assert!(x.interconnect_attachment().is_none());
4667 /// assert!(x.vpc_connector().is_none());
4668 /// assert!(x.direct_vpc_egress_connection().is_none());
4669 /// assert!(x.serverless_external_connection().is_none());
4670 /// assert!(x.deliver().is_none());
4671 /// assert!(x.forward().is_none());
4672 /// assert!(x.abort().is_none());
4673 /// assert!(x.drop().is_none());
4674 /// assert!(x.network().is_none());
4675 /// assert!(x.gke_master().is_none());
4676 /// assert!(x.gke_pod().is_none());
4677 /// assert!(x.ip_masquerading_skipped().is_none());
4678 /// assert!(x.cloud_sql_instance().is_none());
4679 /// assert!(x.redis_instance().is_none());
4680 /// assert!(x.redis_cluster().is_none());
4681 /// assert!(x.cloud_function().is_none());
4682 /// assert!(x.app_engine_version().is_none());
4683 /// assert!(x.cloud_run_revision().is_none());
4684 /// assert!(x.nat().is_none());
4685 /// assert!(x.proxy_connection().is_none());
4686 /// assert!(x.load_balancer_backend_info().is_none());
4687 /// assert!(x.storage_bucket().is_none());
4688 /// assert!(x.serverless_neg().is_none());
4689 /// ```
4690 #[deprecated]
4691 pub fn set_load_balancer<
4692 T: std::convert::Into<std::boxed::Box<crate::model::LoadBalancerInfo>>,
4693 >(
4694 mut self,
4695 v: T,
4696 ) -> Self {
4697 self.step_info =
4698 std::option::Option::Some(crate::model::step::StepInfo::LoadBalancer(v.into()));
4699 self
4700 }
4701
4702 /// The value of [step_info][crate::model::Step::step_info]
4703 /// if it holds a `Network`, `None` if the field is not set or
4704 /// holds a different branch.
4705 pub fn network(&self) -> std::option::Option<&std::boxed::Box<crate::model::NetworkInfo>> {
4706 #[allow(unreachable_patterns)]
4707 self.step_info.as_ref().and_then(|v| match v {
4708 crate::model::step::StepInfo::Network(v) => std::option::Option::Some(v),
4709 _ => std::option::Option::None,
4710 })
4711 }
4712
4713 /// Sets the value of [step_info][crate::model::Step::step_info]
4714 /// to hold a `Network`.
4715 ///
4716 /// Note that all the setters affecting `step_info` are
4717 /// mutually exclusive.
4718 ///
4719 /// # Example
4720 /// ```ignore,no_run
4721 /// # use google_cloud_networkmanagement_v1::model::Step;
4722 /// use google_cloud_networkmanagement_v1::model::NetworkInfo;
4723 /// let x = Step::new().set_network(NetworkInfo::default()/* use setters */);
4724 /// assert!(x.network().is_some());
4725 /// assert!(x.instance().is_none());
4726 /// assert!(x.firewall().is_none());
4727 /// assert!(x.route().is_none());
4728 /// assert!(x.endpoint().is_none());
4729 /// assert!(x.google_service().is_none());
4730 /// assert!(x.forwarding_rule().is_none());
4731 /// assert!(x.hybrid_subnet().is_none());
4732 /// assert!(x.vpn_gateway().is_none());
4733 /// assert!(x.vpn_tunnel().is_none());
4734 /// assert!(x.interconnect_attachment().is_none());
4735 /// assert!(x.vpc_connector().is_none());
4736 /// assert!(x.direct_vpc_egress_connection().is_none());
4737 /// assert!(x.serverless_external_connection().is_none());
4738 /// assert!(x.deliver().is_none());
4739 /// assert!(x.forward().is_none());
4740 /// assert!(x.abort().is_none());
4741 /// assert!(x.drop().is_none());
4742 /// assert!(x.load_balancer().is_none());
4743 /// assert!(x.gke_master().is_none());
4744 /// assert!(x.gke_pod().is_none());
4745 /// assert!(x.ip_masquerading_skipped().is_none());
4746 /// assert!(x.cloud_sql_instance().is_none());
4747 /// assert!(x.redis_instance().is_none());
4748 /// assert!(x.redis_cluster().is_none());
4749 /// assert!(x.cloud_function().is_none());
4750 /// assert!(x.app_engine_version().is_none());
4751 /// assert!(x.cloud_run_revision().is_none());
4752 /// assert!(x.nat().is_none());
4753 /// assert!(x.proxy_connection().is_none());
4754 /// assert!(x.load_balancer_backend_info().is_none());
4755 /// assert!(x.storage_bucket().is_none());
4756 /// assert!(x.serverless_neg().is_none());
4757 /// ```
4758 pub fn set_network<T: std::convert::Into<std::boxed::Box<crate::model::NetworkInfo>>>(
4759 mut self,
4760 v: T,
4761 ) -> Self {
4762 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Network(v.into()));
4763 self
4764 }
4765
4766 /// The value of [step_info][crate::model::Step::step_info]
4767 /// if it holds a `GkeMaster`, `None` if the field is not set or
4768 /// holds a different branch.
4769 pub fn gke_master(&self) -> std::option::Option<&std::boxed::Box<crate::model::GKEMasterInfo>> {
4770 #[allow(unreachable_patterns)]
4771 self.step_info.as_ref().and_then(|v| match v {
4772 crate::model::step::StepInfo::GkeMaster(v) => std::option::Option::Some(v),
4773 _ => std::option::Option::None,
4774 })
4775 }
4776
4777 /// Sets the value of [step_info][crate::model::Step::step_info]
4778 /// to hold a `GkeMaster`.
4779 ///
4780 /// Note that all the setters affecting `step_info` are
4781 /// mutually exclusive.
4782 ///
4783 /// # Example
4784 /// ```ignore,no_run
4785 /// # use google_cloud_networkmanagement_v1::model::Step;
4786 /// use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
4787 /// let x = Step::new().set_gke_master(GKEMasterInfo::default()/* use setters */);
4788 /// assert!(x.gke_master().is_some());
4789 /// assert!(x.instance().is_none());
4790 /// assert!(x.firewall().is_none());
4791 /// assert!(x.route().is_none());
4792 /// assert!(x.endpoint().is_none());
4793 /// assert!(x.google_service().is_none());
4794 /// assert!(x.forwarding_rule().is_none());
4795 /// assert!(x.hybrid_subnet().is_none());
4796 /// assert!(x.vpn_gateway().is_none());
4797 /// assert!(x.vpn_tunnel().is_none());
4798 /// assert!(x.interconnect_attachment().is_none());
4799 /// assert!(x.vpc_connector().is_none());
4800 /// assert!(x.direct_vpc_egress_connection().is_none());
4801 /// assert!(x.serverless_external_connection().is_none());
4802 /// assert!(x.deliver().is_none());
4803 /// assert!(x.forward().is_none());
4804 /// assert!(x.abort().is_none());
4805 /// assert!(x.drop().is_none());
4806 /// assert!(x.load_balancer().is_none());
4807 /// assert!(x.network().is_none());
4808 /// assert!(x.gke_pod().is_none());
4809 /// assert!(x.ip_masquerading_skipped().is_none());
4810 /// assert!(x.cloud_sql_instance().is_none());
4811 /// assert!(x.redis_instance().is_none());
4812 /// assert!(x.redis_cluster().is_none());
4813 /// assert!(x.cloud_function().is_none());
4814 /// assert!(x.app_engine_version().is_none());
4815 /// assert!(x.cloud_run_revision().is_none());
4816 /// assert!(x.nat().is_none());
4817 /// assert!(x.proxy_connection().is_none());
4818 /// assert!(x.load_balancer_backend_info().is_none());
4819 /// assert!(x.storage_bucket().is_none());
4820 /// assert!(x.serverless_neg().is_none());
4821 /// ```
4822 pub fn set_gke_master<T: std::convert::Into<std::boxed::Box<crate::model::GKEMasterInfo>>>(
4823 mut self,
4824 v: T,
4825 ) -> Self {
4826 self.step_info =
4827 std::option::Option::Some(crate::model::step::StepInfo::GkeMaster(v.into()));
4828 self
4829 }
4830
4831 /// The value of [step_info][crate::model::Step::step_info]
4832 /// if it holds a `GkePod`, `None` if the field is not set or
4833 /// holds a different branch.
4834 pub fn gke_pod(&self) -> std::option::Option<&std::boxed::Box<crate::model::GkePodInfo>> {
4835 #[allow(unreachable_patterns)]
4836 self.step_info.as_ref().and_then(|v| match v {
4837 crate::model::step::StepInfo::GkePod(v) => std::option::Option::Some(v),
4838 _ => std::option::Option::None,
4839 })
4840 }
4841
4842 /// Sets the value of [step_info][crate::model::Step::step_info]
4843 /// to hold a `GkePod`.
4844 ///
4845 /// Note that all the setters affecting `step_info` are
4846 /// mutually exclusive.
4847 ///
4848 /// # Example
4849 /// ```ignore,no_run
4850 /// # use google_cloud_networkmanagement_v1::model::Step;
4851 /// use google_cloud_networkmanagement_v1::model::GkePodInfo;
4852 /// let x = Step::new().set_gke_pod(GkePodInfo::default()/* use setters */);
4853 /// assert!(x.gke_pod().is_some());
4854 /// assert!(x.instance().is_none());
4855 /// assert!(x.firewall().is_none());
4856 /// assert!(x.route().is_none());
4857 /// assert!(x.endpoint().is_none());
4858 /// assert!(x.google_service().is_none());
4859 /// assert!(x.forwarding_rule().is_none());
4860 /// assert!(x.hybrid_subnet().is_none());
4861 /// assert!(x.vpn_gateway().is_none());
4862 /// assert!(x.vpn_tunnel().is_none());
4863 /// assert!(x.interconnect_attachment().is_none());
4864 /// assert!(x.vpc_connector().is_none());
4865 /// assert!(x.direct_vpc_egress_connection().is_none());
4866 /// assert!(x.serverless_external_connection().is_none());
4867 /// assert!(x.deliver().is_none());
4868 /// assert!(x.forward().is_none());
4869 /// assert!(x.abort().is_none());
4870 /// assert!(x.drop().is_none());
4871 /// assert!(x.load_balancer().is_none());
4872 /// assert!(x.network().is_none());
4873 /// assert!(x.gke_master().is_none());
4874 /// assert!(x.ip_masquerading_skipped().is_none());
4875 /// assert!(x.cloud_sql_instance().is_none());
4876 /// assert!(x.redis_instance().is_none());
4877 /// assert!(x.redis_cluster().is_none());
4878 /// assert!(x.cloud_function().is_none());
4879 /// assert!(x.app_engine_version().is_none());
4880 /// assert!(x.cloud_run_revision().is_none());
4881 /// assert!(x.nat().is_none());
4882 /// assert!(x.proxy_connection().is_none());
4883 /// assert!(x.load_balancer_backend_info().is_none());
4884 /// assert!(x.storage_bucket().is_none());
4885 /// assert!(x.serverless_neg().is_none());
4886 /// ```
4887 pub fn set_gke_pod<T: std::convert::Into<std::boxed::Box<crate::model::GkePodInfo>>>(
4888 mut self,
4889 v: T,
4890 ) -> Self {
4891 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::GkePod(v.into()));
4892 self
4893 }
4894
4895 /// The value of [step_info][crate::model::Step::step_info]
4896 /// if it holds a `IpMasqueradingSkipped`, `None` if the field is not set or
4897 /// holds a different branch.
4898 pub fn ip_masquerading_skipped(
4899 &self,
4900 ) -> std::option::Option<&std::boxed::Box<crate::model::IpMasqueradingSkippedInfo>> {
4901 #[allow(unreachable_patterns)]
4902 self.step_info.as_ref().and_then(|v| match v {
4903 crate::model::step::StepInfo::IpMasqueradingSkipped(v) => std::option::Option::Some(v),
4904 _ => std::option::Option::None,
4905 })
4906 }
4907
4908 /// Sets the value of [step_info][crate::model::Step::step_info]
4909 /// to hold a `IpMasqueradingSkipped`.
4910 ///
4911 /// Note that all the setters affecting `step_info` are
4912 /// mutually exclusive.
4913 ///
4914 /// # Example
4915 /// ```ignore,no_run
4916 /// # use google_cloud_networkmanagement_v1::model::Step;
4917 /// use google_cloud_networkmanagement_v1::model::IpMasqueradingSkippedInfo;
4918 /// let x = Step::new().set_ip_masquerading_skipped(IpMasqueradingSkippedInfo::default()/* use setters */);
4919 /// assert!(x.ip_masquerading_skipped().is_some());
4920 /// assert!(x.instance().is_none());
4921 /// assert!(x.firewall().is_none());
4922 /// assert!(x.route().is_none());
4923 /// assert!(x.endpoint().is_none());
4924 /// assert!(x.google_service().is_none());
4925 /// assert!(x.forwarding_rule().is_none());
4926 /// assert!(x.hybrid_subnet().is_none());
4927 /// assert!(x.vpn_gateway().is_none());
4928 /// assert!(x.vpn_tunnel().is_none());
4929 /// assert!(x.interconnect_attachment().is_none());
4930 /// assert!(x.vpc_connector().is_none());
4931 /// assert!(x.direct_vpc_egress_connection().is_none());
4932 /// assert!(x.serverless_external_connection().is_none());
4933 /// assert!(x.deliver().is_none());
4934 /// assert!(x.forward().is_none());
4935 /// assert!(x.abort().is_none());
4936 /// assert!(x.drop().is_none());
4937 /// assert!(x.load_balancer().is_none());
4938 /// assert!(x.network().is_none());
4939 /// assert!(x.gke_master().is_none());
4940 /// assert!(x.gke_pod().is_none());
4941 /// assert!(x.cloud_sql_instance().is_none());
4942 /// assert!(x.redis_instance().is_none());
4943 /// assert!(x.redis_cluster().is_none());
4944 /// assert!(x.cloud_function().is_none());
4945 /// assert!(x.app_engine_version().is_none());
4946 /// assert!(x.cloud_run_revision().is_none());
4947 /// assert!(x.nat().is_none());
4948 /// assert!(x.proxy_connection().is_none());
4949 /// assert!(x.load_balancer_backend_info().is_none());
4950 /// assert!(x.storage_bucket().is_none());
4951 /// assert!(x.serverless_neg().is_none());
4952 /// ```
4953 pub fn set_ip_masquerading_skipped<
4954 T: std::convert::Into<std::boxed::Box<crate::model::IpMasqueradingSkippedInfo>>,
4955 >(
4956 mut self,
4957 v: T,
4958 ) -> Self {
4959 self.step_info = std::option::Option::Some(
4960 crate::model::step::StepInfo::IpMasqueradingSkipped(v.into()),
4961 );
4962 self
4963 }
4964
4965 /// The value of [step_info][crate::model::Step::step_info]
4966 /// if it holds a `CloudSqlInstance`, `None` if the field is not set or
4967 /// holds a different branch.
4968 pub fn cloud_sql_instance(
4969 &self,
4970 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudSQLInstanceInfo>> {
4971 #[allow(unreachable_patterns)]
4972 self.step_info.as_ref().and_then(|v| match v {
4973 crate::model::step::StepInfo::CloudSqlInstance(v) => std::option::Option::Some(v),
4974 _ => std::option::Option::None,
4975 })
4976 }
4977
4978 /// Sets the value of [step_info][crate::model::Step::step_info]
4979 /// to hold a `CloudSqlInstance`.
4980 ///
4981 /// Note that all the setters affecting `step_info` are
4982 /// mutually exclusive.
4983 ///
4984 /// # Example
4985 /// ```ignore,no_run
4986 /// # use google_cloud_networkmanagement_v1::model::Step;
4987 /// use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
4988 /// let x = Step::new().set_cloud_sql_instance(CloudSQLInstanceInfo::default()/* use setters */);
4989 /// assert!(x.cloud_sql_instance().is_some());
4990 /// assert!(x.instance().is_none());
4991 /// assert!(x.firewall().is_none());
4992 /// assert!(x.route().is_none());
4993 /// assert!(x.endpoint().is_none());
4994 /// assert!(x.google_service().is_none());
4995 /// assert!(x.forwarding_rule().is_none());
4996 /// assert!(x.hybrid_subnet().is_none());
4997 /// assert!(x.vpn_gateway().is_none());
4998 /// assert!(x.vpn_tunnel().is_none());
4999 /// assert!(x.interconnect_attachment().is_none());
5000 /// assert!(x.vpc_connector().is_none());
5001 /// assert!(x.direct_vpc_egress_connection().is_none());
5002 /// assert!(x.serverless_external_connection().is_none());
5003 /// assert!(x.deliver().is_none());
5004 /// assert!(x.forward().is_none());
5005 /// assert!(x.abort().is_none());
5006 /// assert!(x.drop().is_none());
5007 /// assert!(x.load_balancer().is_none());
5008 /// assert!(x.network().is_none());
5009 /// assert!(x.gke_master().is_none());
5010 /// assert!(x.gke_pod().is_none());
5011 /// assert!(x.ip_masquerading_skipped().is_none());
5012 /// assert!(x.redis_instance().is_none());
5013 /// assert!(x.redis_cluster().is_none());
5014 /// assert!(x.cloud_function().is_none());
5015 /// assert!(x.app_engine_version().is_none());
5016 /// assert!(x.cloud_run_revision().is_none());
5017 /// assert!(x.nat().is_none());
5018 /// assert!(x.proxy_connection().is_none());
5019 /// assert!(x.load_balancer_backend_info().is_none());
5020 /// assert!(x.storage_bucket().is_none());
5021 /// assert!(x.serverless_neg().is_none());
5022 /// ```
5023 pub fn set_cloud_sql_instance<
5024 T: std::convert::Into<std::boxed::Box<crate::model::CloudSQLInstanceInfo>>,
5025 >(
5026 mut self,
5027 v: T,
5028 ) -> Self {
5029 self.step_info =
5030 std::option::Option::Some(crate::model::step::StepInfo::CloudSqlInstance(v.into()));
5031 self
5032 }
5033
5034 /// The value of [step_info][crate::model::Step::step_info]
5035 /// if it holds a `RedisInstance`, `None` if the field is not set or
5036 /// holds a different branch.
5037 pub fn redis_instance(
5038 &self,
5039 ) -> std::option::Option<&std::boxed::Box<crate::model::RedisInstanceInfo>> {
5040 #[allow(unreachable_patterns)]
5041 self.step_info.as_ref().and_then(|v| match v {
5042 crate::model::step::StepInfo::RedisInstance(v) => std::option::Option::Some(v),
5043 _ => std::option::Option::None,
5044 })
5045 }
5046
5047 /// Sets the value of [step_info][crate::model::Step::step_info]
5048 /// to hold a `RedisInstance`.
5049 ///
5050 /// Note that all the setters affecting `step_info` are
5051 /// mutually exclusive.
5052 ///
5053 /// # Example
5054 /// ```ignore,no_run
5055 /// # use google_cloud_networkmanagement_v1::model::Step;
5056 /// use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
5057 /// let x = Step::new().set_redis_instance(RedisInstanceInfo::default()/* use setters */);
5058 /// assert!(x.redis_instance().is_some());
5059 /// assert!(x.instance().is_none());
5060 /// assert!(x.firewall().is_none());
5061 /// assert!(x.route().is_none());
5062 /// assert!(x.endpoint().is_none());
5063 /// assert!(x.google_service().is_none());
5064 /// assert!(x.forwarding_rule().is_none());
5065 /// assert!(x.hybrid_subnet().is_none());
5066 /// assert!(x.vpn_gateway().is_none());
5067 /// assert!(x.vpn_tunnel().is_none());
5068 /// assert!(x.interconnect_attachment().is_none());
5069 /// assert!(x.vpc_connector().is_none());
5070 /// assert!(x.direct_vpc_egress_connection().is_none());
5071 /// assert!(x.serverless_external_connection().is_none());
5072 /// assert!(x.deliver().is_none());
5073 /// assert!(x.forward().is_none());
5074 /// assert!(x.abort().is_none());
5075 /// assert!(x.drop().is_none());
5076 /// assert!(x.load_balancer().is_none());
5077 /// assert!(x.network().is_none());
5078 /// assert!(x.gke_master().is_none());
5079 /// assert!(x.gke_pod().is_none());
5080 /// assert!(x.ip_masquerading_skipped().is_none());
5081 /// assert!(x.cloud_sql_instance().is_none());
5082 /// assert!(x.redis_cluster().is_none());
5083 /// assert!(x.cloud_function().is_none());
5084 /// assert!(x.app_engine_version().is_none());
5085 /// assert!(x.cloud_run_revision().is_none());
5086 /// assert!(x.nat().is_none());
5087 /// assert!(x.proxy_connection().is_none());
5088 /// assert!(x.load_balancer_backend_info().is_none());
5089 /// assert!(x.storage_bucket().is_none());
5090 /// assert!(x.serverless_neg().is_none());
5091 /// ```
5092 pub fn set_redis_instance<
5093 T: std::convert::Into<std::boxed::Box<crate::model::RedisInstanceInfo>>,
5094 >(
5095 mut self,
5096 v: T,
5097 ) -> Self {
5098 self.step_info =
5099 std::option::Option::Some(crate::model::step::StepInfo::RedisInstance(v.into()));
5100 self
5101 }
5102
5103 /// The value of [step_info][crate::model::Step::step_info]
5104 /// if it holds a `RedisCluster`, `None` if the field is not set or
5105 /// holds a different branch.
5106 pub fn redis_cluster(
5107 &self,
5108 ) -> std::option::Option<&std::boxed::Box<crate::model::RedisClusterInfo>> {
5109 #[allow(unreachable_patterns)]
5110 self.step_info.as_ref().and_then(|v| match v {
5111 crate::model::step::StepInfo::RedisCluster(v) => std::option::Option::Some(v),
5112 _ => std::option::Option::None,
5113 })
5114 }
5115
5116 /// Sets the value of [step_info][crate::model::Step::step_info]
5117 /// to hold a `RedisCluster`.
5118 ///
5119 /// Note that all the setters affecting `step_info` are
5120 /// mutually exclusive.
5121 ///
5122 /// # Example
5123 /// ```ignore,no_run
5124 /// # use google_cloud_networkmanagement_v1::model::Step;
5125 /// use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
5126 /// let x = Step::new().set_redis_cluster(RedisClusterInfo::default()/* use setters */);
5127 /// assert!(x.redis_cluster().is_some());
5128 /// assert!(x.instance().is_none());
5129 /// assert!(x.firewall().is_none());
5130 /// assert!(x.route().is_none());
5131 /// assert!(x.endpoint().is_none());
5132 /// assert!(x.google_service().is_none());
5133 /// assert!(x.forwarding_rule().is_none());
5134 /// assert!(x.hybrid_subnet().is_none());
5135 /// assert!(x.vpn_gateway().is_none());
5136 /// assert!(x.vpn_tunnel().is_none());
5137 /// assert!(x.interconnect_attachment().is_none());
5138 /// assert!(x.vpc_connector().is_none());
5139 /// assert!(x.direct_vpc_egress_connection().is_none());
5140 /// assert!(x.serverless_external_connection().is_none());
5141 /// assert!(x.deliver().is_none());
5142 /// assert!(x.forward().is_none());
5143 /// assert!(x.abort().is_none());
5144 /// assert!(x.drop().is_none());
5145 /// assert!(x.load_balancer().is_none());
5146 /// assert!(x.network().is_none());
5147 /// assert!(x.gke_master().is_none());
5148 /// assert!(x.gke_pod().is_none());
5149 /// assert!(x.ip_masquerading_skipped().is_none());
5150 /// assert!(x.cloud_sql_instance().is_none());
5151 /// assert!(x.redis_instance().is_none());
5152 /// assert!(x.cloud_function().is_none());
5153 /// assert!(x.app_engine_version().is_none());
5154 /// assert!(x.cloud_run_revision().is_none());
5155 /// assert!(x.nat().is_none());
5156 /// assert!(x.proxy_connection().is_none());
5157 /// assert!(x.load_balancer_backend_info().is_none());
5158 /// assert!(x.storage_bucket().is_none());
5159 /// assert!(x.serverless_neg().is_none());
5160 /// ```
5161 pub fn set_redis_cluster<
5162 T: std::convert::Into<std::boxed::Box<crate::model::RedisClusterInfo>>,
5163 >(
5164 mut self,
5165 v: T,
5166 ) -> Self {
5167 self.step_info =
5168 std::option::Option::Some(crate::model::step::StepInfo::RedisCluster(v.into()));
5169 self
5170 }
5171
5172 /// The value of [step_info][crate::model::Step::step_info]
5173 /// if it holds a `CloudFunction`, `None` if the field is not set or
5174 /// holds a different branch.
5175 pub fn cloud_function(
5176 &self,
5177 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudFunctionInfo>> {
5178 #[allow(unreachable_patterns)]
5179 self.step_info.as_ref().and_then(|v| match v {
5180 crate::model::step::StepInfo::CloudFunction(v) => std::option::Option::Some(v),
5181 _ => std::option::Option::None,
5182 })
5183 }
5184
5185 /// Sets the value of [step_info][crate::model::Step::step_info]
5186 /// to hold a `CloudFunction`.
5187 ///
5188 /// Note that all the setters affecting `step_info` are
5189 /// mutually exclusive.
5190 ///
5191 /// # Example
5192 /// ```ignore,no_run
5193 /// # use google_cloud_networkmanagement_v1::model::Step;
5194 /// use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
5195 /// let x = Step::new().set_cloud_function(CloudFunctionInfo::default()/* use setters */);
5196 /// assert!(x.cloud_function().is_some());
5197 /// assert!(x.instance().is_none());
5198 /// assert!(x.firewall().is_none());
5199 /// assert!(x.route().is_none());
5200 /// assert!(x.endpoint().is_none());
5201 /// assert!(x.google_service().is_none());
5202 /// assert!(x.forwarding_rule().is_none());
5203 /// assert!(x.hybrid_subnet().is_none());
5204 /// assert!(x.vpn_gateway().is_none());
5205 /// assert!(x.vpn_tunnel().is_none());
5206 /// assert!(x.interconnect_attachment().is_none());
5207 /// assert!(x.vpc_connector().is_none());
5208 /// assert!(x.direct_vpc_egress_connection().is_none());
5209 /// assert!(x.serverless_external_connection().is_none());
5210 /// assert!(x.deliver().is_none());
5211 /// assert!(x.forward().is_none());
5212 /// assert!(x.abort().is_none());
5213 /// assert!(x.drop().is_none());
5214 /// assert!(x.load_balancer().is_none());
5215 /// assert!(x.network().is_none());
5216 /// assert!(x.gke_master().is_none());
5217 /// assert!(x.gke_pod().is_none());
5218 /// assert!(x.ip_masquerading_skipped().is_none());
5219 /// assert!(x.cloud_sql_instance().is_none());
5220 /// assert!(x.redis_instance().is_none());
5221 /// assert!(x.redis_cluster().is_none());
5222 /// assert!(x.app_engine_version().is_none());
5223 /// assert!(x.cloud_run_revision().is_none());
5224 /// assert!(x.nat().is_none());
5225 /// assert!(x.proxy_connection().is_none());
5226 /// assert!(x.load_balancer_backend_info().is_none());
5227 /// assert!(x.storage_bucket().is_none());
5228 /// assert!(x.serverless_neg().is_none());
5229 /// ```
5230 pub fn set_cloud_function<
5231 T: std::convert::Into<std::boxed::Box<crate::model::CloudFunctionInfo>>,
5232 >(
5233 mut self,
5234 v: T,
5235 ) -> Self {
5236 self.step_info =
5237 std::option::Option::Some(crate::model::step::StepInfo::CloudFunction(v.into()));
5238 self
5239 }
5240
5241 /// The value of [step_info][crate::model::Step::step_info]
5242 /// if it holds a `AppEngineVersion`, `None` if the field is not set or
5243 /// holds a different branch.
5244 pub fn app_engine_version(
5245 &self,
5246 ) -> std::option::Option<&std::boxed::Box<crate::model::AppEngineVersionInfo>> {
5247 #[allow(unreachable_patterns)]
5248 self.step_info.as_ref().and_then(|v| match v {
5249 crate::model::step::StepInfo::AppEngineVersion(v) => std::option::Option::Some(v),
5250 _ => std::option::Option::None,
5251 })
5252 }
5253
5254 /// Sets the value of [step_info][crate::model::Step::step_info]
5255 /// to hold a `AppEngineVersion`.
5256 ///
5257 /// Note that all the setters affecting `step_info` are
5258 /// mutually exclusive.
5259 ///
5260 /// # Example
5261 /// ```ignore,no_run
5262 /// # use google_cloud_networkmanagement_v1::model::Step;
5263 /// use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
5264 /// let x = Step::new().set_app_engine_version(AppEngineVersionInfo::default()/* use setters */);
5265 /// assert!(x.app_engine_version().is_some());
5266 /// assert!(x.instance().is_none());
5267 /// assert!(x.firewall().is_none());
5268 /// assert!(x.route().is_none());
5269 /// assert!(x.endpoint().is_none());
5270 /// assert!(x.google_service().is_none());
5271 /// assert!(x.forwarding_rule().is_none());
5272 /// assert!(x.hybrid_subnet().is_none());
5273 /// assert!(x.vpn_gateway().is_none());
5274 /// assert!(x.vpn_tunnel().is_none());
5275 /// assert!(x.interconnect_attachment().is_none());
5276 /// assert!(x.vpc_connector().is_none());
5277 /// assert!(x.direct_vpc_egress_connection().is_none());
5278 /// assert!(x.serverless_external_connection().is_none());
5279 /// assert!(x.deliver().is_none());
5280 /// assert!(x.forward().is_none());
5281 /// assert!(x.abort().is_none());
5282 /// assert!(x.drop().is_none());
5283 /// assert!(x.load_balancer().is_none());
5284 /// assert!(x.network().is_none());
5285 /// assert!(x.gke_master().is_none());
5286 /// assert!(x.gke_pod().is_none());
5287 /// assert!(x.ip_masquerading_skipped().is_none());
5288 /// assert!(x.cloud_sql_instance().is_none());
5289 /// assert!(x.redis_instance().is_none());
5290 /// assert!(x.redis_cluster().is_none());
5291 /// assert!(x.cloud_function().is_none());
5292 /// assert!(x.cloud_run_revision().is_none());
5293 /// assert!(x.nat().is_none());
5294 /// assert!(x.proxy_connection().is_none());
5295 /// assert!(x.load_balancer_backend_info().is_none());
5296 /// assert!(x.storage_bucket().is_none());
5297 /// assert!(x.serverless_neg().is_none());
5298 /// ```
5299 pub fn set_app_engine_version<
5300 T: std::convert::Into<std::boxed::Box<crate::model::AppEngineVersionInfo>>,
5301 >(
5302 mut self,
5303 v: T,
5304 ) -> Self {
5305 self.step_info =
5306 std::option::Option::Some(crate::model::step::StepInfo::AppEngineVersion(v.into()));
5307 self
5308 }
5309
5310 /// The value of [step_info][crate::model::Step::step_info]
5311 /// if it holds a `CloudRunRevision`, `None` if the field is not set or
5312 /// holds a different branch.
5313 pub fn cloud_run_revision(
5314 &self,
5315 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunRevisionInfo>> {
5316 #[allow(unreachable_patterns)]
5317 self.step_info.as_ref().and_then(|v| match v {
5318 crate::model::step::StepInfo::CloudRunRevision(v) => std::option::Option::Some(v),
5319 _ => std::option::Option::None,
5320 })
5321 }
5322
5323 /// Sets the value of [step_info][crate::model::Step::step_info]
5324 /// to hold a `CloudRunRevision`.
5325 ///
5326 /// Note that all the setters affecting `step_info` are
5327 /// mutually exclusive.
5328 ///
5329 /// # Example
5330 /// ```ignore,no_run
5331 /// # use google_cloud_networkmanagement_v1::model::Step;
5332 /// use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
5333 /// let x = Step::new().set_cloud_run_revision(CloudRunRevisionInfo::default()/* use setters */);
5334 /// assert!(x.cloud_run_revision().is_some());
5335 /// assert!(x.instance().is_none());
5336 /// assert!(x.firewall().is_none());
5337 /// assert!(x.route().is_none());
5338 /// assert!(x.endpoint().is_none());
5339 /// assert!(x.google_service().is_none());
5340 /// assert!(x.forwarding_rule().is_none());
5341 /// assert!(x.hybrid_subnet().is_none());
5342 /// assert!(x.vpn_gateway().is_none());
5343 /// assert!(x.vpn_tunnel().is_none());
5344 /// assert!(x.interconnect_attachment().is_none());
5345 /// assert!(x.vpc_connector().is_none());
5346 /// assert!(x.direct_vpc_egress_connection().is_none());
5347 /// assert!(x.serverless_external_connection().is_none());
5348 /// assert!(x.deliver().is_none());
5349 /// assert!(x.forward().is_none());
5350 /// assert!(x.abort().is_none());
5351 /// assert!(x.drop().is_none());
5352 /// assert!(x.load_balancer().is_none());
5353 /// assert!(x.network().is_none());
5354 /// assert!(x.gke_master().is_none());
5355 /// assert!(x.gke_pod().is_none());
5356 /// assert!(x.ip_masquerading_skipped().is_none());
5357 /// assert!(x.cloud_sql_instance().is_none());
5358 /// assert!(x.redis_instance().is_none());
5359 /// assert!(x.redis_cluster().is_none());
5360 /// assert!(x.cloud_function().is_none());
5361 /// assert!(x.app_engine_version().is_none());
5362 /// assert!(x.nat().is_none());
5363 /// assert!(x.proxy_connection().is_none());
5364 /// assert!(x.load_balancer_backend_info().is_none());
5365 /// assert!(x.storage_bucket().is_none());
5366 /// assert!(x.serverless_neg().is_none());
5367 /// ```
5368 pub fn set_cloud_run_revision<
5369 T: std::convert::Into<std::boxed::Box<crate::model::CloudRunRevisionInfo>>,
5370 >(
5371 mut self,
5372 v: T,
5373 ) -> Self {
5374 self.step_info =
5375 std::option::Option::Some(crate::model::step::StepInfo::CloudRunRevision(v.into()));
5376 self
5377 }
5378
5379 /// The value of [step_info][crate::model::Step::step_info]
5380 /// if it holds a `Nat`, `None` if the field is not set or
5381 /// holds a different branch.
5382 pub fn nat(&self) -> std::option::Option<&std::boxed::Box<crate::model::NatInfo>> {
5383 #[allow(unreachable_patterns)]
5384 self.step_info.as_ref().and_then(|v| match v {
5385 crate::model::step::StepInfo::Nat(v) => std::option::Option::Some(v),
5386 _ => std::option::Option::None,
5387 })
5388 }
5389
5390 /// Sets the value of [step_info][crate::model::Step::step_info]
5391 /// to hold a `Nat`.
5392 ///
5393 /// Note that all the setters affecting `step_info` are
5394 /// mutually exclusive.
5395 ///
5396 /// # Example
5397 /// ```ignore,no_run
5398 /// # use google_cloud_networkmanagement_v1::model::Step;
5399 /// use google_cloud_networkmanagement_v1::model::NatInfo;
5400 /// let x = Step::new().set_nat(NatInfo::default()/* use setters */);
5401 /// assert!(x.nat().is_some());
5402 /// assert!(x.instance().is_none());
5403 /// assert!(x.firewall().is_none());
5404 /// assert!(x.route().is_none());
5405 /// assert!(x.endpoint().is_none());
5406 /// assert!(x.google_service().is_none());
5407 /// assert!(x.forwarding_rule().is_none());
5408 /// assert!(x.hybrid_subnet().is_none());
5409 /// assert!(x.vpn_gateway().is_none());
5410 /// assert!(x.vpn_tunnel().is_none());
5411 /// assert!(x.interconnect_attachment().is_none());
5412 /// assert!(x.vpc_connector().is_none());
5413 /// assert!(x.direct_vpc_egress_connection().is_none());
5414 /// assert!(x.serverless_external_connection().is_none());
5415 /// assert!(x.deliver().is_none());
5416 /// assert!(x.forward().is_none());
5417 /// assert!(x.abort().is_none());
5418 /// assert!(x.drop().is_none());
5419 /// assert!(x.load_balancer().is_none());
5420 /// assert!(x.network().is_none());
5421 /// assert!(x.gke_master().is_none());
5422 /// assert!(x.gke_pod().is_none());
5423 /// assert!(x.ip_masquerading_skipped().is_none());
5424 /// assert!(x.cloud_sql_instance().is_none());
5425 /// assert!(x.redis_instance().is_none());
5426 /// assert!(x.redis_cluster().is_none());
5427 /// assert!(x.cloud_function().is_none());
5428 /// assert!(x.app_engine_version().is_none());
5429 /// assert!(x.cloud_run_revision().is_none());
5430 /// assert!(x.proxy_connection().is_none());
5431 /// assert!(x.load_balancer_backend_info().is_none());
5432 /// assert!(x.storage_bucket().is_none());
5433 /// assert!(x.serverless_neg().is_none());
5434 /// ```
5435 pub fn set_nat<T: std::convert::Into<std::boxed::Box<crate::model::NatInfo>>>(
5436 mut self,
5437 v: T,
5438 ) -> Self {
5439 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Nat(v.into()));
5440 self
5441 }
5442
5443 /// The value of [step_info][crate::model::Step::step_info]
5444 /// if it holds a `ProxyConnection`, `None` if the field is not set or
5445 /// holds a different branch.
5446 pub fn proxy_connection(
5447 &self,
5448 ) -> std::option::Option<&std::boxed::Box<crate::model::ProxyConnectionInfo>> {
5449 #[allow(unreachable_patterns)]
5450 self.step_info.as_ref().and_then(|v| match v {
5451 crate::model::step::StepInfo::ProxyConnection(v) => std::option::Option::Some(v),
5452 _ => std::option::Option::None,
5453 })
5454 }
5455
5456 /// Sets the value of [step_info][crate::model::Step::step_info]
5457 /// to hold a `ProxyConnection`.
5458 ///
5459 /// Note that all the setters affecting `step_info` are
5460 /// mutually exclusive.
5461 ///
5462 /// # Example
5463 /// ```ignore,no_run
5464 /// # use google_cloud_networkmanagement_v1::model::Step;
5465 /// use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
5466 /// let x = Step::new().set_proxy_connection(ProxyConnectionInfo::default()/* use setters */);
5467 /// assert!(x.proxy_connection().is_some());
5468 /// assert!(x.instance().is_none());
5469 /// assert!(x.firewall().is_none());
5470 /// assert!(x.route().is_none());
5471 /// assert!(x.endpoint().is_none());
5472 /// assert!(x.google_service().is_none());
5473 /// assert!(x.forwarding_rule().is_none());
5474 /// assert!(x.hybrid_subnet().is_none());
5475 /// assert!(x.vpn_gateway().is_none());
5476 /// assert!(x.vpn_tunnel().is_none());
5477 /// assert!(x.interconnect_attachment().is_none());
5478 /// assert!(x.vpc_connector().is_none());
5479 /// assert!(x.direct_vpc_egress_connection().is_none());
5480 /// assert!(x.serverless_external_connection().is_none());
5481 /// assert!(x.deliver().is_none());
5482 /// assert!(x.forward().is_none());
5483 /// assert!(x.abort().is_none());
5484 /// assert!(x.drop().is_none());
5485 /// assert!(x.load_balancer().is_none());
5486 /// assert!(x.network().is_none());
5487 /// assert!(x.gke_master().is_none());
5488 /// assert!(x.gke_pod().is_none());
5489 /// assert!(x.ip_masquerading_skipped().is_none());
5490 /// assert!(x.cloud_sql_instance().is_none());
5491 /// assert!(x.redis_instance().is_none());
5492 /// assert!(x.redis_cluster().is_none());
5493 /// assert!(x.cloud_function().is_none());
5494 /// assert!(x.app_engine_version().is_none());
5495 /// assert!(x.cloud_run_revision().is_none());
5496 /// assert!(x.nat().is_none());
5497 /// assert!(x.load_balancer_backend_info().is_none());
5498 /// assert!(x.storage_bucket().is_none());
5499 /// assert!(x.serverless_neg().is_none());
5500 /// ```
5501 pub fn set_proxy_connection<
5502 T: std::convert::Into<std::boxed::Box<crate::model::ProxyConnectionInfo>>,
5503 >(
5504 mut self,
5505 v: T,
5506 ) -> Self {
5507 self.step_info =
5508 std::option::Option::Some(crate::model::step::StepInfo::ProxyConnection(v.into()));
5509 self
5510 }
5511
5512 /// The value of [step_info][crate::model::Step::step_info]
5513 /// if it holds a `LoadBalancerBackendInfo`, `None` if the field is not set or
5514 /// holds a different branch.
5515 pub fn load_balancer_backend_info(
5516 &self,
5517 ) -> std::option::Option<&std::boxed::Box<crate::model::LoadBalancerBackendInfo>> {
5518 #[allow(unreachable_patterns)]
5519 self.step_info.as_ref().and_then(|v| match v {
5520 crate::model::step::StepInfo::LoadBalancerBackendInfo(v) => {
5521 std::option::Option::Some(v)
5522 }
5523 _ => std::option::Option::None,
5524 })
5525 }
5526
5527 /// Sets the value of [step_info][crate::model::Step::step_info]
5528 /// to hold a `LoadBalancerBackendInfo`.
5529 ///
5530 /// Note that all the setters affecting `step_info` are
5531 /// mutually exclusive.
5532 ///
5533 /// # Example
5534 /// ```ignore,no_run
5535 /// # use google_cloud_networkmanagement_v1::model::Step;
5536 /// use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
5537 /// let x = Step::new().set_load_balancer_backend_info(LoadBalancerBackendInfo::default()/* use setters */);
5538 /// assert!(x.load_balancer_backend_info().is_some());
5539 /// assert!(x.instance().is_none());
5540 /// assert!(x.firewall().is_none());
5541 /// assert!(x.route().is_none());
5542 /// assert!(x.endpoint().is_none());
5543 /// assert!(x.google_service().is_none());
5544 /// assert!(x.forwarding_rule().is_none());
5545 /// assert!(x.hybrid_subnet().is_none());
5546 /// assert!(x.vpn_gateway().is_none());
5547 /// assert!(x.vpn_tunnel().is_none());
5548 /// assert!(x.interconnect_attachment().is_none());
5549 /// assert!(x.vpc_connector().is_none());
5550 /// assert!(x.direct_vpc_egress_connection().is_none());
5551 /// assert!(x.serverless_external_connection().is_none());
5552 /// assert!(x.deliver().is_none());
5553 /// assert!(x.forward().is_none());
5554 /// assert!(x.abort().is_none());
5555 /// assert!(x.drop().is_none());
5556 /// assert!(x.load_balancer().is_none());
5557 /// assert!(x.network().is_none());
5558 /// assert!(x.gke_master().is_none());
5559 /// assert!(x.gke_pod().is_none());
5560 /// assert!(x.ip_masquerading_skipped().is_none());
5561 /// assert!(x.cloud_sql_instance().is_none());
5562 /// assert!(x.redis_instance().is_none());
5563 /// assert!(x.redis_cluster().is_none());
5564 /// assert!(x.cloud_function().is_none());
5565 /// assert!(x.app_engine_version().is_none());
5566 /// assert!(x.cloud_run_revision().is_none());
5567 /// assert!(x.nat().is_none());
5568 /// assert!(x.proxy_connection().is_none());
5569 /// assert!(x.storage_bucket().is_none());
5570 /// assert!(x.serverless_neg().is_none());
5571 /// ```
5572 pub fn set_load_balancer_backend_info<
5573 T: std::convert::Into<std::boxed::Box<crate::model::LoadBalancerBackendInfo>>,
5574 >(
5575 mut self,
5576 v: T,
5577 ) -> Self {
5578 self.step_info = std::option::Option::Some(
5579 crate::model::step::StepInfo::LoadBalancerBackendInfo(v.into()),
5580 );
5581 self
5582 }
5583
5584 /// The value of [step_info][crate::model::Step::step_info]
5585 /// if it holds a `StorageBucket`, `None` if the field is not set or
5586 /// holds a different branch.
5587 pub fn storage_bucket(
5588 &self,
5589 ) -> std::option::Option<&std::boxed::Box<crate::model::StorageBucketInfo>> {
5590 #[allow(unreachable_patterns)]
5591 self.step_info.as_ref().and_then(|v| match v {
5592 crate::model::step::StepInfo::StorageBucket(v) => std::option::Option::Some(v),
5593 _ => std::option::Option::None,
5594 })
5595 }
5596
5597 /// Sets the value of [step_info][crate::model::Step::step_info]
5598 /// to hold a `StorageBucket`.
5599 ///
5600 /// Note that all the setters affecting `step_info` are
5601 /// mutually exclusive.
5602 ///
5603 /// # Example
5604 /// ```ignore,no_run
5605 /// # use google_cloud_networkmanagement_v1::model::Step;
5606 /// use google_cloud_networkmanagement_v1::model::StorageBucketInfo;
5607 /// let x = Step::new().set_storage_bucket(StorageBucketInfo::default()/* use setters */);
5608 /// assert!(x.storage_bucket().is_some());
5609 /// assert!(x.instance().is_none());
5610 /// assert!(x.firewall().is_none());
5611 /// assert!(x.route().is_none());
5612 /// assert!(x.endpoint().is_none());
5613 /// assert!(x.google_service().is_none());
5614 /// assert!(x.forwarding_rule().is_none());
5615 /// assert!(x.hybrid_subnet().is_none());
5616 /// assert!(x.vpn_gateway().is_none());
5617 /// assert!(x.vpn_tunnel().is_none());
5618 /// assert!(x.interconnect_attachment().is_none());
5619 /// assert!(x.vpc_connector().is_none());
5620 /// assert!(x.direct_vpc_egress_connection().is_none());
5621 /// assert!(x.serverless_external_connection().is_none());
5622 /// assert!(x.deliver().is_none());
5623 /// assert!(x.forward().is_none());
5624 /// assert!(x.abort().is_none());
5625 /// assert!(x.drop().is_none());
5626 /// assert!(x.load_balancer().is_none());
5627 /// assert!(x.network().is_none());
5628 /// assert!(x.gke_master().is_none());
5629 /// assert!(x.gke_pod().is_none());
5630 /// assert!(x.ip_masquerading_skipped().is_none());
5631 /// assert!(x.cloud_sql_instance().is_none());
5632 /// assert!(x.redis_instance().is_none());
5633 /// assert!(x.redis_cluster().is_none());
5634 /// assert!(x.cloud_function().is_none());
5635 /// assert!(x.app_engine_version().is_none());
5636 /// assert!(x.cloud_run_revision().is_none());
5637 /// assert!(x.nat().is_none());
5638 /// assert!(x.proxy_connection().is_none());
5639 /// assert!(x.load_balancer_backend_info().is_none());
5640 /// assert!(x.serverless_neg().is_none());
5641 /// ```
5642 pub fn set_storage_bucket<
5643 T: std::convert::Into<std::boxed::Box<crate::model::StorageBucketInfo>>,
5644 >(
5645 mut self,
5646 v: T,
5647 ) -> Self {
5648 self.step_info =
5649 std::option::Option::Some(crate::model::step::StepInfo::StorageBucket(v.into()));
5650 self
5651 }
5652
5653 /// The value of [step_info][crate::model::Step::step_info]
5654 /// if it holds a `ServerlessNeg`, `None` if the field is not set or
5655 /// holds a different branch.
5656 pub fn serverless_neg(
5657 &self,
5658 ) -> std::option::Option<&std::boxed::Box<crate::model::ServerlessNegInfo>> {
5659 #[allow(unreachable_patterns)]
5660 self.step_info.as_ref().and_then(|v| match v {
5661 crate::model::step::StepInfo::ServerlessNeg(v) => std::option::Option::Some(v),
5662 _ => std::option::Option::None,
5663 })
5664 }
5665
5666 /// Sets the value of [step_info][crate::model::Step::step_info]
5667 /// to hold a `ServerlessNeg`.
5668 ///
5669 /// Note that all the setters affecting `step_info` are
5670 /// mutually exclusive.
5671 ///
5672 /// # Example
5673 /// ```ignore,no_run
5674 /// # use google_cloud_networkmanagement_v1::model::Step;
5675 /// use google_cloud_networkmanagement_v1::model::ServerlessNegInfo;
5676 /// let x = Step::new().set_serverless_neg(ServerlessNegInfo::default()/* use setters */);
5677 /// assert!(x.serverless_neg().is_some());
5678 /// assert!(x.instance().is_none());
5679 /// assert!(x.firewall().is_none());
5680 /// assert!(x.route().is_none());
5681 /// assert!(x.endpoint().is_none());
5682 /// assert!(x.google_service().is_none());
5683 /// assert!(x.forwarding_rule().is_none());
5684 /// assert!(x.hybrid_subnet().is_none());
5685 /// assert!(x.vpn_gateway().is_none());
5686 /// assert!(x.vpn_tunnel().is_none());
5687 /// assert!(x.interconnect_attachment().is_none());
5688 /// assert!(x.vpc_connector().is_none());
5689 /// assert!(x.direct_vpc_egress_connection().is_none());
5690 /// assert!(x.serverless_external_connection().is_none());
5691 /// assert!(x.deliver().is_none());
5692 /// assert!(x.forward().is_none());
5693 /// assert!(x.abort().is_none());
5694 /// assert!(x.drop().is_none());
5695 /// assert!(x.load_balancer().is_none());
5696 /// assert!(x.network().is_none());
5697 /// assert!(x.gke_master().is_none());
5698 /// assert!(x.gke_pod().is_none());
5699 /// assert!(x.ip_masquerading_skipped().is_none());
5700 /// assert!(x.cloud_sql_instance().is_none());
5701 /// assert!(x.redis_instance().is_none());
5702 /// assert!(x.redis_cluster().is_none());
5703 /// assert!(x.cloud_function().is_none());
5704 /// assert!(x.app_engine_version().is_none());
5705 /// assert!(x.cloud_run_revision().is_none());
5706 /// assert!(x.nat().is_none());
5707 /// assert!(x.proxy_connection().is_none());
5708 /// assert!(x.load_balancer_backend_info().is_none());
5709 /// assert!(x.storage_bucket().is_none());
5710 /// ```
5711 pub fn set_serverless_neg<
5712 T: std::convert::Into<std::boxed::Box<crate::model::ServerlessNegInfo>>,
5713 >(
5714 mut self,
5715 v: T,
5716 ) -> Self {
5717 self.step_info =
5718 std::option::Option::Some(crate::model::step::StepInfo::ServerlessNeg(v.into()));
5719 self
5720 }
5721}
5722
5723impl wkt::message::Message for Step {
5724 fn typename() -> &'static str {
5725 "type.googleapis.com/google.cloud.networkmanagement.v1.Step"
5726 }
5727}
5728
5729/// Defines additional types related to [Step].
5730pub mod step {
5731 #[allow(unused_imports)]
5732 use super::*;
5733
5734 /// Type of states that are defined in the network state machine.
5735 /// Each step in the packet trace is in a specific state.
5736 ///
5737 /// # Working with unknown values
5738 ///
5739 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5740 /// additional enum variants at any time. Adding new variants is not considered
5741 /// a breaking change. Applications should write their code in anticipation of:
5742 ///
5743 /// - New values appearing in future releases of the client library, **and**
5744 /// - New values received dynamically, without application changes.
5745 ///
5746 /// Please consult the [Working with enums] section in the user guide for some
5747 /// guidelines.
5748 ///
5749 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5750 #[derive(Clone, Debug, PartialEq)]
5751 #[non_exhaustive]
5752 pub enum State {
5753 /// Unspecified state.
5754 Unspecified,
5755 /// Initial state: packet originating from a Compute Engine instance.
5756 /// An InstanceInfo is populated with starting instance information.
5757 StartFromInstance,
5758 /// Initial state: packet originating from the internet.
5759 /// The endpoint information is populated.
5760 StartFromInternet,
5761 /// Initial state: packet originating from a Google service.
5762 /// The google_service information is populated.
5763 StartFromGoogleService,
5764 /// Initial state: packet originating from a VPC or on-premises network
5765 /// with internal source IP.
5766 /// If the source is a VPC network visible to the user, a NetworkInfo
5767 /// is populated with details of the network.
5768 StartFromPrivateNetwork,
5769 /// Initial state: packet originating from a Google Kubernetes Engine cluster
5770 /// master. A GKEMasterInfo is populated with starting instance information.
5771 StartFromGkeMaster,
5772 /// Initial state: packet originating from a Cloud SQL instance.
5773 /// A CloudSQLInstanceInfo is populated with starting instance information.
5774 StartFromCloudSqlInstance,
5775 /// Initial state: packet originating from a Google Kubernetes Engine Pod.
5776 /// A GkePodInfo is populated with starting Pod information.
5777 StartFromGkePod,
5778 /// Initial state: packet originating from a Redis instance.
5779 /// A RedisInstanceInfo is populated with starting instance information.
5780 StartFromRedisInstance,
5781 /// Initial state: packet originating from a Redis Cluster.
5782 /// A RedisClusterInfo is populated with starting Cluster information.
5783 StartFromRedisCluster,
5784 /// Initial state: packet originating from a Cloud Function.
5785 /// A CloudFunctionInfo is populated with starting function information.
5786 StartFromCloudFunction,
5787 /// Initial state: packet originating from an App Engine service version.
5788 /// An AppEngineVersionInfo is populated with starting version information.
5789 StartFromAppEngineVersion,
5790 /// Initial state: packet originating from a Cloud Run revision.
5791 /// A CloudRunRevisionInfo is populated with starting revision information.
5792 StartFromCloudRunRevision,
5793 /// Initial state: packet originating from a Storage Bucket. Used only for
5794 /// return traces.
5795 /// The storage_bucket information is populated.
5796 StartFromStorageBucket,
5797 /// Initial state: packet originating from a published service that uses
5798 /// Private Service Connect. Used only for return traces.
5799 StartFromPscPublishedService,
5800 /// Initial state: packet originating from a serverless network endpoint
5801 /// group backend. Used only for return traces.
5802 /// The serverless_neg information is populated.
5803 StartFromServerlessNeg,
5804 /// Config checking state: verify ingress firewall rule.
5805 ApplyIngressFirewallRule,
5806 /// Config checking state: verify egress firewall rule.
5807 ApplyEgressFirewallRule,
5808 /// Config checking state: verify route.
5809 ApplyRoute,
5810 /// Config checking state: match forwarding rule.
5811 ApplyForwardingRule,
5812 /// Config checking state: verify load balancer backend configuration.
5813 AnalyzeLoadBalancerBackend,
5814 /// Config checking state: packet sent or received under foreign IP
5815 /// address and allowed.
5816 SpoofingApproved,
5817 /// Forwarding state: arriving at a Compute Engine instance.
5818 ArriveAtInstance,
5819 /// Forwarding state: arriving at a Compute Engine internal load balancer.
5820 #[deprecated]
5821 ArriveAtInternalLoadBalancer,
5822 /// Forwarding state: arriving at a Compute Engine external load balancer.
5823 #[deprecated]
5824 ArriveAtExternalLoadBalancer,
5825 /// Forwarding state: arriving at a hybrid subnet. Appropriate routing
5826 /// configuration will be determined here.
5827 ArriveAtHybridSubnet,
5828 /// Forwarding state: arriving at a Cloud VPN gateway.
5829 ArriveAtVpnGateway,
5830 /// Forwarding state: arriving at a Cloud VPN tunnel.
5831 ArriveAtVpnTunnel,
5832 /// Forwarding state: arriving at an interconnect attachment.
5833 ArriveAtInterconnectAttachment,
5834 /// Forwarding state: arriving at a VPC connector.
5835 ArriveAtVpcConnector,
5836 /// Forwarding state: for packets originating from a serverless endpoint
5837 /// forwarded through Direct VPC egress.
5838 DirectVpcEgressConnection,
5839 /// Forwarding state: for packets originating from a serverless endpoint
5840 /// forwarded through public (external) connectivity.
5841 ServerlessExternalConnection,
5842 /// Transition state: packet header translated. The `nat` field is populated
5843 /// with the translation information.
5844 Nat,
5845 /// Transition state: GKE Pod IP masquerading is skipped. The
5846 /// `ip_masquerading_skipped` field is populated with the reason.
5847 SkipGkePodIpMasquerading,
5848 /// Transition state: original connection is terminated and a new proxied
5849 /// connection is initiated.
5850 ProxyConnection,
5851 /// Final state: packet could be delivered.
5852 Deliver,
5853 /// Final state: packet could be dropped.
5854 Drop,
5855 /// Final state: packet could be forwarded to a network with an unknown
5856 /// configuration.
5857 Forward,
5858 /// Final state: analysis is aborted.
5859 Abort,
5860 /// Special state: viewer of the test result does not have permission to
5861 /// see the configuration in this step.
5862 ViewerPermissionMissing,
5863 /// If set, the enum was initialized with an unknown value.
5864 ///
5865 /// Applications can examine the value using [State::value] or
5866 /// [State::name].
5867 UnknownValue(state::UnknownValue),
5868 }
5869
5870 #[doc(hidden)]
5871 pub mod state {
5872 #[allow(unused_imports)]
5873 use super::*;
5874 #[derive(Clone, Debug, PartialEq)]
5875 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5876 }
5877
5878 impl State {
5879 /// Gets the enum value.
5880 ///
5881 /// Returns `None` if the enum contains an unknown value deserialized from
5882 /// the string representation of enums.
5883 pub fn value(&self) -> std::option::Option<i32> {
5884 match self {
5885 Self::Unspecified => std::option::Option::Some(0),
5886 Self::StartFromInstance => std::option::Option::Some(1),
5887 Self::StartFromInternet => std::option::Option::Some(2),
5888 Self::StartFromGoogleService => std::option::Option::Some(27),
5889 Self::StartFromPrivateNetwork => std::option::Option::Some(3),
5890 Self::StartFromGkeMaster => std::option::Option::Some(21),
5891 Self::StartFromCloudSqlInstance => std::option::Option::Some(22),
5892 Self::StartFromGkePod => std::option::Option::Some(39),
5893 Self::StartFromRedisInstance => std::option::Option::Some(32),
5894 Self::StartFromRedisCluster => std::option::Option::Some(33),
5895 Self::StartFromCloudFunction => std::option::Option::Some(23),
5896 Self::StartFromAppEngineVersion => std::option::Option::Some(25),
5897 Self::StartFromCloudRunRevision => std::option::Option::Some(26),
5898 Self::StartFromStorageBucket => std::option::Option::Some(29),
5899 Self::StartFromPscPublishedService => std::option::Option::Some(30),
5900 Self::StartFromServerlessNeg => std::option::Option::Some(31),
5901 Self::ApplyIngressFirewallRule => std::option::Option::Some(4),
5902 Self::ApplyEgressFirewallRule => std::option::Option::Some(5),
5903 Self::ApplyRoute => std::option::Option::Some(6),
5904 Self::ApplyForwardingRule => std::option::Option::Some(7),
5905 Self::AnalyzeLoadBalancerBackend => std::option::Option::Some(28),
5906 Self::SpoofingApproved => std::option::Option::Some(8),
5907 Self::ArriveAtInstance => std::option::Option::Some(9),
5908 Self::ArriveAtInternalLoadBalancer => std::option::Option::Some(10),
5909 Self::ArriveAtExternalLoadBalancer => std::option::Option::Some(11),
5910 Self::ArriveAtHybridSubnet => std::option::Option::Some(38),
5911 Self::ArriveAtVpnGateway => std::option::Option::Some(12),
5912 Self::ArriveAtVpnTunnel => std::option::Option::Some(13),
5913 Self::ArriveAtInterconnectAttachment => std::option::Option::Some(37),
5914 Self::ArriveAtVpcConnector => std::option::Option::Some(24),
5915 Self::DirectVpcEgressConnection => std::option::Option::Some(35),
5916 Self::ServerlessExternalConnection => std::option::Option::Some(36),
5917 Self::Nat => std::option::Option::Some(14),
5918 Self::SkipGkePodIpMasquerading => std::option::Option::Some(40),
5919 Self::ProxyConnection => std::option::Option::Some(15),
5920 Self::Deliver => std::option::Option::Some(16),
5921 Self::Drop => std::option::Option::Some(17),
5922 Self::Forward => std::option::Option::Some(18),
5923 Self::Abort => std::option::Option::Some(19),
5924 Self::ViewerPermissionMissing => std::option::Option::Some(20),
5925 Self::UnknownValue(u) => u.0.value(),
5926 }
5927 }
5928
5929 /// Gets the enum value as a string.
5930 ///
5931 /// Returns `None` if the enum contains an unknown value deserialized from
5932 /// the integer representation of enums.
5933 pub fn name(&self) -> std::option::Option<&str> {
5934 match self {
5935 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5936 Self::StartFromInstance => std::option::Option::Some("START_FROM_INSTANCE"),
5937 Self::StartFromInternet => std::option::Option::Some("START_FROM_INTERNET"),
5938 Self::StartFromGoogleService => {
5939 std::option::Option::Some("START_FROM_GOOGLE_SERVICE")
5940 }
5941 Self::StartFromPrivateNetwork => {
5942 std::option::Option::Some("START_FROM_PRIVATE_NETWORK")
5943 }
5944 Self::StartFromGkeMaster => std::option::Option::Some("START_FROM_GKE_MASTER"),
5945 Self::StartFromCloudSqlInstance => {
5946 std::option::Option::Some("START_FROM_CLOUD_SQL_INSTANCE")
5947 }
5948 Self::StartFromGkePod => std::option::Option::Some("START_FROM_GKE_POD"),
5949 Self::StartFromRedisInstance => {
5950 std::option::Option::Some("START_FROM_REDIS_INSTANCE")
5951 }
5952 Self::StartFromRedisCluster => {
5953 std::option::Option::Some("START_FROM_REDIS_CLUSTER")
5954 }
5955 Self::StartFromCloudFunction => {
5956 std::option::Option::Some("START_FROM_CLOUD_FUNCTION")
5957 }
5958 Self::StartFromAppEngineVersion => {
5959 std::option::Option::Some("START_FROM_APP_ENGINE_VERSION")
5960 }
5961 Self::StartFromCloudRunRevision => {
5962 std::option::Option::Some("START_FROM_CLOUD_RUN_REVISION")
5963 }
5964 Self::StartFromStorageBucket => {
5965 std::option::Option::Some("START_FROM_STORAGE_BUCKET")
5966 }
5967 Self::StartFromPscPublishedService => {
5968 std::option::Option::Some("START_FROM_PSC_PUBLISHED_SERVICE")
5969 }
5970 Self::StartFromServerlessNeg => {
5971 std::option::Option::Some("START_FROM_SERVERLESS_NEG")
5972 }
5973 Self::ApplyIngressFirewallRule => {
5974 std::option::Option::Some("APPLY_INGRESS_FIREWALL_RULE")
5975 }
5976 Self::ApplyEgressFirewallRule => {
5977 std::option::Option::Some("APPLY_EGRESS_FIREWALL_RULE")
5978 }
5979 Self::ApplyRoute => std::option::Option::Some("APPLY_ROUTE"),
5980 Self::ApplyForwardingRule => std::option::Option::Some("APPLY_FORWARDING_RULE"),
5981 Self::AnalyzeLoadBalancerBackend => {
5982 std::option::Option::Some("ANALYZE_LOAD_BALANCER_BACKEND")
5983 }
5984 Self::SpoofingApproved => std::option::Option::Some("SPOOFING_APPROVED"),
5985 Self::ArriveAtInstance => std::option::Option::Some("ARRIVE_AT_INSTANCE"),
5986 Self::ArriveAtInternalLoadBalancer => {
5987 std::option::Option::Some("ARRIVE_AT_INTERNAL_LOAD_BALANCER")
5988 }
5989 Self::ArriveAtExternalLoadBalancer => {
5990 std::option::Option::Some("ARRIVE_AT_EXTERNAL_LOAD_BALANCER")
5991 }
5992 Self::ArriveAtHybridSubnet => std::option::Option::Some("ARRIVE_AT_HYBRID_SUBNET"),
5993 Self::ArriveAtVpnGateway => std::option::Option::Some("ARRIVE_AT_VPN_GATEWAY"),
5994 Self::ArriveAtVpnTunnel => std::option::Option::Some("ARRIVE_AT_VPN_TUNNEL"),
5995 Self::ArriveAtInterconnectAttachment => {
5996 std::option::Option::Some("ARRIVE_AT_INTERCONNECT_ATTACHMENT")
5997 }
5998 Self::ArriveAtVpcConnector => std::option::Option::Some("ARRIVE_AT_VPC_CONNECTOR"),
5999 Self::DirectVpcEgressConnection => {
6000 std::option::Option::Some("DIRECT_VPC_EGRESS_CONNECTION")
6001 }
6002 Self::ServerlessExternalConnection => {
6003 std::option::Option::Some("SERVERLESS_EXTERNAL_CONNECTION")
6004 }
6005 Self::Nat => std::option::Option::Some("NAT"),
6006 Self::SkipGkePodIpMasquerading => {
6007 std::option::Option::Some("SKIP_GKE_POD_IP_MASQUERADING")
6008 }
6009 Self::ProxyConnection => std::option::Option::Some("PROXY_CONNECTION"),
6010 Self::Deliver => std::option::Option::Some("DELIVER"),
6011 Self::Drop => std::option::Option::Some("DROP"),
6012 Self::Forward => std::option::Option::Some("FORWARD"),
6013 Self::Abort => std::option::Option::Some("ABORT"),
6014 Self::ViewerPermissionMissing => {
6015 std::option::Option::Some("VIEWER_PERMISSION_MISSING")
6016 }
6017 Self::UnknownValue(u) => u.0.name(),
6018 }
6019 }
6020 }
6021
6022 impl std::default::Default for State {
6023 fn default() -> Self {
6024 use std::convert::From;
6025 Self::from(0)
6026 }
6027 }
6028
6029 impl std::fmt::Display for State {
6030 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6031 wkt::internal::display_enum(f, self.name(), self.value())
6032 }
6033 }
6034
6035 impl std::convert::From<i32> for State {
6036 fn from(value: i32) -> Self {
6037 match value {
6038 0 => Self::Unspecified,
6039 1 => Self::StartFromInstance,
6040 2 => Self::StartFromInternet,
6041 3 => Self::StartFromPrivateNetwork,
6042 4 => Self::ApplyIngressFirewallRule,
6043 5 => Self::ApplyEgressFirewallRule,
6044 6 => Self::ApplyRoute,
6045 7 => Self::ApplyForwardingRule,
6046 8 => Self::SpoofingApproved,
6047 9 => Self::ArriveAtInstance,
6048 10 => Self::ArriveAtInternalLoadBalancer,
6049 11 => Self::ArriveAtExternalLoadBalancer,
6050 12 => Self::ArriveAtVpnGateway,
6051 13 => Self::ArriveAtVpnTunnel,
6052 14 => Self::Nat,
6053 15 => Self::ProxyConnection,
6054 16 => Self::Deliver,
6055 17 => Self::Drop,
6056 18 => Self::Forward,
6057 19 => Self::Abort,
6058 20 => Self::ViewerPermissionMissing,
6059 21 => Self::StartFromGkeMaster,
6060 22 => Self::StartFromCloudSqlInstance,
6061 23 => Self::StartFromCloudFunction,
6062 24 => Self::ArriveAtVpcConnector,
6063 25 => Self::StartFromAppEngineVersion,
6064 26 => Self::StartFromCloudRunRevision,
6065 27 => Self::StartFromGoogleService,
6066 28 => Self::AnalyzeLoadBalancerBackend,
6067 29 => Self::StartFromStorageBucket,
6068 30 => Self::StartFromPscPublishedService,
6069 31 => Self::StartFromServerlessNeg,
6070 32 => Self::StartFromRedisInstance,
6071 33 => Self::StartFromRedisCluster,
6072 35 => Self::DirectVpcEgressConnection,
6073 36 => Self::ServerlessExternalConnection,
6074 37 => Self::ArriveAtInterconnectAttachment,
6075 38 => Self::ArriveAtHybridSubnet,
6076 39 => Self::StartFromGkePod,
6077 40 => Self::SkipGkePodIpMasquerading,
6078 _ => Self::UnknownValue(state::UnknownValue(
6079 wkt::internal::UnknownEnumValue::Integer(value),
6080 )),
6081 }
6082 }
6083 }
6084
6085 impl std::convert::From<&str> for State {
6086 fn from(value: &str) -> Self {
6087 use std::string::ToString;
6088 match value {
6089 "STATE_UNSPECIFIED" => Self::Unspecified,
6090 "START_FROM_INSTANCE" => Self::StartFromInstance,
6091 "START_FROM_INTERNET" => Self::StartFromInternet,
6092 "START_FROM_GOOGLE_SERVICE" => Self::StartFromGoogleService,
6093 "START_FROM_PRIVATE_NETWORK" => Self::StartFromPrivateNetwork,
6094 "START_FROM_GKE_MASTER" => Self::StartFromGkeMaster,
6095 "START_FROM_CLOUD_SQL_INSTANCE" => Self::StartFromCloudSqlInstance,
6096 "START_FROM_GKE_POD" => Self::StartFromGkePod,
6097 "START_FROM_REDIS_INSTANCE" => Self::StartFromRedisInstance,
6098 "START_FROM_REDIS_CLUSTER" => Self::StartFromRedisCluster,
6099 "START_FROM_CLOUD_FUNCTION" => Self::StartFromCloudFunction,
6100 "START_FROM_APP_ENGINE_VERSION" => Self::StartFromAppEngineVersion,
6101 "START_FROM_CLOUD_RUN_REVISION" => Self::StartFromCloudRunRevision,
6102 "START_FROM_STORAGE_BUCKET" => Self::StartFromStorageBucket,
6103 "START_FROM_PSC_PUBLISHED_SERVICE" => Self::StartFromPscPublishedService,
6104 "START_FROM_SERVERLESS_NEG" => Self::StartFromServerlessNeg,
6105 "APPLY_INGRESS_FIREWALL_RULE" => Self::ApplyIngressFirewallRule,
6106 "APPLY_EGRESS_FIREWALL_RULE" => Self::ApplyEgressFirewallRule,
6107 "APPLY_ROUTE" => Self::ApplyRoute,
6108 "APPLY_FORWARDING_RULE" => Self::ApplyForwardingRule,
6109 "ANALYZE_LOAD_BALANCER_BACKEND" => Self::AnalyzeLoadBalancerBackend,
6110 "SPOOFING_APPROVED" => Self::SpoofingApproved,
6111 "ARRIVE_AT_INSTANCE" => Self::ArriveAtInstance,
6112 "ARRIVE_AT_INTERNAL_LOAD_BALANCER" => Self::ArriveAtInternalLoadBalancer,
6113 "ARRIVE_AT_EXTERNAL_LOAD_BALANCER" => Self::ArriveAtExternalLoadBalancer,
6114 "ARRIVE_AT_HYBRID_SUBNET" => Self::ArriveAtHybridSubnet,
6115 "ARRIVE_AT_VPN_GATEWAY" => Self::ArriveAtVpnGateway,
6116 "ARRIVE_AT_VPN_TUNNEL" => Self::ArriveAtVpnTunnel,
6117 "ARRIVE_AT_INTERCONNECT_ATTACHMENT" => Self::ArriveAtInterconnectAttachment,
6118 "ARRIVE_AT_VPC_CONNECTOR" => Self::ArriveAtVpcConnector,
6119 "DIRECT_VPC_EGRESS_CONNECTION" => Self::DirectVpcEgressConnection,
6120 "SERVERLESS_EXTERNAL_CONNECTION" => Self::ServerlessExternalConnection,
6121 "NAT" => Self::Nat,
6122 "SKIP_GKE_POD_IP_MASQUERADING" => Self::SkipGkePodIpMasquerading,
6123 "PROXY_CONNECTION" => Self::ProxyConnection,
6124 "DELIVER" => Self::Deliver,
6125 "DROP" => Self::Drop,
6126 "FORWARD" => Self::Forward,
6127 "ABORT" => Self::Abort,
6128 "VIEWER_PERMISSION_MISSING" => Self::ViewerPermissionMissing,
6129 _ => Self::UnknownValue(state::UnknownValue(
6130 wkt::internal::UnknownEnumValue::String(value.to_string()),
6131 )),
6132 }
6133 }
6134 }
6135
6136 impl serde::ser::Serialize for State {
6137 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6138 where
6139 S: serde::Serializer,
6140 {
6141 match self {
6142 Self::Unspecified => serializer.serialize_i32(0),
6143 Self::StartFromInstance => serializer.serialize_i32(1),
6144 Self::StartFromInternet => serializer.serialize_i32(2),
6145 Self::StartFromGoogleService => serializer.serialize_i32(27),
6146 Self::StartFromPrivateNetwork => serializer.serialize_i32(3),
6147 Self::StartFromGkeMaster => serializer.serialize_i32(21),
6148 Self::StartFromCloudSqlInstance => serializer.serialize_i32(22),
6149 Self::StartFromGkePod => serializer.serialize_i32(39),
6150 Self::StartFromRedisInstance => serializer.serialize_i32(32),
6151 Self::StartFromRedisCluster => serializer.serialize_i32(33),
6152 Self::StartFromCloudFunction => serializer.serialize_i32(23),
6153 Self::StartFromAppEngineVersion => serializer.serialize_i32(25),
6154 Self::StartFromCloudRunRevision => serializer.serialize_i32(26),
6155 Self::StartFromStorageBucket => serializer.serialize_i32(29),
6156 Self::StartFromPscPublishedService => serializer.serialize_i32(30),
6157 Self::StartFromServerlessNeg => serializer.serialize_i32(31),
6158 Self::ApplyIngressFirewallRule => serializer.serialize_i32(4),
6159 Self::ApplyEgressFirewallRule => serializer.serialize_i32(5),
6160 Self::ApplyRoute => serializer.serialize_i32(6),
6161 Self::ApplyForwardingRule => serializer.serialize_i32(7),
6162 Self::AnalyzeLoadBalancerBackend => serializer.serialize_i32(28),
6163 Self::SpoofingApproved => serializer.serialize_i32(8),
6164 Self::ArriveAtInstance => serializer.serialize_i32(9),
6165 Self::ArriveAtInternalLoadBalancer => serializer.serialize_i32(10),
6166 Self::ArriveAtExternalLoadBalancer => serializer.serialize_i32(11),
6167 Self::ArriveAtHybridSubnet => serializer.serialize_i32(38),
6168 Self::ArriveAtVpnGateway => serializer.serialize_i32(12),
6169 Self::ArriveAtVpnTunnel => serializer.serialize_i32(13),
6170 Self::ArriveAtInterconnectAttachment => serializer.serialize_i32(37),
6171 Self::ArriveAtVpcConnector => serializer.serialize_i32(24),
6172 Self::DirectVpcEgressConnection => serializer.serialize_i32(35),
6173 Self::ServerlessExternalConnection => serializer.serialize_i32(36),
6174 Self::Nat => serializer.serialize_i32(14),
6175 Self::SkipGkePodIpMasquerading => serializer.serialize_i32(40),
6176 Self::ProxyConnection => serializer.serialize_i32(15),
6177 Self::Deliver => serializer.serialize_i32(16),
6178 Self::Drop => serializer.serialize_i32(17),
6179 Self::Forward => serializer.serialize_i32(18),
6180 Self::Abort => serializer.serialize_i32(19),
6181 Self::ViewerPermissionMissing => serializer.serialize_i32(20),
6182 Self::UnknownValue(u) => u.0.serialize(serializer),
6183 }
6184 }
6185 }
6186
6187 impl<'de> serde::de::Deserialize<'de> for State {
6188 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6189 where
6190 D: serde::Deserializer<'de>,
6191 {
6192 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6193 ".google.cloud.networkmanagement.v1.Step.State",
6194 ))
6195 }
6196 }
6197
6198 /// Configuration or metadata associated with each step.
6199 /// The configuration is filtered based on viewer's permission. If a viewer
6200 /// has no permission to view the configuration in this step, for non-final
6201 /// states a special state is populated (VIEWER_PERMISSION_MISSING), and for
6202 /// final state the configuration is cleared.
6203 #[derive(Clone, Debug, PartialEq)]
6204 #[non_exhaustive]
6205 pub enum StepInfo {
6206 /// Display information of a Compute Engine instance.
6207 Instance(std::boxed::Box<crate::model::InstanceInfo>),
6208 /// Display information of a Compute Engine firewall rule.
6209 Firewall(std::boxed::Box<crate::model::FirewallInfo>),
6210 /// Display information of a Compute Engine route.
6211 Route(std::boxed::Box<crate::model::RouteInfo>),
6212 /// Display information of the source and destination under analysis.
6213 /// The endpoint information in an intermediate state may differ with the
6214 /// initial input, as it might be modified by state like NAT,
6215 /// or Connection Proxy.
6216 Endpoint(std::boxed::Box<crate::model::EndpointInfo>),
6217 /// Display information of a Google service
6218 GoogleService(std::boxed::Box<crate::model::GoogleServiceInfo>),
6219 /// Display information of a Compute Engine forwarding rule.
6220 ForwardingRule(std::boxed::Box<crate::model::ForwardingRuleInfo>),
6221 /// Display information of a hybrid subnet.
6222 HybridSubnet(std::boxed::Box<crate::model::HybridSubnetInfo>),
6223 /// Display information of a Compute Engine VPN gateway.
6224 VpnGateway(std::boxed::Box<crate::model::VpnGatewayInfo>),
6225 /// Display information of a Compute Engine VPN tunnel.
6226 VpnTunnel(std::boxed::Box<crate::model::VpnTunnelInfo>),
6227 /// Display information of an interconnect attachment.
6228 InterconnectAttachment(std::boxed::Box<crate::model::InterconnectAttachmentInfo>),
6229 /// Display information of a VPC connector.
6230 VpcConnector(std::boxed::Box<crate::model::VpcConnectorInfo>),
6231 /// Display information of a serverless direct VPC egress connection.
6232 DirectVpcEgressConnection(std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>),
6233 /// Display information of a serverless public (external) connection.
6234 ServerlessExternalConnection(
6235 std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>,
6236 ),
6237 /// Display information of the final state "deliver" and reason.
6238 Deliver(std::boxed::Box<crate::model::DeliverInfo>),
6239 /// Display information of the final state "forward" and reason.
6240 Forward(std::boxed::Box<crate::model::ForwardInfo>),
6241 /// Display information of the final state "abort" and reason.
6242 Abort(std::boxed::Box<crate::model::AbortInfo>),
6243 /// Display information of the final state "drop" and reason.
6244 Drop(std::boxed::Box<crate::model::DropInfo>),
6245 /// Display information of the load balancers. Deprecated in favor of the
6246 /// `load_balancer_backend_info` field, not used in new tests.
6247 #[deprecated]
6248 LoadBalancer(std::boxed::Box<crate::model::LoadBalancerInfo>),
6249 /// Display information of a Google Cloud network.
6250 Network(std::boxed::Box<crate::model::NetworkInfo>),
6251 /// Display information of a Google Kubernetes Engine cluster master.
6252 GkeMaster(std::boxed::Box<crate::model::GKEMasterInfo>),
6253 /// Display information of a Google Kubernetes Engine Pod.
6254 GkePod(std::boxed::Box<crate::model::GkePodInfo>),
6255 /// Display information of the reason why GKE Pod IP masquerading was
6256 /// skipped.
6257 IpMasqueradingSkipped(std::boxed::Box<crate::model::IpMasqueradingSkippedInfo>),
6258 /// Display information of a Cloud SQL instance.
6259 CloudSqlInstance(std::boxed::Box<crate::model::CloudSQLInstanceInfo>),
6260 /// Display information of a Redis Instance.
6261 RedisInstance(std::boxed::Box<crate::model::RedisInstanceInfo>),
6262 /// Display information of a Redis Cluster.
6263 RedisCluster(std::boxed::Box<crate::model::RedisClusterInfo>),
6264 /// Display information of a Cloud Function.
6265 CloudFunction(std::boxed::Box<crate::model::CloudFunctionInfo>),
6266 /// Display information of an App Engine service version.
6267 AppEngineVersion(std::boxed::Box<crate::model::AppEngineVersionInfo>),
6268 /// Display information of a Cloud Run revision.
6269 CloudRunRevision(std::boxed::Box<crate::model::CloudRunRevisionInfo>),
6270 /// Display information of a NAT.
6271 Nat(std::boxed::Box<crate::model::NatInfo>),
6272 /// Display information of a ProxyConnection.
6273 ProxyConnection(std::boxed::Box<crate::model::ProxyConnectionInfo>),
6274 /// Display information of a specific load balancer backend.
6275 LoadBalancerBackendInfo(std::boxed::Box<crate::model::LoadBalancerBackendInfo>),
6276 /// Display information of a Storage Bucket. Used only for return traces.
6277 StorageBucket(std::boxed::Box<crate::model::StorageBucketInfo>),
6278 /// Display information of a Serverless network endpoint group backend. Used
6279 /// only for return traces.
6280 ServerlessNeg(std::boxed::Box<crate::model::ServerlessNegInfo>),
6281 }
6282}
6283
6284/// For display only. Metadata associated with a Compute Engine instance.
6285#[derive(Clone, Default, PartialEq)]
6286#[non_exhaustive]
6287pub struct InstanceInfo {
6288 /// Name of a Compute Engine instance.
6289 pub display_name: std::string::String,
6290
6291 /// URI of a Compute Engine instance.
6292 pub uri: std::string::String,
6293
6294 /// Name of the network interface of a Compute Engine instance.
6295 pub interface: std::string::String,
6296
6297 /// URI of a Compute Engine network.
6298 pub network_uri: std::string::String,
6299
6300 /// Internal IP address of the network interface.
6301 pub internal_ip: std::string::String,
6302
6303 /// External IP address of the network interface.
6304 pub external_ip: std::string::String,
6305
6306 /// Network tags configured on the instance.
6307 pub network_tags: std::vec::Vec<std::string::String>,
6308
6309 /// Service account authorized for the instance.
6310 #[deprecated]
6311 pub service_account: std::string::String,
6312
6313 /// URI of the PSC network attachment the NIC is attached to (if relevant).
6314 pub psc_network_attachment_uri: std::string::String,
6315
6316 /// Indicates whether the Compute Engine instance is running.
6317 /// Deprecated: use the `status` field instead.
6318 #[deprecated]
6319 pub running: bool,
6320
6321 /// The status of the instance.
6322 pub status: crate::model::instance_info::Status,
6323
6324 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6325}
6326
6327impl InstanceInfo {
6328 pub fn new() -> Self {
6329 std::default::Default::default()
6330 }
6331
6332 /// Sets the value of [display_name][crate::model::InstanceInfo::display_name].
6333 ///
6334 /// # Example
6335 /// ```ignore,no_run
6336 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6337 /// let x = InstanceInfo::new().set_display_name("example");
6338 /// ```
6339 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6340 self.display_name = v.into();
6341 self
6342 }
6343
6344 /// Sets the value of [uri][crate::model::InstanceInfo::uri].
6345 ///
6346 /// # Example
6347 /// ```ignore,no_run
6348 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6349 /// let x = InstanceInfo::new().set_uri("example");
6350 /// ```
6351 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6352 self.uri = v.into();
6353 self
6354 }
6355
6356 /// Sets the value of [interface][crate::model::InstanceInfo::interface].
6357 ///
6358 /// # Example
6359 /// ```ignore,no_run
6360 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6361 /// let x = InstanceInfo::new().set_interface("example");
6362 /// ```
6363 pub fn set_interface<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6364 self.interface = v.into();
6365 self
6366 }
6367
6368 /// Sets the value of [network_uri][crate::model::InstanceInfo::network_uri].
6369 ///
6370 /// # Example
6371 /// ```ignore,no_run
6372 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6373 /// let x = InstanceInfo::new().set_network_uri("example");
6374 /// ```
6375 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6376 self.network_uri = v.into();
6377 self
6378 }
6379
6380 /// Sets the value of [internal_ip][crate::model::InstanceInfo::internal_ip].
6381 ///
6382 /// # Example
6383 /// ```ignore,no_run
6384 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6385 /// let x = InstanceInfo::new().set_internal_ip("example");
6386 /// ```
6387 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6388 self.internal_ip = v.into();
6389 self
6390 }
6391
6392 /// Sets the value of [external_ip][crate::model::InstanceInfo::external_ip].
6393 ///
6394 /// # Example
6395 /// ```ignore,no_run
6396 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6397 /// let x = InstanceInfo::new().set_external_ip("example");
6398 /// ```
6399 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6400 self.external_ip = v.into();
6401 self
6402 }
6403
6404 /// Sets the value of [network_tags][crate::model::InstanceInfo::network_tags].
6405 ///
6406 /// # Example
6407 /// ```ignore,no_run
6408 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6409 /// let x = InstanceInfo::new().set_network_tags(["a", "b", "c"]);
6410 /// ```
6411 pub fn set_network_tags<T, V>(mut self, v: T) -> Self
6412 where
6413 T: std::iter::IntoIterator<Item = V>,
6414 V: std::convert::Into<std::string::String>,
6415 {
6416 use std::iter::Iterator;
6417 self.network_tags = v.into_iter().map(|i| i.into()).collect();
6418 self
6419 }
6420
6421 /// Sets the value of [service_account][crate::model::InstanceInfo::service_account].
6422 ///
6423 /// # Example
6424 /// ```ignore,no_run
6425 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6426 /// let x = InstanceInfo::new().set_service_account("example");
6427 /// ```
6428 #[deprecated]
6429 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6430 self.service_account = v.into();
6431 self
6432 }
6433
6434 /// Sets the value of [psc_network_attachment_uri][crate::model::InstanceInfo::psc_network_attachment_uri].
6435 ///
6436 /// # Example
6437 /// ```ignore,no_run
6438 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6439 /// let x = InstanceInfo::new().set_psc_network_attachment_uri("example");
6440 /// ```
6441 pub fn set_psc_network_attachment_uri<T: std::convert::Into<std::string::String>>(
6442 mut self,
6443 v: T,
6444 ) -> Self {
6445 self.psc_network_attachment_uri = v.into();
6446 self
6447 }
6448
6449 /// Sets the value of [running][crate::model::InstanceInfo::running].
6450 ///
6451 /// # Example
6452 /// ```ignore,no_run
6453 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6454 /// let x = InstanceInfo::new().set_running(true);
6455 /// ```
6456 #[deprecated]
6457 pub fn set_running<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6458 self.running = v.into();
6459 self
6460 }
6461
6462 /// Sets the value of [status][crate::model::InstanceInfo::status].
6463 ///
6464 /// # Example
6465 /// ```ignore,no_run
6466 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6467 /// use google_cloud_networkmanagement_v1::model::instance_info::Status;
6468 /// let x0 = InstanceInfo::new().set_status(Status::Running);
6469 /// let x1 = InstanceInfo::new().set_status(Status::NotRunning);
6470 /// ```
6471 pub fn set_status<T: std::convert::Into<crate::model::instance_info::Status>>(
6472 mut self,
6473 v: T,
6474 ) -> Self {
6475 self.status = v.into();
6476 self
6477 }
6478}
6479
6480impl wkt::message::Message for InstanceInfo {
6481 fn typename() -> &'static str {
6482 "type.googleapis.com/google.cloud.networkmanagement.v1.InstanceInfo"
6483 }
6484}
6485
6486/// Defines additional types related to [InstanceInfo].
6487pub mod instance_info {
6488 #[allow(unused_imports)]
6489 use super::*;
6490
6491 /// The status of the instance. We treat all states other than "RUNNING" as
6492 /// not running.
6493 ///
6494 /// # Working with unknown values
6495 ///
6496 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6497 /// additional enum variants at any time. Adding new variants is not considered
6498 /// a breaking change. Applications should write their code in anticipation of:
6499 ///
6500 /// - New values appearing in future releases of the client library, **and**
6501 /// - New values received dynamically, without application changes.
6502 ///
6503 /// Please consult the [Working with enums] section in the user guide for some
6504 /// guidelines.
6505 ///
6506 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6507 #[derive(Clone, Debug, PartialEq)]
6508 #[non_exhaustive]
6509 pub enum Status {
6510 /// Default unspecified value.
6511 Unspecified,
6512 /// The instance is running.
6513 Running,
6514 /// The instance has any status other than "RUNNING".
6515 NotRunning,
6516 /// If set, the enum was initialized with an unknown value.
6517 ///
6518 /// Applications can examine the value using [Status::value] or
6519 /// [Status::name].
6520 UnknownValue(status::UnknownValue),
6521 }
6522
6523 #[doc(hidden)]
6524 pub mod status {
6525 #[allow(unused_imports)]
6526 use super::*;
6527 #[derive(Clone, Debug, PartialEq)]
6528 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6529 }
6530
6531 impl Status {
6532 /// Gets the enum value.
6533 ///
6534 /// Returns `None` if the enum contains an unknown value deserialized from
6535 /// the string representation of enums.
6536 pub fn value(&self) -> std::option::Option<i32> {
6537 match self {
6538 Self::Unspecified => std::option::Option::Some(0),
6539 Self::Running => std::option::Option::Some(1),
6540 Self::NotRunning => std::option::Option::Some(2),
6541 Self::UnknownValue(u) => u.0.value(),
6542 }
6543 }
6544
6545 /// Gets the enum value as a string.
6546 ///
6547 /// Returns `None` if the enum contains an unknown value deserialized from
6548 /// the integer representation of enums.
6549 pub fn name(&self) -> std::option::Option<&str> {
6550 match self {
6551 Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
6552 Self::Running => std::option::Option::Some("RUNNING"),
6553 Self::NotRunning => std::option::Option::Some("NOT_RUNNING"),
6554 Self::UnknownValue(u) => u.0.name(),
6555 }
6556 }
6557 }
6558
6559 impl std::default::Default for Status {
6560 fn default() -> Self {
6561 use std::convert::From;
6562 Self::from(0)
6563 }
6564 }
6565
6566 impl std::fmt::Display for Status {
6567 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6568 wkt::internal::display_enum(f, self.name(), self.value())
6569 }
6570 }
6571
6572 impl std::convert::From<i32> for Status {
6573 fn from(value: i32) -> Self {
6574 match value {
6575 0 => Self::Unspecified,
6576 1 => Self::Running,
6577 2 => Self::NotRunning,
6578 _ => Self::UnknownValue(status::UnknownValue(
6579 wkt::internal::UnknownEnumValue::Integer(value),
6580 )),
6581 }
6582 }
6583 }
6584
6585 impl std::convert::From<&str> for Status {
6586 fn from(value: &str) -> Self {
6587 use std::string::ToString;
6588 match value {
6589 "STATUS_UNSPECIFIED" => Self::Unspecified,
6590 "RUNNING" => Self::Running,
6591 "NOT_RUNNING" => Self::NotRunning,
6592 _ => Self::UnknownValue(status::UnknownValue(
6593 wkt::internal::UnknownEnumValue::String(value.to_string()),
6594 )),
6595 }
6596 }
6597 }
6598
6599 impl serde::ser::Serialize for Status {
6600 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6601 where
6602 S: serde::Serializer,
6603 {
6604 match self {
6605 Self::Unspecified => serializer.serialize_i32(0),
6606 Self::Running => serializer.serialize_i32(1),
6607 Self::NotRunning => serializer.serialize_i32(2),
6608 Self::UnknownValue(u) => u.0.serialize(serializer),
6609 }
6610 }
6611 }
6612
6613 impl<'de> serde::de::Deserialize<'de> for Status {
6614 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6615 where
6616 D: serde::Deserializer<'de>,
6617 {
6618 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
6619 ".google.cloud.networkmanagement.v1.InstanceInfo.Status",
6620 ))
6621 }
6622 }
6623}
6624
6625/// For display only. Metadata associated with a Compute Engine network.
6626#[derive(Clone, Default, PartialEq)]
6627#[non_exhaustive]
6628pub struct NetworkInfo {
6629 /// Name of a Compute Engine network.
6630 pub display_name: std::string::String,
6631
6632 /// URI of a Compute Engine network.
6633 pub uri: std::string::String,
6634
6635 /// URI of the subnet matching the source IP address of the test.
6636 pub matched_subnet_uri: std::string::String,
6637
6638 /// The IP range of the subnet matching the source IP address of the test.
6639 pub matched_ip_range: std::string::String,
6640
6641 /// The region of the subnet matching the source IP address of the test.
6642 pub region: std::string::String,
6643
6644 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6645}
6646
6647impl NetworkInfo {
6648 pub fn new() -> Self {
6649 std::default::Default::default()
6650 }
6651
6652 /// Sets the value of [display_name][crate::model::NetworkInfo::display_name].
6653 ///
6654 /// # Example
6655 /// ```ignore,no_run
6656 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
6657 /// let x = NetworkInfo::new().set_display_name("example");
6658 /// ```
6659 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6660 self.display_name = v.into();
6661 self
6662 }
6663
6664 /// Sets the value of [uri][crate::model::NetworkInfo::uri].
6665 ///
6666 /// # Example
6667 /// ```ignore,no_run
6668 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
6669 /// let x = NetworkInfo::new().set_uri("example");
6670 /// ```
6671 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6672 self.uri = v.into();
6673 self
6674 }
6675
6676 /// Sets the value of [matched_subnet_uri][crate::model::NetworkInfo::matched_subnet_uri].
6677 ///
6678 /// # Example
6679 /// ```ignore,no_run
6680 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
6681 /// let x = NetworkInfo::new().set_matched_subnet_uri("example");
6682 /// ```
6683 pub fn set_matched_subnet_uri<T: std::convert::Into<std::string::String>>(
6684 mut self,
6685 v: T,
6686 ) -> Self {
6687 self.matched_subnet_uri = v.into();
6688 self
6689 }
6690
6691 /// Sets the value of [matched_ip_range][crate::model::NetworkInfo::matched_ip_range].
6692 ///
6693 /// # Example
6694 /// ```ignore,no_run
6695 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
6696 /// let x = NetworkInfo::new().set_matched_ip_range("example");
6697 /// ```
6698 pub fn set_matched_ip_range<T: std::convert::Into<std::string::String>>(
6699 mut self,
6700 v: T,
6701 ) -> Self {
6702 self.matched_ip_range = v.into();
6703 self
6704 }
6705
6706 /// Sets the value of [region][crate::model::NetworkInfo::region].
6707 ///
6708 /// # Example
6709 /// ```ignore,no_run
6710 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
6711 /// let x = NetworkInfo::new().set_region("example");
6712 /// ```
6713 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6714 self.region = v.into();
6715 self
6716 }
6717}
6718
6719impl wkt::message::Message for NetworkInfo {
6720 fn typename() -> &'static str {
6721 "type.googleapis.com/google.cloud.networkmanagement.v1.NetworkInfo"
6722 }
6723}
6724
6725/// For display only. Metadata associated with a VPC firewall rule, an implied
6726/// VPC firewall rule, or a firewall policy rule.
6727#[derive(Clone, Default, PartialEq)]
6728#[non_exhaustive]
6729pub struct FirewallInfo {
6730 /// The display name of the firewall rule. This field might be empty for
6731 /// firewall policy rules.
6732 pub display_name: std::string::String,
6733
6734 /// The URI of the firewall rule. This field is not applicable to implied
6735 /// VPC firewall rules.
6736 pub uri: std::string::String,
6737
6738 /// Possible values: INGRESS, EGRESS
6739 pub direction: std::string::String,
6740
6741 /// Possible values: ALLOW, DENY, APPLY_SECURITY_PROFILE_GROUP
6742 pub action: std::string::String,
6743
6744 /// The priority of the firewall rule.
6745 pub priority: i32,
6746
6747 /// The URI of the VPC network that the firewall rule is associated with.
6748 /// This field is not applicable to hierarchical firewall policy rules.
6749 pub network_uri: std::string::String,
6750
6751 /// The target tags defined by the VPC firewall rule. This field is not
6752 /// applicable to firewall policy rules.
6753 pub target_tags: std::vec::Vec<std::string::String>,
6754
6755 /// The target service accounts specified by the firewall rule.
6756 pub target_service_accounts: std::vec::Vec<std::string::String>,
6757
6758 /// The name of the firewall policy that this rule is associated with.
6759 /// This field is not applicable to VPC firewall rules and implied VPC firewall
6760 /// rules.
6761 pub policy: std::string::String,
6762
6763 /// The URI of the firewall policy that this rule is associated with.
6764 /// This field is not applicable to VPC firewall rules and implied VPC firewall
6765 /// rules.
6766 pub policy_uri: std::string::String,
6767
6768 /// The firewall rule's type.
6769 pub firewall_rule_type: crate::model::firewall_info::FirewallRuleType,
6770
6771 /// The priority of the firewall policy that this rule is associated with.
6772 /// This field is not applicable to VPC firewall rules and implied VPC firewall
6773 /// rules.
6774 pub policy_priority: i32,
6775
6776 /// Target type of the firewall rule.
6777 pub target_type: crate::model::firewall_info::TargetType,
6778
6779 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6780}
6781
6782impl FirewallInfo {
6783 pub fn new() -> Self {
6784 std::default::Default::default()
6785 }
6786
6787 /// Sets the value of [display_name][crate::model::FirewallInfo::display_name].
6788 ///
6789 /// # Example
6790 /// ```ignore,no_run
6791 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6792 /// let x = FirewallInfo::new().set_display_name("example");
6793 /// ```
6794 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6795 self.display_name = v.into();
6796 self
6797 }
6798
6799 /// Sets the value of [uri][crate::model::FirewallInfo::uri].
6800 ///
6801 /// # Example
6802 /// ```ignore,no_run
6803 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6804 /// let x = FirewallInfo::new().set_uri("example");
6805 /// ```
6806 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6807 self.uri = v.into();
6808 self
6809 }
6810
6811 /// Sets the value of [direction][crate::model::FirewallInfo::direction].
6812 ///
6813 /// # Example
6814 /// ```ignore,no_run
6815 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6816 /// let x = FirewallInfo::new().set_direction("example");
6817 /// ```
6818 pub fn set_direction<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6819 self.direction = v.into();
6820 self
6821 }
6822
6823 /// Sets the value of [action][crate::model::FirewallInfo::action].
6824 ///
6825 /// # Example
6826 /// ```ignore,no_run
6827 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6828 /// let x = FirewallInfo::new().set_action("example");
6829 /// ```
6830 pub fn set_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6831 self.action = v.into();
6832 self
6833 }
6834
6835 /// Sets the value of [priority][crate::model::FirewallInfo::priority].
6836 ///
6837 /// # Example
6838 /// ```ignore,no_run
6839 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6840 /// let x = FirewallInfo::new().set_priority(42);
6841 /// ```
6842 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6843 self.priority = v.into();
6844 self
6845 }
6846
6847 /// Sets the value of [network_uri][crate::model::FirewallInfo::network_uri].
6848 ///
6849 /// # Example
6850 /// ```ignore,no_run
6851 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6852 /// let x = FirewallInfo::new().set_network_uri("example");
6853 /// ```
6854 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6855 self.network_uri = v.into();
6856 self
6857 }
6858
6859 /// Sets the value of [target_tags][crate::model::FirewallInfo::target_tags].
6860 ///
6861 /// # Example
6862 /// ```ignore,no_run
6863 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6864 /// let x = FirewallInfo::new().set_target_tags(["a", "b", "c"]);
6865 /// ```
6866 pub fn set_target_tags<T, V>(mut self, v: T) -> Self
6867 where
6868 T: std::iter::IntoIterator<Item = V>,
6869 V: std::convert::Into<std::string::String>,
6870 {
6871 use std::iter::Iterator;
6872 self.target_tags = v.into_iter().map(|i| i.into()).collect();
6873 self
6874 }
6875
6876 /// Sets the value of [target_service_accounts][crate::model::FirewallInfo::target_service_accounts].
6877 ///
6878 /// # Example
6879 /// ```ignore,no_run
6880 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6881 /// let x = FirewallInfo::new().set_target_service_accounts(["a", "b", "c"]);
6882 /// ```
6883 pub fn set_target_service_accounts<T, V>(mut self, v: T) -> Self
6884 where
6885 T: std::iter::IntoIterator<Item = V>,
6886 V: std::convert::Into<std::string::String>,
6887 {
6888 use std::iter::Iterator;
6889 self.target_service_accounts = v.into_iter().map(|i| i.into()).collect();
6890 self
6891 }
6892
6893 /// Sets the value of [policy][crate::model::FirewallInfo::policy].
6894 ///
6895 /// # Example
6896 /// ```ignore,no_run
6897 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6898 /// let x = FirewallInfo::new().set_policy("example");
6899 /// ```
6900 pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6901 self.policy = v.into();
6902 self
6903 }
6904
6905 /// Sets the value of [policy_uri][crate::model::FirewallInfo::policy_uri].
6906 ///
6907 /// # Example
6908 /// ```ignore,no_run
6909 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6910 /// let x = FirewallInfo::new().set_policy_uri("example");
6911 /// ```
6912 pub fn set_policy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6913 self.policy_uri = v.into();
6914 self
6915 }
6916
6917 /// Sets the value of [firewall_rule_type][crate::model::FirewallInfo::firewall_rule_type].
6918 ///
6919 /// # Example
6920 /// ```ignore,no_run
6921 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6922 /// use google_cloud_networkmanagement_v1::model::firewall_info::FirewallRuleType;
6923 /// let x0 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::HierarchicalFirewallPolicyRule);
6924 /// let x1 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::VpcFirewallRule);
6925 /// let x2 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::ImpliedVpcFirewallRule);
6926 /// ```
6927 pub fn set_firewall_rule_type<
6928 T: std::convert::Into<crate::model::firewall_info::FirewallRuleType>,
6929 >(
6930 mut self,
6931 v: T,
6932 ) -> Self {
6933 self.firewall_rule_type = v.into();
6934 self
6935 }
6936
6937 /// Sets the value of [policy_priority][crate::model::FirewallInfo::policy_priority].
6938 ///
6939 /// # Example
6940 /// ```ignore,no_run
6941 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6942 /// let x = FirewallInfo::new().set_policy_priority(42);
6943 /// ```
6944 pub fn set_policy_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6945 self.policy_priority = v.into();
6946 self
6947 }
6948
6949 /// Sets the value of [target_type][crate::model::FirewallInfo::target_type].
6950 ///
6951 /// # Example
6952 /// ```ignore,no_run
6953 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6954 /// use google_cloud_networkmanagement_v1::model::firewall_info::TargetType;
6955 /// let x0 = FirewallInfo::new().set_target_type(TargetType::Instances);
6956 /// let x1 = FirewallInfo::new().set_target_type(TargetType::InternalManagedLb);
6957 /// ```
6958 pub fn set_target_type<T: std::convert::Into<crate::model::firewall_info::TargetType>>(
6959 mut self,
6960 v: T,
6961 ) -> Self {
6962 self.target_type = v.into();
6963 self
6964 }
6965}
6966
6967impl wkt::message::Message for FirewallInfo {
6968 fn typename() -> &'static str {
6969 "type.googleapis.com/google.cloud.networkmanagement.v1.FirewallInfo"
6970 }
6971}
6972
6973/// Defines additional types related to [FirewallInfo].
6974pub mod firewall_info {
6975 #[allow(unused_imports)]
6976 use super::*;
6977
6978 /// The firewall rule's type.
6979 ///
6980 /// # Working with unknown values
6981 ///
6982 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6983 /// additional enum variants at any time. Adding new variants is not considered
6984 /// a breaking change. Applications should write their code in anticipation of:
6985 ///
6986 /// - New values appearing in future releases of the client library, **and**
6987 /// - New values received dynamically, without application changes.
6988 ///
6989 /// Please consult the [Working with enums] section in the user guide for some
6990 /// guidelines.
6991 ///
6992 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6993 #[derive(Clone, Debug, PartialEq)]
6994 #[non_exhaustive]
6995 pub enum FirewallRuleType {
6996 /// Unspecified type.
6997 Unspecified,
6998 /// Hierarchical firewall policy rule. For details, see
6999 /// [Hierarchical firewall policies
7000 /// overview](https://cloud.google.com/vpc/docs/firewall-policies).
7001 HierarchicalFirewallPolicyRule,
7002 /// VPC firewall rule. For details, see
7003 /// [VPC firewall rules
7004 /// overview](https://cloud.google.com/vpc/docs/firewalls).
7005 VpcFirewallRule,
7006 /// Implied VPC firewall rule. For details, see
7007 /// [Implied
7008 /// rules](https://cloud.google.com/vpc/docs/firewalls#default_firewall_rules).
7009 ImpliedVpcFirewallRule,
7010 /// Implicit firewall rules that are managed by serverless VPC access to
7011 /// allow ingress access. They are not visible in the Google Cloud console.
7012 /// For details, see [VPC connector's implicit
7013 /// rules](https://cloud.google.com/functions/docs/networking/connecting-vpc#restrict-access).
7014 ServerlessVpcAccessManagedFirewallRule,
7015 /// User-defined global network firewall policy rule.
7016 /// For details, see [Network firewall
7017 /// policies](https://cloud.google.com/vpc/docs/network-firewall-policies).
7018 NetworkFirewallPolicyRule,
7019 /// User-defined regional network firewall policy rule.
7020 /// For details, see [Regional network firewall
7021 /// policies](https://cloud.google.com/firewall/docs/regional-firewall-policies).
7022 NetworkRegionalFirewallPolicyRule,
7023 /// System-defined global network firewall policy rule.
7024 SystemNetworkFirewallPolicyRule,
7025 /// System-defined regional network firewall policy rule.
7026 SystemRegionalNetworkFirewallPolicyRule,
7027 /// Firewall policy rule containing attributes not yet supported in
7028 /// Connectivity tests. Firewall analysis is skipped if such a rule can
7029 /// potentially be matched. Please see the [list of unsupported
7030 /// configurations](https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/concepts/overview#unsupported-configs).
7031 UnsupportedFirewallPolicyRule,
7032 /// Tracking state for response traffic created when request traffic goes
7033 /// through allow firewall rule.
7034 /// For details, see [firewall rules
7035 /// specifications](https://cloud.google.com/firewall/docs/firewalls#specifications)
7036 TrackingState,
7037 /// Firewall analysis was skipped due to executing Connectivity Test in the
7038 /// BypassFirewallChecks mode
7039 AnalysisSkipped,
7040 /// If set, the enum was initialized with an unknown value.
7041 ///
7042 /// Applications can examine the value using [FirewallRuleType::value] or
7043 /// [FirewallRuleType::name].
7044 UnknownValue(firewall_rule_type::UnknownValue),
7045 }
7046
7047 #[doc(hidden)]
7048 pub mod firewall_rule_type {
7049 #[allow(unused_imports)]
7050 use super::*;
7051 #[derive(Clone, Debug, PartialEq)]
7052 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7053 }
7054
7055 impl FirewallRuleType {
7056 /// Gets the enum value.
7057 ///
7058 /// Returns `None` if the enum contains an unknown value deserialized from
7059 /// the string representation of enums.
7060 pub fn value(&self) -> std::option::Option<i32> {
7061 match self {
7062 Self::Unspecified => std::option::Option::Some(0),
7063 Self::HierarchicalFirewallPolicyRule => std::option::Option::Some(1),
7064 Self::VpcFirewallRule => std::option::Option::Some(2),
7065 Self::ImpliedVpcFirewallRule => std::option::Option::Some(3),
7066 Self::ServerlessVpcAccessManagedFirewallRule => std::option::Option::Some(4),
7067 Self::NetworkFirewallPolicyRule => std::option::Option::Some(5),
7068 Self::NetworkRegionalFirewallPolicyRule => std::option::Option::Some(6),
7069 Self::SystemNetworkFirewallPolicyRule => std::option::Option::Some(7),
7070 Self::SystemRegionalNetworkFirewallPolicyRule => std::option::Option::Some(8),
7071 Self::UnsupportedFirewallPolicyRule => std::option::Option::Some(100),
7072 Self::TrackingState => std::option::Option::Some(101),
7073 Self::AnalysisSkipped => std::option::Option::Some(102),
7074 Self::UnknownValue(u) => u.0.value(),
7075 }
7076 }
7077
7078 /// Gets the enum value as a string.
7079 ///
7080 /// Returns `None` if the enum contains an unknown value deserialized from
7081 /// the integer representation of enums.
7082 pub fn name(&self) -> std::option::Option<&str> {
7083 match self {
7084 Self::Unspecified => std::option::Option::Some("FIREWALL_RULE_TYPE_UNSPECIFIED"),
7085 Self::HierarchicalFirewallPolicyRule => {
7086 std::option::Option::Some("HIERARCHICAL_FIREWALL_POLICY_RULE")
7087 }
7088 Self::VpcFirewallRule => std::option::Option::Some("VPC_FIREWALL_RULE"),
7089 Self::ImpliedVpcFirewallRule => {
7090 std::option::Option::Some("IMPLIED_VPC_FIREWALL_RULE")
7091 }
7092 Self::ServerlessVpcAccessManagedFirewallRule => {
7093 std::option::Option::Some("SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE")
7094 }
7095 Self::NetworkFirewallPolicyRule => {
7096 std::option::Option::Some("NETWORK_FIREWALL_POLICY_RULE")
7097 }
7098 Self::NetworkRegionalFirewallPolicyRule => {
7099 std::option::Option::Some("NETWORK_REGIONAL_FIREWALL_POLICY_RULE")
7100 }
7101 Self::SystemNetworkFirewallPolicyRule => {
7102 std::option::Option::Some("SYSTEM_NETWORK_FIREWALL_POLICY_RULE")
7103 }
7104 Self::SystemRegionalNetworkFirewallPolicyRule => {
7105 std::option::Option::Some("SYSTEM_REGIONAL_NETWORK_FIREWALL_POLICY_RULE")
7106 }
7107 Self::UnsupportedFirewallPolicyRule => {
7108 std::option::Option::Some("UNSUPPORTED_FIREWALL_POLICY_RULE")
7109 }
7110 Self::TrackingState => std::option::Option::Some("TRACKING_STATE"),
7111 Self::AnalysisSkipped => std::option::Option::Some("ANALYSIS_SKIPPED"),
7112 Self::UnknownValue(u) => u.0.name(),
7113 }
7114 }
7115 }
7116
7117 impl std::default::Default for FirewallRuleType {
7118 fn default() -> Self {
7119 use std::convert::From;
7120 Self::from(0)
7121 }
7122 }
7123
7124 impl std::fmt::Display for FirewallRuleType {
7125 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7126 wkt::internal::display_enum(f, self.name(), self.value())
7127 }
7128 }
7129
7130 impl std::convert::From<i32> for FirewallRuleType {
7131 fn from(value: i32) -> Self {
7132 match value {
7133 0 => Self::Unspecified,
7134 1 => Self::HierarchicalFirewallPolicyRule,
7135 2 => Self::VpcFirewallRule,
7136 3 => Self::ImpliedVpcFirewallRule,
7137 4 => Self::ServerlessVpcAccessManagedFirewallRule,
7138 5 => Self::NetworkFirewallPolicyRule,
7139 6 => Self::NetworkRegionalFirewallPolicyRule,
7140 7 => Self::SystemNetworkFirewallPolicyRule,
7141 8 => Self::SystemRegionalNetworkFirewallPolicyRule,
7142 100 => Self::UnsupportedFirewallPolicyRule,
7143 101 => Self::TrackingState,
7144 102 => Self::AnalysisSkipped,
7145 _ => Self::UnknownValue(firewall_rule_type::UnknownValue(
7146 wkt::internal::UnknownEnumValue::Integer(value),
7147 )),
7148 }
7149 }
7150 }
7151
7152 impl std::convert::From<&str> for FirewallRuleType {
7153 fn from(value: &str) -> Self {
7154 use std::string::ToString;
7155 match value {
7156 "FIREWALL_RULE_TYPE_UNSPECIFIED" => Self::Unspecified,
7157 "HIERARCHICAL_FIREWALL_POLICY_RULE" => Self::HierarchicalFirewallPolicyRule,
7158 "VPC_FIREWALL_RULE" => Self::VpcFirewallRule,
7159 "IMPLIED_VPC_FIREWALL_RULE" => Self::ImpliedVpcFirewallRule,
7160 "SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE" => {
7161 Self::ServerlessVpcAccessManagedFirewallRule
7162 }
7163 "NETWORK_FIREWALL_POLICY_RULE" => Self::NetworkFirewallPolicyRule,
7164 "NETWORK_REGIONAL_FIREWALL_POLICY_RULE" => Self::NetworkRegionalFirewallPolicyRule,
7165 "SYSTEM_NETWORK_FIREWALL_POLICY_RULE" => Self::SystemNetworkFirewallPolicyRule,
7166 "SYSTEM_REGIONAL_NETWORK_FIREWALL_POLICY_RULE" => {
7167 Self::SystemRegionalNetworkFirewallPolicyRule
7168 }
7169 "UNSUPPORTED_FIREWALL_POLICY_RULE" => Self::UnsupportedFirewallPolicyRule,
7170 "TRACKING_STATE" => Self::TrackingState,
7171 "ANALYSIS_SKIPPED" => Self::AnalysisSkipped,
7172 _ => Self::UnknownValue(firewall_rule_type::UnknownValue(
7173 wkt::internal::UnknownEnumValue::String(value.to_string()),
7174 )),
7175 }
7176 }
7177 }
7178
7179 impl serde::ser::Serialize for FirewallRuleType {
7180 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7181 where
7182 S: serde::Serializer,
7183 {
7184 match self {
7185 Self::Unspecified => serializer.serialize_i32(0),
7186 Self::HierarchicalFirewallPolicyRule => serializer.serialize_i32(1),
7187 Self::VpcFirewallRule => serializer.serialize_i32(2),
7188 Self::ImpliedVpcFirewallRule => serializer.serialize_i32(3),
7189 Self::ServerlessVpcAccessManagedFirewallRule => serializer.serialize_i32(4),
7190 Self::NetworkFirewallPolicyRule => serializer.serialize_i32(5),
7191 Self::NetworkRegionalFirewallPolicyRule => serializer.serialize_i32(6),
7192 Self::SystemNetworkFirewallPolicyRule => serializer.serialize_i32(7),
7193 Self::SystemRegionalNetworkFirewallPolicyRule => serializer.serialize_i32(8),
7194 Self::UnsupportedFirewallPolicyRule => serializer.serialize_i32(100),
7195 Self::TrackingState => serializer.serialize_i32(101),
7196 Self::AnalysisSkipped => serializer.serialize_i32(102),
7197 Self::UnknownValue(u) => u.0.serialize(serializer),
7198 }
7199 }
7200 }
7201
7202 impl<'de> serde::de::Deserialize<'de> for FirewallRuleType {
7203 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7204 where
7205 D: serde::Deserializer<'de>,
7206 {
7207 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FirewallRuleType>::new(
7208 ".google.cloud.networkmanagement.v1.FirewallInfo.FirewallRuleType",
7209 ))
7210 }
7211 }
7212
7213 /// Target type of the firewall rule.
7214 ///
7215 /// # Working with unknown values
7216 ///
7217 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7218 /// additional enum variants at any time. Adding new variants is not considered
7219 /// a breaking change. Applications should write their code in anticipation of:
7220 ///
7221 /// - New values appearing in future releases of the client library, **and**
7222 /// - New values received dynamically, without application changes.
7223 ///
7224 /// Please consult the [Working with enums] section in the user guide for some
7225 /// guidelines.
7226 ///
7227 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7228 #[derive(Clone, Debug, PartialEq)]
7229 #[non_exhaustive]
7230 pub enum TargetType {
7231 /// Target type is not specified. In this case we treat the rule as applying
7232 /// to INSTANCES target type.
7233 Unspecified,
7234 /// Firewall rule applies to instances.
7235 Instances,
7236 /// Firewall rule applies to internal managed load balancers.
7237 InternalManagedLb,
7238 /// If set, the enum was initialized with an unknown value.
7239 ///
7240 /// Applications can examine the value using [TargetType::value] or
7241 /// [TargetType::name].
7242 UnknownValue(target_type::UnknownValue),
7243 }
7244
7245 #[doc(hidden)]
7246 pub mod target_type {
7247 #[allow(unused_imports)]
7248 use super::*;
7249 #[derive(Clone, Debug, PartialEq)]
7250 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7251 }
7252
7253 impl TargetType {
7254 /// Gets the enum value.
7255 ///
7256 /// Returns `None` if the enum contains an unknown value deserialized from
7257 /// the string representation of enums.
7258 pub fn value(&self) -> std::option::Option<i32> {
7259 match self {
7260 Self::Unspecified => std::option::Option::Some(0),
7261 Self::Instances => std::option::Option::Some(1),
7262 Self::InternalManagedLb => std::option::Option::Some(2),
7263 Self::UnknownValue(u) => u.0.value(),
7264 }
7265 }
7266
7267 /// Gets the enum value as a string.
7268 ///
7269 /// Returns `None` if the enum contains an unknown value deserialized from
7270 /// the integer representation of enums.
7271 pub fn name(&self) -> std::option::Option<&str> {
7272 match self {
7273 Self::Unspecified => std::option::Option::Some("TARGET_TYPE_UNSPECIFIED"),
7274 Self::Instances => std::option::Option::Some("INSTANCES"),
7275 Self::InternalManagedLb => std::option::Option::Some("INTERNAL_MANAGED_LB"),
7276 Self::UnknownValue(u) => u.0.name(),
7277 }
7278 }
7279 }
7280
7281 impl std::default::Default for TargetType {
7282 fn default() -> Self {
7283 use std::convert::From;
7284 Self::from(0)
7285 }
7286 }
7287
7288 impl std::fmt::Display for TargetType {
7289 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7290 wkt::internal::display_enum(f, self.name(), self.value())
7291 }
7292 }
7293
7294 impl std::convert::From<i32> for TargetType {
7295 fn from(value: i32) -> Self {
7296 match value {
7297 0 => Self::Unspecified,
7298 1 => Self::Instances,
7299 2 => Self::InternalManagedLb,
7300 _ => Self::UnknownValue(target_type::UnknownValue(
7301 wkt::internal::UnknownEnumValue::Integer(value),
7302 )),
7303 }
7304 }
7305 }
7306
7307 impl std::convert::From<&str> for TargetType {
7308 fn from(value: &str) -> Self {
7309 use std::string::ToString;
7310 match value {
7311 "TARGET_TYPE_UNSPECIFIED" => Self::Unspecified,
7312 "INSTANCES" => Self::Instances,
7313 "INTERNAL_MANAGED_LB" => Self::InternalManagedLb,
7314 _ => Self::UnknownValue(target_type::UnknownValue(
7315 wkt::internal::UnknownEnumValue::String(value.to_string()),
7316 )),
7317 }
7318 }
7319 }
7320
7321 impl serde::ser::Serialize for TargetType {
7322 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7323 where
7324 S: serde::Serializer,
7325 {
7326 match self {
7327 Self::Unspecified => serializer.serialize_i32(0),
7328 Self::Instances => serializer.serialize_i32(1),
7329 Self::InternalManagedLb => serializer.serialize_i32(2),
7330 Self::UnknownValue(u) => u.0.serialize(serializer),
7331 }
7332 }
7333 }
7334
7335 impl<'de> serde::de::Deserialize<'de> for TargetType {
7336 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7337 where
7338 D: serde::Deserializer<'de>,
7339 {
7340 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetType>::new(
7341 ".google.cloud.networkmanagement.v1.FirewallInfo.TargetType",
7342 ))
7343 }
7344 }
7345}
7346
7347/// For display only. Metadata associated with a Compute Engine route.
7348#[derive(Clone, Default, PartialEq)]
7349#[non_exhaustive]
7350pub struct RouteInfo {
7351 /// Type of route.
7352 pub route_type: crate::model::route_info::RouteType,
7353
7354 /// Type of next hop.
7355 pub next_hop_type: crate::model::route_info::NextHopType,
7356
7357 /// Indicates where route is applicable. Deprecated, routes with NCC_HUB scope
7358 /// are not included in the trace in new tests.
7359 #[deprecated]
7360 pub route_scope: crate::model::route_info::RouteScope,
7361
7362 /// Name of a route.
7363 pub display_name: std::string::String,
7364
7365 /// URI of a route. SUBNET, STATIC, PEERING_SUBNET (only for peering network)
7366 /// and POLICY_BASED routes only.
7367 pub uri: std::string::String,
7368
7369 /// Region of the route. DYNAMIC, PEERING_DYNAMIC, POLICY_BASED and ADVERTISED
7370 /// routes only. If set for POLICY_BASED route, this is a region of VLAN
7371 /// attachments for Cloud Interconnect the route applies to.
7372 pub region: std::string::String,
7373
7374 /// Destination IP range of the route.
7375 pub dest_ip_range: std::string::String,
7376
7377 /// String type of the next hop of the route (for example, "VPN tunnel").
7378 /// Deprecated in favor of the next_hop_type and next_hop_uri fields, not used
7379 /// in new tests.
7380 #[deprecated]
7381 pub next_hop: std::string::String,
7382
7383 /// URI of a VPC network where route is located.
7384 pub network_uri: std::string::String,
7385
7386 /// Priority of the route.
7387 pub priority: i32,
7388
7389 /// Instance tags of the route.
7390 pub instance_tags: std::vec::Vec<std::string::String>,
7391
7392 /// Source IP address range of the route. POLICY_BASED routes only.
7393 pub src_ip_range: std::string::String,
7394
7395 /// Destination port ranges of the route. POLICY_BASED routes only.
7396 pub dest_port_ranges: std::vec::Vec<std::string::String>,
7397
7398 /// Source port ranges of the route. POLICY_BASED routes only.
7399 pub src_port_ranges: std::vec::Vec<std::string::String>,
7400
7401 /// Protocols of the route. POLICY_BASED routes only.
7402 pub protocols: std::vec::Vec<std::string::String>,
7403
7404 /// URI of the NCC Hub the route is advertised by. PEERING_SUBNET and
7405 /// PEERING_DYNAMIC routes that are advertised by NCC Hub only.
7406 pub ncc_hub_uri: std::option::Option<std::string::String>,
7407
7408 /// URI of the destination NCC Spoke. PEERING_SUBNET and PEERING_DYNAMIC routes
7409 /// that are advertised by NCC Hub only.
7410 pub ncc_spoke_uri: std::option::Option<std::string::String>,
7411
7412 /// For ADVERTISED dynamic routes, the URI of the Cloud Router that advertised
7413 /// the corresponding IP prefix.
7414 pub advertised_route_source_router_uri: std::option::Option<std::string::String>,
7415
7416 /// For ADVERTISED routes, the URI of their next hop, i.e. the URI of the
7417 /// hybrid endpoint (VPN tunnel, Interconnect attachment, NCC router appliance)
7418 /// the advertised prefix is advertised through, or URI of the source peered
7419 /// network. Deprecated in favor of the next_hop_uri field, not used in new
7420 /// tests.
7421 #[deprecated]
7422 pub advertised_route_next_hop_uri: std::option::Option<std::string::String>,
7423
7424 /// URI of the next hop resource.
7425 pub next_hop_uri: std::string::String,
7426
7427 /// URI of a VPC network where the next hop resource is located.
7428 pub next_hop_network_uri: std::string::String,
7429
7430 /// For PEERING_SUBNET and PEERING_STATIC routes, the URI of the originating
7431 /// SUBNET/STATIC route.
7432 pub originating_route_uri: std::string::String,
7433
7434 /// For PEERING_SUBNET, PEERING_STATIC and PEERING_DYNAMIC routes, the name of
7435 /// the originating SUBNET/STATIC/DYNAMIC route.
7436 pub originating_route_display_name: std::string::String,
7437
7438 /// For PEERING_SUBNET and PEERING_DYNAMIC routes that are advertised by NCC
7439 /// Hub, the URI of the corresponding route in NCC Hub's routing table.
7440 pub ncc_hub_route_uri: std::string::String,
7441
7442 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7443}
7444
7445impl RouteInfo {
7446 pub fn new() -> Self {
7447 std::default::Default::default()
7448 }
7449
7450 /// Sets the value of [route_type][crate::model::RouteInfo::route_type].
7451 ///
7452 /// # Example
7453 /// ```ignore,no_run
7454 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7455 /// use google_cloud_networkmanagement_v1::model::route_info::RouteType;
7456 /// let x0 = RouteInfo::new().set_route_type(RouteType::Subnet);
7457 /// let x1 = RouteInfo::new().set_route_type(RouteType::Static);
7458 /// let x2 = RouteInfo::new().set_route_type(RouteType::Dynamic);
7459 /// ```
7460 pub fn set_route_type<T: std::convert::Into<crate::model::route_info::RouteType>>(
7461 mut self,
7462 v: T,
7463 ) -> Self {
7464 self.route_type = v.into();
7465 self
7466 }
7467
7468 /// Sets the value of [next_hop_type][crate::model::RouteInfo::next_hop_type].
7469 ///
7470 /// # Example
7471 /// ```ignore,no_run
7472 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7473 /// use google_cloud_networkmanagement_v1::model::route_info::NextHopType;
7474 /// let x0 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopIp);
7475 /// let x1 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopInstance);
7476 /// let x2 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopNetwork);
7477 /// ```
7478 pub fn set_next_hop_type<T: std::convert::Into<crate::model::route_info::NextHopType>>(
7479 mut self,
7480 v: T,
7481 ) -> Self {
7482 self.next_hop_type = v.into();
7483 self
7484 }
7485
7486 /// Sets the value of [route_scope][crate::model::RouteInfo::route_scope].
7487 ///
7488 /// # Example
7489 /// ```ignore,no_run
7490 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7491 /// use google_cloud_networkmanagement_v1::model::route_info::RouteScope;
7492 /// let x0 = RouteInfo::new().set_route_scope(RouteScope::Network);
7493 /// let x1 = RouteInfo::new().set_route_scope(RouteScope::NccHub);
7494 /// ```
7495 #[deprecated]
7496 pub fn set_route_scope<T: std::convert::Into<crate::model::route_info::RouteScope>>(
7497 mut self,
7498 v: T,
7499 ) -> Self {
7500 self.route_scope = v.into();
7501 self
7502 }
7503
7504 /// Sets the value of [display_name][crate::model::RouteInfo::display_name].
7505 ///
7506 /// # Example
7507 /// ```ignore,no_run
7508 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7509 /// let x = RouteInfo::new().set_display_name("example");
7510 /// ```
7511 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7512 self.display_name = v.into();
7513 self
7514 }
7515
7516 /// Sets the value of [uri][crate::model::RouteInfo::uri].
7517 ///
7518 /// # Example
7519 /// ```ignore,no_run
7520 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7521 /// let x = RouteInfo::new().set_uri("example");
7522 /// ```
7523 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7524 self.uri = v.into();
7525 self
7526 }
7527
7528 /// Sets the value of [region][crate::model::RouteInfo::region].
7529 ///
7530 /// # Example
7531 /// ```ignore,no_run
7532 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7533 /// let x = RouteInfo::new().set_region("example");
7534 /// ```
7535 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7536 self.region = v.into();
7537 self
7538 }
7539
7540 /// Sets the value of [dest_ip_range][crate::model::RouteInfo::dest_ip_range].
7541 ///
7542 /// # Example
7543 /// ```ignore,no_run
7544 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7545 /// let x = RouteInfo::new().set_dest_ip_range("example");
7546 /// ```
7547 pub fn set_dest_ip_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7548 self.dest_ip_range = v.into();
7549 self
7550 }
7551
7552 /// Sets the value of [next_hop][crate::model::RouteInfo::next_hop].
7553 ///
7554 /// # Example
7555 /// ```ignore,no_run
7556 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7557 /// let x = RouteInfo::new().set_next_hop("example");
7558 /// ```
7559 #[deprecated]
7560 pub fn set_next_hop<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7561 self.next_hop = v.into();
7562 self
7563 }
7564
7565 /// Sets the value of [network_uri][crate::model::RouteInfo::network_uri].
7566 ///
7567 /// # Example
7568 /// ```ignore,no_run
7569 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7570 /// let x = RouteInfo::new().set_network_uri("example");
7571 /// ```
7572 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7573 self.network_uri = v.into();
7574 self
7575 }
7576
7577 /// Sets the value of [priority][crate::model::RouteInfo::priority].
7578 ///
7579 /// # Example
7580 /// ```ignore,no_run
7581 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7582 /// let x = RouteInfo::new().set_priority(42);
7583 /// ```
7584 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7585 self.priority = v.into();
7586 self
7587 }
7588
7589 /// Sets the value of [instance_tags][crate::model::RouteInfo::instance_tags].
7590 ///
7591 /// # Example
7592 /// ```ignore,no_run
7593 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7594 /// let x = RouteInfo::new().set_instance_tags(["a", "b", "c"]);
7595 /// ```
7596 pub fn set_instance_tags<T, V>(mut self, v: T) -> Self
7597 where
7598 T: std::iter::IntoIterator<Item = V>,
7599 V: std::convert::Into<std::string::String>,
7600 {
7601 use std::iter::Iterator;
7602 self.instance_tags = v.into_iter().map(|i| i.into()).collect();
7603 self
7604 }
7605
7606 /// Sets the value of [src_ip_range][crate::model::RouteInfo::src_ip_range].
7607 ///
7608 /// # Example
7609 /// ```ignore,no_run
7610 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7611 /// let x = RouteInfo::new().set_src_ip_range("example");
7612 /// ```
7613 pub fn set_src_ip_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7614 self.src_ip_range = v.into();
7615 self
7616 }
7617
7618 /// Sets the value of [dest_port_ranges][crate::model::RouteInfo::dest_port_ranges].
7619 ///
7620 /// # Example
7621 /// ```ignore,no_run
7622 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7623 /// let x = RouteInfo::new().set_dest_port_ranges(["a", "b", "c"]);
7624 /// ```
7625 pub fn set_dest_port_ranges<T, V>(mut self, v: T) -> Self
7626 where
7627 T: std::iter::IntoIterator<Item = V>,
7628 V: std::convert::Into<std::string::String>,
7629 {
7630 use std::iter::Iterator;
7631 self.dest_port_ranges = v.into_iter().map(|i| i.into()).collect();
7632 self
7633 }
7634
7635 /// Sets the value of [src_port_ranges][crate::model::RouteInfo::src_port_ranges].
7636 ///
7637 /// # Example
7638 /// ```ignore,no_run
7639 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7640 /// let x = RouteInfo::new().set_src_port_ranges(["a", "b", "c"]);
7641 /// ```
7642 pub fn set_src_port_ranges<T, V>(mut self, v: T) -> Self
7643 where
7644 T: std::iter::IntoIterator<Item = V>,
7645 V: std::convert::Into<std::string::String>,
7646 {
7647 use std::iter::Iterator;
7648 self.src_port_ranges = v.into_iter().map(|i| i.into()).collect();
7649 self
7650 }
7651
7652 /// Sets the value of [protocols][crate::model::RouteInfo::protocols].
7653 ///
7654 /// # Example
7655 /// ```ignore,no_run
7656 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7657 /// let x = RouteInfo::new().set_protocols(["a", "b", "c"]);
7658 /// ```
7659 pub fn set_protocols<T, V>(mut self, v: T) -> Self
7660 where
7661 T: std::iter::IntoIterator<Item = V>,
7662 V: std::convert::Into<std::string::String>,
7663 {
7664 use std::iter::Iterator;
7665 self.protocols = v.into_iter().map(|i| i.into()).collect();
7666 self
7667 }
7668
7669 /// Sets the value of [ncc_hub_uri][crate::model::RouteInfo::ncc_hub_uri].
7670 ///
7671 /// # Example
7672 /// ```ignore,no_run
7673 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7674 /// let x = RouteInfo::new().set_ncc_hub_uri("example");
7675 /// ```
7676 pub fn set_ncc_hub_uri<T>(mut self, v: T) -> Self
7677 where
7678 T: std::convert::Into<std::string::String>,
7679 {
7680 self.ncc_hub_uri = std::option::Option::Some(v.into());
7681 self
7682 }
7683
7684 /// Sets or clears the value of [ncc_hub_uri][crate::model::RouteInfo::ncc_hub_uri].
7685 ///
7686 /// # Example
7687 /// ```ignore,no_run
7688 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7689 /// let x = RouteInfo::new().set_or_clear_ncc_hub_uri(Some("example"));
7690 /// let x = RouteInfo::new().set_or_clear_ncc_hub_uri(None::<String>);
7691 /// ```
7692 pub fn set_or_clear_ncc_hub_uri<T>(mut self, v: std::option::Option<T>) -> Self
7693 where
7694 T: std::convert::Into<std::string::String>,
7695 {
7696 self.ncc_hub_uri = v.map(|x| x.into());
7697 self
7698 }
7699
7700 /// Sets the value of [ncc_spoke_uri][crate::model::RouteInfo::ncc_spoke_uri].
7701 ///
7702 /// # Example
7703 /// ```ignore,no_run
7704 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7705 /// let x = RouteInfo::new().set_ncc_spoke_uri("example");
7706 /// ```
7707 pub fn set_ncc_spoke_uri<T>(mut self, v: T) -> Self
7708 where
7709 T: std::convert::Into<std::string::String>,
7710 {
7711 self.ncc_spoke_uri = std::option::Option::Some(v.into());
7712 self
7713 }
7714
7715 /// Sets or clears the value of [ncc_spoke_uri][crate::model::RouteInfo::ncc_spoke_uri].
7716 ///
7717 /// # Example
7718 /// ```ignore,no_run
7719 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7720 /// let x = RouteInfo::new().set_or_clear_ncc_spoke_uri(Some("example"));
7721 /// let x = RouteInfo::new().set_or_clear_ncc_spoke_uri(None::<String>);
7722 /// ```
7723 pub fn set_or_clear_ncc_spoke_uri<T>(mut self, v: std::option::Option<T>) -> Self
7724 where
7725 T: std::convert::Into<std::string::String>,
7726 {
7727 self.ncc_spoke_uri = v.map(|x| x.into());
7728 self
7729 }
7730
7731 /// Sets the value of [advertised_route_source_router_uri][crate::model::RouteInfo::advertised_route_source_router_uri].
7732 ///
7733 /// # Example
7734 /// ```ignore,no_run
7735 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7736 /// let x = RouteInfo::new().set_advertised_route_source_router_uri("example");
7737 /// ```
7738 pub fn set_advertised_route_source_router_uri<T>(mut self, v: T) -> Self
7739 where
7740 T: std::convert::Into<std::string::String>,
7741 {
7742 self.advertised_route_source_router_uri = std::option::Option::Some(v.into());
7743 self
7744 }
7745
7746 /// Sets or clears the value of [advertised_route_source_router_uri][crate::model::RouteInfo::advertised_route_source_router_uri].
7747 ///
7748 /// # Example
7749 /// ```ignore,no_run
7750 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7751 /// let x = RouteInfo::new().set_or_clear_advertised_route_source_router_uri(Some("example"));
7752 /// let x = RouteInfo::new().set_or_clear_advertised_route_source_router_uri(None::<String>);
7753 /// ```
7754 pub fn set_or_clear_advertised_route_source_router_uri<T>(
7755 mut self,
7756 v: std::option::Option<T>,
7757 ) -> Self
7758 where
7759 T: std::convert::Into<std::string::String>,
7760 {
7761 self.advertised_route_source_router_uri = v.map(|x| x.into());
7762 self
7763 }
7764
7765 /// Sets the value of [advertised_route_next_hop_uri][crate::model::RouteInfo::advertised_route_next_hop_uri].
7766 ///
7767 /// # Example
7768 /// ```ignore,no_run
7769 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7770 /// let x = RouteInfo::new().set_advertised_route_next_hop_uri("example");
7771 /// ```
7772 #[deprecated]
7773 pub fn set_advertised_route_next_hop_uri<T>(mut self, v: T) -> Self
7774 where
7775 T: std::convert::Into<std::string::String>,
7776 {
7777 self.advertised_route_next_hop_uri = std::option::Option::Some(v.into());
7778 self
7779 }
7780
7781 /// Sets or clears the value of [advertised_route_next_hop_uri][crate::model::RouteInfo::advertised_route_next_hop_uri].
7782 ///
7783 /// # Example
7784 /// ```ignore,no_run
7785 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7786 /// let x = RouteInfo::new().set_or_clear_advertised_route_next_hop_uri(Some("example"));
7787 /// let x = RouteInfo::new().set_or_clear_advertised_route_next_hop_uri(None::<String>);
7788 /// ```
7789 #[deprecated]
7790 pub fn set_or_clear_advertised_route_next_hop_uri<T>(
7791 mut self,
7792 v: std::option::Option<T>,
7793 ) -> Self
7794 where
7795 T: std::convert::Into<std::string::String>,
7796 {
7797 self.advertised_route_next_hop_uri = v.map(|x| x.into());
7798 self
7799 }
7800
7801 /// Sets the value of [next_hop_uri][crate::model::RouteInfo::next_hop_uri].
7802 ///
7803 /// # Example
7804 /// ```ignore,no_run
7805 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7806 /// let x = RouteInfo::new().set_next_hop_uri("example");
7807 /// ```
7808 pub fn set_next_hop_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7809 self.next_hop_uri = v.into();
7810 self
7811 }
7812
7813 /// Sets the value of [next_hop_network_uri][crate::model::RouteInfo::next_hop_network_uri].
7814 ///
7815 /// # Example
7816 /// ```ignore,no_run
7817 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7818 /// let x = RouteInfo::new().set_next_hop_network_uri("example");
7819 /// ```
7820 pub fn set_next_hop_network_uri<T: std::convert::Into<std::string::String>>(
7821 mut self,
7822 v: T,
7823 ) -> Self {
7824 self.next_hop_network_uri = v.into();
7825 self
7826 }
7827
7828 /// Sets the value of [originating_route_uri][crate::model::RouteInfo::originating_route_uri].
7829 ///
7830 /// # Example
7831 /// ```ignore,no_run
7832 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7833 /// let x = RouteInfo::new().set_originating_route_uri("example");
7834 /// ```
7835 pub fn set_originating_route_uri<T: std::convert::Into<std::string::String>>(
7836 mut self,
7837 v: T,
7838 ) -> Self {
7839 self.originating_route_uri = v.into();
7840 self
7841 }
7842
7843 /// Sets the value of [originating_route_display_name][crate::model::RouteInfo::originating_route_display_name].
7844 ///
7845 /// # Example
7846 /// ```ignore,no_run
7847 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7848 /// let x = RouteInfo::new().set_originating_route_display_name("example");
7849 /// ```
7850 pub fn set_originating_route_display_name<T: std::convert::Into<std::string::String>>(
7851 mut self,
7852 v: T,
7853 ) -> Self {
7854 self.originating_route_display_name = v.into();
7855 self
7856 }
7857
7858 /// Sets the value of [ncc_hub_route_uri][crate::model::RouteInfo::ncc_hub_route_uri].
7859 ///
7860 /// # Example
7861 /// ```ignore,no_run
7862 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7863 /// let x = RouteInfo::new().set_ncc_hub_route_uri("example");
7864 /// ```
7865 pub fn set_ncc_hub_route_uri<T: std::convert::Into<std::string::String>>(
7866 mut self,
7867 v: T,
7868 ) -> Self {
7869 self.ncc_hub_route_uri = v.into();
7870 self
7871 }
7872}
7873
7874impl wkt::message::Message for RouteInfo {
7875 fn typename() -> &'static str {
7876 "type.googleapis.com/google.cloud.networkmanagement.v1.RouteInfo"
7877 }
7878}
7879
7880/// Defines additional types related to [RouteInfo].
7881pub mod route_info {
7882 #[allow(unused_imports)]
7883 use super::*;
7884
7885 /// Type of route:
7886 ///
7887 /// # Working with unknown values
7888 ///
7889 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7890 /// additional enum variants at any time. Adding new variants is not considered
7891 /// a breaking change. Applications should write their code in anticipation of:
7892 ///
7893 /// - New values appearing in future releases of the client library, **and**
7894 /// - New values received dynamically, without application changes.
7895 ///
7896 /// Please consult the [Working with enums] section in the user guide for some
7897 /// guidelines.
7898 ///
7899 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7900 #[derive(Clone, Debug, PartialEq)]
7901 #[non_exhaustive]
7902 pub enum RouteType {
7903 /// Unspecified type. Default value.
7904 Unspecified,
7905 /// Route is a subnet route automatically created by the system.
7906 Subnet,
7907 /// Static route created by the user, including the default route to the
7908 /// internet.
7909 Static,
7910 /// Dynamic route exchanged between BGP peers.
7911 Dynamic,
7912 /// A subnet route received from peering network or NCC Hub.
7913 PeeringSubnet,
7914 /// A static route received from peering network.
7915 PeeringStatic,
7916 /// A dynamic route received from peering network or NCC Hub.
7917 PeeringDynamic,
7918 /// Policy based route.
7919 PolicyBased,
7920 /// Advertised route. Synthetic route which is used to transition from the
7921 /// StartFromPrivateNetwork state in Connectivity tests.
7922 Advertised,
7923 /// If set, the enum was initialized with an unknown value.
7924 ///
7925 /// Applications can examine the value using [RouteType::value] or
7926 /// [RouteType::name].
7927 UnknownValue(route_type::UnknownValue),
7928 }
7929
7930 #[doc(hidden)]
7931 pub mod route_type {
7932 #[allow(unused_imports)]
7933 use super::*;
7934 #[derive(Clone, Debug, PartialEq)]
7935 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7936 }
7937
7938 impl RouteType {
7939 /// Gets the enum value.
7940 ///
7941 /// Returns `None` if the enum contains an unknown value deserialized from
7942 /// the string representation of enums.
7943 pub fn value(&self) -> std::option::Option<i32> {
7944 match self {
7945 Self::Unspecified => std::option::Option::Some(0),
7946 Self::Subnet => std::option::Option::Some(1),
7947 Self::Static => std::option::Option::Some(2),
7948 Self::Dynamic => std::option::Option::Some(3),
7949 Self::PeeringSubnet => std::option::Option::Some(4),
7950 Self::PeeringStatic => std::option::Option::Some(5),
7951 Self::PeeringDynamic => std::option::Option::Some(6),
7952 Self::PolicyBased => std::option::Option::Some(7),
7953 Self::Advertised => std::option::Option::Some(101),
7954 Self::UnknownValue(u) => u.0.value(),
7955 }
7956 }
7957
7958 /// Gets the enum value as a string.
7959 ///
7960 /// Returns `None` if the enum contains an unknown value deserialized from
7961 /// the integer representation of enums.
7962 pub fn name(&self) -> std::option::Option<&str> {
7963 match self {
7964 Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
7965 Self::Subnet => std::option::Option::Some("SUBNET"),
7966 Self::Static => std::option::Option::Some("STATIC"),
7967 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
7968 Self::PeeringSubnet => std::option::Option::Some("PEERING_SUBNET"),
7969 Self::PeeringStatic => std::option::Option::Some("PEERING_STATIC"),
7970 Self::PeeringDynamic => std::option::Option::Some("PEERING_DYNAMIC"),
7971 Self::PolicyBased => std::option::Option::Some("POLICY_BASED"),
7972 Self::Advertised => std::option::Option::Some("ADVERTISED"),
7973 Self::UnknownValue(u) => u.0.name(),
7974 }
7975 }
7976 }
7977
7978 impl std::default::Default for RouteType {
7979 fn default() -> Self {
7980 use std::convert::From;
7981 Self::from(0)
7982 }
7983 }
7984
7985 impl std::fmt::Display for RouteType {
7986 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7987 wkt::internal::display_enum(f, self.name(), self.value())
7988 }
7989 }
7990
7991 impl std::convert::From<i32> for RouteType {
7992 fn from(value: i32) -> Self {
7993 match value {
7994 0 => Self::Unspecified,
7995 1 => Self::Subnet,
7996 2 => Self::Static,
7997 3 => Self::Dynamic,
7998 4 => Self::PeeringSubnet,
7999 5 => Self::PeeringStatic,
8000 6 => Self::PeeringDynamic,
8001 7 => Self::PolicyBased,
8002 101 => Self::Advertised,
8003 _ => Self::UnknownValue(route_type::UnknownValue(
8004 wkt::internal::UnknownEnumValue::Integer(value),
8005 )),
8006 }
8007 }
8008 }
8009
8010 impl std::convert::From<&str> for RouteType {
8011 fn from(value: &str) -> Self {
8012 use std::string::ToString;
8013 match value {
8014 "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
8015 "SUBNET" => Self::Subnet,
8016 "STATIC" => Self::Static,
8017 "DYNAMIC" => Self::Dynamic,
8018 "PEERING_SUBNET" => Self::PeeringSubnet,
8019 "PEERING_STATIC" => Self::PeeringStatic,
8020 "PEERING_DYNAMIC" => Self::PeeringDynamic,
8021 "POLICY_BASED" => Self::PolicyBased,
8022 "ADVERTISED" => Self::Advertised,
8023 _ => Self::UnknownValue(route_type::UnknownValue(
8024 wkt::internal::UnknownEnumValue::String(value.to_string()),
8025 )),
8026 }
8027 }
8028 }
8029
8030 impl serde::ser::Serialize for RouteType {
8031 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8032 where
8033 S: serde::Serializer,
8034 {
8035 match self {
8036 Self::Unspecified => serializer.serialize_i32(0),
8037 Self::Subnet => serializer.serialize_i32(1),
8038 Self::Static => serializer.serialize_i32(2),
8039 Self::Dynamic => serializer.serialize_i32(3),
8040 Self::PeeringSubnet => serializer.serialize_i32(4),
8041 Self::PeeringStatic => serializer.serialize_i32(5),
8042 Self::PeeringDynamic => serializer.serialize_i32(6),
8043 Self::PolicyBased => serializer.serialize_i32(7),
8044 Self::Advertised => serializer.serialize_i32(101),
8045 Self::UnknownValue(u) => u.0.serialize(serializer),
8046 }
8047 }
8048 }
8049
8050 impl<'de> serde::de::Deserialize<'de> for RouteType {
8051 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8052 where
8053 D: serde::Deserializer<'de>,
8054 {
8055 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
8056 ".google.cloud.networkmanagement.v1.RouteInfo.RouteType",
8057 ))
8058 }
8059 }
8060
8061 /// Type of next hop:
8062 ///
8063 /// # Working with unknown values
8064 ///
8065 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8066 /// additional enum variants at any time. Adding new variants is not considered
8067 /// a breaking change. Applications should write their code in anticipation of:
8068 ///
8069 /// - New values appearing in future releases of the client library, **and**
8070 /// - New values received dynamically, without application changes.
8071 ///
8072 /// Please consult the [Working with enums] section in the user guide for some
8073 /// guidelines.
8074 ///
8075 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8076 #[derive(Clone, Debug, PartialEq)]
8077 #[non_exhaustive]
8078 pub enum NextHopType {
8079 /// Unspecified type. Default value.
8080 Unspecified,
8081 /// Next hop is an IP address.
8082 NextHopIp,
8083 /// Next hop is a Compute Engine instance.
8084 NextHopInstance,
8085 /// Next hop is a VPC network gateway.
8086 NextHopNetwork,
8087 /// Next hop is a peering VPC. This scenario only happens when the user
8088 /// doesn't have permissions to the project where the next hop resource is
8089 /// located.
8090 NextHopPeering,
8091 /// Next hop is an interconnect.
8092 NextHopInterconnect,
8093 /// Next hop is a VPN tunnel.
8094 NextHopVpnTunnel,
8095 /// Next hop is a VPN gateway. This scenario only happens when tracing
8096 /// connectivity from an on-premises network to Google Cloud through a VPN.
8097 /// The analysis simulates a packet departing from the on-premises network
8098 /// through a VPN tunnel and arriving at a Cloud VPN gateway.
8099 NextHopVpnGateway,
8100 /// Next hop is an internet gateway.
8101 NextHopInternetGateway,
8102 /// Next hop is blackhole; that is, the next hop either does not exist or is
8103 /// unusable.
8104 NextHopBlackhole,
8105 /// Next hop is the forwarding rule of an Internal Load Balancer.
8106 NextHopIlb,
8107 /// Next hop is a
8108 /// [router appliance
8109 /// instance](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/ra-overview).
8110 NextHopRouterAppliance,
8111 /// Next hop is an NCC hub. This scenario only happens when the user doesn't
8112 /// have permissions to the project where the next hop resource is located.
8113 NextHopNccHub,
8114 /// Next hop is Secure Web Proxy Gateway.
8115 SecureWebProxyGateway,
8116 /// If set, the enum was initialized with an unknown value.
8117 ///
8118 /// Applications can examine the value using [NextHopType::value] or
8119 /// [NextHopType::name].
8120 UnknownValue(next_hop_type::UnknownValue),
8121 }
8122
8123 #[doc(hidden)]
8124 pub mod next_hop_type {
8125 #[allow(unused_imports)]
8126 use super::*;
8127 #[derive(Clone, Debug, PartialEq)]
8128 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8129 }
8130
8131 impl NextHopType {
8132 /// Gets the enum value.
8133 ///
8134 /// Returns `None` if the enum contains an unknown value deserialized from
8135 /// the string representation of enums.
8136 pub fn value(&self) -> std::option::Option<i32> {
8137 match self {
8138 Self::Unspecified => std::option::Option::Some(0),
8139 Self::NextHopIp => std::option::Option::Some(1),
8140 Self::NextHopInstance => std::option::Option::Some(2),
8141 Self::NextHopNetwork => std::option::Option::Some(3),
8142 Self::NextHopPeering => std::option::Option::Some(4),
8143 Self::NextHopInterconnect => std::option::Option::Some(5),
8144 Self::NextHopVpnTunnel => std::option::Option::Some(6),
8145 Self::NextHopVpnGateway => std::option::Option::Some(7),
8146 Self::NextHopInternetGateway => std::option::Option::Some(8),
8147 Self::NextHopBlackhole => std::option::Option::Some(9),
8148 Self::NextHopIlb => std::option::Option::Some(10),
8149 Self::NextHopRouterAppliance => std::option::Option::Some(11),
8150 Self::NextHopNccHub => std::option::Option::Some(12),
8151 Self::SecureWebProxyGateway => std::option::Option::Some(13),
8152 Self::UnknownValue(u) => u.0.value(),
8153 }
8154 }
8155
8156 /// Gets the enum value as a string.
8157 ///
8158 /// Returns `None` if the enum contains an unknown value deserialized from
8159 /// the integer representation of enums.
8160 pub fn name(&self) -> std::option::Option<&str> {
8161 match self {
8162 Self::Unspecified => std::option::Option::Some("NEXT_HOP_TYPE_UNSPECIFIED"),
8163 Self::NextHopIp => std::option::Option::Some("NEXT_HOP_IP"),
8164 Self::NextHopInstance => std::option::Option::Some("NEXT_HOP_INSTANCE"),
8165 Self::NextHopNetwork => std::option::Option::Some("NEXT_HOP_NETWORK"),
8166 Self::NextHopPeering => std::option::Option::Some("NEXT_HOP_PEERING"),
8167 Self::NextHopInterconnect => std::option::Option::Some("NEXT_HOP_INTERCONNECT"),
8168 Self::NextHopVpnTunnel => std::option::Option::Some("NEXT_HOP_VPN_TUNNEL"),
8169 Self::NextHopVpnGateway => std::option::Option::Some("NEXT_HOP_VPN_GATEWAY"),
8170 Self::NextHopInternetGateway => {
8171 std::option::Option::Some("NEXT_HOP_INTERNET_GATEWAY")
8172 }
8173 Self::NextHopBlackhole => std::option::Option::Some("NEXT_HOP_BLACKHOLE"),
8174 Self::NextHopIlb => std::option::Option::Some("NEXT_HOP_ILB"),
8175 Self::NextHopRouterAppliance => {
8176 std::option::Option::Some("NEXT_HOP_ROUTER_APPLIANCE")
8177 }
8178 Self::NextHopNccHub => std::option::Option::Some("NEXT_HOP_NCC_HUB"),
8179 Self::SecureWebProxyGateway => {
8180 std::option::Option::Some("SECURE_WEB_PROXY_GATEWAY")
8181 }
8182 Self::UnknownValue(u) => u.0.name(),
8183 }
8184 }
8185 }
8186
8187 impl std::default::Default for NextHopType {
8188 fn default() -> Self {
8189 use std::convert::From;
8190 Self::from(0)
8191 }
8192 }
8193
8194 impl std::fmt::Display for NextHopType {
8195 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8196 wkt::internal::display_enum(f, self.name(), self.value())
8197 }
8198 }
8199
8200 impl std::convert::From<i32> for NextHopType {
8201 fn from(value: i32) -> Self {
8202 match value {
8203 0 => Self::Unspecified,
8204 1 => Self::NextHopIp,
8205 2 => Self::NextHopInstance,
8206 3 => Self::NextHopNetwork,
8207 4 => Self::NextHopPeering,
8208 5 => Self::NextHopInterconnect,
8209 6 => Self::NextHopVpnTunnel,
8210 7 => Self::NextHopVpnGateway,
8211 8 => Self::NextHopInternetGateway,
8212 9 => Self::NextHopBlackhole,
8213 10 => Self::NextHopIlb,
8214 11 => Self::NextHopRouterAppliance,
8215 12 => Self::NextHopNccHub,
8216 13 => Self::SecureWebProxyGateway,
8217 _ => Self::UnknownValue(next_hop_type::UnknownValue(
8218 wkt::internal::UnknownEnumValue::Integer(value),
8219 )),
8220 }
8221 }
8222 }
8223
8224 impl std::convert::From<&str> for NextHopType {
8225 fn from(value: &str) -> Self {
8226 use std::string::ToString;
8227 match value {
8228 "NEXT_HOP_TYPE_UNSPECIFIED" => Self::Unspecified,
8229 "NEXT_HOP_IP" => Self::NextHopIp,
8230 "NEXT_HOP_INSTANCE" => Self::NextHopInstance,
8231 "NEXT_HOP_NETWORK" => Self::NextHopNetwork,
8232 "NEXT_HOP_PEERING" => Self::NextHopPeering,
8233 "NEXT_HOP_INTERCONNECT" => Self::NextHopInterconnect,
8234 "NEXT_HOP_VPN_TUNNEL" => Self::NextHopVpnTunnel,
8235 "NEXT_HOP_VPN_GATEWAY" => Self::NextHopVpnGateway,
8236 "NEXT_HOP_INTERNET_GATEWAY" => Self::NextHopInternetGateway,
8237 "NEXT_HOP_BLACKHOLE" => Self::NextHopBlackhole,
8238 "NEXT_HOP_ILB" => Self::NextHopIlb,
8239 "NEXT_HOP_ROUTER_APPLIANCE" => Self::NextHopRouterAppliance,
8240 "NEXT_HOP_NCC_HUB" => Self::NextHopNccHub,
8241 "SECURE_WEB_PROXY_GATEWAY" => Self::SecureWebProxyGateway,
8242 _ => Self::UnknownValue(next_hop_type::UnknownValue(
8243 wkt::internal::UnknownEnumValue::String(value.to_string()),
8244 )),
8245 }
8246 }
8247 }
8248
8249 impl serde::ser::Serialize for NextHopType {
8250 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8251 where
8252 S: serde::Serializer,
8253 {
8254 match self {
8255 Self::Unspecified => serializer.serialize_i32(0),
8256 Self::NextHopIp => serializer.serialize_i32(1),
8257 Self::NextHopInstance => serializer.serialize_i32(2),
8258 Self::NextHopNetwork => serializer.serialize_i32(3),
8259 Self::NextHopPeering => serializer.serialize_i32(4),
8260 Self::NextHopInterconnect => serializer.serialize_i32(5),
8261 Self::NextHopVpnTunnel => serializer.serialize_i32(6),
8262 Self::NextHopVpnGateway => serializer.serialize_i32(7),
8263 Self::NextHopInternetGateway => serializer.serialize_i32(8),
8264 Self::NextHopBlackhole => serializer.serialize_i32(9),
8265 Self::NextHopIlb => serializer.serialize_i32(10),
8266 Self::NextHopRouterAppliance => serializer.serialize_i32(11),
8267 Self::NextHopNccHub => serializer.serialize_i32(12),
8268 Self::SecureWebProxyGateway => serializer.serialize_i32(13),
8269 Self::UnknownValue(u) => u.0.serialize(serializer),
8270 }
8271 }
8272 }
8273
8274 impl<'de> serde::de::Deserialize<'de> for NextHopType {
8275 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8276 where
8277 D: serde::Deserializer<'de>,
8278 {
8279 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NextHopType>::new(
8280 ".google.cloud.networkmanagement.v1.RouteInfo.NextHopType",
8281 ))
8282 }
8283 }
8284
8285 /// Indicates where routes are applicable.
8286 ///
8287 /// # Working with unknown values
8288 ///
8289 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8290 /// additional enum variants at any time. Adding new variants is not considered
8291 /// a breaking change. Applications should write their code in anticipation of:
8292 ///
8293 /// - New values appearing in future releases of the client library, **and**
8294 /// - New values received dynamically, without application changes.
8295 ///
8296 /// Please consult the [Working with enums] section in the user guide for some
8297 /// guidelines.
8298 ///
8299 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8300 #[derive(Clone, Debug, PartialEq)]
8301 #[non_exhaustive]
8302 pub enum RouteScope {
8303 /// Unspecified scope. Default value.
8304 Unspecified,
8305 /// Route is applicable to packets in Network.
8306 Network,
8307 /// Route is applicable to packets using NCC Hub's routing table.
8308 NccHub,
8309 /// If set, the enum was initialized with an unknown value.
8310 ///
8311 /// Applications can examine the value using [RouteScope::value] or
8312 /// [RouteScope::name].
8313 UnknownValue(route_scope::UnknownValue),
8314 }
8315
8316 #[doc(hidden)]
8317 pub mod route_scope {
8318 #[allow(unused_imports)]
8319 use super::*;
8320 #[derive(Clone, Debug, PartialEq)]
8321 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8322 }
8323
8324 impl RouteScope {
8325 /// Gets the enum value.
8326 ///
8327 /// Returns `None` if the enum contains an unknown value deserialized from
8328 /// the string representation of enums.
8329 pub fn value(&self) -> std::option::Option<i32> {
8330 match self {
8331 Self::Unspecified => std::option::Option::Some(0),
8332 Self::Network => std::option::Option::Some(1),
8333 Self::NccHub => std::option::Option::Some(2),
8334 Self::UnknownValue(u) => u.0.value(),
8335 }
8336 }
8337
8338 /// Gets the enum value as a string.
8339 ///
8340 /// Returns `None` if the enum contains an unknown value deserialized from
8341 /// the integer representation of enums.
8342 pub fn name(&self) -> std::option::Option<&str> {
8343 match self {
8344 Self::Unspecified => std::option::Option::Some("ROUTE_SCOPE_UNSPECIFIED"),
8345 Self::Network => std::option::Option::Some("NETWORK"),
8346 Self::NccHub => std::option::Option::Some("NCC_HUB"),
8347 Self::UnknownValue(u) => u.0.name(),
8348 }
8349 }
8350 }
8351
8352 impl std::default::Default for RouteScope {
8353 fn default() -> Self {
8354 use std::convert::From;
8355 Self::from(0)
8356 }
8357 }
8358
8359 impl std::fmt::Display for RouteScope {
8360 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8361 wkt::internal::display_enum(f, self.name(), self.value())
8362 }
8363 }
8364
8365 impl std::convert::From<i32> for RouteScope {
8366 fn from(value: i32) -> Self {
8367 match value {
8368 0 => Self::Unspecified,
8369 1 => Self::Network,
8370 2 => Self::NccHub,
8371 _ => Self::UnknownValue(route_scope::UnknownValue(
8372 wkt::internal::UnknownEnumValue::Integer(value),
8373 )),
8374 }
8375 }
8376 }
8377
8378 impl std::convert::From<&str> for RouteScope {
8379 fn from(value: &str) -> Self {
8380 use std::string::ToString;
8381 match value {
8382 "ROUTE_SCOPE_UNSPECIFIED" => Self::Unspecified,
8383 "NETWORK" => Self::Network,
8384 "NCC_HUB" => Self::NccHub,
8385 _ => Self::UnknownValue(route_scope::UnknownValue(
8386 wkt::internal::UnknownEnumValue::String(value.to_string()),
8387 )),
8388 }
8389 }
8390 }
8391
8392 impl serde::ser::Serialize for RouteScope {
8393 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8394 where
8395 S: serde::Serializer,
8396 {
8397 match self {
8398 Self::Unspecified => serializer.serialize_i32(0),
8399 Self::Network => serializer.serialize_i32(1),
8400 Self::NccHub => serializer.serialize_i32(2),
8401 Self::UnknownValue(u) => u.0.serialize(serializer),
8402 }
8403 }
8404 }
8405
8406 impl<'de> serde::de::Deserialize<'de> for RouteScope {
8407 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8408 where
8409 D: serde::Deserializer<'de>,
8410 {
8411 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteScope>::new(
8412 ".google.cloud.networkmanagement.v1.RouteInfo.RouteScope",
8413 ))
8414 }
8415 }
8416}
8417
8418/// For display only. Details of a Google Service sending packets to a
8419/// VPC network. Although the source IP might be a publicly routable address,
8420/// some Google Services use special routes within Google production
8421/// infrastructure to reach Compute Engine Instances.
8422/// <https://cloud.google.com/vpc/docs/routes#special_return_paths>
8423#[derive(Clone, Default, PartialEq)]
8424#[non_exhaustive]
8425pub struct GoogleServiceInfo {
8426 /// Source IP address.
8427 pub source_ip: std::string::String,
8428
8429 /// Recognized type of a Google Service.
8430 pub google_service_type: crate::model::google_service_info::GoogleServiceType,
8431
8432 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8433}
8434
8435impl GoogleServiceInfo {
8436 pub fn new() -> Self {
8437 std::default::Default::default()
8438 }
8439
8440 /// Sets the value of [source_ip][crate::model::GoogleServiceInfo::source_ip].
8441 ///
8442 /// # Example
8443 /// ```ignore,no_run
8444 /// # use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
8445 /// let x = GoogleServiceInfo::new().set_source_ip("example");
8446 /// ```
8447 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8448 self.source_ip = v.into();
8449 self
8450 }
8451
8452 /// Sets the value of [google_service_type][crate::model::GoogleServiceInfo::google_service_type].
8453 ///
8454 /// # Example
8455 /// ```ignore,no_run
8456 /// # use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
8457 /// use google_cloud_networkmanagement_v1::model::google_service_info::GoogleServiceType;
8458 /// let x0 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::Iap);
8459 /// let x1 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::GfeProxyOrHealthCheckProber);
8460 /// let x2 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::CloudDns);
8461 /// ```
8462 pub fn set_google_service_type<
8463 T: std::convert::Into<crate::model::google_service_info::GoogleServiceType>,
8464 >(
8465 mut self,
8466 v: T,
8467 ) -> Self {
8468 self.google_service_type = v.into();
8469 self
8470 }
8471}
8472
8473impl wkt::message::Message for GoogleServiceInfo {
8474 fn typename() -> &'static str {
8475 "type.googleapis.com/google.cloud.networkmanagement.v1.GoogleServiceInfo"
8476 }
8477}
8478
8479/// Defines additional types related to [GoogleServiceInfo].
8480pub mod google_service_info {
8481 #[allow(unused_imports)]
8482 use super::*;
8483
8484 /// Recognized type of a Google Service.
8485 ///
8486 /// # Working with unknown values
8487 ///
8488 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8489 /// additional enum variants at any time. Adding new variants is not considered
8490 /// a breaking change. Applications should write their code in anticipation of:
8491 ///
8492 /// - New values appearing in future releases of the client library, **and**
8493 /// - New values received dynamically, without application changes.
8494 ///
8495 /// Please consult the [Working with enums] section in the user guide for some
8496 /// guidelines.
8497 ///
8498 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8499 #[derive(Clone, Debug, PartialEq)]
8500 #[non_exhaustive]
8501 pub enum GoogleServiceType {
8502 /// Unspecified Google Service.
8503 Unspecified,
8504 /// Identity aware proxy.
8505 /// <https://cloud.google.com/iap/docs/using-tcp-forwarding>
8506 Iap,
8507 /// One of two services sharing IP ranges:
8508 ///
8509 /// * Load Balancer proxy
8510 /// * Centralized Health Check prober
8511 /// <https://cloud.google.com/load-balancing/docs/firewall-rules>
8512 GfeProxyOrHealthCheckProber,
8513 /// Connectivity from Cloud DNS to forwarding targets or alternate name
8514 /// servers that use private routing.
8515 /// <https://cloud.google.com/dns/docs/zones/forwarding-zones#firewall-rules>
8516 /// <https://cloud.google.com/dns/docs/policies#firewall-rules>
8517 CloudDns,
8518 /// private.googleapis.com and restricted.googleapis.com
8519 GoogleApi,
8520 /// Google API via Private Service Connect.
8521 /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
8522 GoogleApiPsc,
8523 /// Google API via VPC Service Controls.
8524 /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
8525 GoogleApiVpcSc,
8526 /// Google API via Serverless VPC Access.
8527 /// <https://cloud.google.com/vpc/docs/serverless-vpc-access>
8528 ServerlessVpcAccess,
8529 /// If set, the enum was initialized with an unknown value.
8530 ///
8531 /// Applications can examine the value using [GoogleServiceType::value] or
8532 /// [GoogleServiceType::name].
8533 UnknownValue(google_service_type::UnknownValue),
8534 }
8535
8536 #[doc(hidden)]
8537 pub mod google_service_type {
8538 #[allow(unused_imports)]
8539 use super::*;
8540 #[derive(Clone, Debug, PartialEq)]
8541 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8542 }
8543
8544 impl GoogleServiceType {
8545 /// Gets the enum value.
8546 ///
8547 /// Returns `None` if the enum contains an unknown value deserialized from
8548 /// the string representation of enums.
8549 pub fn value(&self) -> std::option::Option<i32> {
8550 match self {
8551 Self::Unspecified => std::option::Option::Some(0),
8552 Self::Iap => std::option::Option::Some(1),
8553 Self::GfeProxyOrHealthCheckProber => std::option::Option::Some(2),
8554 Self::CloudDns => std::option::Option::Some(3),
8555 Self::GoogleApi => std::option::Option::Some(4),
8556 Self::GoogleApiPsc => std::option::Option::Some(5),
8557 Self::GoogleApiVpcSc => std::option::Option::Some(6),
8558 Self::ServerlessVpcAccess => std::option::Option::Some(7),
8559 Self::UnknownValue(u) => u.0.value(),
8560 }
8561 }
8562
8563 /// Gets the enum value as a string.
8564 ///
8565 /// Returns `None` if the enum contains an unknown value deserialized from
8566 /// the integer representation of enums.
8567 pub fn name(&self) -> std::option::Option<&str> {
8568 match self {
8569 Self::Unspecified => std::option::Option::Some("GOOGLE_SERVICE_TYPE_UNSPECIFIED"),
8570 Self::Iap => std::option::Option::Some("IAP"),
8571 Self::GfeProxyOrHealthCheckProber => {
8572 std::option::Option::Some("GFE_PROXY_OR_HEALTH_CHECK_PROBER")
8573 }
8574 Self::CloudDns => std::option::Option::Some("CLOUD_DNS"),
8575 Self::GoogleApi => std::option::Option::Some("GOOGLE_API"),
8576 Self::GoogleApiPsc => std::option::Option::Some("GOOGLE_API_PSC"),
8577 Self::GoogleApiVpcSc => std::option::Option::Some("GOOGLE_API_VPC_SC"),
8578 Self::ServerlessVpcAccess => std::option::Option::Some("SERVERLESS_VPC_ACCESS"),
8579 Self::UnknownValue(u) => u.0.name(),
8580 }
8581 }
8582 }
8583
8584 impl std::default::Default for GoogleServiceType {
8585 fn default() -> Self {
8586 use std::convert::From;
8587 Self::from(0)
8588 }
8589 }
8590
8591 impl std::fmt::Display for GoogleServiceType {
8592 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8593 wkt::internal::display_enum(f, self.name(), self.value())
8594 }
8595 }
8596
8597 impl std::convert::From<i32> for GoogleServiceType {
8598 fn from(value: i32) -> Self {
8599 match value {
8600 0 => Self::Unspecified,
8601 1 => Self::Iap,
8602 2 => Self::GfeProxyOrHealthCheckProber,
8603 3 => Self::CloudDns,
8604 4 => Self::GoogleApi,
8605 5 => Self::GoogleApiPsc,
8606 6 => Self::GoogleApiVpcSc,
8607 7 => Self::ServerlessVpcAccess,
8608 _ => Self::UnknownValue(google_service_type::UnknownValue(
8609 wkt::internal::UnknownEnumValue::Integer(value),
8610 )),
8611 }
8612 }
8613 }
8614
8615 impl std::convert::From<&str> for GoogleServiceType {
8616 fn from(value: &str) -> Self {
8617 use std::string::ToString;
8618 match value {
8619 "GOOGLE_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
8620 "IAP" => Self::Iap,
8621 "GFE_PROXY_OR_HEALTH_CHECK_PROBER" => Self::GfeProxyOrHealthCheckProber,
8622 "CLOUD_DNS" => Self::CloudDns,
8623 "GOOGLE_API" => Self::GoogleApi,
8624 "GOOGLE_API_PSC" => Self::GoogleApiPsc,
8625 "GOOGLE_API_VPC_SC" => Self::GoogleApiVpcSc,
8626 "SERVERLESS_VPC_ACCESS" => Self::ServerlessVpcAccess,
8627 _ => Self::UnknownValue(google_service_type::UnknownValue(
8628 wkt::internal::UnknownEnumValue::String(value.to_string()),
8629 )),
8630 }
8631 }
8632 }
8633
8634 impl serde::ser::Serialize for GoogleServiceType {
8635 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8636 where
8637 S: serde::Serializer,
8638 {
8639 match self {
8640 Self::Unspecified => serializer.serialize_i32(0),
8641 Self::Iap => serializer.serialize_i32(1),
8642 Self::GfeProxyOrHealthCheckProber => serializer.serialize_i32(2),
8643 Self::CloudDns => serializer.serialize_i32(3),
8644 Self::GoogleApi => serializer.serialize_i32(4),
8645 Self::GoogleApiPsc => serializer.serialize_i32(5),
8646 Self::GoogleApiVpcSc => serializer.serialize_i32(6),
8647 Self::ServerlessVpcAccess => serializer.serialize_i32(7),
8648 Self::UnknownValue(u) => u.0.serialize(serializer),
8649 }
8650 }
8651 }
8652
8653 impl<'de> serde::de::Deserialize<'de> for GoogleServiceType {
8654 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8655 where
8656 D: serde::Deserializer<'de>,
8657 {
8658 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GoogleServiceType>::new(
8659 ".google.cloud.networkmanagement.v1.GoogleServiceInfo.GoogleServiceType",
8660 ))
8661 }
8662 }
8663}
8664
8665/// For display only. Metadata associated with a Compute Engine forwarding rule.
8666#[derive(Clone, Default, PartialEq)]
8667#[non_exhaustive]
8668pub struct ForwardingRuleInfo {
8669 /// Name of the forwarding rule.
8670 pub display_name: std::string::String,
8671
8672 /// URI of the forwarding rule.
8673 pub uri: std::string::String,
8674
8675 /// Protocol defined in the forwarding rule that matches the packet.
8676 pub matched_protocol: std::string::String,
8677
8678 /// Port range defined in the forwarding rule that matches the packet.
8679 pub matched_port_range: std::string::String,
8680
8681 /// VIP of the forwarding rule.
8682 pub vip: std::string::String,
8683
8684 /// Target type of the forwarding rule.
8685 pub target: std::string::String,
8686
8687 /// Network URI.
8688 pub network_uri: std::string::String,
8689
8690 /// Region of the forwarding rule. Set only for regional forwarding rules.
8691 pub region: std::string::String,
8692
8693 /// Name of the load balancer the forwarding rule belongs to. Empty for
8694 /// forwarding rules not related to load balancers (like PSC forwarding rules).
8695 pub load_balancer_name: std::string::String,
8696
8697 /// URI of the PSC service attachment this forwarding rule targets (if
8698 /// applicable).
8699 pub psc_service_attachment_uri: std::string::String,
8700
8701 /// PSC Google API target this forwarding rule targets (if applicable).
8702 pub psc_google_api_target: std::string::String,
8703
8704 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8705}
8706
8707impl ForwardingRuleInfo {
8708 pub fn new() -> Self {
8709 std::default::Default::default()
8710 }
8711
8712 /// Sets the value of [display_name][crate::model::ForwardingRuleInfo::display_name].
8713 ///
8714 /// # Example
8715 /// ```ignore,no_run
8716 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8717 /// let x = ForwardingRuleInfo::new().set_display_name("example");
8718 /// ```
8719 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8720 self.display_name = v.into();
8721 self
8722 }
8723
8724 /// Sets the value of [uri][crate::model::ForwardingRuleInfo::uri].
8725 ///
8726 /// # Example
8727 /// ```ignore,no_run
8728 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8729 /// let x = ForwardingRuleInfo::new().set_uri("example");
8730 /// ```
8731 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8732 self.uri = v.into();
8733 self
8734 }
8735
8736 /// Sets the value of [matched_protocol][crate::model::ForwardingRuleInfo::matched_protocol].
8737 ///
8738 /// # Example
8739 /// ```ignore,no_run
8740 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8741 /// let x = ForwardingRuleInfo::new().set_matched_protocol("example");
8742 /// ```
8743 pub fn set_matched_protocol<T: std::convert::Into<std::string::String>>(
8744 mut self,
8745 v: T,
8746 ) -> Self {
8747 self.matched_protocol = v.into();
8748 self
8749 }
8750
8751 /// Sets the value of [matched_port_range][crate::model::ForwardingRuleInfo::matched_port_range].
8752 ///
8753 /// # Example
8754 /// ```ignore,no_run
8755 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8756 /// let x = ForwardingRuleInfo::new().set_matched_port_range("example");
8757 /// ```
8758 pub fn set_matched_port_range<T: std::convert::Into<std::string::String>>(
8759 mut self,
8760 v: T,
8761 ) -> Self {
8762 self.matched_port_range = v.into();
8763 self
8764 }
8765
8766 /// Sets the value of [vip][crate::model::ForwardingRuleInfo::vip].
8767 ///
8768 /// # Example
8769 /// ```ignore,no_run
8770 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8771 /// let x = ForwardingRuleInfo::new().set_vip("example");
8772 /// ```
8773 pub fn set_vip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8774 self.vip = v.into();
8775 self
8776 }
8777
8778 /// Sets the value of [target][crate::model::ForwardingRuleInfo::target].
8779 ///
8780 /// # Example
8781 /// ```ignore,no_run
8782 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8783 /// let x = ForwardingRuleInfo::new().set_target("example");
8784 /// ```
8785 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8786 self.target = v.into();
8787 self
8788 }
8789
8790 /// Sets the value of [network_uri][crate::model::ForwardingRuleInfo::network_uri].
8791 ///
8792 /// # Example
8793 /// ```ignore,no_run
8794 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8795 /// let x = ForwardingRuleInfo::new().set_network_uri("example");
8796 /// ```
8797 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8798 self.network_uri = v.into();
8799 self
8800 }
8801
8802 /// Sets the value of [region][crate::model::ForwardingRuleInfo::region].
8803 ///
8804 /// # Example
8805 /// ```ignore,no_run
8806 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8807 /// let x = ForwardingRuleInfo::new().set_region("example");
8808 /// ```
8809 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8810 self.region = v.into();
8811 self
8812 }
8813
8814 /// Sets the value of [load_balancer_name][crate::model::ForwardingRuleInfo::load_balancer_name].
8815 ///
8816 /// # Example
8817 /// ```ignore,no_run
8818 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8819 /// let x = ForwardingRuleInfo::new().set_load_balancer_name("example");
8820 /// ```
8821 pub fn set_load_balancer_name<T: std::convert::Into<std::string::String>>(
8822 mut self,
8823 v: T,
8824 ) -> Self {
8825 self.load_balancer_name = v.into();
8826 self
8827 }
8828
8829 /// Sets the value of [psc_service_attachment_uri][crate::model::ForwardingRuleInfo::psc_service_attachment_uri].
8830 ///
8831 /// # Example
8832 /// ```ignore,no_run
8833 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8834 /// let x = ForwardingRuleInfo::new().set_psc_service_attachment_uri("example");
8835 /// ```
8836 pub fn set_psc_service_attachment_uri<T: std::convert::Into<std::string::String>>(
8837 mut self,
8838 v: T,
8839 ) -> Self {
8840 self.psc_service_attachment_uri = v.into();
8841 self
8842 }
8843
8844 /// Sets the value of [psc_google_api_target][crate::model::ForwardingRuleInfo::psc_google_api_target].
8845 ///
8846 /// # Example
8847 /// ```ignore,no_run
8848 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8849 /// let x = ForwardingRuleInfo::new().set_psc_google_api_target("example");
8850 /// ```
8851 pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
8852 mut self,
8853 v: T,
8854 ) -> Self {
8855 self.psc_google_api_target = v.into();
8856 self
8857 }
8858}
8859
8860impl wkt::message::Message for ForwardingRuleInfo {
8861 fn typename() -> &'static str {
8862 "type.googleapis.com/google.cloud.networkmanagement.v1.ForwardingRuleInfo"
8863 }
8864}
8865
8866/// For display only. Metadata associated with a load balancer.
8867#[derive(Clone, Default, PartialEq)]
8868#[non_exhaustive]
8869pub struct LoadBalancerInfo {
8870 /// Type of the load balancer.
8871 pub load_balancer_type: crate::model::load_balancer_info::LoadBalancerType,
8872
8873 /// URI of the health check for the load balancer. Deprecated and no longer
8874 /// populated as different load balancer backends might have different health
8875 /// checks.
8876 #[deprecated]
8877 pub health_check_uri: std::string::String,
8878
8879 /// Information for the loadbalancer backends.
8880 pub backends: std::vec::Vec<crate::model::LoadBalancerBackend>,
8881
8882 /// Type of load balancer's backend configuration.
8883 pub backend_type: crate::model::load_balancer_info::BackendType,
8884
8885 /// Backend configuration URI.
8886 pub backend_uri: std::string::String,
8887
8888 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8889}
8890
8891impl LoadBalancerInfo {
8892 pub fn new() -> Self {
8893 std::default::Default::default()
8894 }
8895
8896 /// Sets the value of [load_balancer_type][crate::model::LoadBalancerInfo::load_balancer_type].
8897 ///
8898 /// # Example
8899 /// ```ignore,no_run
8900 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
8901 /// use google_cloud_networkmanagement_v1::model::load_balancer_info::LoadBalancerType;
8902 /// let x0 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::InternalTcpUdp);
8903 /// let x1 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::NetworkTcpUdp);
8904 /// let x2 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::HttpProxy);
8905 /// ```
8906 pub fn set_load_balancer_type<
8907 T: std::convert::Into<crate::model::load_balancer_info::LoadBalancerType>,
8908 >(
8909 mut self,
8910 v: T,
8911 ) -> Self {
8912 self.load_balancer_type = v.into();
8913 self
8914 }
8915
8916 /// Sets the value of [health_check_uri][crate::model::LoadBalancerInfo::health_check_uri].
8917 ///
8918 /// # Example
8919 /// ```ignore,no_run
8920 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
8921 /// let x = LoadBalancerInfo::new().set_health_check_uri("example");
8922 /// ```
8923 #[deprecated]
8924 pub fn set_health_check_uri<T: std::convert::Into<std::string::String>>(
8925 mut self,
8926 v: T,
8927 ) -> Self {
8928 self.health_check_uri = v.into();
8929 self
8930 }
8931
8932 /// Sets the value of [backends][crate::model::LoadBalancerInfo::backends].
8933 ///
8934 /// # Example
8935 /// ```ignore,no_run
8936 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
8937 /// use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
8938 /// let x = LoadBalancerInfo::new()
8939 /// .set_backends([
8940 /// LoadBalancerBackend::default()/* use setters */,
8941 /// LoadBalancerBackend::default()/* use (different) setters */,
8942 /// ]);
8943 /// ```
8944 pub fn set_backends<T, V>(mut self, v: T) -> Self
8945 where
8946 T: std::iter::IntoIterator<Item = V>,
8947 V: std::convert::Into<crate::model::LoadBalancerBackend>,
8948 {
8949 use std::iter::Iterator;
8950 self.backends = v.into_iter().map(|i| i.into()).collect();
8951 self
8952 }
8953
8954 /// Sets the value of [backend_type][crate::model::LoadBalancerInfo::backend_type].
8955 ///
8956 /// # Example
8957 /// ```ignore,no_run
8958 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
8959 /// use google_cloud_networkmanagement_v1::model::load_balancer_info::BackendType;
8960 /// let x0 = LoadBalancerInfo::new().set_backend_type(BackendType::BackendService);
8961 /// let x1 = LoadBalancerInfo::new().set_backend_type(BackendType::TargetPool);
8962 /// let x2 = LoadBalancerInfo::new().set_backend_type(BackendType::TargetInstance);
8963 /// ```
8964 pub fn set_backend_type<
8965 T: std::convert::Into<crate::model::load_balancer_info::BackendType>,
8966 >(
8967 mut self,
8968 v: T,
8969 ) -> Self {
8970 self.backend_type = v.into();
8971 self
8972 }
8973
8974 /// Sets the value of [backend_uri][crate::model::LoadBalancerInfo::backend_uri].
8975 ///
8976 /// # Example
8977 /// ```ignore,no_run
8978 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
8979 /// let x = LoadBalancerInfo::new().set_backend_uri("example");
8980 /// ```
8981 pub fn set_backend_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8982 self.backend_uri = v.into();
8983 self
8984 }
8985}
8986
8987impl wkt::message::Message for LoadBalancerInfo {
8988 fn typename() -> &'static str {
8989 "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerInfo"
8990 }
8991}
8992
8993/// Defines additional types related to [LoadBalancerInfo].
8994pub mod load_balancer_info {
8995 #[allow(unused_imports)]
8996 use super::*;
8997
8998 /// The type definition for a load balancer:
8999 ///
9000 /// # Working with unknown values
9001 ///
9002 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9003 /// additional enum variants at any time. Adding new variants is not considered
9004 /// a breaking change. Applications should write their code in anticipation of:
9005 ///
9006 /// - New values appearing in future releases of the client library, **and**
9007 /// - New values received dynamically, without application changes.
9008 ///
9009 /// Please consult the [Working with enums] section in the user guide for some
9010 /// guidelines.
9011 ///
9012 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9013 #[derive(Clone, Debug, PartialEq)]
9014 #[non_exhaustive]
9015 pub enum LoadBalancerType {
9016 /// Type is unspecified.
9017 Unspecified,
9018 /// Internal TCP/UDP load balancer.
9019 InternalTcpUdp,
9020 /// Network TCP/UDP load balancer.
9021 NetworkTcpUdp,
9022 /// HTTP(S) proxy load balancer.
9023 HttpProxy,
9024 /// TCP proxy load balancer.
9025 TcpProxy,
9026 /// SSL proxy load balancer.
9027 SslProxy,
9028 /// If set, the enum was initialized with an unknown value.
9029 ///
9030 /// Applications can examine the value using [LoadBalancerType::value] or
9031 /// [LoadBalancerType::name].
9032 UnknownValue(load_balancer_type::UnknownValue),
9033 }
9034
9035 #[doc(hidden)]
9036 pub mod load_balancer_type {
9037 #[allow(unused_imports)]
9038 use super::*;
9039 #[derive(Clone, Debug, PartialEq)]
9040 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9041 }
9042
9043 impl LoadBalancerType {
9044 /// Gets the enum value.
9045 ///
9046 /// Returns `None` if the enum contains an unknown value deserialized from
9047 /// the string representation of enums.
9048 pub fn value(&self) -> std::option::Option<i32> {
9049 match self {
9050 Self::Unspecified => std::option::Option::Some(0),
9051 Self::InternalTcpUdp => std::option::Option::Some(1),
9052 Self::NetworkTcpUdp => std::option::Option::Some(2),
9053 Self::HttpProxy => std::option::Option::Some(3),
9054 Self::TcpProxy => std::option::Option::Some(4),
9055 Self::SslProxy => std::option::Option::Some(5),
9056 Self::UnknownValue(u) => u.0.value(),
9057 }
9058 }
9059
9060 /// Gets the enum value as a string.
9061 ///
9062 /// Returns `None` if the enum contains an unknown value deserialized from
9063 /// the integer representation of enums.
9064 pub fn name(&self) -> std::option::Option<&str> {
9065 match self {
9066 Self::Unspecified => std::option::Option::Some("LOAD_BALANCER_TYPE_UNSPECIFIED"),
9067 Self::InternalTcpUdp => std::option::Option::Some("INTERNAL_TCP_UDP"),
9068 Self::NetworkTcpUdp => std::option::Option::Some("NETWORK_TCP_UDP"),
9069 Self::HttpProxy => std::option::Option::Some("HTTP_PROXY"),
9070 Self::TcpProxy => std::option::Option::Some("TCP_PROXY"),
9071 Self::SslProxy => std::option::Option::Some("SSL_PROXY"),
9072 Self::UnknownValue(u) => u.0.name(),
9073 }
9074 }
9075 }
9076
9077 impl std::default::Default for LoadBalancerType {
9078 fn default() -> Self {
9079 use std::convert::From;
9080 Self::from(0)
9081 }
9082 }
9083
9084 impl std::fmt::Display for LoadBalancerType {
9085 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9086 wkt::internal::display_enum(f, self.name(), self.value())
9087 }
9088 }
9089
9090 impl std::convert::From<i32> for LoadBalancerType {
9091 fn from(value: i32) -> Self {
9092 match value {
9093 0 => Self::Unspecified,
9094 1 => Self::InternalTcpUdp,
9095 2 => Self::NetworkTcpUdp,
9096 3 => Self::HttpProxy,
9097 4 => Self::TcpProxy,
9098 5 => Self::SslProxy,
9099 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
9100 wkt::internal::UnknownEnumValue::Integer(value),
9101 )),
9102 }
9103 }
9104 }
9105
9106 impl std::convert::From<&str> for LoadBalancerType {
9107 fn from(value: &str) -> Self {
9108 use std::string::ToString;
9109 match value {
9110 "LOAD_BALANCER_TYPE_UNSPECIFIED" => Self::Unspecified,
9111 "INTERNAL_TCP_UDP" => Self::InternalTcpUdp,
9112 "NETWORK_TCP_UDP" => Self::NetworkTcpUdp,
9113 "HTTP_PROXY" => Self::HttpProxy,
9114 "TCP_PROXY" => Self::TcpProxy,
9115 "SSL_PROXY" => Self::SslProxy,
9116 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
9117 wkt::internal::UnknownEnumValue::String(value.to_string()),
9118 )),
9119 }
9120 }
9121 }
9122
9123 impl serde::ser::Serialize for LoadBalancerType {
9124 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9125 where
9126 S: serde::Serializer,
9127 {
9128 match self {
9129 Self::Unspecified => serializer.serialize_i32(0),
9130 Self::InternalTcpUdp => serializer.serialize_i32(1),
9131 Self::NetworkTcpUdp => serializer.serialize_i32(2),
9132 Self::HttpProxy => serializer.serialize_i32(3),
9133 Self::TcpProxy => serializer.serialize_i32(4),
9134 Self::SslProxy => serializer.serialize_i32(5),
9135 Self::UnknownValue(u) => u.0.serialize(serializer),
9136 }
9137 }
9138 }
9139
9140 impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
9141 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9142 where
9143 D: serde::Deserializer<'de>,
9144 {
9145 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
9146 ".google.cloud.networkmanagement.v1.LoadBalancerInfo.LoadBalancerType",
9147 ))
9148 }
9149 }
9150
9151 /// The type definition for a load balancer backend configuration:
9152 ///
9153 /// # Working with unknown values
9154 ///
9155 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9156 /// additional enum variants at any time. Adding new variants is not considered
9157 /// a breaking change. Applications should write their code in anticipation of:
9158 ///
9159 /// - New values appearing in future releases of the client library, **and**
9160 /// - New values received dynamically, without application changes.
9161 ///
9162 /// Please consult the [Working with enums] section in the user guide for some
9163 /// guidelines.
9164 ///
9165 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9166 #[derive(Clone, Debug, PartialEq)]
9167 #[non_exhaustive]
9168 pub enum BackendType {
9169 /// Type is unspecified.
9170 Unspecified,
9171 /// Backend Service as the load balancer's backend.
9172 BackendService,
9173 /// Target Pool as the load balancer's backend.
9174 TargetPool,
9175 /// Target Instance as the load balancer's backend.
9176 TargetInstance,
9177 /// If set, the enum was initialized with an unknown value.
9178 ///
9179 /// Applications can examine the value using [BackendType::value] or
9180 /// [BackendType::name].
9181 UnknownValue(backend_type::UnknownValue),
9182 }
9183
9184 #[doc(hidden)]
9185 pub mod backend_type {
9186 #[allow(unused_imports)]
9187 use super::*;
9188 #[derive(Clone, Debug, PartialEq)]
9189 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9190 }
9191
9192 impl BackendType {
9193 /// Gets the enum value.
9194 ///
9195 /// Returns `None` if the enum contains an unknown value deserialized from
9196 /// the string representation of enums.
9197 pub fn value(&self) -> std::option::Option<i32> {
9198 match self {
9199 Self::Unspecified => std::option::Option::Some(0),
9200 Self::BackendService => std::option::Option::Some(1),
9201 Self::TargetPool => std::option::Option::Some(2),
9202 Self::TargetInstance => std::option::Option::Some(3),
9203 Self::UnknownValue(u) => u.0.value(),
9204 }
9205 }
9206
9207 /// Gets the enum value as a string.
9208 ///
9209 /// Returns `None` if the enum contains an unknown value deserialized from
9210 /// the integer representation of enums.
9211 pub fn name(&self) -> std::option::Option<&str> {
9212 match self {
9213 Self::Unspecified => std::option::Option::Some("BACKEND_TYPE_UNSPECIFIED"),
9214 Self::BackendService => std::option::Option::Some("BACKEND_SERVICE"),
9215 Self::TargetPool => std::option::Option::Some("TARGET_POOL"),
9216 Self::TargetInstance => std::option::Option::Some("TARGET_INSTANCE"),
9217 Self::UnknownValue(u) => u.0.name(),
9218 }
9219 }
9220 }
9221
9222 impl std::default::Default for BackendType {
9223 fn default() -> Self {
9224 use std::convert::From;
9225 Self::from(0)
9226 }
9227 }
9228
9229 impl std::fmt::Display for BackendType {
9230 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9231 wkt::internal::display_enum(f, self.name(), self.value())
9232 }
9233 }
9234
9235 impl std::convert::From<i32> for BackendType {
9236 fn from(value: i32) -> Self {
9237 match value {
9238 0 => Self::Unspecified,
9239 1 => Self::BackendService,
9240 2 => Self::TargetPool,
9241 3 => Self::TargetInstance,
9242 _ => Self::UnknownValue(backend_type::UnknownValue(
9243 wkt::internal::UnknownEnumValue::Integer(value),
9244 )),
9245 }
9246 }
9247 }
9248
9249 impl std::convert::From<&str> for BackendType {
9250 fn from(value: &str) -> Self {
9251 use std::string::ToString;
9252 match value {
9253 "BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
9254 "BACKEND_SERVICE" => Self::BackendService,
9255 "TARGET_POOL" => Self::TargetPool,
9256 "TARGET_INSTANCE" => Self::TargetInstance,
9257 _ => Self::UnknownValue(backend_type::UnknownValue(
9258 wkt::internal::UnknownEnumValue::String(value.to_string()),
9259 )),
9260 }
9261 }
9262 }
9263
9264 impl serde::ser::Serialize for BackendType {
9265 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9266 where
9267 S: serde::Serializer,
9268 {
9269 match self {
9270 Self::Unspecified => serializer.serialize_i32(0),
9271 Self::BackendService => serializer.serialize_i32(1),
9272 Self::TargetPool => serializer.serialize_i32(2),
9273 Self::TargetInstance => serializer.serialize_i32(3),
9274 Self::UnknownValue(u) => u.0.serialize(serializer),
9275 }
9276 }
9277 }
9278
9279 impl<'de> serde::de::Deserialize<'de> for BackendType {
9280 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9281 where
9282 D: serde::Deserializer<'de>,
9283 {
9284 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackendType>::new(
9285 ".google.cloud.networkmanagement.v1.LoadBalancerInfo.BackendType",
9286 ))
9287 }
9288 }
9289}
9290
9291/// For display only. Metadata associated with a specific load balancer backend.
9292#[derive(Clone, Default, PartialEq)]
9293#[non_exhaustive]
9294pub struct LoadBalancerBackend {
9295 /// Name of a Compute Engine instance or network endpoint.
9296 pub display_name: std::string::String,
9297
9298 /// URI of a Compute Engine instance or network endpoint.
9299 pub uri: std::string::String,
9300
9301 /// State of the health check firewall configuration.
9302 pub health_check_firewall_state: crate::model::load_balancer_backend::HealthCheckFirewallState,
9303
9304 /// A list of firewall rule URIs allowing probes from health check IP ranges.
9305 pub health_check_allowing_firewall_rules: std::vec::Vec<std::string::String>,
9306
9307 /// A list of firewall rule URIs blocking probes from health check IP ranges.
9308 pub health_check_blocking_firewall_rules: std::vec::Vec<std::string::String>,
9309
9310 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9311}
9312
9313impl LoadBalancerBackend {
9314 pub fn new() -> Self {
9315 std::default::Default::default()
9316 }
9317
9318 /// Sets the value of [display_name][crate::model::LoadBalancerBackend::display_name].
9319 ///
9320 /// # Example
9321 /// ```ignore,no_run
9322 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9323 /// let x = LoadBalancerBackend::new().set_display_name("example");
9324 /// ```
9325 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9326 self.display_name = v.into();
9327 self
9328 }
9329
9330 /// Sets the value of [uri][crate::model::LoadBalancerBackend::uri].
9331 ///
9332 /// # Example
9333 /// ```ignore,no_run
9334 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9335 /// let x = LoadBalancerBackend::new().set_uri("example");
9336 /// ```
9337 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9338 self.uri = v.into();
9339 self
9340 }
9341
9342 /// Sets the value of [health_check_firewall_state][crate::model::LoadBalancerBackend::health_check_firewall_state].
9343 ///
9344 /// # Example
9345 /// ```ignore,no_run
9346 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9347 /// use google_cloud_networkmanagement_v1::model::load_balancer_backend::HealthCheckFirewallState;
9348 /// let x0 = LoadBalancerBackend::new().set_health_check_firewall_state(HealthCheckFirewallState::Configured);
9349 /// let x1 = LoadBalancerBackend::new().set_health_check_firewall_state(HealthCheckFirewallState::Misconfigured);
9350 /// ```
9351 pub fn set_health_check_firewall_state<
9352 T: std::convert::Into<crate::model::load_balancer_backend::HealthCheckFirewallState>,
9353 >(
9354 mut self,
9355 v: T,
9356 ) -> Self {
9357 self.health_check_firewall_state = v.into();
9358 self
9359 }
9360
9361 /// Sets the value of [health_check_allowing_firewall_rules][crate::model::LoadBalancerBackend::health_check_allowing_firewall_rules].
9362 ///
9363 /// # Example
9364 /// ```ignore,no_run
9365 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9366 /// let x = LoadBalancerBackend::new().set_health_check_allowing_firewall_rules(["a", "b", "c"]);
9367 /// ```
9368 pub fn set_health_check_allowing_firewall_rules<T, V>(mut self, v: T) -> Self
9369 where
9370 T: std::iter::IntoIterator<Item = V>,
9371 V: std::convert::Into<std::string::String>,
9372 {
9373 use std::iter::Iterator;
9374 self.health_check_allowing_firewall_rules = v.into_iter().map(|i| i.into()).collect();
9375 self
9376 }
9377
9378 /// Sets the value of [health_check_blocking_firewall_rules][crate::model::LoadBalancerBackend::health_check_blocking_firewall_rules].
9379 ///
9380 /// # Example
9381 /// ```ignore,no_run
9382 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9383 /// let x = LoadBalancerBackend::new().set_health_check_blocking_firewall_rules(["a", "b", "c"]);
9384 /// ```
9385 pub fn set_health_check_blocking_firewall_rules<T, V>(mut self, v: T) -> Self
9386 where
9387 T: std::iter::IntoIterator<Item = V>,
9388 V: std::convert::Into<std::string::String>,
9389 {
9390 use std::iter::Iterator;
9391 self.health_check_blocking_firewall_rules = v.into_iter().map(|i| i.into()).collect();
9392 self
9393 }
9394}
9395
9396impl wkt::message::Message for LoadBalancerBackend {
9397 fn typename() -> &'static str {
9398 "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerBackend"
9399 }
9400}
9401
9402/// Defines additional types related to [LoadBalancerBackend].
9403pub mod load_balancer_backend {
9404 #[allow(unused_imports)]
9405 use super::*;
9406
9407 /// State of a health check firewall configuration:
9408 ///
9409 /// # Working with unknown values
9410 ///
9411 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9412 /// additional enum variants at any time. Adding new variants is not considered
9413 /// a breaking change. Applications should write their code in anticipation of:
9414 ///
9415 /// - New values appearing in future releases of the client library, **and**
9416 /// - New values received dynamically, without application changes.
9417 ///
9418 /// Please consult the [Working with enums] section in the user guide for some
9419 /// guidelines.
9420 ///
9421 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9422 #[derive(Clone, Debug, PartialEq)]
9423 #[non_exhaustive]
9424 pub enum HealthCheckFirewallState {
9425 /// State is unspecified. Default state if not populated.
9426 Unspecified,
9427 /// There are configured firewall rules to allow health check probes to the
9428 /// backend.
9429 Configured,
9430 /// There are firewall rules configured to allow partial health check ranges
9431 /// or block all health check ranges.
9432 /// If a health check probe is sent from denied IP ranges,
9433 /// the health check to the backend will fail. Then, the backend will be
9434 /// marked unhealthy and will not receive traffic sent to the load balancer.
9435 Misconfigured,
9436 /// If set, the enum was initialized with an unknown value.
9437 ///
9438 /// Applications can examine the value using [HealthCheckFirewallState::value] or
9439 /// [HealthCheckFirewallState::name].
9440 UnknownValue(health_check_firewall_state::UnknownValue),
9441 }
9442
9443 #[doc(hidden)]
9444 pub mod health_check_firewall_state {
9445 #[allow(unused_imports)]
9446 use super::*;
9447 #[derive(Clone, Debug, PartialEq)]
9448 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9449 }
9450
9451 impl HealthCheckFirewallState {
9452 /// Gets the enum value.
9453 ///
9454 /// Returns `None` if the enum contains an unknown value deserialized from
9455 /// the string representation of enums.
9456 pub fn value(&self) -> std::option::Option<i32> {
9457 match self {
9458 Self::Unspecified => std::option::Option::Some(0),
9459 Self::Configured => std::option::Option::Some(1),
9460 Self::Misconfigured => std::option::Option::Some(2),
9461 Self::UnknownValue(u) => u.0.value(),
9462 }
9463 }
9464
9465 /// Gets the enum value as a string.
9466 ///
9467 /// Returns `None` if the enum contains an unknown value deserialized from
9468 /// the integer representation of enums.
9469 pub fn name(&self) -> std::option::Option<&str> {
9470 match self {
9471 Self::Unspecified => {
9472 std::option::Option::Some("HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED")
9473 }
9474 Self::Configured => std::option::Option::Some("CONFIGURED"),
9475 Self::Misconfigured => std::option::Option::Some("MISCONFIGURED"),
9476 Self::UnknownValue(u) => u.0.name(),
9477 }
9478 }
9479 }
9480
9481 impl std::default::Default for HealthCheckFirewallState {
9482 fn default() -> Self {
9483 use std::convert::From;
9484 Self::from(0)
9485 }
9486 }
9487
9488 impl std::fmt::Display for HealthCheckFirewallState {
9489 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9490 wkt::internal::display_enum(f, self.name(), self.value())
9491 }
9492 }
9493
9494 impl std::convert::From<i32> for HealthCheckFirewallState {
9495 fn from(value: i32) -> Self {
9496 match value {
9497 0 => Self::Unspecified,
9498 1 => Self::Configured,
9499 2 => Self::Misconfigured,
9500 _ => Self::UnknownValue(health_check_firewall_state::UnknownValue(
9501 wkt::internal::UnknownEnumValue::Integer(value),
9502 )),
9503 }
9504 }
9505 }
9506
9507 impl std::convert::From<&str> for HealthCheckFirewallState {
9508 fn from(value: &str) -> Self {
9509 use std::string::ToString;
9510 match value {
9511 "HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED" => Self::Unspecified,
9512 "CONFIGURED" => Self::Configured,
9513 "MISCONFIGURED" => Self::Misconfigured,
9514 _ => Self::UnknownValue(health_check_firewall_state::UnknownValue(
9515 wkt::internal::UnknownEnumValue::String(value.to_string()),
9516 )),
9517 }
9518 }
9519 }
9520
9521 impl serde::ser::Serialize for HealthCheckFirewallState {
9522 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9523 where
9524 S: serde::Serializer,
9525 {
9526 match self {
9527 Self::Unspecified => serializer.serialize_i32(0),
9528 Self::Configured => serializer.serialize_i32(1),
9529 Self::Misconfigured => serializer.serialize_i32(2),
9530 Self::UnknownValue(u) => u.0.serialize(serializer),
9531 }
9532 }
9533 }
9534
9535 impl<'de> serde::de::Deserialize<'de> for HealthCheckFirewallState {
9536 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9537 where
9538 D: serde::Deserializer<'de>,
9539 {
9540 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HealthCheckFirewallState>::new(
9541 ".google.cloud.networkmanagement.v1.LoadBalancerBackend.HealthCheckFirewallState"))
9542 }
9543 }
9544}
9545
9546/// For display only. Metadata associated with a hybrid subnet.
9547#[derive(Clone, Default, PartialEq)]
9548#[non_exhaustive]
9549pub struct HybridSubnetInfo {
9550 /// Name of a hybrid subnet.
9551 pub display_name: std::string::String,
9552
9553 /// URI of a hybrid subnet.
9554 pub uri: std::string::String,
9555
9556 /// Name of a Google Cloud region where the hybrid subnet is configured.
9557 pub region: std::string::String,
9558
9559 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9560}
9561
9562impl HybridSubnetInfo {
9563 pub fn new() -> Self {
9564 std::default::Default::default()
9565 }
9566
9567 /// Sets the value of [display_name][crate::model::HybridSubnetInfo::display_name].
9568 ///
9569 /// # Example
9570 /// ```ignore,no_run
9571 /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
9572 /// let x = HybridSubnetInfo::new().set_display_name("example");
9573 /// ```
9574 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9575 self.display_name = v.into();
9576 self
9577 }
9578
9579 /// Sets the value of [uri][crate::model::HybridSubnetInfo::uri].
9580 ///
9581 /// # Example
9582 /// ```ignore,no_run
9583 /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
9584 /// let x = HybridSubnetInfo::new().set_uri("example");
9585 /// ```
9586 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9587 self.uri = v.into();
9588 self
9589 }
9590
9591 /// Sets the value of [region][crate::model::HybridSubnetInfo::region].
9592 ///
9593 /// # Example
9594 /// ```ignore,no_run
9595 /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
9596 /// let x = HybridSubnetInfo::new().set_region("example");
9597 /// ```
9598 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9599 self.region = v.into();
9600 self
9601 }
9602}
9603
9604impl wkt::message::Message for HybridSubnetInfo {
9605 fn typename() -> &'static str {
9606 "type.googleapis.com/google.cloud.networkmanagement.v1.HybridSubnetInfo"
9607 }
9608}
9609
9610/// For display only. Metadata associated with a Compute Engine VPN gateway.
9611#[derive(Clone, Default, PartialEq)]
9612#[non_exhaustive]
9613pub struct VpnGatewayInfo {
9614 /// Name of a VPN gateway.
9615 pub display_name: std::string::String,
9616
9617 /// URI of a VPN gateway.
9618 pub uri: std::string::String,
9619
9620 /// URI of a Compute Engine network where the VPN gateway is configured.
9621 pub network_uri: std::string::String,
9622
9623 /// IP address of the VPN gateway.
9624 pub ip_address: std::string::String,
9625
9626 /// A VPN tunnel that is associated with this VPN gateway.
9627 /// There may be multiple VPN tunnels configured on a VPN gateway, and only
9628 /// the one relevant to the test is displayed.
9629 pub vpn_tunnel_uri: std::string::String,
9630
9631 /// Name of a Google Cloud region where this VPN gateway is configured.
9632 pub region: std::string::String,
9633
9634 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9635}
9636
9637impl VpnGatewayInfo {
9638 pub fn new() -> Self {
9639 std::default::Default::default()
9640 }
9641
9642 /// Sets the value of [display_name][crate::model::VpnGatewayInfo::display_name].
9643 ///
9644 /// # Example
9645 /// ```ignore,no_run
9646 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
9647 /// let x = VpnGatewayInfo::new().set_display_name("example");
9648 /// ```
9649 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9650 self.display_name = v.into();
9651 self
9652 }
9653
9654 /// Sets the value of [uri][crate::model::VpnGatewayInfo::uri].
9655 ///
9656 /// # Example
9657 /// ```ignore,no_run
9658 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
9659 /// let x = VpnGatewayInfo::new().set_uri("example");
9660 /// ```
9661 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9662 self.uri = v.into();
9663 self
9664 }
9665
9666 /// Sets the value of [network_uri][crate::model::VpnGatewayInfo::network_uri].
9667 ///
9668 /// # Example
9669 /// ```ignore,no_run
9670 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
9671 /// let x = VpnGatewayInfo::new().set_network_uri("example");
9672 /// ```
9673 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9674 self.network_uri = v.into();
9675 self
9676 }
9677
9678 /// Sets the value of [ip_address][crate::model::VpnGatewayInfo::ip_address].
9679 ///
9680 /// # Example
9681 /// ```ignore,no_run
9682 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
9683 /// let x = VpnGatewayInfo::new().set_ip_address("example");
9684 /// ```
9685 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9686 self.ip_address = v.into();
9687 self
9688 }
9689
9690 /// Sets the value of [vpn_tunnel_uri][crate::model::VpnGatewayInfo::vpn_tunnel_uri].
9691 ///
9692 /// # Example
9693 /// ```ignore,no_run
9694 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
9695 /// let x = VpnGatewayInfo::new().set_vpn_tunnel_uri("example");
9696 /// ```
9697 pub fn set_vpn_tunnel_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9698 self.vpn_tunnel_uri = v.into();
9699 self
9700 }
9701
9702 /// Sets the value of [region][crate::model::VpnGatewayInfo::region].
9703 ///
9704 /// # Example
9705 /// ```ignore,no_run
9706 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
9707 /// let x = VpnGatewayInfo::new().set_region("example");
9708 /// ```
9709 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9710 self.region = v.into();
9711 self
9712 }
9713}
9714
9715impl wkt::message::Message for VpnGatewayInfo {
9716 fn typename() -> &'static str {
9717 "type.googleapis.com/google.cloud.networkmanagement.v1.VpnGatewayInfo"
9718 }
9719}
9720
9721/// For display only. Metadata associated with a Compute Engine VPN tunnel.
9722#[derive(Clone, Default, PartialEq)]
9723#[non_exhaustive]
9724pub struct VpnTunnelInfo {
9725 /// Name of a VPN tunnel.
9726 pub display_name: std::string::String,
9727
9728 /// URI of a VPN tunnel.
9729 pub uri: std::string::String,
9730
9731 /// URI of the VPN gateway at local end of the tunnel.
9732 pub source_gateway: std::string::String,
9733
9734 /// URI of a VPN gateway at remote end of the tunnel.
9735 pub remote_gateway: std::string::String,
9736
9737 /// Remote VPN gateway's IP address.
9738 pub remote_gateway_ip: std::string::String,
9739
9740 /// Local VPN gateway's IP address.
9741 pub source_gateway_ip: std::string::String,
9742
9743 /// URI of a Compute Engine network where the VPN tunnel is configured.
9744 pub network_uri: std::string::String,
9745
9746 /// Name of a Google Cloud region where this VPN tunnel is configured.
9747 pub region: std::string::String,
9748
9749 /// Type of the routing policy.
9750 pub routing_type: crate::model::vpn_tunnel_info::RoutingType,
9751
9752 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9753}
9754
9755impl VpnTunnelInfo {
9756 pub fn new() -> Self {
9757 std::default::Default::default()
9758 }
9759
9760 /// Sets the value of [display_name][crate::model::VpnTunnelInfo::display_name].
9761 ///
9762 /// # Example
9763 /// ```ignore,no_run
9764 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9765 /// let x = VpnTunnelInfo::new().set_display_name("example");
9766 /// ```
9767 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9768 self.display_name = v.into();
9769 self
9770 }
9771
9772 /// Sets the value of [uri][crate::model::VpnTunnelInfo::uri].
9773 ///
9774 /// # Example
9775 /// ```ignore,no_run
9776 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9777 /// let x = VpnTunnelInfo::new().set_uri("example");
9778 /// ```
9779 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9780 self.uri = v.into();
9781 self
9782 }
9783
9784 /// Sets the value of [source_gateway][crate::model::VpnTunnelInfo::source_gateway].
9785 ///
9786 /// # Example
9787 /// ```ignore,no_run
9788 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9789 /// let x = VpnTunnelInfo::new().set_source_gateway("example");
9790 /// ```
9791 pub fn set_source_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9792 self.source_gateway = v.into();
9793 self
9794 }
9795
9796 /// Sets the value of [remote_gateway][crate::model::VpnTunnelInfo::remote_gateway].
9797 ///
9798 /// # Example
9799 /// ```ignore,no_run
9800 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9801 /// let x = VpnTunnelInfo::new().set_remote_gateway("example");
9802 /// ```
9803 pub fn set_remote_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9804 self.remote_gateway = v.into();
9805 self
9806 }
9807
9808 /// Sets the value of [remote_gateway_ip][crate::model::VpnTunnelInfo::remote_gateway_ip].
9809 ///
9810 /// # Example
9811 /// ```ignore,no_run
9812 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9813 /// let x = VpnTunnelInfo::new().set_remote_gateway_ip("example");
9814 /// ```
9815 pub fn set_remote_gateway_ip<T: std::convert::Into<std::string::String>>(
9816 mut self,
9817 v: T,
9818 ) -> Self {
9819 self.remote_gateway_ip = v.into();
9820 self
9821 }
9822
9823 /// Sets the value of [source_gateway_ip][crate::model::VpnTunnelInfo::source_gateway_ip].
9824 ///
9825 /// # Example
9826 /// ```ignore,no_run
9827 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9828 /// let x = VpnTunnelInfo::new().set_source_gateway_ip("example");
9829 /// ```
9830 pub fn set_source_gateway_ip<T: std::convert::Into<std::string::String>>(
9831 mut self,
9832 v: T,
9833 ) -> Self {
9834 self.source_gateway_ip = v.into();
9835 self
9836 }
9837
9838 /// Sets the value of [network_uri][crate::model::VpnTunnelInfo::network_uri].
9839 ///
9840 /// # Example
9841 /// ```ignore,no_run
9842 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9843 /// let x = VpnTunnelInfo::new().set_network_uri("example");
9844 /// ```
9845 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9846 self.network_uri = v.into();
9847 self
9848 }
9849
9850 /// Sets the value of [region][crate::model::VpnTunnelInfo::region].
9851 ///
9852 /// # Example
9853 /// ```ignore,no_run
9854 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9855 /// let x = VpnTunnelInfo::new().set_region("example");
9856 /// ```
9857 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9858 self.region = v.into();
9859 self
9860 }
9861
9862 /// Sets the value of [routing_type][crate::model::VpnTunnelInfo::routing_type].
9863 ///
9864 /// # Example
9865 /// ```ignore,no_run
9866 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9867 /// use google_cloud_networkmanagement_v1::model::vpn_tunnel_info::RoutingType;
9868 /// let x0 = VpnTunnelInfo::new().set_routing_type(RoutingType::RouteBased);
9869 /// let x1 = VpnTunnelInfo::new().set_routing_type(RoutingType::PolicyBased);
9870 /// let x2 = VpnTunnelInfo::new().set_routing_type(RoutingType::Dynamic);
9871 /// ```
9872 pub fn set_routing_type<T: std::convert::Into<crate::model::vpn_tunnel_info::RoutingType>>(
9873 mut self,
9874 v: T,
9875 ) -> Self {
9876 self.routing_type = v.into();
9877 self
9878 }
9879}
9880
9881impl wkt::message::Message for VpnTunnelInfo {
9882 fn typename() -> &'static str {
9883 "type.googleapis.com/google.cloud.networkmanagement.v1.VpnTunnelInfo"
9884 }
9885}
9886
9887/// Defines additional types related to [VpnTunnelInfo].
9888pub mod vpn_tunnel_info {
9889 #[allow(unused_imports)]
9890 use super::*;
9891
9892 /// Types of VPN routing policy. For details, refer to [Networks and Tunnel
9893 /// routing](https://cloud.google.com/network-connectivity/docs/vpn/concepts/choosing-networks-routing/).
9894 ///
9895 /// # Working with unknown values
9896 ///
9897 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9898 /// additional enum variants at any time. Adding new variants is not considered
9899 /// a breaking change. Applications should write their code in anticipation of:
9900 ///
9901 /// - New values appearing in future releases of the client library, **and**
9902 /// - New values received dynamically, without application changes.
9903 ///
9904 /// Please consult the [Working with enums] section in the user guide for some
9905 /// guidelines.
9906 ///
9907 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9908 #[derive(Clone, Debug, PartialEq)]
9909 #[non_exhaustive]
9910 pub enum RoutingType {
9911 /// Unspecified type. Default value.
9912 Unspecified,
9913 /// Route based VPN.
9914 RouteBased,
9915 /// Policy based routing.
9916 PolicyBased,
9917 /// Dynamic (BGP) routing.
9918 Dynamic,
9919 /// If set, the enum was initialized with an unknown value.
9920 ///
9921 /// Applications can examine the value using [RoutingType::value] or
9922 /// [RoutingType::name].
9923 UnknownValue(routing_type::UnknownValue),
9924 }
9925
9926 #[doc(hidden)]
9927 pub mod routing_type {
9928 #[allow(unused_imports)]
9929 use super::*;
9930 #[derive(Clone, Debug, PartialEq)]
9931 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9932 }
9933
9934 impl RoutingType {
9935 /// Gets the enum value.
9936 ///
9937 /// Returns `None` if the enum contains an unknown value deserialized from
9938 /// the string representation of enums.
9939 pub fn value(&self) -> std::option::Option<i32> {
9940 match self {
9941 Self::Unspecified => std::option::Option::Some(0),
9942 Self::RouteBased => std::option::Option::Some(1),
9943 Self::PolicyBased => std::option::Option::Some(2),
9944 Self::Dynamic => std::option::Option::Some(3),
9945 Self::UnknownValue(u) => u.0.value(),
9946 }
9947 }
9948
9949 /// Gets the enum value as a string.
9950 ///
9951 /// Returns `None` if the enum contains an unknown value deserialized from
9952 /// the integer representation of enums.
9953 pub fn name(&self) -> std::option::Option<&str> {
9954 match self {
9955 Self::Unspecified => std::option::Option::Some("ROUTING_TYPE_UNSPECIFIED"),
9956 Self::RouteBased => std::option::Option::Some("ROUTE_BASED"),
9957 Self::PolicyBased => std::option::Option::Some("POLICY_BASED"),
9958 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
9959 Self::UnknownValue(u) => u.0.name(),
9960 }
9961 }
9962 }
9963
9964 impl std::default::Default for RoutingType {
9965 fn default() -> Self {
9966 use std::convert::From;
9967 Self::from(0)
9968 }
9969 }
9970
9971 impl std::fmt::Display for RoutingType {
9972 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9973 wkt::internal::display_enum(f, self.name(), self.value())
9974 }
9975 }
9976
9977 impl std::convert::From<i32> for RoutingType {
9978 fn from(value: i32) -> Self {
9979 match value {
9980 0 => Self::Unspecified,
9981 1 => Self::RouteBased,
9982 2 => Self::PolicyBased,
9983 3 => Self::Dynamic,
9984 _ => Self::UnknownValue(routing_type::UnknownValue(
9985 wkt::internal::UnknownEnumValue::Integer(value),
9986 )),
9987 }
9988 }
9989 }
9990
9991 impl std::convert::From<&str> for RoutingType {
9992 fn from(value: &str) -> Self {
9993 use std::string::ToString;
9994 match value {
9995 "ROUTING_TYPE_UNSPECIFIED" => Self::Unspecified,
9996 "ROUTE_BASED" => Self::RouteBased,
9997 "POLICY_BASED" => Self::PolicyBased,
9998 "DYNAMIC" => Self::Dynamic,
9999 _ => Self::UnknownValue(routing_type::UnknownValue(
10000 wkt::internal::UnknownEnumValue::String(value.to_string()),
10001 )),
10002 }
10003 }
10004 }
10005
10006 impl serde::ser::Serialize for RoutingType {
10007 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10008 where
10009 S: serde::Serializer,
10010 {
10011 match self {
10012 Self::Unspecified => serializer.serialize_i32(0),
10013 Self::RouteBased => serializer.serialize_i32(1),
10014 Self::PolicyBased => serializer.serialize_i32(2),
10015 Self::Dynamic => serializer.serialize_i32(3),
10016 Self::UnknownValue(u) => u.0.serialize(serializer),
10017 }
10018 }
10019 }
10020
10021 impl<'de> serde::de::Deserialize<'de> for RoutingType {
10022 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10023 where
10024 D: serde::Deserializer<'de>,
10025 {
10026 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutingType>::new(
10027 ".google.cloud.networkmanagement.v1.VpnTunnelInfo.RoutingType",
10028 ))
10029 }
10030 }
10031}
10032
10033/// For display only. Metadata associated with an Interconnect attachment.
10034#[derive(Clone, Default, PartialEq)]
10035#[non_exhaustive]
10036pub struct InterconnectAttachmentInfo {
10037 /// Name of an Interconnect attachment.
10038 pub display_name: std::string::String,
10039
10040 /// URI of an Interconnect attachment.
10041 pub uri: std::string::String,
10042
10043 /// URI of the Interconnect where the Interconnect attachment is
10044 /// configured.
10045 pub interconnect_uri: std::string::String,
10046
10047 /// Name of a Google Cloud region where the Interconnect attachment is
10048 /// configured.
10049 pub region: std::string::String,
10050
10051 /// URI of the Cloud Router to be used for dynamic routing.
10052 pub cloud_router_uri: std::string::String,
10053
10054 /// The type of interconnect attachment this is.
10055 pub r#type: crate::model::interconnect_attachment_info::Type,
10056
10057 /// Appliance IP address that was matched for L2_DEDICATED attachments.
10058 pub l2_attachment_matched_ip_address: std::string::String,
10059
10060 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10061}
10062
10063impl InterconnectAttachmentInfo {
10064 pub fn new() -> Self {
10065 std::default::Default::default()
10066 }
10067
10068 /// Sets the value of [display_name][crate::model::InterconnectAttachmentInfo::display_name].
10069 ///
10070 /// # Example
10071 /// ```ignore,no_run
10072 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10073 /// let x = InterconnectAttachmentInfo::new().set_display_name("example");
10074 /// ```
10075 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10076 self.display_name = v.into();
10077 self
10078 }
10079
10080 /// Sets the value of [uri][crate::model::InterconnectAttachmentInfo::uri].
10081 ///
10082 /// # Example
10083 /// ```ignore,no_run
10084 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10085 /// let x = InterconnectAttachmentInfo::new().set_uri("example");
10086 /// ```
10087 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10088 self.uri = v.into();
10089 self
10090 }
10091
10092 /// Sets the value of [interconnect_uri][crate::model::InterconnectAttachmentInfo::interconnect_uri].
10093 ///
10094 /// # Example
10095 /// ```ignore,no_run
10096 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10097 /// let x = InterconnectAttachmentInfo::new().set_interconnect_uri("example");
10098 /// ```
10099 pub fn set_interconnect_uri<T: std::convert::Into<std::string::String>>(
10100 mut self,
10101 v: T,
10102 ) -> Self {
10103 self.interconnect_uri = v.into();
10104 self
10105 }
10106
10107 /// Sets the value of [region][crate::model::InterconnectAttachmentInfo::region].
10108 ///
10109 /// # Example
10110 /// ```ignore,no_run
10111 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10112 /// let x = InterconnectAttachmentInfo::new().set_region("example");
10113 /// ```
10114 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10115 self.region = v.into();
10116 self
10117 }
10118
10119 /// Sets the value of [cloud_router_uri][crate::model::InterconnectAttachmentInfo::cloud_router_uri].
10120 ///
10121 /// # Example
10122 /// ```ignore,no_run
10123 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10124 /// let x = InterconnectAttachmentInfo::new().set_cloud_router_uri("example");
10125 /// ```
10126 pub fn set_cloud_router_uri<T: std::convert::Into<std::string::String>>(
10127 mut self,
10128 v: T,
10129 ) -> Self {
10130 self.cloud_router_uri = v.into();
10131 self
10132 }
10133
10134 /// Sets the value of [r#type][crate::model::InterconnectAttachmentInfo::type].
10135 ///
10136 /// # Example
10137 /// ```ignore,no_run
10138 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10139 /// use google_cloud_networkmanagement_v1::model::interconnect_attachment_info::Type;
10140 /// let x0 = InterconnectAttachmentInfo::new().set_type(Type::Dedicated);
10141 /// let x1 = InterconnectAttachmentInfo::new().set_type(Type::Partner);
10142 /// let x2 = InterconnectAttachmentInfo::new().set_type(Type::PartnerProvider);
10143 /// ```
10144 pub fn set_type<T: std::convert::Into<crate::model::interconnect_attachment_info::Type>>(
10145 mut self,
10146 v: T,
10147 ) -> Self {
10148 self.r#type = v.into();
10149 self
10150 }
10151
10152 /// Sets the value of [l2_attachment_matched_ip_address][crate::model::InterconnectAttachmentInfo::l2_attachment_matched_ip_address].
10153 ///
10154 /// # Example
10155 /// ```ignore,no_run
10156 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10157 /// let x = InterconnectAttachmentInfo::new().set_l2_attachment_matched_ip_address("example");
10158 /// ```
10159 pub fn set_l2_attachment_matched_ip_address<T: std::convert::Into<std::string::String>>(
10160 mut self,
10161 v: T,
10162 ) -> Self {
10163 self.l2_attachment_matched_ip_address = v.into();
10164 self
10165 }
10166}
10167
10168impl wkt::message::Message for InterconnectAttachmentInfo {
10169 fn typename() -> &'static str {
10170 "type.googleapis.com/google.cloud.networkmanagement.v1.InterconnectAttachmentInfo"
10171 }
10172}
10173
10174/// Defines additional types related to [InterconnectAttachmentInfo].
10175pub mod interconnect_attachment_info {
10176 #[allow(unused_imports)]
10177 use super::*;
10178
10179 /// What type of interconnect attachment this is.
10180 ///
10181 /// # Working with unknown values
10182 ///
10183 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10184 /// additional enum variants at any time. Adding new variants is not considered
10185 /// a breaking change. Applications should write their code in anticipation of:
10186 ///
10187 /// - New values appearing in future releases of the client library, **and**
10188 /// - New values received dynamically, without application changes.
10189 ///
10190 /// Please consult the [Working with enums] section in the user guide for some
10191 /// guidelines.
10192 ///
10193 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10194 #[derive(Clone, Debug, PartialEq)]
10195 #[non_exhaustive]
10196 pub enum Type {
10197 /// Unspecified type.
10198 Unspecified,
10199 /// Attachment to a dedicated interconnect.
10200 Dedicated,
10201 /// Attachment to a partner interconnect, created by the customer.
10202 Partner,
10203 /// Attachment to a partner interconnect, created by the partner.
10204 PartnerProvider,
10205 /// Attachment to a L2 interconnect, created by the customer.
10206 L2Dedicated,
10207 /// If set, the enum was initialized with an unknown value.
10208 ///
10209 /// Applications can examine the value using [Type::value] or
10210 /// [Type::name].
10211 UnknownValue(r#type::UnknownValue),
10212 }
10213
10214 #[doc(hidden)]
10215 pub mod r#type {
10216 #[allow(unused_imports)]
10217 use super::*;
10218 #[derive(Clone, Debug, PartialEq)]
10219 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10220 }
10221
10222 impl Type {
10223 /// Gets the enum value.
10224 ///
10225 /// Returns `None` if the enum contains an unknown value deserialized from
10226 /// the string representation of enums.
10227 pub fn value(&self) -> std::option::Option<i32> {
10228 match self {
10229 Self::Unspecified => std::option::Option::Some(0),
10230 Self::Dedicated => std::option::Option::Some(1),
10231 Self::Partner => std::option::Option::Some(2),
10232 Self::PartnerProvider => std::option::Option::Some(3),
10233 Self::L2Dedicated => std::option::Option::Some(4),
10234 Self::UnknownValue(u) => u.0.value(),
10235 }
10236 }
10237
10238 /// Gets the enum value as a string.
10239 ///
10240 /// Returns `None` if the enum contains an unknown value deserialized from
10241 /// the integer representation of enums.
10242 pub fn name(&self) -> std::option::Option<&str> {
10243 match self {
10244 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
10245 Self::Dedicated => std::option::Option::Some("DEDICATED"),
10246 Self::Partner => std::option::Option::Some("PARTNER"),
10247 Self::PartnerProvider => std::option::Option::Some("PARTNER_PROVIDER"),
10248 Self::L2Dedicated => std::option::Option::Some("L2_DEDICATED"),
10249 Self::UnknownValue(u) => u.0.name(),
10250 }
10251 }
10252 }
10253
10254 impl std::default::Default for Type {
10255 fn default() -> Self {
10256 use std::convert::From;
10257 Self::from(0)
10258 }
10259 }
10260
10261 impl std::fmt::Display for Type {
10262 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10263 wkt::internal::display_enum(f, self.name(), self.value())
10264 }
10265 }
10266
10267 impl std::convert::From<i32> for Type {
10268 fn from(value: i32) -> Self {
10269 match value {
10270 0 => Self::Unspecified,
10271 1 => Self::Dedicated,
10272 2 => Self::Partner,
10273 3 => Self::PartnerProvider,
10274 4 => Self::L2Dedicated,
10275 _ => Self::UnknownValue(r#type::UnknownValue(
10276 wkt::internal::UnknownEnumValue::Integer(value),
10277 )),
10278 }
10279 }
10280 }
10281
10282 impl std::convert::From<&str> for Type {
10283 fn from(value: &str) -> Self {
10284 use std::string::ToString;
10285 match value {
10286 "TYPE_UNSPECIFIED" => Self::Unspecified,
10287 "DEDICATED" => Self::Dedicated,
10288 "PARTNER" => Self::Partner,
10289 "PARTNER_PROVIDER" => Self::PartnerProvider,
10290 "L2_DEDICATED" => Self::L2Dedicated,
10291 _ => Self::UnknownValue(r#type::UnknownValue(
10292 wkt::internal::UnknownEnumValue::String(value.to_string()),
10293 )),
10294 }
10295 }
10296 }
10297
10298 impl serde::ser::Serialize for Type {
10299 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10300 where
10301 S: serde::Serializer,
10302 {
10303 match self {
10304 Self::Unspecified => serializer.serialize_i32(0),
10305 Self::Dedicated => serializer.serialize_i32(1),
10306 Self::Partner => serializer.serialize_i32(2),
10307 Self::PartnerProvider => serializer.serialize_i32(3),
10308 Self::L2Dedicated => serializer.serialize_i32(4),
10309 Self::UnknownValue(u) => u.0.serialize(serializer),
10310 }
10311 }
10312 }
10313
10314 impl<'de> serde::de::Deserialize<'de> for Type {
10315 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10316 where
10317 D: serde::Deserializer<'de>,
10318 {
10319 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
10320 ".google.cloud.networkmanagement.v1.InterconnectAttachmentInfo.Type",
10321 ))
10322 }
10323 }
10324}
10325
10326/// For display only. The specification of the endpoints for the test.
10327/// EndpointInfo is derived from source and destination Endpoint and validated
10328/// by the backend data plane model.
10329#[derive(Clone, Default, PartialEq)]
10330#[non_exhaustive]
10331pub struct EndpointInfo {
10332 /// Source IP address.
10333 pub source_ip: std::string::String,
10334
10335 /// Destination IP address.
10336 pub destination_ip: std::string::String,
10337
10338 /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
10339 pub protocol: std::string::String,
10340
10341 /// Source port. Only valid when protocol is TCP or UDP.
10342 pub source_port: i32,
10343
10344 /// Destination port. Only valid when protocol is TCP or UDP.
10345 pub destination_port: i32,
10346
10347 /// URI of the network where this packet originates from.
10348 pub source_network_uri: std::string::String,
10349
10350 /// URI of the network where this packet is sent to.
10351 pub destination_network_uri: std::string::String,
10352
10353 /// URI of the source telemetry agent this packet originates from.
10354 pub source_agent_uri: std::string::String,
10355
10356 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10357}
10358
10359impl EndpointInfo {
10360 pub fn new() -> Self {
10361 std::default::Default::default()
10362 }
10363
10364 /// Sets the value of [source_ip][crate::model::EndpointInfo::source_ip].
10365 ///
10366 /// # Example
10367 /// ```ignore,no_run
10368 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10369 /// let x = EndpointInfo::new().set_source_ip("example");
10370 /// ```
10371 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10372 self.source_ip = v.into();
10373 self
10374 }
10375
10376 /// Sets the value of [destination_ip][crate::model::EndpointInfo::destination_ip].
10377 ///
10378 /// # Example
10379 /// ```ignore,no_run
10380 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10381 /// let x = EndpointInfo::new().set_destination_ip("example");
10382 /// ```
10383 pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10384 self.destination_ip = v.into();
10385 self
10386 }
10387
10388 /// Sets the value of [protocol][crate::model::EndpointInfo::protocol].
10389 ///
10390 /// # Example
10391 /// ```ignore,no_run
10392 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10393 /// let x = EndpointInfo::new().set_protocol("example");
10394 /// ```
10395 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10396 self.protocol = v.into();
10397 self
10398 }
10399
10400 /// Sets the value of [source_port][crate::model::EndpointInfo::source_port].
10401 ///
10402 /// # Example
10403 /// ```ignore,no_run
10404 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10405 /// let x = EndpointInfo::new().set_source_port(42);
10406 /// ```
10407 pub fn set_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10408 self.source_port = v.into();
10409 self
10410 }
10411
10412 /// Sets the value of [destination_port][crate::model::EndpointInfo::destination_port].
10413 ///
10414 /// # Example
10415 /// ```ignore,no_run
10416 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10417 /// let x = EndpointInfo::new().set_destination_port(42);
10418 /// ```
10419 pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10420 self.destination_port = v.into();
10421 self
10422 }
10423
10424 /// Sets the value of [source_network_uri][crate::model::EndpointInfo::source_network_uri].
10425 ///
10426 /// # Example
10427 /// ```ignore,no_run
10428 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10429 /// let x = EndpointInfo::new().set_source_network_uri("example");
10430 /// ```
10431 pub fn set_source_network_uri<T: std::convert::Into<std::string::String>>(
10432 mut self,
10433 v: T,
10434 ) -> Self {
10435 self.source_network_uri = v.into();
10436 self
10437 }
10438
10439 /// Sets the value of [destination_network_uri][crate::model::EndpointInfo::destination_network_uri].
10440 ///
10441 /// # Example
10442 /// ```ignore,no_run
10443 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10444 /// let x = EndpointInfo::new().set_destination_network_uri("example");
10445 /// ```
10446 pub fn set_destination_network_uri<T: std::convert::Into<std::string::String>>(
10447 mut self,
10448 v: T,
10449 ) -> Self {
10450 self.destination_network_uri = v.into();
10451 self
10452 }
10453
10454 /// Sets the value of [source_agent_uri][crate::model::EndpointInfo::source_agent_uri].
10455 ///
10456 /// # Example
10457 /// ```ignore,no_run
10458 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10459 /// let x = EndpointInfo::new().set_source_agent_uri("example");
10460 /// ```
10461 pub fn set_source_agent_uri<T: std::convert::Into<std::string::String>>(
10462 mut self,
10463 v: T,
10464 ) -> Self {
10465 self.source_agent_uri = v.into();
10466 self
10467 }
10468}
10469
10470impl wkt::message::Message for EndpointInfo {
10471 fn typename() -> &'static str {
10472 "type.googleapis.com/google.cloud.networkmanagement.v1.EndpointInfo"
10473 }
10474}
10475
10476/// Details of the final state "deliver" and associated resource.
10477#[derive(Clone, Default, PartialEq)]
10478#[non_exhaustive]
10479pub struct DeliverInfo {
10480 /// Target type where the packet is delivered to.
10481 pub target: crate::model::deliver_info::Target,
10482
10483 /// URI of the resource that the packet is delivered to.
10484 pub resource_uri: std::string::String,
10485
10486 /// IP address of the target (if applicable).
10487 pub ip_address: std::string::String,
10488
10489 /// Name of the Cloud Storage Bucket the packet is delivered to (if
10490 /// applicable).
10491 pub storage_bucket: std::string::String,
10492
10493 /// PSC Google API target the packet is delivered to (if applicable).
10494 pub psc_google_api_target: std::string::String,
10495
10496 /// Recognized type of a Google Service the packet is delivered to (if
10497 /// applicable).
10498 pub google_service_type: crate::model::deliver_info::GoogleServiceType,
10499
10500 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10501}
10502
10503impl DeliverInfo {
10504 pub fn new() -> Self {
10505 std::default::Default::default()
10506 }
10507
10508 /// Sets the value of [target][crate::model::DeliverInfo::target].
10509 ///
10510 /// # Example
10511 /// ```ignore,no_run
10512 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10513 /// use google_cloud_networkmanagement_v1::model::deliver_info::Target;
10514 /// let x0 = DeliverInfo::new().set_target(Target::Instance);
10515 /// let x1 = DeliverInfo::new().set_target(Target::Internet);
10516 /// let x2 = DeliverInfo::new().set_target(Target::GoogleApi);
10517 /// ```
10518 pub fn set_target<T: std::convert::Into<crate::model::deliver_info::Target>>(
10519 mut self,
10520 v: T,
10521 ) -> Self {
10522 self.target = v.into();
10523 self
10524 }
10525
10526 /// Sets the value of [resource_uri][crate::model::DeliverInfo::resource_uri].
10527 ///
10528 /// # Example
10529 /// ```ignore,no_run
10530 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10531 /// let x = DeliverInfo::new().set_resource_uri("example");
10532 /// ```
10533 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10534 self.resource_uri = v.into();
10535 self
10536 }
10537
10538 /// Sets the value of [ip_address][crate::model::DeliverInfo::ip_address].
10539 ///
10540 /// # Example
10541 /// ```ignore,no_run
10542 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10543 /// let x = DeliverInfo::new().set_ip_address("example");
10544 /// ```
10545 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10546 self.ip_address = v.into();
10547 self
10548 }
10549
10550 /// Sets the value of [storage_bucket][crate::model::DeliverInfo::storage_bucket].
10551 ///
10552 /// # Example
10553 /// ```ignore,no_run
10554 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10555 /// let x = DeliverInfo::new().set_storage_bucket("example");
10556 /// ```
10557 pub fn set_storage_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10558 self.storage_bucket = v.into();
10559 self
10560 }
10561
10562 /// Sets the value of [psc_google_api_target][crate::model::DeliverInfo::psc_google_api_target].
10563 ///
10564 /// # Example
10565 /// ```ignore,no_run
10566 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10567 /// let x = DeliverInfo::new().set_psc_google_api_target("example");
10568 /// ```
10569 pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
10570 mut self,
10571 v: T,
10572 ) -> Self {
10573 self.psc_google_api_target = v.into();
10574 self
10575 }
10576
10577 /// Sets the value of [google_service_type][crate::model::DeliverInfo::google_service_type].
10578 ///
10579 /// # Example
10580 /// ```ignore,no_run
10581 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10582 /// use google_cloud_networkmanagement_v1::model::deliver_info::GoogleServiceType;
10583 /// let x0 = DeliverInfo::new().set_google_service_type(GoogleServiceType::Iap);
10584 /// let x1 = DeliverInfo::new().set_google_service_type(GoogleServiceType::GfeProxyOrHealthCheckProber);
10585 /// let x2 = DeliverInfo::new().set_google_service_type(GoogleServiceType::CloudDns);
10586 /// ```
10587 pub fn set_google_service_type<
10588 T: std::convert::Into<crate::model::deliver_info::GoogleServiceType>,
10589 >(
10590 mut self,
10591 v: T,
10592 ) -> Self {
10593 self.google_service_type = v.into();
10594 self
10595 }
10596}
10597
10598impl wkt::message::Message for DeliverInfo {
10599 fn typename() -> &'static str {
10600 "type.googleapis.com/google.cloud.networkmanagement.v1.DeliverInfo"
10601 }
10602}
10603
10604/// Defines additional types related to [DeliverInfo].
10605pub mod deliver_info {
10606 #[allow(unused_imports)]
10607 use super::*;
10608
10609 /// Deliver target types:
10610 ///
10611 /// # Working with unknown values
10612 ///
10613 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10614 /// additional enum variants at any time. Adding new variants is not considered
10615 /// a breaking change. Applications should write their code in anticipation of:
10616 ///
10617 /// - New values appearing in future releases of the client library, **and**
10618 /// - New values received dynamically, without application changes.
10619 ///
10620 /// Please consult the [Working with enums] section in the user guide for some
10621 /// guidelines.
10622 ///
10623 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10624 #[derive(Clone, Debug, PartialEq)]
10625 #[non_exhaustive]
10626 pub enum Target {
10627 /// Target not specified.
10628 Unspecified,
10629 /// Target is a Compute Engine instance.
10630 Instance,
10631 /// Target is the internet.
10632 Internet,
10633 /// Target is a Google API.
10634 GoogleApi,
10635 /// Target is a Google Kubernetes Engine cluster master.
10636 GkeMaster,
10637 /// Target is a Cloud SQL instance.
10638 CloudSqlInstance,
10639 /// Target is a published service that uses [Private Service
10640 /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
10641 PscPublishedService,
10642 /// Target is Google APIs that use [Private Service
10643 /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-apis).
10644 PscGoogleApi,
10645 /// Target is a VPC-SC that uses [Private Service
10646 /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-apis).
10647 PscVpcSc,
10648 /// Target is a serverless network endpoint group.
10649 ServerlessNeg,
10650 /// Target is a Cloud Storage bucket.
10651 StorageBucket,
10652 /// Target is a private network. Used only for return traces.
10653 PrivateNetwork,
10654 /// Target is a Cloud Function. Used only for return traces.
10655 CloudFunction,
10656 /// Target is a App Engine service version. Used only for return traces.
10657 AppEngineVersion,
10658 /// Target is a Cloud Run revision. Used only for return traces.
10659 CloudRunRevision,
10660 /// Target is a Google-managed service. Used only for return traces.
10661 GoogleManagedService,
10662 /// Target is a Redis Instance.
10663 RedisInstance,
10664 /// Target is a Redis Cluster.
10665 RedisCluster,
10666 /// Target is a GKE Pod.
10667 GkePod,
10668 /// If set, the enum was initialized with an unknown value.
10669 ///
10670 /// Applications can examine the value using [Target::value] or
10671 /// [Target::name].
10672 UnknownValue(target::UnknownValue),
10673 }
10674
10675 #[doc(hidden)]
10676 pub mod target {
10677 #[allow(unused_imports)]
10678 use super::*;
10679 #[derive(Clone, Debug, PartialEq)]
10680 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10681 }
10682
10683 impl Target {
10684 /// Gets the enum value.
10685 ///
10686 /// Returns `None` if the enum contains an unknown value deserialized from
10687 /// the string representation of enums.
10688 pub fn value(&self) -> std::option::Option<i32> {
10689 match self {
10690 Self::Unspecified => std::option::Option::Some(0),
10691 Self::Instance => std::option::Option::Some(1),
10692 Self::Internet => std::option::Option::Some(2),
10693 Self::GoogleApi => std::option::Option::Some(3),
10694 Self::GkeMaster => std::option::Option::Some(4),
10695 Self::CloudSqlInstance => std::option::Option::Some(5),
10696 Self::PscPublishedService => std::option::Option::Some(6),
10697 Self::PscGoogleApi => std::option::Option::Some(7),
10698 Self::PscVpcSc => std::option::Option::Some(8),
10699 Self::ServerlessNeg => std::option::Option::Some(9),
10700 Self::StorageBucket => std::option::Option::Some(10),
10701 Self::PrivateNetwork => std::option::Option::Some(11),
10702 Self::CloudFunction => std::option::Option::Some(12),
10703 Self::AppEngineVersion => std::option::Option::Some(13),
10704 Self::CloudRunRevision => std::option::Option::Some(14),
10705 Self::GoogleManagedService => std::option::Option::Some(15),
10706 Self::RedisInstance => std::option::Option::Some(16),
10707 Self::RedisCluster => std::option::Option::Some(17),
10708 Self::GkePod => std::option::Option::Some(19),
10709 Self::UnknownValue(u) => u.0.value(),
10710 }
10711 }
10712
10713 /// Gets the enum value as a string.
10714 ///
10715 /// Returns `None` if the enum contains an unknown value deserialized from
10716 /// the integer representation of enums.
10717 pub fn name(&self) -> std::option::Option<&str> {
10718 match self {
10719 Self::Unspecified => std::option::Option::Some("TARGET_UNSPECIFIED"),
10720 Self::Instance => std::option::Option::Some("INSTANCE"),
10721 Self::Internet => std::option::Option::Some("INTERNET"),
10722 Self::GoogleApi => std::option::Option::Some("GOOGLE_API"),
10723 Self::GkeMaster => std::option::Option::Some("GKE_MASTER"),
10724 Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
10725 Self::PscPublishedService => std::option::Option::Some("PSC_PUBLISHED_SERVICE"),
10726 Self::PscGoogleApi => std::option::Option::Some("PSC_GOOGLE_API"),
10727 Self::PscVpcSc => std::option::Option::Some("PSC_VPC_SC"),
10728 Self::ServerlessNeg => std::option::Option::Some("SERVERLESS_NEG"),
10729 Self::StorageBucket => std::option::Option::Some("STORAGE_BUCKET"),
10730 Self::PrivateNetwork => std::option::Option::Some("PRIVATE_NETWORK"),
10731 Self::CloudFunction => std::option::Option::Some("CLOUD_FUNCTION"),
10732 Self::AppEngineVersion => std::option::Option::Some("APP_ENGINE_VERSION"),
10733 Self::CloudRunRevision => std::option::Option::Some("CLOUD_RUN_REVISION"),
10734 Self::GoogleManagedService => std::option::Option::Some("GOOGLE_MANAGED_SERVICE"),
10735 Self::RedisInstance => std::option::Option::Some("REDIS_INSTANCE"),
10736 Self::RedisCluster => std::option::Option::Some("REDIS_CLUSTER"),
10737 Self::GkePod => std::option::Option::Some("GKE_POD"),
10738 Self::UnknownValue(u) => u.0.name(),
10739 }
10740 }
10741 }
10742
10743 impl std::default::Default for Target {
10744 fn default() -> Self {
10745 use std::convert::From;
10746 Self::from(0)
10747 }
10748 }
10749
10750 impl std::fmt::Display for Target {
10751 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10752 wkt::internal::display_enum(f, self.name(), self.value())
10753 }
10754 }
10755
10756 impl std::convert::From<i32> for Target {
10757 fn from(value: i32) -> Self {
10758 match value {
10759 0 => Self::Unspecified,
10760 1 => Self::Instance,
10761 2 => Self::Internet,
10762 3 => Self::GoogleApi,
10763 4 => Self::GkeMaster,
10764 5 => Self::CloudSqlInstance,
10765 6 => Self::PscPublishedService,
10766 7 => Self::PscGoogleApi,
10767 8 => Self::PscVpcSc,
10768 9 => Self::ServerlessNeg,
10769 10 => Self::StorageBucket,
10770 11 => Self::PrivateNetwork,
10771 12 => Self::CloudFunction,
10772 13 => Self::AppEngineVersion,
10773 14 => Self::CloudRunRevision,
10774 15 => Self::GoogleManagedService,
10775 16 => Self::RedisInstance,
10776 17 => Self::RedisCluster,
10777 19 => Self::GkePod,
10778 _ => Self::UnknownValue(target::UnknownValue(
10779 wkt::internal::UnknownEnumValue::Integer(value),
10780 )),
10781 }
10782 }
10783 }
10784
10785 impl std::convert::From<&str> for Target {
10786 fn from(value: &str) -> Self {
10787 use std::string::ToString;
10788 match value {
10789 "TARGET_UNSPECIFIED" => Self::Unspecified,
10790 "INSTANCE" => Self::Instance,
10791 "INTERNET" => Self::Internet,
10792 "GOOGLE_API" => Self::GoogleApi,
10793 "GKE_MASTER" => Self::GkeMaster,
10794 "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
10795 "PSC_PUBLISHED_SERVICE" => Self::PscPublishedService,
10796 "PSC_GOOGLE_API" => Self::PscGoogleApi,
10797 "PSC_VPC_SC" => Self::PscVpcSc,
10798 "SERVERLESS_NEG" => Self::ServerlessNeg,
10799 "STORAGE_BUCKET" => Self::StorageBucket,
10800 "PRIVATE_NETWORK" => Self::PrivateNetwork,
10801 "CLOUD_FUNCTION" => Self::CloudFunction,
10802 "APP_ENGINE_VERSION" => Self::AppEngineVersion,
10803 "CLOUD_RUN_REVISION" => Self::CloudRunRevision,
10804 "GOOGLE_MANAGED_SERVICE" => Self::GoogleManagedService,
10805 "REDIS_INSTANCE" => Self::RedisInstance,
10806 "REDIS_CLUSTER" => Self::RedisCluster,
10807 "GKE_POD" => Self::GkePod,
10808 _ => Self::UnknownValue(target::UnknownValue(
10809 wkt::internal::UnknownEnumValue::String(value.to_string()),
10810 )),
10811 }
10812 }
10813 }
10814
10815 impl serde::ser::Serialize for Target {
10816 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10817 where
10818 S: serde::Serializer,
10819 {
10820 match self {
10821 Self::Unspecified => serializer.serialize_i32(0),
10822 Self::Instance => serializer.serialize_i32(1),
10823 Self::Internet => serializer.serialize_i32(2),
10824 Self::GoogleApi => serializer.serialize_i32(3),
10825 Self::GkeMaster => serializer.serialize_i32(4),
10826 Self::CloudSqlInstance => serializer.serialize_i32(5),
10827 Self::PscPublishedService => serializer.serialize_i32(6),
10828 Self::PscGoogleApi => serializer.serialize_i32(7),
10829 Self::PscVpcSc => serializer.serialize_i32(8),
10830 Self::ServerlessNeg => serializer.serialize_i32(9),
10831 Self::StorageBucket => serializer.serialize_i32(10),
10832 Self::PrivateNetwork => serializer.serialize_i32(11),
10833 Self::CloudFunction => serializer.serialize_i32(12),
10834 Self::AppEngineVersion => serializer.serialize_i32(13),
10835 Self::CloudRunRevision => serializer.serialize_i32(14),
10836 Self::GoogleManagedService => serializer.serialize_i32(15),
10837 Self::RedisInstance => serializer.serialize_i32(16),
10838 Self::RedisCluster => serializer.serialize_i32(17),
10839 Self::GkePod => serializer.serialize_i32(19),
10840 Self::UnknownValue(u) => u.0.serialize(serializer),
10841 }
10842 }
10843 }
10844
10845 impl<'de> serde::de::Deserialize<'de> for Target {
10846 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10847 where
10848 D: serde::Deserializer<'de>,
10849 {
10850 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Target>::new(
10851 ".google.cloud.networkmanagement.v1.DeliverInfo.Target",
10852 ))
10853 }
10854 }
10855
10856 /// Recognized type of a Google Service.
10857 ///
10858 /// # Working with unknown values
10859 ///
10860 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10861 /// additional enum variants at any time. Adding new variants is not considered
10862 /// a breaking change. Applications should write their code in anticipation of:
10863 ///
10864 /// - New values appearing in future releases of the client library, **and**
10865 /// - New values received dynamically, without application changes.
10866 ///
10867 /// Please consult the [Working with enums] section in the user guide for some
10868 /// guidelines.
10869 ///
10870 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10871 #[derive(Clone, Debug, PartialEq)]
10872 #[non_exhaustive]
10873 pub enum GoogleServiceType {
10874 /// Unspecified Google Service.
10875 Unspecified,
10876 /// Identity aware proxy.
10877 /// <https://cloud.google.com/iap/docs/using-tcp-forwarding>
10878 Iap,
10879 /// One of two services sharing IP ranges:
10880 ///
10881 /// * Load Balancer proxy
10882 /// * Centralized Health Check prober
10883 /// <https://cloud.google.com/load-balancing/docs/firewall-rules>
10884 GfeProxyOrHealthCheckProber,
10885 /// Connectivity from Cloud DNS to forwarding targets or alternate name
10886 /// servers that use private routing.
10887 /// <https://cloud.google.com/dns/docs/zones/forwarding-zones#firewall-rules>
10888 /// <https://cloud.google.com/dns/docs/policies#firewall-rules>
10889 CloudDns,
10890 /// private.googleapis.com and restricted.googleapis.com
10891 PrivateGoogleAccess,
10892 /// Google API via Private Service Connect.
10893 /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
10894 /// Google API via Serverless VPC Access.
10895 /// <https://cloud.google.com/vpc/docs/serverless-vpc-access>
10896 ServerlessVpcAccess,
10897 /// If set, the enum was initialized with an unknown value.
10898 ///
10899 /// Applications can examine the value using [GoogleServiceType::value] or
10900 /// [GoogleServiceType::name].
10901 UnknownValue(google_service_type::UnknownValue),
10902 }
10903
10904 #[doc(hidden)]
10905 pub mod google_service_type {
10906 #[allow(unused_imports)]
10907 use super::*;
10908 #[derive(Clone, Debug, PartialEq)]
10909 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10910 }
10911
10912 impl GoogleServiceType {
10913 /// Gets the enum value.
10914 ///
10915 /// Returns `None` if the enum contains an unknown value deserialized from
10916 /// the string representation of enums.
10917 pub fn value(&self) -> std::option::Option<i32> {
10918 match self {
10919 Self::Unspecified => std::option::Option::Some(0),
10920 Self::Iap => std::option::Option::Some(1),
10921 Self::GfeProxyOrHealthCheckProber => std::option::Option::Some(2),
10922 Self::CloudDns => std::option::Option::Some(3),
10923 Self::PrivateGoogleAccess => std::option::Option::Some(4),
10924 Self::ServerlessVpcAccess => std::option::Option::Some(5),
10925 Self::UnknownValue(u) => u.0.value(),
10926 }
10927 }
10928
10929 /// Gets the enum value as a string.
10930 ///
10931 /// Returns `None` if the enum contains an unknown value deserialized from
10932 /// the integer representation of enums.
10933 pub fn name(&self) -> std::option::Option<&str> {
10934 match self {
10935 Self::Unspecified => std::option::Option::Some("GOOGLE_SERVICE_TYPE_UNSPECIFIED"),
10936 Self::Iap => std::option::Option::Some("IAP"),
10937 Self::GfeProxyOrHealthCheckProber => {
10938 std::option::Option::Some("GFE_PROXY_OR_HEALTH_CHECK_PROBER")
10939 }
10940 Self::CloudDns => std::option::Option::Some("CLOUD_DNS"),
10941 Self::PrivateGoogleAccess => std::option::Option::Some("PRIVATE_GOOGLE_ACCESS"),
10942 Self::ServerlessVpcAccess => std::option::Option::Some("SERVERLESS_VPC_ACCESS"),
10943 Self::UnknownValue(u) => u.0.name(),
10944 }
10945 }
10946 }
10947
10948 impl std::default::Default for GoogleServiceType {
10949 fn default() -> Self {
10950 use std::convert::From;
10951 Self::from(0)
10952 }
10953 }
10954
10955 impl std::fmt::Display for GoogleServiceType {
10956 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10957 wkt::internal::display_enum(f, self.name(), self.value())
10958 }
10959 }
10960
10961 impl std::convert::From<i32> for GoogleServiceType {
10962 fn from(value: i32) -> Self {
10963 match value {
10964 0 => Self::Unspecified,
10965 1 => Self::Iap,
10966 2 => Self::GfeProxyOrHealthCheckProber,
10967 3 => Self::CloudDns,
10968 4 => Self::PrivateGoogleAccess,
10969 5 => Self::ServerlessVpcAccess,
10970 _ => Self::UnknownValue(google_service_type::UnknownValue(
10971 wkt::internal::UnknownEnumValue::Integer(value),
10972 )),
10973 }
10974 }
10975 }
10976
10977 impl std::convert::From<&str> for GoogleServiceType {
10978 fn from(value: &str) -> Self {
10979 use std::string::ToString;
10980 match value {
10981 "GOOGLE_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
10982 "IAP" => Self::Iap,
10983 "GFE_PROXY_OR_HEALTH_CHECK_PROBER" => Self::GfeProxyOrHealthCheckProber,
10984 "CLOUD_DNS" => Self::CloudDns,
10985 "PRIVATE_GOOGLE_ACCESS" => Self::PrivateGoogleAccess,
10986 "SERVERLESS_VPC_ACCESS" => Self::ServerlessVpcAccess,
10987 _ => Self::UnknownValue(google_service_type::UnknownValue(
10988 wkt::internal::UnknownEnumValue::String(value.to_string()),
10989 )),
10990 }
10991 }
10992 }
10993
10994 impl serde::ser::Serialize for GoogleServiceType {
10995 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10996 where
10997 S: serde::Serializer,
10998 {
10999 match self {
11000 Self::Unspecified => serializer.serialize_i32(0),
11001 Self::Iap => serializer.serialize_i32(1),
11002 Self::GfeProxyOrHealthCheckProber => serializer.serialize_i32(2),
11003 Self::CloudDns => serializer.serialize_i32(3),
11004 Self::PrivateGoogleAccess => serializer.serialize_i32(4),
11005 Self::ServerlessVpcAccess => serializer.serialize_i32(5),
11006 Self::UnknownValue(u) => u.0.serialize(serializer),
11007 }
11008 }
11009 }
11010
11011 impl<'de> serde::de::Deserialize<'de> for GoogleServiceType {
11012 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11013 where
11014 D: serde::Deserializer<'de>,
11015 {
11016 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GoogleServiceType>::new(
11017 ".google.cloud.networkmanagement.v1.DeliverInfo.GoogleServiceType",
11018 ))
11019 }
11020 }
11021}
11022
11023/// Details of the final state "forward" and associated resource.
11024#[derive(Clone, Default, PartialEq)]
11025#[non_exhaustive]
11026pub struct ForwardInfo {
11027 /// Target type where this packet is forwarded to.
11028 pub target: crate::model::forward_info::Target,
11029
11030 /// URI of the resource that the packet is forwarded to.
11031 pub resource_uri: std::string::String,
11032
11033 /// IP address of the target (if applicable).
11034 pub ip_address: std::string::String,
11035
11036 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11037}
11038
11039impl ForwardInfo {
11040 pub fn new() -> Self {
11041 std::default::Default::default()
11042 }
11043
11044 /// Sets the value of [target][crate::model::ForwardInfo::target].
11045 ///
11046 /// # Example
11047 /// ```ignore,no_run
11048 /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
11049 /// use google_cloud_networkmanagement_v1::model::forward_info::Target;
11050 /// let x0 = ForwardInfo::new().set_target(Target::PeeringVpc);
11051 /// let x1 = ForwardInfo::new().set_target(Target::VpnGateway);
11052 /// let x2 = ForwardInfo::new().set_target(Target::Interconnect);
11053 /// ```
11054 pub fn set_target<T: std::convert::Into<crate::model::forward_info::Target>>(
11055 mut self,
11056 v: T,
11057 ) -> Self {
11058 self.target = v.into();
11059 self
11060 }
11061
11062 /// Sets the value of [resource_uri][crate::model::ForwardInfo::resource_uri].
11063 ///
11064 /// # Example
11065 /// ```ignore,no_run
11066 /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
11067 /// let x = ForwardInfo::new().set_resource_uri("example");
11068 /// ```
11069 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11070 self.resource_uri = v.into();
11071 self
11072 }
11073
11074 /// Sets the value of [ip_address][crate::model::ForwardInfo::ip_address].
11075 ///
11076 /// # Example
11077 /// ```ignore,no_run
11078 /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
11079 /// let x = ForwardInfo::new().set_ip_address("example");
11080 /// ```
11081 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11082 self.ip_address = v.into();
11083 self
11084 }
11085}
11086
11087impl wkt::message::Message for ForwardInfo {
11088 fn typename() -> &'static str {
11089 "type.googleapis.com/google.cloud.networkmanagement.v1.ForwardInfo"
11090 }
11091}
11092
11093/// Defines additional types related to [ForwardInfo].
11094pub mod forward_info {
11095 #[allow(unused_imports)]
11096 use super::*;
11097
11098 /// Forward target types.
11099 ///
11100 /// # Working with unknown values
11101 ///
11102 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11103 /// additional enum variants at any time. Adding new variants is not considered
11104 /// a breaking change. Applications should write their code in anticipation of:
11105 ///
11106 /// - New values appearing in future releases of the client library, **and**
11107 /// - New values received dynamically, without application changes.
11108 ///
11109 /// Please consult the [Working with enums] section in the user guide for some
11110 /// guidelines.
11111 ///
11112 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11113 #[derive(Clone, Debug, PartialEq)]
11114 #[non_exhaustive]
11115 pub enum Target {
11116 /// Target not specified.
11117 Unspecified,
11118 /// Forwarded to a VPC peering network.
11119 PeeringVpc,
11120 /// Forwarded to a Cloud VPN gateway.
11121 VpnGateway,
11122 /// Forwarded to a Cloud Interconnect connection.
11123 Interconnect,
11124 /// Forwarded to a Google Kubernetes Engine Container cluster master.
11125 #[deprecated]
11126 GkeMaster,
11127 /// Forwarded to the next hop of a custom route imported from a peering VPC.
11128 ImportedCustomRouteNextHop,
11129 /// Forwarded to a Cloud SQL instance.
11130 #[deprecated]
11131 CloudSqlInstance,
11132 /// Forwarded to a VPC network in another project.
11133 AnotherProject,
11134 /// Forwarded to an NCC Hub.
11135 NccHub,
11136 /// Forwarded to a router appliance.
11137 RouterAppliance,
11138 /// Forwarded to a Secure Web Proxy Gateway.
11139 SecureWebProxyGateway,
11140 /// If set, the enum was initialized with an unknown value.
11141 ///
11142 /// Applications can examine the value using [Target::value] or
11143 /// [Target::name].
11144 UnknownValue(target::UnknownValue),
11145 }
11146
11147 #[doc(hidden)]
11148 pub mod target {
11149 #[allow(unused_imports)]
11150 use super::*;
11151 #[derive(Clone, Debug, PartialEq)]
11152 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11153 }
11154
11155 impl Target {
11156 /// Gets the enum value.
11157 ///
11158 /// Returns `None` if the enum contains an unknown value deserialized from
11159 /// the string representation of enums.
11160 pub fn value(&self) -> std::option::Option<i32> {
11161 match self {
11162 Self::Unspecified => std::option::Option::Some(0),
11163 Self::PeeringVpc => std::option::Option::Some(1),
11164 Self::VpnGateway => std::option::Option::Some(2),
11165 Self::Interconnect => std::option::Option::Some(3),
11166 Self::GkeMaster => std::option::Option::Some(4),
11167 Self::ImportedCustomRouteNextHop => std::option::Option::Some(5),
11168 Self::CloudSqlInstance => std::option::Option::Some(6),
11169 Self::AnotherProject => std::option::Option::Some(7),
11170 Self::NccHub => std::option::Option::Some(8),
11171 Self::RouterAppliance => std::option::Option::Some(9),
11172 Self::SecureWebProxyGateway => std::option::Option::Some(10),
11173 Self::UnknownValue(u) => u.0.value(),
11174 }
11175 }
11176
11177 /// Gets the enum value as a string.
11178 ///
11179 /// Returns `None` if the enum contains an unknown value deserialized from
11180 /// the integer representation of enums.
11181 pub fn name(&self) -> std::option::Option<&str> {
11182 match self {
11183 Self::Unspecified => std::option::Option::Some("TARGET_UNSPECIFIED"),
11184 Self::PeeringVpc => std::option::Option::Some("PEERING_VPC"),
11185 Self::VpnGateway => std::option::Option::Some("VPN_GATEWAY"),
11186 Self::Interconnect => std::option::Option::Some("INTERCONNECT"),
11187 Self::GkeMaster => std::option::Option::Some("GKE_MASTER"),
11188 Self::ImportedCustomRouteNextHop => {
11189 std::option::Option::Some("IMPORTED_CUSTOM_ROUTE_NEXT_HOP")
11190 }
11191 Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
11192 Self::AnotherProject => std::option::Option::Some("ANOTHER_PROJECT"),
11193 Self::NccHub => std::option::Option::Some("NCC_HUB"),
11194 Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
11195 Self::SecureWebProxyGateway => {
11196 std::option::Option::Some("SECURE_WEB_PROXY_GATEWAY")
11197 }
11198 Self::UnknownValue(u) => u.0.name(),
11199 }
11200 }
11201 }
11202
11203 impl std::default::Default for Target {
11204 fn default() -> Self {
11205 use std::convert::From;
11206 Self::from(0)
11207 }
11208 }
11209
11210 impl std::fmt::Display for Target {
11211 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11212 wkt::internal::display_enum(f, self.name(), self.value())
11213 }
11214 }
11215
11216 impl std::convert::From<i32> for Target {
11217 fn from(value: i32) -> Self {
11218 match value {
11219 0 => Self::Unspecified,
11220 1 => Self::PeeringVpc,
11221 2 => Self::VpnGateway,
11222 3 => Self::Interconnect,
11223 4 => Self::GkeMaster,
11224 5 => Self::ImportedCustomRouteNextHop,
11225 6 => Self::CloudSqlInstance,
11226 7 => Self::AnotherProject,
11227 8 => Self::NccHub,
11228 9 => Self::RouterAppliance,
11229 10 => Self::SecureWebProxyGateway,
11230 _ => Self::UnknownValue(target::UnknownValue(
11231 wkt::internal::UnknownEnumValue::Integer(value),
11232 )),
11233 }
11234 }
11235 }
11236
11237 impl std::convert::From<&str> for Target {
11238 fn from(value: &str) -> Self {
11239 use std::string::ToString;
11240 match value {
11241 "TARGET_UNSPECIFIED" => Self::Unspecified,
11242 "PEERING_VPC" => Self::PeeringVpc,
11243 "VPN_GATEWAY" => Self::VpnGateway,
11244 "INTERCONNECT" => Self::Interconnect,
11245 "GKE_MASTER" => Self::GkeMaster,
11246 "IMPORTED_CUSTOM_ROUTE_NEXT_HOP" => Self::ImportedCustomRouteNextHop,
11247 "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
11248 "ANOTHER_PROJECT" => Self::AnotherProject,
11249 "NCC_HUB" => Self::NccHub,
11250 "ROUTER_APPLIANCE" => Self::RouterAppliance,
11251 "SECURE_WEB_PROXY_GATEWAY" => Self::SecureWebProxyGateway,
11252 _ => Self::UnknownValue(target::UnknownValue(
11253 wkt::internal::UnknownEnumValue::String(value.to_string()),
11254 )),
11255 }
11256 }
11257 }
11258
11259 impl serde::ser::Serialize for Target {
11260 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11261 where
11262 S: serde::Serializer,
11263 {
11264 match self {
11265 Self::Unspecified => serializer.serialize_i32(0),
11266 Self::PeeringVpc => serializer.serialize_i32(1),
11267 Self::VpnGateway => serializer.serialize_i32(2),
11268 Self::Interconnect => serializer.serialize_i32(3),
11269 Self::GkeMaster => serializer.serialize_i32(4),
11270 Self::ImportedCustomRouteNextHop => serializer.serialize_i32(5),
11271 Self::CloudSqlInstance => serializer.serialize_i32(6),
11272 Self::AnotherProject => serializer.serialize_i32(7),
11273 Self::NccHub => serializer.serialize_i32(8),
11274 Self::RouterAppliance => serializer.serialize_i32(9),
11275 Self::SecureWebProxyGateway => serializer.serialize_i32(10),
11276 Self::UnknownValue(u) => u.0.serialize(serializer),
11277 }
11278 }
11279 }
11280
11281 impl<'de> serde::de::Deserialize<'de> for Target {
11282 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11283 where
11284 D: serde::Deserializer<'de>,
11285 {
11286 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Target>::new(
11287 ".google.cloud.networkmanagement.v1.ForwardInfo.Target",
11288 ))
11289 }
11290 }
11291}
11292
11293/// Details of the final state "abort" and associated resource.
11294#[derive(Clone, Default, PartialEq)]
11295#[non_exhaustive]
11296pub struct AbortInfo {
11297 /// Causes that the analysis is aborted.
11298 pub cause: crate::model::abort_info::Cause,
11299
11300 /// URI of the resource that caused the abort.
11301 pub resource_uri: std::string::String,
11302
11303 /// IP address that caused the abort.
11304 pub ip_address: std::string::String,
11305
11306 /// List of project IDs the user specified in the request but lacks access to.
11307 /// In this case, analysis is aborted with the PERMISSION_DENIED cause.
11308 pub projects_missing_permission: std::vec::Vec<std::string::String>,
11309
11310 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11311}
11312
11313impl AbortInfo {
11314 pub fn new() -> Self {
11315 std::default::Default::default()
11316 }
11317
11318 /// Sets the value of [cause][crate::model::AbortInfo::cause].
11319 ///
11320 /// # Example
11321 /// ```ignore,no_run
11322 /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11323 /// use google_cloud_networkmanagement_v1::model::abort_info::Cause;
11324 /// let x0 = AbortInfo::new().set_cause(Cause::UnknownIp);
11325 /// let x1 = AbortInfo::new().set_cause(Cause::GoogleManagedServiceUnknownIp);
11326 /// let x2 = AbortInfo::new().set_cause(Cause::SourceIpAddressNotInSourceNetwork);
11327 /// ```
11328 pub fn set_cause<T: std::convert::Into<crate::model::abort_info::Cause>>(
11329 mut self,
11330 v: T,
11331 ) -> Self {
11332 self.cause = v.into();
11333 self
11334 }
11335
11336 /// Sets the value of [resource_uri][crate::model::AbortInfo::resource_uri].
11337 ///
11338 /// # Example
11339 /// ```ignore,no_run
11340 /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11341 /// let x = AbortInfo::new().set_resource_uri("example");
11342 /// ```
11343 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11344 self.resource_uri = v.into();
11345 self
11346 }
11347
11348 /// Sets the value of [ip_address][crate::model::AbortInfo::ip_address].
11349 ///
11350 /// # Example
11351 /// ```ignore,no_run
11352 /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11353 /// let x = AbortInfo::new().set_ip_address("example");
11354 /// ```
11355 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11356 self.ip_address = v.into();
11357 self
11358 }
11359
11360 /// Sets the value of [projects_missing_permission][crate::model::AbortInfo::projects_missing_permission].
11361 ///
11362 /// # Example
11363 /// ```ignore,no_run
11364 /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11365 /// let x = AbortInfo::new().set_projects_missing_permission(["a", "b", "c"]);
11366 /// ```
11367 pub fn set_projects_missing_permission<T, V>(mut self, v: T) -> Self
11368 where
11369 T: std::iter::IntoIterator<Item = V>,
11370 V: std::convert::Into<std::string::String>,
11371 {
11372 use std::iter::Iterator;
11373 self.projects_missing_permission = v.into_iter().map(|i| i.into()).collect();
11374 self
11375 }
11376}
11377
11378impl wkt::message::Message for AbortInfo {
11379 fn typename() -> &'static str {
11380 "type.googleapis.com/google.cloud.networkmanagement.v1.AbortInfo"
11381 }
11382}
11383
11384/// Defines additional types related to [AbortInfo].
11385pub mod abort_info {
11386 #[allow(unused_imports)]
11387 use super::*;
11388
11389 /// Abort cause types:
11390 ///
11391 /// # Working with unknown values
11392 ///
11393 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11394 /// additional enum variants at any time. Adding new variants is not considered
11395 /// a breaking change. Applications should write their code in anticipation of:
11396 ///
11397 /// - New values appearing in future releases of the client library, **and**
11398 /// - New values received dynamically, without application changes.
11399 ///
11400 /// Please consult the [Working with enums] section in the user guide for some
11401 /// guidelines.
11402 ///
11403 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11404 #[derive(Clone, Debug, PartialEq)]
11405 #[non_exhaustive]
11406 pub enum Cause {
11407 /// Cause is unspecified.
11408 Unspecified,
11409 /// Aborted due to unknown network. Deprecated, not used in the new tests.
11410 #[deprecated]
11411 UnknownNetwork,
11412 /// Aborted because no project information can be derived from the test
11413 /// input. Deprecated, not used in the new tests.
11414 #[deprecated]
11415 UnknownProject,
11416 /// Aborted because traffic is sent from a public IP to an instance without
11417 /// an external IP. Deprecated, not used in the new tests.
11418 #[deprecated]
11419 NoExternalIp,
11420 /// Aborted because none of the traces matches destination information
11421 /// specified in the input test request. Deprecated, not used in the new
11422 /// tests.
11423 #[deprecated]
11424 UnintendedDestination,
11425 /// Aborted because the source endpoint could not be found. Deprecated, not
11426 /// used in the new tests.
11427 #[deprecated]
11428 SourceEndpointNotFound,
11429 /// Aborted because the source network does not match the source endpoint.
11430 /// Deprecated, not used in the new tests.
11431 #[deprecated]
11432 MismatchedSourceNetwork,
11433 /// Aborted because the destination endpoint could not be found. Deprecated,
11434 /// not used in the new tests.
11435 #[deprecated]
11436 DestinationEndpointNotFound,
11437 /// Aborted because the destination network does not match the destination
11438 /// endpoint. Deprecated, not used in the new tests.
11439 #[deprecated]
11440 MismatchedDestinationNetwork,
11441 /// Aborted because no endpoint with the packet's destination IP address is
11442 /// found.
11443 UnknownIp,
11444 /// Aborted because no endpoint with the packet's destination IP is found in
11445 /// the Google-managed project.
11446 GoogleManagedServiceUnknownIp,
11447 /// Aborted because the source IP address doesn't belong to any of the
11448 /// subnets of the source VPC network.
11449 SourceIpAddressNotInSourceNetwork,
11450 /// Aborted because user lacks permission to access all or part of the
11451 /// network configurations required to run the test.
11452 PermissionDenied,
11453 /// Aborted because user lacks permission to access Cloud NAT configs
11454 /// required to run the test.
11455 PermissionDeniedNoCloudNatConfigs,
11456 /// Aborted because user lacks permission to access Network endpoint group
11457 /// endpoint configs required to run the test.
11458 PermissionDeniedNoNegEndpointConfigs,
11459 /// Aborted because user lacks permission to access Cloud Router configs
11460 /// required to run the test.
11461 PermissionDeniedNoCloudRouterConfigs,
11462 /// Aborted because no valid source or destination endpoint can be derived
11463 /// from the test request.
11464 NoSourceLocation,
11465 /// Aborted because the source IP address is not contained within the subnet
11466 /// ranges of the provided VPC network.
11467 NoSourceGcpNetworkLocation,
11468 /// Aborted because the source IP address is not contained within the
11469 /// destination ranges of the routes towards non-GCP networks in the provided
11470 /// VPC network.
11471 NoSourceNonGcpNetworkLocation,
11472 /// Aborted because the source IP address can't be resolved as an Internet
11473 /// IP address.
11474 NoSourceInternetLocation,
11475 /// Aborted because the source or destination endpoint specified in
11476 /// the request is invalid. Some examples:
11477 ///
11478 /// - The request might contain malformed resource URI, project ID, or IP
11479 /// address.
11480 /// - The request might contain inconsistent information (for example, the
11481 /// request might include both the instance and the network, but the instance
11482 /// might not have a NIC in that network).
11483 InvalidArgument,
11484 /// Aborted because the number of steps in the trace exceeds a certain
11485 /// limit. It might be caused by a routing loop.
11486 TraceTooLong,
11487 /// Aborted due to internal server error.
11488 InternalError,
11489 /// Aborted because the test scenario is not supported.
11490 Unsupported,
11491 /// Aborted because the source and destination resources have no common IP
11492 /// version.
11493 MismatchedIpVersion,
11494 /// Aborted because the connection between the control plane and the node of
11495 /// the source cluster is initiated by the node and managed by the
11496 /// Konnectivity proxy.
11497 GkeKonnectivityProxyUnsupported,
11498 /// Aborted because expected resource configuration was missing.
11499 ResourceConfigNotFound,
11500 /// Aborted because expected VM instance configuration was missing.
11501 VmInstanceConfigNotFound,
11502 /// Aborted because expected network configuration was missing.
11503 NetworkConfigNotFound,
11504 /// Aborted because expected firewall configuration was missing.
11505 FirewallConfigNotFound,
11506 /// Aborted because expected route configuration was missing.
11507 RouteConfigNotFound,
11508 /// Aborted because PSC endpoint selection for the Google-managed service
11509 /// is ambiguous (several PSC endpoints satisfy test input).
11510 GoogleManagedServiceAmbiguousPscEndpoint,
11511 /// Aborted because endpoint selection for the Google-managed service is
11512 /// ambiguous (several endpoints satisfy test input).
11513 GoogleManagedServiceAmbiguousEndpoint,
11514 /// Aborted because tests with a PSC-based Cloud SQL instance as a source are
11515 /// not supported.
11516 SourcePscCloudSqlUnsupported,
11517 /// Aborted because tests with the external database as a source are not
11518 /// supported. In such replication scenarios, the connection is initiated by
11519 /// the Cloud SQL replica instance.
11520 SourceExternalCloudSqlUnsupported,
11521 /// Aborted because tests with a Redis Cluster as a source are not supported.
11522 SourceRedisClusterUnsupported,
11523 /// Aborted because tests with a Redis Instance as a source are not
11524 /// supported.
11525 SourceRedisInstanceUnsupported,
11526 /// Aborted because tests with a forwarding rule as a source are not
11527 /// supported.
11528 SourceForwardingRuleUnsupported,
11529 /// Aborted because one of the endpoints is a non-routable IP address
11530 /// (loopback, link-local, etc).
11531 NonRoutableIpAddress,
11532 /// Aborted due to an unknown issue in the Google-managed project.
11533 UnknownIssueInGoogleManagedProject,
11534 /// Aborted due to an unsupported configuration of the Google-managed
11535 /// project.
11536 UnsupportedGoogleManagedProjectConfig,
11537 /// Aborted because the source endpoint is a Cloud Run revision with direct
11538 /// VPC access enabled, but there are no reserved serverless IP ranges.
11539 NoServerlessIpRanges,
11540 /// Aborted because the used protocol is not supported for the used IP
11541 /// version.
11542 IpVersionProtocolMismatch,
11543 /// Aborted because selected GKE Pod endpoint location is unknown. This is
11544 /// often the case for "Pending" Pods, which don't have assigned IP addresses
11545 /// yet.
11546 GkePodUnknownEndpointLocation,
11547 /// If set, the enum was initialized with an unknown value.
11548 ///
11549 /// Applications can examine the value using [Cause::value] or
11550 /// [Cause::name].
11551 UnknownValue(cause::UnknownValue),
11552 }
11553
11554 #[doc(hidden)]
11555 pub mod cause {
11556 #[allow(unused_imports)]
11557 use super::*;
11558 #[derive(Clone, Debug, PartialEq)]
11559 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11560 }
11561
11562 impl Cause {
11563 /// Gets the enum value.
11564 ///
11565 /// Returns `None` if the enum contains an unknown value deserialized from
11566 /// the string representation of enums.
11567 pub fn value(&self) -> std::option::Option<i32> {
11568 match self {
11569 Self::Unspecified => std::option::Option::Some(0),
11570 Self::UnknownNetwork => std::option::Option::Some(1),
11571 Self::UnknownProject => std::option::Option::Some(3),
11572 Self::NoExternalIp => std::option::Option::Some(7),
11573 Self::UnintendedDestination => std::option::Option::Some(8),
11574 Self::SourceEndpointNotFound => std::option::Option::Some(11),
11575 Self::MismatchedSourceNetwork => std::option::Option::Some(12),
11576 Self::DestinationEndpointNotFound => std::option::Option::Some(13),
11577 Self::MismatchedDestinationNetwork => std::option::Option::Some(14),
11578 Self::UnknownIp => std::option::Option::Some(2),
11579 Self::GoogleManagedServiceUnknownIp => std::option::Option::Some(32),
11580 Self::SourceIpAddressNotInSourceNetwork => std::option::Option::Some(23),
11581 Self::PermissionDenied => std::option::Option::Some(4),
11582 Self::PermissionDeniedNoCloudNatConfigs => std::option::Option::Some(28),
11583 Self::PermissionDeniedNoNegEndpointConfigs => std::option::Option::Some(29),
11584 Self::PermissionDeniedNoCloudRouterConfigs => std::option::Option::Some(36),
11585 Self::NoSourceLocation => std::option::Option::Some(5),
11586 Self::NoSourceGcpNetworkLocation => std::option::Option::Some(42),
11587 Self::NoSourceNonGcpNetworkLocation => std::option::Option::Some(43),
11588 Self::NoSourceInternetLocation => std::option::Option::Some(44),
11589 Self::InvalidArgument => std::option::Option::Some(6),
11590 Self::TraceTooLong => std::option::Option::Some(9),
11591 Self::InternalError => std::option::Option::Some(10),
11592 Self::Unsupported => std::option::Option::Some(15),
11593 Self::MismatchedIpVersion => std::option::Option::Some(16),
11594 Self::GkeKonnectivityProxyUnsupported => std::option::Option::Some(17),
11595 Self::ResourceConfigNotFound => std::option::Option::Some(18),
11596 Self::VmInstanceConfigNotFound => std::option::Option::Some(24),
11597 Self::NetworkConfigNotFound => std::option::Option::Some(25),
11598 Self::FirewallConfigNotFound => std::option::Option::Some(26),
11599 Self::RouteConfigNotFound => std::option::Option::Some(27),
11600 Self::GoogleManagedServiceAmbiguousPscEndpoint => std::option::Option::Some(19),
11601 Self::GoogleManagedServiceAmbiguousEndpoint => std::option::Option::Some(39),
11602 Self::SourcePscCloudSqlUnsupported => std::option::Option::Some(20),
11603 Self::SourceExternalCloudSqlUnsupported => std::option::Option::Some(45),
11604 Self::SourceRedisClusterUnsupported => std::option::Option::Some(34),
11605 Self::SourceRedisInstanceUnsupported => std::option::Option::Some(35),
11606 Self::SourceForwardingRuleUnsupported => std::option::Option::Some(21),
11607 Self::NonRoutableIpAddress => std::option::Option::Some(22),
11608 Self::UnknownIssueInGoogleManagedProject => std::option::Option::Some(30),
11609 Self::UnsupportedGoogleManagedProjectConfig => std::option::Option::Some(31),
11610 Self::NoServerlessIpRanges => std::option::Option::Some(37),
11611 Self::IpVersionProtocolMismatch => std::option::Option::Some(40),
11612 Self::GkePodUnknownEndpointLocation => std::option::Option::Some(41),
11613 Self::UnknownValue(u) => u.0.value(),
11614 }
11615 }
11616
11617 /// Gets the enum value as a string.
11618 ///
11619 /// Returns `None` if the enum contains an unknown value deserialized from
11620 /// the integer representation of enums.
11621 pub fn name(&self) -> std::option::Option<&str> {
11622 match self {
11623 Self::Unspecified => std::option::Option::Some("CAUSE_UNSPECIFIED"),
11624 Self::UnknownNetwork => std::option::Option::Some("UNKNOWN_NETWORK"),
11625 Self::UnknownProject => std::option::Option::Some("UNKNOWN_PROJECT"),
11626 Self::NoExternalIp => std::option::Option::Some("NO_EXTERNAL_IP"),
11627 Self::UnintendedDestination => std::option::Option::Some("UNINTENDED_DESTINATION"),
11628 Self::SourceEndpointNotFound => {
11629 std::option::Option::Some("SOURCE_ENDPOINT_NOT_FOUND")
11630 }
11631 Self::MismatchedSourceNetwork => {
11632 std::option::Option::Some("MISMATCHED_SOURCE_NETWORK")
11633 }
11634 Self::DestinationEndpointNotFound => {
11635 std::option::Option::Some("DESTINATION_ENDPOINT_NOT_FOUND")
11636 }
11637 Self::MismatchedDestinationNetwork => {
11638 std::option::Option::Some("MISMATCHED_DESTINATION_NETWORK")
11639 }
11640 Self::UnknownIp => std::option::Option::Some("UNKNOWN_IP"),
11641 Self::GoogleManagedServiceUnknownIp => {
11642 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_UNKNOWN_IP")
11643 }
11644 Self::SourceIpAddressNotInSourceNetwork => {
11645 std::option::Option::Some("SOURCE_IP_ADDRESS_NOT_IN_SOURCE_NETWORK")
11646 }
11647 Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
11648 Self::PermissionDeniedNoCloudNatConfigs => {
11649 std::option::Option::Some("PERMISSION_DENIED_NO_CLOUD_NAT_CONFIGS")
11650 }
11651 Self::PermissionDeniedNoNegEndpointConfigs => {
11652 std::option::Option::Some("PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS")
11653 }
11654 Self::PermissionDeniedNoCloudRouterConfigs => {
11655 std::option::Option::Some("PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS")
11656 }
11657 Self::NoSourceLocation => std::option::Option::Some("NO_SOURCE_LOCATION"),
11658 Self::NoSourceGcpNetworkLocation => {
11659 std::option::Option::Some("NO_SOURCE_GCP_NETWORK_LOCATION")
11660 }
11661 Self::NoSourceNonGcpNetworkLocation => {
11662 std::option::Option::Some("NO_SOURCE_NON_GCP_NETWORK_LOCATION")
11663 }
11664 Self::NoSourceInternetLocation => {
11665 std::option::Option::Some("NO_SOURCE_INTERNET_LOCATION")
11666 }
11667 Self::InvalidArgument => std::option::Option::Some("INVALID_ARGUMENT"),
11668 Self::TraceTooLong => std::option::Option::Some("TRACE_TOO_LONG"),
11669 Self::InternalError => std::option::Option::Some("INTERNAL_ERROR"),
11670 Self::Unsupported => std::option::Option::Some("UNSUPPORTED"),
11671 Self::MismatchedIpVersion => std::option::Option::Some("MISMATCHED_IP_VERSION"),
11672 Self::GkeKonnectivityProxyUnsupported => {
11673 std::option::Option::Some("GKE_KONNECTIVITY_PROXY_UNSUPPORTED")
11674 }
11675 Self::ResourceConfigNotFound => {
11676 std::option::Option::Some("RESOURCE_CONFIG_NOT_FOUND")
11677 }
11678 Self::VmInstanceConfigNotFound => {
11679 std::option::Option::Some("VM_INSTANCE_CONFIG_NOT_FOUND")
11680 }
11681 Self::NetworkConfigNotFound => {
11682 std::option::Option::Some("NETWORK_CONFIG_NOT_FOUND")
11683 }
11684 Self::FirewallConfigNotFound => {
11685 std::option::Option::Some("FIREWALL_CONFIG_NOT_FOUND")
11686 }
11687 Self::RouteConfigNotFound => std::option::Option::Some("ROUTE_CONFIG_NOT_FOUND"),
11688 Self::GoogleManagedServiceAmbiguousPscEndpoint => {
11689 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT")
11690 }
11691 Self::GoogleManagedServiceAmbiguousEndpoint => {
11692 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT")
11693 }
11694 Self::SourcePscCloudSqlUnsupported => {
11695 std::option::Option::Some("SOURCE_PSC_CLOUD_SQL_UNSUPPORTED")
11696 }
11697 Self::SourceExternalCloudSqlUnsupported => {
11698 std::option::Option::Some("SOURCE_EXTERNAL_CLOUD_SQL_UNSUPPORTED")
11699 }
11700 Self::SourceRedisClusterUnsupported => {
11701 std::option::Option::Some("SOURCE_REDIS_CLUSTER_UNSUPPORTED")
11702 }
11703 Self::SourceRedisInstanceUnsupported => {
11704 std::option::Option::Some("SOURCE_REDIS_INSTANCE_UNSUPPORTED")
11705 }
11706 Self::SourceForwardingRuleUnsupported => {
11707 std::option::Option::Some("SOURCE_FORWARDING_RULE_UNSUPPORTED")
11708 }
11709 Self::NonRoutableIpAddress => std::option::Option::Some("NON_ROUTABLE_IP_ADDRESS"),
11710 Self::UnknownIssueInGoogleManagedProject => {
11711 std::option::Option::Some("UNKNOWN_ISSUE_IN_GOOGLE_MANAGED_PROJECT")
11712 }
11713 Self::UnsupportedGoogleManagedProjectConfig => {
11714 std::option::Option::Some("UNSUPPORTED_GOOGLE_MANAGED_PROJECT_CONFIG")
11715 }
11716 Self::NoServerlessIpRanges => std::option::Option::Some("NO_SERVERLESS_IP_RANGES"),
11717 Self::IpVersionProtocolMismatch => {
11718 std::option::Option::Some("IP_VERSION_PROTOCOL_MISMATCH")
11719 }
11720 Self::GkePodUnknownEndpointLocation => {
11721 std::option::Option::Some("GKE_POD_UNKNOWN_ENDPOINT_LOCATION")
11722 }
11723 Self::UnknownValue(u) => u.0.name(),
11724 }
11725 }
11726 }
11727
11728 impl std::default::Default for Cause {
11729 fn default() -> Self {
11730 use std::convert::From;
11731 Self::from(0)
11732 }
11733 }
11734
11735 impl std::fmt::Display for Cause {
11736 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11737 wkt::internal::display_enum(f, self.name(), self.value())
11738 }
11739 }
11740
11741 impl std::convert::From<i32> for Cause {
11742 fn from(value: i32) -> Self {
11743 match value {
11744 0 => Self::Unspecified,
11745 1 => Self::UnknownNetwork,
11746 2 => Self::UnknownIp,
11747 3 => Self::UnknownProject,
11748 4 => Self::PermissionDenied,
11749 5 => Self::NoSourceLocation,
11750 6 => Self::InvalidArgument,
11751 7 => Self::NoExternalIp,
11752 8 => Self::UnintendedDestination,
11753 9 => Self::TraceTooLong,
11754 10 => Self::InternalError,
11755 11 => Self::SourceEndpointNotFound,
11756 12 => Self::MismatchedSourceNetwork,
11757 13 => Self::DestinationEndpointNotFound,
11758 14 => Self::MismatchedDestinationNetwork,
11759 15 => Self::Unsupported,
11760 16 => Self::MismatchedIpVersion,
11761 17 => Self::GkeKonnectivityProxyUnsupported,
11762 18 => Self::ResourceConfigNotFound,
11763 19 => Self::GoogleManagedServiceAmbiguousPscEndpoint,
11764 20 => Self::SourcePscCloudSqlUnsupported,
11765 21 => Self::SourceForwardingRuleUnsupported,
11766 22 => Self::NonRoutableIpAddress,
11767 23 => Self::SourceIpAddressNotInSourceNetwork,
11768 24 => Self::VmInstanceConfigNotFound,
11769 25 => Self::NetworkConfigNotFound,
11770 26 => Self::FirewallConfigNotFound,
11771 27 => Self::RouteConfigNotFound,
11772 28 => Self::PermissionDeniedNoCloudNatConfigs,
11773 29 => Self::PermissionDeniedNoNegEndpointConfigs,
11774 30 => Self::UnknownIssueInGoogleManagedProject,
11775 31 => Self::UnsupportedGoogleManagedProjectConfig,
11776 32 => Self::GoogleManagedServiceUnknownIp,
11777 34 => Self::SourceRedisClusterUnsupported,
11778 35 => Self::SourceRedisInstanceUnsupported,
11779 36 => Self::PermissionDeniedNoCloudRouterConfigs,
11780 37 => Self::NoServerlessIpRanges,
11781 39 => Self::GoogleManagedServiceAmbiguousEndpoint,
11782 40 => Self::IpVersionProtocolMismatch,
11783 41 => Self::GkePodUnknownEndpointLocation,
11784 42 => Self::NoSourceGcpNetworkLocation,
11785 43 => Self::NoSourceNonGcpNetworkLocation,
11786 44 => Self::NoSourceInternetLocation,
11787 45 => Self::SourceExternalCloudSqlUnsupported,
11788 _ => Self::UnknownValue(cause::UnknownValue(
11789 wkt::internal::UnknownEnumValue::Integer(value),
11790 )),
11791 }
11792 }
11793 }
11794
11795 impl std::convert::From<&str> for Cause {
11796 fn from(value: &str) -> Self {
11797 use std::string::ToString;
11798 match value {
11799 "CAUSE_UNSPECIFIED" => Self::Unspecified,
11800 "UNKNOWN_NETWORK" => Self::UnknownNetwork,
11801 "UNKNOWN_PROJECT" => Self::UnknownProject,
11802 "NO_EXTERNAL_IP" => Self::NoExternalIp,
11803 "UNINTENDED_DESTINATION" => Self::UnintendedDestination,
11804 "SOURCE_ENDPOINT_NOT_FOUND" => Self::SourceEndpointNotFound,
11805 "MISMATCHED_SOURCE_NETWORK" => Self::MismatchedSourceNetwork,
11806 "DESTINATION_ENDPOINT_NOT_FOUND" => Self::DestinationEndpointNotFound,
11807 "MISMATCHED_DESTINATION_NETWORK" => Self::MismatchedDestinationNetwork,
11808 "UNKNOWN_IP" => Self::UnknownIp,
11809 "GOOGLE_MANAGED_SERVICE_UNKNOWN_IP" => Self::GoogleManagedServiceUnknownIp,
11810 "SOURCE_IP_ADDRESS_NOT_IN_SOURCE_NETWORK" => {
11811 Self::SourceIpAddressNotInSourceNetwork
11812 }
11813 "PERMISSION_DENIED" => Self::PermissionDenied,
11814 "PERMISSION_DENIED_NO_CLOUD_NAT_CONFIGS" => Self::PermissionDeniedNoCloudNatConfigs,
11815 "PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS" => {
11816 Self::PermissionDeniedNoNegEndpointConfigs
11817 }
11818 "PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS" => {
11819 Self::PermissionDeniedNoCloudRouterConfigs
11820 }
11821 "NO_SOURCE_LOCATION" => Self::NoSourceLocation,
11822 "NO_SOURCE_GCP_NETWORK_LOCATION" => Self::NoSourceGcpNetworkLocation,
11823 "NO_SOURCE_NON_GCP_NETWORK_LOCATION" => Self::NoSourceNonGcpNetworkLocation,
11824 "NO_SOURCE_INTERNET_LOCATION" => Self::NoSourceInternetLocation,
11825 "INVALID_ARGUMENT" => Self::InvalidArgument,
11826 "TRACE_TOO_LONG" => Self::TraceTooLong,
11827 "INTERNAL_ERROR" => Self::InternalError,
11828 "UNSUPPORTED" => Self::Unsupported,
11829 "MISMATCHED_IP_VERSION" => Self::MismatchedIpVersion,
11830 "GKE_KONNECTIVITY_PROXY_UNSUPPORTED" => Self::GkeKonnectivityProxyUnsupported,
11831 "RESOURCE_CONFIG_NOT_FOUND" => Self::ResourceConfigNotFound,
11832 "VM_INSTANCE_CONFIG_NOT_FOUND" => Self::VmInstanceConfigNotFound,
11833 "NETWORK_CONFIG_NOT_FOUND" => Self::NetworkConfigNotFound,
11834 "FIREWALL_CONFIG_NOT_FOUND" => Self::FirewallConfigNotFound,
11835 "ROUTE_CONFIG_NOT_FOUND" => Self::RouteConfigNotFound,
11836 "GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT" => {
11837 Self::GoogleManagedServiceAmbiguousPscEndpoint
11838 }
11839 "GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT" => {
11840 Self::GoogleManagedServiceAmbiguousEndpoint
11841 }
11842 "SOURCE_PSC_CLOUD_SQL_UNSUPPORTED" => Self::SourcePscCloudSqlUnsupported,
11843 "SOURCE_EXTERNAL_CLOUD_SQL_UNSUPPORTED" => Self::SourceExternalCloudSqlUnsupported,
11844 "SOURCE_REDIS_CLUSTER_UNSUPPORTED" => Self::SourceRedisClusterUnsupported,
11845 "SOURCE_REDIS_INSTANCE_UNSUPPORTED" => Self::SourceRedisInstanceUnsupported,
11846 "SOURCE_FORWARDING_RULE_UNSUPPORTED" => Self::SourceForwardingRuleUnsupported,
11847 "NON_ROUTABLE_IP_ADDRESS" => Self::NonRoutableIpAddress,
11848 "UNKNOWN_ISSUE_IN_GOOGLE_MANAGED_PROJECT" => {
11849 Self::UnknownIssueInGoogleManagedProject
11850 }
11851 "UNSUPPORTED_GOOGLE_MANAGED_PROJECT_CONFIG" => {
11852 Self::UnsupportedGoogleManagedProjectConfig
11853 }
11854 "NO_SERVERLESS_IP_RANGES" => Self::NoServerlessIpRanges,
11855 "IP_VERSION_PROTOCOL_MISMATCH" => Self::IpVersionProtocolMismatch,
11856 "GKE_POD_UNKNOWN_ENDPOINT_LOCATION" => Self::GkePodUnknownEndpointLocation,
11857 _ => Self::UnknownValue(cause::UnknownValue(
11858 wkt::internal::UnknownEnumValue::String(value.to_string()),
11859 )),
11860 }
11861 }
11862 }
11863
11864 impl serde::ser::Serialize for Cause {
11865 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11866 where
11867 S: serde::Serializer,
11868 {
11869 match self {
11870 Self::Unspecified => serializer.serialize_i32(0),
11871 Self::UnknownNetwork => serializer.serialize_i32(1),
11872 Self::UnknownProject => serializer.serialize_i32(3),
11873 Self::NoExternalIp => serializer.serialize_i32(7),
11874 Self::UnintendedDestination => serializer.serialize_i32(8),
11875 Self::SourceEndpointNotFound => serializer.serialize_i32(11),
11876 Self::MismatchedSourceNetwork => serializer.serialize_i32(12),
11877 Self::DestinationEndpointNotFound => serializer.serialize_i32(13),
11878 Self::MismatchedDestinationNetwork => serializer.serialize_i32(14),
11879 Self::UnknownIp => serializer.serialize_i32(2),
11880 Self::GoogleManagedServiceUnknownIp => serializer.serialize_i32(32),
11881 Self::SourceIpAddressNotInSourceNetwork => serializer.serialize_i32(23),
11882 Self::PermissionDenied => serializer.serialize_i32(4),
11883 Self::PermissionDeniedNoCloudNatConfigs => serializer.serialize_i32(28),
11884 Self::PermissionDeniedNoNegEndpointConfigs => serializer.serialize_i32(29),
11885 Self::PermissionDeniedNoCloudRouterConfigs => serializer.serialize_i32(36),
11886 Self::NoSourceLocation => serializer.serialize_i32(5),
11887 Self::NoSourceGcpNetworkLocation => serializer.serialize_i32(42),
11888 Self::NoSourceNonGcpNetworkLocation => serializer.serialize_i32(43),
11889 Self::NoSourceInternetLocation => serializer.serialize_i32(44),
11890 Self::InvalidArgument => serializer.serialize_i32(6),
11891 Self::TraceTooLong => serializer.serialize_i32(9),
11892 Self::InternalError => serializer.serialize_i32(10),
11893 Self::Unsupported => serializer.serialize_i32(15),
11894 Self::MismatchedIpVersion => serializer.serialize_i32(16),
11895 Self::GkeKonnectivityProxyUnsupported => serializer.serialize_i32(17),
11896 Self::ResourceConfigNotFound => serializer.serialize_i32(18),
11897 Self::VmInstanceConfigNotFound => serializer.serialize_i32(24),
11898 Self::NetworkConfigNotFound => serializer.serialize_i32(25),
11899 Self::FirewallConfigNotFound => serializer.serialize_i32(26),
11900 Self::RouteConfigNotFound => serializer.serialize_i32(27),
11901 Self::GoogleManagedServiceAmbiguousPscEndpoint => serializer.serialize_i32(19),
11902 Self::GoogleManagedServiceAmbiguousEndpoint => serializer.serialize_i32(39),
11903 Self::SourcePscCloudSqlUnsupported => serializer.serialize_i32(20),
11904 Self::SourceExternalCloudSqlUnsupported => serializer.serialize_i32(45),
11905 Self::SourceRedisClusterUnsupported => serializer.serialize_i32(34),
11906 Self::SourceRedisInstanceUnsupported => serializer.serialize_i32(35),
11907 Self::SourceForwardingRuleUnsupported => serializer.serialize_i32(21),
11908 Self::NonRoutableIpAddress => serializer.serialize_i32(22),
11909 Self::UnknownIssueInGoogleManagedProject => serializer.serialize_i32(30),
11910 Self::UnsupportedGoogleManagedProjectConfig => serializer.serialize_i32(31),
11911 Self::NoServerlessIpRanges => serializer.serialize_i32(37),
11912 Self::IpVersionProtocolMismatch => serializer.serialize_i32(40),
11913 Self::GkePodUnknownEndpointLocation => serializer.serialize_i32(41),
11914 Self::UnknownValue(u) => u.0.serialize(serializer),
11915 }
11916 }
11917 }
11918
11919 impl<'de> serde::de::Deserialize<'de> for Cause {
11920 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11921 where
11922 D: serde::Deserializer<'de>,
11923 {
11924 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Cause>::new(
11925 ".google.cloud.networkmanagement.v1.AbortInfo.Cause",
11926 ))
11927 }
11928 }
11929}
11930
11931/// Details of the final state "drop" and associated resource.
11932#[derive(Clone, Default, PartialEq)]
11933#[non_exhaustive]
11934pub struct DropInfo {
11935 /// Cause that the packet is dropped.
11936 pub cause: crate::model::drop_info::Cause,
11937
11938 /// URI of the resource that caused the drop.
11939 pub resource_uri: std::string::String,
11940
11941 /// Source IP address of the dropped packet (if relevant).
11942 pub source_ip: std::string::String,
11943
11944 /// Destination IP address of the dropped packet (if relevant).
11945 pub destination_ip: std::string::String,
11946
11947 /// Region of the dropped packet (if relevant).
11948 pub region: std::string::String,
11949
11950 /// Geolocation (region code) of the source IP address (if relevant).
11951 pub source_geolocation_code: std::string::String,
11952
11953 /// Geolocation (region code) of the destination IP address (if relevant).
11954 pub destination_geolocation_code: std::string::String,
11955
11956 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11957}
11958
11959impl DropInfo {
11960 pub fn new() -> Self {
11961 std::default::Default::default()
11962 }
11963
11964 /// Sets the value of [cause][crate::model::DropInfo::cause].
11965 ///
11966 /// # Example
11967 /// ```ignore,no_run
11968 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
11969 /// use google_cloud_networkmanagement_v1::model::drop_info::Cause;
11970 /// let x0 = DropInfo::new().set_cause(Cause::UnknownExternalAddress);
11971 /// let x1 = DropInfo::new().set_cause(Cause::ForeignIpDisallowed);
11972 /// let x2 = DropInfo::new().set_cause(Cause::FirewallRule);
11973 /// ```
11974 pub fn set_cause<T: std::convert::Into<crate::model::drop_info::Cause>>(
11975 mut self,
11976 v: T,
11977 ) -> Self {
11978 self.cause = v.into();
11979 self
11980 }
11981
11982 /// Sets the value of [resource_uri][crate::model::DropInfo::resource_uri].
11983 ///
11984 /// # Example
11985 /// ```ignore,no_run
11986 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
11987 /// let x = DropInfo::new().set_resource_uri("example");
11988 /// ```
11989 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11990 self.resource_uri = v.into();
11991 self
11992 }
11993
11994 /// Sets the value of [source_ip][crate::model::DropInfo::source_ip].
11995 ///
11996 /// # Example
11997 /// ```ignore,no_run
11998 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
11999 /// let x = DropInfo::new().set_source_ip("example");
12000 /// ```
12001 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12002 self.source_ip = v.into();
12003 self
12004 }
12005
12006 /// Sets the value of [destination_ip][crate::model::DropInfo::destination_ip].
12007 ///
12008 /// # Example
12009 /// ```ignore,no_run
12010 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12011 /// let x = DropInfo::new().set_destination_ip("example");
12012 /// ```
12013 pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12014 self.destination_ip = v.into();
12015 self
12016 }
12017
12018 /// Sets the value of [region][crate::model::DropInfo::region].
12019 ///
12020 /// # Example
12021 /// ```ignore,no_run
12022 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12023 /// let x = DropInfo::new().set_region("example");
12024 /// ```
12025 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12026 self.region = v.into();
12027 self
12028 }
12029
12030 /// Sets the value of [source_geolocation_code][crate::model::DropInfo::source_geolocation_code].
12031 ///
12032 /// # Example
12033 /// ```ignore,no_run
12034 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12035 /// let x = DropInfo::new().set_source_geolocation_code("example");
12036 /// ```
12037 pub fn set_source_geolocation_code<T: std::convert::Into<std::string::String>>(
12038 mut self,
12039 v: T,
12040 ) -> Self {
12041 self.source_geolocation_code = v.into();
12042 self
12043 }
12044
12045 /// Sets the value of [destination_geolocation_code][crate::model::DropInfo::destination_geolocation_code].
12046 ///
12047 /// # Example
12048 /// ```ignore,no_run
12049 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12050 /// let x = DropInfo::new().set_destination_geolocation_code("example");
12051 /// ```
12052 pub fn set_destination_geolocation_code<T: std::convert::Into<std::string::String>>(
12053 mut self,
12054 v: T,
12055 ) -> Self {
12056 self.destination_geolocation_code = v.into();
12057 self
12058 }
12059}
12060
12061impl wkt::message::Message for DropInfo {
12062 fn typename() -> &'static str {
12063 "type.googleapis.com/google.cloud.networkmanagement.v1.DropInfo"
12064 }
12065}
12066
12067/// Defines additional types related to [DropInfo].
12068pub mod drop_info {
12069 #[allow(unused_imports)]
12070 use super::*;
12071
12072 /// Drop cause types:
12073 ///
12074 /// # Working with unknown values
12075 ///
12076 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12077 /// additional enum variants at any time. Adding new variants is not considered
12078 /// a breaking change. Applications should write their code in anticipation of:
12079 ///
12080 /// - New values appearing in future releases of the client library, **and**
12081 /// - New values received dynamically, without application changes.
12082 ///
12083 /// Please consult the [Working with enums] section in the user guide for some
12084 /// guidelines.
12085 ///
12086 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12087 #[derive(Clone, Debug, PartialEq)]
12088 #[non_exhaustive]
12089 pub enum Cause {
12090 /// Cause is unspecified.
12091 Unspecified,
12092 /// Destination external address cannot be resolved to a known target. If
12093 /// the address is used in a Google Cloud project, provide the project ID
12094 /// as test input.
12095 UnknownExternalAddress,
12096 /// A Compute Engine instance can only send or receive a packet with a
12097 /// foreign IP address if ip_forward is enabled.
12098 ForeignIpDisallowed,
12099 /// Dropped due to a firewall rule, unless allowed due to connection
12100 /// tracking.
12101 FirewallRule,
12102 /// Dropped due to no matching routes.
12103 NoRoute,
12104 /// Dropped due to invalid route. Route's next hop is a blackhole.
12105 RouteBlackhole,
12106 /// Packet is sent to a wrong (unintended) network. Example: you trace a
12107 /// packet from VM1:Network1 to VM2:Network2, however, the route configured
12108 /// in Network1 sends the packet destined for VM2's IP address to Network3.
12109 RouteWrongNetwork,
12110 /// Route's next hop IP address cannot be resolved to a GCP resource.
12111 RouteNextHopIpAddressNotResolved,
12112 /// Route's next hop resource is not found.
12113 RouteNextHopResourceNotFound,
12114 /// Route's next hop instance doesn't have a NIC in the route's network.
12115 RouteNextHopInstanceWrongNetwork,
12116 /// Route's next hop IP address is not a primary IP address of the next hop
12117 /// instance.
12118 RouteNextHopInstanceNonPrimaryIp,
12119 /// Route's next hop forwarding rule doesn't match next hop IP address.
12120 RouteNextHopForwardingRuleIpMismatch,
12121 /// Route's next hop VPN tunnel is down (does not have valid IKE SAs).
12122 RouteNextHopVpnTunnelNotEstablished,
12123 /// Route's next hop forwarding rule type is invalid (it's not a forwarding
12124 /// rule of the internal passthrough load balancer).
12125 RouteNextHopForwardingRuleTypeInvalid,
12126 /// Packet is sent from the Internet to the private IPv6 address.
12127 NoRouteFromInternetToPrivateIpv6Address,
12128 /// Packet is sent from the Internet to the private IPv4 address.
12129 NoRouteFromInternetToPrivateIpv4Address,
12130 /// Packet is sent from the external IPv6 source address of an instance to
12131 /// the private IPv6 address of an instance.
12132 NoRouteFromExternalIpv6SourceToPrivateIpv6Address,
12133 /// The packet does not match a policy-based VPN tunnel local selector.
12134 VpnTunnelLocalSelectorMismatch,
12135 /// The packet does not match a policy-based VPN tunnel remote selector.
12136 VpnTunnelRemoteSelectorMismatch,
12137 /// Packet with internal destination address sent to the internet gateway.
12138 PrivateTrafficToInternet,
12139 /// Endpoint with only an internal IP address tries to access Google API and
12140 /// services, but Private Google Access is not enabled in the subnet or is
12141 /// not applicable.
12142 PrivateGoogleAccessDisallowed,
12143 /// Source endpoint tries to access Google API and services through the VPN
12144 /// tunnel to another network, but Private Google Access needs to be enabled
12145 /// in the source endpoint network.
12146 PrivateGoogleAccessViaVpnTunnelUnsupported,
12147 /// Endpoint with only an internal IP address tries to access external hosts,
12148 /// but there is no matching Cloud NAT gateway in the subnet.
12149 NoExternalAddress,
12150 /// Destination internal address cannot be resolved to a known target. If
12151 /// this is a shared VPC scenario, verify if the service project ID is
12152 /// provided as test input. Otherwise, verify if the IP address is being
12153 /// used in the project.
12154 UnknownInternalAddress,
12155 /// Forwarding rule's protocol and ports do not match the packet header.
12156 ForwardingRuleMismatch,
12157 /// Forwarding rule does not have backends configured.
12158 ForwardingRuleNoInstances,
12159 /// Firewalls block the health check probes to the backends and cause
12160 /// the backends to be unavailable for traffic from the load balancer.
12161 /// For more details, see [Health check firewall
12162 /// rules](https://cloud.google.com/load-balancing/docs/health-checks#firewall_rules).
12163 FirewallBlockingLoadBalancerBackendHealthCheck,
12164 /// Matching ingress firewall rules by network tags for packets sent via
12165 /// serverless VPC direct egress is unsupported. Behavior is undefined.
12166 /// <https://cloud.google.com/run/docs/configuring/vpc-direct-vpc#limitations>
12167 IngressFirewallTagsUnsupportedByDirectVpcEgress,
12168 /// Packet is sent from or to a Compute Engine instance that is not in a
12169 /// running state.
12170 InstanceNotRunning,
12171 /// Packet sent from or to a GKE cluster that is not in running state.
12172 GkeClusterNotRunning,
12173 /// Packet sent from or to a GKE Pod that is not in running state.
12174 GkePodNotRunning,
12175 /// Packet sent from or to a Cloud SQL instance that is not in running state.
12176 CloudSqlInstanceNotRunning,
12177 /// Packet sent from or to a Redis Instance that is not in running state.
12178 RedisInstanceNotRunning,
12179 /// Packet sent from or to a Redis Cluster that is not in running state.
12180 RedisClusterNotRunning,
12181 /// The type of traffic is blocked and the user cannot configure a firewall
12182 /// rule to enable it. See [Always blocked
12183 /// traffic](https://cloud.google.com/vpc/docs/firewalls#blockedtraffic) for
12184 /// more details.
12185 TrafficTypeBlocked,
12186 /// Access to Google Kubernetes Engine cluster master's endpoint is not
12187 /// authorized. See [Access to the cluster
12188 /// endpoints](https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#access_to_the_cluster_endpoints)
12189 /// for more details.
12190 GkeMasterUnauthorizedAccess,
12191 /// Access to the Cloud SQL instance endpoint is not authorized.
12192 /// See [Authorizing with authorized
12193 /// networks](https://cloud.google.com/sql/docs/mysql/authorize-networks) for
12194 /// more details.
12195 CloudSqlInstanceUnauthorizedAccess,
12196 /// Packet was dropped inside Google Kubernetes Engine Service.
12197 DroppedInsideGkeService,
12198 /// Packet was dropped inside Cloud SQL Service.
12199 DroppedInsideCloudSqlService,
12200 /// Packet was dropped because there is no peering between the originating
12201 /// network and the Google Managed Services Network.
12202 GoogleManagedServiceNoPeering,
12203 /// Packet was dropped because the Google-managed service uses Private
12204 /// Service Connect (PSC), but the PSC endpoint is not found in the project.
12205 GoogleManagedServiceNoPscEndpoint,
12206 /// Packet was dropped because the GKE cluster uses Private Service Connect
12207 /// (PSC), but the PSC endpoint is not found in the project.
12208 GkePscEndpointMissing,
12209 /// Packet was dropped because the Cloud SQL instance has neither a private
12210 /// nor a public IP address.
12211 CloudSqlInstanceNoIpAddress,
12212 /// Packet was dropped because a GKE cluster private endpoint is
12213 /// unreachable from a region different from the cluster's region.
12214 GkeControlPlaneRegionMismatch,
12215 /// Packet sent from a public GKE cluster control plane to a private
12216 /// IP address.
12217 PublicGkeControlPlaneToPrivateDestination,
12218 /// Packet was dropped because there is no route from a GKE cluster
12219 /// control plane to a destination network.
12220 GkeControlPlaneNoRoute,
12221 /// Packet sent from a Cloud SQL instance to an external IP address is not
12222 /// allowed. The Cloud SQL instance is not configured to send packets to
12223 /// external IP addresses.
12224 CloudSqlInstanceNotConfiguredForExternalTraffic,
12225 /// Packet sent from a Cloud SQL instance with only a public IP address to a
12226 /// private IP address.
12227 PublicCloudSqlInstanceToPrivateDestination,
12228 /// Packet was dropped because there is no route from a Cloud SQL
12229 /// instance to a destination network.
12230 CloudSqlInstanceNoRoute,
12231 /// Packet was dropped because the Cloud SQL instance requires all
12232 /// connections to use Cloud SQL connectors and to target the Cloud SQL proxy
12233 /// port (3307).
12234 CloudSqlConnectorRequired,
12235 /// Packet could be dropped because the Cloud Function is not in an active
12236 /// status.
12237 CloudFunctionNotActive,
12238 /// Packet could be dropped because no VPC connector is set.
12239 VpcConnectorNotSet,
12240 /// Packet could be dropped because the VPC connector is not in a running
12241 /// state.
12242 VpcConnectorNotRunning,
12243 /// Packet could be dropped because the traffic from the serverless service
12244 /// to the VPC connector is not allowed.
12245 VpcConnectorServerlessTrafficBlocked,
12246 /// Packet could be dropped because the health check traffic to the VPC
12247 /// connector is not allowed.
12248 VpcConnectorHealthCheckTrafficBlocked,
12249 /// Packet could be dropped because it was sent from a different region
12250 /// to a regional forwarding without global access.
12251 ForwardingRuleRegionMismatch,
12252 /// The Private Service Connect endpoint is in a project that is not approved
12253 /// to connect to the service.
12254 PscConnectionNotAccepted,
12255 /// The packet is sent to the Private Service Connect endpoint over the
12256 /// peering, but [it's not
12257 /// supported](https://cloud.google.com/vpc/docs/configure-private-service-connect-services#on-premises).
12258 PscEndpointAccessedFromPeeredNetwork,
12259 /// The packet is sent to the Private Service Connect backend (network
12260 /// endpoint group), but the producer PSC forwarding rule does not have
12261 /// global access enabled.
12262 PscNegProducerEndpointNoGlobalAccess,
12263 /// The packet is sent to the Private Service Connect backend (network
12264 /// endpoint group), but the producer PSC forwarding rule has multiple ports
12265 /// specified.
12266 PscNegProducerForwardingRuleMultiplePorts,
12267 /// The packet is sent to the Private Service Connect backend (network
12268 /// endpoint group) targeting a Cloud SQL service attachment, but this
12269 /// configuration is not supported.
12270 CloudSqlPscNegUnsupported,
12271 /// No NAT subnets are defined for the PSC service attachment.
12272 NoNatSubnetsForPscServiceAttachment,
12273 /// PSC endpoint is accessed via NCC, but PSC transitivity configuration is
12274 /// not yet propagated.
12275 PscTransitivityNotPropagated,
12276 /// The packet sent from the hybrid NEG proxy matches a non-dynamic route,
12277 /// but such a configuration is not supported.
12278 HybridNegNonDynamicRouteMatched,
12279 /// The packet sent from the hybrid NEG proxy matches a dynamic route with a
12280 /// next hop in a different region, but such a configuration is not
12281 /// supported.
12282 HybridNegNonLocalDynamicRouteMatched,
12283 /// Packet sent from a Cloud Run revision that is not ready.
12284 CloudRunRevisionNotReady,
12285 /// Packet was dropped inside Private Service Connect service producer.
12286 DroppedInsidePscServiceProducer,
12287 /// Packet sent to a load balancer, which requires a proxy-only subnet and
12288 /// the subnet is not found.
12289 LoadBalancerHasNoProxySubnet,
12290 /// Packet sent to Cloud Nat without active NAT IPs.
12291 CloudNatNoAddresses,
12292 /// Packet is stuck in a routing loop.
12293 RoutingLoop,
12294 /// Packet is dropped inside a Google-managed service due to being delivered
12295 /// in return trace to an endpoint that doesn't match the endpoint the packet
12296 /// was sent from in forward trace. Used only for return traces.
12297 DroppedInsideGoogleManagedService,
12298 /// Packet is dropped due to a load balancer backend instance not having a
12299 /// network interface in the network expected by the load balancer.
12300 LoadBalancerBackendInvalidNetwork,
12301 /// Packet is dropped due to a backend service named port not being defined
12302 /// on the instance group level.
12303 BackendServiceNamedPortNotDefined,
12304 /// Packet is dropped due to a destination IP range being part of a Private
12305 /// NAT IP range.
12306 DestinationIsPrivateNatIpRange,
12307 /// Generic drop cause for a packet being dropped inside a Redis Instance
12308 /// service project.
12309 DroppedInsideRedisInstanceService,
12310 /// Packet is dropped due to an unsupported port being used to connect to a
12311 /// Redis Instance. Port 6379 should be used to connect to a Redis Instance.
12312 RedisInstanceUnsupportedPort,
12313 /// Packet is dropped due to connecting from PUPI address to a PSA based
12314 /// Redis Instance.
12315 RedisInstanceConnectingFromPupiAddress,
12316 /// Packet is dropped due to no route to the destination network.
12317 RedisInstanceNoRouteToDestinationNetwork,
12318 /// Redis Instance does not have an external IP address.
12319 RedisInstanceNoExternalIp,
12320 /// Packet is dropped due to an unsupported protocol being used to connect to
12321 /// a Redis Instance. Only TCP connections are accepted by a Redis Instance.
12322 RedisInstanceUnsupportedProtocol,
12323 /// Generic drop cause for a packet being dropped inside a Redis Cluster
12324 /// service project.
12325 DroppedInsideRedisClusterService,
12326 /// Packet is dropped due to an unsupported port being used to connect to a
12327 /// Redis Cluster. Ports 6379 and 11000 to 13047 should be used to connect to
12328 /// a Redis Cluster.
12329 RedisClusterUnsupportedPort,
12330 /// Redis Cluster does not have an external IP address.
12331 RedisClusterNoExternalIp,
12332 /// Packet is dropped due to an unsupported protocol being used to connect to
12333 /// a Redis Cluster. Only TCP connections are accepted by a Redis Cluster.
12334 RedisClusterUnsupportedProtocol,
12335 /// Packet from the non-GCP (on-prem) or unknown GCP network is dropped due
12336 /// to the destination IP address not belonging to any IP prefix advertised
12337 /// via BGP by the Cloud Router.
12338 NoAdvertisedRouteToGcpDestination,
12339 /// Packet from the non-GCP (on-prem) or unknown GCP network is dropped due
12340 /// to the destination IP address not belonging to any IP prefix included to
12341 /// the local traffic selector of the VPN tunnel.
12342 NoTrafficSelectorToGcpDestination,
12343 /// Packet from the unknown peered network is dropped due to no known route
12344 /// from the source network to the destination IP address.
12345 NoKnownRouteFromPeeredNetworkToDestination,
12346 /// Sending packets processed by the Private NAT Gateways to the Private
12347 /// Service Connect endpoints is not supported.
12348 PrivateNatToPscEndpointUnsupported,
12349 /// Packet is sent to the PSC port mapping service, but its destination port
12350 /// does not match any port mapping rules.
12351 PscPortMappingPortMismatch,
12352 /// Sending packets directly to the PSC port mapping service without going
12353 /// through the PSC connection is not supported.
12354 PscPortMappingWithoutPscConnectionUnsupported,
12355 /// Packet with destination IP address within the reserved NAT64 range is
12356 /// dropped due to matching a route of an unsupported type.
12357 UnsupportedRouteMatchedForNat64Destination,
12358 /// Packet could be dropped because hybrid endpoint like a VPN gateway or
12359 /// Interconnect is not allowed to send traffic to the Internet.
12360 TrafficFromHybridEndpointToInternetDisallowed,
12361 /// Packet with destination IP address within the reserved NAT64 range is
12362 /// dropped due to no matching NAT gateway in the subnet.
12363 NoMatchingNat64Gateway,
12364 /// Packet is dropped due to matching a Private NAT64 gateway with no rules
12365 /// for source IPv6 addresses.
12366 NoConfiguredPrivateNat64Rule,
12367 /// Packet is dropped due to being sent to a backend of a passthrough load
12368 /// balancer that doesn't use the same IP version as the frontend.
12369 LoadBalancerBackendIpVersionMismatch,
12370 /// Packet from the unknown NCC network is dropped due to no known route
12371 /// from the source network to the destination IP address.
12372 NoKnownRouteFromNccNetworkToDestination,
12373 /// Packet is dropped by Cloud NAT due to using an unsupported protocol.
12374 CloudNatProtocolUnsupported,
12375 /// Packet is dropped due to using an unsupported protocol (any other than
12376 /// UDP) for L2 Interconnect.
12377 L2InterconnectUnsupportedProtocol,
12378 /// Packet is dropped due to using an unsupported port (any other than
12379 /// 6081) for L2 Interconnect.
12380 L2InterconnectUnsupportedPort,
12381 /// Packet is dropped due to destination IP not matching the appliance
12382 /// mapping IPs configured on the L2 Interconnect attachment.
12383 L2InterconnectDestinationIpMismatch,
12384 /// Packet could be dropped because it matches a route associated with an NCC
12385 /// spoke in the hybrid subnet context, but such a configuration is not
12386 /// supported.
12387 NccRouteWithinHybridSubnetUnsupported,
12388 /// Packet is dropped because the region of the hybrid subnet is different
12389 /// from the region of the next hop of the route matched within this hybrid
12390 /// subnet.
12391 HybridSubnetRegionMismatch,
12392 /// Packet is dropped because no matching route was found in the hybrid
12393 /// subnet.
12394 HybridSubnetNoRoute,
12395 /// If set, the enum was initialized with an unknown value.
12396 ///
12397 /// Applications can examine the value using [Cause::value] or
12398 /// [Cause::name].
12399 UnknownValue(cause::UnknownValue),
12400 }
12401
12402 #[doc(hidden)]
12403 pub mod cause {
12404 #[allow(unused_imports)]
12405 use super::*;
12406 #[derive(Clone, Debug, PartialEq)]
12407 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12408 }
12409
12410 impl Cause {
12411 /// Gets the enum value.
12412 ///
12413 /// Returns `None` if the enum contains an unknown value deserialized from
12414 /// the string representation of enums.
12415 pub fn value(&self) -> std::option::Option<i32> {
12416 match self {
12417 Self::Unspecified => std::option::Option::Some(0),
12418 Self::UnknownExternalAddress => std::option::Option::Some(1),
12419 Self::ForeignIpDisallowed => std::option::Option::Some(2),
12420 Self::FirewallRule => std::option::Option::Some(3),
12421 Self::NoRoute => std::option::Option::Some(4),
12422 Self::RouteBlackhole => std::option::Option::Some(5),
12423 Self::RouteWrongNetwork => std::option::Option::Some(6),
12424 Self::RouteNextHopIpAddressNotResolved => std::option::Option::Some(42),
12425 Self::RouteNextHopResourceNotFound => std::option::Option::Some(43),
12426 Self::RouteNextHopInstanceWrongNetwork => std::option::Option::Some(49),
12427 Self::RouteNextHopInstanceNonPrimaryIp => std::option::Option::Some(50),
12428 Self::RouteNextHopForwardingRuleIpMismatch => std::option::Option::Some(51),
12429 Self::RouteNextHopVpnTunnelNotEstablished => std::option::Option::Some(52),
12430 Self::RouteNextHopForwardingRuleTypeInvalid => std::option::Option::Some(53),
12431 Self::NoRouteFromInternetToPrivateIpv6Address => std::option::Option::Some(44),
12432 Self::NoRouteFromInternetToPrivateIpv4Address => std::option::Option::Some(109),
12433 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
12434 std::option::Option::Some(98)
12435 }
12436 Self::VpnTunnelLocalSelectorMismatch => std::option::Option::Some(45),
12437 Self::VpnTunnelRemoteSelectorMismatch => std::option::Option::Some(46),
12438 Self::PrivateTrafficToInternet => std::option::Option::Some(7),
12439 Self::PrivateGoogleAccessDisallowed => std::option::Option::Some(8),
12440 Self::PrivateGoogleAccessViaVpnTunnelUnsupported => std::option::Option::Some(47),
12441 Self::NoExternalAddress => std::option::Option::Some(9),
12442 Self::UnknownInternalAddress => std::option::Option::Some(10),
12443 Self::ForwardingRuleMismatch => std::option::Option::Some(11),
12444 Self::ForwardingRuleNoInstances => std::option::Option::Some(12),
12445 Self::FirewallBlockingLoadBalancerBackendHealthCheck => {
12446 std::option::Option::Some(13)
12447 }
12448 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => {
12449 std::option::Option::Some(85)
12450 }
12451 Self::InstanceNotRunning => std::option::Option::Some(14),
12452 Self::GkeClusterNotRunning => std::option::Option::Some(27),
12453 Self::GkePodNotRunning => std::option::Option::Some(103),
12454 Self::CloudSqlInstanceNotRunning => std::option::Option::Some(28),
12455 Self::RedisInstanceNotRunning => std::option::Option::Some(68),
12456 Self::RedisClusterNotRunning => std::option::Option::Some(69),
12457 Self::TrafficTypeBlocked => std::option::Option::Some(15),
12458 Self::GkeMasterUnauthorizedAccess => std::option::Option::Some(16),
12459 Self::CloudSqlInstanceUnauthorizedAccess => std::option::Option::Some(17),
12460 Self::DroppedInsideGkeService => std::option::Option::Some(18),
12461 Self::DroppedInsideCloudSqlService => std::option::Option::Some(19),
12462 Self::GoogleManagedServiceNoPeering => std::option::Option::Some(20),
12463 Self::GoogleManagedServiceNoPscEndpoint => std::option::Option::Some(38),
12464 Self::GkePscEndpointMissing => std::option::Option::Some(36),
12465 Self::CloudSqlInstanceNoIpAddress => std::option::Option::Some(21),
12466 Self::GkeControlPlaneRegionMismatch => std::option::Option::Some(30),
12467 Self::PublicGkeControlPlaneToPrivateDestination => std::option::Option::Some(31),
12468 Self::GkeControlPlaneNoRoute => std::option::Option::Some(32),
12469 Self::CloudSqlInstanceNotConfiguredForExternalTraffic => {
12470 std::option::Option::Some(33)
12471 }
12472 Self::PublicCloudSqlInstanceToPrivateDestination => std::option::Option::Some(34),
12473 Self::CloudSqlInstanceNoRoute => std::option::Option::Some(35),
12474 Self::CloudSqlConnectorRequired => std::option::Option::Some(63),
12475 Self::CloudFunctionNotActive => std::option::Option::Some(22),
12476 Self::VpcConnectorNotSet => std::option::Option::Some(23),
12477 Self::VpcConnectorNotRunning => std::option::Option::Some(24),
12478 Self::VpcConnectorServerlessTrafficBlocked => std::option::Option::Some(60),
12479 Self::VpcConnectorHealthCheckTrafficBlocked => std::option::Option::Some(61),
12480 Self::ForwardingRuleRegionMismatch => std::option::Option::Some(25),
12481 Self::PscConnectionNotAccepted => std::option::Option::Some(26),
12482 Self::PscEndpointAccessedFromPeeredNetwork => std::option::Option::Some(41),
12483 Self::PscNegProducerEndpointNoGlobalAccess => std::option::Option::Some(48),
12484 Self::PscNegProducerForwardingRuleMultiplePorts => std::option::Option::Some(54),
12485 Self::CloudSqlPscNegUnsupported => std::option::Option::Some(58),
12486 Self::NoNatSubnetsForPscServiceAttachment => std::option::Option::Some(57),
12487 Self::PscTransitivityNotPropagated => std::option::Option::Some(64),
12488 Self::HybridNegNonDynamicRouteMatched => std::option::Option::Some(55),
12489 Self::HybridNegNonLocalDynamicRouteMatched => std::option::Option::Some(56),
12490 Self::CloudRunRevisionNotReady => std::option::Option::Some(29),
12491 Self::DroppedInsidePscServiceProducer => std::option::Option::Some(37),
12492 Self::LoadBalancerHasNoProxySubnet => std::option::Option::Some(39),
12493 Self::CloudNatNoAddresses => std::option::Option::Some(40),
12494 Self::RoutingLoop => std::option::Option::Some(59),
12495 Self::DroppedInsideGoogleManagedService => std::option::Option::Some(62),
12496 Self::LoadBalancerBackendInvalidNetwork => std::option::Option::Some(65),
12497 Self::BackendServiceNamedPortNotDefined => std::option::Option::Some(66),
12498 Self::DestinationIsPrivateNatIpRange => std::option::Option::Some(67),
12499 Self::DroppedInsideRedisInstanceService => std::option::Option::Some(70),
12500 Self::RedisInstanceUnsupportedPort => std::option::Option::Some(71),
12501 Self::RedisInstanceConnectingFromPupiAddress => std::option::Option::Some(72),
12502 Self::RedisInstanceNoRouteToDestinationNetwork => std::option::Option::Some(73),
12503 Self::RedisInstanceNoExternalIp => std::option::Option::Some(74),
12504 Self::RedisInstanceUnsupportedProtocol => std::option::Option::Some(78),
12505 Self::DroppedInsideRedisClusterService => std::option::Option::Some(75),
12506 Self::RedisClusterUnsupportedPort => std::option::Option::Some(76),
12507 Self::RedisClusterNoExternalIp => std::option::Option::Some(77),
12508 Self::RedisClusterUnsupportedProtocol => std::option::Option::Some(79),
12509 Self::NoAdvertisedRouteToGcpDestination => std::option::Option::Some(80),
12510 Self::NoTrafficSelectorToGcpDestination => std::option::Option::Some(81),
12511 Self::NoKnownRouteFromPeeredNetworkToDestination => std::option::Option::Some(82),
12512 Self::PrivateNatToPscEndpointUnsupported => std::option::Option::Some(83),
12513 Self::PscPortMappingPortMismatch => std::option::Option::Some(86),
12514 Self::PscPortMappingWithoutPscConnectionUnsupported => {
12515 std::option::Option::Some(87)
12516 }
12517 Self::UnsupportedRouteMatchedForNat64Destination => std::option::Option::Some(88),
12518 Self::TrafficFromHybridEndpointToInternetDisallowed => {
12519 std::option::Option::Some(89)
12520 }
12521 Self::NoMatchingNat64Gateway => std::option::Option::Some(90),
12522 Self::NoConfiguredPrivateNat64Rule => std::option::Option::Some(107),
12523 Self::LoadBalancerBackendIpVersionMismatch => std::option::Option::Some(96),
12524 Self::NoKnownRouteFromNccNetworkToDestination => std::option::Option::Some(97),
12525 Self::CloudNatProtocolUnsupported => std::option::Option::Some(99),
12526 Self::L2InterconnectUnsupportedProtocol => std::option::Option::Some(100),
12527 Self::L2InterconnectUnsupportedPort => std::option::Option::Some(101),
12528 Self::L2InterconnectDestinationIpMismatch => std::option::Option::Some(102),
12529 Self::NccRouteWithinHybridSubnetUnsupported => std::option::Option::Some(104),
12530 Self::HybridSubnetRegionMismatch => std::option::Option::Some(105),
12531 Self::HybridSubnetNoRoute => std::option::Option::Some(106),
12532 Self::UnknownValue(u) => u.0.value(),
12533 }
12534 }
12535
12536 /// Gets the enum value as a string.
12537 ///
12538 /// Returns `None` if the enum contains an unknown value deserialized from
12539 /// the integer representation of enums.
12540 pub fn name(&self) -> std::option::Option<&str> {
12541 match self {
12542 Self::Unspecified => std::option::Option::Some("CAUSE_UNSPECIFIED"),
12543 Self::UnknownExternalAddress => {
12544 std::option::Option::Some("UNKNOWN_EXTERNAL_ADDRESS")
12545 }
12546 Self::ForeignIpDisallowed => std::option::Option::Some("FOREIGN_IP_DISALLOWED"),
12547 Self::FirewallRule => std::option::Option::Some("FIREWALL_RULE"),
12548 Self::NoRoute => std::option::Option::Some("NO_ROUTE"),
12549 Self::RouteBlackhole => std::option::Option::Some("ROUTE_BLACKHOLE"),
12550 Self::RouteWrongNetwork => std::option::Option::Some("ROUTE_WRONG_NETWORK"),
12551 Self::RouteNextHopIpAddressNotResolved => {
12552 std::option::Option::Some("ROUTE_NEXT_HOP_IP_ADDRESS_NOT_RESOLVED")
12553 }
12554 Self::RouteNextHopResourceNotFound => {
12555 std::option::Option::Some("ROUTE_NEXT_HOP_RESOURCE_NOT_FOUND")
12556 }
12557 Self::RouteNextHopInstanceWrongNetwork => {
12558 std::option::Option::Some("ROUTE_NEXT_HOP_INSTANCE_WRONG_NETWORK")
12559 }
12560 Self::RouteNextHopInstanceNonPrimaryIp => {
12561 std::option::Option::Some("ROUTE_NEXT_HOP_INSTANCE_NON_PRIMARY_IP")
12562 }
12563 Self::RouteNextHopForwardingRuleIpMismatch => {
12564 std::option::Option::Some("ROUTE_NEXT_HOP_FORWARDING_RULE_IP_MISMATCH")
12565 }
12566 Self::RouteNextHopVpnTunnelNotEstablished => {
12567 std::option::Option::Some("ROUTE_NEXT_HOP_VPN_TUNNEL_NOT_ESTABLISHED")
12568 }
12569 Self::RouteNextHopForwardingRuleTypeInvalid => {
12570 std::option::Option::Some("ROUTE_NEXT_HOP_FORWARDING_RULE_TYPE_INVALID")
12571 }
12572 Self::NoRouteFromInternetToPrivateIpv6Address => {
12573 std::option::Option::Some("NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV6_ADDRESS")
12574 }
12575 Self::NoRouteFromInternetToPrivateIpv4Address => {
12576 std::option::Option::Some("NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV4_ADDRESS")
12577 }
12578 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
12579 std::option::Option::Some(
12580 "NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS",
12581 )
12582 }
12583 Self::VpnTunnelLocalSelectorMismatch => {
12584 std::option::Option::Some("VPN_TUNNEL_LOCAL_SELECTOR_MISMATCH")
12585 }
12586 Self::VpnTunnelRemoteSelectorMismatch => {
12587 std::option::Option::Some("VPN_TUNNEL_REMOTE_SELECTOR_MISMATCH")
12588 }
12589 Self::PrivateTrafficToInternet => {
12590 std::option::Option::Some("PRIVATE_TRAFFIC_TO_INTERNET")
12591 }
12592 Self::PrivateGoogleAccessDisallowed => {
12593 std::option::Option::Some("PRIVATE_GOOGLE_ACCESS_DISALLOWED")
12594 }
12595 Self::PrivateGoogleAccessViaVpnTunnelUnsupported => {
12596 std::option::Option::Some("PRIVATE_GOOGLE_ACCESS_VIA_VPN_TUNNEL_UNSUPPORTED")
12597 }
12598 Self::NoExternalAddress => std::option::Option::Some("NO_EXTERNAL_ADDRESS"),
12599 Self::UnknownInternalAddress => {
12600 std::option::Option::Some("UNKNOWN_INTERNAL_ADDRESS")
12601 }
12602 Self::ForwardingRuleMismatch => {
12603 std::option::Option::Some("FORWARDING_RULE_MISMATCH")
12604 }
12605 Self::ForwardingRuleNoInstances => {
12606 std::option::Option::Some("FORWARDING_RULE_NO_INSTANCES")
12607 }
12608 Self::FirewallBlockingLoadBalancerBackendHealthCheck => std::option::Option::Some(
12609 "FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK",
12610 ),
12611 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => std::option::Option::Some(
12612 "INGRESS_FIREWALL_TAGS_UNSUPPORTED_BY_DIRECT_VPC_EGRESS",
12613 ),
12614 Self::InstanceNotRunning => std::option::Option::Some("INSTANCE_NOT_RUNNING"),
12615 Self::GkeClusterNotRunning => std::option::Option::Some("GKE_CLUSTER_NOT_RUNNING"),
12616 Self::GkePodNotRunning => std::option::Option::Some("GKE_POD_NOT_RUNNING"),
12617 Self::CloudSqlInstanceNotRunning => {
12618 std::option::Option::Some("CLOUD_SQL_INSTANCE_NOT_RUNNING")
12619 }
12620 Self::RedisInstanceNotRunning => {
12621 std::option::Option::Some("REDIS_INSTANCE_NOT_RUNNING")
12622 }
12623 Self::RedisClusterNotRunning => {
12624 std::option::Option::Some("REDIS_CLUSTER_NOT_RUNNING")
12625 }
12626 Self::TrafficTypeBlocked => std::option::Option::Some("TRAFFIC_TYPE_BLOCKED"),
12627 Self::GkeMasterUnauthorizedAccess => {
12628 std::option::Option::Some("GKE_MASTER_UNAUTHORIZED_ACCESS")
12629 }
12630 Self::CloudSqlInstanceUnauthorizedAccess => {
12631 std::option::Option::Some("CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS")
12632 }
12633 Self::DroppedInsideGkeService => {
12634 std::option::Option::Some("DROPPED_INSIDE_GKE_SERVICE")
12635 }
12636 Self::DroppedInsideCloudSqlService => {
12637 std::option::Option::Some("DROPPED_INSIDE_CLOUD_SQL_SERVICE")
12638 }
12639 Self::GoogleManagedServiceNoPeering => {
12640 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_NO_PEERING")
12641 }
12642 Self::GoogleManagedServiceNoPscEndpoint => {
12643 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_NO_PSC_ENDPOINT")
12644 }
12645 Self::GkePscEndpointMissing => {
12646 std::option::Option::Some("GKE_PSC_ENDPOINT_MISSING")
12647 }
12648 Self::CloudSqlInstanceNoIpAddress => {
12649 std::option::Option::Some("CLOUD_SQL_INSTANCE_NO_IP_ADDRESS")
12650 }
12651 Self::GkeControlPlaneRegionMismatch => {
12652 std::option::Option::Some("GKE_CONTROL_PLANE_REGION_MISMATCH")
12653 }
12654 Self::PublicGkeControlPlaneToPrivateDestination => {
12655 std::option::Option::Some("PUBLIC_GKE_CONTROL_PLANE_TO_PRIVATE_DESTINATION")
12656 }
12657 Self::GkeControlPlaneNoRoute => {
12658 std::option::Option::Some("GKE_CONTROL_PLANE_NO_ROUTE")
12659 }
12660 Self::CloudSqlInstanceNotConfiguredForExternalTraffic => std::option::Option::Some(
12661 "CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC",
12662 ),
12663 Self::PublicCloudSqlInstanceToPrivateDestination => {
12664 std::option::Option::Some("PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION")
12665 }
12666 Self::CloudSqlInstanceNoRoute => {
12667 std::option::Option::Some("CLOUD_SQL_INSTANCE_NO_ROUTE")
12668 }
12669 Self::CloudSqlConnectorRequired => {
12670 std::option::Option::Some("CLOUD_SQL_CONNECTOR_REQUIRED")
12671 }
12672 Self::CloudFunctionNotActive => {
12673 std::option::Option::Some("CLOUD_FUNCTION_NOT_ACTIVE")
12674 }
12675 Self::VpcConnectorNotSet => std::option::Option::Some("VPC_CONNECTOR_NOT_SET"),
12676 Self::VpcConnectorNotRunning => {
12677 std::option::Option::Some("VPC_CONNECTOR_NOT_RUNNING")
12678 }
12679 Self::VpcConnectorServerlessTrafficBlocked => {
12680 std::option::Option::Some("VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED")
12681 }
12682 Self::VpcConnectorHealthCheckTrafficBlocked => {
12683 std::option::Option::Some("VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED")
12684 }
12685 Self::ForwardingRuleRegionMismatch => {
12686 std::option::Option::Some("FORWARDING_RULE_REGION_MISMATCH")
12687 }
12688 Self::PscConnectionNotAccepted => {
12689 std::option::Option::Some("PSC_CONNECTION_NOT_ACCEPTED")
12690 }
12691 Self::PscEndpointAccessedFromPeeredNetwork => {
12692 std::option::Option::Some("PSC_ENDPOINT_ACCESSED_FROM_PEERED_NETWORK")
12693 }
12694 Self::PscNegProducerEndpointNoGlobalAccess => {
12695 std::option::Option::Some("PSC_NEG_PRODUCER_ENDPOINT_NO_GLOBAL_ACCESS")
12696 }
12697 Self::PscNegProducerForwardingRuleMultiplePorts => {
12698 std::option::Option::Some("PSC_NEG_PRODUCER_FORWARDING_RULE_MULTIPLE_PORTS")
12699 }
12700 Self::CloudSqlPscNegUnsupported => {
12701 std::option::Option::Some("CLOUD_SQL_PSC_NEG_UNSUPPORTED")
12702 }
12703 Self::NoNatSubnetsForPscServiceAttachment => {
12704 std::option::Option::Some("NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT")
12705 }
12706 Self::PscTransitivityNotPropagated => {
12707 std::option::Option::Some("PSC_TRANSITIVITY_NOT_PROPAGATED")
12708 }
12709 Self::HybridNegNonDynamicRouteMatched => {
12710 std::option::Option::Some("HYBRID_NEG_NON_DYNAMIC_ROUTE_MATCHED")
12711 }
12712 Self::HybridNegNonLocalDynamicRouteMatched => {
12713 std::option::Option::Some("HYBRID_NEG_NON_LOCAL_DYNAMIC_ROUTE_MATCHED")
12714 }
12715 Self::CloudRunRevisionNotReady => {
12716 std::option::Option::Some("CLOUD_RUN_REVISION_NOT_READY")
12717 }
12718 Self::DroppedInsidePscServiceProducer => {
12719 std::option::Option::Some("DROPPED_INSIDE_PSC_SERVICE_PRODUCER")
12720 }
12721 Self::LoadBalancerHasNoProxySubnet => {
12722 std::option::Option::Some("LOAD_BALANCER_HAS_NO_PROXY_SUBNET")
12723 }
12724 Self::CloudNatNoAddresses => std::option::Option::Some("CLOUD_NAT_NO_ADDRESSES"),
12725 Self::RoutingLoop => std::option::Option::Some("ROUTING_LOOP"),
12726 Self::DroppedInsideGoogleManagedService => {
12727 std::option::Option::Some("DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE")
12728 }
12729 Self::LoadBalancerBackendInvalidNetwork => {
12730 std::option::Option::Some("LOAD_BALANCER_BACKEND_INVALID_NETWORK")
12731 }
12732 Self::BackendServiceNamedPortNotDefined => {
12733 std::option::Option::Some("BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED")
12734 }
12735 Self::DestinationIsPrivateNatIpRange => {
12736 std::option::Option::Some("DESTINATION_IS_PRIVATE_NAT_IP_RANGE")
12737 }
12738 Self::DroppedInsideRedisInstanceService => {
12739 std::option::Option::Some("DROPPED_INSIDE_REDIS_INSTANCE_SERVICE")
12740 }
12741 Self::RedisInstanceUnsupportedPort => {
12742 std::option::Option::Some("REDIS_INSTANCE_UNSUPPORTED_PORT")
12743 }
12744 Self::RedisInstanceConnectingFromPupiAddress => {
12745 std::option::Option::Some("REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS")
12746 }
12747 Self::RedisInstanceNoRouteToDestinationNetwork => {
12748 std::option::Option::Some("REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK")
12749 }
12750 Self::RedisInstanceNoExternalIp => {
12751 std::option::Option::Some("REDIS_INSTANCE_NO_EXTERNAL_IP")
12752 }
12753 Self::RedisInstanceUnsupportedProtocol => {
12754 std::option::Option::Some("REDIS_INSTANCE_UNSUPPORTED_PROTOCOL")
12755 }
12756 Self::DroppedInsideRedisClusterService => {
12757 std::option::Option::Some("DROPPED_INSIDE_REDIS_CLUSTER_SERVICE")
12758 }
12759 Self::RedisClusterUnsupportedPort => {
12760 std::option::Option::Some("REDIS_CLUSTER_UNSUPPORTED_PORT")
12761 }
12762 Self::RedisClusterNoExternalIp => {
12763 std::option::Option::Some("REDIS_CLUSTER_NO_EXTERNAL_IP")
12764 }
12765 Self::RedisClusterUnsupportedProtocol => {
12766 std::option::Option::Some("REDIS_CLUSTER_UNSUPPORTED_PROTOCOL")
12767 }
12768 Self::NoAdvertisedRouteToGcpDestination => {
12769 std::option::Option::Some("NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION")
12770 }
12771 Self::NoTrafficSelectorToGcpDestination => {
12772 std::option::Option::Some("NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION")
12773 }
12774 Self::NoKnownRouteFromPeeredNetworkToDestination => {
12775 std::option::Option::Some("NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION")
12776 }
12777 Self::PrivateNatToPscEndpointUnsupported => {
12778 std::option::Option::Some("PRIVATE_NAT_TO_PSC_ENDPOINT_UNSUPPORTED")
12779 }
12780 Self::PscPortMappingPortMismatch => {
12781 std::option::Option::Some("PSC_PORT_MAPPING_PORT_MISMATCH")
12782 }
12783 Self::PscPortMappingWithoutPscConnectionUnsupported => {
12784 std::option::Option::Some("PSC_PORT_MAPPING_WITHOUT_PSC_CONNECTION_UNSUPPORTED")
12785 }
12786 Self::UnsupportedRouteMatchedForNat64Destination => {
12787 std::option::Option::Some("UNSUPPORTED_ROUTE_MATCHED_FOR_NAT64_DESTINATION")
12788 }
12789 Self::TrafficFromHybridEndpointToInternetDisallowed => {
12790 std::option::Option::Some("TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED")
12791 }
12792 Self::NoMatchingNat64Gateway => {
12793 std::option::Option::Some("NO_MATCHING_NAT64_GATEWAY")
12794 }
12795 Self::NoConfiguredPrivateNat64Rule => {
12796 std::option::Option::Some("NO_CONFIGURED_PRIVATE_NAT64_RULE")
12797 }
12798 Self::LoadBalancerBackendIpVersionMismatch => {
12799 std::option::Option::Some("LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH")
12800 }
12801 Self::NoKnownRouteFromNccNetworkToDestination => {
12802 std::option::Option::Some("NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION")
12803 }
12804 Self::CloudNatProtocolUnsupported => {
12805 std::option::Option::Some("CLOUD_NAT_PROTOCOL_UNSUPPORTED")
12806 }
12807 Self::L2InterconnectUnsupportedProtocol => {
12808 std::option::Option::Some("L2_INTERCONNECT_UNSUPPORTED_PROTOCOL")
12809 }
12810 Self::L2InterconnectUnsupportedPort => {
12811 std::option::Option::Some("L2_INTERCONNECT_UNSUPPORTED_PORT")
12812 }
12813 Self::L2InterconnectDestinationIpMismatch => {
12814 std::option::Option::Some("L2_INTERCONNECT_DESTINATION_IP_MISMATCH")
12815 }
12816 Self::NccRouteWithinHybridSubnetUnsupported => {
12817 std::option::Option::Some("NCC_ROUTE_WITHIN_HYBRID_SUBNET_UNSUPPORTED")
12818 }
12819 Self::HybridSubnetRegionMismatch => {
12820 std::option::Option::Some("HYBRID_SUBNET_REGION_MISMATCH")
12821 }
12822 Self::HybridSubnetNoRoute => std::option::Option::Some("HYBRID_SUBNET_NO_ROUTE"),
12823 Self::UnknownValue(u) => u.0.name(),
12824 }
12825 }
12826 }
12827
12828 impl std::default::Default for Cause {
12829 fn default() -> Self {
12830 use std::convert::From;
12831 Self::from(0)
12832 }
12833 }
12834
12835 impl std::fmt::Display for Cause {
12836 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12837 wkt::internal::display_enum(f, self.name(), self.value())
12838 }
12839 }
12840
12841 impl std::convert::From<i32> for Cause {
12842 fn from(value: i32) -> Self {
12843 match value {
12844 0 => Self::Unspecified,
12845 1 => Self::UnknownExternalAddress,
12846 2 => Self::ForeignIpDisallowed,
12847 3 => Self::FirewallRule,
12848 4 => Self::NoRoute,
12849 5 => Self::RouteBlackhole,
12850 6 => Self::RouteWrongNetwork,
12851 7 => Self::PrivateTrafficToInternet,
12852 8 => Self::PrivateGoogleAccessDisallowed,
12853 9 => Self::NoExternalAddress,
12854 10 => Self::UnknownInternalAddress,
12855 11 => Self::ForwardingRuleMismatch,
12856 12 => Self::ForwardingRuleNoInstances,
12857 13 => Self::FirewallBlockingLoadBalancerBackendHealthCheck,
12858 14 => Self::InstanceNotRunning,
12859 15 => Self::TrafficTypeBlocked,
12860 16 => Self::GkeMasterUnauthorizedAccess,
12861 17 => Self::CloudSqlInstanceUnauthorizedAccess,
12862 18 => Self::DroppedInsideGkeService,
12863 19 => Self::DroppedInsideCloudSqlService,
12864 20 => Self::GoogleManagedServiceNoPeering,
12865 21 => Self::CloudSqlInstanceNoIpAddress,
12866 22 => Self::CloudFunctionNotActive,
12867 23 => Self::VpcConnectorNotSet,
12868 24 => Self::VpcConnectorNotRunning,
12869 25 => Self::ForwardingRuleRegionMismatch,
12870 26 => Self::PscConnectionNotAccepted,
12871 27 => Self::GkeClusterNotRunning,
12872 28 => Self::CloudSqlInstanceNotRunning,
12873 29 => Self::CloudRunRevisionNotReady,
12874 30 => Self::GkeControlPlaneRegionMismatch,
12875 31 => Self::PublicGkeControlPlaneToPrivateDestination,
12876 32 => Self::GkeControlPlaneNoRoute,
12877 33 => Self::CloudSqlInstanceNotConfiguredForExternalTraffic,
12878 34 => Self::PublicCloudSqlInstanceToPrivateDestination,
12879 35 => Self::CloudSqlInstanceNoRoute,
12880 36 => Self::GkePscEndpointMissing,
12881 37 => Self::DroppedInsidePscServiceProducer,
12882 38 => Self::GoogleManagedServiceNoPscEndpoint,
12883 39 => Self::LoadBalancerHasNoProxySubnet,
12884 40 => Self::CloudNatNoAddresses,
12885 41 => Self::PscEndpointAccessedFromPeeredNetwork,
12886 42 => Self::RouteNextHopIpAddressNotResolved,
12887 43 => Self::RouteNextHopResourceNotFound,
12888 44 => Self::NoRouteFromInternetToPrivateIpv6Address,
12889 45 => Self::VpnTunnelLocalSelectorMismatch,
12890 46 => Self::VpnTunnelRemoteSelectorMismatch,
12891 47 => Self::PrivateGoogleAccessViaVpnTunnelUnsupported,
12892 48 => Self::PscNegProducerEndpointNoGlobalAccess,
12893 49 => Self::RouteNextHopInstanceWrongNetwork,
12894 50 => Self::RouteNextHopInstanceNonPrimaryIp,
12895 51 => Self::RouteNextHopForwardingRuleIpMismatch,
12896 52 => Self::RouteNextHopVpnTunnelNotEstablished,
12897 53 => Self::RouteNextHopForwardingRuleTypeInvalid,
12898 54 => Self::PscNegProducerForwardingRuleMultiplePorts,
12899 55 => Self::HybridNegNonDynamicRouteMatched,
12900 56 => Self::HybridNegNonLocalDynamicRouteMatched,
12901 57 => Self::NoNatSubnetsForPscServiceAttachment,
12902 58 => Self::CloudSqlPscNegUnsupported,
12903 59 => Self::RoutingLoop,
12904 60 => Self::VpcConnectorServerlessTrafficBlocked,
12905 61 => Self::VpcConnectorHealthCheckTrafficBlocked,
12906 62 => Self::DroppedInsideGoogleManagedService,
12907 63 => Self::CloudSqlConnectorRequired,
12908 64 => Self::PscTransitivityNotPropagated,
12909 65 => Self::LoadBalancerBackendInvalidNetwork,
12910 66 => Self::BackendServiceNamedPortNotDefined,
12911 67 => Self::DestinationIsPrivateNatIpRange,
12912 68 => Self::RedisInstanceNotRunning,
12913 69 => Self::RedisClusterNotRunning,
12914 70 => Self::DroppedInsideRedisInstanceService,
12915 71 => Self::RedisInstanceUnsupportedPort,
12916 72 => Self::RedisInstanceConnectingFromPupiAddress,
12917 73 => Self::RedisInstanceNoRouteToDestinationNetwork,
12918 74 => Self::RedisInstanceNoExternalIp,
12919 75 => Self::DroppedInsideRedisClusterService,
12920 76 => Self::RedisClusterUnsupportedPort,
12921 77 => Self::RedisClusterNoExternalIp,
12922 78 => Self::RedisInstanceUnsupportedProtocol,
12923 79 => Self::RedisClusterUnsupportedProtocol,
12924 80 => Self::NoAdvertisedRouteToGcpDestination,
12925 81 => Self::NoTrafficSelectorToGcpDestination,
12926 82 => Self::NoKnownRouteFromPeeredNetworkToDestination,
12927 83 => Self::PrivateNatToPscEndpointUnsupported,
12928 85 => Self::IngressFirewallTagsUnsupportedByDirectVpcEgress,
12929 86 => Self::PscPortMappingPortMismatch,
12930 87 => Self::PscPortMappingWithoutPscConnectionUnsupported,
12931 88 => Self::UnsupportedRouteMatchedForNat64Destination,
12932 89 => Self::TrafficFromHybridEndpointToInternetDisallowed,
12933 90 => Self::NoMatchingNat64Gateway,
12934 96 => Self::LoadBalancerBackendIpVersionMismatch,
12935 97 => Self::NoKnownRouteFromNccNetworkToDestination,
12936 98 => Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address,
12937 99 => Self::CloudNatProtocolUnsupported,
12938 100 => Self::L2InterconnectUnsupportedProtocol,
12939 101 => Self::L2InterconnectUnsupportedPort,
12940 102 => Self::L2InterconnectDestinationIpMismatch,
12941 103 => Self::GkePodNotRunning,
12942 104 => Self::NccRouteWithinHybridSubnetUnsupported,
12943 105 => Self::HybridSubnetRegionMismatch,
12944 106 => Self::HybridSubnetNoRoute,
12945 107 => Self::NoConfiguredPrivateNat64Rule,
12946 109 => Self::NoRouteFromInternetToPrivateIpv4Address,
12947 _ => Self::UnknownValue(cause::UnknownValue(
12948 wkt::internal::UnknownEnumValue::Integer(value),
12949 )),
12950 }
12951 }
12952 }
12953
12954 impl std::convert::From<&str> for Cause {
12955 fn from(value: &str) -> Self {
12956 use std::string::ToString;
12957 match value {
12958 "CAUSE_UNSPECIFIED" => Self::Unspecified,
12959 "UNKNOWN_EXTERNAL_ADDRESS" => Self::UnknownExternalAddress,
12960 "FOREIGN_IP_DISALLOWED" => Self::ForeignIpDisallowed,
12961 "FIREWALL_RULE" => Self::FirewallRule,
12962 "NO_ROUTE" => Self::NoRoute,
12963 "ROUTE_BLACKHOLE" => Self::RouteBlackhole,
12964 "ROUTE_WRONG_NETWORK" => Self::RouteWrongNetwork,
12965 "ROUTE_NEXT_HOP_IP_ADDRESS_NOT_RESOLVED" => Self::RouteNextHopIpAddressNotResolved,
12966 "ROUTE_NEXT_HOP_RESOURCE_NOT_FOUND" => Self::RouteNextHopResourceNotFound,
12967 "ROUTE_NEXT_HOP_INSTANCE_WRONG_NETWORK" => Self::RouteNextHopInstanceWrongNetwork,
12968 "ROUTE_NEXT_HOP_INSTANCE_NON_PRIMARY_IP" => Self::RouteNextHopInstanceNonPrimaryIp,
12969 "ROUTE_NEXT_HOP_FORWARDING_RULE_IP_MISMATCH" => {
12970 Self::RouteNextHopForwardingRuleIpMismatch
12971 }
12972 "ROUTE_NEXT_HOP_VPN_TUNNEL_NOT_ESTABLISHED" => {
12973 Self::RouteNextHopVpnTunnelNotEstablished
12974 }
12975 "ROUTE_NEXT_HOP_FORWARDING_RULE_TYPE_INVALID" => {
12976 Self::RouteNextHopForwardingRuleTypeInvalid
12977 }
12978 "NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV6_ADDRESS" => {
12979 Self::NoRouteFromInternetToPrivateIpv6Address
12980 }
12981 "NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV4_ADDRESS" => {
12982 Self::NoRouteFromInternetToPrivateIpv4Address
12983 }
12984 "NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS" => {
12985 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address
12986 }
12987 "VPN_TUNNEL_LOCAL_SELECTOR_MISMATCH" => Self::VpnTunnelLocalSelectorMismatch,
12988 "VPN_TUNNEL_REMOTE_SELECTOR_MISMATCH" => Self::VpnTunnelRemoteSelectorMismatch,
12989 "PRIVATE_TRAFFIC_TO_INTERNET" => Self::PrivateTrafficToInternet,
12990 "PRIVATE_GOOGLE_ACCESS_DISALLOWED" => Self::PrivateGoogleAccessDisallowed,
12991 "PRIVATE_GOOGLE_ACCESS_VIA_VPN_TUNNEL_UNSUPPORTED" => {
12992 Self::PrivateGoogleAccessViaVpnTunnelUnsupported
12993 }
12994 "NO_EXTERNAL_ADDRESS" => Self::NoExternalAddress,
12995 "UNKNOWN_INTERNAL_ADDRESS" => Self::UnknownInternalAddress,
12996 "FORWARDING_RULE_MISMATCH" => Self::ForwardingRuleMismatch,
12997 "FORWARDING_RULE_NO_INSTANCES" => Self::ForwardingRuleNoInstances,
12998 "FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK" => {
12999 Self::FirewallBlockingLoadBalancerBackendHealthCheck
13000 }
13001 "INGRESS_FIREWALL_TAGS_UNSUPPORTED_BY_DIRECT_VPC_EGRESS" => {
13002 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress
13003 }
13004 "INSTANCE_NOT_RUNNING" => Self::InstanceNotRunning,
13005 "GKE_CLUSTER_NOT_RUNNING" => Self::GkeClusterNotRunning,
13006 "GKE_POD_NOT_RUNNING" => Self::GkePodNotRunning,
13007 "CLOUD_SQL_INSTANCE_NOT_RUNNING" => Self::CloudSqlInstanceNotRunning,
13008 "REDIS_INSTANCE_NOT_RUNNING" => Self::RedisInstanceNotRunning,
13009 "REDIS_CLUSTER_NOT_RUNNING" => Self::RedisClusterNotRunning,
13010 "TRAFFIC_TYPE_BLOCKED" => Self::TrafficTypeBlocked,
13011 "GKE_MASTER_UNAUTHORIZED_ACCESS" => Self::GkeMasterUnauthorizedAccess,
13012 "CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS" => {
13013 Self::CloudSqlInstanceUnauthorizedAccess
13014 }
13015 "DROPPED_INSIDE_GKE_SERVICE" => Self::DroppedInsideGkeService,
13016 "DROPPED_INSIDE_CLOUD_SQL_SERVICE" => Self::DroppedInsideCloudSqlService,
13017 "GOOGLE_MANAGED_SERVICE_NO_PEERING" => Self::GoogleManagedServiceNoPeering,
13018 "GOOGLE_MANAGED_SERVICE_NO_PSC_ENDPOINT" => Self::GoogleManagedServiceNoPscEndpoint,
13019 "GKE_PSC_ENDPOINT_MISSING" => Self::GkePscEndpointMissing,
13020 "CLOUD_SQL_INSTANCE_NO_IP_ADDRESS" => Self::CloudSqlInstanceNoIpAddress,
13021 "GKE_CONTROL_PLANE_REGION_MISMATCH" => Self::GkeControlPlaneRegionMismatch,
13022 "PUBLIC_GKE_CONTROL_PLANE_TO_PRIVATE_DESTINATION" => {
13023 Self::PublicGkeControlPlaneToPrivateDestination
13024 }
13025 "GKE_CONTROL_PLANE_NO_ROUTE" => Self::GkeControlPlaneNoRoute,
13026 "CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC" => {
13027 Self::CloudSqlInstanceNotConfiguredForExternalTraffic
13028 }
13029 "PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION" => {
13030 Self::PublicCloudSqlInstanceToPrivateDestination
13031 }
13032 "CLOUD_SQL_INSTANCE_NO_ROUTE" => Self::CloudSqlInstanceNoRoute,
13033 "CLOUD_SQL_CONNECTOR_REQUIRED" => Self::CloudSqlConnectorRequired,
13034 "CLOUD_FUNCTION_NOT_ACTIVE" => Self::CloudFunctionNotActive,
13035 "VPC_CONNECTOR_NOT_SET" => Self::VpcConnectorNotSet,
13036 "VPC_CONNECTOR_NOT_RUNNING" => Self::VpcConnectorNotRunning,
13037 "VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED" => {
13038 Self::VpcConnectorServerlessTrafficBlocked
13039 }
13040 "VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED" => {
13041 Self::VpcConnectorHealthCheckTrafficBlocked
13042 }
13043 "FORWARDING_RULE_REGION_MISMATCH" => Self::ForwardingRuleRegionMismatch,
13044 "PSC_CONNECTION_NOT_ACCEPTED" => Self::PscConnectionNotAccepted,
13045 "PSC_ENDPOINT_ACCESSED_FROM_PEERED_NETWORK" => {
13046 Self::PscEndpointAccessedFromPeeredNetwork
13047 }
13048 "PSC_NEG_PRODUCER_ENDPOINT_NO_GLOBAL_ACCESS" => {
13049 Self::PscNegProducerEndpointNoGlobalAccess
13050 }
13051 "PSC_NEG_PRODUCER_FORWARDING_RULE_MULTIPLE_PORTS" => {
13052 Self::PscNegProducerForwardingRuleMultiplePorts
13053 }
13054 "CLOUD_SQL_PSC_NEG_UNSUPPORTED" => Self::CloudSqlPscNegUnsupported,
13055 "NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT" => {
13056 Self::NoNatSubnetsForPscServiceAttachment
13057 }
13058 "PSC_TRANSITIVITY_NOT_PROPAGATED" => Self::PscTransitivityNotPropagated,
13059 "HYBRID_NEG_NON_DYNAMIC_ROUTE_MATCHED" => Self::HybridNegNonDynamicRouteMatched,
13060 "HYBRID_NEG_NON_LOCAL_DYNAMIC_ROUTE_MATCHED" => {
13061 Self::HybridNegNonLocalDynamicRouteMatched
13062 }
13063 "CLOUD_RUN_REVISION_NOT_READY" => Self::CloudRunRevisionNotReady,
13064 "DROPPED_INSIDE_PSC_SERVICE_PRODUCER" => Self::DroppedInsidePscServiceProducer,
13065 "LOAD_BALANCER_HAS_NO_PROXY_SUBNET" => Self::LoadBalancerHasNoProxySubnet,
13066 "CLOUD_NAT_NO_ADDRESSES" => Self::CloudNatNoAddresses,
13067 "ROUTING_LOOP" => Self::RoutingLoop,
13068 "DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE" => Self::DroppedInsideGoogleManagedService,
13069 "LOAD_BALANCER_BACKEND_INVALID_NETWORK" => Self::LoadBalancerBackendInvalidNetwork,
13070 "BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED" => Self::BackendServiceNamedPortNotDefined,
13071 "DESTINATION_IS_PRIVATE_NAT_IP_RANGE" => Self::DestinationIsPrivateNatIpRange,
13072 "DROPPED_INSIDE_REDIS_INSTANCE_SERVICE" => Self::DroppedInsideRedisInstanceService,
13073 "REDIS_INSTANCE_UNSUPPORTED_PORT" => Self::RedisInstanceUnsupportedPort,
13074 "REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS" => {
13075 Self::RedisInstanceConnectingFromPupiAddress
13076 }
13077 "REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK" => {
13078 Self::RedisInstanceNoRouteToDestinationNetwork
13079 }
13080 "REDIS_INSTANCE_NO_EXTERNAL_IP" => Self::RedisInstanceNoExternalIp,
13081 "REDIS_INSTANCE_UNSUPPORTED_PROTOCOL" => Self::RedisInstanceUnsupportedProtocol,
13082 "DROPPED_INSIDE_REDIS_CLUSTER_SERVICE" => Self::DroppedInsideRedisClusterService,
13083 "REDIS_CLUSTER_UNSUPPORTED_PORT" => Self::RedisClusterUnsupportedPort,
13084 "REDIS_CLUSTER_NO_EXTERNAL_IP" => Self::RedisClusterNoExternalIp,
13085 "REDIS_CLUSTER_UNSUPPORTED_PROTOCOL" => Self::RedisClusterUnsupportedProtocol,
13086 "NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION" => Self::NoAdvertisedRouteToGcpDestination,
13087 "NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION" => Self::NoTrafficSelectorToGcpDestination,
13088 "NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION" => {
13089 Self::NoKnownRouteFromPeeredNetworkToDestination
13090 }
13091 "PRIVATE_NAT_TO_PSC_ENDPOINT_UNSUPPORTED" => {
13092 Self::PrivateNatToPscEndpointUnsupported
13093 }
13094 "PSC_PORT_MAPPING_PORT_MISMATCH" => Self::PscPortMappingPortMismatch,
13095 "PSC_PORT_MAPPING_WITHOUT_PSC_CONNECTION_UNSUPPORTED" => {
13096 Self::PscPortMappingWithoutPscConnectionUnsupported
13097 }
13098 "UNSUPPORTED_ROUTE_MATCHED_FOR_NAT64_DESTINATION" => {
13099 Self::UnsupportedRouteMatchedForNat64Destination
13100 }
13101 "TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED" => {
13102 Self::TrafficFromHybridEndpointToInternetDisallowed
13103 }
13104 "NO_MATCHING_NAT64_GATEWAY" => Self::NoMatchingNat64Gateway,
13105 "NO_CONFIGURED_PRIVATE_NAT64_RULE" => Self::NoConfiguredPrivateNat64Rule,
13106 "LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH" => {
13107 Self::LoadBalancerBackendIpVersionMismatch
13108 }
13109 "NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION" => {
13110 Self::NoKnownRouteFromNccNetworkToDestination
13111 }
13112 "CLOUD_NAT_PROTOCOL_UNSUPPORTED" => Self::CloudNatProtocolUnsupported,
13113 "L2_INTERCONNECT_UNSUPPORTED_PROTOCOL" => Self::L2InterconnectUnsupportedProtocol,
13114 "L2_INTERCONNECT_UNSUPPORTED_PORT" => Self::L2InterconnectUnsupportedPort,
13115 "L2_INTERCONNECT_DESTINATION_IP_MISMATCH" => {
13116 Self::L2InterconnectDestinationIpMismatch
13117 }
13118 "NCC_ROUTE_WITHIN_HYBRID_SUBNET_UNSUPPORTED" => {
13119 Self::NccRouteWithinHybridSubnetUnsupported
13120 }
13121 "HYBRID_SUBNET_REGION_MISMATCH" => Self::HybridSubnetRegionMismatch,
13122 "HYBRID_SUBNET_NO_ROUTE" => Self::HybridSubnetNoRoute,
13123 _ => Self::UnknownValue(cause::UnknownValue(
13124 wkt::internal::UnknownEnumValue::String(value.to_string()),
13125 )),
13126 }
13127 }
13128 }
13129
13130 impl serde::ser::Serialize for Cause {
13131 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13132 where
13133 S: serde::Serializer,
13134 {
13135 match self {
13136 Self::Unspecified => serializer.serialize_i32(0),
13137 Self::UnknownExternalAddress => serializer.serialize_i32(1),
13138 Self::ForeignIpDisallowed => serializer.serialize_i32(2),
13139 Self::FirewallRule => serializer.serialize_i32(3),
13140 Self::NoRoute => serializer.serialize_i32(4),
13141 Self::RouteBlackhole => serializer.serialize_i32(5),
13142 Self::RouteWrongNetwork => serializer.serialize_i32(6),
13143 Self::RouteNextHopIpAddressNotResolved => serializer.serialize_i32(42),
13144 Self::RouteNextHopResourceNotFound => serializer.serialize_i32(43),
13145 Self::RouteNextHopInstanceWrongNetwork => serializer.serialize_i32(49),
13146 Self::RouteNextHopInstanceNonPrimaryIp => serializer.serialize_i32(50),
13147 Self::RouteNextHopForwardingRuleIpMismatch => serializer.serialize_i32(51),
13148 Self::RouteNextHopVpnTunnelNotEstablished => serializer.serialize_i32(52),
13149 Self::RouteNextHopForwardingRuleTypeInvalid => serializer.serialize_i32(53),
13150 Self::NoRouteFromInternetToPrivateIpv6Address => serializer.serialize_i32(44),
13151 Self::NoRouteFromInternetToPrivateIpv4Address => serializer.serialize_i32(109),
13152 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
13153 serializer.serialize_i32(98)
13154 }
13155 Self::VpnTunnelLocalSelectorMismatch => serializer.serialize_i32(45),
13156 Self::VpnTunnelRemoteSelectorMismatch => serializer.serialize_i32(46),
13157 Self::PrivateTrafficToInternet => serializer.serialize_i32(7),
13158 Self::PrivateGoogleAccessDisallowed => serializer.serialize_i32(8),
13159 Self::PrivateGoogleAccessViaVpnTunnelUnsupported => serializer.serialize_i32(47),
13160 Self::NoExternalAddress => serializer.serialize_i32(9),
13161 Self::UnknownInternalAddress => serializer.serialize_i32(10),
13162 Self::ForwardingRuleMismatch => serializer.serialize_i32(11),
13163 Self::ForwardingRuleNoInstances => serializer.serialize_i32(12),
13164 Self::FirewallBlockingLoadBalancerBackendHealthCheck => {
13165 serializer.serialize_i32(13)
13166 }
13167 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => {
13168 serializer.serialize_i32(85)
13169 }
13170 Self::InstanceNotRunning => serializer.serialize_i32(14),
13171 Self::GkeClusterNotRunning => serializer.serialize_i32(27),
13172 Self::GkePodNotRunning => serializer.serialize_i32(103),
13173 Self::CloudSqlInstanceNotRunning => serializer.serialize_i32(28),
13174 Self::RedisInstanceNotRunning => serializer.serialize_i32(68),
13175 Self::RedisClusterNotRunning => serializer.serialize_i32(69),
13176 Self::TrafficTypeBlocked => serializer.serialize_i32(15),
13177 Self::GkeMasterUnauthorizedAccess => serializer.serialize_i32(16),
13178 Self::CloudSqlInstanceUnauthorizedAccess => serializer.serialize_i32(17),
13179 Self::DroppedInsideGkeService => serializer.serialize_i32(18),
13180 Self::DroppedInsideCloudSqlService => serializer.serialize_i32(19),
13181 Self::GoogleManagedServiceNoPeering => serializer.serialize_i32(20),
13182 Self::GoogleManagedServiceNoPscEndpoint => serializer.serialize_i32(38),
13183 Self::GkePscEndpointMissing => serializer.serialize_i32(36),
13184 Self::CloudSqlInstanceNoIpAddress => serializer.serialize_i32(21),
13185 Self::GkeControlPlaneRegionMismatch => serializer.serialize_i32(30),
13186 Self::PublicGkeControlPlaneToPrivateDestination => serializer.serialize_i32(31),
13187 Self::GkeControlPlaneNoRoute => serializer.serialize_i32(32),
13188 Self::CloudSqlInstanceNotConfiguredForExternalTraffic => {
13189 serializer.serialize_i32(33)
13190 }
13191 Self::PublicCloudSqlInstanceToPrivateDestination => serializer.serialize_i32(34),
13192 Self::CloudSqlInstanceNoRoute => serializer.serialize_i32(35),
13193 Self::CloudSqlConnectorRequired => serializer.serialize_i32(63),
13194 Self::CloudFunctionNotActive => serializer.serialize_i32(22),
13195 Self::VpcConnectorNotSet => serializer.serialize_i32(23),
13196 Self::VpcConnectorNotRunning => serializer.serialize_i32(24),
13197 Self::VpcConnectorServerlessTrafficBlocked => serializer.serialize_i32(60),
13198 Self::VpcConnectorHealthCheckTrafficBlocked => serializer.serialize_i32(61),
13199 Self::ForwardingRuleRegionMismatch => serializer.serialize_i32(25),
13200 Self::PscConnectionNotAccepted => serializer.serialize_i32(26),
13201 Self::PscEndpointAccessedFromPeeredNetwork => serializer.serialize_i32(41),
13202 Self::PscNegProducerEndpointNoGlobalAccess => serializer.serialize_i32(48),
13203 Self::PscNegProducerForwardingRuleMultiplePorts => serializer.serialize_i32(54),
13204 Self::CloudSqlPscNegUnsupported => serializer.serialize_i32(58),
13205 Self::NoNatSubnetsForPscServiceAttachment => serializer.serialize_i32(57),
13206 Self::PscTransitivityNotPropagated => serializer.serialize_i32(64),
13207 Self::HybridNegNonDynamicRouteMatched => serializer.serialize_i32(55),
13208 Self::HybridNegNonLocalDynamicRouteMatched => serializer.serialize_i32(56),
13209 Self::CloudRunRevisionNotReady => serializer.serialize_i32(29),
13210 Self::DroppedInsidePscServiceProducer => serializer.serialize_i32(37),
13211 Self::LoadBalancerHasNoProxySubnet => serializer.serialize_i32(39),
13212 Self::CloudNatNoAddresses => serializer.serialize_i32(40),
13213 Self::RoutingLoop => serializer.serialize_i32(59),
13214 Self::DroppedInsideGoogleManagedService => serializer.serialize_i32(62),
13215 Self::LoadBalancerBackendInvalidNetwork => serializer.serialize_i32(65),
13216 Self::BackendServiceNamedPortNotDefined => serializer.serialize_i32(66),
13217 Self::DestinationIsPrivateNatIpRange => serializer.serialize_i32(67),
13218 Self::DroppedInsideRedisInstanceService => serializer.serialize_i32(70),
13219 Self::RedisInstanceUnsupportedPort => serializer.serialize_i32(71),
13220 Self::RedisInstanceConnectingFromPupiAddress => serializer.serialize_i32(72),
13221 Self::RedisInstanceNoRouteToDestinationNetwork => serializer.serialize_i32(73),
13222 Self::RedisInstanceNoExternalIp => serializer.serialize_i32(74),
13223 Self::RedisInstanceUnsupportedProtocol => serializer.serialize_i32(78),
13224 Self::DroppedInsideRedisClusterService => serializer.serialize_i32(75),
13225 Self::RedisClusterUnsupportedPort => serializer.serialize_i32(76),
13226 Self::RedisClusterNoExternalIp => serializer.serialize_i32(77),
13227 Self::RedisClusterUnsupportedProtocol => serializer.serialize_i32(79),
13228 Self::NoAdvertisedRouteToGcpDestination => serializer.serialize_i32(80),
13229 Self::NoTrafficSelectorToGcpDestination => serializer.serialize_i32(81),
13230 Self::NoKnownRouteFromPeeredNetworkToDestination => serializer.serialize_i32(82),
13231 Self::PrivateNatToPscEndpointUnsupported => serializer.serialize_i32(83),
13232 Self::PscPortMappingPortMismatch => serializer.serialize_i32(86),
13233 Self::PscPortMappingWithoutPscConnectionUnsupported => serializer.serialize_i32(87),
13234 Self::UnsupportedRouteMatchedForNat64Destination => serializer.serialize_i32(88),
13235 Self::TrafficFromHybridEndpointToInternetDisallowed => serializer.serialize_i32(89),
13236 Self::NoMatchingNat64Gateway => serializer.serialize_i32(90),
13237 Self::NoConfiguredPrivateNat64Rule => serializer.serialize_i32(107),
13238 Self::LoadBalancerBackendIpVersionMismatch => serializer.serialize_i32(96),
13239 Self::NoKnownRouteFromNccNetworkToDestination => serializer.serialize_i32(97),
13240 Self::CloudNatProtocolUnsupported => serializer.serialize_i32(99),
13241 Self::L2InterconnectUnsupportedProtocol => serializer.serialize_i32(100),
13242 Self::L2InterconnectUnsupportedPort => serializer.serialize_i32(101),
13243 Self::L2InterconnectDestinationIpMismatch => serializer.serialize_i32(102),
13244 Self::NccRouteWithinHybridSubnetUnsupported => serializer.serialize_i32(104),
13245 Self::HybridSubnetRegionMismatch => serializer.serialize_i32(105),
13246 Self::HybridSubnetNoRoute => serializer.serialize_i32(106),
13247 Self::UnknownValue(u) => u.0.serialize(serializer),
13248 }
13249 }
13250 }
13251
13252 impl<'de> serde::de::Deserialize<'de> for Cause {
13253 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13254 where
13255 D: serde::Deserializer<'de>,
13256 {
13257 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Cause>::new(
13258 ".google.cloud.networkmanagement.v1.DropInfo.Cause",
13259 ))
13260 }
13261 }
13262}
13263
13264/// For display only. Metadata associated with a Google Kubernetes Engine (GKE)
13265/// cluster master.
13266#[derive(Clone, Default, PartialEq)]
13267#[non_exhaustive]
13268pub struct GKEMasterInfo {
13269 /// URI of a GKE cluster.
13270 pub cluster_uri: std::string::String,
13271
13272 /// URI of a GKE cluster network.
13273 pub cluster_network_uri: std::string::String,
13274
13275 /// Internal IP address of a GKE cluster control plane.
13276 pub internal_ip: std::string::String,
13277
13278 /// External IP address of a GKE cluster control plane.
13279 pub external_ip: std::string::String,
13280
13281 /// DNS endpoint of a GKE cluster control plane.
13282 pub dns_endpoint: std::string::String,
13283
13284 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13285}
13286
13287impl GKEMasterInfo {
13288 pub fn new() -> Self {
13289 std::default::Default::default()
13290 }
13291
13292 /// Sets the value of [cluster_uri][crate::model::GKEMasterInfo::cluster_uri].
13293 ///
13294 /// # Example
13295 /// ```ignore,no_run
13296 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13297 /// let x = GKEMasterInfo::new().set_cluster_uri("example");
13298 /// ```
13299 pub fn set_cluster_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13300 self.cluster_uri = v.into();
13301 self
13302 }
13303
13304 /// Sets the value of [cluster_network_uri][crate::model::GKEMasterInfo::cluster_network_uri].
13305 ///
13306 /// # Example
13307 /// ```ignore,no_run
13308 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13309 /// let x = GKEMasterInfo::new().set_cluster_network_uri("example");
13310 /// ```
13311 pub fn set_cluster_network_uri<T: std::convert::Into<std::string::String>>(
13312 mut self,
13313 v: T,
13314 ) -> Self {
13315 self.cluster_network_uri = v.into();
13316 self
13317 }
13318
13319 /// Sets the value of [internal_ip][crate::model::GKEMasterInfo::internal_ip].
13320 ///
13321 /// # Example
13322 /// ```ignore,no_run
13323 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13324 /// let x = GKEMasterInfo::new().set_internal_ip("example");
13325 /// ```
13326 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13327 self.internal_ip = v.into();
13328 self
13329 }
13330
13331 /// Sets the value of [external_ip][crate::model::GKEMasterInfo::external_ip].
13332 ///
13333 /// # Example
13334 /// ```ignore,no_run
13335 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13336 /// let x = GKEMasterInfo::new().set_external_ip("example");
13337 /// ```
13338 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13339 self.external_ip = v.into();
13340 self
13341 }
13342
13343 /// Sets the value of [dns_endpoint][crate::model::GKEMasterInfo::dns_endpoint].
13344 ///
13345 /// # Example
13346 /// ```ignore,no_run
13347 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13348 /// let x = GKEMasterInfo::new().set_dns_endpoint("example");
13349 /// ```
13350 pub fn set_dns_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13351 self.dns_endpoint = v.into();
13352 self
13353 }
13354}
13355
13356impl wkt::message::Message for GKEMasterInfo {
13357 fn typename() -> &'static str {
13358 "type.googleapis.com/google.cloud.networkmanagement.v1.GKEMasterInfo"
13359 }
13360}
13361
13362/// For display only. Metadata associated with a Google Kubernetes Engine (GKE)
13363/// Pod.
13364#[derive(Clone, Default, PartialEq)]
13365#[non_exhaustive]
13366pub struct GkePodInfo {
13367 /// URI of a GKE Pod.
13368 /// For Pods in regional Clusters, the URI format is:
13369 /// `projects/{project}/locations/{location}/clusters/{cluster}/k8s/namespaces/{namespace}/pods/{pod}`
13370 /// For Pods in zonal Clusters, the URI format is:
13371 /// `projects/{project}/zones/{zone}/clusters/{cluster}/k8s/namespaces/{namespace}/pods/{pod}`
13372 pub pod_uri: std::string::String,
13373
13374 /// IP address of a GKE Pod. If the Pod is dual-stack, this is the IP address
13375 /// relevant to the trace.
13376 pub ip_address: std::string::String,
13377
13378 /// URI of the network containing the GKE Pod.
13379 pub network_uri: std::string::String,
13380
13381 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13382}
13383
13384impl GkePodInfo {
13385 pub fn new() -> Self {
13386 std::default::Default::default()
13387 }
13388
13389 /// Sets the value of [pod_uri][crate::model::GkePodInfo::pod_uri].
13390 ///
13391 /// # Example
13392 /// ```ignore,no_run
13393 /// # use google_cloud_networkmanagement_v1::model::GkePodInfo;
13394 /// let x = GkePodInfo::new().set_pod_uri("example");
13395 /// ```
13396 pub fn set_pod_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13397 self.pod_uri = v.into();
13398 self
13399 }
13400
13401 /// Sets the value of [ip_address][crate::model::GkePodInfo::ip_address].
13402 ///
13403 /// # Example
13404 /// ```ignore,no_run
13405 /// # use google_cloud_networkmanagement_v1::model::GkePodInfo;
13406 /// let x = GkePodInfo::new().set_ip_address("example");
13407 /// ```
13408 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13409 self.ip_address = v.into();
13410 self
13411 }
13412
13413 /// Sets the value of [network_uri][crate::model::GkePodInfo::network_uri].
13414 ///
13415 /// # Example
13416 /// ```ignore,no_run
13417 /// # use google_cloud_networkmanagement_v1::model::GkePodInfo;
13418 /// let x = GkePodInfo::new().set_network_uri("example");
13419 /// ```
13420 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13421 self.network_uri = v.into();
13422 self
13423 }
13424}
13425
13426impl wkt::message::Message for GkePodInfo {
13427 fn typename() -> &'static str {
13428 "type.googleapis.com/google.cloud.networkmanagement.v1.GkePodInfo"
13429 }
13430}
13431
13432/// For display only. Contains information about why IP masquerading was skipped
13433/// for the packet.
13434#[derive(Clone, Default, PartialEq)]
13435#[non_exhaustive]
13436pub struct IpMasqueradingSkippedInfo {
13437 /// Reason why IP masquerading was not applied.
13438 pub reason: crate::model::ip_masquerading_skipped_info::Reason,
13439
13440 /// The matched non-masquerade IP range. Only set if reason is
13441 /// DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE or
13442 /// DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE.
13443 pub non_masquerade_range: std::string::String,
13444
13445 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13446}
13447
13448impl IpMasqueradingSkippedInfo {
13449 pub fn new() -> Self {
13450 std::default::Default::default()
13451 }
13452
13453 /// Sets the value of [reason][crate::model::IpMasqueradingSkippedInfo::reason].
13454 ///
13455 /// # Example
13456 /// ```ignore,no_run
13457 /// # use google_cloud_networkmanagement_v1::model::IpMasqueradingSkippedInfo;
13458 /// use google_cloud_networkmanagement_v1::model::ip_masquerading_skipped_info::Reason;
13459 /// let x0 = IpMasqueradingSkippedInfo::new().set_reason(Reason::DestinationIpInConfiguredNonMasqueradeRange);
13460 /// let x1 = IpMasqueradingSkippedInfo::new().set_reason(Reason::DestinationIpInDefaultNonMasqueradeRange);
13461 /// let x2 = IpMasqueradingSkippedInfo::new().set_reason(Reason::DestinationOnSameNode);
13462 /// ```
13463 pub fn set_reason<T: std::convert::Into<crate::model::ip_masquerading_skipped_info::Reason>>(
13464 mut self,
13465 v: T,
13466 ) -> Self {
13467 self.reason = v.into();
13468 self
13469 }
13470
13471 /// Sets the value of [non_masquerade_range][crate::model::IpMasqueradingSkippedInfo::non_masquerade_range].
13472 ///
13473 /// # Example
13474 /// ```ignore,no_run
13475 /// # use google_cloud_networkmanagement_v1::model::IpMasqueradingSkippedInfo;
13476 /// let x = IpMasqueradingSkippedInfo::new().set_non_masquerade_range("example");
13477 /// ```
13478 pub fn set_non_masquerade_range<T: std::convert::Into<std::string::String>>(
13479 mut self,
13480 v: T,
13481 ) -> Self {
13482 self.non_masquerade_range = v.into();
13483 self
13484 }
13485}
13486
13487impl wkt::message::Message for IpMasqueradingSkippedInfo {
13488 fn typename() -> &'static str {
13489 "type.googleapis.com/google.cloud.networkmanagement.v1.IpMasqueradingSkippedInfo"
13490 }
13491}
13492
13493/// Defines additional types related to [IpMasqueradingSkippedInfo].
13494pub mod ip_masquerading_skipped_info {
13495 #[allow(unused_imports)]
13496 use super::*;
13497
13498 /// Reason why IP masquerading was skipped.
13499 ///
13500 /// # Working with unknown values
13501 ///
13502 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13503 /// additional enum variants at any time. Adding new variants is not considered
13504 /// a breaking change. Applications should write their code in anticipation of:
13505 ///
13506 /// - New values appearing in future releases of the client library, **and**
13507 /// - New values received dynamically, without application changes.
13508 ///
13509 /// Please consult the [Working with enums] section in the user guide for some
13510 /// guidelines.
13511 ///
13512 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13513 #[derive(Clone, Debug, PartialEq)]
13514 #[non_exhaustive]
13515 pub enum Reason {
13516 /// Unused default value.
13517 Unspecified,
13518 /// Masquerading not applied because destination IP is in one of configured
13519 /// non-masquerade ranges.
13520 DestinationIpInConfiguredNonMasqueradeRange,
13521 /// Masquerading not applied because destination IP is in one of default
13522 /// non-masquerade ranges.
13523 DestinationIpInDefaultNonMasqueradeRange,
13524 /// Masquerading not applied because destination is on the same Node.
13525 DestinationOnSameNode,
13526 /// Masquerading not applied because ip-masq-agent doesn't exist and default
13527 /// SNAT is disabled.
13528 DefaultSnatDisabled,
13529 /// Masquerading not applied because the packet's IP version is IPv6.
13530 NoMasqueradingForIpv6,
13531 /// Masquerading not applied because the source Pod uses the host Node's
13532 /// network namespace, including the Node's IP address.
13533 PodUsesNodeNetworkNamespace,
13534 /// Masquerading not applied because the packet is a return packet.
13535 NoMasqueradingForReturnPacket,
13536 /// If set, the enum was initialized with an unknown value.
13537 ///
13538 /// Applications can examine the value using [Reason::value] or
13539 /// [Reason::name].
13540 UnknownValue(reason::UnknownValue),
13541 }
13542
13543 #[doc(hidden)]
13544 pub mod reason {
13545 #[allow(unused_imports)]
13546 use super::*;
13547 #[derive(Clone, Debug, PartialEq)]
13548 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13549 }
13550
13551 impl Reason {
13552 /// Gets the enum value.
13553 ///
13554 /// Returns `None` if the enum contains an unknown value deserialized from
13555 /// the string representation of enums.
13556 pub fn value(&self) -> std::option::Option<i32> {
13557 match self {
13558 Self::Unspecified => std::option::Option::Some(0),
13559 Self::DestinationIpInConfiguredNonMasqueradeRange => std::option::Option::Some(1),
13560 Self::DestinationIpInDefaultNonMasqueradeRange => std::option::Option::Some(2),
13561 Self::DestinationOnSameNode => std::option::Option::Some(3),
13562 Self::DefaultSnatDisabled => std::option::Option::Some(4),
13563 Self::NoMasqueradingForIpv6 => std::option::Option::Some(5),
13564 Self::PodUsesNodeNetworkNamespace => std::option::Option::Some(6),
13565 Self::NoMasqueradingForReturnPacket => std::option::Option::Some(7),
13566 Self::UnknownValue(u) => u.0.value(),
13567 }
13568 }
13569
13570 /// Gets the enum value as a string.
13571 ///
13572 /// Returns `None` if the enum contains an unknown value deserialized from
13573 /// the integer representation of enums.
13574 pub fn name(&self) -> std::option::Option<&str> {
13575 match self {
13576 Self::Unspecified => std::option::Option::Some("REASON_UNSPECIFIED"),
13577 Self::DestinationIpInConfiguredNonMasqueradeRange => {
13578 std::option::Option::Some("DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE")
13579 }
13580 Self::DestinationIpInDefaultNonMasqueradeRange => {
13581 std::option::Option::Some("DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE")
13582 }
13583 Self::DestinationOnSameNode => {
13584 std::option::Option::Some("DESTINATION_ON_SAME_NODE")
13585 }
13586 Self::DefaultSnatDisabled => std::option::Option::Some("DEFAULT_SNAT_DISABLED"),
13587 Self::NoMasqueradingForIpv6 => {
13588 std::option::Option::Some("NO_MASQUERADING_FOR_IPV6")
13589 }
13590 Self::PodUsesNodeNetworkNamespace => {
13591 std::option::Option::Some("POD_USES_NODE_NETWORK_NAMESPACE")
13592 }
13593 Self::NoMasqueradingForReturnPacket => {
13594 std::option::Option::Some("NO_MASQUERADING_FOR_RETURN_PACKET")
13595 }
13596 Self::UnknownValue(u) => u.0.name(),
13597 }
13598 }
13599 }
13600
13601 impl std::default::Default for Reason {
13602 fn default() -> Self {
13603 use std::convert::From;
13604 Self::from(0)
13605 }
13606 }
13607
13608 impl std::fmt::Display for Reason {
13609 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13610 wkt::internal::display_enum(f, self.name(), self.value())
13611 }
13612 }
13613
13614 impl std::convert::From<i32> for Reason {
13615 fn from(value: i32) -> Self {
13616 match value {
13617 0 => Self::Unspecified,
13618 1 => Self::DestinationIpInConfiguredNonMasqueradeRange,
13619 2 => Self::DestinationIpInDefaultNonMasqueradeRange,
13620 3 => Self::DestinationOnSameNode,
13621 4 => Self::DefaultSnatDisabled,
13622 5 => Self::NoMasqueradingForIpv6,
13623 6 => Self::PodUsesNodeNetworkNamespace,
13624 7 => Self::NoMasqueradingForReturnPacket,
13625 _ => Self::UnknownValue(reason::UnknownValue(
13626 wkt::internal::UnknownEnumValue::Integer(value),
13627 )),
13628 }
13629 }
13630 }
13631
13632 impl std::convert::From<&str> for Reason {
13633 fn from(value: &str) -> Self {
13634 use std::string::ToString;
13635 match value {
13636 "REASON_UNSPECIFIED" => Self::Unspecified,
13637 "DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE" => {
13638 Self::DestinationIpInConfiguredNonMasqueradeRange
13639 }
13640 "DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE" => {
13641 Self::DestinationIpInDefaultNonMasqueradeRange
13642 }
13643 "DESTINATION_ON_SAME_NODE" => Self::DestinationOnSameNode,
13644 "DEFAULT_SNAT_DISABLED" => Self::DefaultSnatDisabled,
13645 "NO_MASQUERADING_FOR_IPV6" => Self::NoMasqueradingForIpv6,
13646 "POD_USES_NODE_NETWORK_NAMESPACE" => Self::PodUsesNodeNetworkNamespace,
13647 "NO_MASQUERADING_FOR_RETURN_PACKET" => Self::NoMasqueradingForReturnPacket,
13648 _ => Self::UnknownValue(reason::UnknownValue(
13649 wkt::internal::UnknownEnumValue::String(value.to_string()),
13650 )),
13651 }
13652 }
13653 }
13654
13655 impl serde::ser::Serialize for Reason {
13656 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13657 where
13658 S: serde::Serializer,
13659 {
13660 match self {
13661 Self::Unspecified => serializer.serialize_i32(0),
13662 Self::DestinationIpInConfiguredNonMasqueradeRange => serializer.serialize_i32(1),
13663 Self::DestinationIpInDefaultNonMasqueradeRange => serializer.serialize_i32(2),
13664 Self::DestinationOnSameNode => serializer.serialize_i32(3),
13665 Self::DefaultSnatDisabled => serializer.serialize_i32(4),
13666 Self::NoMasqueradingForIpv6 => serializer.serialize_i32(5),
13667 Self::PodUsesNodeNetworkNamespace => serializer.serialize_i32(6),
13668 Self::NoMasqueradingForReturnPacket => serializer.serialize_i32(7),
13669 Self::UnknownValue(u) => u.0.serialize(serializer),
13670 }
13671 }
13672 }
13673
13674 impl<'de> serde::de::Deserialize<'de> for Reason {
13675 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13676 where
13677 D: serde::Deserializer<'de>,
13678 {
13679 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Reason>::new(
13680 ".google.cloud.networkmanagement.v1.IpMasqueradingSkippedInfo.Reason",
13681 ))
13682 }
13683 }
13684}
13685
13686/// For display only. Metadata associated with a Cloud SQL instance.
13687#[derive(Clone, Default, PartialEq)]
13688#[non_exhaustive]
13689pub struct CloudSQLInstanceInfo {
13690 /// Name of a Cloud SQL instance.
13691 pub display_name: std::string::String,
13692
13693 /// URI of a Cloud SQL instance.
13694 pub uri: std::string::String,
13695
13696 /// URI of a Cloud SQL instance network or empty string if the instance does
13697 /// not have one.
13698 pub network_uri: std::string::String,
13699
13700 /// Internal IP address of a Cloud SQL instance.
13701 pub internal_ip: std::string::String,
13702
13703 /// External IP address of a Cloud SQL instance.
13704 pub external_ip: std::string::String,
13705
13706 /// Region in which the Cloud SQL instance is running.
13707 pub region: std::string::String,
13708
13709 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13710}
13711
13712impl CloudSQLInstanceInfo {
13713 pub fn new() -> Self {
13714 std::default::Default::default()
13715 }
13716
13717 /// Sets the value of [display_name][crate::model::CloudSQLInstanceInfo::display_name].
13718 ///
13719 /// # Example
13720 /// ```ignore,no_run
13721 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
13722 /// let x = CloudSQLInstanceInfo::new().set_display_name("example");
13723 /// ```
13724 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13725 self.display_name = v.into();
13726 self
13727 }
13728
13729 /// Sets the value of [uri][crate::model::CloudSQLInstanceInfo::uri].
13730 ///
13731 /// # Example
13732 /// ```ignore,no_run
13733 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
13734 /// let x = CloudSQLInstanceInfo::new().set_uri("example");
13735 /// ```
13736 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13737 self.uri = v.into();
13738 self
13739 }
13740
13741 /// Sets the value of [network_uri][crate::model::CloudSQLInstanceInfo::network_uri].
13742 ///
13743 /// # Example
13744 /// ```ignore,no_run
13745 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
13746 /// let x = CloudSQLInstanceInfo::new().set_network_uri("example");
13747 /// ```
13748 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13749 self.network_uri = v.into();
13750 self
13751 }
13752
13753 /// Sets the value of [internal_ip][crate::model::CloudSQLInstanceInfo::internal_ip].
13754 ///
13755 /// # Example
13756 /// ```ignore,no_run
13757 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
13758 /// let x = CloudSQLInstanceInfo::new().set_internal_ip("example");
13759 /// ```
13760 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13761 self.internal_ip = v.into();
13762 self
13763 }
13764
13765 /// Sets the value of [external_ip][crate::model::CloudSQLInstanceInfo::external_ip].
13766 ///
13767 /// # Example
13768 /// ```ignore,no_run
13769 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
13770 /// let x = CloudSQLInstanceInfo::new().set_external_ip("example");
13771 /// ```
13772 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13773 self.external_ip = v.into();
13774 self
13775 }
13776
13777 /// Sets the value of [region][crate::model::CloudSQLInstanceInfo::region].
13778 ///
13779 /// # Example
13780 /// ```ignore,no_run
13781 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
13782 /// let x = CloudSQLInstanceInfo::new().set_region("example");
13783 /// ```
13784 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13785 self.region = v.into();
13786 self
13787 }
13788}
13789
13790impl wkt::message::Message for CloudSQLInstanceInfo {
13791 fn typename() -> &'static str {
13792 "type.googleapis.com/google.cloud.networkmanagement.v1.CloudSQLInstanceInfo"
13793 }
13794}
13795
13796/// For display only. Metadata associated with a Cloud Redis Instance.
13797#[derive(Clone, Default, PartialEq)]
13798#[non_exhaustive]
13799pub struct RedisInstanceInfo {
13800 /// Name of a Cloud Redis Instance.
13801 pub display_name: std::string::String,
13802
13803 /// URI of a Cloud Redis Instance.
13804 pub uri: std::string::String,
13805
13806 /// URI of a Cloud Redis Instance network.
13807 pub network_uri: std::string::String,
13808
13809 /// Primary endpoint IP address of a Cloud Redis Instance.
13810 pub primary_endpoint_ip: std::string::String,
13811
13812 /// Read endpoint IP address of a Cloud Redis Instance (if applicable).
13813 pub read_endpoint_ip: std::string::String,
13814
13815 /// Region in which the Cloud Redis Instance is defined.
13816 pub region: std::string::String,
13817
13818 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13819}
13820
13821impl RedisInstanceInfo {
13822 pub fn new() -> Self {
13823 std::default::Default::default()
13824 }
13825
13826 /// Sets the value of [display_name][crate::model::RedisInstanceInfo::display_name].
13827 ///
13828 /// # Example
13829 /// ```ignore,no_run
13830 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
13831 /// let x = RedisInstanceInfo::new().set_display_name("example");
13832 /// ```
13833 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13834 self.display_name = v.into();
13835 self
13836 }
13837
13838 /// Sets the value of [uri][crate::model::RedisInstanceInfo::uri].
13839 ///
13840 /// # Example
13841 /// ```ignore,no_run
13842 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
13843 /// let x = RedisInstanceInfo::new().set_uri("example");
13844 /// ```
13845 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13846 self.uri = v.into();
13847 self
13848 }
13849
13850 /// Sets the value of [network_uri][crate::model::RedisInstanceInfo::network_uri].
13851 ///
13852 /// # Example
13853 /// ```ignore,no_run
13854 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
13855 /// let x = RedisInstanceInfo::new().set_network_uri("example");
13856 /// ```
13857 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13858 self.network_uri = v.into();
13859 self
13860 }
13861
13862 /// Sets the value of [primary_endpoint_ip][crate::model::RedisInstanceInfo::primary_endpoint_ip].
13863 ///
13864 /// # Example
13865 /// ```ignore,no_run
13866 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
13867 /// let x = RedisInstanceInfo::new().set_primary_endpoint_ip("example");
13868 /// ```
13869 pub fn set_primary_endpoint_ip<T: std::convert::Into<std::string::String>>(
13870 mut self,
13871 v: T,
13872 ) -> Self {
13873 self.primary_endpoint_ip = v.into();
13874 self
13875 }
13876
13877 /// Sets the value of [read_endpoint_ip][crate::model::RedisInstanceInfo::read_endpoint_ip].
13878 ///
13879 /// # Example
13880 /// ```ignore,no_run
13881 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
13882 /// let x = RedisInstanceInfo::new().set_read_endpoint_ip("example");
13883 /// ```
13884 pub fn set_read_endpoint_ip<T: std::convert::Into<std::string::String>>(
13885 mut self,
13886 v: T,
13887 ) -> Self {
13888 self.read_endpoint_ip = v.into();
13889 self
13890 }
13891
13892 /// Sets the value of [region][crate::model::RedisInstanceInfo::region].
13893 ///
13894 /// # Example
13895 /// ```ignore,no_run
13896 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
13897 /// let x = RedisInstanceInfo::new().set_region("example");
13898 /// ```
13899 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13900 self.region = v.into();
13901 self
13902 }
13903}
13904
13905impl wkt::message::Message for RedisInstanceInfo {
13906 fn typename() -> &'static str {
13907 "type.googleapis.com/google.cloud.networkmanagement.v1.RedisInstanceInfo"
13908 }
13909}
13910
13911/// For display only. Metadata associated with a Redis Cluster.
13912#[derive(Clone, Default, PartialEq)]
13913#[non_exhaustive]
13914pub struct RedisClusterInfo {
13915 /// Name of a Redis Cluster.
13916 pub display_name: std::string::String,
13917
13918 /// URI of a Redis Cluster in format
13919 /// "projects/{project_id}/locations/{location}/clusters/{cluster_id}"
13920 pub uri: std::string::String,
13921
13922 /// URI of the network containing the Redis Cluster endpoints in format
13923 /// "projects/{project_id}/global/networks/{network_id}".
13924 pub network_uri: std::string::String,
13925
13926 /// Discovery endpoint IP address of a Redis Cluster.
13927 pub discovery_endpoint_ip_address: std::string::String,
13928
13929 /// Secondary endpoint IP address of a Redis Cluster.
13930 pub secondary_endpoint_ip_address: std::string::String,
13931
13932 /// Name of the region in which the Redis Cluster is defined. For example,
13933 /// "us-central1".
13934 pub location: std::string::String,
13935
13936 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13937}
13938
13939impl RedisClusterInfo {
13940 pub fn new() -> Self {
13941 std::default::Default::default()
13942 }
13943
13944 /// Sets the value of [display_name][crate::model::RedisClusterInfo::display_name].
13945 ///
13946 /// # Example
13947 /// ```ignore,no_run
13948 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
13949 /// let x = RedisClusterInfo::new().set_display_name("example");
13950 /// ```
13951 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13952 self.display_name = v.into();
13953 self
13954 }
13955
13956 /// Sets the value of [uri][crate::model::RedisClusterInfo::uri].
13957 ///
13958 /// # Example
13959 /// ```ignore,no_run
13960 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
13961 /// let x = RedisClusterInfo::new().set_uri("example");
13962 /// ```
13963 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13964 self.uri = v.into();
13965 self
13966 }
13967
13968 /// Sets the value of [network_uri][crate::model::RedisClusterInfo::network_uri].
13969 ///
13970 /// # Example
13971 /// ```ignore,no_run
13972 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
13973 /// let x = RedisClusterInfo::new().set_network_uri("example");
13974 /// ```
13975 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13976 self.network_uri = v.into();
13977 self
13978 }
13979
13980 /// Sets the value of [discovery_endpoint_ip_address][crate::model::RedisClusterInfo::discovery_endpoint_ip_address].
13981 ///
13982 /// # Example
13983 /// ```ignore,no_run
13984 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
13985 /// let x = RedisClusterInfo::new().set_discovery_endpoint_ip_address("example");
13986 /// ```
13987 pub fn set_discovery_endpoint_ip_address<T: std::convert::Into<std::string::String>>(
13988 mut self,
13989 v: T,
13990 ) -> Self {
13991 self.discovery_endpoint_ip_address = v.into();
13992 self
13993 }
13994
13995 /// Sets the value of [secondary_endpoint_ip_address][crate::model::RedisClusterInfo::secondary_endpoint_ip_address].
13996 ///
13997 /// # Example
13998 /// ```ignore,no_run
13999 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14000 /// let x = RedisClusterInfo::new().set_secondary_endpoint_ip_address("example");
14001 /// ```
14002 pub fn set_secondary_endpoint_ip_address<T: std::convert::Into<std::string::String>>(
14003 mut self,
14004 v: T,
14005 ) -> Self {
14006 self.secondary_endpoint_ip_address = v.into();
14007 self
14008 }
14009
14010 /// Sets the value of [location][crate::model::RedisClusterInfo::location].
14011 ///
14012 /// # Example
14013 /// ```ignore,no_run
14014 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14015 /// let x = RedisClusterInfo::new().set_location("example");
14016 /// ```
14017 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14018 self.location = v.into();
14019 self
14020 }
14021}
14022
14023impl wkt::message::Message for RedisClusterInfo {
14024 fn typename() -> &'static str {
14025 "type.googleapis.com/google.cloud.networkmanagement.v1.RedisClusterInfo"
14026 }
14027}
14028
14029/// For display only. Metadata associated with a Cloud Function.
14030#[derive(Clone, Default, PartialEq)]
14031#[non_exhaustive]
14032pub struct CloudFunctionInfo {
14033 /// Name of a Cloud Function.
14034 pub display_name: std::string::String,
14035
14036 /// URI of a Cloud Function.
14037 pub uri: std::string::String,
14038
14039 /// Location in which the Cloud Function is deployed.
14040 pub location: std::string::String,
14041
14042 /// Latest successfully deployed version id of the Cloud Function.
14043 pub version_id: i64,
14044
14045 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14046}
14047
14048impl CloudFunctionInfo {
14049 pub fn new() -> Self {
14050 std::default::Default::default()
14051 }
14052
14053 /// Sets the value of [display_name][crate::model::CloudFunctionInfo::display_name].
14054 ///
14055 /// # Example
14056 /// ```ignore,no_run
14057 /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
14058 /// let x = CloudFunctionInfo::new().set_display_name("example");
14059 /// ```
14060 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14061 self.display_name = v.into();
14062 self
14063 }
14064
14065 /// Sets the value of [uri][crate::model::CloudFunctionInfo::uri].
14066 ///
14067 /// # Example
14068 /// ```ignore,no_run
14069 /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
14070 /// let x = CloudFunctionInfo::new().set_uri("example");
14071 /// ```
14072 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14073 self.uri = v.into();
14074 self
14075 }
14076
14077 /// Sets the value of [location][crate::model::CloudFunctionInfo::location].
14078 ///
14079 /// # Example
14080 /// ```ignore,no_run
14081 /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
14082 /// let x = CloudFunctionInfo::new().set_location("example");
14083 /// ```
14084 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14085 self.location = v.into();
14086 self
14087 }
14088
14089 /// Sets the value of [version_id][crate::model::CloudFunctionInfo::version_id].
14090 ///
14091 /// # Example
14092 /// ```ignore,no_run
14093 /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
14094 /// let x = CloudFunctionInfo::new().set_version_id(42);
14095 /// ```
14096 pub fn set_version_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14097 self.version_id = v.into();
14098 self
14099 }
14100}
14101
14102impl wkt::message::Message for CloudFunctionInfo {
14103 fn typename() -> &'static str {
14104 "type.googleapis.com/google.cloud.networkmanagement.v1.CloudFunctionInfo"
14105 }
14106}
14107
14108/// For display only. Metadata associated with a Cloud Run revision.
14109#[derive(Clone, Default, PartialEq)]
14110#[non_exhaustive]
14111pub struct CloudRunRevisionInfo {
14112 /// Name of a Cloud Run revision.
14113 pub display_name: std::string::String,
14114
14115 /// URI of a Cloud Run revision.
14116 pub uri: std::string::String,
14117
14118 /// Location in which this revision is deployed.
14119 pub location: std::string::String,
14120
14121 /// URI of Cloud Run service this revision belongs to.
14122 pub service_uri: std::string::String,
14123
14124 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14125}
14126
14127impl CloudRunRevisionInfo {
14128 pub fn new() -> Self {
14129 std::default::Default::default()
14130 }
14131
14132 /// Sets the value of [display_name][crate::model::CloudRunRevisionInfo::display_name].
14133 ///
14134 /// # Example
14135 /// ```ignore,no_run
14136 /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
14137 /// let x = CloudRunRevisionInfo::new().set_display_name("example");
14138 /// ```
14139 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14140 self.display_name = v.into();
14141 self
14142 }
14143
14144 /// Sets the value of [uri][crate::model::CloudRunRevisionInfo::uri].
14145 ///
14146 /// # Example
14147 /// ```ignore,no_run
14148 /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
14149 /// let x = CloudRunRevisionInfo::new().set_uri("example");
14150 /// ```
14151 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14152 self.uri = v.into();
14153 self
14154 }
14155
14156 /// Sets the value of [location][crate::model::CloudRunRevisionInfo::location].
14157 ///
14158 /// # Example
14159 /// ```ignore,no_run
14160 /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
14161 /// let x = CloudRunRevisionInfo::new().set_location("example");
14162 /// ```
14163 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14164 self.location = v.into();
14165 self
14166 }
14167
14168 /// Sets the value of [service_uri][crate::model::CloudRunRevisionInfo::service_uri].
14169 ///
14170 /// # Example
14171 /// ```ignore,no_run
14172 /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
14173 /// let x = CloudRunRevisionInfo::new().set_service_uri("example");
14174 /// ```
14175 pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14176 self.service_uri = v.into();
14177 self
14178 }
14179}
14180
14181impl wkt::message::Message for CloudRunRevisionInfo {
14182 fn typename() -> &'static str {
14183 "type.googleapis.com/google.cloud.networkmanagement.v1.CloudRunRevisionInfo"
14184 }
14185}
14186
14187/// For display only. Metadata associated with an App Engine version.
14188#[derive(Clone, Default, PartialEq)]
14189#[non_exhaustive]
14190pub struct AppEngineVersionInfo {
14191 /// Name of an App Engine version.
14192 pub display_name: std::string::String,
14193
14194 /// URI of an App Engine version.
14195 pub uri: std::string::String,
14196
14197 /// Runtime of the App Engine version.
14198 pub runtime: std::string::String,
14199
14200 /// App Engine execution environment for a version.
14201 pub environment: std::string::String,
14202
14203 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14204}
14205
14206impl AppEngineVersionInfo {
14207 pub fn new() -> Self {
14208 std::default::Default::default()
14209 }
14210
14211 /// Sets the value of [display_name][crate::model::AppEngineVersionInfo::display_name].
14212 ///
14213 /// # Example
14214 /// ```ignore,no_run
14215 /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
14216 /// let x = AppEngineVersionInfo::new().set_display_name("example");
14217 /// ```
14218 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14219 self.display_name = v.into();
14220 self
14221 }
14222
14223 /// Sets the value of [uri][crate::model::AppEngineVersionInfo::uri].
14224 ///
14225 /// # Example
14226 /// ```ignore,no_run
14227 /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
14228 /// let x = AppEngineVersionInfo::new().set_uri("example");
14229 /// ```
14230 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14231 self.uri = v.into();
14232 self
14233 }
14234
14235 /// Sets the value of [runtime][crate::model::AppEngineVersionInfo::runtime].
14236 ///
14237 /// # Example
14238 /// ```ignore,no_run
14239 /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
14240 /// let x = AppEngineVersionInfo::new().set_runtime("example");
14241 /// ```
14242 pub fn set_runtime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14243 self.runtime = v.into();
14244 self
14245 }
14246
14247 /// Sets the value of [environment][crate::model::AppEngineVersionInfo::environment].
14248 ///
14249 /// # Example
14250 /// ```ignore,no_run
14251 /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
14252 /// let x = AppEngineVersionInfo::new().set_environment("example");
14253 /// ```
14254 pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14255 self.environment = v.into();
14256 self
14257 }
14258}
14259
14260impl wkt::message::Message for AppEngineVersionInfo {
14261 fn typename() -> &'static str {
14262 "type.googleapis.com/google.cloud.networkmanagement.v1.AppEngineVersionInfo"
14263 }
14264}
14265
14266/// For display only. Metadata associated with a VPC connector.
14267#[derive(Clone, Default, PartialEq)]
14268#[non_exhaustive]
14269pub struct VpcConnectorInfo {
14270 /// Name of a VPC connector.
14271 pub display_name: std::string::String,
14272
14273 /// URI of a VPC connector.
14274 pub uri: std::string::String,
14275
14276 /// Location in which the VPC connector is deployed.
14277 pub location: std::string::String,
14278
14279 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14280}
14281
14282impl VpcConnectorInfo {
14283 pub fn new() -> Self {
14284 std::default::Default::default()
14285 }
14286
14287 /// Sets the value of [display_name][crate::model::VpcConnectorInfo::display_name].
14288 ///
14289 /// # Example
14290 /// ```ignore,no_run
14291 /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
14292 /// let x = VpcConnectorInfo::new().set_display_name("example");
14293 /// ```
14294 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14295 self.display_name = v.into();
14296 self
14297 }
14298
14299 /// Sets the value of [uri][crate::model::VpcConnectorInfo::uri].
14300 ///
14301 /// # Example
14302 /// ```ignore,no_run
14303 /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
14304 /// let x = VpcConnectorInfo::new().set_uri("example");
14305 /// ```
14306 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14307 self.uri = v.into();
14308 self
14309 }
14310
14311 /// Sets the value of [location][crate::model::VpcConnectorInfo::location].
14312 ///
14313 /// # Example
14314 /// ```ignore,no_run
14315 /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
14316 /// let x = VpcConnectorInfo::new().set_location("example");
14317 /// ```
14318 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14319 self.location = v.into();
14320 self
14321 }
14322}
14323
14324impl wkt::message::Message for VpcConnectorInfo {
14325 fn typename() -> &'static str {
14326 "type.googleapis.com/google.cloud.networkmanagement.v1.VpcConnectorInfo"
14327 }
14328}
14329
14330/// For display only. Metadata associated with a serverless direct VPC egress
14331/// connection.
14332#[derive(Clone, Default, PartialEq)]
14333#[non_exhaustive]
14334pub struct DirectVpcEgressConnectionInfo {
14335 /// URI of direct access network.
14336 pub network_uri: std::string::String,
14337
14338 /// URI of direct access subnetwork.
14339 pub subnetwork_uri: std::string::String,
14340
14341 /// Selected IP range.
14342 pub selected_ip_range: std::string::String,
14343
14344 /// Selected starting IP address, from the selected IP range.
14345 pub selected_ip_address: std::string::String,
14346
14347 /// Region in which the Direct VPC egress is deployed.
14348 pub region: std::string::String,
14349
14350 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14351}
14352
14353impl DirectVpcEgressConnectionInfo {
14354 pub fn new() -> Self {
14355 std::default::Default::default()
14356 }
14357
14358 /// Sets the value of [network_uri][crate::model::DirectVpcEgressConnectionInfo::network_uri].
14359 ///
14360 /// # Example
14361 /// ```ignore,no_run
14362 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
14363 /// let x = DirectVpcEgressConnectionInfo::new().set_network_uri("example");
14364 /// ```
14365 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14366 self.network_uri = v.into();
14367 self
14368 }
14369
14370 /// Sets the value of [subnetwork_uri][crate::model::DirectVpcEgressConnectionInfo::subnetwork_uri].
14371 ///
14372 /// # Example
14373 /// ```ignore,no_run
14374 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
14375 /// let x = DirectVpcEgressConnectionInfo::new().set_subnetwork_uri("example");
14376 /// ```
14377 pub fn set_subnetwork_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14378 self.subnetwork_uri = v.into();
14379 self
14380 }
14381
14382 /// Sets the value of [selected_ip_range][crate::model::DirectVpcEgressConnectionInfo::selected_ip_range].
14383 ///
14384 /// # Example
14385 /// ```ignore,no_run
14386 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
14387 /// let x = DirectVpcEgressConnectionInfo::new().set_selected_ip_range("example");
14388 /// ```
14389 pub fn set_selected_ip_range<T: std::convert::Into<std::string::String>>(
14390 mut self,
14391 v: T,
14392 ) -> Self {
14393 self.selected_ip_range = v.into();
14394 self
14395 }
14396
14397 /// Sets the value of [selected_ip_address][crate::model::DirectVpcEgressConnectionInfo::selected_ip_address].
14398 ///
14399 /// # Example
14400 /// ```ignore,no_run
14401 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
14402 /// let x = DirectVpcEgressConnectionInfo::new().set_selected_ip_address("example");
14403 /// ```
14404 pub fn set_selected_ip_address<T: std::convert::Into<std::string::String>>(
14405 mut self,
14406 v: T,
14407 ) -> Self {
14408 self.selected_ip_address = v.into();
14409 self
14410 }
14411
14412 /// Sets the value of [region][crate::model::DirectVpcEgressConnectionInfo::region].
14413 ///
14414 /// # Example
14415 /// ```ignore,no_run
14416 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
14417 /// let x = DirectVpcEgressConnectionInfo::new().set_region("example");
14418 /// ```
14419 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14420 self.region = v.into();
14421 self
14422 }
14423}
14424
14425impl wkt::message::Message for DirectVpcEgressConnectionInfo {
14426 fn typename() -> &'static str {
14427 "type.googleapis.com/google.cloud.networkmanagement.v1.DirectVpcEgressConnectionInfo"
14428 }
14429}
14430
14431/// For display only. Metadata associated with a serverless public connection.
14432#[derive(Clone, Default, PartialEq)]
14433#[non_exhaustive]
14434pub struct ServerlessExternalConnectionInfo {
14435 /// Selected starting IP address, from the Google dynamic address pool.
14436 pub selected_ip_address: std::string::String,
14437
14438 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14439}
14440
14441impl ServerlessExternalConnectionInfo {
14442 pub fn new() -> Self {
14443 std::default::Default::default()
14444 }
14445
14446 /// Sets the value of [selected_ip_address][crate::model::ServerlessExternalConnectionInfo::selected_ip_address].
14447 ///
14448 /// # Example
14449 /// ```ignore,no_run
14450 /// # use google_cloud_networkmanagement_v1::model::ServerlessExternalConnectionInfo;
14451 /// let x = ServerlessExternalConnectionInfo::new().set_selected_ip_address("example");
14452 /// ```
14453 pub fn set_selected_ip_address<T: std::convert::Into<std::string::String>>(
14454 mut self,
14455 v: T,
14456 ) -> Self {
14457 self.selected_ip_address = v.into();
14458 self
14459 }
14460}
14461
14462impl wkt::message::Message for ServerlessExternalConnectionInfo {
14463 fn typename() -> &'static str {
14464 "type.googleapis.com/google.cloud.networkmanagement.v1.ServerlessExternalConnectionInfo"
14465 }
14466}
14467
14468/// For display only. Metadata associated with NAT.
14469#[derive(Clone, Default, PartialEq)]
14470#[non_exhaustive]
14471pub struct NatInfo {
14472 /// Type of NAT.
14473 pub r#type: crate::model::nat_info::Type,
14474
14475 /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
14476 pub protocol: std::string::String,
14477
14478 /// URI of the network where NAT translation takes place.
14479 pub network_uri: std::string::String,
14480
14481 /// Source IP address before NAT translation.
14482 pub old_source_ip: std::string::String,
14483
14484 /// Source IP address after NAT translation.
14485 pub new_source_ip: std::string::String,
14486
14487 /// Destination IP address before NAT translation.
14488 pub old_destination_ip: std::string::String,
14489
14490 /// Destination IP address after NAT translation.
14491 pub new_destination_ip: std::string::String,
14492
14493 /// Source port before NAT translation. Only valid when protocol is TCP or UDP.
14494 pub old_source_port: i32,
14495
14496 /// Source port after NAT translation. Only valid when protocol is TCP or UDP.
14497 pub new_source_port: i32,
14498
14499 /// Destination port before NAT translation. Only valid when protocol is TCP or
14500 /// UDP.
14501 pub old_destination_port: i32,
14502
14503 /// Destination port after NAT translation. Only valid when protocol is TCP or
14504 /// UDP.
14505 pub new_destination_port: i32,
14506
14507 /// Uri of the Cloud Router. Only valid when type is CLOUD_NAT.
14508 pub router_uri: std::string::String,
14509
14510 /// The name of Cloud NAT Gateway. Only valid when type is CLOUD_NAT.
14511 pub nat_gateway_name: std::string::String,
14512
14513 /// Type of Cloud NAT gateway. Only valid when `type` is CLOUD_NAT.
14514 pub cloud_nat_gateway_type: crate::model::nat_info::CloudNatGatewayType,
14515
14516 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14517}
14518
14519impl NatInfo {
14520 pub fn new() -> Self {
14521 std::default::Default::default()
14522 }
14523
14524 /// Sets the value of [r#type][crate::model::NatInfo::type].
14525 ///
14526 /// # Example
14527 /// ```ignore,no_run
14528 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
14529 /// use google_cloud_networkmanagement_v1::model::nat_info::Type;
14530 /// let x0 = NatInfo::new().set_type(Type::InternalToExternal);
14531 /// let x1 = NatInfo::new().set_type(Type::ExternalToInternal);
14532 /// let x2 = NatInfo::new().set_type(Type::CloudNat);
14533 /// ```
14534 pub fn set_type<T: std::convert::Into<crate::model::nat_info::Type>>(mut self, v: T) -> Self {
14535 self.r#type = v.into();
14536 self
14537 }
14538
14539 /// Sets the value of [protocol][crate::model::NatInfo::protocol].
14540 ///
14541 /// # Example
14542 /// ```ignore,no_run
14543 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
14544 /// let x = NatInfo::new().set_protocol("example");
14545 /// ```
14546 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14547 self.protocol = v.into();
14548 self
14549 }
14550
14551 /// Sets the value of [network_uri][crate::model::NatInfo::network_uri].
14552 ///
14553 /// # Example
14554 /// ```ignore,no_run
14555 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
14556 /// let x = NatInfo::new().set_network_uri("example");
14557 /// ```
14558 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14559 self.network_uri = v.into();
14560 self
14561 }
14562
14563 /// Sets the value of [old_source_ip][crate::model::NatInfo::old_source_ip].
14564 ///
14565 /// # Example
14566 /// ```ignore,no_run
14567 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
14568 /// let x = NatInfo::new().set_old_source_ip("example");
14569 /// ```
14570 pub fn set_old_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14571 self.old_source_ip = v.into();
14572 self
14573 }
14574
14575 /// Sets the value of [new_source_ip][crate::model::NatInfo::new_source_ip].
14576 ///
14577 /// # Example
14578 /// ```ignore,no_run
14579 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
14580 /// let x = NatInfo::new().set_new_source_ip("example");
14581 /// ```
14582 pub fn set_new_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14583 self.new_source_ip = v.into();
14584 self
14585 }
14586
14587 /// Sets the value of [old_destination_ip][crate::model::NatInfo::old_destination_ip].
14588 ///
14589 /// # Example
14590 /// ```ignore,no_run
14591 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
14592 /// let x = NatInfo::new().set_old_destination_ip("example");
14593 /// ```
14594 pub fn set_old_destination_ip<T: std::convert::Into<std::string::String>>(
14595 mut self,
14596 v: T,
14597 ) -> Self {
14598 self.old_destination_ip = v.into();
14599 self
14600 }
14601
14602 /// Sets the value of [new_destination_ip][crate::model::NatInfo::new_destination_ip].
14603 ///
14604 /// # Example
14605 /// ```ignore,no_run
14606 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
14607 /// let x = NatInfo::new().set_new_destination_ip("example");
14608 /// ```
14609 pub fn set_new_destination_ip<T: std::convert::Into<std::string::String>>(
14610 mut self,
14611 v: T,
14612 ) -> Self {
14613 self.new_destination_ip = v.into();
14614 self
14615 }
14616
14617 /// Sets the value of [old_source_port][crate::model::NatInfo::old_source_port].
14618 ///
14619 /// # Example
14620 /// ```ignore,no_run
14621 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
14622 /// let x = NatInfo::new().set_old_source_port(42);
14623 /// ```
14624 pub fn set_old_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14625 self.old_source_port = v.into();
14626 self
14627 }
14628
14629 /// Sets the value of [new_source_port][crate::model::NatInfo::new_source_port].
14630 ///
14631 /// # Example
14632 /// ```ignore,no_run
14633 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
14634 /// let x = NatInfo::new().set_new_source_port(42);
14635 /// ```
14636 pub fn set_new_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14637 self.new_source_port = v.into();
14638 self
14639 }
14640
14641 /// Sets the value of [old_destination_port][crate::model::NatInfo::old_destination_port].
14642 ///
14643 /// # Example
14644 /// ```ignore,no_run
14645 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
14646 /// let x = NatInfo::new().set_old_destination_port(42);
14647 /// ```
14648 pub fn set_old_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14649 self.old_destination_port = v.into();
14650 self
14651 }
14652
14653 /// Sets the value of [new_destination_port][crate::model::NatInfo::new_destination_port].
14654 ///
14655 /// # Example
14656 /// ```ignore,no_run
14657 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
14658 /// let x = NatInfo::new().set_new_destination_port(42);
14659 /// ```
14660 pub fn set_new_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14661 self.new_destination_port = v.into();
14662 self
14663 }
14664
14665 /// Sets the value of [router_uri][crate::model::NatInfo::router_uri].
14666 ///
14667 /// # Example
14668 /// ```ignore,no_run
14669 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
14670 /// let x = NatInfo::new().set_router_uri("example");
14671 /// ```
14672 pub fn set_router_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14673 self.router_uri = v.into();
14674 self
14675 }
14676
14677 /// Sets the value of [nat_gateway_name][crate::model::NatInfo::nat_gateway_name].
14678 ///
14679 /// # Example
14680 /// ```ignore,no_run
14681 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
14682 /// let x = NatInfo::new().set_nat_gateway_name("example");
14683 /// ```
14684 pub fn set_nat_gateway_name<T: std::convert::Into<std::string::String>>(
14685 mut self,
14686 v: T,
14687 ) -> Self {
14688 self.nat_gateway_name = v.into();
14689 self
14690 }
14691
14692 /// Sets the value of [cloud_nat_gateway_type][crate::model::NatInfo::cloud_nat_gateway_type].
14693 ///
14694 /// # Example
14695 /// ```ignore,no_run
14696 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
14697 /// use google_cloud_networkmanagement_v1::model::nat_info::CloudNatGatewayType;
14698 /// let x0 = NatInfo::new().set_cloud_nat_gateway_type(CloudNatGatewayType::PublicNat44);
14699 /// let x1 = NatInfo::new().set_cloud_nat_gateway_type(CloudNatGatewayType::PublicNat64);
14700 /// let x2 = NatInfo::new().set_cloud_nat_gateway_type(CloudNatGatewayType::PrivateNatNcc);
14701 /// ```
14702 pub fn set_cloud_nat_gateway_type<
14703 T: std::convert::Into<crate::model::nat_info::CloudNatGatewayType>,
14704 >(
14705 mut self,
14706 v: T,
14707 ) -> Self {
14708 self.cloud_nat_gateway_type = v.into();
14709 self
14710 }
14711}
14712
14713impl wkt::message::Message for NatInfo {
14714 fn typename() -> &'static str {
14715 "type.googleapis.com/google.cloud.networkmanagement.v1.NatInfo"
14716 }
14717}
14718
14719/// Defines additional types related to [NatInfo].
14720pub mod nat_info {
14721 #[allow(unused_imports)]
14722 use super::*;
14723
14724 /// Types of NAT.
14725 ///
14726 /// # Working with unknown values
14727 ///
14728 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14729 /// additional enum variants at any time. Adding new variants is not considered
14730 /// a breaking change. Applications should write their code in anticipation of:
14731 ///
14732 /// - New values appearing in future releases of the client library, **and**
14733 /// - New values received dynamically, without application changes.
14734 ///
14735 /// Please consult the [Working with enums] section in the user guide for some
14736 /// guidelines.
14737 ///
14738 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14739 #[derive(Clone, Debug, PartialEq)]
14740 #[non_exhaustive]
14741 pub enum Type {
14742 /// Type is unspecified.
14743 Unspecified,
14744 /// From Compute Engine instance's internal address to external address.
14745 InternalToExternal,
14746 /// From Compute Engine instance's external address to internal address.
14747 ExternalToInternal,
14748 /// Cloud NAT Gateway.
14749 CloudNat,
14750 /// Private service connect NAT.
14751 PrivateServiceConnect,
14752 /// GKE Pod IP address masquerading.
14753 GkePodIpMasquerading,
14754 /// If set, the enum was initialized with an unknown value.
14755 ///
14756 /// Applications can examine the value using [Type::value] or
14757 /// [Type::name].
14758 UnknownValue(r#type::UnknownValue),
14759 }
14760
14761 #[doc(hidden)]
14762 pub mod r#type {
14763 #[allow(unused_imports)]
14764 use super::*;
14765 #[derive(Clone, Debug, PartialEq)]
14766 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14767 }
14768
14769 impl Type {
14770 /// Gets the enum value.
14771 ///
14772 /// Returns `None` if the enum contains an unknown value deserialized from
14773 /// the string representation of enums.
14774 pub fn value(&self) -> std::option::Option<i32> {
14775 match self {
14776 Self::Unspecified => std::option::Option::Some(0),
14777 Self::InternalToExternal => std::option::Option::Some(1),
14778 Self::ExternalToInternal => std::option::Option::Some(2),
14779 Self::CloudNat => std::option::Option::Some(3),
14780 Self::PrivateServiceConnect => std::option::Option::Some(4),
14781 Self::GkePodIpMasquerading => std::option::Option::Some(5),
14782 Self::UnknownValue(u) => u.0.value(),
14783 }
14784 }
14785
14786 /// Gets the enum value as a string.
14787 ///
14788 /// Returns `None` if the enum contains an unknown value deserialized from
14789 /// the integer representation of enums.
14790 pub fn name(&self) -> std::option::Option<&str> {
14791 match self {
14792 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
14793 Self::InternalToExternal => std::option::Option::Some("INTERNAL_TO_EXTERNAL"),
14794 Self::ExternalToInternal => std::option::Option::Some("EXTERNAL_TO_INTERNAL"),
14795 Self::CloudNat => std::option::Option::Some("CLOUD_NAT"),
14796 Self::PrivateServiceConnect => std::option::Option::Some("PRIVATE_SERVICE_CONNECT"),
14797 Self::GkePodIpMasquerading => std::option::Option::Some("GKE_POD_IP_MASQUERADING"),
14798 Self::UnknownValue(u) => u.0.name(),
14799 }
14800 }
14801 }
14802
14803 impl std::default::Default for Type {
14804 fn default() -> Self {
14805 use std::convert::From;
14806 Self::from(0)
14807 }
14808 }
14809
14810 impl std::fmt::Display for Type {
14811 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14812 wkt::internal::display_enum(f, self.name(), self.value())
14813 }
14814 }
14815
14816 impl std::convert::From<i32> for Type {
14817 fn from(value: i32) -> Self {
14818 match value {
14819 0 => Self::Unspecified,
14820 1 => Self::InternalToExternal,
14821 2 => Self::ExternalToInternal,
14822 3 => Self::CloudNat,
14823 4 => Self::PrivateServiceConnect,
14824 5 => Self::GkePodIpMasquerading,
14825 _ => Self::UnknownValue(r#type::UnknownValue(
14826 wkt::internal::UnknownEnumValue::Integer(value),
14827 )),
14828 }
14829 }
14830 }
14831
14832 impl std::convert::From<&str> for Type {
14833 fn from(value: &str) -> Self {
14834 use std::string::ToString;
14835 match value {
14836 "TYPE_UNSPECIFIED" => Self::Unspecified,
14837 "INTERNAL_TO_EXTERNAL" => Self::InternalToExternal,
14838 "EXTERNAL_TO_INTERNAL" => Self::ExternalToInternal,
14839 "CLOUD_NAT" => Self::CloudNat,
14840 "PRIVATE_SERVICE_CONNECT" => Self::PrivateServiceConnect,
14841 "GKE_POD_IP_MASQUERADING" => Self::GkePodIpMasquerading,
14842 _ => Self::UnknownValue(r#type::UnknownValue(
14843 wkt::internal::UnknownEnumValue::String(value.to_string()),
14844 )),
14845 }
14846 }
14847 }
14848
14849 impl serde::ser::Serialize for Type {
14850 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14851 where
14852 S: serde::Serializer,
14853 {
14854 match self {
14855 Self::Unspecified => serializer.serialize_i32(0),
14856 Self::InternalToExternal => serializer.serialize_i32(1),
14857 Self::ExternalToInternal => serializer.serialize_i32(2),
14858 Self::CloudNat => serializer.serialize_i32(3),
14859 Self::PrivateServiceConnect => serializer.serialize_i32(4),
14860 Self::GkePodIpMasquerading => serializer.serialize_i32(5),
14861 Self::UnknownValue(u) => u.0.serialize(serializer),
14862 }
14863 }
14864 }
14865
14866 impl<'de> serde::de::Deserialize<'de> for Type {
14867 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14868 where
14869 D: serde::Deserializer<'de>,
14870 {
14871 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
14872 ".google.cloud.networkmanagement.v1.NatInfo.Type",
14873 ))
14874 }
14875 }
14876
14877 /// Types of Cloud NAT gateway.
14878 ///
14879 /// # Working with unknown values
14880 ///
14881 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14882 /// additional enum variants at any time. Adding new variants is not considered
14883 /// a breaking change. Applications should write their code in anticipation of:
14884 ///
14885 /// - New values appearing in future releases of the client library, **and**
14886 /// - New values received dynamically, without application changes.
14887 ///
14888 /// Please consult the [Working with enums] section in the user guide for some
14889 /// guidelines.
14890 ///
14891 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14892 #[derive(Clone, Debug, PartialEq)]
14893 #[non_exhaustive]
14894 pub enum CloudNatGatewayType {
14895 /// Type is unspecified.
14896 Unspecified,
14897 /// Public NAT gateway.
14898 PublicNat44,
14899 /// Public NAT64 gateway.
14900 PublicNat64,
14901 /// Private NAT gateway for NCC.
14902 PrivateNatNcc,
14903 /// Private NAT gateway for hybrid connectivity.
14904 PrivateNatHybrid,
14905 /// Private NAT64 gateway.
14906 PrivateNat64,
14907 /// If set, the enum was initialized with an unknown value.
14908 ///
14909 /// Applications can examine the value using [CloudNatGatewayType::value] or
14910 /// [CloudNatGatewayType::name].
14911 UnknownValue(cloud_nat_gateway_type::UnknownValue),
14912 }
14913
14914 #[doc(hidden)]
14915 pub mod cloud_nat_gateway_type {
14916 #[allow(unused_imports)]
14917 use super::*;
14918 #[derive(Clone, Debug, PartialEq)]
14919 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14920 }
14921
14922 impl CloudNatGatewayType {
14923 /// Gets the enum value.
14924 ///
14925 /// Returns `None` if the enum contains an unknown value deserialized from
14926 /// the string representation of enums.
14927 pub fn value(&self) -> std::option::Option<i32> {
14928 match self {
14929 Self::Unspecified => std::option::Option::Some(0),
14930 Self::PublicNat44 => std::option::Option::Some(1),
14931 Self::PublicNat64 => std::option::Option::Some(2),
14932 Self::PrivateNatNcc => std::option::Option::Some(3),
14933 Self::PrivateNatHybrid => std::option::Option::Some(4),
14934 Self::PrivateNat64 => std::option::Option::Some(5),
14935 Self::UnknownValue(u) => u.0.value(),
14936 }
14937 }
14938
14939 /// Gets the enum value as a string.
14940 ///
14941 /// Returns `None` if the enum contains an unknown value deserialized from
14942 /// the integer representation of enums.
14943 pub fn name(&self) -> std::option::Option<&str> {
14944 match self {
14945 Self::Unspecified => {
14946 std::option::Option::Some("CLOUD_NAT_GATEWAY_TYPE_UNSPECIFIED")
14947 }
14948 Self::PublicNat44 => std::option::Option::Some("PUBLIC_NAT44"),
14949 Self::PublicNat64 => std::option::Option::Some("PUBLIC_NAT64"),
14950 Self::PrivateNatNcc => std::option::Option::Some("PRIVATE_NAT_NCC"),
14951 Self::PrivateNatHybrid => std::option::Option::Some("PRIVATE_NAT_HYBRID"),
14952 Self::PrivateNat64 => std::option::Option::Some("PRIVATE_NAT64"),
14953 Self::UnknownValue(u) => u.0.name(),
14954 }
14955 }
14956 }
14957
14958 impl std::default::Default for CloudNatGatewayType {
14959 fn default() -> Self {
14960 use std::convert::From;
14961 Self::from(0)
14962 }
14963 }
14964
14965 impl std::fmt::Display for CloudNatGatewayType {
14966 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14967 wkt::internal::display_enum(f, self.name(), self.value())
14968 }
14969 }
14970
14971 impl std::convert::From<i32> for CloudNatGatewayType {
14972 fn from(value: i32) -> Self {
14973 match value {
14974 0 => Self::Unspecified,
14975 1 => Self::PublicNat44,
14976 2 => Self::PublicNat64,
14977 3 => Self::PrivateNatNcc,
14978 4 => Self::PrivateNatHybrid,
14979 5 => Self::PrivateNat64,
14980 _ => Self::UnknownValue(cloud_nat_gateway_type::UnknownValue(
14981 wkt::internal::UnknownEnumValue::Integer(value),
14982 )),
14983 }
14984 }
14985 }
14986
14987 impl std::convert::From<&str> for CloudNatGatewayType {
14988 fn from(value: &str) -> Self {
14989 use std::string::ToString;
14990 match value {
14991 "CLOUD_NAT_GATEWAY_TYPE_UNSPECIFIED" => Self::Unspecified,
14992 "PUBLIC_NAT44" => Self::PublicNat44,
14993 "PUBLIC_NAT64" => Self::PublicNat64,
14994 "PRIVATE_NAT_NCC" => Self::PrivateNatNcc,
14995 "PRIVATE_NAT_HYBRID" => Self::PrivateNatHybrid,
14996 "PRIVATE_NAT64" => Self::PrivateNat64,
14997 _ => Self::UnknownValue(cloud_nat_gateway_type::UnknownValue(
14998 wkt::internal::UnknownEnumValue::String(value.to_string()),
14999 )),
15000 }
15001 }
15002 }
15003
15004 impl serde::ser::Serialize for CloudNatGatewayType {
15005 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15006 where
15007 S: serde::Serializer,
15008 {
15009 match self {
15010 Self::Unspecified => serializer.serialize_i32(0),
15011 Self::PublicNat44 => serializer.serialize_i32(1),
15012 Self::PublicNat64 => serializer.serialize_i32(2),
15013 Self::PrivateNatNcc => serializer.serialize_i32(3),
15014 Self::PrivateNatHybrid => serializer.serialize_i32(4),
15015 Self::PrivateNat64 => serializer.serialize_i32(5),
15016 Self::UnknownValue(u) => u.0.serialize(serializer),
15017 }
15018 }
15019 }
15020
15021 impl<'de> serde::de::Deserialize<'de> for CloudNatGatewayType {
15022 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15023 where
15024 D: serde::Deserializer<'de>,
15025 {
15026 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudNatGatewayType>::new(
15027 ".google.cloud.networkmanagement.v1.NatInfo.CloudNatGatewayType",
15028 ))
15029 }
15030 }
15031}
15032
15033/// For display only. Metadata associated with ProxyConnection.
15034#[derive(Clone, Default, PartialEq)]
15035#[non_exhaustive]
15036pub struct ProxyConnectionInfo {
15037 /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
15038 pub protocol: std::string::String,
15039
15040 /// Source IP address of an original connection.
15041 pub old_source_ip: std::string::String,
15042
15043 /// Source IP address of a new connection.
15044 pub new_source_ip: std::string::String,
15045
15046 /// Destination IP address of an original connection
15047 pub old_destination_ip: std::string::String,
15048
15049 /// Destination IP address of a new connection.
15050 pub new_destination_ip: std::string::String,
15051
15052 /// Source port of an original connection. Only valid when protocol is TCP or
15053 /// UDP.
15054 pub old_source_port: i32,
15055
15056 /// Source port of a new connection. Only valid when protocol is TCP or UDP.
15057 pub new_source_port: i32,
15058
15059 /// Destination port of an original connection. Only valid when protocol is TCP
15060 /// or UDP.
15061 pub old_destination_port: i32,
15062
15063 /// Destination port of a new connection. Only valid when protocol is TCP or
15064 /// UDP.
15065 pub new_destination_port: i32,
15066
15067 /// Uri of proxy subnet.
15068 pub subnet_uri: std::string::String,
15069
15070 /// URI of the network where connection is proxied.
15071 pub network_uri: std::string::String,
15072
15073 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15074}
15075
15076impl ProxyConnectionInfo {
15077 pub fn new() -> Self {
15078 std::default::Default::default()
15079 }
15080
15081 /// Sets the value of [protocol][crate::model::ProxyConnectionInfo::protocol].
15082 ///
15083 /// # Example
15084 /// ```ignore,no_run
15085 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15086 /// let x = ProxyConnectionInfo::new().set_protocol("example");
15087 /// ```
15088 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15089 self.protocol = v.into();
15090 self
15091 }
15092
15093 /// Sets the value of [old_source_ip][crate::model::ProxyConnectionInfo::old_source_ip].
15094 ///
15095 /// # Example
15096 /// ```ignore,no_run
15097 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15098 /// let x = ProxyConnectionInfo::new().set_old_source_ip("example");
15099 /// ```
15100 pub fn set_old_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15101 self.old_source_ip = v.into();
15102 self
15103 }
15104
15105 /// Sets the value of [new_source_ip][crate::model::ProxyConnectionInfo::new_source_ip].
15106 ///
15107 /// # Example
15108 /// ```ignore,no_run
15109 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15110 /// let x = ProxyConnectionInfo::new().set_new_source_ip("example");
15111 /// ```
15112 pub fn set_new_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15113 self.new_source_ip = v.into();
15114 self
15115 }
15116
15117 /// Sets the value of [old_destination_ip][crate::model::ProxyConnectionInfo::old_destination_ip].
15118 ///
15119 /// # Example
15120 /// ```ignore,no_run
15121 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15122 /// let x = ProxyConnectionInfo::new().set_old_destination_ip("example");
15123 /// ```
15124 pub fn set_old_destination_ip<T: std::convert::Into<std::string::String>>(
15125 mut self,
15126 v: T,
15127 ) -> Self {
15128 self.old_destination_ip = v.into();
15129 self
15130 }
15131
15132 /// Sets the value of [new_destination_ip][crate::model::ProxyConnectionInfo::new_destination_ip].
15133 ///
15134 /// # Example
15135 /// ```ignore,no_run
15136 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15137 /// let x = ProxyConnectionInfo::new().set_new_destination_ip("example");
15138 /// ```
15139 pub fn set_new_destination_ip<T: std::convert::Into<std::string::String>>(
15140 mut self,
15141 v: T,
15142 ) -> Self {
15143 self.new_destination_ip = v.into();
15144 self
15145 }
15146
15147 /// Sets the value of [old_source_port][crate::model::ProxyConnectionInfo::old_source_port].
15148 ///
15149 /// # Example
15150 /// ```ignore,no_run
15151 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15152 /// let x = ProxyConnectionInfo::new().set_old_source_port(42);
15153 /// ```
15154 pub fn set_old_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15155 self.old_source_port = v.into();
15156 self
15157 }
15158
15159 /// Sets the value of [new_source_port][crate::model::ProxyConnectionInfo::new_source_port].
15160 ///
15161 /// # Example
15162 /// ```ignore,no_run
15163 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15164 /// let x = ProxyConnectionInfo::new().set_new_source_port(42);
15165 /// ```
15166 pub fn set_new_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15167 self.new_source_port = v.into();
15168 self
15169 }
15170
15171 /// Sets the value of [old_destination_port][crate::model::ProxyConnectionInfo::old_destination_port].
15172 ///
15173 /// # Example
15174 /// ```ignore,no_run
15175 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15176 /// let x = ProxyConnectionInfo::new().set_old_destination_port(42);
15177 /// ```
15178 pub fn set_old_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15179 self.old_destination_port = v.into();
15180 self
15181 }
15182
15183 /// Sets the value of [new_destination_port][crate::model::ProxyConnectionInfo::new_destination_port].
15184 ///
15185 /// # Example
15186 /// ```ignore,no_run
15187 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15188 /// let x = ProxyConnectionInfo::new().set_new_destination_port(42);
15189 /// ```
15190 pub fn set_new_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15191 self.new_destination_port = v.into();
15192 self
15193 }
15194
15195 /// Sets the value of [subnet_uri][crate::model::ProxyConnectionInfo::subnet_uri].
15196 ///
15197 /// # Example
15198 /// ```ignore,no_run
15199 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15200 /// let x = ProxyConnectionInfo::new().set_subnet_uri("example");
15201 /// ```
15202 pub fn set_subnet_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15203 self.subnet_uri = v.into();
15204 self
15205 }
15206
15207 /// Sets the value of [network_uri][crate::model::ProxyConnectionInfo::network_uri].
15208 ///
15209 /// # Example
15210 /// ```ignore,no_run
15211 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15212 /// let x = ProxyConnectionInfo::new().set_network_uri("example");
15213 /// ```
15214 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15215 self.network_uri = v.into();
15216 self
15217 }
15218}
15219
15220impl wkt::message::Message for ProxyConnectionInfo {
15221 fn typename() -> &'static str {
15222 "type.googleapis.com/google.cloud.networkmanagement.v1.ProxyConnectionInfo"
15223 }
15224}
15225
15226/// For display only. Metadata associated with the load balancer backend.
15227#[derive(Clone, Default, PartialEq)]
15228#[non_exhaustive]
15229pub struct LoadBalancerBackendInfo {
15230 /// Display name of the backend. For example, it might be an instance name for
15231 /// the instance group backends, or an IP address and port for zonal network
15232 /// endpoint group backends.
15233 pub name: std::string::String,
15234
15235 /// URI of the backend instance (if applicable). Populated for instance group
15236 /// backends, and zonal NEG backends.
15237 pub instance_uri: std::string::String,
15238
15239 /// URI of the backend service this backend belongs to (if applicable).
15240 pub backend_service_uri: std::string::String,
15241
15242 /// URI of the instance group this backend belongs to (if applicable).
15243 pub instance_group_uri: std::string::String,
15244
15245 /// URI of the network endpoint group this backend belongs to (if applicable).
15246 pub network_endpoint_group_uri: std::string::String,
15247
15248 /// URI of the backend bucket this backend targets (if applicable).
15249 pub backend_bucket_uri: std::string::String,
15250
15251 /// URI of the PSC service attachment this PSC NEG backend targets (if
15252 /// applicable).
15253 pub psc_service_attachment_uri: std::string::String,
15254
15255 /// PSC Google API target this PSC NEG backend targets (if applicable).
15256 pub psc_google_api_target: std::string::String,
15257
15258 /// URI of the health check attached to this backend (if applicable).
15259 pub health_check_uri: std::string::String,
15260
15261 /// Output only. Health check firewalls configuration state for the backend.
15262 /// This is a result of the static firewall analysis (verifying that health
15263 /// check traffic from required IP ranges to the backend is allowed or not).
15264 /// The backend might still be unhealthy even if these firewalls are
15265 /// configured. Please refer to the documentation for more information:
15266 /// <https://cloud.google.com/load-balancing/docs/firewall-rules>
15267 pub health_check_firewalls_config_state:
15268 crate::model::load_balancer_backend_info::HealthCheckFirewallsConfigState,
15269
15270 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15271}
15272
15273impl LoadBalancerBackendInfo {
15274 pub fn new() -> Self {
15275 std::default::Default::default()
15276 }
15277
15278 /// Sets the value of [name][crate::model::LoadBalancerBackendInfo::name].
15279 ///
15280 /// # Example
15281 /// ```ignore,no_run
15282 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
15283 /// let x = LoadBalancerBackendInfo::new().set_name("example");
15284 /// ```
15285 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15286 self.name = v.into();
15287 self
15288 }
15289
15290 /// Sets the value of [instance_uri][crate::model::LoadBalancerBackendInfo::instance_uri].
15291 ///
15292 /// # Example
15293 /// ```ignore,no_run
15294 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
15295 /// let x = LoadBalancerBackendInfo::new().set_instance_uri("example");
15296 /// ```
15297 pub fn set_instance_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15298 self.instance_uri = v.into();
15299 self
15300 }
15301
15302 /// Sets the value of [backend_service_uri][crate::model::LoadBalancerBackendInfo::backend_service_uri].
15303 ///
15304 /// # Example
15305 /// ```ignore,no_run
15306 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
15307 /// let x = LoadBalancerBackendInfo::new().set_backend_service_uri("example");
15308 /// ```
15309 pub fn set_backend_service_uri<T: std::convert::Into<std::string::String>>(
15310 mut self,
15311 v: T,
15312 ) -> Self {
15313 self.backend_service_uri = v.into();
15314 self
15315 }
15316
15317 /// Sets the value of [instance_group_uri][crate::model::LoadBalancerBackendInfo::instance_group_uri].
15318 ///
15319 /// # Example
15320 /// ```ignore,no_run
15321 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
15322 /// let x = LoadBalancerBackendInfo::new().set_instance_group_uri("example");
15323 /// ```
15324 pub fn set_instance_group_uri<T: std::convert::Into<std::string::String>>(
15325 mut self,
15326 v: T,
15327 ) -> Self {
15328 self.instance_group_uri = v.into();
15329 self
15330 }
15331
15332 /// Sets the value of [network_endpoint_group_uri][crate::model::LoadBalancerBackendInfo::network_endpoint_group_uri].
15333 ///
15334 /// # Example
15335 /// ```ignore,no_run
15336 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
15337 /// let x = LoadBalancerBackendInfo::new().set_network_endpoint_group_uri("example");
15338 /// ```
15339 pub fn set_network_endpoint_group_uri<T: std::convert::Into<std::string::String>>(
15340 mut self,
15341 v: T,
15342 ) -> Self {
15343 self.network_endpoint_group_uri = v.into();
15344 self
15345 }
15346
15347 /// Sets the value of [backend_bucket_uri][crate::model::LoadBalancerBackendInfo::backend_bucket_uri].
15348 ///
15349 /// # Example
15350 /// ```ignore,no_run
15351 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
15352 /// let x = LoadBalancerBackendInfo::new().set_backend_bucket_uri("example");
15353 /// ```
15354 pub fn set_backend_bucket_uri<T: std::convert::Into<std::string::String>>(
15355 mut self,
15356 v: T,
15357 ) -> Self {
15358 self.backend_bucket_uri = v.into();
15359 self
15360 }
15361
15362 /// Sets the value of [psc_service_attachment_uri][crate::model::LoadBalancerBackendInfo::psc_service_attachment_uri].
15363 ///
15364 /// # Example
15365 /// ```ignore,no_run
15366 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
15367 /// let x = LoadBalancerBackendInfo::new().set_psc_service_attachment_uri("example");
15368 /// ```
15369 pub fn set_psc_service_attachment_uri<T: std::convert::Into<std::string::String>>(
15370 mut self,
15371 v: T,
15372 ) -> Self {
15373 self.psc_service_attachment_uri = v.into();
15374 self
15375 }
15376
15377 /// Sets the value of [psc_google_api_target][crate::model::LoadBalancerBackendInfo::psc_google_api_target].
15378 ///
15379 /// # Example
15380 /// ```ignore,no_run
15381 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
15382 /// let x = LoadBalancerBackendInfo::new().set_psc_google_api_target("example");
15383 /// ```
15384 pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
15385 mut self,
15386 v: T,
15387 ) -> Self {
15388 self.psc_google_api_target = v.into();
15389 self
15390 }
15391
15392 /// Sets the value of [health_check_uri][crate::model::LoadBalancerBackendInfo::health_check_uri].
15393 ///
15394 /// # Example
15395 /// ```ignore,no_run
15396 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
15397 /// let x = LoadBalancerBackendInfo::new().set_health_check_uri("example");
15398 /// ```
15399 pub fn set_health_check_uri<T: std::convert::Into<std::string::String>>(
15400 mut self,
15401 v: T,
15402 ) -> Self {
15403 self.health_check_uri = v.into();
15404 self
15405 }
15406
15407 /// Sets the value of [health_check_firewalls_config_state][crate::model::LoadBalancerBackendInfo::health_check_firewalls_config_state].
15408 ///
15409 /// # Example
15410 /// ```ignore,no_run
15411 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
15412 /// use google_cloud_networkmanagement_v1::model::load_balancer_backend_info::HealthCheckFirewallsConfigState;
15413 /// let x0 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsConfigured);
15414 /// let x1 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsPartiallyConfigured);
15415 /// let x2 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsNotConfigured);
15416 /// ```
15417 pub fn set_health_check_firewalls_config_state<
15418 T: std::convert::Into<
15419 crate::model::load_balancer_backend_info::HealthCheckFirewallsConfigState,
15420 >,
15421 >(
15422 mut self,
15423 v: T,
15424 ) -> Self {
15425 self.health_check_firewalls_config_state = v.into();
15426 self
15427 }
15428}
15429
15430impl wkt::message::Message for LoadBalancerBackendInfo {
15431 fn typename() -> &'static str {
15432 "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerBackendInfo"
15433 }
15434}
15435
15436/// Defines additional types related to [LoadBalancerBackendInfo].
15437pub mod load_balancer_backend_info {
15438 #[allow(unused_imports)]
15439 use super::*;
15440
15441 /// Health check firewalls configuration state enum.
15442 ///
15443 /// # Working with unknown values
15444 ///
15445 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15446 /// additional enum variants at any time. Adding new variants is not considered
15447 /// a breaking change. Applications should write their code in anticipation of:
15448 ///
15449 /// - New values appearing in future releases of the client library, **and**
15450 /// - New values received dynamically, without application changes.
15451 ///
15452 /// Please consult the [Working with enums] section in the user guide for some
15453 /// guidelines.
15454 ///
15455 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15456 #[derive(Clone, Debug, PartialEq)]
15457 #[non_exhaustive]
15458 pub enum HealthCheckFirewallsConfigState {
15459 /// Configuration state unspecified. It usually means that the backend has
15460 /// no health check attached, or there was an unexpected configuration error
15461 /// preventing Connectivity tests from verifying health check configuration.
15462 Unspecified,
15463 /// Firewall rules (policies) allowing health check traffic from all required
15464 /// IP ranges to the backend are configured.
15465 FirewallsConfigured,
15466 /// Firewall rules (policies) allow health check traffic only from a part of
15467 /// required IP ranges.
15468 FirewallsPartiallyConfigured,
15469 /// Firewall rules (policies) deny health check traffic from all required
15470 /// IP ranges to the backend.
15471 FirewallsNotConfigured,
15472 /// The network contains firewall rules of unsupported types, so Connectivity
15473 /// tests were not able to verify health check configuration status. Please
15474 /// refer to the documentation for the list of unsupported configurations:
15475 /// <https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/concepts/overview#unsupported-configs>
15476 FirewallsUnsupported,
15477 /// If set, the enum was initialized with an unknown value.
15478 ///
15479 /// Applications can examine the value using [HealthCheckFirewallsConfigState::value] or
15480 /// [HealthCheckFirewallsConfigState::name].
15481 UnknownValue(health_check_firewalls_config_state::UnknownValue),
15482 }
15483
15484 #[doc(hidden)]
15485 pub mod health_check_firewalls_config_state {
15486 #[allow(unused_imports)]
15487 use super::*;
15488 #[derive(Clone, Debug, PartialEq)]
15489 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15490 }
15491
15492 impl HealthCheckFirewallsConfigState {
15493 /// Gets the enum value.
15494 ///
15495 /// Returns `None` if the enum contains an unknown value deserialized from
15496 /// the string representation of enums.
15497 pub fn value(&self) -> std::option::Option<i32> {
15498 match self {
15499 Self::Unspecified => std::option::Option::Some(0),
15500 Self::FirewallsConfigured => std::option::Option::Some(1),
15501 Self::FirewallsPartiallyConfigured => std::option::Option::Some(2),
15502 Self::FirewallsNotConfigured => std::option::Option::Some(3),
15503 Self::FirewallsUnsupported => std::option::Option::Some(4),
15504 Self::UnknownValue(u) => u.0.value(),
15505 }
15506 }
15507
15508 /// Gets the enum value as a string.
15509 ///
15510 /// Returns `None` if the enum contains an unknown value deserialized from
15511 /// the integer representation of enums.
15512 pub fn name(&self) -> std::option::Option<&str> {
15513 match self {
15514 Self::Unspecified => {
15515 std::option::Option::Some("HEALTH_CHECK_FIREWALLS_CONFIG_STATE_UNSPECIFIED")
15516 }
15517 Self::FirewallsConfigured => std::option::Option::Some("FIREWALLS_CONFIGURED"),
15518 Self::FirewallsPartiallyConfigured => {
15519 std::option::Option::Some("FIREWALLS_PARTIALLY_CONFIGURED")
15520 }
15521 Self::FirewallsNotConfigured => {
15522 std::option::Option::Some("FIREWALLS_NOT_CONFIGURED")
15523 }
15524 Self::FirewallsUnsupported => std::option::Option::Some("FIREWALLS_UNSUPPORTED"),
15525 Self::UnknownValue(u) => u.0.name(),
15526 }
15527 }
15528 }
15529
15530 impl std::default::Default for HealthCheckFirewallsConfigState {
15531 fn default() -> Self {
15532 use std::convert::From;
15533 Self::from(0)
15534 }
15535 }
15536
15537 impl std::fmt::Display for HealthCheckFirewallsConfigState {
15538 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15539 wkt::internal::display_enum(f, self.name(), self.value())
15540 }
15541 }
15542
15543 impl std::convert::From<i32> for HealthCheckFirewallsConfigState {
15544 fn from(value: i32) -> Self {
15545 match value {
15546 0 => Self::Unspecified,
15547 1 => Self::FirewallsConfigured,
15548 2 => Self::FirewallsPartiallyConfigured,
15549 3 => Self::FirewallsNotConfigured,
15550 4 => Self::FirewallsUnsupported,
15551 _ => Self::UnknownValue(health_check_firewalls_config_state::UnknownValue(
15552 wkt::internal::UnknownEnumValue::Integer(value),
15553 )),
15554 }
15555 }
15556 }
15557
15558 impl std::convert::From<&str> for HealthCheckFirewallsConfigState {
15559 fn from(value: &str) -> Self {
15560 use std::string::ToString;
15561 match value {
15562 "HEALTH_CHECK_FIREWALLS_CONFIG_STATE_UNSPECIFIED" => Self::Unspecified,
15563 "FIREWALLS_CONFIGURED" => Self::FirewallsConfigured,
15564 "FIREWALLS_PARTIALLY_CONFIGURED" => Self::FirewallsPartiallyConfigured,
15565 "FIREWALLS_NOT_CONFIGURED" => Self::FirewallsNotConfigured,
15566 "FIREWALLS_UNSUPPORTED" => Self::FirewallsUnsupported,
15567 _ => Self::UnknownValue(health_check_firewalls_config_state::UnknownValue(
15568 wkt::internal::UnknownEnumValue::String(value.to_string()),
15569 )),
15570 }
15571 }
15572 }
15573
15574 impl serde::ser::Serialize for HealthCheckFirewallsConfigState {
15575 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15576 where
15577 S: serde::Serializer,
15578 {
15579 match self {
15580 Self::Unspecified => serializer.serialize_i32(0),
15581 Self::FirewallsConfigured => serializer.serialize_i32(1),
15582 Self::FirewallsPartiallyConfigured => serializer.serialize_i32(2),
15583 Self::FirewallsNotConfigured => serializer.serialize_i32(3),
15584 Self::FirewallsUnsupported => serializer.serialize_i32(4),
15585 Self::UnknownValue(u) => u.0.serialize(serializer),
15586 }
15587 }
15588 }
15589
15590 impl<'de> serde::de::Deserialize<'de> for HealthCheckFirewallsConfigState {
15591 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15592 where
15593 D: serde::Deserializer<'de>,
15594 {
15595 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HealthCheckFirewallsConfigState>::new(
15596 ".google.cloud.networkmanagement.v1.LoadBalancerBackendInfo.HealthCheckFirewallsConfigState"))
15597 }
15598 }
15599}
15600
15601/// For display only. Metadata associated with Storage Bucket.
15602#[derive(Clone, Default, PartialEq)]
15603#[non_exhaustive]
15604pub struct StorageBucketInfo {
15605 /// Cloud Storage Bucket name.
15606 pub bucket: std::string::String,
15607
15608 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15609}
15610
15611impl StorageBucketInfo {
15612 pub fn new() -> Self {
15613 std::default::Default::default()
15614 }
15615
15616 /// Sets the value of [bucket][crate::model::StorageBucketInfo::bucket].
15617 ///
15618 /// # Example
15619 /// ```ignore,no_run
15620 /// # use google_cloud_networkmanagement_v1::model::StorageBucketInfo;
15621 /// let x = StorageBucketInfo::new().set_bucket("example");
15622 /// ```
15623 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15624 self.bucket = v.into();
15625 self
15626 }
15627}
15628
15629impl wkt::message::Message for StorageBucketInfo {
15630 fn typename() -> &'static str {
15631 "type.googleapis.com/google.cloud.networkmanagement.v1.StorageBucketInfo"
15632 }
15633}
15634
15635/// For display only. Metadata associated with the serverless network endpoint
15636/// group backend.
15637#[derive(Clone, Default, PartialEq)]
15638#[non_exhaustive]
15639pub struct ServerlessNegInfo {
15640 /// URI of the serverless network endpoint group.
15641 pub neg_uri: std::string::String,
15642
15643 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15644}
15645
15646impl ServerlessNegInfo {
15647 pub fn new() -> Self {
15648 std::default::Default::default()
15649 }
15650
15651 /// Sets the value of [neg_uri][crate::model::ServerlessNegInfo::neg_uri].
15652 ///
15653 /// # Example
15654 /// ```ignore,no_run
15655 /// # use google_cloud_networkmanagement_v1::model::ServerlessNegInfo;
15656 /// let x = ServerlessNegInfo::new().set_neg_uri("example");
15657 /// ```
15658 pub fn set_neg_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15659 self.neg_uri = v.into();
15660 self
15661 }
15662}
15663
15664impl wkt::message::Message for ServerlessNegInfo {
15665 fn typename() -> &'static str {
15666 "type.googleapis.com/google.cloud.networkmanagement.v1.ServerlessNegInfo"
15667 }
15668}
15669
15670/// Request for the `ListVpcFlowLogsConfigs` method.
15671#[derive(Clone, Default, PartialEq)]
15672#[non_exhaustive]
15673pub struct ListVpcFlowLogsConfigsRequest {
15674 /// Required. The parent resource of the VpcFlowLogsConfig,
15675 /// in one of the following formats:
15676 ///
15677 /// - For project-level resources: `projects/{project_id}/locations/global`
15678 ///
15679 /// - For organization-level resources:
15680 /// `organizations/{organization_id}/locations/global`
15681 ///
15682 pub parent: std::string::String,
15683
15684 /// Optional. Number of `VpcFlowLogsConfigs` to return.
15685 pub page_size: i32,
15686
15687 /// Optional. Page token from an earlier query, as returned in
15688 /// `next_page_token`.
15689 pub page_token: std::string::String,
15690
15691 /// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
15692 /// A filter expression must use the supported [CEL logic operators]
15693 /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
15694 pub filter: std::string::String,
15695
15696 /// Optional. Field to use to sort the list.
15697 pub order_by: std::string::String,
15698
15699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15700}
15701
15702impl ListVpcFlowLogsConfigsRequest {
15703 pub fn new() -> Self {
15704 std::default::Default::default()
15705 }
15706
15707 /// Sets the value of [parent][crate::model::ListVpcFlowLogsConfigsRequest::parent].
15708 ///
15709 /// # Example
15710 /// ```ignore,no_run
15711 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
15712 /// let x = ListVpcFlowLogsConfigsRequest::new().set_parent("example");
15713 /// ```
15714 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15715 self.parent = v.into();
15716 self
15717 }
15718
15719 /// Sets the value of [page_size][crate::model::ListVpcFlowLogsConfigsRequest::page_size].
15720 ///
15721 /// # Example
15722 /// ```ignore,no_run
15723 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
15724 /// let x = ListVpcFlowLogsConfigsRequest::new().set_page_size(42);
15725 /// ```
15726 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15727 self.page_size = v.into();
15728 self
15729 }
15730
15731 /// Sets the value of [page_token][crate::model::ListVpcFlowLogsConfigsRequest::page_token].
15732 ///
15733 /// # Example
15734 /// ```ignore,no_run
15735 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
15736 /// let x = ListVpcFlowLogsConfigsRequest::new().set_page_token("example");
15737 /// ```
15738 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15739 self.page_token = v.into();
15740 self
15741 }
15742
15743 /// Sets the value of [filter][crate::model::ListVpcFlowLogsConfigsRequest::filter].
15744 ///
15745 /// # Example
15746 /// ```ignore,no_run
15747 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
15748 /// let x = ListVpcFlowLogsConfigsRequest::new().set_filter("example");
15749 /// ```
15750 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15751 self.filter = v.into();
15752 self
15753 }
15754
15755 /// Sets the value of [order_by][crate::model::ListVpcFlowLogsConfigsRequest::order_by].
15756 ///
15757 /// # Example
15758 /// ```ignore,no_run
15759 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
15760 /// let x = ListVpcFlowLogsConfigsRequest::new().set_order_by("example");
15761 /// ```
15762 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15763 self.order_by = v.into();
15764 self
15765 }
15766}
15767
15768impl wkt::message::Message for ListVpcFlowLogsConfigsRequest {
15769 fn typename() -> &'static str {
15770 "type.googleapis.com/google.cloud.networkmanagement.v1.ListVpcFlowLogsConfigsRequest"
15771 }
15772}
15773
15774/// Response for the `ListVpcFlowLogsConfigs` method.
15775#[derive(Clone, Default, PartialEq)]
15776#[non_exhaustive]
15777pub struct ListVpcFlowLogsConfigsResponse {
15778 /// List of VPC Flow Log configurations.
15779 pub vpc_flow_logs_configs: std::vec::Vec<crate::model::VpcFlowLogsConfig>,
15780
15781 /// Page token to fetch the next set of configurations.
15782 pub next_page_token: std::string::String,
15783
15784 /// Locations that could not be reached (when querying all locations with `-`).
15785 pub unreachable: std::vec::Vec<std::string::String>,
15786
15787 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15788}
15789
15790impl ListVpcFlowLogsConfigsResponse {
15791 pub fn new() -> Self {
15792 std::default::Default::default()
15793 }
15794
15795 /// Sets the value of [vpc_flow_logs_configs][crate::model::ListVpcFlowLogsConfigsResponse::vpc_flow_logs_configs].
15796 ///
15797 /// # Example
15798 /// ```ignore,no_run
15799 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
15800 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15801 /// let x = ListVpcFlowLogsConfigsResponse::new()
15802 /// .set_vpc_flow_logs_configs([
15803 /// VpcFlowLogsConfig::default()/* use setters */,
15804 /// VpcFlowLogsConfig::default()/* use (different) setters */,
15805 /// ]);
15806 /// ```
15807 pub fn set_vpc_flow_logs_configs<T, V>(mut self, v: T) -> Self
15808 where
15809 T: std::iter::IntoIterator<Item = V>,
15810 V: std::convert::Into<crate::model::VpcFlowLogsConfig>,
15811 {
15812 use std::iter::Iterator;
15813 self.vpc_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
15814 self
15815 }
15816
15817 /// Sets the value of [next_page_token][crate::model::ListVpcFlowLogsConfigsResponse::next_page_token].
15818 ///
15819 /// # Example
15820 /// ```ignore,no_run
15821 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
15822 /// let x = ListVpcFlowLogsConfigsResponse::new().set_next_page_token("example");
15823 /// ```
15824 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15825 self.next_page_token = v.into();
15826 self
15827 }
15828
15829 /// Sets the value of [unreachable][crate::model::ListVpcFlowLogsConfigsResponse::unreachable].
15830 ///
15831 /// # Example
15832 /// ```ignore,no_run
15833 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
15834 /// let x = ListVpcFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
15835 /// ```
15836 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
15837 where
15838 T: std::iter::IntoIterator<Item = V>,
15839 V: std::convert::Into<std::string::String>,
15840 {
15841 use std::iter::Iterator;
15842 self.unreachable = v.into_iter().map(|i| i.into()).collect();
15843 self
15844 }
15845}
15846
15847impl wkt::message::Message for ListVpcFlowLogsConfigsResponse {
15848 fn typename() -> &'static str {
15849 "type.googleapis.com/google.cloud.networkmanagement.v1.ListVpcFlowLogsConfigsResponse"
15850 }
15851}
15852
15853#[doc(hidden)]
15854impl gax::paginator::internal::PageableResponse for ListVpcFlowLogsConfigsResponse {
15855 type PageItem = crate::model::VpcFlowLogsConfig;
15856
15857 fn items(self) -> std::vec::Vec<Self::PageItem> {
15858 self.vpc_flow_logs_configs
15859 }
15860
15861 fn next_page_token(&self) -> std::string::String {
15862 use std::clone::Clone;
15863 self.next_page_token.clone()
15864 }
15865}
15866
15867/// Request for the `GetVpcFlowLogsConfig` method.
15868#[derive(Clone, Default, PartialEq)]
15869#[non_exhaustive]
15870pub struct GetVpcFlowLogsConfigRequest {
15871 /// Required. The resource name of the VpcFlowLogsConfig,
15872 /// in one of the following formats:
15873 ///
15874 /// - For project-level resources:
15875 /// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
15876 ///
15877 /// - For organization-level resources:
15878 /// `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
15879 ///
15880 pub name: std::string::String,
15881
15882 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15883}
15884
15885impl GetVpcFlowLogsConfigRequest {
15886 pub fn new() -> Self {
15887 std::default::Default::default()
15888 }
15889
15890 /// Sets the value of [name][crate::model::GetVpcFlowLogsConfigRequest::name].
15891 ///
15892 /// # Example
15893 /// ```ignore,no_run
15894 /// # use google_cloud_networkmanagement_v1::model::GetVpcFlowLogsConfigRequest;
15895 /// let x = GetVpcFlowLogsConfigRequest::new().set_name("example");
15896 /// ```
15897 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15898 self.name = v.into();
15899 self
15900 }
15901}
15902
15903impl wkt::message::Message for GetVpcFlowLogsConfigRequest {
15904 fn typename() -> &'static str {
15905 "type.googleapis.com/google.cloud.networkmanagement.v1.GetVpcFlowLogsConfigRequest"
15906 }
15907}
15908
15909/// Request for the `CreateVpcFlowLogsConfig` method.
15910#[derive(Clone, Default, PartialEq)]
15911#[non_exhaustive]
15912pub struct CreateVpcFlowLogsConfigRequest {
15913 /// Required. The parent resource of the VpcFlowLogsConfig to create,
15914 /// in one of the following formats:
15915 ///
15916 /// - For project-level resources: `projects/{project_id}/locations/global`
15917 ///
15918 /// - For organization-level resources:
15919 /// `organizations/{organization_id}/locations/global`
15920 ///
15921 pub parent: std::string::String,
15922
15923 /// Required. ID of the `VpcFlowLogsConfig`.
15924 pub vpc_flow_logs_config_id: std::string::String,
15925
15926 /// Required. A `VpcFlowLogsConfig` resource
15927 pub vpc_flow_logs_config: std::option::Option<crate::model::VpcFlowLogsConfig>,
15928
15929 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15930}
15931
15932impl CreateVpcFlowLogsConfigRequest {
15933 pub fn new() -> Self {
15934 std::default::Default::default()
15935 }
15936
15937 /// Sets the value of [parent][crate::model::CreateVpcFlowLogsConfigRequest::parent].
15938 ///
15939 /// # Example
15940 /// ```ignore,no_run
15941 /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
15942 /// let x = CreateVpcFlowLogsConfigRequest::new().set_parent("example");
15943 /// ```
15944 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15945 self.parent = v.into();
15946 self
15947 }
15948
15949 /// Sets the value of [vpc_flow_logs_config_id][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config_id].
15950 ///
15951 /// # Example
15952 /// ```ignore,no_run
15953 /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
15954 /// let x = CreateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config_id("example");
15955 /// ```
15956 pub fn set_vpc_flow_logs_config_id<T: std::convert::Into<std::string::String>>(
15957 mut self,
15958 v: T,
15959 ) -> Self {
15960 self.vpc_flow_logs_config_id = v.into();
15961 self
15962 }
15963
15964 /// Sets the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
15965 ///
15966 /// # Example
15967 /// ```ignore,no_run
15968 /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
15969 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15970 /// let x = CreateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config(VpcFlowLogsConfig::default()/* use setters */);
15971 /// ```
15972 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
15973 where
15974 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
15975 {
15976 self.vpc_flow_logs_config = std::option::Option::Some(v.into());
15977 self
15978 }
15979
15980 /// Sets or clears the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
15981 ///
15982 /// # Example
15983 /// ```ignore,no_run
15984 /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
15985 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15986 /// let x = CreateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(Some(VpcFlowLogsConfig::default()/* use setters */));
15987 /// let x = CreateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(None::<VpcFlowLogsConfig>);
15988 /// ```
15989 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
15990 where
15991 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
15992 {
15993 self.vpc_flow_logs_config = v.map(|x| x.into());
15994 self
15995 }
15996}
15997
15998impl wkt::message::Message for CreateVpcFlowLogsConfigRequest {
15999 fn typename() -> &'static str {
16000 "type.googleapis.com/google.cloud.networkmanagement.v1.CreateVpcFlowLogsConfigRequest"
16001 }
16002}
16003
16004/// Request for the `UpdateVpcFlowLogsConfig` method.
16005#[derive(Clone, Default, PartialEq)]
16006#[non_exhaustive]
16007pub struct UpdateVpcFlowLogsConfigRequest {
16008 /// Required. Mask of fields to update. At least one path must be supplied in
16009 /// this field.
16010 /// For example, to change the state of the configuration to ENABLED, specify
16011 /// `update_mask` = `"state"`, and the `vpc_flow_logs_config` would be:
16012 /// `vpc_flow_logs_config = {
16013 /// name =
16014 /// "projects/my-project/locations/global/vpcFlowLogsConfigs/my-config"
16015 /// state = "ENABLED" }`
16016 pub update_mask: std::option::Option<wkt::FieldMask>,
16017
16018 /// Required. Only fields specified in update_mask are updated.
16019 pub vpc_flow_logs_config: std::option::Option<crate::model::VpcFlowLogsConfig>,
16020
16021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16022}
16023
16024impl UpdateVpcFlowLogsConfigRequest {
16025 pub fn new() -> Self {
16026 std::default::Default::default()
16027 }
16028
16029 /// Sets the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
16030 ///
16031 /// # Example
16032 /// ```ignore,no_run
16033 /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
16034 /// use wkt::FieldMask;
16035 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
16036 /// ```
16037 pub fn set_update_mask<T>(mut self, v: T) -> Self
16038 where
16039 T: std::convert::Into<wkt::FieldMask>,
16040 {
16041 self.update_mask = std::option::Option::Some(v.into());
16042 self
16043 }
16044
16045 /// Sets or clears the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
16046 ///
16047 /// # Example
16048 /// ```ignore,no_run
16049 /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
16050 /// use wkt::FieldMask;
16051 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
16052 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
16053 /// ```
16054 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16055 where
16056 T: std::convert::Into<wkt::FieldMask>,
16057 {
16058 self.update_mask = v.map(|x| x.into());
16059 self
16060 }
16061
16062 /// Sets the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
16063 ///
16064 /// # Example
16065 /// ```ignore,no_run
16066 /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
16067 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16068 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config(VpcFlowLogsConfig::default()/* use setters */);
16069 /// ```
16070 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
16071 where
16072 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16073 {
16074 self.vpc_flow_logs_config = std::option::Option::Some(v.into());
16075 self
16076 }
16077
16078 /// Sets or clears the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
16079 ///
16080 /// # Example
16081 /// ```ignore,no_run
16082 /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
16083 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16084 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(Some(VpcFlowLogsConfig::default()/* use setters */));
16085 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(None::<VpcFlowLogsConfig>);
16086 /// ```
16087 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
16088 where
16089 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16090 {
16091 self.vpc_flow_logs_config = v.map(|x| x.into());
16092 self
16093 }
16094}
16095
16096impl wkt::message::Message for UpdateVpcFlowLogsConfigRequest {
16097 fn typename() -> &'static str {
16098 "type.googleapis.com/google.cloud.networkmanagement.v1.UpdateVpcFlowLogsConfigRequest"
16099 }
16100}
16101
16102/// Request for the `DeleteVpcFlowLogsConfig` method.
16103#[derive(Clone, Default, PartialEq)]
16104#[non_exhaustive]
16105pub struct DeleteVpcFlowLogsConfigRequest {
16106 /// Required. The resource name of the VpcFlowLogsConfig,
16107 /// in one of the following formats:
16108 ///
16109 /// - For a project-level resource:
16110 /// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
16111 ///
16112 /// - For an organization-level resource:
16113 /// `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
16114 ///
16115 pub name: std::string::String,
16116
16117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16118}
16119
16120impl DeleteVpcFlowLogsConfigRequest {
16121 pub fn new() -> Self {
16122 std::default::Default::default()
16123 }
16124
16125 /// Sets the value of [name][crate::model::DeleteVpcFlowLogsConfigRequest::name].
16126 ///
16127 /// # Example
16128 /// ```ignore,no_run
16129 /// # use google_cloud_networkmanagement_v1::model::DeleteVpcFlowLogsConfigRequest;
16130 /// let x = DeleteVpcFlowLogsConfigRequest::new().set_name("example");
16131 /// ```
16132 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16133 self.name = v.into();
16134 self
16135 }
16136}
16137
16138impl wkt::message::Message for DeleteVpcFlowLogsConfigRequest {
16139 fn typename() -> &'static str {
16140 "type.googleapis.com/google.cloud.networkmanagement.v1.DeleteVpcFlowLogsConfigRequest"
16141 }
16142}
16143
16144/// Request for the `QueryOrgVpcFlowLogsConfigs` method.
16145#[derive(Clone, Default, PartialEq)]
16146#[non_exhaustive]
16147pub struct QueryOrgVpcFlowLogsConfigsRequest {
16148 /// Required. The parent resource of the VpcFlowLogsConfig, specified in
16149 /// the following format: `projects/{project_id}/locations/global`
16150 pub parent: std::string::String,
16151
16152 /// Optional. Number of `VpcFlowLogsConfigs` to return.
16153 pub page_size: i32,
16154
16155 /// Optional. Page token from an earlier query, as returned in
16156 /// `next_page_token`.
16157 pub page_token: std::string::String,
16158
16159 /// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
16160 /// A filter expression must use the supported [CEL logic operators]
16161 /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
16162 pub filter: std::string::String,
16163
16164 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16165}
16166
16167impl QueryOrgVpcFlowLogsConfigsRequest {
16168 pub fn new() -> Self {
16169 std::default::Default::default()
16170 }
16171
16172 /// Sets the value of [parent][crate::model::QueryOrgVpcFlowLogsConfigsRequest::parent].
16173 ///
16174 /// # Example
16175 /// ```ignore,no_run
16176 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
16177 /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_parent("example");
16178 /// ```
16179 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16180 self.parent = v.into();
16181 self
16182 }
16183
16184 /// Sets the value of [page_size][crate::model::QueryOrgVpcFlowLogsConfigsRequest::page_size].
16185 ///
16186 /// # Example
16187 /// ```ignore,no_run
16188 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
16189 /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_page_size(42);
16190 /// ```
16191 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16192 self.page_size = v.into();
16193 self
16194 }
16195
16196 /// Sets the value of [page_token][crate::model::QueryOrgVpcFlowLogsConfigsRequest::page_token].
16197 ///
16198 /// # Example
16199 /// ```ignore,no_run
16200 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
16201 /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_page_token("example");
16202 /// ```
16203 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16204 self.page_token = v.into();
16205 self
16206 }
16207
16208 /// Sets the value of [filter][crate::model::QueryOrgVpcFlowLogsConfigsRequest::filter].
16209 ///
16210 /// # Example
16211 /// ```ignore,no_run
16212 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
16213 /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_filter("example");
16214 /// ```
16215 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16216 self.filter = v.into();
16217 self
16218 }
16219}
16220
16221impl wkt::message::Message for QueryOrgVpcFlowLogsConfigsRequest {
16222 fn typename() -> &'static str {
16223 "type.googleapis.com/google.cloud.networkmanagement.v1.QueryOrgVpcFlowLogsConfigsRequest"
16224 }
16225}
16226
16227/// Response for the `QueryVpcFlowLogsConfigs` method.
16228#[derive(Clone, Default, PartialEq)]
16229#[non_exhaustive]
16230pub struct QueryOrgVpcFlowLogsConfigsResponse {
16231 /// List of VPC Flow Log configurations.
16232 pub vpc_flow_logs_configs: std::vec::Vec<crate::model::VpcFlowLogsConfig>,
16233
16234 /// Page token to fetch the next set of configurations.
16235 pub next_page_token: std::string::String,
16236
16237 /// Locations that could not be reached (when querying all locations with `-`).
16238 pub unreachable: std::vec::Vec<std::string::String>,
16239
16240 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16241}
16242
16243impl QueryOrgVpcFlowLogsConfigsResponse {
16244 pub fn new() -> Self {
16245 std::default::Default::default()
16246 }
16247
16248 /// Sets the value of [vpc_flow_logs_configs][crate::model::QueryOrgVpcFlowLogsConfigsResponse::vpc_flow_logs_configs].
16249 ///
16250 /// # Example
16251 /// ```ignore,no_run
16252 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
16253 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16254 /// let x = QueryOrgVpcFlowLogsConfigsResponse::new()
16255 /// .set_vpc_flow_logs_configs([
16256 /// VpcFlowLogsConfig::default()/* use setters */,
16257 /// VpcFlowLogsConfig::default()/* use (different) setters */,
16258 /// ]);
16259 /// ```
16260 pub fn set_vpc_flow_logs_configs<T, V>(mut self, v: T) -> Self
16261 where
16262 T: std::iter::IntoIterator<Item = V>,
16263 V: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16264 {
16265 use std::iter::Iterator;
16266 self.vpc_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
16267 self
16268 }
16269
16270 /// Sets the value of [next_page_token][crate::model::QueryOrgVpcFlowLogsConfigsResponse::next_page_token].
16271 ///
16272 /// # Example
16273 /// ```ignore,no_run
16274 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
16275 /// let x = QueryOrgVpcFlowLogsConfigsResponse::new().set_next_page_token("example");
16276 /// ```
16277 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16278 self.next_page_token = v.into();
16279 self
16280 }
16281
16282 /// Sets the value of [unreachable][crate::model::QueryOrgVpcFlowLogsConfigsResponse::unreachable].
16283 ///
16284 /// # Example
16285 /// ```ignore,no_run
16286 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
16287 /// let x = QueryOrgVpcFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
16288 /// ```
16289 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
16290 where
16291 T: std::iter::IntoIterator<Item = V>,
16292 V: std::convert::Into<std::string::String>,
16293 {
16294 use std::iter::Iterator;
16295 self.unreachable = v.into_iter().map(|i| i.into()).collect();
16296 self
16297 }
16298}
16299
16300impl wkt::message::Message for QueryOrgVpcFlowLogsConfigsResponse {
16301 fn typename() -> &'static str {
16302 "type.googleapis.com/google.cloud.networkmanagement.v1.QueryOrgVpcFlowLogsConfigsResponse"
16303 }
16304}
16305
16306#[doc(hidden)]
16307impl gax::paginator::internal::PageableResponse for QueryOrgVpcFlowLogsConfigsResponse {
16308 type PageItem = crate::model::VpcFlowLogsConfig;
16309
16310 fn items(self) -> std::vec::Vec<Self::PageItem> {
16311 self.vpc_flow_logs_configs
16312 }
16313
16314 fn next_page_token(&self) -> std::string::String {
16315 use std::clone::Clone;
16316 self.next_page_token.clone()
16317 }
16318}
16319
16320/// Request for the `ShowEffectiveFlowLogsConfigs` method.
16321#[derive(Clone, Default, PartialEq)]
16322#[non_exhaustive]
16323pub struct ShowEffectiveFlowLogsConfigsRequest {
16324 /// Required. The parent resource of the VpcFlowLogsConfig, specified in
16325 /// the following format: `projects/{project_id}/locations/global`
16326 pub parent: std::string::String,
16327
16328 /// Required. The resource to get the effective VPC Flow Logs configuration
16329 /// for. The resource must belong to the same project as the parent. The
16330 /// resource must be a network, subnetwork, interconnect attachment, VPN
16331 /// tunnel, or a project.
16332 pub resource: std::string::String,
16333
16334 /// Optional. Number of `EffectiveVpcFlowLogsConfigs` to return. Default is 30.
16335 pub page_size: i32,
16336
16337 /// Optional. Page token from an earlier query, as returned in
16338 /// `next_page_token`.
16339 pub page_token: std::string::String,
16340
16341 /// Optional. Lists the `EffectiveVpcFlowLogsConfigs` that match the filter
16342 /// expression. A filter expression must use the supported [CEL logic
16343 /// operators]
16344 /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
16345 pub filter: std::string::String,
16346
16347 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16348}
16349
16350impl ShowEffectiveFlowLogsConfigsRequest {
16351 pub fn new() -> Self {
16352 std::default::Default::default()
16353 }
16354
16355 /// Sets the value of [parent][crate::model::ShowEffectiveFlowLogsConfigsRequest::parent].
16356 ///
16357 /// # Example
16358 /// ```ignore,no_run
16359 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
16360 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_parent("example");
16361 /// ```
16362 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16363 self.parent = v.into();
16364 self
16365 }
16366
16367 /// Sets the value of [resource][crate::model::ShowEffectiveFlowLogsConfigsRequest::resource].
16368 ///
16369 /// # Example
16370 /// ```ignore,no_run
16371 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
16372 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_resource("example");
16373 /// ```
16374 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16375 self.resource = v.into();
16376 self
16377 }
16378
16379 /// Sets the value of [page_size][crate::model::ShowEffectiveFlowLogsConfigsRequest::page_size].
16380 ///
16381 /// # Example
16382 /// ```ignore,no_run
16383 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
16384 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_page_size(42);
16385 /// ```
16386 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16387 self.page_size = v.into();
16388 self
16389 }
16390
16391 /// Sets the value of [page_token][crate::model::ShowEffectiveFlowLogsConfigsRequest::page_token].
16392 ///
16393 /// # Example
16394 /// ```ignore,no_run
16395 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
16396 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_page_token("example");
16397 /// ```
16398 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16399 self.page_token = v.into();
16400 self
16401 }
16402
16403 /// Sets the value of [filter][crate::model::ShowEffectiveFlowLogsConfigsRequest::filter].
16404 ///
16405 /// # Example
16406 /// ```ignore,no_run
16407 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
16408 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_filter("example");
16409 /// ```
16410 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16411 self.filter = v.into();
16412 self
16413 }
16414}
16415
16416impl wkt::message::Message for ShowEffectiveFlowLogsConfigsRequest {
16417 fn typename() -> &'static str {
16418 "type.googleapis.com/google.cloud.networkmanagement.v1.ShowEffectiveFlowLogsConfigsRequest"
16419 }
16420}
16421
16422/// Response for the `ShowEffectiveFlowLogsConfigs` method.
16423#[derive(Clone, Default, PartialEq)]
16424#[non_exhaustive]
16425pub struct ShowEffectiveFlowLogsConfigsResponse {
16426 /// List of Effective Vpc Flow Logs configurations.
16427 pub effective_flow_logs_configs: std::vec::Vec<crate::model::EffectiveVpcFlowLogsConfig>,
16428
16429 /// Page token to fetch the next set of configurations.
16430 pub next_page_token: std::string::String,
16431
16432 /// Locations that could not be reached (when querying all locations with `-`).
16433 pub unreachable: std::vec::Vec<std::string::String>,
16434
16435 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16436}
16437
16438impl ShowEffectiveFlowLogsConfigsResponse {
16439 pub fn new() -> Self {
16440 std::default::Default::default()
16441 }
16442
16443 /// Sets the value of [effective_flow_logs_configs][crate::model::ShowEffectiveFlowLogsConfigsResponse::effective_flow_logs_configs].
16444 ///
16445 /// # Example
16446 /// ```ignore,no_run
16447 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
16448 /// use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
16449 /// let x = ShowEffectiveFlowLogsConfigsResponse::new()
16450 /// .set_effective_flow_logs_configs([
16451 /// EffectiveVpcFlowLogsConfig::default()/* use setters */,
16452 /// EffectiveVpcFlowLogsConfig::default()/* use (different) setters */,
16453 /// ]);
16454 /// ```
16455 pub fn set_effective_flow_logs_configs<T, V>(mut self, v: T) -> Self
16456 where
16457 T: std::iter::IntoIterator<Item = V>,
16458 V: std::convert::Into<crate::model::EffectiveVpcFlowLogsConfig>,
16459 {
16460 use std::iter::Iterator;
16461 self.effective_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
16462 self
16463 }
16464
16465 /// Sets the value of [next_page_token][crate::model::ShowEffectiveFlowLogsConfigsResponse::next_page_token].
16466 ///
16467 /// # Example
16468 /// ```ignore,no_run
16469 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
16470 /// let x = ShowEffectiveFlowLogsConfigsResponse::new().set_next_page_token("example");
16471 /// ```
16472 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16473 self.next_page_token = v.into();
16474 self
16475 }
16476
16477 /// Sets the value of [unreachable][crate::model::ShowEffectiveFlowLogsConfigsResponse::unreachable].
16478 ///
16479 /// # Example
16480 /// ```ignore,no_run
16481 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
16482 /// let x = ShowEffectiveFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
16483 /// ```
16484 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
16485 where
16486 T: std::iter::IntoIterator<Item = V>,
16487 V: std::convert::Into<std::string::String>,
16488 {
16489 use std::iter::Iterator;
16490 self.unreachable = v.into_iter().map(|i| i.into()).collect();
16491 self
16492 }
16493}
16494
16495impl wkt::message::Message for ShowEffectiveFlowLogsConfigsResponse {
16496 fn typename() -> &'static str {
16497 "type.googleapis.com/google.cloud.networkmanagement.v1.ShowEffectiveFlowLogsConfigsResponse"
16498 }
16499}
16500
16501#[doc(hidden)]
16502impl gax::paginator::internal::PageableResponse for ShowEffectiveFlowLogsConfigsResponse {
16503 type PageItem = crate::model::EffectiveVpcFlowLogsConfig;
16504
16505 fn items(self) -> std::vec::Vec<Self::PageItem> {
16506 self.effective_flow_logs_configs
16507 }
16508
16509 fn next_page_token(&self) -> std::string::String {
16510 use std::clone::Clone;
16511 self.next_page_token.clone()
16512 }
16513}
16514
16515/// A configuration to generate VPC Flow Logs.
16516#[derive(Clone, Default, PartialEq)]
16517#[non_exhaustive]
16518pub struct VpcFlowLogsConfig {
16519 /// Identifier. Unique name of the configuration. The name can have one of the
16520 /// following forms:
16521 ///
16522 /// - For project-level configurations:
16523 /// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
16524 ///
16525 /// - For organization-level configurations:
16526 /// `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
16527 ///
16528 pub name: std::string::String,
16529
16530 /// Optional. The user-supplied description of the VPC Flow Logs configuration.
16531 /// Maximum of 512 characters.
16532 pub description: std::option::Option<std::string::String>,
16533
16534 /// Optional. The state of the VPC Flow Log configuration. Default value is
16535 /// ENABLED. When creating a new configuration, it must be enabled. Setting
16536 /// state=DISABLED will pause the log generation for this config.
16537 pub state: std::option::Option<crate::model::vpc_flow_logs_config::State>,
16538
16539 /// Optional. The aggregation interval for the logs. Default value is
16540 /// INTERVAL_5_SEC.
16541 pub aggregation_interval:
16542 std::option::Option<crate::model::vpc_flow_logs_config::AggregationInterval>,
16543
16544 /// Optional. The value of the field must be in (0, 1]. The sampling rate of
16545 /// VPC Flow Logs where 1.0 means all collected logs are reported. Setting the
16546 /// sampling rate to 0.0 is not allowed. If you want to disable VPC Flow Logs,
16547 /// use the state field instead. Default value is 1.0.
16548 pub flow_sampling: std::option::Option<f32>,
16549
16550 /// Optional. Configures whether all, none or a subset of metadata fields
16551 /// should be added to the reported VPC flow logs. Default value is
16552 /// INCLUDE_ALL_METADATA.
16553 pub metadata: std::option::Option<crate::model::vpc_flow_logs_config::Metadata>,
16554
16555 /// Optional. Custom metadata fields to include in the reported VPC flow logs.
16556 /// Can only be specified if "metadata" was set to CUSTOM_METADATA.
16557 pub metadata_fields: std::vec::Vec<std::string::String>,
16558
16559 /// Optional. Export filter used to define which VPC Flow Logs should be
16560 /// logged.
16561 pub filter_expr: std::option::Option<std::string::String>,
16562
16563 /// Optional. Determines whether to include cross project annotations in the
16564 /// logs. This field is available only for organization configurations. If not
16565 /// specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
16566 pub cross_project_metadata:
16567 std::option::Option<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
16568
16569 /// Output only. Describes the state of the configured target resource for
16570 /// diagnostic purposes.
16571 pub target_resource_state:
16572 std::option::Option<crate::model::vpc_flow_logs_config::TargetResourceState>,
16573
16574 /// Optional. Resource labels to represent user-provided metadata.
16575 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16576
16577 /// Output only. The time the config was created.
16578 pub create_time: std::option::Option<wkt::Timestamp>,
16579
16580 /// Output only. The time the config was updated.
16581 pub update_time: std::option::Option<wkt::Timestamp>,
16582
16583 /// Reference to the resource of the config scope. That is, the scope from
16584 /// which traffic is logged. The target resource must belong to the same
16585 /// project as the configuration.
16586 /// This field is not supported for organization level configurations.
16587 pub target_resource: std::option::Option<crate::model::vpc_flow_logs_config::TargetResource>,
16588
16589 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16590}
16591
16592impl VpcFlowLogsConfig {
16593 pub fn new() -> Self {
16594 std::default::Default::default()
16595 }
16596
16597 /// Sets the value of [name][crate::model::VpcFlowLogsConfig::name].
16598 ///
16599 /// # Example
16600 /// ```ignore,no_run
16601 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16602 /// let x = VpcFlowLogsConfig::new().set_name("example");
16603 /// ```
16604 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16605 self.name = v.into();
16606 self
16607 }
16608
16609 /// Sets the value of [description][crate::model::VpcFlowLogsConfig::description].
16610 ///
16611 /// # Example
16612 /// ```ignore,no_run
16613 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16614 /// let x = VpcFlowLogsConfig::new().set_description("example");
16615 /// ```
16616 pub fn set_description<T>(mut self, v: T) -> Self
16617 where
16618 T: std::convert::Into<std::string::String>,
16619 {
16620 self.description = std::option::Option::Some(v.into());
16621 self
16622 }
16623
16624 /// Sets or clears the value of [description][crate::model::VpcFlowLogsConfig::description].
16625 ///
16626 /// # Example
16627 /// ```ignore,no_run
16628 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16629 /// let x = VpcFlowLogsConfig::new().set_or_clear_description(Some("example"));
16630 /// let x = VpcFlowLogsConfig::new().set_or_clear_description(None::<String>);
16631 /// ```
16632 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
16633 where
16634 T: std::convert::Into<std::string::String>,
16635 {
16636 self.description = v.map(|x| x.into());
16637 self
16638 }
16639
16640 /// Sets the value of [state][crate::model::VpcFlowLogsConfig::state].
16641 ///
16642 /// # Example
16643 /// ```ignore,no_run
16644 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16645 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
16646 /// let x0 = VpcFlowLogsConfig::new().set_state(State::Enabled);
16647 /// let x1 = VpcFlowLogsConfig::new().set_state(State::Disabled);
16648 /// ```
16649 pub fn set_state<T>(mut self, v: T) -> Self
16650 where
16651 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
16652 {
16653 self.state = std::option::Option::Some(v.into());
16654 self
16655 }
16656
16657 /// Sets or clears the value of [state][crate::model::VpcFlowLogsConfig::state].
16658 ///
16659 /// # Example
16660 /// ```ignore,no_run
16661 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16662 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
16663 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_state(Some(State::Enabled));
16664 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_state(Some(State::Disabled));
16665 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_state(None::<State>);
16666 /// ```
16667 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
16668 where
16669 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
16670 {
16671 self.state = v.map(|x| x.into());
16672 self
16673 }
16674
16675 /// Sets the value of [aggregation_interval][crate::model::VpcFlowLogsConfig::aggregation_interval].
16676 ///
16677 /// # Example
16678 /// ```ignore,no_run
16679 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16680 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
16681 /// let x0 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval5Sec);
16682 /// let x1 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval30Sec);
16683 /// let x2 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval1Min);
16684 /// ```
16685 pub fn set_aggregation_interval<T>(mut self, v: T) -> Self
16686 where
16687 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
16688 {
16689 self.aggregation_interval = std::option::Option::Some(v.into());
16690 self
16691 }
16692
16693 /// Sets or clears the value of [aggregation_interval][crate::model::VpcFlowLogsConfig::aggregation_interval].
16694 ///
16695 /// # Example
16696 /// ```ignore,no_run
16697 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16698 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
16699 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval5Sec));
16700 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval30Sec));
16701 /// let x2 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval1Min));
16702 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(None::<AggregationInterval>);
16703 /// ```
16704 pub fn set_or_clear_aggregation_interval<T>(mut self, v: std::option::Option<T>) -> Self
16705 where
16706 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
16707 {
16708 self.aggregation_interval = v.map(|x| x.into());
16709 self
16710 }
16711
16712 /// Sets the value of [flow_sampling][crate::model::VpcFlowLogsConfig::flow_sampling].
16713 ///
16714 /// # Example
16715 /// ```ignore,no_run
16716 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16717 /// let x = VpcFlowLogsConfig::new().set_flow_sampling(42.0);
16718 /// ```
16719 pub fn set_flow_sampling<T>(mut self, v: T) -> Self
16720 where
16721 T: std::convert::Into<f32>,
16722 {
16723 self.flow_sampling = std::option::Option::Some(v.into());
16724 self
16725 }
16726
16727 /// Sets or clears the value of [flow_sampling][crate::model::VpcFlowLogsConfig::flow_sampling].
16728 ///
16729 /// # Example
16730 /// ```ignore,no_run
16731 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16732 /// let x = VpcFlowLogsConfig::new().set_or_clear_flow_sampling(Some(42.0));
16733 /// let x = VpcFlowLogsConfig::new().set_or_clear_flow_sampling(None::<f32>);
16734 /// ```
16735 pub fn set_or_clear_flow_sampling<T>(mut self, v: std::option::Option<T>) -> Self
16736 where
16737 T: std::convert::Into<f32>,
16738 {
16739 self.flow_sampling = v.map(|x| x.into());
16740 self
16741 }
16742
16743 /// Sets the value of [metadata][crate::model::VpcFlowLogsConfig::metadata].
16744 ///
16745 /// # Example
16746 /// ```ignore,no_run
16747 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16748 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
16749 /// let x0 = VpcFlowLogsConfig::new().set_metadata(Metadata::IncludeAllMetadata);
16750 /// let x1 = VpcFlowLogsConfig::new().set_metadata(Metadata::ExcludeAllMetadata);
16751 /// let x2 = VpcFlowLogsConfig::new().set_metadata(Metadata::CustomMetadata);
16752 /// ```
16753 pub fn set_metadata<T>(mut self, v: T) -> Self
16754 where
16755 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
16756 {
16757 self.metadata = std::option::Option::Some(v.into());
16758 self
16759 }
16760
16761 /// Sets or clears the value of [metadata][crate::model::VpcFlowLogsConfig::metadata].
16762 ///
16763 /// # Example
16764 /// ```ignore,no_run
16765 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16766 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
16767 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::IncludeAllMetadata));
16768 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::ExcludeAllMetadata));
16769 /// let x2 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::CustomMetadata));
16770 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_metadata(None::<Metadata>);
16771 /// ```
16772 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
16773 where
16774 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
16775 {
16776 self.metadata = v.map(|x| x.into());
16777 self
16778 }
16779
16780 /// Sets the value of [metadata_fields][crate::model::VpcFlowLogsConfig::metadata_fields].
16781 ///
16782 /// # Example
16783 /// ```ignore,no_run
16784 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16785 /// let x = VpcFlowLogsConfig::new().set_metadata_fields(["a", "b", "c"]);
16786 /// ```
16787 pub fn set_metadata_fields<T, V>(mut self, v: T) -> Self
16788 where
16789 T: std::iter::IntoIterator<Item = V>,
16790 V: std::convert::Into<std::string::String>,
16791 {
16792 use std::iter::Iterator;
16793 self.metadata_fields = v.into_iter().map(|i| i.into()).collect();
16794 self
16795 }
16796
16797 /// Sets the value of [filter_expr][crate::model::VpcFlowLogsConfig::filter_expr].
16798 ///
16799 /// # Example
16800 /// ```ignore,no_run
16801 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16802 /// let x = VpcFlowLogsConfig::new().set_filter_expr("example");
16803 /// ```
16804 pub fn set_filter_expr<T>(mut self, v: T) -> Self
16805 where
16806 T: std::convert::Into<std::string::String>,
16807 {
16808 self.filter_expr = std::option::Option::Some(v.into());
16809 self
16810 }
16811
16812 /// Sets or clears the value of [filter_expr][crate::model::VpcFlowLogsConfig::filter_expr].
16813 ///
16814 /// # Example
16815 /// ```ignore,no_run
16816 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16817 /// let x = VpcFlowLogsConfig::new().set_or_clear_filter_expr(Some("example"));
16818 /// let x = VpcFlowLogsConfig::new().set_or_clear_filter_expr(None::<String>);
16819 /// ```
16820 pub fn set_or_clear_filter_expr<T>(mut self, v: std::option::Option<T>) -> Self
16821 where
16822 T: std::convert::Into<std::string::String>,
16823 {
16824 self.filter_expr = v.map(|x| x.into());
16825 self
16826 }
16827
16828 /// Sets the value of [cross_project_metadata][crate::model::VpcFlowLogsConfig::cross_project_metadata].
16829 ///
16830 /// # Example
16831 /// ```ignore,no_run
16832 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16833 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
16834 /// let x0 = VpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Enabled);
16835 /// let x1 = VpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Disabled);
16836 /// ```
16837 pub fn set_cross_project_metadata<T>(mut self, v: T) -> Self
16838 where
16839 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
16840 {
16841 self.cross_project_metadata = std::option::Option::Some(v.into());
16842 self
16843 }
16844
16845 /// Sets or clears the value of [cross_project_metadata][crate::model::VpcFlowLogsConfig::cross_project_metadata].
16846 ///
16847 /// # Example
16848 /// ```ignore,no_run
16849 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16850 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
16851 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Enabled));
16852 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Disabled));
16853 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(None::<CrossProjectMetadata>);
16854 /// ```
16855 pub fn set_or_clear_cross_project_metadata<T>(mut self, v: std::option::Option<T>) -> Self
16856 where
16857 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
16858 {
16859 self.cross_project_metadata = v.map(|x| x.into());
16860 self
16861 }
16862
16863 /// Sets the value of [target_resource_state][crate::model::VpcFlowLogsConfig::target_resource_state].
16864 ///
16865 /// # Example
16866 /// ```ignore,no_run
16867 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16868 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResourceState;
16869 /// let x0 = VpcFlowLogsConfig::new().set_target_resource_state(TargetResourceState::TargetResourceExists);
16870 /// let x1 = VpcFlowLogsConfig::new().set_target_resource_state(TargetResourceState::TargetResourceDoesNotExist);
16871 /// ```
16872 pub fn set_target_resource_state<T>(mut self, v: T) -> Self
16873 where
16874 T: std::convert::Into<crate::model::vpc_flow_logs_config::TargetResourceState>,
16875 {
16876 self.target_resource_state = std::option::Option::Some(v.into());
16877 self
16878 }
16879
16880 /// Sets or clears the value of [target_resource_state][crate::model::VpcFlowLogsConfig::target_resource_state].
16881 ///
16882 /// # Example
16883 /// ```ignore,no_run
16884 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16885 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResourceState;
16886 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(Some(TargetResourceState::TargetResourceExists));
16887 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(Some(TargetResourceState::TargetResourceDoesNotExist));
16888 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(None::<TargetResourceState>);
16889 /// ```
16890 pub fn set_or_clear_target_resource_state<T>(mut self, v: std::option::Option<T>) -> Self
16891 where
16892 T: std::convert::Into<crate::model::vpc_flow_logs_config::TargetResourceState>,
16893 {
16894 self.target_resource_state = v.map(|x| x.into());
16895 self
16896 }
16897
16898 /// Sets the value of [labels][crate::model::VpcFlowLogsConfig::labels].
16899 ///
16900 /// # Example
16901 /// ```ignore,no_run
16902 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16903 /// let x = VpcFlowLogsConfig::new().set_labels([
16904 /// ("key0", "abc"),
16905 /// ("key1", "xyz"),
16906 /// ]);
16907 /// ```
16908 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16909 where
16910 T: std::iter::IntoIterator<Item = (K, V)>,
16911 K: std::convert::Into<std::string::String>,
16912 V: std::convert::Into<std::string::String>,
16913 {
16914 use std::iter::Iterator;
16915 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16916 self
16917 }
16918
16919 /// Sets the value of [create_time][crate::model::VpcFlowLogsConfig::create_time].
16920 ///
16921 /// # Example
16922 /// ```ignore,no_run
16923 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16924 /// use wkt::Timestamp;
16925 /// let x = VpcFlowLogsConfig::new().set_create_time(Timestamp::default()/* use setters */);
16926 /// ```
16927 pub fn set_create_time<T>(mut self, v: T) -> Self
16928 where
16929 T: std::convert::Into<wkt::Timestamp>,
16930 {
16931 self.create_time = std::option::Option::Some(v.into());
16932 self
16933 }
16934
16935 /// Sets or clears the value of [create_time][crate::model::VpcFlowLogsConfig::create_time].
16936 ///
16937 /// # Example
16938 /// ```ignore,no_run
16939 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16940 /// use wkt::Timestamp;
16941 /// let x = VpcFlowLogsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16942 /// let x = VpcFlowLogsConfig::new().set_or_clear_create_time(None::<Timestamp>);
16943 /// ```
16944 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16945 where
16946 T: std::convert::Into<wkt::Timestamp>,
16947 {
16948 self.create_time = v.map(|x| x.into());
16949 self
16950 }
16951
16952 /// Sets the value of [update_time][crate::model::VpcFlowLogsConfig::update_time].
16953 ///
16954 /// # Example
16955 /// ```ignore,no_run
16956 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16957 /// use wkt::Timestamp;
16958 /// let x = VpcFlowLogsConfig::new().set_update_time(Timestamp::default()/* use setters */);
16959 /// ```
16960 pub fn set_update_time<T>(mut self, v: T) -> Self
16961 where
16962 T: std::convert::Into<wkt::Timestamp>,
16963 {
16964 self.update_time = std::option::Option::Some(v.into());
16965 self
16966 }
16967
16968 /// Sets or clears the value of [update_time][crate::model::VpcFlowLogsConfig::update_time].
16969 ///
16970 /// # Example
16971 /// ```ignore,no_run
16972 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16973 /// use wkt::Timestamp;
16974 /// let x = VpcFlowLogsConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16975 /// let x = VpcFlowLogsConfig::new().set_or_clear_update_time(None::<Timestamp>);
16976 /// ```
16977 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16978 where
16979 T: std::convert::Into<wkt::Timestamp>,
16980 {
16981 self.update_time = v.map(|x| x.into());
16982 self
16983 }
16984
16985 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource].
16986 ///
16987 /// Note that all the setters affecting `target_resource` are mutually
16988 /// exclusive.
16989 ///
16990 /// # Example
16991 /// ```ignore,no_run
16992 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16993 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResource;
16994 /// let x = VpcFlowLogsConfig::new().set_target_resource(Some(TargetResource::Network("example".to_string())));
16995 /// ```
16996 pub fn set_target_resource<
16997 T: std::convert::Into<std::option::Option<crate::model::vpc_flow_logs_config::TargetResource>>,
16998 >(
16999 mut self,
17000 v: T,
17001 ) -> Self {
17002 self.target_resource = v.into();
17003 self
17004 }
17005
17006 /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17007 /// if it holds a `Network`, `None` if the field is not set or
17008 /// holds a different branch.
17009 pub fn network(&self) -> std::option::Option<&std::string::String> {
17010 #[allow(unreachable_patterns)]
17011 self.target_resource.as_ref().and_then(|v| match v {
17012 crate::model::vpc_flow_logs_config::TargetResource::Network(v) => {
17013 std::option::Option::Some(v)
17014 }
17015 _ => std::option::Option::None,
17016 })
17017 }
17018
17019 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17020 /// to hold a `Network`.
17021 ///
17022 /// Note that all the setters affecting `target_resource` are
17023 /// mutually exclusive.
17024 ///
17025 /// # Example
17026 /// ```ignore,no_run
17027 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17028 /// let x = VpcFlowLogsConfig::new().set_network("example");
17029 /// assert!(x.network().is_some());
17030 /// assert!(x.subnet().is_none());
17031 /// assert!(x.interconnect_attachment().is_none());
17032 /// assert!(x.vpn_tunnel().is_none());
17033 /// ```
17034 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17035 self.target_resource = std::option::Option::Some(
17036 crate::model::vpc_flow_logs_config::TargetResource::Network(v.into()),
17037 );
17038 self
17039 }
17040
17041 /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17042 /// if it holds a `Subnet`, `None` if the field is not set or
17043 /// holds a different branch.
17044 pub fn subnet(&self) -> std::option::Option<&std::string::String> {
17045 #[allow(unreachable_patterns)]
17046 self.target_resource.as_ref().and_then(|v| match v {
17047 crate::model::vpc_flow_logs_config::TargetResource::Subnet(v) => {
17048 std::option::Option::Some(v)
17049 }
17050 _ => std::option::Option::None,
17051 })
17052 }
17053
17054 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17055 /// to hold a `Subnet`.
17056 ///
17057 /// Note that all the setters affecting `target_resource` are
17058 /// mutually exclusive.
17059 ///
17060 /// # Example
17061 /// ```ignore,no_run
17062 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17063 /// let x = VpcFlowLogsConfig::new().set_subnet("example");
17064 /// assert!(x.subnet().is_some());
17065 /// assert!(x.network().is_none());
17066 /// assert!(x.interconnect_attachment().is_none());
17067 /// assert!(x.vpn_tunnel().is_none());
17068 /// ```
17069 pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17070 self.target_resource = std::option::Option::Some(
17071 crate::model::vpc_flow_logs_config::TargetResource::Subnet(v.into()),
17072 );
17073 self
17074 }
17075
17076 /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17077 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
17078 /// holds a different branch.
17079 pub fn interconnect_attachment(&self) -> std::option::Option<&std::string::String> {
17080 #[allow(unreachable_patterns)]
17081 self.target_resource.as_ref().and_then(|v| match v {
17082 crate::model::vpc_flow_logs_config::TargetResource::InterconnectAttachment(v) => {
17083 std::option::Option::Some(v)
17084 }
17085 _ => std::option::Option::None,
17086 })
17087 }
17088
17089 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17090 /// to hold a `InterconnectAttachment`.
17091 ///
17092 /// Note that all the setters affecting `target_resource` are
17093 /// mutually exclusive.
17094 ///
17095 /// # Example
17096 /// ```ignore,no_run
17097 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17098 /// let x = VpcFlowLogsConfig::new().set_interconnect_attachment("example");
17099 /// assert!(x.interconnect_attachment().is_some());
17100 /// assert!(x.network().is_none());
17101 /// assert!(x.subnet().is_none());
17102 /// assert!(x.vpn_tunnel().is_none());
17103 /// ```
17104 pub fn set_interconnect_attachment<T: std::convert::Into<std::string::String>>(
17105 mut self,
17106 v: T,
17107 ) -> Self {
17108 self.target_resource = std::option::Option::Some(
17109 crate::model::vpc_flow_logs_config::TargetResource::InterconnectAttachment(v.into()),
17110 );
17111 self
17112 }
17113
17114 /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17115 /// if it holds a `VpnTunnel`, `None` if the field is not set or
17116 /// holds a different branch.
17117 pub fn vpn_tunnel(&self) -> std::option::Option<&std::string::String> {
17118 #[allow(unreachable_patterns)]
17119 self.target_resource.as_ref().and_then(|v| match v {
17120 crate::model::vpc_flow_logs_config::TargetResource::VpnTunnel(v) => {
17121 std::option::Option::Some(v)
17122 }
17123 _ => std::option::Option::None,
17124 })
17125 }
17126
17127 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17128 /// to hold a `VpnTunnel`.
17129 ///
17130 /// Note that all the setters affecting `target_resource` are
17131 /// mutually exclusive.
17132 ///
17133 /// # Example
17134 /// ```ignore,no_run
17135 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17136 /// let x = VpcFlowLogsConfig::new().set_vpn_tunnel("example");
17137 /// assert!(x.vpn_tunnel().is_some());
17138 /// assert!(x.network().is_none());
17139 /// assert!(x.subnet().is_none());
17140 /// assert!(x.interconnect_attachment().is_none());
17141 /// ```
17142 pub fn set_vpn_tunnel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17143 self.target_resource = std::option::Option::Some(
17144 crate::model::vpc_flow_logs_config::TargetResource::VpnTunnel(v.into()),
17145 );
17146 self
17147 }
17148}
17149
17150impl wkt::message::Message for VpcFlowLogsConfig {
17151 fn typename() -> &'static str {
17152 "type.googleapis.com/google.cloud.networkmanagement.v1.VpcFlowLogsConfig"
17153 }
17154}
17155
17156/// Defines additional types related to [VpcFlowLogsConfig].
17157pub mod vpc_flow_logs_config {
17158 #[allow(unused_imports)]
17159 use super::*;
17160
17161 /// Determines whether this configuration will be generating logs.
17162 ///
17163 /// # Working with unknown values
17164 ///
17165 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17166 /// additional enum variants at any time. Adding new variants is not considered
17167 /// a breaking change. Applications should write their code in anticipation of:
17168 ///
17169 /// - New values appearing in future releases of the client library, **and**
17170 /// - New values received dynamically, without application changes.
17171 ///
17172 /// Please consult the [Working with enums] section in the user guide for some
17173 /// guidelines.
17174 ///
17175 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17176 #[derive(Clone, Debug, PartialEq)]
17177 #[non_exhaustive]
17178 pub enum State {
17179 /// If not specified, will default to ENABLED.
17180 Unspecified,
17181 /// When ENABLED, this configuration will generate logs.
17182 Enabled,
17183 /// When DISABLED, this configuration will not generate logs.
17184 Disabled,
17185 /// If set, the enum was initialized with an unknown value.
17186 ///
17187 /// Applications can examine the value using [State::value] or
17188 /// [State::name].
17189 UnknownValue(state::UnknownValue),
17190 }
17191
17192 #[doc(hidden)]
17193 pub mod state {
17194 #[allow(unused_imports)]
17195 use super::*;
17196 #[derive(Clone, Debug, PartialEq)]
17197 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17198 }
17199
17200 impl State {
17201 /// Gets the enum value.
17202 ///
17203 /// Returns `None` if the enum contains an unknown value deserialized from
17204 /// the string representation of enums.
17205 pub fn value(&self) -> std::option::Option<i32> {
17206 match self {
17207 Self::Unspecified => std::option::Option::Some(0),
17208 Self::Enabled => std::option::Option::Some(1),
17209 Self::Disabled => std::option::Option::Some(2),
17210 Self::UnknownValue(u) => u.0.value(),
17211 }
17212 }
17213
17214 /// Gets the enum value as a string.
17215 ///
17216 /// Returns `None` if the enum contains an unknown value deserialized from
17217 /// the integer representation of enums.
17218 pub fn name(&self) -> std::option::Option<&str> {
17219 match self {
17220 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17221 Self::Enabled => std::option::Option::Some("ENABLED"),
17222 Self::Disabled => std::option::Option::Some("DISABLED"),
17223 Self::UnknownValue(u) => u.0.name(),
17224 }
17225 }
17226 }
17227
17228 impl std::default::Default for State {
17229 fn default() -> Self {
17230 use std::convert::From;
17231 Self::from(0)
17232 }
17233 }
17234
17235 impl std::fmt::Display for State {
17236 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17237 wkt::internal::display_enum(f, self.name(), self.value())
17238 }
17239 }
17240
17241 impl std::convert::From<i32> for State {
17242 fn from(value: i32) -> Self {
17243 match value {
17244 0 => Self::Unspecified,
17245 1 => Self::Enabled,
17246 2 => Self::Disabled,
17247 _ => Self::UnknownValue(state::UnknownValue(
17248 wkt::internal::UnknownEnumValue::Integer(value),
17249 )),
17250 }
17251 }
17252 }
17253
17254 impl std::convert::From<&str> for State {
17255 fn from(value: &str) -> Self {
17256 use std::string::ToString;
17257 match value {
17258 "STATE_UNSPECIFIED" => Self::Unspecified,
17259 "ENABLED" => Self::Enabled,
17260 "DISABLED" => Self::Disabled,
17261 _ => Self::UnknownValue(state::UnknownValue(
17262 wkt::internal::UnknownEnumValue::String(value.to_string()),
17263 )),
17264 }
17265 }
17266 }
17267
17268 impl serde::ser::Serialize for State {
17269 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17270 where
17271 S: serde::Serializer,
17272 {
17273 match self {
17274 Self::Unspecified => serializer.serialize_i32(0),
17275 Self::Enabled => serializer.serialize_i32(1),
17276 Self::Disabled => serializer.serialize_i32(2),
17277 Self::UnknownValue(u) => u.0.serialize(serializer),
17278 }
17279 }
17280 }
17281
17282 impl<'de> serde::de::Deserialize<'de> for State {
17283 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17284 where
17285 D: serde::Deserializer<'de>,
17286 {
17287 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
17288 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.State",
17289 ))
17290 }
17291 }
17292
17293 /// Toggles the aggregation interval for collecting flow logs by 5-tuple.
17294 ///
17295 /// # Working with unknown values
17296 ///
17297 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17298 /// additional enum variants at any time. Adding new variants is not considered
17299 /// a breaking change. Applications should write their code in anticipation of:
17300 ///
17301 /// - New values appearing in future releases of the client library, **and**
17302 /// - New values received dynamically, without application changes.
17303 ///
17304 /// Please consult the [Working with enums] section in the user guide for some
17305 /// guidelines.
17306 ///
17307 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17308 #[derive(Clone, Debug, PartialEq)]
17309 #[non_exhaustive]
17310 pub enum AggregationInterval {
17311 /// If not specified, will default to INTERVAL_5_SEC.
17312 Unspecified,
17313 /// Aggregate logs in 5s intervals.
17314 Interval5Sec,
17315 /// Aggregate logs in 30s intervals.
17316 Interval30Sec,
17317 /// Aggregate logs in 1m intervals.
17318 Interval1Min,
17319 /// Aggregate logs in 5m intervals.
17320 Interval5Min,
17321 /// Aggregate logs in 10m intervals.
17322 Interval10Min,
17323 /// Aggregate logs in 15m intervals.
17324 Interval15Min,
17325 /// If set, the enum was initialized with an unknown value.
17326 ///
17327 /// Applications can examine the value using [AggregationInterval::value] or
17328 /// [AggregationInterval::name].
17329 UnknownValue(aggregation_interval::UnknownValue),
17330 }
17331
17332 #[doc(hidden)]
17333 pub mod aggregation_interval {
17334 #[allow(unused_imports)]
17335 use super::*;
17336 #[derive(Clone, Debug, PartialEq)]
17337 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17338 }
17339
17340 impl AggregationInterval {
17341 /// Gets the enum value.
17342 ///
17343 /// Returns `None` if the enum contains an unknown value deserialized from
17344 /// the string representation of enums.
17345 pub fn value(&self) -> std::option::Option<i32> {
17346 match self {
17347 Self::Unspecified => std::option::Option::Some(0),
17348 Self::Interval5Sec => std::option::Option::Some(1),
17349 Self::Interval30Sec => std::option::Option::Some(2),
17350 Self::Interval1Min => std::option::Option::Some(3),
17351 Self::Interval5Min => std::option::Option::Some(4),
17352 Self::Interval10Min => std::option::Option::Some(5),
17353 Self::Interval15Min => std::option::Option::Some(6),
17354 Self::UnknownValue(u) => u.0.value(),
17355 }
17356 }
17357
17358 /// Gets the enum value as a string.
17359 ///
17360 /// Returns `None` if the enum contains an unknown value deserialized from
17361 /// the integer representation of enums.
17362 pub fn name(&self) -> std::option::Option<&str> {
17363 match self {
17364 Self::Unspecified => std::option::Option::Some("AGGREGATION_INTERVAL_UNSPECIFIED"),
17365 Self::Interval5Sec => std::option::Option::Some("INTERVAL_5_SEC"),
17366 Self::Interval30Sec => std::option::Option::Some("INTERVAL_30_SEC"),
17367 Self::Interval1Min => std::option::Option::Some("INTERVAL_1_MIN"),
17368 Self::Interval5Min => std::option::Option::Some("INTERVAL_5_MIN"),
17369 Self::Interval10Min => std::option::Option::Some("INTERVAL_10_MIN"),
17370 Self::Interval15Min => std::option::Option::Some("INTERVAL_15_MIN"),
17371 Self::UnknownValue(u) => u.0.name(),
17372 }
17373 }
17374 }
17375
17376 impl std::default::Default for AggregationInterval {
17377 fn default() -> Self {
17378 use std::convert::From;
17379 Self::from(0)
17380 }
17381 }
17382
17383 impl std::fmt::Display for AggregationInterval {
17384 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17385 wkt::internal::display_enum(f, self.name(), self.value())
17386 }
17387 }
17388
17389 impl std::convert::From<i32> for AggregationInterval {
17390 fn from(value: i32) -> Self {
17391 match value {
17392 0 => Self::Unspecified,
17393 1 => Self::Interval5Sec,
17394 2 => Self::Interval30Sec,
17395 3 => Self::Interval1Min,
17396 4 => Self::Interval5Min,
17397 5 => Self::Interval10Min,
17398 6 => Self::Interval15Min,
17399 _ => Self::UnknownValue(aggregation_interval::UnknownValue(
17400 wkt::internal::UnknownEnumValue::Integer(value),
17401 )),
17402 }
17403 }
17404 }
17405
17406 impl std::convert::From<&str> for AggregationInterval {
17407 fn from(value: &str) -> Self {
17408 use std::string::ToString;
17409 match value {
17410 "AGGREGATION_INTERVAL_UNSPECIFIED" => Self::Unspecified,
17411 "INTERVAL_5_SEC" => Self::Interval5Sec,
17412 "INTERVAL_30_SEC" => Self::Interval30Sec,
17413 "INTERVAL_1_MIN" => Self::Interval1Min,
17414 "INTERVAL_5_MIN" => Self::Interval5Min,
17415 "INTERVAL_10_MIN" => Self::Interval10Min,
17416 "INTERVAL_15_MIN" => Self::Interval15Min,
17417 _ => Self::UnknownValue(aggregation_interval::UnknownValue(
17418 wkt::internal::UnknownEnumValue::String(value.to_string()),
17419 )),
17420 }
17421 }
17422 }
17423
17424 impl serde::ser::Serialize for AggregationInterval {
17425 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17426 where
17427 S: serde::Serializer,
17428 {
17429 match self {
17430 Self::Unspecified => serializer.serialize_i32(0),
17431 Self::Interval5Sec => serializer.serialize_i32(1),
17432 Self::Interval30Sec => serializer.serialize_i32(2),
17433 Self::Interval1Min => serializer.serialize_i32(3),
17434 Self::Interval5Min => serializer.serialize_i32(4),
17435 Self::Interval10Min => serializer.serialize_i32(5),
17436 Self::Interval15Min => serializer.serialize_i32(6),
17437 Self::UnknownValue(u) => u.0.serialize(serializer),
17438 }
17439 }
17440 }
17441
17442 impl<'de> serde::de::Deserialize<'de> for AggregationInterval {
17443 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17444 where
17445 D: serde::Deserializer<'de>,
17446 {
17447 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AggregationInterval>::new(
17448 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.AggregationInterval",
17449 ))
17450 }
17451 }
17452
17453 /// Configures which log fields would be included.
17454 ///
17455 /// # Working with unknown values
17456 ///
17457 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17458 /// additional enum variants at any time. Adding new variants is not considered
17459 /// a breaking change. Applications should write their code in anticipation of:
17460 ///
17461 /// - New values appearing in future releases of the client library, **and**
17462 /// - New values received dynamically, without application changes.
17463 ///
17464 /// Please consult the [Working with enums] section in the user guide for some
17465 /// guidelines.
17466 ///
17467 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17468 #[derive(Clone, Debug, PartialEq)]
17469 #[non_exhaustive]
17470 pub enum Metadata {
17471 /// If not specified, will default to INCLUDE_ALL_METADATA.
17472 Unspecified,
17473 /// Include all metadata fields.
17474 IncludeAllMetadata,
17475 /// Exclude all metadata fields.
17476 ExcludeAllMetadata,
17477 /// Include only custom fields (specified in metadata_fields).
17478 CustomMetadata,
17479 /// If set, the enum was initialized with an unknown value.
17480 ///
17481 /// Applications can examine the value using [Metadata::value] or
17482 /// [Metadata::name].
17483 UnknownValue(metadata::UnknownValue),
17484 }
17485
17486 #[doc(hidden)]
17487 pub mod metadata {
17488 #[allow(unused_imports)]
17489 use super::*;
17490 #[derive(Clone, Debug, PartialEq)]
17491 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17492 }
17493
17494 impl Metadata {
17495 /// Gets the enum value.
17496 ///
17497 /// Returns `None` if the enum contains an unknown value deserialized from
17498 /// the string representation of enums.
17499 pub fn value(&self) -> std::option::Option<i32> {
17500 match self {
17501 Self::Unspecified => std::option::Option::Some(0),
17502 Self::IncludeAllMetadata => std::option::Option::Some(1),
17503 Self::ExcludeAllMetadata => std::option::Option::Some(2),
17504 Self::CustomMetadata => std::option::Option::Some(3),
17505 Self::UnknownValue(u) => u.0.value(),
17506 }
17507 }
17508
17509 /// Gets the enum value as a string.
17510 ///
17511 /// Returns `None` if the enum contains an unknown value deserialized from
17512 /// the integer representation of enums.
17513 pub fn name(&self) -> std::option::Option<&str> {
17514 match self {
17515 Self::Unspecified => std::option::Option::Some("METADATA_UNSPECIFIED"),
17516 Self::IncludeAllMetadata => std::option::Option::Some("INCLUDE_ALL_METADATA"),
17517 Self::ExcludeAllMetadata => std::option::Option::Some("EXCLUDE_ALL_METADATA"),
17518 Self::CustomMetadata => std::option::Option::Some("CUSTOM_METADATA"),
17519 Self::UnknownValue(u) => u.0.name(),
17520 }
17521 }
17522 }
17523
17524 impl std::default::Default for Metadata {
17525 fn default() -> Self {
17526 use std::convert::From;
17527 Self::from(0)
17528 }
17529 }
17530
17531 impl std::fmt::Display for Metadata {
17532 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17533 wkt::internal::display_enum(f, self.name(), self.value())
17534 }
17535 }
17536
17537 impl std::convert::From<i32> for Metadata {
17538 fn from(value: i32) -> Self {
17539 match value {
17540 0 => Self::Unspecified,
17541 1 => Self::IncludeAllMetadata,
17542 2 => Self::ExcludeAllMetadata,
17543 3 => Self::CustomMetadata,
17544 _ => Self::UnknownValue(metadata::UnknownValue(
17545 wkt::internal::UnknownEnumValue::Integer(value),
17546 )),
17547 }
17548 }
17549 }
17550
17551 impl std::convert::From<&str> for Metadata {
17552 fn from(value: &str) -> Self {
17553 use std::string::ToString;
17554 match value {
17555 "METADATA_UNSPECIFIED" => Self::Unspecified,
17556 "INCLUDE_ALL_METADATA" => Self::IncludeAllMetadata,
17557 "EXCLUDE_ALL_METADATA" => Self::ExcludeAllMetadata,
17558 "CUSTOM_METADATA" => Self::CustomMetadata,
17559 _ => Self::UnknownValue(metadata::UnknownValue(
17560 wkt::internal::UnknownEnumValue::String(value.to_string()),
17561 )),
17562 }
17563 }
17564 }
17565
17566 impl serde::ser::Serialize for Metadata {
17567 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17568 where
17569 S: serde::Serializer,
17570 {
17571 match self {
17572 Self::Unspecified => serializer.serialize_i32(0),
17573 Self::IncludeAllMetadata => serializer.serialize_i32(1),
17574 Self::ExcludeAllMetadata => serializer.serialize_i32(2),
17575 Self::CustomMetadata => serializer.serialize_i32(3),
17576 Self::UnknownValue(u) => u.0.serialize(serializer),
17577 }
17578 }
17579 }
17580
17581 impl<'de> serde::de::Deserialize<'de> for Metadata {
17582 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17583 where
17584 D: serde::Deserializer<'de>,
17585 {
17586 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Metadata>::new(
17587 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.Metadata",
17588 ))
17589 }
17590 }
17591
17592 /// Determines whether to include cross project annotations in the logs.
17593 /// Project configurations will always have CROSS_PROJECT_METADATA_DISABLED.
17594 ///
17595 /// # Working with unknown values
17596 ///
17597 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17598 /// additional enum variants at any time. Adding new variants is not considered
17599 /// a breaking change. Applications should write their code in anticipation of:
17600 ///
17601 /// - New values appearing in future releases of the client library, **and**
17602 /// - New values received dynamically, without application changes.
17603 ///
17604 /// Please consult the [Working with enums] section in the user guide for some
17605 /// guidelines.
17606 ///
17607 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17608 #[derive(Clone, Debug, PartialEq)]
17609 #[non_exhaustive]
17610 pub enum CrossProjectMetadata {
17611 /// If not specified, the default is CROSS_PROJECT_METADATA_ENABLED.
17612 Unspecified,
17613 /// When CROSS_PROJECT_METADATA_ENABLED, metadata from other projects will be
17614 /// included in the logs.
17615 Enabled,
17616 /// When CROSS_PROJECT_METADATA_DISABLED, metadata from other projects will
17617 /// not be included in the logs.
17618 Disabled,
17619 /// If set, the enum was initialized with an unknown value.
17620 ///
17621 /// Applications can examine the value using [CrossProjectMetadata::value] or
17622 /// [CrossProjectMetadata::name].
17623 UnknownValue(cross_project_metadata::UnknownValue),
17624 }
17625
17626 #[doc(hidden)]
17627 pub mod cross_project_metadata {
17628 #[allow(unused_imports)]
17629 use super::*;
17630 #[derive(Clone, Debug, PartialEq)]
17631 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17632 }
17633
17634 impl CrossProjectMetadata {
17635 /// Gets the enum value.
17636 ///
17637 /// Returns `None` if the enum contains an unknown value deserialized from
17638 /// the string representation of enums.
17639 pub fn value(&self) -> std::option::Option<i32> {
17640 match self {
17641 Self::Unspecified => std::option::Option::Some(0),
17642 Self::Enabled => std::option::Option::Some(1),
17643 Self::Disabled => std::option::Option::Some(2),
17644 Self::UnknownValue(u) => u.0.value(),
17645 }
17646 }
17647
17648 /// Gets the enum value as a string.
17649 ///
17650 /// Returns `None` if the enum contains an unknown value deserialized from
17651 /// the integer representation of enums.
17652 pub fn name(&self) -> std::option::Option<&str> {
17653 match self {
17654 Self::Unspecified => {
17655 std::option::Option::Some("CROSS_PROJECT_METADATA_UNSPECIFIED")
17656 }
17657 Self::Enabled => std::option::Option::Some("CROSS_PROJECT_METADATA_ENABLED"),
17658 Self::Disabled => std::option::Option::Some("CROSS_PROJECT_METADATA_DISABLED"),
17659 Self::UnknownValue(u) => u.0.name(),
17660 }
17661 }
17662 }
17663
17664 impl std::default::Default for CrossProjectMetadata {
17665 fn default() -> Self {
17666 use std::convert::From;
17667 Self::from(0)
17668 }
17669 }
17670
17671 impl std::fmt::Display for CrossProjectMetadata {
17672 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17673 wkt::internal::display_enum(f, self.name(), self.value())
17674 }
17675 }
17676
17677 impl std::convert::From<i32> for CrossProjectMetadata {
17678 fn from(value: i32) -> Self {
17679 match value {
17680 0 => Self::Unspecified,
17681 1 => Self::Enabled,
17682 2 => Self::Disabled,
17683 _ => Self::UnknownValue(cross_project_metadata::UnknownValue(
17684 wkt::internal::UnknownEnumValue::Integer(value),
17685 )),
17686 }
17687 }
17688 }
17689
17690 impl std::convert::From<&str> for CrossProjectMetadata {
17691 fn from(value: &str) -> Self {
17692 use std::string::ToString;
17693 match value {
17694 "CROSS_PROJECT_METADATA_UNSPECIFIED" => Self::Unspecified,
17695 "CROSS_PROJECT_METADATA_ENABLED" => Self::Enabled,
17696 "CROSS_PROJECT_METADATA_DISABLED" => Self::Disabled,
17697 _ => Self::UnknownValue(cross_project_metadata::UnknownValue(
17698 wkt::internal::UnknownEnumValue::String(value.to_string()),
17699 )),
17700 }
17701 }
17702 }
17703
17704 impl serde::ser::Serialize for CrossProjectMetadata {
17705 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17706 where
17707 S: serde::Serializer,
17708 {
17709 match self {
17710 Self::Unspecified => serializer.serialize_i32(0),
17711 Self::Enabled => serializer.serialize_i32(1),
17712 Self::Disabled => serializer.serialize_i32(2),
17713 Self::UnknownValue(u) => u.0.serialize(serializer),
17714 }
17715 }
17716 }
17717
17718 impl<'de> serde::de::Deserialize<'de> for CrossProjectMetadata {
17719 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17720 where
17721 D: serde::Deserializer<'de>,
17722 {
17723 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CrossProjectMetadata>::new(
17724 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.CrossProjectMetadata",
17725 ))
17726 }
17727 }
17728
17729 /// Output only. Indicates whether the target resource exists, for diagnostic
17730 /// purposes.
17731 ///
17732 /// # Working with unknown values
17733 ///
17734 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17735 /// additional enum variants at any time. Adding new variants is not considered
17736 /// a breaking change. Applications should write their code in anticipation of:
17737 ///
17738 /// - New values appearing in future releases of the client library, **and**
17739 /// - New values received dynamically, without application changes.
17740 ///
17741 /// Please consult the [Working with enums] section in the user guide for some
17742 /// guidelines.
17743 ///
17744 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17745 #[derive(Clone, Debug, PartialEq)]
17746 #[non_exhaustive]
17747 pub enum TargetResourceState {
17748 /// Unspecified target resource state.
17749 Unspecified,
17750 /// Indicates that the target resource exists.
17751 TargetResourceExists,
17752 /// Indicates that the target resource does not exist.
17753 TargetResourceDoesNotExist,
17754 /// If set, the enum was initialized with an unknown value.
17755 ///
17756 /// Applications can examine the value using [TargetResourceState::value] or
17757 /// [TargetResourceState::name].
17758 UnknownValue(target_resource_state::UnknownValue),
17759 }
17760
17761 #[doc(hidden)]
17762 pub mod target_resource_state {
17763 #[allow(unused_imports)]
17764 use super::*;
17765 #[derive(Clone, Debug, PartialEq)]
17766 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17767 }
17768
17769 impl TargetResourceState {
17770 /// Gets the enum value.
17771 ///
17772 /// Returns `None` if the enum contains an unknown value deserialized from
17773 /// the string representation of enums.
17774 pub fn value(&self) -> std::option::Option<i32> {
17775 match self {
17776 Self::Unspecified => std::option::Option::Some(0),
17777 Self::TargetResourceExists => std::option::Option::Some(1),
17778 Self::TargetResourceDoesNotExist => std::option::Option::Some(2),
17779 Self::UnknownValue(u) => u.0.value(),
17780 }
17781 }
17782
17783 /// Gets the enum value as a string.
17784 ///
17785 /// Returns `None` if the enum contains an unknown value deserialized from
17786 /// the integer representation of enums.
17787 pub fn name(&self) -> std::option::Option<&str> {
17788 match self {
17789 Self::Unspecified => std::option::Option::Some("TARGET_RESOURCE_STATE_UNSPECIFIED"),
17790 Self::TargetResourceExists => std::option::Option::Some("TARGET_RESOURCE_EXISTS"),
17791 Self::TargetResourceDoesNotExist => {
17792 std::option::Option::Some("TARGET_RESOURCE_DOES_NOT_EXIST")
17793 }
17794 Self::UnknownValue(u) => u.0.name(),
17795 }
17796 }
17797 }
17798
17799 impl std::default::Default for TargetResourceState {
17800 fn default() -> Self {
17801 use std::convert::From;
17802 Self::from(0)
17803 }
17804 }
17805
17806 impl std::fmt::Display for TargetResourceState {
17807 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17808 wkt::internal::display_enum(f, self.name(), self.value())
17809 }
17810 }
17811
17812 impl std::convert::From<i32> for TargetResourceState {
17813 fn from(value: i32) -> Self {
17814 match value {
17815 0 => Self::Unspecified,
17816 1 => Self::TargetResourceExists,
17817 2 => Self::TargetResourceDoesNotExist,
17818 _ => Self::UnknownValue(target_resource_state::UnknownValue(
17819 wkt::internal::UnknownEnumValue::Integer(value),
17820 )),
17821 }
17822 }
17823 }
17824
17825 impl std::convert::From<&str> for TargetResourceState {
17826 fn from(value: &str) -> Self {
17827 use std::string::ToString;
17828 match value {
17829 "TARGET_RESOURCE_STATE_UNSPECIFIED" => Self::Unspecified,
17830 "TARGET_RESOURCE_EXISTS" => Self::TargetResourceExists,
17831 "TARGET_RESOURCE_DOES_NOT_EXIST" => Self::TargetResourceDoesNotExist,
17832 _ => Self::UnknownValue(target_resource_state::UnknownValue(
17833 wkt::internal::UnknownEnumValue::String(value.to_string()),
17834 )),
17835 }
17836 }
17837 }
17838
17839 impl serde::ser::Serialize for TargetResourceState {
17840 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17841 where
17842 S: serde::Serializer,
17843 {
17844 match self {
17845 Self::Unspecified => serializer.serialize_i32(0),
17846 Self::TargetResourceExists => serializer.serialize_i32(1),
17847 Self::TargetResourceDoesNotExist => serializer.serialize_i32(2),
17848 Self::UnknownValue(u) => u.0.serialize(serializer),
17849 }
17850 }
17851 }
17852
17853 impl<'de> serde::de::Deserialize<'de> for TargetResourceState {
17854 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17855 where
17856 D: serde::Deserializer<'de>,
17857 {
17858 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetResourceState>::new(
17859 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.TargetResourceState",
17860 ))
17861 }
17862 }
17863
17864 /// Reference to the resource of the config scope. That is, the scope from
17865 /// which traffic is logged. The target resource must belong to the same
17866 /// project as the configuration.
17867 /// This field is not supported for organization level configurations.
17868 #[derive(Clone, Debug, PartialEq)]
17869 #[non_exhaustive]
17870 pub enum TargetResource {
17871 /// Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
17872 /// within the network.
17873 /// Format: projects/{project_id}/global/networks/{name}
17874 Network(std::string::String),
17875 /// Traffic will be logged from VMs within the subnetwork.
17876 /// Format: projects/{project_id}/regions/{region}/subnetworks/{name}
17877 Subnet(std::string::String),
17878 /// Traffic will be logged from the Interconnect Attachment.
17879 /// Format:
17880 /// projects/{project_id}/regions/{region}/interconnectAttachments/{name}
17881 InterconnectAttachment(std::string::String),
17882 /// Traffic will be logged from the VPN Tunnel.
17883 /// Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
17884 VpnTunnel(std::string::String),
17885 }
17886}
17887
17888/// A configuration to generate a response for GetEffectiveVpcFlowLogsConfig
17889/// request.
17890#[derive(Clone, Default, PartialEq)]
17891#[non_exhaustive]
17892pub struct EffectiveVpcFlowLogsConfig {
17893 /// Unique name of the configuration. The name can have one of the following
17894 /// forms:
17895 ///
17896 /// - For project-level configurations:
17897 /// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
17898 ///
17899 /// - For organization-level configurations:
17900 /// `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
17901 ///
17902 /// - For a Compute config, the name will be the path of the subnet:
17903 /// `projects/{project_id}/regions/{region}/subnetworks/{subnet_id}`
17904 ///
17905 pub name: std::string::String,
17906
17907 /// The state of the VPC Flow Log configuration. Default value is ENABLED.
17908 /// When creating a new configuration, it must be enabled.
17909 /// Setting state=DISABLED will pause the log generation for this config.
17910 pub state: std::option::Option<crate::model::vpc_flow_logs_config::State>,
17911
17912 /// The aggregation interval for the logs. Default value is INTERVAL_5_SEC.
17913 pub aggregation_interval:
17914 std::option::Option<crate::model::vpc_flow_logs_config::AggregationInterval>,
17915
17916 /// The value of the field must be in (0, 1]. The sampling rate of VPC Flow
17917 /// Logs where 1.0 means all collected logs are reported.
17918 /// Setting the sampling rate to 0.0 is not allowed. If you want to disable VPC
17919 /// Flow Logs, use the state field instead.
17920 /// Default value is 1.0.
17921 pub flow_sampling: std::option::Option<f32>,
17922
17923 /// Configures whether all, none or a subset of metadata fields should be
17924 /// added to the reported VPC flow logs.
17925 /// Default value is INCLUDE_ALL_METADATA.
17926 pub metadata: std::option::Option<crate::model::vpc_flow_logs_config::Metadata>,
17927
17928 /// Custom metadata fields to include in the reported VPC flow logs.
17929 /// Can only be specified if "metadata" was set to CUSTOM_METADATA.
17930 pub metadata_fields: std::vec::Vec<std::string::String>,
17931
17932 /// Export filter used to define which VPC Flow Logs should be logged.
17933 pub filter_expr: std::option::Option<std::string::String>,
17934
17935 /// Determines whether to include cross project annotations in the logs.
17936 /// This field is available only for organization configurations. If not
17937 /// specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
17938 pub cross_project_metadata:
17939 std::option::Option<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
17940
17941 /// Specifies the scope of the config (e.g., SUBNET, NETWORK, ORGANIZATION..).
17942 pub scope: std::option::Option<crate::model::effective_vpc_flow_logs_config::Scope>,
17943
17944 /// Reference to the resource of the config scope. That is, the scope from
17945 /// which traffic is logged. The target resource must belong to the same
17946 /// project as the configuration.
17947 /// This field is not supported for organization level configurations.
17948 pub target_resource:
17949 std::option::Option<crate::model::effective_vpc_flow_logs_config::TargetResource>,
17950
17951 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17952}
17953
17954impl EffectiveVpcFlowLogsConfig {
17955 pub fn new() -> Self {
17956 std::default::Default::default()
17957 }
17958
17959 /// Sets the value of [name][crate::model::EffectiveVpcFlowLogsConfig::name].
17960 ///
17961 /// # Example
17962 /// ```ignore,no_run
17963 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17964 /// let x = EffectiveVpcFlowLogsConfig::new().set_name("example");
17965 /// ```
17966 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17967 self.name = v.into();
17968 self
17969 }
17970
17971 /// Sets the value of [state][crate::model::EffectiveVpcFlowLogsConfig::state].
17972 ///
17973 /// # Example
17974 /// ```ignore,no_run
17975 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17976 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
17977 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_state(State::Enabled);
17978 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_state(State::Disabled);
17979 /// ```
17980 pub fn set_state<T>(mut self, v: T) -> Self
17981 where
17982 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
17983 {
17984 self.state = std::option::Option::Some(v.into());
17985 self
17986 }
17987
17988 /// Sets or clears the value of [state][crate::model::EffectiveVpcFlowLogsConfig::state].
17989 ///
17990 /// # Example
17991 /// ```ignore,no_run
17992 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17993 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
17994 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(Some(State::Enabled));
17995 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(Some(State::Disabled));
17996 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(None::<State>);
17997 /// ```
17998 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
17999 where
18000 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
18001 {
18002 self.state = v.map(|x| x.into());
18003 self
18004 }
18005
18006 /// Sets the value of [aggregation_interval][crate::model::EffectiveVpcFlowLogsConfig::aggregation_interval].
18007 ///
18008 /// # Example
18009 /// ```ignore,no_run
18010 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18011 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
18012 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval5Sec);
18013 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval30Sec);
18014 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval1Min);
18015 /// ```
18016 pub fn set_aggregation_interval<T>(mut self, v: T) -> Self
18017 where
18018 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
18019 {
18020 self.aggregation_interval = std::option::Option::Some(v.into());
18021 self
18022 }
18023
18024 /// Sets or clears the value of [aggregation_interval][crate::model::EffectiveVpcFlowLogsConfig::aggregation_interval].
18025 ///
18026 /// # Example
18027 /// ```ignore,no_run
18028 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18029 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
18030 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval5Sec));
18031 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval30Sec));
18032 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval1Min));
18033 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(None::<AggregationInterval>);
18034 /// ```
18035 pub fn set_or_clear_aggregation_interval<T>(mut self, v: std::option::Option<T>) -> Self
18036 where
18037 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
18038 {
18039 self.aggregation_interval = v.map(|x| x.into());
18040 self
18041 }
18042
18043 /// Sets the value of [flow_sampling][crate::model::EffectiveVpcFlowLogsConfig::flow_sampling].
18044 ///
18045 /// # Example
18046 /// ```ignore,no_run
18047 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18048 /// let x = EffectiveVpcFlowLogsConfig::new().set_flow_sampling(42.0);
18049 /// ```
18050 pub fn set_flow_sampling<T>(mut self, v: T) -> Self
18051 where
18052 T: std::convert::Into<f32>,
18053 {
18054 self.flow_sampling = std::option::Option::Some(v.into());
18055 self
18056 }
18057
18058 /// Sets or clears the value of [flow_sampling][crate::model::EffectiveVpcFlowLogsConfig::flow_sampling].
18059 ///
18060 /// # Example
18061 /// ```ignore,no_run
18062 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18063 /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_flow_sampling(Some(42.0));
18064 /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_flow_sampling(None::<f32>);
18065 /// ```
18066 pub fn set_or_clear_flow_sampling<T>(mut self, v: std::option::Option<T>) -> Self
18067 where
18068 T: std::convert::Into<f32>,
18069 {
18070 self.flow_sampling = v.map(|x| x.into());
18071 self
18072 }
18073
18074 /// Sets the value of [metadata][crate::model::EffectiveVpcFlowLogsConfig::metadata].
18075 ///
18076 /// # Example
18077 /// ```ignore,no_run
18078 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18079 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
18080 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::IncludeAllMetadata);
18081 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::ExcludeAllMetadata);
18082 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::CustomMetadata);
18083 /// ```
18084 pub fn set_metadata<T>(mut self, v: T) -> Self
18085 where
18086 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
18087 {
18088 self.metadata = std::option::Option::Some(v.into());
18089 self
18090 }
18091
18092 /// Sets or clears the value of [metadata][crate::model::EffectiveVpcFlowLogsConfig::metadata].
18093 ///
18094 /// # Example
18095 /// ```ignore,no_run
18096 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18097 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
18098 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::IncludeAllMetadata));
18099 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::ExcludeAllMetadata));
18100 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::CustomMetadata));
18101 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(None::<Metadata>);
18102 /// ```
18103 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
18104 where
18105 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
18106 {
18107 self.metadata = v.map(|x| x.into());
18108 self
18109 }
18110
18111 /// Sets the value of [metadata_fields][crate::model::EffectiveVpcFlowLogsConfig::metadata_fields].
18112 ///
18113 /// # Example
18114 /// ```ignore,no_run
18115 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18116 /// let x = EffectiveVpcFlowLogsConfig::new().set_metadata_fields(["a", "b", "c"]);
18117 /// ```
18118 pub fn set_metadata_fields<T, V>(mut self, v: T) -> Self
18119 where
18120 T: std::iter::IntoIterator<Item = V>,
18121 V: std::convert::Into<std::string::String>,
18122 {
18123 use std::iter::Iterator;
18124 self.metadata_fields = v.into_iter().map(|i| i.into()).collect();
18125 self
18126 }
18127
18128 /// Sets the value of [filter_expr][crate::model::EffectiveVpcFlowLogsConfig::filter_expr].
18129 ///
18130 /// # Example
18131 /// ```ignore,no_run
18132 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18133 /// let x = EffectiveVpcFlowLogsConfig::new().set_filter_expr("example");
18134 /// ```
18135 pub fn set_filter_expr<T>(mut self, v: T) -> Self
18136 where
18137 T: std::convert::Into<std::string::String>,
18138 {
18139 self.filter_expr = std::option::Option::Some(v.into());
18140 self
18141 }
18142
18143 /// Sets or clears the value of [filter_expr][crate::model::EffectiveVpcFlowLogsConfig::filter_expr].
18144 ///
18145 /// # Example
18146 /// ```ignore,no_run
18147 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18148 /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_filter_expr(Some("example"));
18149 /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_filter_expr(None::<String>);
18150 /// ```
18151 pub fn set_or_clear_filter_expr<T>(mut self, v: std::option::Option<T>) -> Self
18152 where
18153 T: std::convert::Into<std::string::String>,
18154 {
18155 self.filter_expr = v.map(|x| x.into());
18156 self
18157 }
18158
18159 /// Sets the value of [cross_project_metadata][crate::model::EffectiveVpcFlowLogsConfig::cross_project_metadata].
18160 ///
18161 /// # Example
18162 /// ```ignore,no_run
18163 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18164 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
18165 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Enabled);
18166 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Disabled);
18167 /// ```
18168 pub fn set_cross_project_metadata<T>(mut self, v: T) -> Self
18169 where
18170 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
18171 {
18172 self.cross_project_metadata = std::option::Option::Some(v.into());
18173 self
18174 }
18175
18176 /// Sets or clears the value of [cross_project_metadata][crate::model::EffectiveVpcFlowLogsConfig::cross_project_metadata].
18177 ///
18178 /// # Example
18179 /// ```ignore,no_run
18180 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18181 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
18182 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Enabled));
18183 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Disabled));
18184 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(None::<CrossProjectMetadata>);
18185 /// ```
18186 pub fn set_or_clear_cross_project_metadata<T>(mut self, v: std::option::Option<T>) -> Self
18187 where
18188 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
18189 {
18190 self.cross_project_metadata = v.map(|x| x.into());
18191 self
18192 }
18193
18194 /// Sets the value of [scope][crate::model::EffectiveVpcFlowLogsConfig::scope].
18195 ///
18196 /// # Example
18197 /// ```ignore,no_run
18198 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18199 /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::Scope;
18200 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::Subnet);
18201 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::ComputeApiSubnet);
18202 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::Network);
18203 /// ```
18204 pub fn set_scope<T>(mut self, v: T) -> Self
18205 where
18206 T: std::convert::Into<crate::model::effective_vpc_flow_logs_config::Scope>,
18207 {
18208 self.scope = std::option::Option::Some(v.into());
18209 self
18210 }
18211
18212 /// Sets or clears the value of [scope][crate::model::EffectiveVpcFlowLogsConfig::scope].
18213 ///
18214 /// # Example
18215 /// ```ignore,no_run
18216 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18217 /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::Scope;
18218 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::Subnet));
18219 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::ComputeApiSubnet));
18220 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::Network));
18221 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(None::<Scope>);
18222 /// ```
18223 pub fn set_or_clear_scope<T>(mut self, v: std::option::Option<T>) -> Self
18224 where
18225 T: std::convert::Into<crate::model::effective_vpc_flow_logs_config::Scope>,
18226 {
18227 self.scope = v.map(|x| x.into());
18228 self
18229 }
18230
18231 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource].
18232 ///
18233 /// Note that all the setters affecting `target_resource` are mutually
18234 /// exclusive.
18235 ///
18236 /// # Example
18237 /// ```ignore,no_run
18238 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18239 /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::TargetResource;
18240 /// let x = EffectiveVpcFlowLogsConfig::new().set_target_resource(Some(TargetResource::Network("example".to_string())));
18241 /// ```
18242 pub fn set_target_resource<
18243 T: std::convert::Into<
18244 std::option::Option<crate::model::effective_vpc_flow_logs_config::TargetResource>,
18245 >,
18246 >(
18247 mut self,
18248 v: T,
18249 ) -> Self {
18250 self.target_resource = v.into();
18251 self
18252 }
18253
18254 /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
18255 /// if it holds a `Network`, `None` if the field is not set or
18256 /// holds a different branch.
18257 pub fn network(&self) -> std::option::Option<&std::string::String> {
18258 #[allow(unreachable_patterns)]
18259 self.target_resource.as_ref().and_then(|v| match v {
18260 crate::model::effective_vpc_flow_logs_config::TargetResource::Network(v) => {
18261 std::option::Option::Some(v)
18262 }
18263 _ => std::option::Option::None,
18264 })
18265 }
18266
18267 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
18268 /// to hold a `Network`.
18269 ///
18270 /// Note that all the setters affecting `target_resource` are
18271 /// mutually exclusive.
18272 ///
18273 /// # Example
18274 /// ```ignore,no_run
18275 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18276 /// let x = EffectiveVpcFlowLogsConfig::new().set_network("example");
18277 /// assert!(x.network().is_some());
18278 /// assert!(x.subnet().is_none());
18279 /// assert!(x.interconnect_attachment().is_none());
18280 /// assert!(x.vpn_tunnel().is_none());
18281 /// ```
18282 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18283 self.target_resource = std::option::Option::Some(
18284 crate::model::effective_vpc_flow_logs_config::TargetResource::Network(v.into()),
18285 );
18286 self
18287 }
18288
18289 /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
18290 /// if it holds a `Subnet`, `None` if the field is not set or
18291 /// holds a different branch.
18292 pub fn subnet(&self) -> std::option::Option<&std::string::String> {
18293 #[allow(unreachable_patterns)]
18294 self.target_resource.as_ref().and_then(|v| match v {
18295 crate::model::effective_vpc_flow_logs_config::TargetResource::Subnet(v) => {
18296 std::option::Option::Some(v)
18297 }
18298 _ => std::option::Option::None,
18299 })
18300 }
18301
18302 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
18303 /// to hold a `Subnet`.
18304 ///
18305 /// Note that all the setters affecting `target_resource` are
18306 /// mutually exclusive.
18307 ///
18308 /// # Example
18309 /// ```ignore,no_run
18310 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18311 /// let x = EffectiveVpcFlowLogsConfig::new().set_subnet("example");
18312 /// assert!(x.subnet().is_some());
18313 /// assert!(x.network().is_none());
18314 /// assert!(x.interconnect_attachment().is_none());
18315 /// assert!(x.vpn_tunnel().is_none());
18316 /// ```
18317 pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18318 self.target_resource = std::option::Option::Some(
18319 crate::model::effective_vpc_flow_logs_config::TargetResource::Subnet(v.into()),
18320 );
18321 self
18322 }
18323
18324 /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
18325 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
18326 /// holds a different branch.
18327 pub fn interconnect_attachment(&self) -> std::option::Option<&std::string::String> {
18328 #[allow(unreachable_patterns)]
18329 self.target_resource.as_ref().and_then(|v| match v {
18330 crate::model::effective_vpc_flow_logs_config::TargetResource::InterconnectAttachment(v) => std::option::Option::Some(v),
18331 _ => std::option::Option::None,
18332 })
18333 }
18334
18335 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
18336 /// to hold a `InterconnectAttachment`.
18337 ///
18338 /// Note that all the setters affecting `target_resource` are
18339 /// mutually exclusive.
18340 ///
18341 /// # Example
18342 /// ```ignore,no_run
18343 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18344 /// let x = EffectiveVpcFlowLogsConfig::new().set_interconnect_attachment("example");
18345 /// assert!(x.interconnect_attachment().is_some());
18346 /// assert!(x.network().is_none());
18347 /// assert!(x.subnet().is_none());
18348 /// assert!(x.vpn_tunnel().is_none());
18349 /// ```
18350 pub fn set_interconnect_attachment<T: std::convert::Into<std::string::String>>(
18351 mut self,
18352 v: T,
18353 ) -> Self {
18354 self.target_resource = std::option::Option::Some(
18355 crate::model::effective_vpc_flow_logs_config::TargetResource::InterconnectAttachment(
18356 v.into(),
18357 ),
18358 );
18359 self
18360 }
18361
18362 /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
18363 /// if it holds a `VpnTunnel`, `None` if the field is not set or
18364 /// holds a different branch.
18365 pub fn vpn_tunnel(&self) -> std::option::Option<&std::string::String> {
18366 #[allow(unreachable_patterns)]
18367 self.target_resource.as_ref().and_then(|v| match v {
18368 crate::model::effective_vpc_flow_logs_config::TargetResource::VpnTunnel(v) => {
18369 std::option::Option::Some(v)
18370 }
18371 _ => std::option::Option::None,
18372 })
18373 }
18374
18375 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
18376 /// to hold a `VpnTunnel`.
18377 ///
18378 /// Note that all the setters affecting `target_resource` are
18379 /// mutually exclusive.
18380 ///
18381 /// # Example
18382 /// ```ignore,no_run
18383 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18384 /// let x = EffectiveVpcFlowLogsConfig::new().set_vpn_tunnel("example");
18385 /// assert!(x.vpn_tunnel().is_some());
18386 /// assert!(x.network().is_none());
18387 /// assert!(x.subnet().is_none());
18388 /// assert!(x.interconnect_attachment().is_none());
18389 /// ```
18390 pub fn set_vpn_tunnel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18391 self.target_resource = std::option::Option::Some(
18392 crate::model::effective_vpc_flow_logs_config::TargetResource::VpnTunnel(v.into()),
18393 );
18394 self
18395 }
18396}
18397
18398impl wkt::message::Message for EffectiveVpcFlowLogsConfig {
18399 fn typename() -> &'static str {
18400 "type.googleapis.com/google.cloud.networkmanagement.v1.EffectiveVpcFlowLogsConfig"
18401 }
18402}
18403
18404/// Defines additional types related to [EffectiveVpcFlowLogsConfig].
18405pub mod effective_vpc_flow_logs_config {
18406 #[allow(unused_imports)]
18407 use super::*;
18408
18409 /// The scope for this flow log configuration.
18410 ///
18411 /// # Working with unknown values
18412 ///
18413 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18414 /// additional enum variants at any time. Adding new variants is not considered
18415 /// a breaking change. Applications should write their code in anticipation of:
18416 ///
18417 /// - New values appearing in future releases of the client library, **and**
18418 /// - New values received dynamically, without application changes.
18419 ///
18420 /// Please consult the [Working with enums] section in the user guide for some
18421 /// guidelines.
18422 ///
18423 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18424 #[derive(Clone, Debug, PartialEq)]
18425 #[non_exhaustive]
18426 pub enum Scope {
18427 /// Scope is unspecified.
18428 Unspecified,
18429 /// Target resource is a subnet (Network Management API).
18430 Subnet,
18431 /// Target resource is a subnet, and the config originates from the Compute
18432 /// API.
18433 ComputeApiSubnet,
18434 /// Target resource is a network.
18435 Network,
18436 /// Target resource is a VPN tunnel.
18437 VpnTunnel,
18438 /// Target resource is an interconnect attachment.
18439 InterconnectAttachment,
18440 /// Configuration applies to an entire organization.
18441 Organization,
18442 /// If set, the enum was initialized with an unknown value.
18443 ///
18444 /// Applications can examine the value using [Scope::value] or
18445 /// [Scope::name].
18446 UnknownValue(scope::UnknownValue),
18447 }
18448
18449 #[doc(hidden)]
18450 pub mod scope {
18451 #[allow(unused_imports)]
18452 use super::*;
18453 #[derive(Clone, Debug, PartialEq)]
18454 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18455 }
18456
18457 impl Scope {
18458 /// Gets the enum value.
18459 ///
18460 /// Returns `None` if the enum contains an unknown value deserialized from
18461 /// the string representation of enums.
18462 pub fn value(&self) -> std::option::Option<i32> {
18463 match self {
18464 Self::Unspecified => std::option::Option::Some(0),
18465 Self::Subnet => std::option::Option::Some(1),
18466 Self::ComputeApiSubnet => std::option::Option::Some(2),
18467 Self::Network => std::option::Option::Some(3),
18468 Self::VpnTunnel => std::option::Option::Some(4),
18469 Self::InterconnectAttachment => std::option::Option::Some(5),
18470 Self::Organization => std::option::Option::Some(6),
18471 Self::UnknownValue(u) => u.0.value(),
18472 }
18473 }
18474
18475 /// Gets the enum value as a string.
18476 ///
18477 /// Returns `None` if the enum contains an unknown value deserialized from
18478 /// the integer representation of enums.
18479 pub fn name(&self) -> std::option::Option<&str> {
18480 match self {
18481 Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
18482 Self::Subnet => std::option::Option::Some("SUBNET"),
18483 Self::ComputeApiSubnet => std::option::Option::Some("COMPUTE_API_SUBNET"),
18484 Self::Network => std::option::Option::Some("NETWORK"),
18485 Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
18486 Self::InterconnectAttachment => {
18487 std::option::Option::Some("INTERCONNECT_ATTACHMENT")
18488 }
18489 Self::Organization => std::option::Option::Some("ORGANIZATION"),
18490 Self::UnknownValue(u) => u.0.name(),
18491 }
18492 }
18493 }
18494
18495 impl std::default::Default for Scope {
18496 fn default() -> Self {
18497 use std::convert::From;
18498 Self::from(0)
18499 }
18500 }
18501
18502 impl std::fmt::Display for Scope {
18503 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18504 wkt::internal::display_enum(f, self.name(), self.value())
18505 }
18506 }
18507
18508 impl std::convert::From<i32> for Scope {
18509 fn from(value: i32) -> Self {
18510 match value {
18511 0 => Self::Unspecified,
18512 1 => Self::Subnet,
18513 2 => Self::ComputeApiSubnet,
18514 3 => Self::Network,
18515 4 => Self::VpnTunnel,
18516 5 => Self::InterconnectAttachment,
18517 6 => Self::Organization,
18518 _ => Self::UnknownValue(scope::UnknownValue(
18519 wkt::internal::UnknownEnumValue::Integer(value),
18520 )),
18521 }
18522 }
18523 }
18524
18525 impl std::convert::From<&str> for Scope {
18526 fn from(value: &str) -> Self {
18527 use std::string::ToString;
18528 match value {
18529 "SCOPE_UNSPECIFIED" => Self::Unspecified,
18530 "SUBNET" => Self::Subnet,
18531 "COMPUTE_API_SUBNET" => Self::ComputeApiSubnet,
18532 "NETWORK" => Self::Network,
18533 "VPN_TUNNEL" => Self::VpnTunnel,
18534 "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
18535 "ORGANIZATION" => Self::Organization,
18536 _ => Self::UnknownValue(scope::UnknownValue(
18537 wkt::internal::UnknownEnumValue::String(value.to_string()),
18538 )),
18539 }
18540 }
18541 }
18542
18543 impl serde::ser::Serialize for Scope {
18544 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18545 where
18546 S: serde::Serializer,
18547 {
18548 match self {
18549 Self::Unspecified => serializer.serialize_i32(0),
18550 Self::Subnet => serializer.serialize_i32(1),
18551 Self::ComputeApiSubnet => serializer.serialize_i32(2),
18552 Self::Network => serializer.serialize_i32(3),
18553 Self::VpnTunnel => serializer.serialize_i32(4),
18554 Self::InterconnectAttachment => serializer.serialize_i32(5),
18555 Self::Organization => serializer.serialize_i32(6),
18556 Self::UnknownValue(u) => u.0.serialize(serializer),
18557 }
18558 }
18559 }
18560
18561 impl<'de> serde::de::Deserialize<'de> for Scope {
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::<Scope>::new(
18567 ".google.cloud.networkmanagement.v1.EffectiveVpcFlowLogsConfig.Scope",
18568 ))
18569 }
18570 }
18571
18572 /// Reference to the resource of the config scope. That is, the scope from
18573 /// which traffic is logged. The target resource must belong to the same
18574 /// project as the configuration.
18575 /// This field is not supported for organization level configurations.
18576 #[derive(Clone, Debug, PartialEq)]
18577 #[non_exhaustive]
18578 pub enum TargetResource {
18579 /// Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
18580 /// within the network.
18581 /// Format: projects/{project_id}/global/networks/{name}
18582 Network(std::string::String),
18583 /// Traffic will be logged from VMs within the subnetwork.
18584 /// Format: projects/{project_id}/regions/{region}/subnetworks/{name}
18585 Subnet(std::string::String),
18586 /// Traffic will be logged from the Interconnect Attachment.
18587 /// Format:
18588 /// projects/{project_id}/regions/{region}/interconnectAttachments/{name}
18589 InterconnectAttachment(std::string::String),
18590 /// Traffic will be logged from the VPN Tunnel.
18591 /// Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
18592 VpnTunnel(std::string::String),
18593 }
18594}
18595
18596/// Type of a load balancer. For more information, see [Summary of Google Cloud
18597/// load
18598/// balancers](https://cloud.google.com/load-balancing/docs/load-balancing-overview#summary-of-google-cloud-load-balancers).
18599///
18600/// # Working with unknown values
18601///
18602/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18603/// additional enum variants at any time. Adding new variants is not considered
18604/// a breaking change. Applications should write their code in anticipation of:
18605///
18606/// - New values appearing in future releases of the client library, **and**
18607/// - New values received dynamically, without application changes.
18608///
18609/// Please consult the [Working with enums] section in the user guide for some
18610/// guidelines.
18611///
18612/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18613#[derive(Clone, Debug, PartialEq)]
18614#[non_exhaustive]
18615pub enum LoadBalancerType {
18616 /// Forwarding rule points to a different target than a load balancer or a
18617 /// load balancer type is unknown.
18618 Unspecified,
18619 /// Global external HTTP(S) load balancer.
18620 HttpsAdvancedLoadBalancer,
18621 /// Global external HTTP(S) load balancer (classic)
18622 HttpsLoadBalancer,
18623 /// Regional external HTTP(S) load balancer.
18624 RegionalHttpsLoadBalancer,
18625 /// Internal HTTP(S) load balancer.
18626 InternalHttpsLoadBalancer,
18627 /// External SSL proxy load balancer.
18628 SslProxyLoadBalancer,
18629 /// External TCP proxy load balancer.
18630 TcpProxyLoadBalancer,
18631 /// Internal regional TCP proxy load balancer.
18632 InternalTcpProxyLoadBalancer,
18633 /// External TCP/UDP Network load balancer.
18634 NetworkLoadBalancer,
18635 /// Target-pool based external TCP/UDP Network load balancer.
18636 LegacyNetworkLoadBalancer,
18637 /// Internal TCP/UDP load balancer.
18638 TcpUdpInternalLoadBalancer,
18639 /// If set, the enum was initialized with an unknown value.
18640 ///
18641 /// Applications can examine the value using [LoadBalancerType::value] or
18642 /// [LoadBalancerType::name].
18643 UnknownValue(load_balancer_type::UnknownValue),
18644}
18645
18646#[doc(hidden)]
18647pub mod load_balancer_type {
18648 #[allow(unused_imports)]
18649 use super::*;
18650 #[derive(Clone, Debug, PartialEq)]
18651 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18652}
18653
18654impl LoadBalancerType {
18655 /// Gets the enum value.
18656 ///
18657 /// Returns `None` if the enum contains an unknown value deserialized from
18658 /// the string representation of enums.
18659 pub fn value(&self) -> std::option::Option<i32> {
18660 match self {
18661 Self::Unspecified => std::option::Option::Some(0),
18662 Self::HttpsAdvancedLoadBalancer => std::option::Option::Some(1),
18663 Self::HttpsLoadBalancer => std::option::Option::Some(2),
18664 Self::RegionalHttpsLoadBalancer => std::option::Option::Some(3),
18665 Self::InternalHttpsLoadBalancer => std::option::Option::Some(4),
18666 Self::SslProxyLoadBalancer => std::option::Option::Some(5),
18667 Self::TcpProxyLoadBalancer => std::option::Option::Some(6),
18668 Self::InternalTcpProxyLoadBalancer => std::option::Option::Some(7),
18669 Self::NetworkLoadBalancer => std::option::Option::Some(8),
18670 Self::LegacyNetworkLoadBalancer => std::option::Option::Some(9),
18671 Self::TcpUdpInternalLoadBalancer => std::option::Option::Some(10),
18672 Self::UnknownValue(u) => u.0.value(),
18673 }
18674 }
18675
18676 /// Gets the enum value as a string.
18677 ///
18678 /// Returns `None` if the enum contains an unknown value deserialized from
18679 /// the integer representation of enums.
18680 pub fn name(&self) -> std::option::Option<&str> {
18681 match self {
18682 Self::Unspecified => std::option::Option::Some("LOAD_BALANCER_TYPE_UNSPECIFIED"),
18683 Self::HttpsAdvancedLoadBalancer => {
18684 std::option::Option::Some("HTTPS_ADVANCED_LOAD_BALANCER")
18685 }
18686 Self::HttpsLoadBalancer => std::option::Option::Some("HTTPS_LOAD_BALANCER"),
18687 Self::RegionalHttpsLoadBalancer => {
18688 std::option::Option::Some("REGIONAL_HTTPS_LOAD_BALANCER")
18689 }
18690 Self::InternalHttpsLoadBalancer => {
18691 std::option::Option::Some("INTERNAL_HTTPS_LOAD_BALANCER")
18692 }
18693 Self::SslProxyLoadBalancer => std::option::Option::Some("SSL_PROXY_LOAD_BALANCER"),
18694 Self::TcpProxyLoadBalancer => std::option::Option::Some("TCP_PROXY_LOAD_BALANCER"),
18695 Self::InternalTcpProxyLoadBalancer => {
18696 std::option::Option::Some("INTERNAL_TCP_PROXY_LOAD_BALANCER")
18697 }
18698 Self::NetworkLoadBalancer => std::option::Option::Some("NETWORK_LOAD_BALANCER"),
18699 Self::LegacyNetworkLoadBalancer => {
18700 std::option::Option::Some("LEGACY_NETWORK_LOAD_BALANCER")
18701 }
18702 Self::TcpUdpInternalLoadBalancer => {
18703 std::option::Option::Some("TCP_UDP_INTERNAL_LOAD_BALANCER")
18704 }
18705 Self::UnknownValue(u) => u.0.name(),
18706 }
18707 }
18708}
18709
18710impl std::default::Default for LoadBalancerType {
18711 fn default() -> Self {
18712 use std::convert::From;
18713 Self::from(0)
18714 }
18715}
18716
18717impl std::fmt::Display for LoadBalancerType {
18718 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18719 wkt::internal::display_enum(f, self.name(), self.value())
18720 }
18721}
18722
18723impl std::convert::From<i32> for LoadBalancerType {
18724 fn from(value: i32) -> Self {
18725 match value {
18726 0 => Self::Unspecified,
18727 1 => Self::HttpsAdvancedLoadBalancer,
18728 2 => Self::HttpsLoadBalancer,
18729 3 => Self::RegionalHttpsLoadBalancer,
18730 4 => Self::InternalHttpsLoadBalancer,
18731 5 => Self::SslProxyLoadBalancer,
18732 6 => Self::TcpProxyLoadBalancer,
18733 7 => Self::InternalTcpProxyLoadBalancer,
18734 8 => Self::NetworkLoadBalancer,
18735 9 => Self::LegacyNetworkLoadBalancer,
18736 10 => Self::TcpUdpInternalLoadBalancer,
18737 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
18738 wkt::internal::UnknownEnumValue::Integer(value),
18739 )),
18740 }
18741 }
18742}
18743
18744impl std::convert::From<&str> for LoadBalancerType {
18745 fn from(value: &str) -> Self {
18746 use std::string::ToString;
18747 match value {
18748 "LOAD_BALANCER_TYPE_UNSPECIFIED" => Self::Unspecified,
18749 "HTTPS_ADVANCED_LOAD_BALANCER" => Self::HttpsAdvancedLoadBalancer,
18750 "HTTPS_LOAD_BALANCER" => Self::HttpsLoadBalancer,
18751 "REGIONAL_HTTPS_LOAD_BALANCER" => Self::RegionalHttpsLoadBalancer,
18752 "INTERNAL_HTTPS_LOAD_BALANCER" => Self::InternalHttpsLoadBalancer,
18753 "SSL_PROXY_LOAD_BALANCER" => Self::SslProxyLoadBalancer,
18754 "TCP_PROXY_LOAD_BALANCER" => Self::TcpProxyLoadBalancer,
18755 "INTERNAL_TCP_PROXY_LOAD_BALANCER" => Self::InternalTcpProxyLoadBalancer,
18756 "NETWORK_LOAD_BALANCER" => Self::NetworkLoadBalancer,
18757 "LEGACY_NETWORK_LOAD_BALANCER" => Self::LegacyNetworkLoadBalancer,
18758 "TCP_UDP_INTERNAL_LOAD_BALANCER" => Self::TcpUdpInternalLoadBalancer,
18759 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
18760 wkt::internal::UnknownEnumValue::String(value.to_string()),
18761 )),
18762 }
18763 }
18764}
18765
18766impl serde::ser::Serialize for LoadBalancerType {
18767 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18768 where
18769 S: serde::Serializer,
18770 {
18771 match self {
18772 Self::Unspecified => serializer.serialize_i32(0),
18773 Self::HttpsAdvancedLoadBalancer => serializer.serialize_i32(1),
18774 Self::HttpsLoadBalancer => serializer.serialize_i32(2),
18775 Self::RegionalHttpsLoadBalancer => serializer.serialize_i32(3),
18776 Self::InternalHttpsLoadBalancer => serializer.serialize_i32(4),
18777 Self::SslProxyLoadBalancer => serializer.serialize_i32(5),
18778 Self::TcpProxyLoadBalancer => serializer.serialize_i32(6),
18779 Self::InternalTcpProxyLoadBalancer => serializer.serialize_i32(7),
18780 Self::NetworkLoadBalancer => serializer.serialize_i32(8),
18781 Self::LegacyNetworkLoadBalancer => serializer.serialize_i32(9),
18782 Self::TcpUdpInternalLoadBalancer => serializer.serialize_i32(10),
18783 Self::UnknownValue(u) => u.0.serialize(serializer),
18784 }
18785 }
18786}
18787
18788impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
18789 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18790 where
18791 D: serde::Deserializer<'de>,
18792 {
18793 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
18794 ".google.cloud.networkmanagement.v1.LoadBalancerType",
18795 ))
18796 }
18797}