google_cloud_networkmanagement_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_rpc;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// A Connectivity Test for a network reachability analysis.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct ConnectivityTest {
44 /// Identifier. Unique name of the resource using the form:
45 /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
46 pub name: std::string::String,
47
48 /// The user-supplied description of the Connectivity Test.
49 /// Maximum of 512 characters.
50 pub description: std::string::String,
51
52 /// Required. Source specification of the Connectivity Test.
53 ///
54 /// You can use a combination of source IP address, URI of a supported
55 /// endpoint, project ID, or VPC network to identify the source location.
56 ///
57 /// Reachability analysis might proceed even if the source location is
58 /// ambiguous. However, the test result might include endpoints or use a source
59 /// that you don't intend to test.
60 pub source: std::option::Option<crate::model::Endpoint>,
61
62 /// Required. Destination specification of the Connectivity Test.
63 ///
64 /// You can use a combination of destination IP address, URI of a supported
65 /// endpoint, project ID, or VPC network to identify the destination location.
66 ///
67 /// Reachability analysis proceeds even if the destination location is
68 /// ambiguous. However, the test result might include endpoints or use a
69 /// destination that you don't intend to test.
70 pub destination: std::option::Option<crate::model::Endpoint>,
71
72 /// IP Protocol of the test. When not provided, "TCP" is assumed.
73 pub protocol: std::string::String,
74
75 /// Other projects that may be relevant for reachability analysis.
76 /// This is applicable to scenarios where a test can cross project boundaries.
77 pub related_projects: std::vec::Vec<std::string::String>,
78
79 /// Output only. The display name of a Connectivity Test.
80 pub display_name: std::string::String,
81
82 /// Resource labels to represent user-provided metadata.
83 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
84
85 /// Output only. The time the test was created.
86 pub create_time: std::option::Option<wkt::Timestamp>,
87
88 /// Output only. The time the test's configuration was updated.
89 pub update_time: std::option::Option<wkt::Timestamp>,
90
91 /// Output only. The reachability details of this test from the latest run.
92 /// The details are updated when creating a new test, updating an
93 /// existing test, or triggering a one-time rerun of an existing test.
94 pub reachability_details: std::option::Option<crate::model::ReachabilityDetails>,
95
96 /// Output only. The probing details of this test from the latest run, present
97 /// for applicable tests only. The details are updated when creating a new
98 /// test, updating an existing test, or triggering a one-time rerun of an
99 /// existing test.
100 pub probing_details: std::option::Option<crate::model::ProbingDetails>,
101
102 /// Whether run analysis for the return path from destination to source.
103 /// Default value is false.
104 pub round_trip: bool,
105
106 /// Output only. The reachability details of this test from the latest run for
107 /// the return path. The details are updated when creating a new test,
108 /// updating an existing test, or triggering a one-time rerun of an existing
109 /// test.
110 pub return_reachability_details: std::option::Option<crate::model::ReachabilityDetails>,
111
112 /// Whether the analysis should skip firewall checking. Default value is false.
113 pub bypass_firewall_checks: bool,
114
115 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
116}
117
118impl ConnectivityTest {
119 /// Creates a new default instance.
120 pub fn new() -> Self {
121 std::default::Default::default()
122 }
123
124 /// Sets the value of [name][crate::model::ConnectivityTest::name].
125 ///
126 /// # Example
127 /// ```ignore,no_run
128 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
129 /// let x = ConnectivityTest::new().set_name("example");
130 /// ```
131 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
132 self.name = v.into();
133 self
134 }
135
136 /// Sets the value of [description][crate::model::ConnectivityTest::description].
137 ///
138 /// # Example
139 /// ```ignore,no_run
140 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
141 /// let x = ConnectivityTest::new().set_description("example");
142 /// ```
143 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
144 self.description = v.into();
145 self
146 }
147
148 /// Sets the value of [source][crate::model::ConnectivityTest::source].
149 ///
150 /// # Example
151 /// ```ignore,no_run
152 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
153 /// use google_cloud_networkmanagement_v1::model::Endpoint;
154 /// let x = ConnectivityTest::new().set_source(Endpoint::default()/* use setters */);
155 /// ```
156 pub fn set_source<T>(mut self, v: T) -> Self
157 where
158 T: std::convert::Into<crate::model::Endpoint>,
159 {
160 self.source = std::option::Option::Some(v.into());
161 self
162 }
163
164 /// Sets or clears the value of [source][crate::model::ConnectivityTest::source].
165 ///
166 /// # Example
167 /// ```ignore,no_run
168 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
169 /// use google_cloud_networkmanagement_v1::model::Endpoint;
170 /// let x = ConnectivityTest::new().set_or_clear_source(Some(Endpoint::default()/* use setters */));
171 /// let x = ConnectivityTest::new().set_or_clear_source(None::<Endpoint>);
172 /// ```
173 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
174 where
175 T: std::convert::Into<crate::model::Endpoint>,
176 {
177 self.source = v.map(|x| x.into());
178 self
179 }
180
181 /// Sets the value of [destination][crate::model::ConnectivityTest::destination].
182 ///
183 /// # Example
184 /// ```ignore,no_run
185 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
186 /// use google_cloud_networkmanagement_v1::model::Endpoint;
187 /// let x = ConnectivityTest::new().set_destination(Endpoint::default()/* use setters */);
188 /// ```
189 pub fn set_destination<T>(mut self, v: T) -> Self
190 where
191 T: std::convert::Into<crate::model::Endpoint>,
192 {
193 self.destination = std::option::Option::Some(v.into());
194 self
195 }
196
197 /// Sets or clears the value of [destination][crate::model::ConnectivityTest::destination].
198 ///
199 /// # Example
200 /// ```ignore,no_run
201 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
202 /// use google_cloud_networkmanagement_v1::model::Endpoint;
203 /// let x = ConnectivityTest::new().set_or_clear_destination(Some(Endpoint::default()/* use setters */));
204 /// let x = ConnectivityTest::new().set_or_clear_destination(None::<Endpoint>);
205 /// ```
206 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
207 where
208 T: std::convert::Into<crate::model::Endpoint>,
209 {
210 self.destination = v.map(|x| x.into());
211 self
212 }
213
214 /// Sets the value of [protocol][crate::model::ConnectivityTest::protocol].
215 ///
216 /// # Example
217 /// ```ignore,no_run
218 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
219 /// let x = ConnectivityTest::new().set_protocol("example");
220 /// ```
221 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
222 self.protocol = v.into();
223 self
224 }
225
226 /// Sets the value of [related_projects][crate::model::ConnectivityTest::related_projects].
227 ///
228 /// # Example
229 /// ```ignore,no_run
230 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
231 /// let x = ConnectivityTest::new().set_related_projects(["a", "b", "c"]);
232 /// ```
233 pub fn set_related_projects<T, V>(mut self, v: T) -> Self
234 where
235 T: std::iter::IntoIterator<Item = V>,
236 V: std::convert::Into<std::string::String>,
237 {
238 use std::iter::Iterator;
239 self.related_projects = v.into_iter().map(|i| i.into()).collect();
240 self
241 }
242
243 /// Sets the value of [display_name][crate::model::ConnectivityTest::display_name].
244 ///
245 /// # Example
246 /// ```ignore,no_run
247 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
248 /// let x = ConnectivityTest::new().set_display_name("example");
249 /// ```
250 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
251 self.display_name = v.into();
252 self
253 }
254
255 /// Sets the value of [labels][crate::model::ConnectivityTest::labels].
256 ///
257 /// # Example
258 /// ```ignore,no_run
259 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
260 /// let x = ConnectivityTest::new().set_labels([
261 /// ("key0", "abc"),
262 /// ("key1", "xyz"),
263 /// ]);
264 /// ```
265 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
266 where
267 T: std::iter::IntoIterator<Item = (K, V)>,
268 K: std::convert::Into<std::string::String>,
269 V: std::convert::Into<std::string::String>,
270 {
271 use std::iter::Iterator;
272 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
273 self
274 }
275
276 /// Sets the value of [create_time][crate::model::ConnectivityTest::create_time].
277 ///
278 /// # Example
279 /// ```ignore,no_run
280 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
281 /// use wkt::Timestamp;
282 /// let x = ConnectivityTest::new().set_create_time(Timestamp::default()/* use setters */);
283 /// ```
284 pub fn set_create_time<T>(mut self, v: T) -> Self
285 where
286 T: std::convert::Into<wkt::Timestamp>,
287 {
288 self.create_time = std::option::Option::Some(v.into());
289 self
290 }
291
292 /// Sets or clears the value of [create_time][crate::model::ConnectivityTest::create_time].
293 ///
294 /// # Example
295 /// ```ignore,no_run
296 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
297 /// use wkt::Timestamp;
298 /// let x = ConnectivityTest::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
299 /// let x = ConnectivityTest::new().set_or_clear_create_time(None::<Timestamp>);
300 /// ```
301 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
302 where
303 T: std::convert::Into<wkt::Timestamp>,
304 {
305 self.create_time = v.map(|x| x.into());
306 self
307 }
308
309 /// Sets the value of [update_time][crate::model::ConnectivityTest::update_time].
310 ///
311 /// # Example
312 /// ```ignore,no_run
313 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
314 /// use wkt::Timestamp;
315 /// let x = ConnectivityTest::new().set_update_time(Timestamp::default()/* use setters */);
316 /// ```
317 pub fn set_update_time<T>(mut self, v: T) -> Self
318 where
319 T: std::convert::Into<wkt::Timestamp>,
320 {
321 self.update_time = std::option::Option::Some(v.into());
322 self
323 }
324
325 /// Sets or clears the value of [update_time][crate::model::ConnectivityTest::update_time].
326 ///
327 /// # Example
328 /// ```ignore,no_run
329 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
330 /// use wkt::Timestamp;
331 /// let x = ConnectivityTest::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
332 /// let x = ConnectivityTest::new().set_or_clear_update_time(None::<Timestamp>);
333 /// ```
334 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
335 where
336 T: std::convert::Into<wkt::Timestamp>,
337 {
338 self.update_time = v.map(|x| x.into());
339 self
340 }
341
342 /// Sets the value of [reachability_details][crate::model::ConnectivityTest::reachability_details].
343 ///
344 /// # Example
345 /// ```ignore,no_run
346 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
347 /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
348 /// let x = ConnectivityTest::new().set_reachability_details(ReachabilityDetails::default()/* use setters */);
349 /// ```
350 pub fn set_reachability_details<T>(mut self, v: T) -> Self
351 where
352 T: std::convert::Into<crate::model::ReachabilityDetails>,
353 {
354 self.reachability_details = std::option::Option::Some(v.into());
355 self
356 }
357
358 /// Sets or clears the value of [reachability_details][crate::model::ConnectivityTest::reachability_details].
359 ///
360 /// # Example
361 /// ```ignore,no_run
362 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
363 /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
364 /// let x = ConnectivityTest::new().set_or_clear_reachability_details(Some(ReachabilityDetails::default()/* use setters */));
365 /// let x = ConnectivityTest::new().set_or_clear_reachability_details(None::<ReachabilityDetails>);
366 /// ```
367 pub fn set_or_clear_reachability_details<T>(mut self, v: std::option::Option<T>) -> Self
368 where
369 T: std::convert::Into<crate::model::ReachabilityDetails>,
370 {
371 self.reachability_details = v.map(|x| x.into());
372 self
373 }
374
375 /// Sets the value of [probing_details][crate::model::ConnectivityTest::probing_details].
376 ///
377 /// # Example
378 /// ```ignore,no_run
379 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
380 /// use google_cloud_networkmanagement_v1::model::ProbingDetails;
381 /// let x = ConnectivityTest::new().set_probing_details(ProbingDetails::default()/* use setters */);
382 /// ```
383 pub fn set_probing_details<T>(mut self, v: T) -> Self
384 where
385 T: std::convert::Into<crate::model::ProbingDetails>,
386 {
387 self.probing_details = std::option::Option::Some(v.into());
388 self
389 }
390
391 /// Sets or clears the value of [probing_details][crate::model::ConnectivityTest::probing_details].
392 ///
393 /// # Example
394 /// ```ignore,no_run
395 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
396 /// use google_cloud_networkmanagement_v1::model::ProbingDetails;
397 /// let x = ConnectivityTest::new().set_or_clear_probing_details(Some(ProbingDetails::default()/* use setters */));
398 /// let x = ConnectivityTest::new().set_or_clear_probing_details(None::<ProbingDetails>);
399 /// ```
400 pub fn set_or_clear_probing_details<T>(mut self, v: std::option::Option<T>) -> Self
401 where
402 T: std::convert::Into<crate::model::ProbingDetails>,
403 {
404 self.probing_details = v.map(|x| x.into());
405 self
406 }
407
408 /// Sets the value of [round_trip][crate::model::ConnectivityTest::round_trip].
409 ///
410 /// # Example
411 /// ```ignore,no_run
412 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
413 /// let x = ConnectivityTest::new().set_round_trip(true);
414 /// ```
415 pub fn set_round_trip<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
416 self.round_trip = v.into();
417 self
418 }
419
420 /// Sets the value of [return_reachability_details][crate::model::ConnectivityTest::return_reachability_details].
421 ///
422 /// # Example
423 /// ```ignore,no_run
424 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
425 /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
426 /// let x = ConnectivityTest::new().set_return_reachability_details(ReachabilityDetails::default()/* use setters */);
427 /// ```
428 pub fn set_return_reachability_details<T>(mut self, v: T) -> Self
429 where
430 T: std::convert::Into<crate::model::ReachabilityDetails>,
431 {
432 self.return_reachability_details = std::option::Option::Some(v.into());
433 self
434 }
435
436 /// Sets or clears the value of [return_reachability_details][crate::model::ConnectivityTest::return_reachability_details].
437 ///
438 /// # Example
439 /// ```ignore,no_run
440 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
441 /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
442 /// let x = ConnectivityTest::new().set_or_clear_return_reachability_details(Some(ReachabilityDetails::default()/* use setters */));
443 /// let x = ConnectivityTest::new().set_or_clear_return_reachability_details(None::<ReachabilityDetails>);
444 /// ```
445 pub fn set_or_clear_return_reachability_details<T>(mut self, v: std::option::Option<T>) -> Self
446 where
447 T: std::convert::Into<crate::model::ReachabilityDetails>,
448 {
449 self.return_reachability_details = v.map(|x| x.into());
450 self
451 }
452
453 /// Sets the value of [bypass_firewall_checks][crate::model::ConnectivityTest::bypass_firewall_checks].
454 ///
455 /// # Example
456 /// ```ignore,no_run
457 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
458 /// let x = ConnectivityTest::new().set_bypass_firewall_checks(true);
459 /// ```
460 pub fn set_bypass_firewall_checks<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
461 self.bypass_firewall_checks = v.into();
462 self
463 }
464}
465
466impl wkt::message::Message for ConnectivityTest {
467 fn typename() -> &'static str {
468 "type.googleapis.com/google.cloud.networkmanagement.v1.ConnectivityTest"
469 }
470}
471
472/// Source or destination of the Connectivity Test.
473#[derive(Clone, Default, PartialEq)]
474#[non_exhaustive]
475pub struct Endpoint {
476 /// The IP address of the endpoint, which can be an external or internal IP.
477 pub ip_address: std::string::String,
478
479 /// The IP protocol port of the endpoint.
480 /// Only applicable when protocol is TCP or UDP.
481 pub port: i32,
482
483 /// A Compute Engine instance URI.
484 pub instance: std::string::String,
485
486 /// A forwarding rule and its corresponding IP address represent the frontend
487 /// configuration of a Google Cloud load balancer. Forwarding rules are also
488 /// used for protocol forwarding, Private Service Connect and other network
489 /// services to provide forwarding information in the control plane. Applicable
490 /// only to destination endpoint. Format:
491 /// `projects/{project}/global/forwardingRules/{id}` or
492 /// `projects/{project}/regions/{region}/forwardingRules/{id}`
493 pub forwarding_rule: std::string::String,
494
495 /// Output only. Specifies the type of the target of the forwarding rule.
496 pub forwarding_rule_target: std::option::Option<crate::model::endpoint::ForwardingRuleTarget>,
497
498 /// Output only. ID of the load balancer the forwarding rule points to. Empty
499 /// for forwarding rules not related to load balancers.
500 pub load_balancer_id: std::option::Option<std::string::String>,
501
502 /// Output only. Type of the load balancer the forwarding rule points to.
503 pub load_balancer_type: std::option::Option<crate::model::LoadBalancerType>,
504
505 /// A cluster URI for [Google Kubernetes Engine cluster control
506 /// plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
507 pub gke_master_cluster: std::string::String,
508
509 /// DNS endpoint of [Google Kubernetes Engine cluster control
510 /// plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
511 /// Requires gke_master_cluster to be set, can't be used simultaneoulsly with
512 /// ip_address or network. Applicable only to destination endpoint.
513 pub fqdn: std::string::String,
514
515 /// A [Cloud SQL](https://cloud.google.com/sql) instance URI.
516 pub cloud_sql_instance: std::string::String,
517
518 /// A [Redis Instance](https://cloud.google.com/memorystore/docs/redis) URI.
519 /// Applicable only to destination endpoint.
520 pub redis_instance: std::string::String,
521
522 /// A [Redis Cluster](https://cloud.google.com/memorystore/docs/cluster) URI.
523 /// Applicable only to destination endpoint.
524 pub redis_cluster: std::string::String,
525
526 /// A [GKE Pod](https://cloud.google.com/kubernetes-engine/docs/concepts/pod)
527 /// URI.
528 pub gke_pod: std::string::String,
529
530 /// A [Cloud Function](https://cloud.google.com/functions). Applicable only to
531 /// source endpoint.
532 pub cloud_function: std::option::Option<crate::model::endpoint::CloudFunctionEndpoint>,
533
534 /// An [App Engine](https://cloud.google.com/appengine) [service
535 /// version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions).
536 /// Applicable only to source endpoint.
537 pub app_engine_version: std::option::Option<crate::model::endpoint::AppEngineVersionEndpoint>,
538
539 /// A [Cloud Run](https://cloud.google.com/run)
540 /// [revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get)
541 /// Applicable only to source endpoint.
542 pub cloud_run_revision: std::option::Option<crate::model::endpoint::CloudRunRevisionEndpoint>,
543
544 /// A VPC network URI. For source endpoints, used according to the
545 /// `network_type`. For destination endpoints, used only when the source is an
546 /// external IP address endpoint, and the destination is an internal IP address
547 /// endpoint.
548 pub network: std::string::String,
549
550 /// For source endpoints, type of the network where the endpoint is located.
551 /// Not relevant for destination endpoints.
552 pub network_type: crate::model::endpoint::NetworkType,
553
554 /// For source endpoints, endpoint project ID. Used according to the
555 /// `network_type`. Not relevant for destination endpoints.
556 pub project_id: std::string::String,
557
558 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
559}
560
561impl Endpoint {
562 /// Creates a new default instance.
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 /// Creates a new default instance.
963 pub fn new() -> Self {
964 std::default::Default::default()
965 }
966
967 /// Sets the value of [uri][crate::model::endpoint::CloudFunctionEndpoint::uri].
968 ///
969 /// # Example
970 /// ```ignore,no_run
971 /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudFunctionEndpoint;
972 /// let x = CloudFunctionEndpoint::new().set_uri("example");
973 /// ```
974 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
975 self.uri = v.into();
976 self
977 }
978 }
979
980 impl wkt::message::Message for CloudFunctionEndpoint {
981 fn typename() -> &'static str {
982 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.CloudFunctionEndpoint"
983 }
984 }
985
986 /// Wrapper for the App Engine service version attributes.
987 #[derive(Clone, Default, PartialEq)]
988 #[non_exhaustive]
989 pub struct AppEngineVersionEndpoint {
990 /// An [App Engine](https://cloud.google.com/appengine) [service
991 /// version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions)
992 /// name.
993 pub uri: std::string::String,
994
995 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
996 }
997
998 impl AppEngineVersionEndpoint {
999 /// Creates a new default instance.
1000 pub fn new() -> Self {
1001 std::default::Default::default()
1002 }
1003
1004 /// Sets the value of [uri][crate::model::endpoint::AppEngineVersionEndpoint::uri].
1005 ///
1006 /// # Example
1007 /// ```ignore,no_run
1008 /// # use google_cloud_networkmanagement_v1::model::endpoint::AppEngineVersionEndpoint;
1009 /// let x = AppEngineVersionEndpoint::new().set_uri("example");
1010 /// ```
1011 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1012 self.uri = v.into();
1013 self
1014 }
1015 }
1016
1017 impl wkt::message::Message for AppEngineVersionEndpoint {
1018 fn typename() -> &'static str {
1019 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.AppEngineVersionEndpoint"
1020 }
1021 }
1022
1023 /// Wrapper for Cloud Run revision attributes.
1024 #[derive(Clone, Default, PartialEq)]
1025 #[non_exhaustive]
1026 pub struct CloudRunRevisionEndpoint {
1027 /// A [Cloud Run](https://cloud.google.com/run)
1028 /// [revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get)
1029 /// URI. The format is:
1030 /// projects/{project}/locations/{location}/revisions/{revision}
1031 pub uri: std::string::String,
1032
1033 /// Output only. The URI of the Cloud Run service that the revision belongs
1034 /// to. The format is:
1035 /// projects/{project}/locations/{location}/services/{service}
1036 pub service_uri: std::string::String,
1037
1038 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1039 }
1040
1041 impl CloudRunRevisionEndpoint {
1042 /// Creates a new default instance.
1043 pub fn new() -> Self {
1044 std::default::Default::default()
1045 }
1046
1047 /// Sets the value of [uri][crate::model::endpoint::CloudRunRevisionEndpoint::uri].
1048 ///
1049 /// # Example
1050 /// ```ignore,no_run
1051 /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
1052 /// let x = CloudRunRevisionEndpoint::new().set_uri("example");
1053 /// ```
1054 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1055 self.uri = v.into();
1056 self
1057 }
1058
1059 /// Sets the value of [service_uri][crate::model::endpoint::CloudRunRevisionEndpoint::service_uri].
1060 ///
1061 /// # Example
1062 /// ```ignore,no_run
1063 /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
1064 /// let x = CloudRunRevisionEndpoint::new().set_service_uri("example");
1065 /// ```
1066 pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1067 self.service_uri = v.into();
1068 self
1069 }
1070 }
1071
1072 impl wkt::message::Message for CloudRunRevisionEndpoint {
1073 fn typename() -> &'static str {
1074 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.CloudRunRevisionEndpoint"
1075 }
1076 }
1077
1078 /// The type of the network of the IP address endpoint. Relevant for the source
1079 /// IP address endpoints.
1080 ///
1081 /// # Working with unknown values
1082 ///
1083 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1084 /// additional enum variants at any time. Adding new variants is not considered
1085 /// a breaking change. Applications should write their code in anticipation of:
1086 ///
1087 /// - New values appearing in future releases of the client library, **and**
1088 /// - New values received dynamically, without application changes.
1089 ///
1090 /// Please consult the [Working with enums] section in the user guide for some
1091 /// guidelines.
1092 ///
1093 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1094 #[derive(Clone, Debug, PartialEq)]
1095 #[non_exhaustive]
1096 pub enum NetworkType {
1097 /// Unspecified. The test will analyze all possible IP address locations.
1098 /// This might take longer and produce inaccurate or ambiguous results, so
1099 /// prefer specifying an explicit network type.
1100 ///
1101 /// The `project_id` field should be set to the project where the GCP
1102 /// endpoint is located, or where the non-GCP endpoint should be reachable
1103 /// from (via routes to non-GCP networks). The project might also be inferred
1104 /// from the Connectivity Test project or other projects referenced in the
1105 /// request.
1106 Unspecified,
1107 /// A VPC network. Should be used for internal IP addresses in VPC networks.
1108 /// The `network` field should be set to the URI of this network. Only
1109 /// endpoints within this network will be considered.
1110 GcpNetwork,
1111 /// A non-GCP network (for example, an on-premises network or another cloud
1112 /// provider network). Should be used for internal IP addresses outside of
1113 /// Google Cloud. The `network` field should be set to the URI of the VPC
1114 /// network containing a corresponding Cloud VPN tunnel, Cloud Interconnect
1115 /// VLAN attachment, or a router appliance instance. Only endpoints reachable
1116 /// from the provided VPC network via the routes to non-GCP networks will be
1117 /// considered.
1118 NonGcpNetwork,
1119 /// Internet. Should be used for internet-routable external IP addresses or
1120 /// IP addresses for global Google APIs and services.
1121 Internet,
1122 /// If set, the enum was initialized with an unknown value.
1123 ///
1124 /// Applications can examine the value using [NetworkType::value] or
1125 /// [NetworkType::name].
1126 UnknownValue(network_type::UnknownValue),
1127 }
1128
1129 #[doc(hidden)]
1130 pub mod network_type {
1131 #[allow(unused_imports)]
1132 use super::*;
1133 #[derive(Clone, Debug, PartialEq)]
1134 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1135 }
1136
1137 impl NetworkType {
1138 /// Gets the enum value.
1139 ///
1140 /// Returns `None` if the enum contains an unknown value deserialized from
1141 /// the string representation of enums.
1142 pub fn value(&self) -> std::option::Option<i32> {
1143 match self {
1144 Self::Unspecified => std::option::Option::Some(0),
1145 Self::GcpNetwork => std::option::Option::Some(1),
1146 Self::NonGcpNetwork => std::option::Option::Some(2),
1147 Self::Internet => std::option::Option::Some(3),
1148 Self::UnknownValue(u) => u.0.value(),
1149 }
1150 }
1151
1152 /// Gets the enum value as a string.
1153 ///
1154 /// Returns `None` if the enum contains an unknown value deserialized from
1155 /// the integer representation of enums.
1156 pub fn name(&self) -> std::option::Option<&str> {
1157 match self {
1158 Self::Unspecified => std::option::Option::Some("NETWORK_TYPE_UNSPECIFIED"),
1159 Self::GcpNetwork => std::option::Option::Some("GCP_NETWORK"),
1160 Self::NonGcpNetwork => std::option::Option::Some("NON_GCP_NETWORK"),
1161 Self::Internet => std::option::Option::Some("INTERNET"),
1162 Self::UnknownValue(u) => u.0.name(),
1163 }
1164 }
1165 }
1166
1167 impl std::default::Default for NetworkType {
1168 fn default() -> Self {
1169 use std::convert::From;
1170 Self::from(0)
1171 }
1172 }
1173
1174 impl std::fmt::Display for NetworkType {
1175 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1176 wkt::internal::display_enum(f, self.name(), self.value())
1177 }
1178 }
1179
1180 impl std::convert::From<i32> for NetworkType {
1181 fn from(value: i32) -> Self {
1182 match value {
1183 0 => Self::Unspecified,
1184 1 => Self::GcpNetwork,
1185 2 => Self::NonGcpNetwork,
1186 3 => Self::Internet,
1187 _ => Self::UnknownValue(network_type::UnknownValue(
1188 wkt::internal::UnknownEnumValue::Integer(value),
1189 )),
1190 }
1191 }
1192 }
1193
1194 impl std::convert::From<&str> for NetworkType {
1195 fn from(value: &str) -> Self {
1196 use std::string::ToString;
1197 match value {
1198 "NETWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
1199 "GCP_NETWORK" => Self::GcpNetwork,
1200 "NON_GCP_NETWORK" => Self::NonGcpNetwork,
1201 "INTERNET" => Self::Internet,
1202 _ => Self::UnknownValue(network_type::UnknownValue(
1203 wkt::internal::UnknownEnumValue::String(value.to_string()),
1204 )),
1205 }
1206 }
1207 }
1208
1209 impl serde::ser::Serialize for NetworkType {
1210 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1211 where
1212 S: serde::Serializer,
1213 {
1214 match self {
1215 Self::Unspecified => serializer.serialize_i32(0),
1216 Self::GcpNetwork => serializer.serialize_i32(1),
1217 Self::NonGcpNetwork => serializer.serialize_i32(2),
1218 Self::Internet => serializer.serialize_i32(3),
1219 Self::UnknownValue(u) => u.0.serialize(serializer),
1220 }
1221 }
1222 }
1223
1224 impl<'de> serde::de::Deserialize<'de> for NetworkType {
1225 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1226 where
1227 D: serde::Deserializer<'de>,
1228 {
1229 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NetworkType>::new(
1230 ".google.cloud.networkmanagement.v1.Endpoint.NetworkType",
1231 ))
1232 }
1233 }
1234
1235 /// Type of the target of a forwarding rule.
1236 ///
1237 /// # Working with unknown values
1238 ///
1239 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1240 /// additional enum variants at any time. Adding new variants is not considered
1241 /// a breaking change. Applications should write their code in anticipation of:
1242 ///
1243 /// - New values appearing in future releases of the client library, **and**
1244 /// - New values received dynamically, without application changes.
1245 ///
1246 /// Please consult the [Working with enums] section in the user guide for some
1247 /// guidelines.
1248 ///
1249 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1250 #[derive(Clone, Debug, PartialEq)]
1251 #[non_exhaustive]
1252 pub enum ForwardingRuleTarget {
1253 /// Forwarding rule target is unknown.
1254 Unspecified,
1255 /// Compute Engine instance for protocol forwarding.
1256 Instance,
1257 /// Load Balancer. The specific type can be found from [load_balancer_type]
1258 /// [google.cloud.networkmanagement.v1.Endpoint.load_balancer_type].
1259 LoadBalancer,
1260 /// Classic Cloud VPN Gateway.
1261 VpnGateway,
1262 /// Forwarding Rule is a Private Service Connect endpoint.
1263 Psc,
1264 /// If set, the enum was initialized with an unknown value.
1265 ///
1266 /// Applications can examine the value using [ForwardingRuleTarget::value] or
1267 /// [ForwardingRuleTarget::name].
1268 UnknownValue(forwarding_rule_target::UnknownValue),
1269 }
1270
1271 #[doc(hidden)]
1272 pub mod forwarding_rule_target {
1273 #[allow(unused_imports)]
1274 use super::*;
1275 #[derive(Clone, Debug, PartialEq)]
1276 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1277 }
1278
1279 impl ForwardingRuleTarget {
1280 /// Gets the enum value.
1281 ///
1282 /// Returns `None` if the enum contains an unknown value deserialized from
1283 /// the string representation of enums.
1284 pub fn value(&self) -> std::option::Option<i32> {
1285 match self {
1286 Self::Unspecified => std::option::Option::Some(0),
1287 Self::Instance => std::option::Option::Some(1),
1288 Self::LoadBalancer => std::option::Option::Some(2),
1289 Self::VpnGateway => std::option::Option::Some(3),
1290 Self::Psc => std::option::Option::Some(4),
1291 Self::UnknownValue(u) => u.0.value(),
1292 }
1293 }
1294
1295 /// Gets the enum value as a string.
1296 ///
1297 /// Returns `None` if the enum contains an unknown value deserialized from
1298 /// the integer representation of enums.
1299 pub fn name(&self) -> std::option::Option<&str> {
1300 match self {
1301 Self::Unspecified => {
1302 std::option::Option::Some("FORWARDING_RULE_TARGET_UNSPECIFIED")
1303 }
1304 Self::Instance => std::option::Option::Some("INSTANCE"),
1305 Self::LoadBalancer => std::option::Option::Some("LOAD_BALANCER"),
1306 Self::VpnGateway => std::option::Option::Some("VPN_GATEWAY"),
1307 Self::Psc => std::option::Option::Some("PSC"),
1308 Self::UnknownValue(u) => u.0.name(),
1309 }
1310 }
1311 }
1312
1313 impl std::default::Default for ForwardingRuleTarget {
1314 fn default() -> Self {
1315 use std::convert::From;
1316 Self::from(0)
1317 }
1318 }
1319
1320 impl std::fmt::Display for ForwardingRuleTarget {
1321 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1322 wkt::internal::display_enum(f, self.name(), self.value())
1323 }
1324 }
1325
1326 impl std::convert::From<i32> for ForwardingRuleTarget {
1327 fn from(value: i32) -> Self {
1328 match value {
1329 0 => Self::Unspecified,
1330 1 => Self::Instance,
1331 2 => Self::LoadBalancer,
1332 3 => Self::VpnGateway,
1333 4 => Self::Psc,
1334 _ => Self::UnknownValue(forwarding_rule_target::UnknownValue(
1335 wkt::internal::UnknownEnumValue::Integer(value),
1336 )),
1337 }
1338 }
1339 }
1340
1341 impl std::convert::From<&str> for ForwardingRuleTarget {
1342 fn from(value: &str) -> Self {
1343 use std::string::ToString;
1344 match value {
1345 "FORWARDING_RULE_TARGET_UNSPECIFIED" => Self::Unspecified,
1346 "INSTANCE" => Self::Instance,
1347 "LOAD_BALANCER" => Self::LoadBalancer,
1348 "VPN_GATEWAY" => Self::VpnGateway,
1349 "PSC" => Self::Psc,
1350 _ => Self::UnknownValue(forwarding_rule_target::UnknownValue(
1351 wkt::internal::UnknownEnumValue::String(value.to_string()),
1352 )),
1353 }
1354 }
1355 }
1356
1357 impl serde::ser::Serialize for ForwardingRuleTarget {
1358 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1359 where
1360 S: serde::Serializer,
1361 {
1362 match self {
1363 Self::Unspecified => serializer.serialize_i32(0),
1364 Self::Instance => serializer.serialize_i32(1),
1365 Self::LoadBalancer => serializer.serialize_i32(2),
1366 Self::VpnGateway => serializer.serialize_i32(3),
1367 Self::Psc => serializer.serialize_i32(4),
1368 Self::UnknownValue(u) => u.0.serialize(serializer),
1369 }
1370 }
1371 }
1372
1373 impl<'de> serde::de::Deserialize<'de> for ForwardingRuleTarget {
1374 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1375 where
1376 D: serde::Deserializer<'de>,
1377 {
1378 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ForwardingRuleTarget>::new(
1379 ".google.cloud.networkmanagement.v1.Endpoint.ForwardingRuleTarget",
1380 ))
1381 }
1382 }
1383}
1384
1385/// Results of the configuration analysis from the last run of the test.
1386#[derive(Clone, Default, PartialEq)]
1387#[non_exhaustive]
1388pub struct ReachabilityDetails {
1389 /// The overall result of the test's configuration analysis.
1390 pub result: crate::model::reachability_details::Result,
1391
1392 /// The time of the configuration analysis.
1393 pub verify_time: std::option::Option<wkt::Timestamp>,
1394
1395 /// The details of a failure or a cancellation of reachability analysis.
1396 pub error: std::option::Option<google_cloud_rpc::model::Status>,
1397
1398 /// Result may contain a list of traces if a test has multiple possible
1399 /// paths in the network, such as when destination endpoint is a load balancer
1400 /// with multiple backends.
1401 pub traces: std::vec::Vec<crate::model::Trace>,
1402
1403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1404}
1405
1406impl ReachabilityDetails {
1407 /// Creates a new default instance.
1408 pub fn new() -> Self {
1409 std::default::Default::default()
1410 }
1411
1412 /// Sets the value of [result][crate::model::ReachabilityDetails::result].
1413 ///
1414 /// # Example
1415 /// ```ignore,no_run
1416 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1417 /// use google_cloud_networkmanagement_v1::model::reachability_details::Result;
1418 /// let x0 = ReachabilityDetails::new().set_result(Result::Reachable);
1419 /// let x1 = ReachabilityDetails::new().set_result(Result::Unreachable);
1420 /// let x2 = ReachabilityDetails::new().set_result(Result::Ambiguous);
1421 /// ```
1422 pub fn set_result<T: std::convert::Into<crate::model::reachability_details::Result>>(
1423 mut self,
1424 v: T,
1425 ) -> Self {
1426 self.result = v.into();
1427 self
1428 }
1429
1430 /// Sets the value of [verify_time][crate::model::ReachabilityDetails::verify_time].
1431 ///
1432 /// # Example
1433 /// ```ignore,no_run
1434 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1435 /// use wkt::Timestamp;
1436 /// let x = ReachabilityDetails::new().set_verify_time(Timestamp::default()/* use setters */);
1437 /// ```
1438 pub fn set_verify_time<T>(mut self, v: T) -> Self
1439 where
1440 T: std::convert::Into<wkt::Timestamp>,
1441 {
1442 self.verify_time = std::option::Option::Some(v.into());
1443 self
1444 }
1445
1446 /// Sets or clears the value of [verify_time][crate::model::ReachabilityDetails::verify_time].
1447 ///
1448 /// # Example
1449 /// ```ignore,no_run
1450 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1451 /// use wkt::Timestamp;
1452 /// let x = ReachabilityDetails::new().set_or_clear_verify_time(Some(Timestamp::default()/* use setters */));
1453 /// let x = ReachabilityDetails::new().set_or_clear_verify_time(None::<Timestamp>);
1454 /// ```
1455 pub fn set_or_clear_verify_time<T>(mut self, v: std::option::Option<T>) -> Self
1456 where
1457 T: std::convert::Into<wkt::Timestamp>,
1458 {
1459 self.verify_time = v.map(|x| x.into());
1460 self
1461 }
1462
1463 /// Sets the value of [error][crate::model::ReachabilityDetails::error].
1464 ///
1465 /// # Example
1466 /// ```ignore,no_run
1467 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1468 /// use google_cloud_rpc::model::Status;
1469 /// let x = ReachabilityDetails::new().set_error(Status::default()/* use setters */);
1470 /// ```
1471 pub fn set_error<T>(mut self, v: T) -> Self
1472 where
1473 T: std::convert::Into<google_cloud_rpc::model::Status>,
1474 {
1475 self.error = std::option::Option::Some(v.into());
1476 self
1477 }
1478
1479 /// Sets or clears the value of [error][crate::model::ReachabilityDetails::error].
1480 ///
1481 /// # Example
1482 /// ```ignore,no_run
1483 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1484 /// use google_cloud_rpc::model::Status;
1485 /// let x = ReachabilityDetails::new().set_or_clear_error(Some(Status::default()/* use setters */));
1486 /// let x = ReachabilityDetails::new().set_or_clear_error(None::<Status>);
1487 /// ```
1488 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1489 where
1490 T: std::convert::Into<google_cloud_rpc::model::Status>,
1491 {
1492 self.error = v.map(|x| x.into());
1493 self
1494 }
1495
1496 /// Sets the value of [traces][crate::model::ReachabilityDetails::traces].
1497 ///
1498 /// # Example
1499 /// ```ignore,no_run
1500 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1501 /// use google_cloud_networkmanagement_v1::model::Trace;
1502 /// let x = ReachabilityDetails::new()
1503 /// .set_traces([
1504 /// Trace::default()/* use setters */,
1505 /// Trace::default()/* use (different) setters */,
1506 /// ]);
1507 /// ```
1508 pub fn set_traces<T, V>(mut self, v: T) -> Self
1509 where
1510 T: std::iter::IntoIterator<Item = V>,
1511 V: std::convert::Into<crate::model::Trace>,
1512 {
1513 use std::iter::Iterator;
1514 self.traces = v.into_iter().map(|i| i.into()).collect();
1515 self
1516 }
1517}
1518
1519impl wkt::message::Message for ReachabilityDetails {
1520 fn typename() -> &'static str {
1521 "type.googleapis.com/google.cloud.networkmanagement.v1.ReachabilityDetails"
1522 }
1523}
1524
1525/// Defines additional types related to [ReachabilityDetails].
1526pub mod reachability_details {
1527 #[allow(unused_imports)]
1528 use super::*;
1529
1530 /// The overall result of the test's configuration analysis.
1531 ///
1532 /// # Working with unknown values
1533 ///
1534 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1535 /// additional enum variants at any time. Adding new variants is not considered
1536 /// a breaking change. Applications should write their code in anticipation of:
1537 ///
1538 /// - New values appearing in future releases of the client library, **and**
1539 /// - New values received dynamically, without application changes.
1540 ///
1541 /// Please consult the [Working with enums] section in the user guide for some
1542 /// guidelines.
1543 ///
1544 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1545 #[derive(Clone, Debug, PartialEq)]
1546 #[non_exhaustive]
1547 pub enum Result {
1548 /// No result was specified.
1549 Unspecified,
1550 /// Possible scenarios are:
1551 ///
1552 /// * The configuration analysis determined that a packet originating from
1553 /// the source is expected to reach the destination.
1554 /// * The analysis didn't complete because the user lacks permission for
1555 /// some of the resources in the trace. However, at the time the user's
1556 /// permission became insufficient, the trace had been successful so far.
1557 Reachable,
1558 /// A packet originating from the source is expected to be dropped before
1559 /// reaching the destination.
1560 Unreachable,
1561 /// The source and destination endpoints do not uniquely identify
1562 /// the test location in the network, and the reachability result contains
1563 /// multiple traces. For some traces, a packet could be delivered, and for
1564 /// others, it would not be. This result is also assigned to
1565 /// configuration analysis of return path if on its own it should be
1566 /// REACHABLE, but configuration analysis of forward path is AMBIGUOUS.
1567 Ambiguous,
1568 /// The configuration analysis did not complete. Possible reasons are:
1569 ///
1570 /// * A permissions error occurred--for example, the user might not have
1571 /// read permission for all of the resources named in the test.
1572 /// * An internal error occurred.
1573 /// * The analyzer received an invalid or unsupported argument or was unable
1574 /// to identify a known endpoint.
1575 Undetermined,
1576 /// If set, the enum was initialized with an unknown value.
1577 ///
1578 /// Applications can examine the value using [Result::value] or
1579 /// [Result::name].
1580 UnknownValue(result::UnknownValue),
1581 }
1582
1583 #[doc(hidden)]
1584 pub mod result {
1585 #[allow(unused_imports)]
1586 use super::*;
1587 #[derive(Clone, Debug, PartialEq)]
1588 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1589 }
1590
1591 impl Result {
1592 /// Gets the enum value.
1593 ///
1594 /// Returns `None` if the enum contains an unknown value deserialized from
1595 /// the string representation of enums.
1596 pub fn value(&self) -> std::option::Option<i32> {
1597 match self {
1598 Self::Unspecified => std::option::Option::Some(0),
1599 Self::Reachable => std::option::Option::Some(1),
1600 Self::Unreachable => std::option::Option::Some(2),
1601 Self::Ambiguous => std::option::Option::Some(4),
1602 Self::Undetermined => std::option::Option::Some(5),
1603 Self::UnknownValue(u) => u.0.value(),
1604 }
1605 }
1606
1607 /// Gets the enum value as a string.
1608 ///
1609 /// Returns `None` if the enum contains an unknown value deserialized from
1610 /// the integer representation of enums.
1611 pub fn name(&self) -> std::option::Option<&str> {
1612 match self {
1613 Self::Unspecified => std::option::Option::Some("RESULT_UNSPECIFIED"),
1614 Self::Reachable => std::option::Option::Some("REACHABLE"),
1615 Self::Unreachable => std::option::Option::Some("UNREACHABLE"),
1616 Self::Ambiguous => std::option::Option::Some("AMBIGUOUS"),
1617 Self::Undetermined => std::option::Option::Some("UNDETERMINED"),
1618 Self::UnknownValue(u) => u.0.name(),
1619 }
1620 }
1621 }
1622
1623 impl std::default::Default for Result {
1624 fn default() -> Self {
1625 use std::convert::From;
1626 Self::from(0)
1627 }
1628 }
1629
1630 impl std::fmt::Display for Result {
1631 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1632 wkt::internal::display_enum(f, self.name(), self.value())
1633 }
1634 }
1635
1636 impl std::convert::From<i32> for Result {
1637 fn from(value: i32) -> Self {
1638 match value {
1639 0 => Self::Unspecified,
1640 1 => Self::Reachable,
1641 2 => Self::Unreachable,
1642 4 => Self::Ambiguous,
1643 5 => Self::Undetermined,
1644 _ => Self::UnknownValue(result::UnknownValue(
1645 wkt::internal::UnknownEnumValue::Integer(value),
1646 )),
1647 }
1648 }
1649 }
1650
1651 impl std::convert::From<&str> for Result {
1652 fn from(value: &str) -> Self {
1653 use std::string::ToString;
1654 match value {
1655 "RESULT_UNSPECIFIED" => Self::Unspecified,
1656 "REACHABLE" => Self::Reachable,
1657 "UNREACHABLE" => Self::Unreachable,
1658 "AMBIGUOUS" => Self::Ambiguous,
1659 "UNDETERMINED" => Self::Undetermined,
1660 _ => Self::UnknownValue(result::UnknownValue(
1661 wkt::internal::UnknownEnumValue::String(value.to_string()),
1662 )),
1663 }
1664 }
1665 }
1666
1667 impl serde::ser::Serialize for Result {
1668 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1669 where
1670 S: serde::Serializer,
1671 {
1672 match self {
1673 Self::Unspecified => serializer.serialize_i32(0),
1674 Self::Reachable => serializer.serialize_i32(1),
1675 Self::Unreachable => serializer.serialize_i32(2),
1676 Self::Ambiguous => serializer.serialize_i32(4),
1677 Self::Undetermined => serializer.serialize_i32(5),
1678 Self::UnknownValue(u) => u.0.serialize(serializer),
1679 }
1680 }
1681 }
1682
1683 impl<'de> serde::de::Deserialize<'de> for Result {
1684 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1685 where
1686 D: serde::Deserializer<'de>,
1687 {
1688 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Result>::new(
1689 ".google.cloud.networkmanagement.v1.ReachabilityDetails.Result",
1690 ))
1691 }
1692 }
1693}
1694
1695/// Latency percentile rank and value.
1696#[derive(Clone, Default, PartialEq)]
1697#[non_exhaustive]
1698pub struct LatencyPercentile {
1699 /// Percentage of samples this data point applies to.
1700 pub percent: i32,
1701
1702 /// percent-th percentile of latency observed, in microseconds.
1703 /// Fraction of percent/100 of samples have latency lower or
1704 /// equal to the value of this field.
1705 pub latency_micros: i64,
1706
1707 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1708}
1709
1710impl LatencyPercentile {
1711 /// Creates a new default instance.
1712 pub fn new() -> Self {
1713 std::default::Default::default()
1714 }
1715
1716 /// Sets the value of [percent][crate::model::LatencyPercentile::percent].
1717 ///
1718 /// # Example
1719 /// ```ignore,no_run
1720 /// # use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1721 /// let x = LatencyPercentile::new().set_percent(42);
1722 /// ```
1723 pub fn set_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1724 self.percent = v.into();
1725 self
1726 }
1727
1728 /// Sets the value of [latency_micros][crate::model::LatencyPercentile::latency_micros].
1729 ///
1730 /// # Example
1731 /// ```ignore,no_run
1732 /// # use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1733 /// let x = LatencyPercentile::new().set_latency_micros(42);
1734 /// ```
1735 pub fn set_latency_micros<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1736 self.latency_micros = v.into();
1737 self
1738 }
1739}
1740
1741impl wkt::message::Message for LatencyPercentile {
1742 fn typename() -> &'static str {
1743 "type.googleapis.com/google.cloud.networkmanagement.v1.LatencyPercentile"
1744 }
1745}
1746
1747/// Describes measured latency distribution.
1748#[derive(Clone, Default, PartialEq)]
1749#[non_exhaustive]
1750pub struct LatencyDistribution {
1751 /// Representative latency percentiles.
1752 pub latency_percentiles: std::vec::Vec<crate::model::LatencyPercentile>,
1753
1754 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1755}
1756
1757impl LatencyDistribution {
1758 /// Creates a new default instance.
1759 pub fn new() -> Self {
1760 std::default::Default::default()
1761 }
1762
1763 /// Sets the value of [latency_percentiles][crate::model::LatencyDistribution::latency_percentiles].
1764 ///
1765 /// # Example
1766 /// ```ignore,no_run
1767 /// # use google_cloud_networkmanagement_v1::model::LatencyDistribution;
1768 /// use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1769 /// let x = LatencyDistribution::new()
1770 /// .set_latency_percentiles([
1771 /// LatencyPercentile::default()/* use setters */,
1772 /// LatencyPercentile::default()/* use (different) setters */,
1773 /// ]);
1774 /// ```
1775 pub fn set_latency_percentiles<T, V>(mut self, v: T) -> Self
1776 where
1777 T: std::iter::IntoIterator<Item = V>,
1778 V: std::convert::Into<crate::model::LatencyPercentile>,
1779 {
1780 use std::iter::Iterator;
1781 self.latency_percentiles = v.into_iter().map(|i| i.into()).collect();
1782 self
1783 }
1784}
1785
1786impl wkt::message::Message for LatencyDistribution {
1787 fn typename() -> &'static str {
1788 "type.googleapis.com/google.cloud.networkmanagement.v1.LatencyDistribution"
1789 }
1790}
1791
1792/// Results of active probing from the last run of the test.
1793#[derive(Clone, Default, PartialEq)]
1794#[non_exhaustive]
1795pub struct ProbingDetails {
1796 /// The overall result of active probing.
1797 pub result: crate::model::probing_details::ProbingResult,
1798
1799 /// The time that reachability was assessed through active probing.
1800 pub verify_time: std::option::Option<wkt::Timestamp>,
1801
1802 /// Details about an internal failure or the cancellation of active probing.
1803 pub error: std::option::Option<google_cloud_rpc::model::Status>,
1804
1805 /// The reason probing was aborted.
1806 pub abort_cause: crate::model::probing_details::ProbingAbortCause,
1807
1808 /// Number of probes sent.
1809 pub sent_probe_count: i32,
1810
1811 /// Number of probes that reached the destination.
1812 pub successful_probe_count: i32,
1813
1814 /// The source and destination endpoints derived from the test input and used
1815 /// for active probing.
1816 pub endpoint_info: std::option::Option<crate::model::EndpointInfo>,
1817
1818 /// Latency as measured by active probing in one direction:
1819 /// from the source to the destination endpoint.
1820 pub probing_latency: std::option::Option<crate::model::LatencyDistribution>,
1821
1822 /// The EdgeLocation from which a packet, destined to the internet, will egress
1823 /// the Google network.
1824 /// This will only be populated for a connectivity test which has an internet
1825 /// destination address.
1826 /// The absence of this field *must not* be used as an indication that the
1827 /// destination is part of the Google network.
1828 pub destination_egress_location:
1829 std::option::Option<crate::model::probing_details::EdgeLocation>,
1830
1831 /// Probing results for all edge devices.
1832 pub edge_responses: std::vec::Vec<crate::model::probing_details::SingleEdgeResponse>,
1833
1834 /// Whether all relevant edge devices were probed.
1835 pub probed_all_devices: bool,
1836
1837 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1838}
1839
1840impl ProbingDetails {
1841 /// Creates a new default instance.
1842 pub fn new() -> Self {
1843 std::default::Default::default()
1844 }
1845
1846 /// Sets the value of [result][crate::model::ProbingDetails::result].
1847 ///
1848 /// # Example
1849 /// ```ignore,no_run
1850 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1851 /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingResult;
1852 /// let x0 = ProbingDetails::new().set_result(ProbingResult::Reachable);
1853 /// let x1 = ProbingDetails::new().set_result(ProbingResult::Unreachable);
1854 /// let x2 = ProbingDetails::new().set_result(ProbingResult::ReachabilityInconsistent);
1855 /// ```
1856 pub fn set_result<T: std::convert::Into<crate::model::probing_details::ProbingResult>>(
1857 mut self,
1858 v: T,
1859 ) -> Self {
1860 self.result = v.into();
1861 self
1862 }
1863
1864 /// Sets the value of [verify_time][crate::model::ProbingDetails::verify_time].
1865 ///
1866 /// # Example
1867 /// ```ignore,no_run
1868 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1869 /// use wkt::Timestamp;
1870 /// let x = ProbingDetails::new().set_verify_time(Timestamp::default()/* use setters */);
1871 /// ```
1872 pub fn set_verify_time<T>(mut self, v: T) -> Self
1873 where
1874 T: std::convert::Into<wkt::Timestamp>,
1875 {
1876 self.verify_time = std::option::Option::Some(v.into());
1877 self
1878 }
1879
1880 /// Sets or clears the value of [verify_time][crate::model::ProbingDetails::verify_time].
1881 ///
1882 /// # Example
1883 /// ```ignore,no_run
1884 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1885 /// use wkt::Timestamp;
1886 /// let x = ProbingDetails::new().set_or_clear_verify_time(Some(Timestamp::default()/* use setters */));
1887 /// let x = ProbingDetails::new().set_or_clear_verify_time(None::<Timestamp>);
1888 /// ```
1889 pub fn set_or_clear_verify_time<T>(mut self, v: std::option::Option<T>) -> Self
1890 where
1891 T: std::convert::Into<wkt::Timestamp>,
1892 {
1893 self.verify_time = v.map(|x| x.into());
1894 self
1895 }
1896
1897 /// Sets the value of [error][crate::model::ProbingDetails::error].
1898 ///
1899 /// # Example
1900 /// ```ignore,no_run
1901 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1902 /// use google_cloud_rpc::model::Status;
1903 /// let x = ProbingDetails::new().set_error(Status::default()/* use setters */);
1904 /// ```
1905 pub fn set_error<T>(mut self, v: T) -> Self
1906 where
1907 T: std::convert::Into<google_cloud_rpc::model::Status>,
1908 {
1909 self.error = std::option::Option::Some(v.into());
1910 self
1911 }
1912
1913 /// Sets or clears the value of [error][crate::model::ProbingDetails::error].
1914 ///
1915 /// # Example
1916 /// ```ignore,no_run
1917 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1918 /// use google_cloud_rpc::model::Status;
1919 /// let x = ProbingDetails::new().set_or_clear_error(Some(Status::default()/* use setters */));
1920 /// let x = ProbingDetails::new().set_or_clear_error(None::<Status>);
1921 /// ```
1922 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1923 where
1924 T: std::convert::Into<google_cloud_rpc::model::Status>,
1925 {
1926 self.error = v.map(|x| x.into());
1927 self
1928 }
1929
1930 /// Sets the value of [abort_cause][crate::model::ProbingDetails::abort_cause].
1931 ///
1932 /// # Example
1933 /// ```ignore,no_run
1934 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1935 /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingAbortCause;
1936 /// let x0 = ProbingDetails::new().set_abort_cause(ProbingAbortCause::PermissionDenied);
1937 /// let x1 = ProbingDetails::new().set_abort_cause(ProbingAbortCause::NoSourceLocation);
1938 /// ```
1939 pub fn set_abort_cause<
1940 T: std::convert::Into<crate::model::probing_details::ProbingAbortCause>,
1941 >(
1942 mut self,
1943 v: T,
1944 ) -> Self {
1945 self.abort_cause = v.into();
1946 self
1947 }
1948
1949 /// Sets the value of [sent_probe_count][crate::model::ProbingDetails::sent_probe_count].
1950 ///
1951 /// # Example
1952 /// ```ignore,no_run
1953 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1954 /// let x = ProbingDetails::new().set_sent_probe_count(42);
1955 /// ```
1956 pub fn set_sent_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1957 self.sent_probe_count = v.into();
1958 self
1959 }
1960
1961 /// Sets the value of [successful_probe_count][crate::model::ProbingDetails::successful_probe_count].
1962 ///
1963 /// # Example
1964 /// ```ignore,no_run
1965 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1966 /// let x = ProbingDetails::new().set_successful_probe_count(42);
1967 /// ```
1968 pub fn set_successful_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1969 self.successful_probe_count = v.into();
1970 self
1971 }
1972
1973 /// Sets the value of [endpoint_info][crate::model::ProbingDetails::endpoint_info].
1974 ///
1975 /// # Example
1976 /// ```ignore,no_run
1977 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1978 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
1979 /// let x = ProbingDetails::new().set_endpoint_info(EndpointInfo::default()/* use setters */);
1980 /// ```
1981 pub fn set_endpoint_info<T>(mut self, v: T) -> Self
1982 where
1983 T: std::convert::Into<crate::model::EndpointInfo>,
1984 {
1985 self.endpoint_info = std::option::Option::Some(v.into());
1986 self
1987 }
1988
1989 /// Sets or clears the value of [endpoint_info][crate::model::ProbingDetails::endpoint_info].
1990 ///
1991 /// # Example
1992 /// ```ignore,no_run
1993 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1994 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
1995 /// let x = ProbingDetails::new().set_or_clear_endpoint_info(Some(EndpointInfo::default()/* use setters */));
1996 /// let x = ProbingDetails::new().set_or_clear_endpoint_info(None::<EndpointInfo>);
1997 /// ```
1998 pub fn set_or_clear_endpoint_info<T>(mut self, v: std::option::Option<T>) -> Self
1999 where
2000 T: std::convert::Into<crate::model::EndpointInfo>,
2001 {
2002 self.endpoint_info = v.map(|x| x.into());
2003 self
2004 }
2005
2006 /// Sets the value of [probing_latency][crate::model::ProbingDetails::probing_latency].
2007 ///
2008 /// # Example
2009 /// ```ignore,no_run
2010 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2011 /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2012 /// let x = ProbingDetails::new().set_probing_latency(LatencyDistribution::default()/* use setters */);
2013 /// ```
2014 pub fn set_probing_latency<T>(mut self, v: T) -> Self
2015 where
2016 T: std::convert::Into<crate::model::LatencyDistribution>,
2017 {
2018 self.probing_latency = std::option::Option::Some(v.into());
2019 self
2020 }
2021
2022 /// Sets or clears the value of [probing_latency][crate::model::ProbingDetails::probing_latency].
2023 ///
2024 /// # Example
2025 /// ```ignore,no_run
2026 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2027 /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2028 /// let x = ProbingDetails::new().set_or_clear_probing_latency(Some(LatencyDistribution::default()/* use setters */));
2029 /// let x = ProbingDetails::new().set_or_clear_probing_latency(None::<LatencyDistribution>);
2030 /// ```
2031 pub fn set_or_clear_probing_latency<T>(mut self, v: std::option::Option<T>) -> Self
2032 where
2033 T: std::convert::Into<crate::model::LatencyDistribution>,
2034 {
2035 self.probing_latency = v.map(|x| x.into());
2036 self
2037 }
2038
2039 /// Sets the value of [destination_egress_location][crate::model::ProbingDetails::destination_egress_location].
2040 ///
2041 /// # Example
2042 /// ```ignore,no_run
2043 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2044 /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2045 /// let x = ProbingDetails::new().set_destination_egress_location(EdgeLocation::default()/* use setters */);
2046 /// ```
2047 pub fn set_destination_egress_location<T>(mut self, v: T) -> Self
2048 where
2049 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2050 {
2051 self.destination_egress_location = std::option::Option::Some(v.into());
2052 self
2053 }
2054
2055 /// Sets or clears the value of [destination_egress_location][crate::model::ProbingDetails::destination_egress_location].
2056 ///
2057 /// # Example
2058 /// ```ignore,no_run
2059 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2060 /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2061 /// let x = ProbingDetails::new().set_or_clear_destination_egress_location(Some(EdgeLocation::default()/* use setters */));
2062 /// let x = ProbingDetails::new().set_or_clear_destination_egress_location(None::<EdgeLocation>);
2063 /// ```
2064 pub fn set_or_clear_destination_egress_location<T>(mut self, v: std::option::Option<T>) -> Self
2065 where
2066 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2067 {
2068 self.destination_egress_location = v.map(|x| x.into());
2069 self
2070 }
2071
2072 /// Sets the value of [edge_responses][crate::model::ProbingDetails::edge_responses].
2073 ///
2074 /// # Example
2075 /// ```ignore,no_run
2076 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2077 /// use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2078 /// let x = ProbingDetails::new()
2079 /// .set_edge_responses([
2080 /// SingleEdgeResponse::default()/* use setters */,
2081 /// SingleEdgeResponse::default()/* use (different) setters */,
2082 /// ]);
2083 /// ```
2084 pub fn set_edge_responses<T, V>(mut self, v: T) -> Self
2085 where
2086 T: std::iter::IntoIterator<Item = V>,
2087 V: std::convert::Into<crate::model::probing_details::SingleEdgeResponse>,
2088 {
2089 use std::iter::Iterator;
2090 self.edge_responses = v.into_iter().map(|i| i.into()).collect();
2091 self
2092 }
2093
2094 /// Sets the value of [probed_all_devices][crate::model::ProbingDetails::probed_all_devices].
2095 ///
2096 /// # Example
2097 /// ```ignore,no_run
2098 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2099 /// let x = ProbingDetails::new().set_probed_all_devices(true);
2100 /// ```
2101 pub fn set_probed_all_devices<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2102 self.probed_all_devices = v.into();
2103 self
2104 }
2105}
2106
2107impl wkt::message::Message for ProbingDetails {
2108 fn typename() -> &'static str {
2109 "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails"
2110 }
2111}
2112
2113/// Defines additional types related to [ProbingDetails].
2114pub mod probing_details {
2115 #[allow(unused_imports)]
2116 use super::*;
2117
2118 /// Representation of a network edge location as per
2119 /// <https://cloud.google.com/vpc/docs/edge-locations>.
2120 #[derive(Clone, Default, PartialEq)]
2121 #[non_exhaustive]
2122 pub struct EdgeLocation {
2123 /// Name of the metropolitan area.
2124 pub metropolitan_area: std::string::String,
2125
2126 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2127 }
2128
2129 impl EdgeLocation {
2130 /// Creates a new default instance.
2131 pub fn new() -> Self {
2132 std::default::Default::default()
2133 }
2134
2135 /// Sets the value of [metropolitan_area][crate::model::probing_details::EdgeLocation::metropolitan_area].
2136 ///
2137 /// # Example
2138 /// ```ignore,no_run
2139 /// # use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2140 /// let x = EdgeLocation::new().set_metropolitan_area("example");
2141 /// ```
2142 pub fn set_metropolitan_area<T: std::convert::Into<std::string::String>>(
2143 mut self,
2144 v: T,
2145 ) -> Self {
2146 self.metropolitan_area = v.into();
2147 self
2148 }
2149 }
2150
2151 impl wkt::message::Message for EdgeLocation {
2152 fn typename() -> &'static str {
2153 "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails.EdgeLocation"
2154 }
2155 }
2156
2157 /// Probing results for a single edge device.
2158 #[derive(Clone, Default, PartialEq)]
2159 #[non_exhaustive]
2160 pub struct SingleEdgeResponse {
2161 /// The overall result of active probing for this egress device.
2162 pub result: crate::model::probing_details::ProbingResult,
2163
2164 /// Number of probes sent.
2165 pub sent_probe_count: i32,
2166
2167 /// Number of probes that reached the destination.
2168 pub successful_probe_count: i32,
2169
2170 /// Latency as measured by active probing in one direction: from the source
2171 /// to the destination endpoint.
2172 pub probing_latency: std::option::Option<crate::model::LatencyDistribution>,
2173
2174 /// The EdgeLocation from which a packet, destined to the internet, will
2175 /// egress the Google network.
2176 /// This will only be populated for a connectivity test which has an internet
2177 /// destination address.
2178 /// The absence of this field *must not* be used as an indication that the
2179 /// destination is part of the Google network.
2180 pub destination_egress_location:
2181 std::option::Option<crate::model::probing_details::EdgeLocation>,
2182
2183 /// Router name in the format '{router}.{metroshard}'. For example:
2184 /// pf01.aaa01, pr02.aaa01.
2185 pub destination_router: std::string::String,
2186
2187 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2188 }
2189
2190 impl SingleEdgeResponse {
2191 /// Creates a new default instance.
2192 pub fn new() -> Self {
2193 std::default::Default::default()
2194 }
2195
2196 /// Sets the value of [result][crate::model::probing_details::SingleEdgeResponse::result].
2197 ///
2198 /// # Example
2199 /// ```ignore,no_run
2200 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2201 /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingResult;
2202 /// let x0 = SingleEdgeResponse::new().set_result(ProbingResult::Reachable);
2203 /// let x1 = SingleEdgeResponse::new().set_result(ProbingResult::Unreachable);
2204 /// let x2 = SingleEdgeResponse::new().set_result(ProbingResult::ReachabilityInconsistent);
2205 /// ```
2206 pub fn set_result<T: std::convert::Into<crate::model::probing_details::ProbingResult>>(
2207 mut self,
2208 v: T,
2209 ) -> Self {
2210 self.result = v.into();
2211 self
2212 }
2213
2214 /// Sets the value of [sent_probe_count][crate::model::probing_details::SingleEdgeResponse::sent_probe_count].
2215 ///
2216 /// # Example
2217 /// ```ignore,no_run
2218 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2219 /// let x = SingleEdgeResponse::new().set_sent_probe_count(42);
2220 /// ```
2221 pub fn set_sent_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2222 self.sent_probe_count = v.into();
2223 self
2224 }
2225
2226 /// Sets the value of [successful_probe_count][crate::model::probing_details::SingleEdgeResponse::successful_probe_count].
2227 ///
2228 /// # Example
2229 /// ```ignore,no_run
2230 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2231 /// let x = SingleEdgeResponse::new().set_successful_probe_count(42);
2232 /// ```
2233 pub fn set_successful_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2234 self.successful_probe_count = v.into();
2235 self
2236 }
2237
2238 /// Sets the value of [probing_latency][crate::model::probing_details::SingleEdgeResponse::probing_latency].
2239 ///
2240 /// # Example
2241 /// ```ignore,no_run
2242 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2243 /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2244 /// let x = SingleEdgeResponse::new().set_probing_latency(LatencyDistribution::default()/* use setters */);
2245 /// ```
2246 pub fn set_probing_latency<T>(mut self, v: T) -> Self
2247 where
2248 T: std::convert::Into<crate::model::LatencyDistribution>,
2249 {
2250 self.probing_latency = std::option::Option::Some(v.into());
2251 self
2252 }
2253
2254 /// Sets or clears the value of [probing_latency][crate::model::probing_details::SingleEdgeResponse::probing_latency].
2255 ///
2256 /// # Example
2257 /// ```ignore,no_run
2258 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2259 /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2260 /// let x = SingleEdgeResponse::new().set_or_clear_probing_latency(Some(LatencyDistribution::default()/* use setters */));
2261 /// let x = SingleEdgeResponse::new().set_or_clear_probing_latency(None::<LatencyDistribution>);
2262 /// ```
2263 pub fn set_or_clear_probing_latency<T>(mut self, v: std::option::Option<T>) -> Self
2264 where
2265 T: std::convert::Into<crate::model::LatencyDistribution>,
2266 {
2267 self.probing_latency = v.map(|x| x.into());
2268 self
2269 }
2270
2271 /// Sets the value of [destination_egress_location][crate::model::probing_details::SingleEdgeResponse::destination_egress_location].
2272 ///
2273 /// # Example
2274 /// ```ignore,no_run
2275 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2276 /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2277 /// let x = SingleEdgeResponse::new().set_destination_egress_location(EdgeLocation::default()/* use setters */);
2278 /// ```
2279 pub fn set_destination_egress_location<T>(mut self, v: T) -> Self
2280 where
2281 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2282 {
2283 self.destination_egress_location = std::option::Option::Some(v.into());
2284 self
2285 }
2286
2287 /// Sets or clears the value of [destination_egress_location][crate::model::probing_details::SingleEdgeResponse::destination_egress_location].
2288 ///
2289 /// # Example
2290 /// ```ignore,no_run
2291 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2292 /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2293 /// let x = SingleEdgeResponse::new().set_or_clear_destination_egress_location(Some(EdgeLocation::default()/* use setters */));
2294 /// let x = SingleEdgeResponse::new().set_or_clear_destination_egress_location(None::<EdgeLocation>);
2295 /// ```
2296 pub fn set_or_clear_destination_egress_location<T>(
2297 mut self,
2298 v: std::option::Option<T>,
2299 ) -> Self
2300 where
2301 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2302 {
2303 self.destination_egress_location = v.map(|x| x.into());
2304 self
2305 }
2306
2307 /// Sets the value of [destination_router][crate::model::probing_details::SingleEdgeResponse::destination_router].
2308 ///
2309 /// # Example
2310 /// ```ignore,no_run
2311 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2312 /// let x = SingleEdgeResponse::new().set_destination_router("example");
2313 /// ```
2314 pub fn set_destination_router<T: std::convert::Into<std::string::String>>(
2315 mut self,
2316 v: T,
2317 ) -> Self {
2318 self.destination_router = v.into();
2319 self
2320 }
2321 }
2322
2323 impl wkt::message::Message for SingleEdgeResponse {
2324 fn typename() -> &'static str {
2325 "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails.SingleEdgeResponse"
2326 }
2327 }
2328
2329 /// Overall probing result of the test.
2330 ///
2331 /// # Working with unknown values
2332 ///
2333 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2334 /// additional enum variants at any time. Adding new variants is not considered
2335 /// a breaking change. Applications should write their code in anticipation of:
2336 ///
2337 /// - New values appearing in future releases of the client library, **and**
2338 /// - New values received dynamically, without application changes.
2339 ///
2340 /// Please consult the [Working with enums] section in the user guide for some
2341 /// guidelines.
2342 ///
2343 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2344 #[derive(Clone, Debug, PartialEq)]
2345 #[non_exhaustive]
2346 pub enum ProbingResult {
2347 /// No result was specified.
2348 Unspecified,
2349 /// At least 95% of packets reached the destination.
2350 Reachable,
2351 /// No packets reached the destination.
2352 Unreachable,
2353 /// Less than 95% of packets reached the destination.
2354 ReachabilityInconsistent,
2355 /// Reachability could not be determined. Possible reasons are:
2356 ///
2357 /// * The user lacks permission to access some of the network resources
2358 /// required to run the test.
2359 /// * No valid source endpoint could be derived from the request.
2360 /// * An internal error occurred.
2361 Undetermined,
2362 /// If set, the enum was initialized with an unknown value.
2363 ///
2364 /// Applications can examine the value using [ProbingResult::value] or
2365 /// [ProbingResult::name].
2366 UnknownValue(probing_result::UnknownValue),
2367 }
2368
2369 #[doc(hidden)]
2370 pub mod probing_result {
2371 #[allow(unused_imports)]
2372 use super::*;
2373 #[derive(Clone, Debug, PartialEq)]
2374 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2375 }
2376
2377 impl ProbingResult {
2378 /// Gets the enum value.
2379 ///
2380 /// Returns `None` if the enum contains an unknown value deserialized from
2381 /// the string representation of enums.
2382 pub fn value(&self) -> std::option::Option<i32> {
2383 match self {
2384 Self::Unspecified => std::option::Option::Some(0),
2385 Self::Reachable => std::option::Option::Some(1),
2386 Self::Unreachable => std::option::Option::Some(2),
2387 Self::ReachabilityInconsistent => std::option::Option::Some(3),
2388 Self::Undetermined => std::option::Option::Some(4),
2389 Self::UnknownValue(u) => u.0.value(),
2390 }
2391 }
2392
2393 /// Gets the enum value as a string.
2394 ///
2395 /// Returns `None` if the enum contains an unknown value deserialized from
2396 /// the integer representation of enums.
2397 pub fn name(&self) -> std::option::Option<&str> {
2398 match self {
2399 Self::Unspecified => std::option::Option::Some("PROBING_RESULT_UNSPECIFIED"),
2400 Self::Reachable => std::option::Option::Some("REACHABLE"),
2401 Self::Unreachable => std::option::Option::Some("UNREACHABLE"),
2402 Self::ReachabilityInconsistent => {
2403 std::option::Option::Some("REACHABILITY_INCONSISTENT")
2404 }
2405 Self::Undetermined => std::option::Option::Some("UNDETERMINED"),
2406 Self::UnknownValue(u) => u.0.name(),
2407 }
2408 }
2409 }
2410
2411 impl std::default::Default for ProbingResult {
2412 fn default() -> Self {
2413 use std::convert::From;
2414 Self::from(0)
2415 }
2416 }
2417
2418 impl std::fmt::Display for ProbingResult {
2419 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2420 wkt::internal::display_enum(f, self.name(), self.value())
2421 }
2422 }
2423
2424 impl std::convert::From<i32> for ProbingResult {
2425 fn from(value: i32) -> Self {
2426 match value {
2427 0 => Self::Unspecified,
2428 1 => Self::Reachable,
2429 2 => Self::Unreachable,
2430 3 => Self::ReachabilityInconsistent,
2431 4 => Self::Undetermined,
2432 _ => Self::UnknownValue(probing_result::UnknownValue(
2433 wkt::internal::UnknownEnumValue::Integer(value),
2434 )),
2435 }
2436 }
2437 }
2438
2439 impl std::convert::From<&str> for ProbingResult {
2440 fn from(value: &str) -> Self {
2441 use std::string::ToString;
2442 match value {
2443 "PROBING_RESULT_UNSPECIFIED" => Self::Unspecified,
2444 "REACHABLE" => Self::Reachable,
2445 "UNREACHABLE" => Self::Unreachable,
2446 "REACHABILITY_INCONSISTENT" => Self::ReachabilityInconsistent,
2447 "UNDETERMINED" => Self::Undetermined,
2448 _ => Self::UnknownValue(probing_result::UnknownValue(
2449 wkt::internal::UnknownEnumValue::String(value.to_string()),
2450 )),
2451 }
2452 }
2453 }
2454
2455 impl serde::ser::Serialize for ProbingResult {
2456 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2457 where
2458 S: serde::Serializer,
2459 {
2460 match self {
2461 Self::Unspecified => serializer.serialize_i32(0),
2462 Self::Reachable => serializer.serialize_i32(1),
2463 Self::Unreachable => serializer.serialize_i32(2),
2464 Self::ReachabilityInconsistent => serializer.serialize_i32(3),
2465 Self::Undetermined => serializer.serialize_i32(4),
2466 Self::UnknownValue(u) => u.0.serialize(serializer),
2467 }
2468 }
2469 }
2470
2471 impl<'de> serde::de::Deserialize<'de> for ProbingResult {
2472 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2473 where
2474 D: serde::Deserializer<'de>,
2475 {
2476 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProbingResult>::new(
2477 ".google.cloud.networkmanagement.v1.ProbingDetails.ProbingResult",
2478 ))
2479 }
2480 }
2481
2482 /// Abort cause types.
2483 ///
2484 /// # Working with unknown values
2485 ///
2486 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2487 /// additional enum variants at any time. Adding new variants is not considered
2488 /// a breaking change. Applications should write their code in anticipation of:
2489 ///
2490 /// - New values appearing in future releases of the client library, **and**
2491 /// - New values received dynamically, without application changes.
2492 ///
2493 /// Please consult the [Working with enums] section in the user guide for some
2494 /// guidelines.
2495 ///
2496 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2497 #[derive(Clone, Debug, PartialEq)]
2498 #[non_exhaustive]
2499 pub enum ProbingAbortCause {
2500 /// No reason was specified.
2501 Unspecified,
2502 /// The user lacks permission to access some of the
2503 /// network resources required to run the test.
2504 PermissionDenied,
2505 /// No valid source endpoint could be derived from the request.
2506 NoSourceLocation,
2507 /// If set, the enum was initialized with an unknown value.
2508 ///
2509 /// Applications can examine the value using [ProbingAbortCause::value] or
2510 /// [ProbingAbortCause::name].
2511 UnknownValue(probing_abort_cause::UnknownValue),
2512 }
2513
2514 #[doc(hidden)]
2515 pub mod probing_abort_cause {
2516 #[allow(unused_imports)]
2517 use super::*;
2518 #[derive(Clone, Debug, PartialEq)]
2519 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2520 }
2521
2522 impl ProbingAbortCause {
2523 /// Gets the enum value.
2524 ///
2525 /// Returns `None` if the enum contains an unknown value deserialized from
2526 /// the string representation of enums.
2527 pub fn value(&self) -> std::option::Option<i32> {
2528 match self {
2529 Self::Unspecified => std::option::Option::Some(0),
2530 Self::PermissionDenied => std::option::Option::Some(1),
2531 Self::NoSourceLocation => std::option::Option::Some(2),
2532 Self::UnknownValue(u) => u.0.value(),
2533 }
2534 }
2535
2536 /// Gets the enum value as a string.
2537 ///
2538 /// Returns `None` if the enum contains an unknown value deserialized from
2539 /// the integer representation of enums.
2540 pub fn name(&self) -> std::option::Option<&str> {
2541 match self {
2542 Self::Unspecified => std::option::Option::Some("PROBING_ABORT_CAUSE_UNSPECIFIED"),
2543 Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
2544 Self::NoSourceLocation => std::option::Option::Some("NO_SOURCE_LOCATION"),
2545 Self::UnknownValue(u) => u.0.name(),
2546 }
2547 }
2548 }
2549
2550 impl std::default::Default for ProbingAbortCause {
2551 fn default() -> Self {
2552 use std::convert::From;
2553 Self::from(0)
2554 }
2555 }
2556
2557 impl std::fmt::Display for ProbingAbortCause {
2558 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2559 wkt::internal::display_enum(f, self.name(), self.value())
2560 }
2561 }
2562
2563 impl std::convert::From<i32> for ProbingAbortCause {
2564 fn from(value: i32) -> Self {
2565 match value {
2566 0 => Self::Unspecified,
2567 1 => Self::PermissionDenied,
2568 2 => Self::NoSourceLocation,
2569 _ => Self::UnknownValue(probing_abort_cause::UnknownValue(
2570 wkt::internal::UnknownEnumValue::Integer(value),
2571 )),
2572 }
2573 }
2574 }
2575
2576 impl std::convert::From<&str> for ProbingAbortCause {
2577 fn from(value: &str) -> Self {
2578 use std::string::ToString;
2579 match value {
2580 "PROBING_ABORT_CAUSE_UNSPECIFIED" => Self::Unspecified,
2581 "PERMISSION_DENIED" => Self::PermissionDenied,
2582 "NO_SOURCE_LOCATION" => Self::NoSourceLocation,
2583 _ => Self::UnknownValue(probing_abort_cause::UnknownValue(
2584 wkt::internal::UnknownEnumValue::String(value.to_string()),
2585 )),
2586 }
2587 }
2588 }
2589
2590 impl serde::ser::Serialize for ProbingAbortCause {
2591 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2592 where
2593 S: serde::Serializer,
2594 {
2595 match self {
2596 Self::Unspecified => serializer.serialize_i32(0),
2597 Self::PermissionDenied => serializer.serialize_i32(1),
2598 Self::NoSourceLocation => serializer.serialize_i32(2),
2599 Self::UnknownValue(u) => u.0.serialize(serializer),
2600 }
2601 }
2602 }
2603
2604 impl<'de> serde::de::Deserialize<'de> for ProbingAbortCause {
2605 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2606 where
2607 D: serde::Deserializer<'de>,
2608 {
2609 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProbingAbortCause>::new(
2610 ".google.cloud.networkmanagement.v1.ProbingDetails.ProbingAbortCause",
2611 ))
2612 }
2613 }
2614}
2615
2616/// Request for the `ListConnectivityTests` method.
2617#[derive(Clone, Default, PartialEq)]
2618#[non_exhaustive]
2619pub struct ListConnectivityTestsRequest {
2620 /// Required. The parent resource of the Connectivity Tests:
2621 /// `projects/{project_id}/locations/global`
2622 pub parent: std::string::String,
2623
2624 /// Number of `ConnectivityTests` to return.
2625 pub page_size: i32,
2626
2627 /// Page token from an earlier query, as returned in `next_page_token`.
2628 pub page_token: std::string::String,
2629
2630 /// Lists the `ConnectivityTests` that match the filter expression. A filter
2631 /// expression filters the resources listed in the response. The expression
2632 /// must be of the form `<field> <operator> <value>` where operators: `<`, `>`,
2633 /// `<=`,
2634 /// `>=`,
2635 /// `!=`, `=`, `:` are supported (colon `:` represents a HAS operator which is
2636 /// roughly synonymous with equality). \<field\> can refer to a proto or JSON
2637 /// field, or a synthetic field. Field names can be camelCase or snake_case.
2638 ///
2639 /// Examples:
2640 ///
2641 /// - Filter by name:
2642 /// name = "projects/proj-1/locations/global/connectivityTests/test-1
2643 ///
2644 /// - Filter by labels:
2645 ///
2646 /// - Resources that have a key called `foo`
2647 /// labels.foo:*
2648 /// - Resources that have a key called `foo` whose value is `bar`
2649 /// labels.foo = bar
2650 pub filter: std::string::String,
2651
2652 /// Field to use to sort the list.
2653 pub order_by: std::string::String,
2654
2655 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2656}
2657
2658impl ListConnectivityTestsRequest {
2659 /// Creates a new default instance.
2660 pub fn new() -> Self {
2661 std::default::Default::default()
2662 }
2663
2664 /// Sets the value of [parent][crate::model::ListConnectivityTestsRequest::parent].
2665 ///
2666 /// # Example
2667 /// ```ignore,no_run
2668 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2669 /// let x = ListConnectivityTestsRequest::new().set_parent("example");
2670 /// ```
2671 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2672 self.parent = v.into();
2673 self
2674 }
2675
2676 /// Sets the value of [page_size][crate::model::ListConnectivityTestsRequest::page_size].
2677 ///
2678 /// # Example
2679 /// ```ignore,no_run
2680 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2681 /// let x = ListConnectivityTestsRequest::new().set_page_size(42);
2682 /// ```
2683 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2684 self.page_size = v.into();
2685 self
2686 }
2687
2688 /// Sets the value of [page_token][crate::model::ListConnectivityTestsRequest::page_token].
2689 ///
2690 /// # Example
2691 /// ```ignore,no_run
2692 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2693 /// let x = ListConnectivityTestsRequest::new().set_page_token("example");
2694 /// ```
2695 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2696 self.page_token = v.into();
2697 self
2698 }
2699
2700 /// Sets the value of [filter][crate::model::ListConnectivityTestsRequest::filter].
2701 ///
2702 /// # Example
2703 /// ```ignore,no_run
2704 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2705 /// let x = ListConnectivityTestsRequest::new().set_filter("example");
2706 /// ```
2707 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2708 self.filter = v.into();
2709 self
2710 }
2711
2712 /// Sets the value of [order_by][crate::model::ListConnectivityTestsRequest::order_by].
2713 ///
2714 /// # Example
2715 /// ```ignore,no_run
2716 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2717 /// let x = ListConnectivityTestsRequest::new().set_order_by("example");
2718 /// ```
2719 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2720 self.order_by = v.into();
2721 self
2722 }
2723}
2724
2725impl wkt::message::Message for ListConnectivityTestsRequest {
2726 fn typename() -> &'static str {
2727 "type.googleapis.com/google.cloud.networkmanagement.v1.ListConnectivityTestsRequest"
2728 }
2729}
2730
2731/// Response for the `ListConnectivityTests` method.
2732#[derive(Clone, Default, PartialEq)]
2733#[non_exhaustive]
2734pub struct ListConnectivityTestsResponse {
2735 /// List of Connectivity Tests.
2736 pub resources: std::vec::Vec<crate::model::ConnectivityTest>,
2737
2738 /// Page token to fetch the next set of Connectivity Tests.
2739 pub next_page_token: std::string::String,
2740
2741 /// Locations that could not be reached (when querying all locations with `-`).
2742 pub unreachable: std::vec::Vec<std::string::String>,
2743
2744 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2745}
2746
2747impl ListConnectivityTestsResponse {
2748 /// Creates a new default instance.
2749 pub fn new() -> Self {
2750 std::default::Default::default()
2751 }
2752
2753 /// Sets the value of [resources][crate::model::ListConnectivityTestsResponse::resources].
2754 ///
2755 /// # Example
2756 /// ```ignore,no_run
2757 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2758 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2759 /// let x = ListConnectivityTestsResponse::new()
2760 /// .set_resources([
2761 /// ConnectivityTest::default()/* use setters */,
2762 /// ConnectivityTest::default()/* use (different) setters */,
2763 /// ]);
2764 /// ```
2765 pub fn set_resources<T, V>(mut self, v: T) -> Self
2766 where
2767 T: std::iter::IntoIterator<Item = V>,
2768 V: std::convert::Into<crate::model::ConnectivityTest>,
2769 {
2770 use std::iter::Iterator;
2771 self.resources = v.into_iter().map(|i| i.into()).collect();
2772 self
2773 }
2774
2775 /// Sets the value of [next_page_token][crate::model::ListConnectivityTestsResponse::next_page_token].
2776 ///
2777 /// # Example
2778 /// ```ignore,no_run
2779 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2780 /// let x = ListConnectivityTestsResponse::new().set_next_page_token("example");
2781 /// ```
2782 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2783 self.next_page_token = v.into();
2784 self
2785 }
2786
2787 /// Sets the value of [unreachable][crate::model::ListConnectivityTestsResponse::unreachable].
2788 ///
2789 /// # Example
2790 /// ```ignore,no_run
2791 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2792 /// let x = ListConnectivityTestsResponse::new().set_unreachable(["a", "b", "c"]);
2793 /// ```
2794 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2795 where
2796 T: std::iter::IntoIterator<Item = V>,
2797 V: std::convert::Into<std::string::String>,
2798 {
2799 use std::iter::Iterator;
2800 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2801 self
2802 }
2803}
2804
2805impl wkt::message::Message for ListConnectivityTestsResponse {
2806 fn typename() -> &'static str {
2807 "type.googleapis.com/google.cloud.networkmanagement.v1.ListConnectivityTestsResponse"
2808 }
2809}
2810
2811#[doc(hidden)]
2812impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectivityTestsResponse {
2813 type PageItem = crate::model::ConnectivityTest;
2814
2815 fn items(self) -> std::vec::Vec<Self::PageItem> {
2816 self.resources
2817 }
2818
2819 fn next_page_token(&self) -> std::string::String {
2820 use std::clone::Clone;
2821 self.next_page_token.clone()
2822 }
2823}
2824
2825/// Request for the `GetConnectivityTest` method.
2826#[derive(Clone, Default, PartialEq)]
2827#[non_exhaustive]
2828pub struct GetConnectivityTestRequest {
2829 /// Required. `ConnectivityTest` resource name using the form:
2830 /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
2831 pub name: std::string::String,
2832
2833 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2834}
2835
2836impl GetConnectivityTestRequest {
2837 /// Creates a new default instance.
2838 pub fn new() -> Self {
2839 std::default::Default::default()
2840 }
2841
2842 /// Sets the value of [name][crate::model::GetConnectivityTestRequest::name].
2843 ///
2844 /// # Example
2845 /// ```ignore,no_run
2846 /// # use google_cloud_networkmanagement_v1::model::GetConnectivityTestRequest;
2847 /// let x = GetConnectivityTestRequest::new().set_name("example");
2848 /// ```
2849 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2850 self.name = v.into();
2851 self
2852 }
2853}
2854
2855impl wkt::message::Message for GetConnectivityTestRequest {
2856 fn typename() -> &'static str {
2857 "type.googleapis.com/google.cloud.networkmanagement.v1.GetConnectivityTestRequest"
2858 }
2859}
2860
2861/// Request for the `CreateConnectivityTest` method.
2862#[derive(Clone, Default, PartialEq)]
2863#[non_exhaustive]
2864pub struct CreateConnectivityTestRequest {
2865 /// Required. The parent resource of the Connectivity Test to create:
2866 /// `projects/{project_id}/locations/global`
2867 pub parent: std::string::String,
2868
2869 /// Required. The logical name of the Connectivity Test in your project
2870 /// with the following restrictions:
2871 ///
2872 /// * Must contain only lowercase letters, numbers, and hyphens.
2873 /// * Must start with a letter.
2874 /// * Must be between 1-40 characters.
2875 /// * Must end with a number or a letter.
2876 /// * Must be unique within the customer project
2877 pub test_id: std::string::String,
2878
2879 /// Required. A `ConnectivityTest` resource
2880 pub resource: std::option::Option<crate::model::ConnectivityTest>,
2881
2882 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2883}
2884
2885impl CreateConnectivityTestRequest {
2886 /// Creates a new default instance.
2887 pub fn new() -> Self {
2888 std::default::Default::default()
2889 }
2890
2891 /// Sets the value of [parent][crate::model::CreateConnectivityTestRequest::parent].
2892 ///
2893 /// # Example
2894 /// ```ignore,no_run
2895 /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2896 /// let x = CreateConnectivityTestRequest::new().set_parent("example");
2897 /// ```
2898 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2899 self.parent = v.into();
2900 self
2901 }
2902
2903 /// Sets the value of [test_id][crate::model::CreateConnectivityTestRequest::test_id].
2904 ///
2905 /// # Example
2906 /// ```ignore,no_run
2907 /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2908 /// let x = CreateConnectivityTestRequest::new().set_test_id("example");
2909 /// ```
2910 pub fn set_test_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2911 self.test_id = v.into();
2912 self
2913 }
2914
2915 /// Sets the value of [resource][crate::model::CreateConnectivityTestRequest::resource].
2916 ///
2917 /// # Example
2918 /// ```ignore,no_run
2919 /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2920 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2921 /// let x = CreateConnectivityTestRequest::new().set_resource(ConnectivityTest::default()/* use setters */);
2922 /// ```
2923 pub fn set_resource<T>(mut self, v: T) -> Self
2924 where
2925 T: std::convert::Into<crate::model::ConnectivityTest>,
2926 {
2927 self.resource = std::option::Option::Some(v.into());
2928 self
2929 }
2930
2931 /// Sets or clears the value of [resource][crate::model::CreateConnectivityTestRequest::resource].
2932 ///
2933 /// # Example
2934 /// ```ignore,no_run
2935 /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2936 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2937 /// let x = CreateConnectivityTestRequest::new().set_or_clear_resource(Some(ConnectivityTest::default()/* use setters */));
2938 /// let x = CreateConnectivityTestRequest::new().set_or_clear_resource(None::<ConnectivityTest>);
2939 /// ```
2940 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
2941 where
2942 T: std::convert::Into<crate::model::ConnectivityTest>,
2943 {
2944 self.resource = v.map(|x| x.into());
2945 self
2946 }
2947}
2948
2949impl wkt::message::Message for CreateConnectivityTestRequest {
2950 fn typename() -> &'static str {
2951 "type.googleapis.com/google.cloud.networkmanagement.v1.CreateConnectivityTestRequest"
2952 }
2953}
2954
2955/// Request for the `UpdateConnectivityTest` method.
2956#[derive(Clone, Default, PartialEq)]
2957#[non_exhaustive]
2958pub struct UpdateConnectivityTestRequest {
2959 /// Required. Mask of fields to update. At least one path must be supplied in
2960 /// this field.
2961 pub update_mask: std::option::Option<wkt::FieldMask>,
2962
2963 /// Required. Only fields specified in update_mask are updated.
2964 pub resource: std::option::Option<crate::model::ConnectivityTest>,
2965
2966 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2967}
2968
2969impl UpdateConnectivityTestRequest {
2970 /// Creates a new default instance.
2971 pub fn new() -> Self {
2972 std::default::Default::default()
2973 }
2974
2975 /// Sets the value of [update_mask][crate::model::UpdateConnectivityTestRequest::update_mask].
2976 ///
2977 /// # Example
2978 /// ```ignore,no_run
2979 /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
2980 /// use wkt::FieldMask;
2981 /// let x = UpdateConnectivityTestRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2982 /// ```
2983 pub fn set_update_mask<T>(mut self, v: T) -> Self
2984 where
2985 T: std::convert::Into<wkt::FieldMask>,
2986 {
2987 self.update_mask = std::option::Option::Some(v.into());
2988 self
2989 }
2990
2991 /// Sets or clears the value of [update_mask][crate::model::UpdateConnectivityTestRequest::update_mask].
2992 ///
2993 /// # Example
2994 /// ```ignore,no_run
2995 /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
2996 /// use wkt::FieldMask;
2997 /// let x = UpdateConnectivityTestRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2998 /// let x = UpdateConnectivityTestRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2999 /// ```
3000 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3001 where
3002 T: std::convert::Into<wkt::FieldMask>,
3003 {
3004 self.update_mask = v.map(|x| x.into());
3005 self
3006 }
3007
3008 /// Sets the value of [resource][crate::model::UpdateConnectivityTestRequest::resource].
3009 ///
3010 /// # Example
3011 /// ```ignore,no_run
3012 /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
3013 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
3014 /// let x = UpdateConnectivityTestRequest::new().set_resource(ConnectivityTest::default()/* use setters */);
3015 /// ```
3016 pub fn set_resource<T>(mut self, v: T) -> Self
3017 where
3018 T: std::convert::Into<crate::model::ConnectivityTest>,
3019 {
3020 self.resource = std::option::Option::Some(v.into());
3021 self
3022 }
3023
3024 /// Sets or clears the value of [resource][crate::model::UpdateConnectivityTestRequest::resource].
3025 ///
3026 /// # Example
3027 /// ```ignore,no_run
3028 /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
3029 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
3030 /// let x = UpdateConnectivityTestRequest::new().set_or_clear_resource(Some(ConnectivityTest::default()/* use setters */));
3031 /// let x = UpdateConnectivityTestRequest::new().set_or_clear_resource(None::<ConnectivityTest>);
3032 /// ```
3033 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
3034 where
3035 T: std::convert::Into<crate::model::ConnectivityTest>,
3036 {
3037 self.resource = v.map(|x| x.into());
3038 self
3039 }
3040}
3041
3042impl wkt::message::Message for UpdateConnectivityTestRequest {
3043 fn typename() -> &'static str {
3044 "type.googleapis.com/google.cloud.networkmanagement.v1.UpdateConnectivityTestRequest"
3045 }
3046}
3047
3048/// Request for the `DeleteConnectivityTest` method.
3049#[derive(Clone, Default, PartialEq)]
3050#[non_exhaustive]
3051pub struct DeleteConnectivityTestRequest {
3052 /// Required. Connectivity Test resource name using the form:
3053 /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
3054 pub name: std::string::String,
3055
3056 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3057}
3058
3059impl DeleteConnectivityTestRequest {
3060 /// Creates a new default instance.
3061 pub fn new() -> Self {
3062 std::default::Default::default()
3063 }
3064
3065 /// Sets the value of [name][crate::model::DeleteConnectivityTestRequest::name].
3066 ///
3067 /// # Example
3068 /// ```ignore,no_run
3069 /// # use google_cloud_networkmanagement_v1::model::DeleteConnectivityTestRequest;
3070 /// let x = DeleteConnectivityTestRequest::new().set_name("example");
3071 /// ```
3072 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3073 self.name = v.into();
3074 self
3075 }
3076}
3077
3078impl wkt::message::Message for DeleteConnectivityTestRequest {
3079 fn typename() -> &'static str {
3080 "type.googleapis.com/google.cloud.networkmanagement.v1.DeleteConnectivityTestRequest"
3081 }
3082}
3083
3084/// Request for the `RerunConnectivityTest` method.
3085#[derive(Clone, Default, PartialEq)]
3086#[non_exhaustive]
3087pub struct RerunConnectivityTestRequest {
3088 /// Required. Connectivity Test resource name using the form:
3089 /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
3090 pub name: std::string::String,
3091
3092 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3093}
3094
3095impl RerunConnectivityTestRequest {
3096 /// Creates a new default instance.
3097 pub fn new() -> Self {
3098 std::default::Default::default()
3099 }
3100
3101 /// Sets the value of [name][crate::model::RerunConnectivityTestRequest::name].
3102 ///
3103 /// # Example
3104 /// ```ignore,no_run
3105 /// # use google_cloud_networkmanagement_v1::model::RerunConnectivityTestRequest;
3106 /// let x = RerunConnectivityTestRequest::new().set_name("example");
3107 /// ```
3108 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3109 self.name = v.into();
3110 self
3111 }
3112}
3113
3114impl wkt::message::Message for RerunConnectivityTestRequest {
3115 fn typename() -> &'static str {
3116 "type.googleapis.com/google.cloud.networkmanagement.v1.RerunConnectivityTestRequest"
3117 }
3118}
3119
3120/// Metadata describing an [Operation][google.longrunning.Operation]
3121///
3122/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
3123#[derive(Clone, Default, PartialEq)]
3124#[non_exhaustive]
3125pub struct OperationMetadata {
3126 /// The time the operation was created.
3127 pub create_time: std::option::Option<wkt::Timestamp>,
3128
3129 /// The time the operation finished running.
3130 pub end_time: std::option::Option<wkt::Timestamp>,
3131
3132 /// Target of the operation - for example
3133 /// projects/project-1/locations/global/connectivityTests/test-1
3134 pub target: std::string::String,
3135
3136 /// Name of the verb executed by the operation.
3137 pub verb: std::string::String,
3138
3139 /// Human-readable status of the operation, if any.
3140 pub status_detail: std::string::String,
3141
3142 /// Specifies if cancellation was requested for the operation.
3143 pub cancel_requested: bool,
3144
3145 /// API version.
3146 pub api_version: std::string::String,
3147
3148 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3149}
3150
3151impl OperationMetadata {
3152 /// Creates a new default instance.
3153 pub fn new() -> Self {
3154 std::default::Default::default()
3155 }
3156
3157 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3158 ///
3159 /// # Example
3160 /// ```ignore,no_run
3161 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3162 /// use wkt::Timestamp;
3163 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
3164 /// ```
3165 pub fn set_create_time<T>(mut self, v: T) -> Self
3166 where
3167 T: std::convert::Into<wkt::Timestamp>,
3168 {
3169 self.create_time = std::option::Option::Some(v.into());
3170 self
3171 }
3172
3173 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_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_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3180 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
3181 /// ```
3182 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3183 where
3184 T: std::convert::Into<wkt::Timestamp>,
3185 {
3186 self.create_time = v.map(|x| x.into());
3187 self
3188 }
3189
3190 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3191 ///
3192 /// # Example
3193 /// ```ignore,no_run
3194 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3195 /// use wkt::Timestamp;
3196 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3197 /// ```
3198 pub fn set_end_time<T>(mut self, v: T) -> Self
3199 where
3200 T: std::convert::Into<wkt::Timestamp>,
3201 {
3202 self.end_time = std::option::Option::Some(v.into());
3203 self
3204 }
3205
3206 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3207 ///
3208 /// # Example
3209 /// ```ignore,no_run
3210 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3211 /// use wkt::Timestamp;
3212 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3213 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3214 /// ```
3215 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3216 where
3217 T: std::convert::Into<wkt::Timestamp>,
3218 {
3219 self.end_time = v.map(|x| x.into());
3220 self
3221 }
3222
3223 /// Sets the value of [target][crate::model::OperationMetadata::target].
3224 ///
3225 /// # Example
3226 /// ```ignore,no_run
3227 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3228 /// let x = OperationMetadata::new().set_target("example");
3229 /// ```
3230 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3231 self.target = v.into();
3232 self
3233 }
3234
3235 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3236 ///
3237 /// # Example
3238 /// ```ignore,no_run
3239 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3240 /// let x = OperationMetadata::new().set_verb("example");
3241 /// ```
3242 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3243 self.verb = v.into();
3244 self
3245 }
3246
3247 /// Sets the value of [status_detail][crate::model::OperationMetadata::status_detail].
3248 ///
3249 /// # Example
3250 /// ```ignore,no_run
3251 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3252 /// let x = OperationMetadata::new().set_status_detail("example");
3253 /// ```
3254 pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3255 self.status_detail = v.into();
3256 self
3257 }
3258
3259 /// Sets the value of [cancel_requested][crate::model::OperationMetadata::cancel_requested].
3260 ///
3261 /// # Example
3262 /// ```ignore,no_run
3263 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3264 /// let x = OperationMetadata::new().set_cancel_requested(true);
3265 /// ```
3266 pub fn set_cancel_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3267 self.cancel_requested = v.into();
3268 self
3269 }
3270
3271 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3272 ///
3273 /// # Example
3274 /// ```ignore,no_run
3275 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3276 /// let x = OperationMetadata::new().set_api_version("example");
3277 /// ```
3278 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3279 self.api_version = v.into();
3280 self
3281 }
3282}
3283
3284impl wkt::message::Message for OperationMetadata {
3285 fn typename() -> &'static str {
3286 "type.googleapis.com/google.cloud.networkmanagement.v1.OperationMetadata"
3287 }
3288}
3289
3290/// Trace represents one simulated packet forwarding path.
3291///
3292/// * Each trace contains multiple ordered steps.
3293/// * Each step is in a particular state with associated configuration.
3294/// * State is categorized as final or non-final states.
3295/// * Each final state has a reason associated.
3296/// * Each trace must end with a final state (the last step).
3297///
3298/// ```norust
3299/// |---------------------Trace----------------------|
3300/// Step1(State) Step2(State) --- StepN(State(final))
3301/// ```
3302#[derive(Clone, Default, PartialEq)]
3303#[non_exhaustive]
3304pub struct Trace {
3305 /// Derived from the source and destination endpoints definition specified by
3306 /// user request, and validated by the data plane model.
3307 /// If there are multiple traces starting from different source locations, then
3308 /// the endpoint_info may be different between traces.
3309 pub endpoint_info: std::option::Option<crate::model::EndpointInfo>,
3310
3311 /// A trace of a test contains multiple steps from the initial state to the
3312 /// final state (delivered, dropped, forwarded, or aborted).
3313 ///
3314 /// The steps are ordered by the processing sequence within the simulated
3315 /// network state machine. It is critical to preserve the order of the steps
3316 /// and avoid reordering or sorting them.
3317 pub steps: std::vec::Vec<crate::model::Step>,
3318
3319 /// ID of trace. For forward traces, this ID is unique for each trace. For
3320 /// return traces, it matches ID of associated forward trace. A single forward
3321 /// trace can be associated with none, one or more than one return trace.
3322 pub forward_trace_id: i32,
3323
3324 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3325}
3326
3327impl Trace {
3328 /// Creates a new default instance.
3329 pub fn new() -> Self {
3330 std::default::Default::default()
3331 }
3332
3333 /// Sets the value of [endpoint_info][crate::model::Trace::endpoint_info].
3334 ///
3335 /// # Example
3336 /// ```ignore,no_run
3337 /// # use google_cloud_networkmanagement_v1::model::Trace;
3338 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3339 /// let x = Trace::new().set_endpoint_info(EndpointInfo::default()/* use setters */);
3340 /// ```
3341 pub fn set_endpoint_info<T>(mut self, v: T) -> Self
3342 where
3343 T: std::convert::Into<crate::model::EndpointInfo>,
3344 {
3345 self.endpoint_info = std::option::Option::Some(v.into());
3346 self
3347 }
3348
3349 /// Sets or clears the value of [endpoint_info][crate::model::Trace::endpoint_info].
3350 ///
3351 /// # Example
3352 /// ```ignore,no_run
3353 /// # use google_cloud_networkmanagement_v1::model::Trace;
3354 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3355 /// let x = Trace::new().set_or_clear_endpoint_info(Some(EndpointInfo::default()/* use setters */));
3356 /// let x = Trace::new().set_or_clear_endpoint_info(None::<EndpointInfo>);
3357 /// ```
3358 pub fn set_or_clear_endpoint_info<T>(mut self, v: std::option::Option<T>) -> Self
3359 where
3360 T: std::convert::Into<crate::model::EndpointInfo>,
3361 {
3362 self.endpoint_info = v.map(|x| x.into());
3363 self
3364 }
3365
3366 /// Sets the value of [steps][crate::model::Trace::steps].
3367 ///
3368 /// # Example
3369 /// ```ignore,no_run
3370 /// # use google_cloud_networkmanagement_v1::model::Trace;
3371 /// use google_cloud_networkmanagement_v1::model::Step;
3372 /// let x = Trace::new()
3373 /// .set_steps([
3374 /// Step::default()/* use setters */,
3375 /// Step::default()/* use (different) setters */,
3376 /// ]);
3377 /// ```
3378 pub fn set_steps<T, V>(mut self, v: T) -> Self
3379 where
3380 T: std::iter::IntoIterator<Item = V>,
3381 V: std::convert::Into<crate::model::Step>,
3382 {
3383 use std::iter::Iterator;
3384 self.steps = v.into_iter().map(|i| i.into()).collect();
3385 self
3386 }
3387
3388 /// Sets the value of [forward_trace_id][crate::model::Trace::forward_trace_id].
3389 ///
3390 /// # Example
3391 /// ```ignore,no_run
3392 /// # use google_cloud_networkmanagement_v1::model::Trace;
3393 /// let x = Trace::new().set_forward_trace_id(42);
3394 /// ```
3395 pub fn set_forward_trace_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3396 self.forward_trace_id = v.into();
3397 self
3398 }
3399}
3400
3401impl wkt::message::Message for Trace {
3402 fn typename() -> &'static str {
3403 "type.googleapis.com/google.cloud.networkmanagement.v1.Trace"
3404 }
3405}
3406
3407/// A simulated forwarding path is composed of multiple steps.
3408/// Each step has a well-defined state and an associated configuration.
3409#[derive(Clone, Default, PartialEq)]
3410#[non_exhaustive]
3411pub struct Step {
3412 /// A description of the step. Usually this is a summary of the state.
3413 pub description: std::string::String,
3414
3415 /// Each step is in one of the pre-defined states.
3416 pub state: crate::model::step::State,
3417
3418 /// This is a step that leads to the final state Drop.
3419 pub causes_drop: bool,
3420
3421 /// Project ID that contains the configuration this step is validating.
3422 pub project_id: std::string::String,
3423
3424 /// Configuration or metadata associated with each step.
3425 /// The configuration is filtered based on viewer's permission. If a viewer
3426 /// has no permission to view the configuration in this step, for non-final
3427 /// states a special state is populated (VIEWER_PERMISSION_MISSING), and for
3428 /// final state the configuration is cleared.
3429 pub step_info: std::option::Option<crate::model::step::StepInfo>,
3430
3431 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3432}
3433
3434impl Step {
3435 /// Creates a new default instance.
3436 pub fn new() -> Self {
3437 std::default::Default::default()
3438 }
3439
3440 /// Sets the value of [description][crate::model::Step::description].
3441 ///
3442 /// # Example
3443 /// ```ignore,no_run
3444 /// # use google_cloud_networkmanagement_v1::model::Step;
3445 /// let x = Step::new().set_description("example");
3446 /// ```
3447 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3448 self.description = v.into();
3449 self
3450 }
3451
3452 /// Sets the value of [state][crate::model::Step::state].
3453 ///
3454 /// # Example
3455 /// ```ignore,no_run
3456 /// # use google_cloud_networkmanagement_v1::model::Step;
3457 /// use google_cloud_networkmanagement_v1::model::step::State;
3458 /// let x0 = Step::new().set_state(State::StartFromInstance);
3459 /// let x1 = Step::new().set_state(State::StartFromInternet);
3460 /// let x2 = Step::new().set_state(State::StartFromGoogleService);
3461 /// ```
3462 pub fn set_state<T: std::convert::Into<crate::model::step::State>>(mut self, v: T) -> Self {
3463 self.state = v.into();
3464 self
3465 }
3466
3467 /// Sets the value of [causes_drop][crate::model::Step::causes_drop].
3468 ///
3469 /// # Example
3470 /// ```ignore,no_run
3471 /// # use google_cloud_networkmanagement_v1::model::Step;
3472 /// let x = Step::new().set_causes_drop(true);
3473 /// ```
3474 pub fn set_causes_drop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3475 self.causes_drop = v.into();
3476 self
3477 }
3478
3479 /// Sets the value of [project_id][crate::model::Step::project_id].
3480 ///
3481 /// # Example
3482 /// ```ignore,no_run
3483 /// # use google_cloud_networkmanagement_v1::model::Step;
3484 /// let x = Step::new().set_project_id("example");
3485 /// ```
3486 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3487 self.project_id = v.into();
3488 self
3489 }
3490
3491 /// Sets the value of [step_info][crate::model::Step::step_info].
3492 ///
3493 /// Note that all the setters affecting `step_info` are mutually
3494 /// exclusive.
3495 ///
3496 /// # Example
3497 /// ```ignore,no_run
3498 /// # use google_cloud_networkmanagement_v1::model::Step;
3499 /// use google_cloud_networkmanagement_v1::model::InstanceInfo;
3500 /// let x = Step::new().set_step_info(Some(
3501 /// google_cloud_networkmanagement_v1::model::step::StepInfo::Instance(InstanceInfo::default().into())));
3502 /// ```
3503 pub fn set_step_info<
3504 T: std::convert::Into<std::option::Option<crate::model::step::StepInfo>>,
3505 >(
3506 mut self,
3507 v: T,
3508 ) -> Self {
3509 self.step_info = v.into();
3510 self
3511 }
3512
3513 /// The value of [step_info][crate::model::Step::step_info]
3514 /// if it holds a `Instance`, `None` if the field is not set or
3515 /// holds a different branch.
3516 pub fn instance(&self) -> std::option::Option<&std::boxed::Box<crate::model::InstanceInfo>> {
3517 #[allow(unreachable_patterns)]
3518 self.step_info.as_ref().and_then(|v| match v {
3519 crate::model::step::StepInfo::Instance(v) => std::option::Option::Some(v),
3520 _ => std::option::Option::None,
3521 })
3522 }
3523
3524 /// Sets the value of [step_info][crate::model::Step::step_info]
3525 /// to hold a `Instance`.
3526 ///
3527 /// Note that all the setters affecting `step_info` are
3528 /// mutually exclusive.
3529 ///
3530 /// # Example
3531 /// ```ignore,no_run
3532 /// # use google_cloud_networkmanagement_v1::model::Step;
3533 /// use google_cloud_networkmanagement_v1::model::InstanceInfo;
3534 /// let x = Step::new().set_instance(InstanceInfo::default()/* use setters */);
3535 /// assert!(x.instance().is_some());
3536 /// assert!(x.firewall().is_none());
3537 /// assert!(x.route().is_none());
3538 /// assert!(x.endpoint().is_none());
3539 /// assert!(x.google_service().is_none());
3540 /// assert!(x.forwarding_rule().is_none());
3541 /// assert!(x.hybrid_subnet().is_none());
3542 /// assert!(x.vpn_gateway().is_none());
3543 /// assert!(x.vpn_tunnel().is_none());
3544 /// assert!(x.interconnect_attachment().is_none());
3545 /// assert!(x.vpc_connector().is_none());
3546 /// assert!(x.direct_vpc_egress_connection().is_none());
3547 /// assert!(x.serverless_external_connection().is_none());
3548 /// assert!(x.deliver().is_none());
3549 /// assert!(x.forward().is_none());
3550 /// assert!(x.abort().is_none());
3551 /// assert!(x.drop().is_none());
3552 /// assert!(x.load_balancer().is_none());
3553 /// assert!(x.network().is_none());
3554 /// assert!(x.gke_master().is_none());
3555 /// assert!(x.gke_pod().is_none());
3556 /// assert!(x.ip_masquerading_skipped().is_none());
3557 /// assert!(x.gke_network_policy().is_none());
3558 /// assert!(x.gke_network_policy_skipped().is_none());
3559 /// assert!(x.cloud_sql_instance().is_none());
3560 /// assert!(x.redis_instance().is_none());
3561 /// assert!(x.redis_cluster().is_none());
3562 /// assert!(x.cloud_function().is_none());
3563 /// assert!(x.app_engine_version().is_none());
3564 /// assert!(x.cloud_run_revision().is_none());
3565 /// assert!(x.nat().is_none());
3566 /// assert!(x.proxy_connection().is_none());
3567 /// assert!(x.load_balancer_backend_info().is_none());
3568 /// assert!(x.storage_bucket().is_none());
3569 /// assert!(x.serverless_neg().is_none());
3570 /// assert!(x.ngfw_packet_inspection().is_none());
3571 /// ```
3572 pub fn set_instance<T: std::convert::Into<std::boxed::Box<crate::model::InstanceInfo>>>(
3573 mut self,
3574 v: T,
3575 ) -> Self {
3576 self.step_info =
3577 std::option::Option::Some(crate::model::step::StepInfo::Instance(v.into()));
3578 self
3579 }
3580
3581 /// The value of [step_info][crate::model::Step::step_info]
3582 /// if it holds a `Firewall`, `None` if the field is not set or
3583 /// holds a different branch.
3584 pub fn firewall(&self) -> std::option::Option<&std::boxed::Box<crate::model::FirewallInfo>> {
3585 #[allow(unreachable_patterns)]
3586 self.step_info.as_ref().and_then(|v| match v {
3587 crate::model::step::StepInfo::Firewall(v) => std::option::Option::Some(v),
3588 _ => std::option::Option::None,
3589 })
3590 }
3591
3592 /// Sets the value of [step_info][crate::model::Step::step_info]
3593 /// to hold a `Firewall`.
3594 ///
3595 /// Note that all the setters affecting `step_info` are
3596 /// mutually exclusive.
3597 ///
3598 /// # Example
3599 /// ```ignore,no_run
3600 /// # use google_cloud_networkmanagement_v1::model::Step;
3601 /// use google_cloud_networkmanagement_v1::model::FirewallInfo;
3602 /// let x = Step::new().set_firewall(FirewallInfo::default()/* use setters */);
3603 /// assert!(x.firewall().is_some());
3604 /// assert!(x.instance().is_none());
3605 /// assert!(x.route().is_none());
3606 /// assert!(x.endpoint().is_none());
3607 /// assert!(x.google_service().is_none());
3608 /// assert!(x.forwarding_rule().is_none());
3609 /// assert!(x.hybrid_subnet().is_none());
3610 /// assert!(x.vpn_gateway().is_none());
3611 /// assert!(x.vpn_tunnel().is_none());
3612 /// assert!(x.interconnect_attachment().is_none());
3613 /// assert!(x.vpc_connector().is_none());
3614 /// assert!(x.direct_vpc_egress_connection().is_none());
3615 /// assert!(x.serverless_external_connection().is_none());
3616 /// assert!(x.deliver().is_none());
3617 /// assert!(x.forward().is_none());
3618 /// assert!(x.abort().is_none());
3619 /// assert!(x.drop().is_none());
3620 /// assert!(x.load_balancer().is_none());
3621 /// assert!(x.network().is_none());
3622 /// assert!(x.gke_master().is_none());
3623 /// assert!(x.gke_pod().is_none());
3624 /// assert!(x.ip_masquerading_skipped().is_none());
3625 /// assert!(x.gke_network_policy().is_none());
3626 /// assert!(x.gke_network_policy_skipped().is_none());
3627 /// assert!(x.cloud_sql_instance().is_none());
3628 /// assert!(x.redis_instance().is_none());
3629 /// assert!(x.redis_cluster().is_none());
3630 /// assert!(x.cloud_function().is_none());
3631 /// assert!(x.app_engine_version().is_none());
3632 /// assert!(x.cloud_run_revision().is_none());
3633 /// assert!(x.nat().is_none());
3634 /// assert!(x.proxy_connection().is_none());
3635 /// assert!(x.load_balancer_backend_info().is_none());
3636 /// assert!(x.storage_bucket().is_none());
3637 /// assert!(x.serverless_neg().is_none());
3638 /// assert!(x.ngfw_packet_inspection().is_none());
3639 /// ```
3640 pub fn set_firewall<T: std::convert::Into<std::boxed::Box<crate::model::FirewallInfo>>>(
3641 mut self,
3642 v: T,
3643 ) -> Self {
3644 self.step_info =
3645 std::option::Option::Some(crate::model::step::StepInfo::Firewall(v.into()));
3646 self
3647 }
3648
3649 /// The value of [step_info][crate::model::Step::step_info]
3650 /// if it holds a `Route`, `None` if the field is not set or
3651 /// holds a different branch.
3652 pub fn route(&self) -> std::option::Option<&std::boxed::Box<crate::model::RouteInfo>> {
3653 #[allow(unreachable_patterns)]
3654 self.step_info.as_ref().and_then(|v| match v {
3655 crate::model::step::StepInfo::Route(v) => std::option::Option::Some(v),
3656 _ => std::option::Option::None,
3657 })
3658 }
3659
3660 /// Sets the value of [step_info][crate::model::Step::step_info]
3661 /// to hold a `Route`.
3662 ///
3663 /// Note that all the setters affecting `step_info` are
3664 /// mutually exclusive.
3665 ///
3666 /// # Example
3667 /// ```ignore,no_run
3668 /// # use google_cloud_networkmanagement_v1::model::Step;
3669 /// use google_cloud_networkmanagement_v1::model::RouteInfo;
3670 /// let x = Step::new().set_route(RouteInfo::default()/* use setters */);
3671 /// assert!(x.route().is_some());
3672 /// assert!(x.instance().is_none());
3673 /// assert!(x.firewall().is_none());
3674 /// assert!(x.endpoint().is_none());
3675 /// assert!(x.google_service().is_none());
3676 /// assert!(x.forwarding_rule().is_none());
3677 /// assert!(x.hybrid_subnet().is_none());
3678 /// assert!(x.vpn_gateway().is_none());
3679 /// assert!(x.vpn_tunnel().is_none());
3680 /// assert!(x.interconnect_attachment().is_none());
3681 /// assert!(x.vpc_connector().is_none());
3682 /// assert!(x.direct_vpc_egress_connection().is_none());
3683 /// assert!(x.serverless_external_connection().is_none());
3684 /// assert!(x.deliver().is_none());
3685 /// assert!(x.forward().is_none());
3686 /// assert!(x.abort().is_none());
3687 /// assert!(x.drop().is_none());
3688 /// assert!(x.load_balancer().is_none());
3689 /// assert!(x.network().is_none());
3690 /// assert!(x.gke_master().is_none());
3691 /// assert!(x.gke_pod().is_none());
3692 /// assert!(x.ip_masquerading_skipped().is_none());
3693 /// assert!(x.gke_network_policy().is_none());
3694 /// assert!(x.gke_network_policy_skipped().is_none());
3695 /// assert!(x.cloud_sql_instance().is_none());
3696 /// assert!(x.redis_instance().is_none());
3697 /// assert!(x.redis_cluster().is_none());
3698 /// assert!(x.cloud_function().is_none());
3699 /// assert!(x.app_engine_version().is_none());
3700 /// assert!(x.cloud_run_revision().is_none());
3701 /// assert!(x.nat().is_none());
3702 /// assert!(x.proxy_connection().is_none());
3703 /// assert!(x.load_balancer_backend_info().is_none());
3704 /// assert!(x.storage_bucket().is_none());
3705 /// assert!(x.serverless_neg().is_none());
3706 /// assert!(x.ngfw_packet_inspection().is_none());
3707 /// ```
3708 pub fn set_route<T: std::convert::Into<std::boxed::Box<crate::model::RouteInfo>>>(
3709 mut self,
3710 v: T,
3711 ) -> Self {
3712 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Route(v.into()));
3713 self
3714 }
3715
3716 /// The value of [step_info][crate::model::Step::step_info]
3717 /// if it holds a `Endpoint`, `None` if the field is not set or
3718 /// holds a different branch.
3719 pub fn endpoint(&self) -> std::option::Option<&std::boxed::Box<crate::model::EndpointInfo>> {
3720 #[allow(unreachable_patterns)]
3721 self.step_info.as_ref().and_then(|v| match v {
3722 crate::model::step::StepInfo::Endpoint(v) => std::option::Option::Some(v),
3723 _ => std::option::Option::None,
3724 })
3725 }
3726
3727 /// Sets the value of [step_info][crate::model::Step::step_info]
3728 /// to hold a `Endpoint`.
3729 ///
3730 /// Note that all the setters affecting `step_info` are
3731 /// mutually exclusive.
3732 ///
3733 /// # Example
3734 /// ```ignore,no_run
3735 /// # use google_cloud_networkmanagement_v1::model::Step;
3736 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3737 /// let x = Step::new().set_endpoint(EndpointInfo::default()/* use setters */);
3738 /// assert!(x.endpoint().is_some());
3739 /// assert!(x.instance().is_none());
3740 /// assert!(x.firewall().is_none());
3741 /// assert!(x.route().is_none());
3742 /// assert!(x.google_service().is_none());
3743 /// assert!(x.forwarding_rule().is_none());
3744 /// assert!(x.hybrid_subnet().is_none());
3745 /// assert!(x.vpn_gateway().is_none());
3746 /// assert!(x.vpn_tunnel().is_none());
3747 /// assert!(x.interconnect_attachment().is_none());
3748 /// assert!(x.vpc_connector().is_none());
3749 /// assert!(x.direct_vpc_egress_connection().is_none());
3750 /// assert!(x.serverless_external_connection().is_none());
3751 /// assert!(x.deliver().is_none());
3752 /// assert!(x.forward().is_none());
3753 /// assert!(x.abort().is_none());
3754 /// assert!(x.drop().is_none());
3755 /// assert!(x.load_balancer().is_none());
3756 /// assert!(x.network().is_none());
3757 /// assert!(x.gke_master().is_none());
3758 /// assert!(x.gke_pod().is_none());
3759 /// assert!(x.ip_masquerading_skipped().is_none());
3760 /// assert!(x.gke_network_policy().is_none());
3761 /// assert!(x.gke_network_policy_skipped().is_none());
3762 /// assert!(x.cloud_sql_instance().is_none());
3763 /// assert!(x.redis_instance().is_none());
3764 /// assert!(x.redis_cluster().is_none());
3765 /// assert!(x.cloud_function().is_none());
3766 /// assert!(x.app_engine_version().is_none());
3767 /// assert!(x.cloud_run_revision().is_none());
3768 /// assert!(x.nat().is_none());
3769 /// assert!(x.proxy_connection().is_none());
3770 /// assert!(x.load_balancer_backend_info().is_none());
3771 /// assert!(x.storage_bucket().is_none());
3772 /// assert!(x.serverless_neg().is_none());
3773 /// assert!(x.ngfw_packet_inspection().is_none());
3774 /// ```
3775 pub fn set_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::EndpointInfo>>>(
3776 mut self,
3777 v: T,
3778 ) -> Self {
3779 self.step_info =
3780 std::option::Option::Some(crate::model::step::StepInfo::Endpoint(v.into()));
3781 self
3782 }
3783
3784 /// The value of [step_info][crate::model::Step::step_info]
3785 /// if it holds a `GoogleService`, `None` if the field is not set or
3786 /// holds a different branch.
3787 pub fn google_service(
3788 &self,
3789 ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleServiceInfo>> {
3790 #[allow(unreachable_patterns)]
3791 self.step_info.as_ref().and_then(|v| match v {
3792 crate::model::step::StepInfo::GoogleService(v) => std::option::Option::Some(v),
3793 _ => std::option::Option::None,
3794 })
3795 }
3796
3797 /// Sets the value of [step_info][crate::model::Step::step_info]
3798 /// to hold a `GoogleService`.
3799 ///
3800 /// Note that all the setters affecting `step_info` are
3801 /// mutually exclusive.
3802 ///
3803 /// # Example
3804 /// ```ignore,no_run
3805 /// # use google_cloud_networkmanagement_v1::model::Step;
3806 /// use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
3807 /// let x = Step::new().set_google_service(GoogleServiceInfo::default()/* use setters */);
3808 /// assert!(x.google_service().is_some());
3809 /// assert!(x.instance().is_none());
3810 /// assert!(x.firewall().is_none());
3811 /// assert!(x.route().is_none());
3812 /// assert!(x.endpoint().is_none());
3813 /// assert!(x.forwarding_rule().is_none());
3814 /// assert!(x.hybrid_subnet().is_none());
3815 /// assert!(x.vpn_gateway().is_none());
3816 /// assert!(x.vpn_tunnel().is_none());
3817 /// assert!(x.interconnect_attachment().is_none());
3818 /// assert!(x.vpc_connector().is_none());
3819 /// assert!(x.direct_vpc_egress_connection().is_none());
3820 /// assert!(x.serverless_external_connection().is_none());
3821 /// assert!(x.deliver().is_none());
3822 /// assert!(x.forward().is_none());
3823 /// assert!(x.abort().is_none());
3824 /// assert!(x.drop().is_none());
3825 /// assert!(x.load_balancer().is_none());
3826 /// assert!(x.network().is_none());
3827 /// assert!(x.gke_master().is_none());
3828 /// assert!(x.gke_pod().is_none());
3829 /// assert!(x.ip_masquerading_skipped().is_none());
3830 /// assert!(x.gke_network_policy().is_none());
3831 /// assert!(x.gke_network_policy_skipped().is_none());
3832 /// assert!(x.cloud_sql_instance().is_none());
3833 /// assert!(x.redis_instance().is_none());
3834 /// assert!(x.redis_cluster().is_none());
3835 /// assert!(x.cloud_function().is_none());
3836 /// assert!(x.app_engine_version().is_none());
3837 /// assert!(x.cloud_run_revision().is_none());
3838 /// assert!(x.nat().is_none());
3839 /// assert!(x.proxy_connection().is_none());
3840 /// assert!(x.load_balancer_backend_info().is_none());
3841 /// assert!(x.storage_bucket().is_none());
3842 /// assert!(x.serverless_neg().is_none());
3843 /// assert!(x.ngfw_packet_inspection().is_none());
3844 /// ```
3845 pub fn set_google_service<
3846 T: std::convert::Into<std::boxed::Box<crate::model::GoogleServiceInfo>>,
3847 >(
3848 mut self,
3849 v: T,
3850 ) -> Self {
3851 self.step_info =
3852 std::option::Option::Some(crate::model::step::StepInfo::GoogleService(v.into()));
3853 self
3854 }
3855
3856 /// The value of [step_info][crate::model::Step::step_info]
3857 /// if it holds a `ForwardingRule`, `None` if the field is not set or
3858 /// holds a different branch.
3859 pub fn forwarding_rule(
3860 &self,
3861 ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardingRuleInfo>> {
3862 #[allow(unreachable_patterns)]
3863 self.step_info.as_ref().and_then(|v| match v {
3864 crate::model::step::StepInfo::ForwardingRule(v) => std::option::Option::Some(v),
3865 _ => std::option::Option::None,
3866 })
3867 }
3868
3869 /// Sets the value of [step_info][crate::model::Step::step_info]
3870 /// to hold a `ForwardingRule`.
3871 ///
3872 /// Note that all the setters affecting `step_info` are
3873 /// mutually exclusive.
3874 ///
3875 /// # Example
3876 /// ```ignore,no_run
3877 /// # use google_cloud_networkmanagement_v1::model::Step;
3878 /// use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
3879 /// let x = Step::new().set_forwarding_rule(ForwardingRuleInfo::default()/* use setters */);
3880 /// assert!(x.forwarding_rule().is_some());
3881 /// assert!(x.instance().is_none());
3882 /// assert!(x.firewall().is_none());
3883 /// assert!(x.route().is_none());
3884 /// assert!(x.endpoint().is_none());
3885 /// assert!(x.google_service().is_none());
3886 /// assert!(x.hybrid_subnet().is_none());
3887 /// assert!(x.vpn_gateway().is_none());
3888 /// assert!(x.vpn_tunnel().is_none());
3889 /// assert!(x.interconnect_attachment().is_none());
3890 /// assert!(x.vpc_connector().is_none());
3891 /// assert!(x.direct_vpc_egress_connection().is_none());
3892 /// assert!(x.serverless_external_connection().is_none());
3893 /// assert!(x.deliver().is_none());
3894 /// assert!(x.forward().is_none());
3895 /// assert!(x.abort().is_none());
3896 /// assert!(x.drop().is_none());
3897 /// assert!(x.load_balancer().is_none());
3898 /// assert!(x.network().is_none());
3899 /// assert!(x.gke_master().is_none());
3900 /// assert!(x.gke_pod().is_none());
3901 /// assert!(x.ip_masquerading_skipped().is_none());
3902 /// assert!(x.gke_network_policy().is_none());
3903 /// assert!(x.gke_network_policy_skipped().is_none());
3904 /// assert!(x.cloud_sql_instance().is_none());
3905 /// assert!(x.redis_instance().is_none());
3906 /// assert!(x.redis_cluster().is_none());
3907 /// assert!(x.cloud_function().is_none());
3908 /// assert!(x.app_engine_version().is_none());
3909 /// assert!(x.cloud_run_revision().is_none());
3910 /// assert!(x.nat().is_none());
3911 /// assert!(x.proxy_connection().is_none());
3912 /// assert!(x.load_balancer_backend_info().is_none());
3913 /// assert!(x.storage_bucket().is_none());
3914 /// assert!(x.serverless_neg().is_none());
3915 /// assert!(x.ngfw_packet_inspection().is_none());
3916 /// ```
3917 pub fn set_forwarding_rule<
3918 T: std::convert::Into<std::boxed::Box<crate::model::ForwardingRuleInfo>>,
3919 >(
3920 mut self,
3921 v: T,
3922 ) -> Self {
3923 self.step_info =
3924 std::option::Option::Some(crate::model::step::StepInfo::ForwardingRule(v.into()));
3925 self
3926 }
3927
3928 /// The value of [step_info][crate::model::Step::step_info]
3929 /// if it holds a `HybridSubnet`, `None` if the field is not set or
3930 /// holds a different branch.
3931 pub fn hybrid_subnet(
3932 &self,
3933 ) -> std::option::Option<&std::boxed::Box<crate::model::HybridSubnetInfo>> {
3934 #[allow(unreachable_patterns)]
3935 self.step_info.as_ref().and_then(|v| match v {
3936 crate::model::step::StepInfo::HybridSubnet(v) => std::option::Option::Some(v),
3937 _ => std::option::Option::None,
3938 })
3939 }
3940
3941 /// Sets the value of [step_info][crate::model::Step::step_info]
3942 /// to hold a `HybridSubnet`.
3943 ///
3944 /// Note that all the setters affecting `step_info` are
3945 /// mutually exclusive.
3946 ///
3947 /// # Example
3948 /// ```ignore,no_run
3949 /// # use google_cloud_networkmanagement_v1::model::Step;
3950 /// use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
3951 /// let x = Step::new().set_hybrid_subnet(HybridSubnetInfo::default()/* use setters */);
3952 /// assert!(x.hybrid_subnet().is_some());
3953 /// assert!(x.instance().is_none());
3954 /// assert!(x.firewall().is_none());
3955 /// assert!(x.route().is_none());
3956 /// assert!(x.endpoint().is_none());
3957 /// assert!(x.google_service().is_none());
3958 /// assert!(x.forwarding_rule().is_none());
3959 /// assert!(x.vpn_gateway().is_none());
3960 /// assert!(x.vpn_tunnel().is_none());
3961 /// assert!(x.interconnect_attachment().is_none());
3962 /// assert!(x.vpc_connector().is_none());
3963 /// assert!(x.direct_vpc_egress_connection().is_none());
3964 /// assert!(x.serverless_external_connection().is_none());
3965 /// assert!(x.deliver().is_none());
3966 /// assert!(x.forward().is_none());
3967 /// assert!(x.abort().is_none());
3968 /// assert!(x.drop().is_none());
3969 /// assert!(x.load_balancer().is_none());
3970 /// assert!(x.network().is_none());
3971 /// assert!(x.gke_master().is_none());
3972 /// assert!(x.gke_pod().is_none());
3973 /// assert!(x.ip_masquerading_skipped().is_none());
3974 /// assert!(x.gke_network_policy().is_none());
3975 /// assert!(x.gke_network_policy_skipped().is_none());
3976 /// assert!(x.cloud_sql_instance().is_none());
3977 /// assert!(x.redis_instance().is_none());
3978 /// assert!(x.redis_cluster().is_none());
3979 /// assert!(x.cloud_function().is_none());
3980 /// assert!(x.app_engine_version().is_none());
3981 /// assert!(x.cloud_run_revision().is_none());
3982 /// assert!(x.nat().is_none());
3983 /// assert!(x.proxy_connection().is_none());
3984 /// assert!(x.load_balancer_backend_info().is_none());
3985 /// assert!(x.storage_bucket().is_none());
3986 /// assert!(x.serverless_neg().is_none());
3987 /// assert!(x.ngfw_packet_inspection().is_none());
3988 /// ```
3989 pub fn set_hybrid_subnet<
3990 T: std::convert::Into<std::boxed::Box<crate::model::HybridSubnetInfo>>,
3991 >(
3992 mut self,
3993 v: T,
3994 ) -> Self {
3995 self.step_info =
3996 std::option::Option::Some(crate::model::step::StepInfo::HybridSubnet(v.into()));
3997 self
3998 }
3999
4000 /// The value of [step_info][crate::model::Step::step_info]
4001 /// if it holds a `VpnGateway`, `None` if the field is not set or
4002 /// holds a different branch.
4003 pub fn vpn_gateway(
4004 &self,
4005 ) -> std::option::Option<&std::boxed::Box<crate::model::VpnGatewayInfo>> {
4006 #[allow(unreachable_patterns)]
4007 self.step_info.as_ref().and_then(|v| match v {
4008 crate::model::step::StepInfo::VpnGateway(v) => std::option::Option::Some(v),
4009 _ => std::option::Option::None,
4010 })
4011 }
4012
4013 /// Sets the value of [step_info][crate::model::Step::step_info]
4014 /// to hold a `VpnGateway`.
4015 ///
4016 /// Note that all the setters affecting `step_info` are
4017 /// mutually exclusive.
4018 ///
4019 /// # Example
4020 /// ```ignore,no_run
4021 /// # use google_cloud_networkmanagement_v1::model::Step;
4022 /// use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
4023 /// let x = Step::new().set_vpn_gateway(VpnGatewayInfo::default()/* use setters */);
4024 /// assert!(x.vpn_gateway().is_some());
4025 /// assert!(x.instance().is_none());
4026 /// assert!(x.firewall().is_none());
4027 /// assert!(x.route().is_none());
4028 /// assert!(x.endpoint().is_none());
4029 /// assert!(x.google_service().is_none());
4030 /// assert!(x.forwarding_rule().is_none());
4031 /// assert!(x.hybrid_subnet().is_none());
4032 /// assert!(x.vpn_tunnel().is_none());
4033 /// assert!(x.interconnect_attachment().is_none());
4034 /// assert!(x.vpc_connector().is_none());
4035 /// assert!(x.direct_vpc_egress_connection().is_none());
4036 /// assert!(x.serverless_external_connection().is_none());
4037 /// assert!(x.deliver().is_none());
4038 /// assert!(x.forward().is_none());
4039 /// assert!(x.abort().is_none());
4040 /// assert!(x.drop().is_none());
4041 /// assert!(x.load_balancer().is_none());
4042 /// assert!(x.network().is_none());
4043 /// assert!(x.gke_master().is_none());
4044 /// assert!(x.gke_pod().is_none());
4045 /// assert!(x.ip_masquerading_skipped().is_none());
4046 /// assert!(x.gke_network_policy().is_none());
4047 /// assert!(x.gke_network_policy_skipped().is_none());
4048 /// assert!(x.cloud_sql_instance().is_none());
4049 /// assert!(x.redis_instance().is_none());
4050 /// assert!(x.redis_cluster().is_none());
4051 /// assert!(x.cloud_function().is_none());
4052 /// assert!(x.app_engine_version().is_none());
4053 /// assert!(x.cloud_run_revision().is_none());
4054 /// assert!(x.nat().is_none());
4055 /// assert!(x.proxy_connection().is_none());
4056 /// assert!(x.load_balancer_backend_info().is_none());
4057 /// assert!(x.storage_bucket().is_none());
4058 /// assert!(x.serverless_neg().is_none());
4059 /// assert!(x.ngfw_packet_inspection().is_none());
4060 /// ```
4061 pub fn set_vpn_gateway<T: std::convert::Into<std::boxed::Box<crate::model::VpnGatewayInfo>>>(
4062 mut self,
4063 v: T,
4064 ) -> Self {
4065 self.step_info =
4066 std::option::Option::Some(crate::model::step::StepInfo::VpnGateway(v.into()));
4067 self
4068 }
4069
4070 /// The value of [step_info][crate::model::Step::step_info]
4071 /// if it holds a `VpnTunnel`, `None` if the field is not set or
4072 /// holds a different branch.
4073 pub fn vpn_tunnel(&self) -> std::option::Option<&std::boxed::Box<crate::model::VpnTunnelInfo>> {
4074 #[allow(unreachable_patterns)]
4075 self.step_info.as_ref().and_then(|v| match v {
4076 crate::model::step::StepInfo::VpnTunnel(v) => std::option::Option::Some(v),
4077 _ => std::option::Option::None,
4078 })
4079 }
4080
4081 /// Sets the value of [step_info][crate::model::Step::step_info]
4082 /// to hold a `VpnTunnel`.
4083 ///
4084 /// Note that all the setters affecting `step_info` are
4085 /// mutually exclusive.
4086 ///
4087 /// # Example
4088 /// ```ignore,no_run
4089 /// # use google_cloud_networkmanagement_v1::model::Step;
4090 /// use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
4091 /// let x = Step::new().set_vpn_tunnel(VpnTunnelInfo::default()/* use setters */);
4092 /// assert!(x.vpn_tunnel().is_some());
4093 /// assert!(x.instance().is_none());
4094 /// assert!(x.firewall().is_none());
4095 /// assert!(x.route().is_none());
4096 /// assert!(x.endpoint().is_none());
4097 /// assert!(x.google_service().is_none());
4098 /// assert!(x.forwarding_rule().is_none());
4099 /// assert!(x.hybrid_subnet().is_none());
4100 /// assert!(x.vpn_gateway().is_none());
4101 /// assert!(x.interconnect_attachment().is_none());
4102 /// assert!(x.vpc_connector().is_none());
4103 /// assert!(x.direct_vpc_egress_connection().is_none());
4104 /// assert!(x.serverless_external_connection().is_none());
4105 /// assert!(x.deliver().is_none());
4106 /// assert!(x.forward().is_none());
4107 /// assert!(x.abort().is_none());
4108 /// assert!(x.drop().is_none());
4109 /// assert!(x.load_balancer().is_none());
4110 /// assert!(x.network().is_none());
4111 /// assert!(x.gke_master().is_none());
4112 /// assert!(x.gke_pod().is_none());
4113 /// assert!(x.ip_masquerading_skipped().is_none());
4114 /// assert!(x.gke_network_policy().is_none());
4115 /// assert!(x.gke_network_policy_skipped().is_none());
4116 /// assert!(x.cloud_sql_instance().is_none());
4117 /// assert!(x.redis_instance().is_none());
4118 /// assert!(x.redis_cluster().is_none());
4119 /// assert!(x.cloud_function().is_none());
4120 /// assert!(x.app_engine_version().is_none());
4121 /// assert!(x.cloud_run_revision().is_none());
4122 /// assert!(x.nat().is_none());
4123 /// assert!(x.proxy_connection().is_none());
4124 /// assert!(x.load_balancer_backend_info().is_none());
4125 /// assert!(x.storage_bucket().is_none());
4126 /// assert!(x.serverless_neg().is_none());
4127 /// assert!(x.ngfw_packet_inspection().is_none());
4128 /// ```
4129 pub fn set_vpn_tunnel<T: std::convert::Into<std::boxed::Box<crate::model::VpnTunnelInfo>>>(
4130 mut self,
4131 v: T,
4132 ) -> Self {
4133 self.step_info =
4134 std::option::Option::Some(crate::model::step::StepInfo::VpnTunnel(v.into()));
4135 self
4136 }
4137
4138 /// The value of [step_info][crate::model::Step::step_info]
4139 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
4140 /// holds a different branch.
4141 pub fn interconnect_attachment(
4142 &self,
4143 ) -> std::option::Option<&std::boxed::Box<crate::model::InterconnectAttachmentInfo>> {
4144 #[allow(unreachable_patterns)]
4145 self.step_info.as_ref().and_then(|v| match v {
4146 crate::model::step::StepInfo::InterconnectAttachment(v) => std::option::Option::Some(v),
4147 _ => std::option::Option::None,
4148 })
4149 }
4150
4151 /// Sets the value of [step_info][crate::model::Step::step_info]
4152 /// to hold a `InterconnectAttachment`.
4153 ///
4154 /// Note that all the setters affecting `step_info` are
4155 /// mutually exclusive.
4156 ///
4157 /// # Example
4158 /// ```ignore,no_run
4159 /// # use google_cloud_networkmanagement_v1::model::Step;
4160 /// use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
4161 /// let x = Step::new().set_interconnect_attachment(InterconnectAttachmentInfo::default()/* use setters */);
4162 /// assert!(x.interconnect_attachment().is_some());
4163 /// assert!(x.instance().is_none());
4164 /// assert!(x.firewall().is_none());
4165 /// assert!(x.route().is_none());
4166 /// assert!(x.endpoint().is_none());
4167 /// assert!(x.google_service().is_none());
4168 /// assert!(x.forwarding_rule().is_none());
4169 /// assert!(x.hybrid_subnet().is_none());
4170 /// assert!(x.vpn_gateway().is_none());
4171 /// assert!(x.vpn_tunnel().is_none());
4172 /// assert!(x.vpc_connector().is_none());
4173 /// assert!(x.direct_vpc_egress_connection().is_none());
4174 /// assert!(x.serverless_external_connection().is_none());
4175 /// assert!(x.deliver().is_none());
4176 /// assert!(x.forward().is_none());
4177 /// assert!(x.abort().is_none());
4178 /// assert!(x.drop().is_none());
4179 /// assert!(x.load_balancer().is_none());
4180 /// assert!(x.network().is_none());
4181 /// assert!(x.gke_master().is_none());
4182 /// assert!(x.gke_pod().is_none());
4183 /// assert!(x.ip_masquerading_skipped().is_none());
4184 /// assert!(x.gke_network_policy().is_none());
4185 /// assert!(x.gke_network_policy_skipped().is_none());
4186 /// assert!(x.cloud_sql_instance().is_none());
4187 /// assert!(x.redis_instance().is_none());
4188 /// assert!(x.redis_cluster().is_none());
4189 /// assert!(x.cloud_function().is_none());
4190 /// assert!(x.app_engine_version().is_none());
4191 /// assert!(x.cloud_run_revision().is_none());
4192 /// assert!(x.nat().is_none());
4193 /// assert!(x.proxy_connection().is_none());
4194 /// assert!(x.load_balancer_backend_info().is_none());
4195 /// assert!(x.storage_bucket().is_none());
4196 /// assert!(x.serverless_neg().is_none());
4197 /// assert!(x.ngfw_packet_inspection().is_none());
4198 /// ```
4199 pub fn set_interconnect_attachment<
4200 T: std::convert::Into<std::boxed::Box<crate::model::InterconnectAttachmentInfo>>,
4201 >(
4202 mut self,
4203 v: T,
4204 ) -> Self {
4205 self.step_info = std::option::Option::Some(
4206 crate::model::step::StepInfo::InterconnectAttachment(v.into()),
4207 );
4208 self
4209 }
4210
4211 /// The value of [step_info][crate::model::Step::step_info]
4212 /// if it holds a `VpcConnector`, `None` if the field is not set or
4213 /// holds a different branch.
4214 pub fn vpc_connector(
4215 &self,
4216 ) -> std::option::Option<&std::boxed::Box<crate::model::VpcConnectorInfo>> {
4217 #[allow(unreachable_patterns)]
4218 self.step_info.as_ref().and_then(|v| match v {
4219 crate::model::step::StepInfo::VpcConnector(v) => std::option::Option::Some(v),
4220 _ => std::option::Option::None,
4221 })
4222 }
4223
4224 /// Sets the value of [step_info][crate::model::Step::step_info]
4225 /// to hold a `VpcConnector`.
4226 ///
4227 /// Note that all the setters affecting `step_info` are
4228 /// mutually exclusive.
4229 ///
4230 /// # Example
4231 /// ```ignore,no_run
4232 /// # use google_cloud_networkmanagement_v1::model::Step;
4233 /// use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
4234 /// let x = Step::new().set_vpc_connector(VpcConnectorInfo::default()/* use setters */);
4235 /// assert!(x.vpc_connector().is_some());
4236 /// assert!(x.instance().is_none());
4237 /// assert!(x.firewall().is_none());
4238 /// assert!(x.route().is_none());
4239 /// assert!(x.endpoint().is_none());
4240 /// assert!(x.google_service().is_none());
4241 /// assert!(x.forwarding_rule().is_none());
4242 /// assert!(x.hybrid_subnet().is_none());
4243 /// assert!(x.vpn_gateway().is_none());
4244 /// assert!(x.vpn_tunnel().is_none());
4245 /// assert!(x.interconnect_attachment().is_none());
4246 /// assert!(x.direct_vpc_egress_connection().is_none());
4247 /// assert!(x.serverless_external_connection().is_none());
4248 /// assert!(x.deliver().is_none());
4249 /// assert!(x.forward().is_none());
4250 /// assert!(x.abort().is_none());
4251 /// assert!(x.drop().is_none());
4252 /// assert!(x.load_balancer().is_none());
4253 /// assert!(x.network().is_none());
4254 /// assert!(x.gke_master().is_none());
4255 /// assert!(x.gke_pod().is_none());
4256 /// assert!(x.ip_masquerading_skipped().is_none());
4257 /// assert!(x.gke_network_policy().is_none());
4258 /// assert!(x.gke_network_policy_skipped().is_none());
4259 /// assert!(x.cloud_sql_instance().is_none());
4260 /// assert!(x.redis_instance().is_none());
4261 /// assert!(x.redis_cluster().is_none());
4262 /// assert!(x.cloud_function().is_none());
4263 /// assert!(x.app_engine_version().is_none());
4264 /// assert!(x.cloud_run_revision().is_none());
4265 /// assert!(x.nat().is_none());
4266 /// assert!(x.proxy_connection().is_none());
4267 /// assert!(x.load_balancer_backend_info().is_none());
4268 /// assert!(x.storage_bucket().is_none());
4269 /// assert!(x.serverless_neg().is_none());
4270 /// assert!(x.ngfw_packet_inspection().is_none());
4271 /// ```
4272 pub fn set_vpc_connector<
4273 T: std::convert::Into<std::boxed::Box<crate::model::VpcConnectorInfo>>,
4274 >(
4275 mut self,
4276 v: T,
4277 ) -> Self {
4278 self.step_info =
4279 std::option::Option::Some(crate::model::step::StepInfo::VpcConnector(v.into()));
4280 self
4281 }
4282
4283 /// The value of [step_info][crate::model::Step::step_info]
4284 /// if it holds a `DirectVpcEgressConnection`, `None` if the field is not set or
4285 /// holds a different branch.
4286 pub fn direct_vpc_egress_connection(
4287 &self,
4288 ) -> std::option::Option<&std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>> {
4289 #[allow(unreachable_patterns)]
4290 self.step_info.as_ref().and_then(|v| match v {
4291 crate::model::step::StepInfo::DirectVpcEgressConnection(v) => {
4292 std::option::Option::Some(v)
4293 }
4294 _ => std::option::Option::None,
4295 })
4296 }
4297
4298 /// Sets the value of [step_info][crate::model::Step::step_info]
4299 /// to hold a `DirectVpcEgressConnection`.
4300 ///
4301 /// Note that all the setters affecting `step_info` are
4302 /// mutually exclusive.
4303 ///
4304 /// # Example
4305 /// ```ignore,no_run
4306 /// # use google_cloud_networkmanagement_v1::model::Step;
4307 /// use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
4308 /// let x = Step::new().set_direct_vpc_egress_connection(DirectVpcEgressConnectionInfo::default()/* use setters */);
4309 /// assert!(x.direct_vpc_egress_connection().is_some());
4310 /// assert!(x.instance().is_none());
4311 /// assert!(x.firewall().is_none());
4312 /// assert!(x.route().is_none());
4313 /// assert!(x.endpoint().is_none());
4314 /// assert!(x.google_service().is_none());
4315 /// assert!(x.forwarding_rule().is_none());
4316 /// assert!(x.hybrid_subnet().is_none());
4317 /// assert!(x.vpn_gateway().is_none());
4318 /// assert!(x.vpn_tunnel().is_none());
4319 /// assert!(x.interconnect_attachment().is_none());
4320 /// assert!(x.vpc_connector().is_none());
4321 /// assert!(x.serverless_external_connection().is_none());
4322 /// assert!(x.deliver().is_none());
4323 /// assert!(x.forward().is_none());
4324 /// assert!(x.abort().is_none());
4325 /// assert!(x.drop().is_none());
4326 /// assert!(x.load_balancer().is_none());
4327 /// assert!(x.network().is_none());
4328 /// assert!(x.gke_master().is_none());
4329 /// assert!(x.gke_pod().is_none());
4330 /// assert!(x.ip_masquerading_skipped().is_none());
4331 /// assert!(x.gke_network_policy().is_none());
4332 /// assert!(x.gke_network_policy_skipped().is_none());
4333 /// assert!(x.cloud_sql_instance().is_none());
4334 /// assert!(x.redis_instance().is_none());
4335 /// assert!(x.redis_cluster().is_none());
4336 /// assert!(x.cloud_function().is_none());
4337 /// assert!(x.app_engine_version().is_none());
4338 /// assert!(x.cloud_run_revision().is_none());
4339 /// assert!(x.nat().is_none());
4340 /// assert!(x.proxy_connection().is_none());
4341 /// assert!(x.load_balancer_backend_info().is_none());
4342 /// assert!(x.storage_bucket().is_none());
4343 /// assert!(x.serverless_neg().is_none());
4344 /// assert!(x.ngfw_packet_inspection().is_none());
4345 /// ```
4346 pub fn set_direct_vpc_egress_connection<
4347 T: std::convert::Into<std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>>,
4348 >(
4349 mut self,
4350 v: T,
4351 ) -> Self {
4352 self.step_info = std::option::Option::Some(
4353 crate::model::step::StepInfo::DirectVpcEgressConnection(v.into()),
4354 );
4355 self
4356 }
4357
4358 /// The value of [step_info][crate::model::Step::step_info]
4359 /// if it holds a `ServerlessExternalConnection`, `None` if the field is not set or
4360 /// holds a different branch.
4361 pub fn serverless_external_connection(
4362 &self,
4363 ) -> std::option::Option<&std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>> {
4364 #[allow(unreachable_patterns)]
4365 self.step_info.as_ref().and_then(|v| match v {
4366 crate::model::step::StepInfo::ServerlessExternalConnection(v) => {
4367 std::option::Option::Some(v)
4368 }
4369 _ => std::option::Option::None,
4370 })
4371 }
4372
4373 /// Sets the value of [step_info][crate::model::Step::step_info]
4374 /// to hold a `ServerlessExternalConnection`.
4375 ///
4376 /// Note that all the setters affecting `step_info` are
4377 /// mutually exclusive.
4378 ///
4379 /// # Example
4380 /// ```ignore,no_run
4381 /// # use google_cloud_networkmanagement_v1::model::Step;
4382 /// use google_cloud_networkmanagement_v1::model::ServerlessExternalConnectionInfo;
4383 /// let x = Step::new().set_serverless_external_connection(ServerlessExternalConnectionInfo::default()/* use setters */);
4384 /// assert!(x.serverless_external_connection().is_some());
4385 /// assert!(x.instance().is_none());
4386 /// assert!(x.firewall().is_none());
4387 /// assert!(x.route().is_none());
4388 /// assert!(x.endpoint().is_none());
4389 /// assert!(x.google_service().is_none());
4390 /// assert!(x.forwarding_rule().is_none());
4391 /// assert!(x.hybrid_subnet().is_none());
4392 /// assert!(x.vpn_gateway().is_none());
4393 /// assert!(x.vpn_tunnel().is_none());
4394 /// assert!(x.interconnect_attachment().is_none());
4395 /// assert!(x.vpc_connector().is_none());
4396 /// assert!(x.direct_vpc_egress_connection().is_none());
4397 /// assert!(x.deliver().is_none());
4398 /// assert!(x.forward().is_none());
4399 /// assert!(x.abort().is_none());
4400 /// assert!(x.drop().is_none());
4401 /// assert!(x.load_balancer().is_none());
4402 /// assert!(x.network().is_none());
4403 /// assert!(x.gke_master().is_none());
4404 /// assert!(x.gke_pod().is_none());
4405 /// assert!(x.ip_masquerading_skipped().is_none());
4406 /// assert!(x.gke_network_policy().is_none());
4407 /// assert!(x.gke_network_policy_skipped().is_none());
4408 /// assert!(x.cloud_sql_instance().is_none());
4409 /// assert!(x.redis_instance().is_none());
4410 /// assert!(x.redis_cluster().is_none());
4411 /// assert!(x.cloud_function().is_none());
4412 /// assert!(x.app_engine_version().is_none());
4413 /// assert!(x.cloud_run_revision().is_none());
4414 /// assert!(x.nat().is_none());
4415 /// assert!(x.proxy_connection().is_none());
4416 /// assert!(x.load_balancer_backend_info().is_none());
4417 /// assert!(x.storage_bucket().is_none());
4418 /// assert!(x.serverless_neg().is_none());
4419 /// assert!(x.ngfw_packet_inspection().is_none());
4420 /// ```
4421 pub fn set_serverless_external_connection<
4422 T: std::convert::Into<std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>>,
4423 >(
4424 mut self,
4425 v: T,
4426 ) -> Self {
4427 self.step_info = std::option::Option::Some(
4428 crate::model::step::StepInfo::ServerlessExternalConnection(v.into()),
4429 );
4430 self
4431 }
4432
4433 /// The value of [step_info][crate::model::Step::step_info]
4434 /// if it holds a `Deliver`, `None` if the field is not set or
4435 /// holds a different branch.
4436 pub fn deliver(&self) -> std::option::Option<&std::boxed::Box<crate::model::DeliverInfo>> {
4437 #[allow(unreachable_patterns)]
4438 self.step_info.as_ref().and_then(|v| match v {
4439 crate::model::step::StepInfo::Deliver(v) => std::option::Option::Some(v),
4440 _ => std::option::Option::None,
4441 })
4442 }
4443
4444 /// Sets the value of [step_info][crate::model::Step::step_info]
4445 /// to hold a `Deliver`.
4446 ///
4447 /// Note that all the setters affecting `step_info` are
4448 /// mutually exclusive.
4449 ///
4450 /// # Example
4451 /// ```ignore,no_run
4452 /// # use google_cloud_networkmanagement_v1::model::Step;
4453 /// use google_cloud_networkmanagement_v1::model::DeliverInfo;
4454 /// let x = Step::new().set_deliver(DeliverInfo::default()/* use setters */);
4455 /// assert!(x.deliver().is_some());
4456 /// assert!(x.instance().is_none());
4457 /// assert!(x.firewall().is_none());
4458 /// assert!(x.route().is_none());
4459 /// assert!(x.endpoint().is_none());
4460 /// assert!(x.google_service().is_none());
4461 /// assert!(x.forwarding_rule().is_none());
4462 /// assert!(x.hybrid_subnet().is_none());
4463 /// assert!(x.vpn_gateway().is_none());
4464 /// assert!(x.vpn_tunnel().is_none());
4465 /// assert!(x.interconnect_attachment().is_none());
4466 /// assert!(x.vpc_connector().is_none());
4467 /// assert!(x.direct_vpc_egress_connection().is_none());
4468 /// assert!(x.serverless_external_connection().is_none());
4469 /// assert!(x.forward().is_none());
4470 /// assert!(x.abort().is_none());
4471 /// assert!(x.drop().is_none());
4472 /// assert!(x.load_balancer().is_none());
4473 /// assert!(x.network().is_none());
4474 /// assert!(x.gke_master().is_none());
4475 /// assert!(x.gke_pod().is_none());
4476 /// assert!(x.ip_masquerading_skipped().is_none());
4477 /// assert!(x.gke_network_policy().is_none());
4478 /// assert!(x.gke_network_policy_skipped().is_none());
4479 /// assert!(x.cloud_sql_instance().is_none());
4480 /// assert!(x.redis_instance().is_none());
4481 /// assert!(x.redis_cluster().is_none());
4482 /// assert!(x.cloud_function().is_none());
4483 /// assert!(x.app_engine_version().is_none());
4484 /// assert!(x.cloud_run_revision().is_none());
4485 /// assert!(x.nat().is_none());
4486 /// assert!(x.proxy_connection().is_none());
4487 /// assert!(x.load_balancer_backend_info().is_none());
4488 /// assert!(x.storage_bucket().is_none());
4489 /// assert!(x.serverless_neg().is_none());
4490 /// assert!(x.ngfw_packet_inspection().is_none());
4491 /// ```
4492 pub fn set_deliver<T: std::convert::Into<std::boxed::Box<crate::model::DeliverInfo>>>(
4493 mut self,
4494 v: T,
4495 ) -> Self {
4496 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Deliver(v.into()));
4497 self
4498 }
4499
4500 /// The value of [step_info][crate::model::Step::step_info]
4501 /// if it holds a `Forward`, `None` if the field is not set or
4502 /// holds a different branch.
4503 pub fn forward(&self) -> std::option::Option<&std::boxed::Box<crate::model::ForwardInfo>> {
4504 #[allow(unreachable_patterns)]
4505 self.step_info.as_ref().and_then(|v| match v {
4506 crate::model::step::StepInfo::Forward(v) => std::option::Option::Some(v),
4507 _ => std::option::Option::None,
4508 })
4509 }
4510
4511 /// Sets the value of [step_info][crate::model::Step::step_info]
4512 /// to hold a `Forward`.
4513 ///
4514 /// Note that all the setters affecting `step_info` are
4515 /// mutually exclusive.
4516 ///
4517 /// # Example
4518 /// ```ignore,no_run
4519 /// # use google_cloud_networkmanagement_v1::model::Step;
4520 /// use google_cloud_networkmanagement_v1::model::ForwardInfo;
4521 /// let x = Step::new().set_forward(ForwardInfo::default()/* use setters */);
4522 /// assert!(x.forward().is_some());
4523 /// assert!(x.instance().is_none());
4524 /// assert!(x.firewall().is_none());
4525 /// assert!(x.route().is_none());
4526 /// assert!(x.endpoint().is_none());
4527 /// assert!(x.google_service().is_none());
4528 /// assert!(x.forwarding_rule().is_none());
4529 /// assert!(x.hybrid_subnet().is_none());
4530 /// assert!(x.vpn_gateway().is_none());
4531 /// assert!(x.vpn_tunnel().is_none());
4532 /// assert!(x.interconnect_attachment().is_none());
4533 /// assert!(x.vpc_connector().is_none());
4534 /// assert!(x.direct_vpc_egress_connection().is_none());
4535 /// assert!(x.serverless_external_connection().is_none());
4536 /// assert!(x.deliver().is_none());
4537 /// assert!(x.abort().is_none());
4538 /// assert!(x.drop().is_none());
4539 /// assert!(x.load_balancer().is_none());
4540 /// assert!(x.network().is_none());
4541 /// assert!(x.gke_master().is_none());
4542 /// assert!(x.gke_pod().is_none());
4543 /// assert!(x.ip_masquerading_skipped().is_none());
4544 /// assert!(x.gke_network_policy().is_none());
4545 /// assert!(x.gke_network_policy_skipped().is_none());
4546 /// assert!(x.cloud_sql_instance().is_none());
4547 /// assert!(x.redis_instance().is_none());
4548 /// assert!(x.redis_cluster().is_none());
4549 /// assert!(x.cloud_function().is_none());
4550 /// assert!(x.app_engine_version().is_none());
4551 /// assert!(x.cloud_run_revision().is_none());
4552 /// assert!(x.nat().is_none());
4553 /// assert!(x.proxy_connection().is_none());
4554 /// assert!(x.load_balancer_backend_info().is_none());
4555 /// assert!(x.storage_bucket().is_none());
4556 /// assert!(x.serverless_neg().is_none());
4557 /// assert!(x.ngfw_packet_inspection().is_none());
4558 /// ```
4559 pub fn set_forward<T: std::convert::Into<std::boxed::Box<crate::model::ForwardInfo>>>(
4560 mut self,
4561 v: T,
4562 ) -> Self {
4563 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Forward(v.into()));
4564 self
4565 }
4566
4567 /// The value of [step_info][crate::model::Step::step_info]
4568 /// if it holds a `Abort`, `None` if the field is not set or
4569 /// holds a different branch.
4570 pub fn abort(&self) -> std::option::Option<&std::boxed::Box<crate::model::AbortInfo>> {
4571 #[allow(unreachable_patterns)]
4572 self.step_info.as_ref().and_then(|v| match v {
4573 crate::model::step::StepInfo::Abort(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 `Abort`.
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::AbortInfo;
4588 /// let x = Step::new().set_abort(AbortInfo::default()/* use setters */);
4589 /// assert!(x.abort().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.drop().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.gke_network_policy().is_none());
4612 /// assert!(x.gke_network_policy_skipped().is_none());
4613 /// assert!(x.cloud_sql_instance().is_none());
4614 /// assert!(x.redis_instance().is_none());
4615 /// assert!(x.redis_cluster().is_none());
4616 /// assert!(x.cloud_function().is_none());
4617 /// assert!(x.app_engine_version().is_none());
4618 /// assert!(x.cloud_run_revision().is_none());
4619 /// assert!(x.nat().is_none());
4620 /// assert!(x.proxy_connection().is_none());
4621 /// assert!(x.load_balancer_backend_info().is_none());
4622 /// assert!(x.storage_bucket().is_none());
4623 /// assert!(x.serverless_neg().is_none());
4624 /// assert!(x.ngfw_packet_inspection().is_none());
4625 /// ```
4626 pub fn set_abort<T: std::convert::Into<std::boxed::Box<crate::model::AbortInfo>>>(
4627 mut self,
4628 v: T,
4629 ) -> Self {
4630 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Abort(v.into()));
4631 self
4632 }
4633
4634 /// The value of [step_info][crate::model::Step::step_info]
4635 /// if it holds a `Drop`, `None` if the field is not set or
4636 /// holds a different branch.
4637 pub fn drop(&self) -> std::option::Option<&std::boxed::Box<crate::model::DropInfo>> {
4638 #[allow(unreachable_patterns)]
4639 self.step_info.as_ref().and_then(|v| match v {
4640 crate::model::step::StepInfo::Drop(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 `Drop`.
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::DropInfo;
4655 /// let x = Step::new().set_drop(DropInfo::default()/* use setters */);
4656 /// assert!(x.drop().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.load_balancer().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.gke_network_policy().is_none());
4679 /// assert!(x.gke_network_policy_skipped().is_none());
4680 /// assert!(x.cloud_sql_instance().is_none());
4681 /// assert!(x.redis_instance().is_none());
4682 /// assert!(x.redis_cluster().is_none());
4683 /// assert!(x.cloud_function().is_none());
4684 /// assert!(x.app_engine_version().is_none());
4685 /// assert!(x.cloud_run_revision().is_none());
4686 /// assert!(x.nat().is_none());
4687 /// assert!(x.proxy_connection().is_none());
4688 /// assert!(x.load_balancer_backend_info().is_none());
4689 /// assert!(x.storage_bucket().is_none());
4690 /// assert!(x.serverless_neg().is_none());
4691 /// assert!(x.ngfw_packet_inspection().is_none());
4692 /// ```
4693 pub fn set_drop<T: std::convert::Into<std::boxed::Box<crate::model::DropInfo>>>(
4694 mut self,
4695 v: T,
4696 ) -> Self {
4697 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Drop(v.into()));
4698 self
4699 }
4700
4701 /// The value of [step_info][crate::model::Step::step_info]
4702 /// if it holds a `LoadBalancer`, `None` if the field is not set or
4703 /// holds a different branch.
4704 #[deprecated]
4705 pub fn load_balancer(
4706 &self,
4707 ) -> std::option::Option<&std::boxed::Box<crate::model::LoadBalancerInfo>> {
4708 #[allow(unreachable_patterns)]
4709 self.step_info.as_ref().and_then(|v| match v {
4710 crate::model::step::StepInfo::LoadBalancer(v) => std::option::Option::Some(v),
4711 _ => std::option::Option::None,
4712 })
4713 }
4714
4715 /// Sets the value of [step_info][crate::model::Step::step_info]
4716 /// to hold a `LoadBalancer`.
4717 ///
4718 /// Note that all the setters affecting `step_info` are
4719 /// mutually exclusive.
4720 ///
4721 /// # Example
4722 /// ```ignore,no_run
4723 /// # use google_cloud_networkmanagement_v1::model::Step;
4724 /// use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
4725 /// let x = Step::new().set_load_balancer(LoadBalancerInfo::default()/* use setters */);
4726 /// assert!(x.load_balancer().is_some());
4727 /// assert!(x.instance().is_none());
4728 /// assert!(x.firewall().is_none());
4729 /// assert!(x.route().is_none());
4730 /// assert!(x.endpoint().is_none());
4731 /// assert!(x.google_service().is_none());
4732 /// assert!(x.forwarding_rule().is_none());
4733 /// assert!(x.hybrid_subnet().is_none());
4734 /// assert!(x.vpn_gateway().is_none());
4735 /// assert!(x.vpn_tunnel().is_none());
4736 /// assert!(x.interconnect_attachment().is_none());
4737 /// assert!(x.vpc_connector().is_none());
4738 /// assert!(x.direct_vpc_egress_connection().is_none());
4739 /// assert!(x.serverless_external_connection().is_none());
4740 /// assert!(x.deliver().is_none());
4741 /// assert!(x.forward().is_none());
4742 /// assert!(x.abort().is_none());
4743 /// assert!(x.drop().is_none());
4744 /// assert!(x.network().is_none());
4745 /// assert!(x.gke_master().is_none());
4746 /// assert!(x.gke_pod().is_none());
4747 /// assert!(x.ip_masquerading_skipped().is_none());
4748 /// assert!(x.gke_network_policy().is_none());
4749 /// assert!(x.gke_network_policy_skipped().is_none());
4750 /// assert!(x.cloud_sql_instance().is_none());
4751 /// assert!(x.redis_instance().is_none());
4752 /// assert!(x.redis_cluster().is_none());
4753 /// assert!(x.cloud_function().is_none());
4754 /// assert!(x.app_engine_version().is_none());
4755 /// assert!(x.cloud_run_revision().is_none());
4756 /// assert!(x.nat().is_none());
4757 /// assert!(x.proxy_connection().is_none());
4758 /// assert!(x.load_balancer_backend_info().is_none());
4759 /// assert!(x.storage_bucket().is_none());
4760 /// assert!(x.serverless_neg().is_none());
4761 /// assert!(x.ngfw_packet_inspection().is_none());
4762 /// ```
4763 #[deprecated]
4764 pub fn set_load_balancer<
4765 T: std::convert::Into<std::boxed::Box<crate::model::LoadBalancerInfo>>,
4766 >(
4767 mut self,
4768 v: T,
4769 ) -> Self {
4770 self.step_info =
4771 std::option::Option::Some(crate::model::step::StepInfo::LoadBalancer(v.into()));
4772 self
4773 }
4774
4775 /// The value of [step_info][crate::model::Step::step_info]
4776 /// if it holds a `Network`, `None` if the field is not set or
4777 /// holds a different branch.
4778 pub fn network(&self) -> std::option::Option<&std::boxed::Box<crate::model::NetworkInfo>> {
4779 #[allow(unreachable_patterns)]
4780 self.step_info.as_ref().and_then(|v| match v {
4781 crate::model::step::StepInfo::Network(v) => std::option::Option::Some(v),
4782 _ => std::option::Option::None,
4783 })
4784 }
4785
4786 /// Sets the value of [step_info][crate::model::Step::step_info]
4787 /// to hold a `Network`.
4788 ///
4789 /// Note that all the setters affecting `step_info` are
4790 /// mutually exclusive.
4791 ///
4792 /// # Example
4793 /// ```ignore,no_run
4794 /// # use google_cloud_networkmanagement_v1::model::Step;
4795 /// use google_cloud_networkmanagement_v1::model::NetworkInfo;
4796 /// let x = Step::new().set_network(NetworkInfo::default()/* use setters */);
4797 /// assert!(x.network().is_some());
4798 /// assert!(x.instance().is_none());
4799 /// assert!(x.firewall().is_none());
4800 /// assert!(x.route().is_none());
4801 /// assert!(x.endpoint().is_none());
4802 /// assert!(x.google_service().is_none());
4803 /// assert!(x.forwarding_rule().is_none());
4804 /// assert!(x.hybrid_subnet().is_none());
4805 /// assert!(x.vpn_gateway().is_none());
4806 /// assert!(x.vpn_tunnel().is_none());
4807 /// assert!(x.interconnect_attachment().is_none());
4808 /// assert!(x.vpc_connector().is_none());
4809 /// assert!(x.direct_vpc_egress_connection().is_none());
4810 /// assert!(x.serverless_external_connection().is_none());
4811 /// assert!(x.deliver().is_none());
4812 /// assert!(x.forward().is_none());
4813 /// assert!(x.abort().is_none());
4814 /// assert!(x.drop().is_none());
4815 /// assert!(x.load_balancer().is_none());
4816 /// assert!(x.gke_master().is_none());
4817 /// assert!(x.gke_pod().is_none());
4818 /// assert!(x.ip_masquerading_skipped().is_none());
4819 /// assert!(x.gke_network_policy().is_none());
4820 /// assert!(x.gke_network_policy_skipped().is_none());
4821 /// assert!(x.cloud_sql_instance().is_none());
4822 /// assert!(x.redis_instance().is_none());
4823 /// assert!(x.redis_cluster().is_none());
4824 /// assert!(x.cloud_function().is_none());
4825 /// assert!(x.app_engine_version().is_none());
4826 /// assert!(x.cloud_run_revision().is_none());
4827 /// assert!(x.nat().is_none());
4828 /// assert!(x.proxy_connection().is_none());
4829 /// assert!(x.load_balancer_backend_info().is_none());
4830 /// assert!(x.storage_bucket().is_none());
4831 /// assert!(x.serverless_neg().is_none());
4832 /// assert!(x.ngfw_packet_inspection().is_none());
4833 /// ```
4834 pub fn set_network<T: std::convert::Into<std::boxed::Box<crate::model::NetworkInfo>>>(
4835 mut self,
4836 v: T,
4837 ) -> Self {
4838 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Network(v.into()));
4839 self
4840 }
4841
4842 /// The value of [step_info][crate::model::Step::step_info]
4843 /// if it holds a `GkeMaster`, `None` if the field is not set or
4844 /// holds a different branch.
4845 pub fn gke_master(&self) -> std::option::Option<&std::boxed::Box<crate::model::GKEMasterInfo>> {
4846 #[allow(unreachable_patterns)]
4847 self.step_info.as_ref().and_then(|v| match v {
4848 crate::model::step::StepInfo::GkeMaster(v) => std::option::Option::Some(v),
4849 _ => std::option::Option::None,
4850 })
4851 }
4852
4853 /// Sets the value of [step_info][crate::model::Step::step_info]
4854 /// to hold a `GkeMaster`.
4855 ///
4856 /// Note that all the setters affecting `step_info` are
4857 /// mutually exclusive.
4858 ///
4859 /// # Example
4860 /// ```ignore,no_run
4861 /// # use google_cloud_networkmanagement_v1::model::Step;
4862 /// use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
4863 /// let x = Step::new().set_gke_master(GKEMasterInfo::default()/* use setters */);
4864 /// assert!(x.gke_master().is_some());
4865 /// assert!(x.instance().is_none());
4866 /// assert!(x.firewall().is_none());
4867 /// assert!(x.route().is_none());
4868 /// assert!(x.endpoint().is_none());
4869 /// assert!(x.google_service().is_none());
4870 /// assert!(x.forwarding_rule().is_none());
4871 /// assert!(x.hybrid_subnet().is_none());
4872 /// assert!(x.vpn_gateway().is_none());
4873 /// assert!(x.vpn_tunnel().is_none());
4874 /// assert!(x.interconnect_attachment().is_none());
4875 /// assert!(x.vpc_connector().is_none());
4876 /// assert!(x.direct_vpc_egress_connection().is_none());
4877 /// assert!(x.serverless_external_connection().is_none());
4878 /// assert!(x.deliver().is_none());
4879 /// assert!(x.forward().is_none());
4880 /// assert!(x.abort().is_none());
4881 /// assert!(x.drop().is_none());
4882 /// assert!(x.load_balancer().is_none());
4883 /// assert!(x.network().is_none());
4884 /// assert!(x.gke_pod().is_none());
4885 /// assert!(x.ip_masquerading_skipped().is_none());
4886 /// assert!(x.gke_network_policy().is_none());
4887 /// assert!(x.gke_network_policy_skipped().is_none());
4888 /// assert!(x.cloud_sql_instance().is_none());
4889 /// assert!(x.redis_instance().is_none());
4890 /// assert!(x.redis_cluster().is_none());
4891 /// assert!(x.cloud_function().is_none());
4892 /// assert!(x.app_engine_version().is_none());
4893 /// assert!(x.cloud_run_revision().is_none());
4894 /// assert!(x.nat().is_none());
4895 /// assert!(x.proxy_connection().is_none());
4896 /// assert!(x.load_balancer_backend_info().is_none());
4897 /// assert!(x.storage_bucket().is_none());
4898 /// assert!(x.serverless_neg().is_none());
4899 /// assert!(x.ngfw_packet_inspection().is_none());
4900 /// ```
4901 pub fn set_gke_master<T: std::convert::Into<std::boxed::Box<crate::model::GKEMasterInfo>>>(
4902 mut self,
4903 v: T,
4904 ) -> Self {
4905 self.step_info =
4906 std::option::Option::Some(crate::model::step::StepInfo::GkeMaster(v.into()));
4907 self
4908 }
4909
4910 /// The value of [step_info][crate::model::Step::step_info]
4911 /// if it holds a `GkePod`, `None` if the field is not set or
4912 /// holds a different branch.
4913 pub fn gke_pod(&self) -> std::option::Option<&std::boxed::Box<crate::model::GkePodInfo>> {
4914 #[allow(unreachable_patterns)]
4915 self.step_info.as_ref().and_then(|v| match v {
4916 crate::model::step::StepInfo::GkePod(v) => std::option::Option::Some(v),
4917 _ => std::option::Option::None,
4918 })
4919 }
4920
4921 /// Sets the value of [step_info][crate::model::Step::step_info]
4922 /// to hold a `GkePod`.
4923 ///
4924 /// Note that all the setters affecting `step_info` are
4925 /// mutually exclusive.
4926 ///
4927 /// # Example
4928 /// ```ignore,no_run
4929 /// # use google_cloud_networkmanagement_v1::model::Step;
4930 /// use google_cloud_networkmanagement_v1::model::GkePodInfo;
4931 /// let x = Step::new().set_gke_pod(GkePodInfo::default()/* use setters */);
4932 /// assert!(x.gke_pod().is_some());
4933 /// assert!(x.instance().is_none());
4934 /// assert!(x.firewall().is_none());
4935 /// assert!(x.route().is_none());
4936 /// assert!(x.endpoint().is_none());
4937 /// assert!(x.google_service().is_none());
4938 /// assert!(x.forwarding_rule().is_none());
4939 /// assert!(x.hybrid_subnet().is_none());
4940 /// assert!(x.vpn_gateway().is_none());
4941 /// assert!(x.vpn_tunnel().is_none());
4942 /// assert!(x.interconnect_attachment().is_none());
4943 /// assert!(x.vpc_connector().is_none());
4944 /// assert!(x.direct_vpc_egress_connection().is_none());
4945 /// assert!(x.serverless_external_connection().is_none());
4946 /// assert!(x.deliver().is_none());
4947 /// assert!(x.forward().is_none());
4948 /// assert!(x.abort().is_none());
4949 /// assert!(x.drop().is_none());
4950 /// assert!(x.load_balancer().is_none());
4951 /// assert!(x.network().is_none());
4952 /// assert!(x.gke_master().is_none());
4953 /// assert!(x.ip_masquerading_skipped().is_none());
4954 /// assert!(x.gke_network_policy().is_none());
4955 /// assert!(x.gke_network_policy_skipped().is_none());
4956 /// assert!(x.cloud_sql_instance().is_none());
4957 /// assert!(x.redis_instance().is_none());
4958 /// assert!(x.redis_cluster().is_none());
4959 /// assert!(x.cloud_function().is_none());
4960 /// assert!(x.app_engine_version().is_none());
4961 /// assert!(x.cloud_run_revision().is_none());
4962 /// assert!(x.nat().is_none());
4963 /// assert!(x.proxy_connection().is_none());
4964 /// assert!(x.load_balancer_backend_info().is_none());
4965 /// assert!(x.storage_bucket().is_none());
4966 /// assert!(x.serverless_neg().is_none());
4967 /// assert!(x.ngfw_packet_inspection().is_none());
4968 /// ```
4969 pub fn set_gke_pod<T: std::convert::Into<std::boxed::Box<crate::model::GkePodInfo>>>(
4970 mut self,
4971 v: T,
4972 ) -> Self {
4973 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::GkePod(v.into()));
4974 self
4975 }
4976
4977 /// The value of [step_info][crate::model::Step::step_info]
4978 /// if it holds a `IpMasqueradingSkipped`, `None` if the field is not set or
4979 /// holds a different branch.
4980 pub fn ip_masquerading_skipped(
4981 &self,
4982 ) -> std::option::Option<&std::boxed::Box<crate::model::IpMasqueradingSkippedInfo>> {
4983 #[allow(unreachable_patterns)]
4984 self.step_info.as_ref().and_then(|v| match v {
4985 crate::model::step::StepInfo::IpMasqueradingSkipped(v) => std::option::Option::Some(v),
4986 _ => std::option::Option::None,
4987 })
4988 }
4989
4990 /// Sets the value of [step_info][crate::model::Step::step_info]
4991 /// to hold a `IpMasqueradingSkipped`.
4992 ///
4993 /// Note that all the setters affecting `step_info` are
4994 /// mutually exclusive.
4995 ///
4996 /// # Example
4997 /// ```ignore,no_run
4998 /// # use google_cloud_networkmanagement_v1::model::Step;
4999 /// use google_cloud_networkmanagement_v1::model::IpMasqueradingSkippedInfo;
5000 /// let x = Step::new().set_ip_masquerading_skipped(IpMasqueradingSkippedInfo::default()/* use setters */);
5001 /// assert!(x.ip_masquerading_skipped().is_some());
5002 /// assert!(x.instance().is_none());
5003 /// assert!(x.firewall().is_none());
5004 /// assert!(x.route().is_none());
5005 /// assert!(x.endpoint().is_none());
5006 /// assert!(x.google_service().is_none());
5007 /// assert!(x.forwarding_rule().is_none());
5008 /// assert!(x.hybrid_subnet().is_none());
5009 /// assert!(x.vpn_gateway().is_none());
5010 /// assert!(x.vpn_tunnel().is_none());
5011 /// assert!(x.interconnect_attachment().is_none());
5012 /// assert!(x.vpc_connector().is_none());
5013 /// assert!(x.direct_vpc_egress_connection().is_none());
5014 /// assert!(x.serverless_external_connection().is_none());
5015 /// assert!(x.deliver().is_none());
5016 /// assert!(x.forward().is_none());
5017 /// assert!(x.abort().is_none());
5018 /// assert!(x.drop().is_none());
5019 /// assert!(x.load_balancer().is_none());
5020 /// assert!(x.network().is_none());
5021 /// assert!(x.gke_master().is_none());
5022 /// assert!(x.gke_pod().is_none());
5023 /// assert!(x.gke_network_policy().is_none());
5024 /// assert!(x.gke_network_policy_skipped().is_none());
5025 /// assert!(x.cloud_sql_instance().is_none());
5026 /// assert!(x.redis_instance().is_none());
5027 /// assert!(x.redis_cluster().is_none());
5028 /// assert!(x.cloud_function().is_none());
5029 /// assert!(x.app_engine_version().is_none());
5030 /// assert!(x.cloud_run_revision().is_none());
5031 /// assert!(x.nat().is_none());
5032 /// assert!(x.proxy_connection().is_none());
5033 /// assert!(x.load_balancer_backend_info().is_none());
5034 /// assert!(x.storage_bucket().is_none());
5035 /// assert!(x.serverless_neg().is_none());
5036 /// assert!(x.ngfw_packet_inspection().is_none());
5037 /// ```
5038 pub fn set_ip_masquerading_skipped<
5039 T: std::convert::Into<std::boxed::Box<crate::model::IpMasqueradingSkippedInfo>>,
5040 >(
5041 mut self,
5042 v: T,
5043 ) -> Self {
5044 self.step_info = std::option::Option::Some(
5045 crate::model::step::StepInfo::IpMasqueradingSkipped(v.into()),
5046 );
5047 self
5048 }
5049
5050 /// The value of [step_info][crate::model::Step::step_info]
5051 /// if it holds a `GkeNetworkPolicy`, `None` if the field is not set or
5052 /// holds a different branch.
5053 pub fn gke_network_policy(
5054 &self,
5055 ) -> std::option::Option<&std::boxed::Box<crate::model::GkeNetworkPolicyInfo>> {
5056 #[allow(unreachable_patterns)]
5057 self.step_info.as_ref().and_then(|v| match v {
5058 crate::model::step::StepInfo::GkeNetworkPolicy(v) => std::option::Option::Some(v),
5059 _ => std::option::Option::None,
5060 })
5061 }
5062
5063 /// Sets the value of [step_info][crate::model::Step::step_info]
5064 /// to hold a `GkeNetworkPolicy`.
5065 ///
5066 /// Note that all the setters affecting `step_info` are
5067 /// mutually exclusive.
5068 ///
5069 /// # Example
5070 /// ```ignore,no_run
5071 /// # use google_cloud_networkmanagement_v1::model::Step;
5072 /// use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
5073 /// let x = Step::new().set_gke_network_policy(GkeNetworkPolicyInfo::default()/* use setters */);
5074 /// assert!(x.gke_network_policy().is_some());
5075 /// assert!(x.instance().is_none());
5076 /// assert!(x.firewall().is_none());
5077 /// assert!(x.route().is_none());
5078 /// assert!(x.endpoint().is_none());
5079 /// assert!(x.google_service().is_none());
5080 /// assert!(x.forwarding_rule().is_none());
5081 /// assert!(x.hybrid_subnet().is_none());
5082 /// assert!(x.vpn_gateway().is_none());
5083 /// assert!(x.vpn_tunnel().is_none());
5084 /// assert!(x.interconnect_attachment().is_none());
5085 /// assert!(x.vpc_connector().is_none());
5086 /// assert!(x.direct_vpc_egress_connection().is_none());
5087 /// assert!(x.serverless_external_connection().is_none());
5088 /// assert!(x.deliver().is_none());
5089 /// assert!(x.forward().is_none());
5090 /// assert!(x.abort().is_none());
5091 /// assert!(x.drop().is_none());
5092 /// assert!(x.load_balancer().is_none());
5093 /// assert!(x.network().is_none());
5094 /// assert!(x.gke_master().is_none());
5095 /// assert!(x.gke_pod().is_none());
5096 /// assert!(x.ip_masquerading_skipped().is_none());
5097 /// assert!(x.gke_network_policy_skipped().is_none());
5098 /// assert!(x.cloud_sql_instance().is_none());
5099 /// assert!(x.redis_instance().is_none());
5100 /// assert!(x.redis_cluster().is_none());
5101 /// assert!(x.cloud_function().is_none());
5102 /// assert!(x.app_engine_version().is_none());
5103 /// assert!(x.cloud_run_revision().is_none());
5104 /// assert!(x.nat().is_none());
5105 /// assert!(x.proxy_connection().is_none());
5106 /// assert!(x.load_balancer_backend_info().is_none());
5107 /// assert!(x.storage_bucket().is_none());
5108 /// assert!(x.serverless_neg().is_none());
5109 /// assert!(x.ngfw_packet_inspection().is_none());
5110 /// ```
5111 pub fn set_gke_network_policy<
5112 T: std::convert::Into<std::boxed::Box<crate::model::GkeNetworkPolicyInfo>>,
5113 >(
5114 mut self,
5115 v: T,
5116 ) -> Self {
5117 self.step_info =
5118 std::option::Option::Some(crate::model::step::StepInfo::GkeNetworkPolicy(v.into()));
5119 self
5120 }
5121
5122 /// The value of [step_info][crate::model::Step::step_info]
5123 /// if it holds a `GkeNetworkPolicySkipped`, `None` if the field is not set or
5124 /// holds a different branch.
5125 pub fn gke_network_policy_skipped(
5126 &self,
5127 ) -> std::option::Option<&std::boxed::Box<crate::model::GkeNetworkPolicySkippedInfo>> {
5128 #[allow(unreachable_patterns)]
5129 self.step_info.as_ref().and_then(|v| match v {
5130 crate::model::step::StepInfo::GkeNetworkPolicySkipped(v) => {
5131 std::option::Option::Some(v)
5132 }
5133 _ => std::option::Option::None,
5134 })
5135 }
5136
5137 /// Sets the value of [step_info][crate::model::Step::step_info]
5138 /// to hold a `GkeNetworkPolicySkipped`.
5139 ///
5140 /// Note that all the setters affecting `step_info` are
5141 /// mutually exclusive.
5142 ///
5143 /// # Example
5144 /// ```ignore,no_run
5145 /// # use google_cloud_networkmanagement_v1::model::Step;
5146 /// use google_cloud_networkmanagement_v1::model::GkeNetworkPolicySkippedInfo;
5147 /// let x = Step::new().set_gke_network_policy_skipped(GkeNetworkPolicySkippedInfo::default()/* use setters */);
5148 /// assert!(x.gke_network_policy_skipped().is_some());
5149 /// assert!(x.instance().is_none());
5150 /// assert!(x.firewall().is_none());
5151 /// assert!(x.route().is_none());
5152 /// assert!(x.endpoint().is_none());
5153 /// assert!(x.google_service().is_none());
5154 /// assert!(x.forwarding_rule().is_none());
5155 /// assert!(x.hybrid_subnet().is_none());
5156 /// assert!(x.vpn_gateway().is_none());
5157 /// assert!(x.vpn_tunnel().is_none());
5158 /// assert!(x.interconnect_attachment().is_none());
5159 /// assert!(x.vpc_connector().is_none());
5160 /// assert!(x.direct_vpc_egress_connection().is_none());
5161 /// assert!(x.serverless_external_connection().is_none());
5162 /// assert!(x.deliver().is_none());
5163 /// assert!(x.forward().is_none());
5164 /// assert!(x.abort().is_none());
5165 /// assert!(x.drop().is_none());
5166 /// assert!(x.load_balancer().is_none());
5167 /// assert!(x.network().is_none());
5168 /// assert!(x.gke_master().is_none());
5169 /// assert!(x.gke_pod().is_none());
5170 /// assert!(x.ip_masquerading_skipped().is_none());
5171 /// assert!(x.gke_network_policy().is_none());
5172 /// assert!(x.cloud_sql_instance().is_none());
5173 /// assert!(x.redis_instance().is_none());
5174 /// assert!(x.redis_cluster().is_none());
5175 /// assert!(x.cloud_function().is_none());
5176 /// assert!(x.app_engine_version().is_none());
5177 /// assert!(x.cloud_run_revision().is_none());
5178 /// assert!(x.nat().is_none());
5179 /// assert!(x.proxy_connection().is_none());
5180 /// assert!(x.load_balancer_backend_info().is_none());
5181 /// assert!(x.storage_bucket().is_none());
5182 /// assert!(x.serverless_neg().is_none());
5183 /// assert!(x.ngfw_packet_inspection().is_none());
5184 /// ```
5185 pub fn set_gke_network_policy_skipped<
5186 T: std::convert::Into<std::boxed::Box<crate::model::GkeNetworkPolicySkippedInfo>>,
5187 >(
5188 mut self,
5189 v: T,
5190 ) -> Self {
5191 self.step_info = std::option::Option::Some(
5192 crate::model::step::StepInfo::GkeNetworkPolicySkipped(v.into()),
5193 );
5194 self
5195 }
5196
5197 /// The value of [step_info][crate::model::Step::step_info]
5198 /// if it holds a `CloudSqlInstance`, `None` if the field is not set or
5199 /// holds a different branch.
5200 pub fn cloud_sql_instance(
5201 &self,
5202 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudSQLInstanceInfo>> {
5203 #[allow(unreachable_patterns)]
5204 self.step_info.as_ref().and_then(|v| match v {
5205 crate::model::step::StepInfo::CloudSqlInstance(v) => std::option::Option::Some(v),
5206 _ => std::option::Option::None,
5207 })
5208 }
5209
5210 /// Sets the value of [step_info][crate::model::Step::step_info]
5211 /// to hold a `CloudSqlInstance`.
5212 ///
5213 /// Note that all the setters affecting `step_info` are
5214 /// mutually exclusive.
5215 ///
5216 /// # Example
5217 /// ```ignore,no_run
5218 /// # use google_cloud_networkmanagement_v1::model::Step;
5219 /// use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
5220 /// let x = Step::new().set_cloud_sql_instance(CloudSQLInstanceInfo::default()/* use setters */);
5221 /// assert!(x.cloud_sql_instance().is_some());
5222 /// assert!(x.instance().is_none());
5223 /// assert!(x.firewall().is_none());
5224 /// assert!(x.route().is_none());
5225 /// assert!(x.endpoint().is_none());
5226 /// assert!(x.google_service().is_none());
5227 /// assert!(x.forwarding_rule().is_none());
5228 /// assert!(x.hybrid_subnet().is_none());
5229 /// assert!(x.vpn_gateway().is_none());
5230 /// assert!(x.vpn_tunnel().is_none());
5231 /// assert!(x.interconnect_attachment().is_none());
5232 /// assert!(x.vpc_connector().is_none());
5233 /// assert!(x.direct_vpc_egress_connection().is_none());
5234 /// assert!(x.serverless_external_connection().is_none());
5235 /// assert!(x.deliver().is_none());
5236 /// assert!(x.forward().is_none());
5237 /// assert!(x.abort().is_none());
5238 /// assert!(x.drop().is_none());
5239 /// assert!(x.load_balancer().is_none());
5240 /// assert!(x.network().is_none());
5241 /// assert!(x.gke_master().is_none());
5242 /// assert!(x.gke_pod().is_none());
5243 /// assert!(x.ip_masquerading_skipped().is_none());
5244 /// assert!(x.gke_network_policy().is_none());
5245 /// assert!(x.gke_network_policy_skipped().is_none());
5246 /// assert!(x.redis_instance().is_none());
5247 /// assert!(x.redis_cluster().is_none());
5248 /// assert!(x.cloud_function().is_none());
5249 /// assert!(x.app_engine_version().is_none());
5250 /// assert!(x.cloud_run_revision().is_none());
5251 /// assert!(x.nat().is_none());
5252 /// assert!(x.proxy_connection().is_none());
5253 /// assert!(x.load_balancer_backend_info().is_none());
5254 /// assert!(x.storage_bucket().is_none());
5255 /// assert!(x.serverless_neg().is_none());
5256 /// assert!(x.ngfw_packet_inspection().is_none());
5257 /// ```
5258 pub fn set_cloud_sql_instance<
5259 T: std::convert::Into<std::boxed::Box<crate::model::CloudSQLInstanceInfo>>,
5260 >(
5261 mut self,
5262 v: T,
5263 ) -> Self {
5264 self.step_info =
5265 std::option::Option::Some(crate::model::step::StepInfo::CloudSqlInstance(v.into()));
5266 self
5267 }
5268
5269 /// The value of [step_info][crate::model::Step::step_info]
5270 /// if it holds a `RedisInstance`, `None` if the field is not set or
5271 /// holds a different branch.
5272 pub fn redis_instance(
5273 &self,
5274 ) -> std::option::Option<&std::boxed::Box<crate::model::RedisInstanceInfo>> {
5275 #[allow(unreachable_patterns)]
5276 self.step_info.as_ref().and_then(|v| match v {
5277 crate::model::step::StepInfo::RedisInstance(v) => std::option::Option::Some(v),
5278 _ => std::option::Option::None,
5279 })
5280 }
5281
5282 /// Sets the value of [step_info][crate::model::Step::step_info]
5283 /// to hold a `RedisInstance`.
5284 ///
5285 /// Note that all the setters affecting `step_info` are
5286 /// mutually exclusive.
5287 ///
5288 /// # Example
5289 /// ```ignore,no_run
5290 /// # use google_cloud_networkmanagement_v1::model::Step;
5291 /// use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
5292 /// let x = Step::new().set_redis_instance(RedisInstanceInfo::default()/* use setters */);
5293 /// assert!(x.redis_instance().is_some());
5294 /// assert!(x.instance().is_none());
5295 /// assert!(x.firewall().is_none());
5296 /// assert!(x.route().is_none());
5297 /// assert!(x.endpoint().is_none());
5298 /// assert!(x.google_service().is_none());
5299 /// assert!(x.forwarding_rule().is_none());
5300 /// assert!(x.hybrid_subnet().is_none());
5301 /// assert!(x.vpn_gateway().is_none());
5302 /// assert!(x.vpn_tunnel().is_none());
5303 /// assert!(x.interconnect_attachment().is_none());
5304 /// assert!(x.vpc_connector().is_none());
5305 /// assert!(x.direct_vpc_egress_connection().is_none());
5306 /// assert!(x.serverless_external_connection().is_none());
5307 /// assert!(x.deliver().is_none());
5308 /// assert!(x.forward().is_none());
5309 /// assert!(x.abort().is_none());
5310 /// assert!(x.drop().is_none());
5311 /// assert!(x.load_balancer().is_none());
5312 /// assert!(x.network().is_none());
5313 /// assert!(x.gke_master().is_none());
5314 /// assert!(x.gke_pod().is_none());
5315 /// assert!(x.ip_masquerading_skipped().is_none());
5316 /// assert!(x.gke_network_policy().is_none());
5317 /// assert!(x.gke_network_policy_skipped().is_none());
5318 /// assert!(x.cloud_sql_instance().is_none());
5319 /// assert!(x.redis_cluster().is_none());
5320 /// assert!(x.cloud_function().is_none());
5321 /// assert!(x.app_engine_version().is_none());
5322 /// assert!(x.cloud_run_revision().is_none());
5323 /// assert!(x.nat().is_none());
5324 /// assert!(x.proxy_connection().is_none());
5325 /// assert!(x.load_balancer_backend_info().is_none());
5326 /// assert!(x.storage_bucket().is_none());
5327 /// assert!(x.serverless_neg().is_none());
5328 /// assert!(x.ngfw_packet_inspection().is_none());
5329 /// ```
5330 pub fn set_redis_instance<
5331 T: std::convert::Into<std::boxed::Box<crate::model::RedisInstanceInfo>>,
5332 >(
5333 mut self,
5334 v: T,
5335 ) -> Self {
5336 self.step_info =
5337 std::option::Option::Some(crate::model::step::StepInfo::RedisInstance(v.into()));
5338 self
5339 }
5340
5341 /// The value of [step_info][crate::model::Step::step_info]
5342 /// if it holds a `RedisCluster`, `None` if the field is not set or
5343 /// holds a different branch.
5344 pub fn redis_cluster(
5345 &self,
5346 ) -> std::option::Option<&std::boxed::Box<crate::model::RedisClusterInfo>> {
5347 #[allow(unreachable_patterns)]
5348 self.step_info.as_ref().and_then(|v| match v {
5349 crate::model::step::StepInfo::RedisCluster(v) => std::option::Option::Some(v),
5350 _ => std::option::Option::None,
5351 })
5352 }
5353
5354 /// Sets the value of [step_info][crate::model::Step::step_info]
5355 /// to hold a `RedisCluster`.
5356 ///
5357 /// Note that all the setters affecting `step_info` are
5358 /// mutually exclusive.
5359 ///
5360 /// # Example
5361 /// ```ignore,no_run
5362 /// # use google_cloud_networkmanagement_v1::model::Step;
5363 /// use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
5364 /// let x = Step::new().set_redis_cluster(RedisClusterInfo::default()/* use setters */);
5365 /// assert!(x.redis_cluster().is_some());
5366 /// assert!(x.instance().is_none());
5367 /// assert!(x.firewall().is_none());
5368 /// assert!(x.route().is_none());
5369 /// assert!(x.endpoint().is_none());
5370 /// assert!(x.google_service().is_none());
5371 /// assert!(x.forwarding_rule().is_none());
5372 /// assert!(x.hybrid_subnet().is_none());
5373 /// assert!(x.vpn_gateway().is_none());
5374 /// assert!(x.vpn_tunnel().is_none());
5375 /// assert!(x.interconnect_attachment().is_none());
5376 /// assert!(x.vpc_connector().is_none());
5377 /// assert!(x.direct_vpc_egress_connection().is_none());
5378 /// assert!(x.serverless_external_connection().is_none());
5379 /// assert!(x.deliver().is_none());
5380 /// assert!(x.forward().is_none());
5381 /// assert!(x.abort().is_none());
5382 /// assert!(x.drop().is_none());
5383 /// assert!(x.load_balancer().is_none());
5384 /// assert!(x.network().is_none());
5385 /// assert!(x.gke_master().is_none());
5386 /// assert!(x.gke_pod().is_none());
5387 /// assert!(x.ip_masquerading_skipped().is_none());
5388 /// assert!(x.gke_network_policy().is_none());
5389 /// assert!(x.gke_network_policy_skipped().is_none());
5390 /// assert!(x.cloud_sql_instance().is_none());
5391 /// assert!(x.redis_instance().is_none());
5392 /// assert!(x.cloud_function().is_none());
5393 /// assert!(x.app_engine_version().is_none());
5394 /// assert!(x.cloud_run_revision().is_none());
5395 /// assert!(x.nat().is_none());
5396 /// assert!(x.proxy_connection().is_none());
5397 /// assert!(x.load_balancer_backend_info().is_none());
5398 /// assert!(x.storage_bucket().is_none());
5399 /// assert!(x.serverless_neg().is_none());
5400 /// assert!(x.ngfw_packet_inspection().is_none());
5401 /// ```
5402 pub fn set_redis_cluster<
5403 T: std::convert::Into<std::boxed::Box<crate::model::RedisClusterInfo>>,
5404 >(
5405 mut self,
5406 v: T,
5407 ) -> Self {
5408 self.step_info =
5409 std::option::Option::Some(crate::model::step::StepInfo::RedisCluster(v.into()));
5410 self
5411 }
5412
5413 /// The value of [step_info][crate::model::Step::step_info]
5414 /// if it holds a `CloudFunction`, `None` if the field is not set or
5415 /// holds a different branch.
5416 pub fn cloud_function(
5417 &self,
5418 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudFunctionInfo>> {
5419 #[allow(unreachable_patterns)]
5420 self.step_info.as_ref().and_then(|v| match v {
5421 crate::model::step::StepInfo::CloudFunction(v) => std::option::Option::Some(v),
5422 _ => std::option::Option::None,
5423 })
5424 }
5425
5426 /// Sets the value of [step_info][crate::model::Step::step_info]
5427 /// to hold a `CloudFunction`.
5428 ///
5429 /// Note that all the setters affecting `step_info` are
5430 /// mutually exclusive.
5431 ///
5432 /// # Example
5433 /// ```ignore,no_run
5434 /// # use google_cloud_networkmanagement_v1::model::Step;
5435 /// use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
5436 /// let x = Step::new().set_cloud_function(CloudFunctionInfo::default()/* use setters */);
5437 /// assert!(x.cloud_function().is_some());
5438 /// assert!(x.instance().is_none());
5439 /// assert!(x.firewall().is_none());
5440 /// assert!(x.route().is_none());
5441 /// assert!(x.endpoint().is_none());
5442 /// assert!(x.google_service().is_none());
5443 /// assert!(x.forwarding_rule().is_none());
5444 /// assert!(x.hybrid_subnet().is_none());
5445 /// assert!(x.vpn_gateway().is_none());
5446 /// assert!(x.vpn_tunnel().is_none());
5447 /// assert!(x.interconnect_attachment().is_none());
5448 /// assert!(x.vpc_connector().is_none());
5449 /// assert!(x.direct_vpc_egress_connection().is_none());
5450 /// assert!(x.serverless_external_connection().is_none());
5451 /// assert!(x.deliver().is_none());
5452 /// assert!(x.forward().is_none());
5453 /// assert!(x.abort().is_none());
5454 /// assert!(x.drop().is_none());
5455 /// assert!(x.load_balancer().is_none());
5456 /// assert!(x.network().is_none());
5457 /// assert!(x.gke_master().is_none());
5458 /// assert!(x.gke_pod().is_none());
5459 /// assert!(x.ip_masquerading_skipped().is_none());
5460 /// assert!(x.gke_network_policy().is_none());
5461 /// assert!(x.gke_network_policy_skipped().is_none());
5462 /// assert!(x.cloud_sql_instance().is_none());
5463 /// assert!(x.redis_instance().is_none());
5464 /// assert!(x.redis_cluster().is_none());
5465 /// assert!(x.app_engine_version().is_none());
5466 /// assert!(x.cloud_run_revision().is_none());
5467 /// assert!(x.nat().is_none());
5468 /// assert!(x.proxy_connection().is_none());
5469 /// assert!(x.load_balancer_backend_info().is_none());
5470 /// assert!(x.storage_bucket().is_none());
5471 /// assert!(x.serverless_neg().is_none());
5472 /// assert!(x.ngfw_packet_inspection().is_none());
5473 /// ```
5474 pub fn set_cloud_function<
5475 T: std::convert::Into<std::boxed::Box<crate::model::CloudFunctionInfo>>,
5476 >(
5477 mut self,
5478 v: T,
5479 ) -> Self {
5480 self.step_info =
5481 std::option::Option::Some(crate::model::step::StepInfo::CloudFunction(v.into()));
5482 self
5483 }
5484
5485 /// The value of [step_info][crate::model::Step::step_info]
5486 /// if it holds a `AppEngineVersion`, `None` if the field is not set or
5487 /// holds a different branch.
5488 pub fn app_engine_version(
5489 &self,
5490 ) -> std::option::Option<&std::boxed::Box<crate::model::AppEngineVersionInfo>> {
5491 #[allow(unreachable_patterns)]
5492 self.step_info.as_ref().and_then(|v| match v {
5493 crate::model::step::StepInfo::AppEngineVersion(v) => std::option::Option::Some(v),
5494 _ => std::option::Option::None,
5495 })
5496 }
5497
5498 /// Sets the value of [step_info][crate::model::Step::step_info]
5499 /// to hold a `AppEngineVersion`.
5500 ///
5501 /// Note that all the setters affecting `step_info` are
5502 /// mutually exclusive.
5503 ///
5504 /// # Example
5505 /// ```ignore,no_run
5506 /// # use google_cloud_networkmanagement_v1::model::Step;
5507 /// use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
5508 /// let x = Step::new().set_app_engine_version(AppEngineVersionInfo::default()/* use setters */);
5509 /// assert!(x.app_engine_version().is_some());
5510 /// assert!(x.instance().is_none());
5511 /// assert!(x.firewall().is_none());
5512 /// assert!(x.route().is_none());
5513 /// assert!(x.endpoint().is_none());
5514 /// assert!(x.google_service().is_none());
5515 /// assert!(x.forwarding_rule().is_none());
5516 /// assert!(x.hybrid_subnet().is_none());
5517 /// assert!(x.vpn_gateway().is_none());
5518 /// assert!(x.vpn_tunnel().is_none());
5519 /// assert!(x.interconnect_attachment().is_none());
5520 /// assert!(x.vpc_connector().is_none());
5521 /// assert!(x.direct_vpc_egress_connection().is_none());
5522 /// assert!(x.serverless_external_connection().is_none());
5523 /// assert!(x.deliver().is_none());
5524 /// assert!(x.forward().is_none());
5525 /// assert!(x.abort().is_none());
5526 /// assert!(x.drop().is_none());
5527 /// assert!(x.load_balancer().is_none());
5528 /// assert!(x.network().is_none());
5529 /// assert!(x.gke_master().is_none());
5530 /// assert!(x.gke_pod().is_none());
5531 /// assert!(x.ip_masquerading_skipped().is_none());
5532 /// assert!(x.gke_network_policy().is_none());
5533 /// assert!(x.gke_network_policy_skipped().is_none());
5534 /// assert!(x.cloud_sql_instance().is_none());
5535 /// assert!(x.redis_instance().is_none());
5536 /// assert!(x.redis_cluster().is_none());
5537 /// assert!(x.cloud_function().is_none());
5538 /// assert!(x.cloud_run_revision().is_none());
5539 /// assert!(x.nat().is_none());
5540 /// assert!(x.proxy_connection().is_none());
5541 /// assert!(x.load_balancer_backend_info().is_none());
5542 /// assert!(x.storage_bucket().is_none());
5543 /// assert!(x.serverless_neg().is_none());
5544 /// assert!(x.ngfw_packet_inspection().is_none());
5545 /// ```
5546 pub fn set_app_engine_version<
5547 T: std::convert::Into<std::boxed::Box<crate::model::AppEngineVersionInfo>>,
5548 >(
5549 mut self,
5550 v: T,
5551 ) -> Self {
5552 self.step_info =
5553 std::option::Option::Some(crate::model::step::StepInfo::AppEngineVersion(v.into()));
5554 self
5555 }
5556
5557 /// The value of [step_info][crate::model::Step::step_info]
5558 /// if it holds a `CloudRunRevision`, `None` if the field is not set or
5559 /// holds a different branch.
5560 pub fn cloud_run_revision(
5561 &self,
5562 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunRevisionInfo>> {
5563 #[allow(unreachable_patterns)]
5564 self.step_info.as_ref().and_then(|v| match v {
5565 crate::model::step::StepInfo::CloudRunRevision(v) => std::option::Option::Some(v),
5566 _ => std::option::Option::None,
5567 })
5568 }
5569
5570 /// Sets the value of [step_info][crate::model::Step::step_info]
5571 /// to hold a `CloudRunRevision`.
5572 ///
5573 /// Note that all the setters affecting `step_info` are
5574 /// mutually exclusive.
5575 ///
5576 /// # Example
5577 /// ```ignore,no_run
5578 /// # use google_cloud_networkmanagement_v1::model::Step;
5579 /// use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
5580 /// let x = Step::new().set_cloud_run_revision(CloudRunRevisionInfo::default()/* use setters */);
5581 /// assert!(x.cloud_run_revision().is_some());
5582 /// assert!(x.instance().is_none());
5583 /// assert!(x.firewall().is_none());
5584 /// assert!(x.route().is_none());
5585 /// assert!(x.endpoint().is_none());
5586 /// assert!(x.google_service().is_none());
5587 /// assert!(x.forwarding_rule().is_none());
5588 /// assert!(x.hybrid_subnet().is_none());
5589 /// assert!(x.vpn_gateway().is_none());
5590 /// assert!(x.vpn_tunnel().is_none());
5591 /// assert!(x.interconnect_attachment().is_none());
5592 /// assert!(x.vpc_connector().is_none());
5593 /// assert!(x.direct_vpc_egress_connection().is_none());
5594 /// assert!(x.serverless_external_connection().is_none());
5595 /// assert!(x.deliver().is_none());
5596 /// assert!(x.forward().is_none());
5597 /// assert!(x.abort().is_none());
5598 /// assert!(x.drop().is_none());
5599 /// assert!(x.load_balancer().is_none());
5600 /// assert!(x.network().is_none());
5601 /// assert!(x.gke_master().is_none());
5602 /// assert!(x.gke_pod().is_none());
5603 /// assert!(x.ip_masquerading_skipped().is_none());
5604 /// assert!(x.gke_network_policy().is_none());
5605 /// assert!(x.gke_network_policy_skipped().is_none());
5606 /// assert!(x.cloud_sql_instance().is_none());
5607 /// assert!(x.redis_instance().is_none());
5608 /// assert!(x.redis_cluster().is_none());
5609 /// assert!(x.cloud_function().is_none());
5610 /// assert!(x.app_engine_version().is_none());
5611 /// assert!(x.nat().is_none());
5612 /// assert!(x.proxy_connection().is_none());
5613 /// assert!(x.load_balancer_backend_info().is_none());
5614 /// assert!(x.storage_bucket().is_none());
5615 /// assert!(x.serverless_neg().is_none());
5616 /// assert!(x.ngfw_packet_inspection().is_none());
5617 /// ```
5618 pub fn set_cloud_run_revision<
5619 T: std::convert::Into<std::boxed::Box<crate::model::CloudRunRevisionInfo>>,
5620 >(
5621 mut self,
5622 v: T,
5623 ) -> Self {
5624 self.step_info =
5625 std::option::Option::Some(crate::model::step::StepInfo::CloudRunRevision(v.into()));
5626 self
5627 }
5628
5629 /// The value of [step_info][crate::model::Step::step_info]
5630 /// if it holds a `Nat`, `None` if the field is not set or
5631 /// holds a different branch.
5632 pub fn nat(&self) -> std::option::Option<&std::boxed::Box<crate::model::NatInfo>> {
5633 #[allow(unreachable_patterns)]
5634 self.step_info.as_ref().and_then(|v| match v {
5635 crate::model::step::StepInfo::Nat(v) => std::option::Option::Some(v),
5636 _ => std::option::Option::None,
5637 })
5638 }
5639
5640 /// Sets the value of [step_info][crate::model::Step::step_info]
5641 /// to hold a `Nat`.
5642 ///
5643 /// Note that all the setters affecting `step_info` are
5644 /// mutually exclusive.
5645 ///
5646 /// # Example
5647 /// ```ignore,no_run
5648 /// # use google_cloud_networkmanagement_v1::model::Step;
5649 /// use google_cloud_networkmanagement_v1::model::NatInfo;
5650 /// let x = Step::new().set_nat(NatInfo::default()/* use setters */);
5651 /// assert!(x.nat().is_some());
5652 /// assert!(x.instance().is_none());
5653 /// assert!(x.firewall().is_none());
5654 /// assert!(x.route().is_none());
5655 /// assert!(x.endpoint().is_none());
5656 /// assert!(x.google_service().is_none());
5657 /// assert!(x.forwarding_rule().is_none());
5658 /// assert!(x.hybrid_subnet().is_none());
5659 /// assert!(x.vpn_gateway().is_none());
5660 /// assert!(x.vpn_tunnel().is_none());
5661 /// assert!(x.interconnect_attachment().is_none());
5662 /// assert!(x.vpc_connector().is_none());
5663 /// assert!(x.direct_vpc_egress_connection().is_none());
5664 /// assert!(x.serverless_external_connection().is_none());
5665 /// assert!(x.deliver().is_none());
5666 /// assert!(x.forward().is_none());
5667 /// assert!(x.abort().is_none());
5668 /// assert!(x.drop().is_none());
5669 /// assert!(x.load_balancer().is_none());
5670 /// assert!(x.network().is_none());
5671 /// assert!(x.gke_master().is_none());
5672 /// assert!(x.gke_pod().is_none());
5673 /// assert!(x.ip_masquerading_skipped().is_none());
5674 /// assert!(x.gke_network_policy().is_none());
5675 /// assert!(x.gke_network_policy_skipped().is_none());
5676 /// assert!(x.cloud_sql_instance().is_none());
5677 /// assert!(x.redis_instance().is_none());
5678 /// assert!(x.redis_cluster().is_none());
5679 /// assert!(x.cloud_function().is_none());
5680 /// assert!(x.app_engine_version().is_none());
5681 /// assert!(x.cloud_run_revision().is_none());
5682 /// assert!(x.proxy_connection().is_none());
5683 /// assert!(x.load_balancer_backend_info().is_none());
5684 /// assert!(x.storage_bucket().is_none());
5685 /// assert!(x.serverless_neg().is_none());
5686 /// assert!(x.ngfw_packet_inspection().is_none());
5687 /// ```
5688 pub fn set_nat<T: std::convert::Into<std::boxed::Box<crate::model::NatInfo>>>(
5689 mut self,
5690 v: T,
5691 ) -> Self {
5692 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Nat(v.into()));
5693 self
5694 }
5695
5696 /// The value of [step_info][crate::model::Step::step_info]
5697 /// if it holds a `ProxyConnection`, `None` if the field is not set or
5698 /// holds a different branch.
5699 pub fn proxy_connection(
5700 &self,
5701 ) -> std::option::Option<&std::boxed::Box<crate::model::ProxyConnectionInfo>> {
5702 #[allow(unreachable_patterns)]
5703 self.step_info.as_ref().and_then(|v| match v {
5704 crate::model::step::StepInfo::ProxyConnection(v) => std::option::Option::Some(v),
5705 _ => std::option::Option::None,
5706 })
5707 }
5708
5709 /// Sets the value of [step_info][crate::model::Step::step_info]
5710 /// to hold a `ProxyConnection`.
5711 ///
5712 /// Note that all the setters affecting `step_info` are
5713 /// mutually exclusive.
5714 ///
5715 /// # Example
5716 /// ```ignore,no_run
5717 /// # use google_cloud_networkmanagement_v1::model::Step;
5718 /// use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
5719 /// let x = Step::new().set_proxy_connection(ProxyConnectionInfo::default()/* use setters */);
5720 /// assert!(x.proxy_connection().is_some());
5721 /// assert!(x.instance().is_none());
5722 /// assert!(x.firewall().is_none());
5723 /// assert!(x.route().is_none());
5724 /// assert!(x.endpoint().is_none());
5725 /// assert!(x.google_service().is_none());
5726 /// assert!(x.forwarding_rule().is_none());
5727 /// assert!(x.hybrid_subnet().is_none());
5728 /// assert!(x.vpn_gateway().is_none());
5729 /// assert!(x.vpn_tunnel().is_none());
5730 /// assert!(x.interconnect_attachment().is_none());
5731 /// assert!(x.vpc_connector().is_none());
5732 /// assert!(x.direct_vpc_egress_connection().is_none());
5733 /// assert!(x.serverless_external_connection().is_none());
5734 /// assert!(x.deliver().is_none());
5735 /// assert!(x.forward().is_none());
5736 /// assert!(x.abort().is_none());
5737 /// assert!(x.drop().is_none());
5738 /// assert!(x.load_balancer().is_none());
5739 /// assert!(x.network().is_none());
5740 /// assert!(x.gke_master().is_none());
5741 /// assert!(x.gke_pod().is_none());
5742 /// assert!(x.ip_masquerading_skipped().is_none());
5743 /// assert!(x.gke_network_policy().is_none());
5744 /// assert!(x.gke_network_policy_skipped().is_none());
5745 /// assert!(x.cloud_sql_instance().is_none());
5746 /// assert!(x.redis_instance().is_none());
5747 /// assert!(x.redis_cluster().is_none());
5748 /// assert!(x.cloud_function().is_none());
5749 /// assert!(x.app_engine_version().is_none());
5750 /// assert!(x.cloud_run_revision().is_none());
5751 /// assert!(x.nat().is_none());
5752 /// assert!(x.load_balancer_backend_info().is_none());
5753 /// assert!(x.storage_bucket().is_none());
5754 /// assert!(x.serverless_neg().is_none());
5755 /// assert!(x.ngfw_packet_inspection().is_none());
5756 /// ```
5757 pub fn set_proxy_connection<
5758 T: std::convert::Into<std::boxed::Box<crate::model::ProxyConnectionInfo>>,
5759 >(
5760 mut self,
5761 v: T,
5762 ) -> Self {
5763 self.step_info =
5764 std::option::Option::Some(crate::model::step::StepInfo::ProxyConnection(v.into()));
5765 self
5766 }
5767
5768 /// The value of [step_info][crate::model::Step::step_info]
5769 /// if it holds a `LoadBalancerBackendInfo`, `None` if the field is not set or
5770 /// holds a different branch.
5771 pub fn load_balancer_backend_info(
5772 &self,
5773 ) -> std::option::Option<&std::boxed::Box<crate::model::LoadBalancerBackendInfo>> {
5774 #[allow(unreachable_patterns)]
5775 self.step_info.as_ref().and_then(|v| match v {
5776 crate::model::step::StepInfo::LoadBalancerBackendInfo(v) => {
5777 std::option::Option::Some(v)
5778 }
5779 _ => std::option::Option::None,
5780 })
5781 }
5782
5783 /// Sets the value of [step_info][crate::model::Step::step_info]
5784 /// to hold a `LoadBalancerBackendInfo`.
5785 ///
5786 /// Note that all the setters affecting `step_info` are
5787 /// mutually exclusive.
5788 ///
5789 /// # Example
5790 /// ```ignore,no_run
5791 /// # use google_cloud_networkmanagement_v1::model::Step;
5792 /// use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
5793 /// let x = Step::new().set_load_balancer_backend_info(LoadBalancerBackendInfo::default()/* use setters */);
5794 /// assert!(x.load_balancer_backend_info().is_some());
5795 /// assert!(x.instance().is_none());
5796 /// assert!(x.firewall().is_none());
5797 /// assert!(x.route().is_none());
5798 /// assert!(x.endpoint().is_none());
5799 /// assert!(x.google_service().is_none());
5800 /// assert!(x.forwarding_rule().is_none());
5801 /// assert!(x.hybrid_subnet().is_none());
5802 /// assert!(x.vpn_gateway().is_none());
5803 /// assert!(x.vpn_tunnel().is_none());
5804 /// assert!(x.interconnect_attachment().is_none());
5805 /// assert!(x.vpc_connector().is_none());
5806 /// assert!(x.direct_vpc_egress_connection().is_none());
5807 /// assert!(x.serverless_external_connection().is_none());
5808 /// assert!(x.deliver().is_none());
5809 /// assert!(x.forward().is_none());
5810 /// assert!(x.abort().is_none());
5811 /// assert!(x.drop().is_none());
5812 /// assert!(x.load_balancer().is_none());
5813 /// assert!(x.network().is_none());
5814 /// assert!(x.gke_master().is_none());
5815 /// assert!(x.gke_pod().is_none());
5816 /// assert!(x.ip_masquerading_skipped().is_none());
5817 /// assert!(x.gke_network_policy().is_none());
5818 /// assert!(x.gke_network_policy_skipped().is_none());
5819 /// assert!(x.cloud_sql_instance().is_none());
5820 /// assert!(x.redis_instance().is_none());
5821 /// assert!(x.redis_cluster().is_none());
5822 /// assert!(x.cloud_function().is_none());
5823 /// assert!(x.app_engine_version().is_none());
5824 /// assert!(x.cloud_run_revision().is_none());
5825 /// assert!(x.nat().is_none());
5826 /// assert!(x.proxy_connection().is_none());
5827 /// assert!(x.storage_bucket().is_none());
5828 /// assert!(x.serverless_neg().is_none());
5829 /// assert!(x.ngfw_packet_inspection().is_none());
5830 /// ```
5831 pub fn set_load_balancer_backend_info<
5832 T: std::convert::Into<std::boxed::Box<crate::model::LoadBalancerBackendInfo>>,
5833 >(
5834 mut self,
5835 v: T,
5836 ) -> Self {
5837 self.step_info = std::option::Option::Some(
5838 crate::model::step::StepInfo::LoadBalancerBackendInfo(v.into()),
5839 );
5840 self
5841 }
5842
5843 /// The value of [step_info][crate::model::Step::step_info]
5844 /// if it holds a `StorageBucket`, `None` if the field is not set or
5845 /// holds a different branch.
5846 pub fn storage_bucket(
5847 &self,
5848 ) -> std::option::Option<&std::boxed::Box<crate::model::StorageBucketInfo>> {
5849 #[allow(unreachable_patterns)]
5850 self.step_info.as_ref().and_then(|v| match v {
5851 crate::model::step::StepInfo::StorageBucket(v) => std::option::Option::Some(v),
5852 _ => std::option::Option::None,
5853 })
5854 }
5855
5856 /// Sets the value of [step_info][crate::model::Step::step_info]
5857 /// to hold a `StorageBucket`.
5858 ///
5859 /// Note that all the setters affecting `step_info` are
5860 /// mutually exclusive.
5861 ///
5862 /// # Example
5863 /// ```ignore,no_run
5864 /// # use google_cloud_networkmanagement_v1::model::Step;
5865 /// use google_cloud_networkmanagement_v1::model::StorageBucketInfo;
5866 /// let x = Step::new().set_storage_bucket(StorageBucketInfo::default()/* use setters */);
5867 /// assert!(x.storage_bucket().is_some());
5868 /// assert!(x.instance().is_none());
5869 /// assert!(x.firewall().is_none());
5870 /// assert!(x.route().is_none());
5871 /// assert!(x.endpoint().is_none());
5872 /// assert!(x.google_service().is_none());
5873 /// assert!(x.forwarding_rule().is_none());
5874 /// assert!(x.hybrid_subnet().is_none());
5875 /// assert!(x.vpn_gateway().is_none());
5876 /// assert!(x.vpn_tunnel().is_none());
5877 /// assert!(x.interconnect_attachment().is_none());
5878 /// assert!(x.vpc_connector().is_none());
5879 /// assert!(x.direct_vpc_egress_connection().is_none());
5880 /// assert!(x.serverless_external_connection().is_none());
5881 /// assert!(x.deliver().is_none());
5882 /// assert!(x.forward().is_none());
5883 /// assert!(x.abort().is_none());
5884 /// assert!(x.drop().is_none());
5885 /// assert!(x.load_balancer().is_none());
5886 /// assert!(x.network().is_none());
5887 /// assert!(x.gke_master().is_none());
5888 /// assert!(x.gke_pod().is_none());
5889 /// assert!(x.ip_masquerading_skipped().is_none());
5890 /// assert!(x.gke_network_policy().is_none());
5891 /// assert!(x.gke_network_policy_skipped().is_none());
5892 /// assert!(x.cloud_sql_instance().is_none());
5893 /// assert!(x.redis_instance().is_none());
5894 /// assert!(x.redis_cluster().is_none());
5895 /// assert!(x.cloud_function().is_none());
5896 /// assert!(x.app_engine_version().is_none());
5897 /// assert!(x.cloud_run_revision().is_none());
5898 /// assert!(x.nat().is_none());
5899 /// assert!(x.proxy_connection().is_none());
5900 /// assert!(x.load_balancer_backend_info().is_none());
5901 /// assert!(x.serverless_neg().is_none());
5902 /// assert!(x.ngfw_packet_inspection().is_none());
5903 /// ```
5904 pub fn set_storage_bucket<
5905 T: std::convert::Into<std::boxed::Box<crate::model::StorageBucketInfo>>,
5906 >(
5907 mut self,
5908 v: T,
5909 ) -> Self {
5910 self.step_info =
5911 std::option::Option::Some(crate::model::step::StepInfo::StorageBucket(v.into()));
5912 self
5913 }
5914
5915 /// The value of [step_info][crate::model::Step::step_info]
5916 /// if it holds a `ServerlessNeg`, `None` if the field is not set or
5917 /// holds a different branch.
5918 pub fn serverless_neg(
5919 &self,
5920 ) -> std::option::Option<&std::boxed::Box<crate::model::ServerlessNegInfo>> {
5921 #[allow(unreachable_patterns)]
5922 self.step_info.as_ref().and_then(|v| match v {
5923 crate::model::step::StepInfo::ServerlessNeg(v) => std::option::Option::Some(v),
5924 _ => std::option::Option::None,
5925 })
5926 }
5927
5928 /// Sets the value of [step_info][crate::model::Step::step_info]
5929 /// to hold a `ServerlessNeg`.
5930 ///
5931 /// Note that all the setters affecting `step_info` are
5932 /// mutually exclusive.
5933 ///
5934 /// # Example
5935 /// ```ignore,no_run
5936 /// # use google_cloud_networkmanagement_v1::model::Step;
5937 /// use google_cloud_networkmanagement_v1::model::ServerlessNegInfo;
5938 /// let x = Step::new().set_serverless_neg(ServerlessNegInfo::default()/* use setters */);
5939 /// assert!(x.serverless_neg().is_some());
5940 /// assert!(x.instance().is_none());
5941 /// assert!(x.firewall().is_none());
5942 /// assert!(x.route().is_none());
5943 /// assert!(x.endpoint().is_none());
5944 /// assert!(x.google_service().is_none());
5945 /// assert!(x.forwarding_rule().is_none());
5946 /// assert!(x.hybrid_subnet().is_none());
5947 /// assert!(x.vpn_gateway().is_none());
5948 /// assert!(x.vpn_tunnel().is_none());
5949 /// assert!(x.interconnect_attachment().is_none());
5950 /// assert!(x.vpc_connector().is_none());
5951 /// assert!(x.direct_vpc_egress_connection().is_none());
5952 /// assert!(x.serverless_external_connection().is_none());
5953 /// assert!(x.deliver().is_none());
5954 /// assert!(x.forward().is_none());
5955 /// assert!(x.abort().is_none());
5956 /// assert!(x.drop().is_none());
5957 /// assert!(x.load_balancer().is_none());
5958 /// assert!(x.network().is_none());
5959 /// assert!(x.gke_master().is_none());
5960 /// assert!(x.gke_pod().is_none());
5961 /// assert!(x.ip_masquerading_skipped().is_none());
5962 /// assert!(x.gke_network_policy().is_none());
5963 /// assert!(x.gke_network_policy_skipped().is_none());
5964 /// assert!(x.cloud_sql_instance().is_none());
5965 /// assert!(x.redis_instance().is_none());
5966 /// assert!(x.redis_cluster().is_none());
5967 /// assert!(x.cloud_function().is_none());
5968 /// assert!(x.app_engine_version().is_none());
5969 /// assert!(x.cloud_run_revision().is_none());
5970 /// assert!(x.nat().is_none());
5971 /// assert!(x.proxy_connection().is_none());
5972 /// assert!(x.load_balancer_backend_info().is_none());
5973 /// assert!(x.storage_bucket().is_none());
5974 /// assert!(x.ngfw_packet_inspection().is_none());
5975 /// ```
5976 pub fn set_serverless_neg<
5977 T: std::convert::Into<std::boxed::Box<crate::model::ServerlessNegInfo>>,
5978 >(
5979 mut self,
5980 v: T,
5981 ) -> Self {
5982 self.step_info =
5983 std::option::Option::Some(crate::model::step::StepInfo::ServerlessNeg(v.into()));
5984 self
5985 }
5986
5987 /// The value of [step_info][crate::model::Step::step_info]
5988 /// if it holds a `NgfwPacketInspection`, `None` if the field is not set or
5989 /// holds a different branch.
5990 pub fn ngfw_packet_inspection(
5991 &self,
5992 ) -> std::option::Option<&std::boxed::Box<crate::model::NgfwPacketInspectionInfo>> {
5993 #[allow(unreachable_patterns)]
5994 self.step_info.as_ref().and_then(|v| match v {
5995 crate::model::step::StepInfo::NgfwPacketInspection(v) => std::option::Option::Some(v),
5996 _ => std::option::Option::None,
5997 })
5998 }
5999
6000 /// Sets the value of [step_info][crate::model::Step::step_info]
6001 /// to hold a `NgfwPacketInspection`.
6002 ///
6003 /// Note that all the setters affecting `step_info` are
6004 /// mutually exclusive.
6005 ///
6006 /// # Example
6007 /// ```ignore,no_run
6008 /// # use google_cloud_networkmanagement_v1::model::Step;
6009 /// use google_cloud_networkmanagement_v1::model::NgfwPacketInspectionInfo;
6010 /// let x = Step::new().set_ngfw_packet_inspection(NgfwPacketInspectionInfo::default()/* use setters */);
6011 /// assert!(x.ngfw_packet_inspection().is_some());
6012 /// assert!(x.instance().is_none());
6013 /// assert!(x.firewall().is_none());
6014 /// assert!(x.route().is_none());
6015 /// assert!(x.endpoint().is_none());
6016 /// assert!(x.google_service().is_none());
6017 /// assert!(x.forwarding_rule().is_none());
6018 /// assert!(x.hybrid_subnet().is_none());
6019 /// assert!(x.vpn_gateway().is_none());
6020 /// assert!(x.vpn_tunnel().is_none());
6021 /// assert!(x.interconnect_attachment().is_none());
6022 /// assert!(x.vpc_connector().is_none());
6023 /// assert!(x.direct_vpc_egress_connection().is_none());
6024 /// assert!(x.serverless_external_connection().is_none());
6025 /// assert!(x.deliver().is_none());
6026 /// assert!(x.forward().is_none());
6027 /// assert!(x.abort().is_none());
6028 /// assert!(x.drop().is_none());
6029 /// assert!(x.load_balancer().is_none());
6030 /// assert!(x.network().is_none());
6031 /// assert!(x.gke_master().is_none());
6032 /// assert!(x.gke_pod().is_none());
6033 /// assert!(x.ip_masquerading_skipped().is_none());
6034 /// assert!(x.gke_network_policy().is_none());
6035 /// assert!(x.gke_network_policy_skipped().is_none());
6036 /// assert!(x.cloud_sql_instance().is_none());
6037 /// assert!(x.redis_instance().is_none());
6038 /// assert!(x.redis_cluster().is_none());
6039 /// assert!(x.cloud_function().is_none());
6040 /// assert!(x.app_engine_version().is_none());
6041 /// assert!(x.cloud_run_revision().is_none());
6042 /// assert!(x.nat().is_none());
6043 /// assert!(x.proxy_connection().is_none());
6044 /// assert!(x.load_balancer_backend_info().is_none());
6045 /// assert!(x.storage_bucket().is_none());
6046 /// assert!(x.serverless_neg().is_none());
6047 /// ```
6048 pub fn set_ngfw_packet_inspection<
6049 T: std::convert::Into<std::boxed::Box<crate::model::NgfwPacketInspectionInfo>>,
6050 >(
6051 mut self,
6052 v: T,
6053 ) -> Self {
6054 self.step_info =
6055 std::option::Option::Some(crate::model::step::StepInfo::NgfwPacketInspection(v.into()));
6056 self
6057 }
6058}
6059
6060impl wkt::message::Message for Step {
6061 fn typename() -> &'static str {
6062 "type.googleapis.com/google.cloud.networkmanagement.v1.Step"
6063 }
6064}
6065
6066/// Defines additional types related to [Step].
6067pub mod step {
6068 #[allow(unused_imports)]
6069 use super::*;
6070
6071 /// Type of states that are defined in the network state machine.
6072 /// Each step in the packet trace is in a specific state.
6073 ///
6074 /// # Working with unknown values
6075 ///
6076 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6077 /// additional enum variants at any time. Adding new variants is not considered
6078 /// a breaking change. Applications should write their code in anticipation of:
6079 ///
6080 /// - New values appearing in future releases of the client library, **and**
6081 /// - New values received dynamically, without application changes.
6082 ///
6083 /// Please consult the [Working with enums] section in the user guide for some
6084 /// guidelines.
6085 ///
6086 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6087 #[derive(Clone, Debug, PartialEq)]
6088 #[non_exhaustive]
6089 pub enum State {
6090 /// Unspecified state.
6091 Unspecified,
6092 /// Initial state: packet originating from a Compute Engine instance.
6093 /// An InstanceInfo is populated with starting instance information.
6094 StartFromInstance,
6095 /// Initial state: packet originating from the internet.
6096 /// The endpoint information is populated.
6097 StartFromInternet,
6098 /// Initial state: packet originating from a Google service.
6099 /// The google_service information is populated.
6100 StartFromGoogleService,
6101 /// Initial state: packet originating from a VPC or on-premises network
6102 /// with internal source IP.
6103 /// If the source is a VPC network visible to the user, a NetworkInfo
6104 /// is populated with details of the network.
6105 StartFromPrivateNetwork,
6106 /// Initial state: packet originating from a Google Kubernetes Engine cluster
6107 /// master. A GKEMasterInfo is populated with starting instance information.
6108 StartFromGkeMaster,
6109 /// Initial state: packet originating from a Cloud SQL instance.
6110 /// A CloudSQLInstanceInfo is populated with starting instance information.
6111 StartFromCloudSqlInstance,
6112 /// Initial state: packet originating from a Google Kubernetes Engine Pod.
6113 /// A GkePodInfo is populated with starting Pod information.
6114 StartFromGkePod,
6115 /// Initial state: packet originating from a Redis instance.
6116 /// A RedisInstanceInfo is populated with starting instance information.
6117 StartFromRedisInstance,
6118 /// Initial state: packet originating from a Redis Cluster.
6119 /// A RedisClusterInfo is populated with starting Cluster information.
6120 StartFromRedisCluster,
6121 /// Initial state: packet originating from a Cloud Function.
6122 /// A CloudFunctionInfo is populated with starting function information.
6123 StartFromCloudFunction,
6124 /// Initial state: packet originating from an App Engine service version.
6125 /// An AppEngineVersionInfo is populated with starting version information.
6126 StartFromAppEngineVersion,
6127 /// Initial state: packet originating from a Cloud Run revision.
6128 /// A CloudRunRevisionInfo is populated with starting revision information.
6129 StartFromCloudRunRevision,
6130 /// Initial state: packet originating from a Storage Bucket. Used only for
6131 /// return traces.
6132 /// The storage_bucket information is populated.
6133 StartFromStorageBucket,
6134 /// Initial state: packet originating from a published service that uses
6135 /// Private Service Connect. Used only for return traces.
6136 StartFromPscPublishedService,
6137 /// Initial state: packet originating from a serverless network endpoint
6138 /// group backend. Used only for return traces.
6139 /// The serverless_neg information is populated.
6140 StartFromServerlessNeg,
6141 /// Config checking state: verify ingress firewall rule.
6142 ApplyIngressFirewallRule,
6143 /// Config checking state: verify egress firewall rule.
6144 ApplyEgressFirewallRule,
6145 /// Config checking state: verify route.
6146 ApplyRoute,
6147 /// Config checking state: match forwarding rule.
6148 ApplyForwardingRule,
6149 /// Config checking state: verify load balancer backend configuration.
6150 AnalyzeLoadBalancerBackend,
6151 /// Config checking state: packet sent or received under foreign IP
6152 /// address and allowed.
6153 SpoofingApproved,
6154 /// Forwarding state: arriving at a Compute Engine instance.
6155 ArriveAtInstance,
6156 /// Forwarding state: arriving at a Compute Engine internal load balancer.
6157 #[deprecated]
6158 ArriveAtInternalLoadBalancer,
6159 /// Forwarding state: arriving at a Compute Engine external load balancer.
6160 #[deprecated]
6161 ArriveAtExternalLoadBalancer,
6162 /// Forwarding state: arriving at a hybrid subnet. Appropriate routing
6163 /// configuration will be determined here.
6164 ArriveAtHybridSubnet,
6165 /// Forwarding state: arriving at a Cloud VPN gateway.
6166 ArriveAtVpnGateway,
6167 /// Forwarding state: arriving at a Cloud VPN tunnel.
6168 ArriveAtVpnTunnel,
6169 /// Forwarding state: arriving at an interconnect attachment.
6170 ArriveAtInterconnectAttachment,
6171 /// Forwarding state: arriving at a VPC connector.
6172 ArriveAtVpcConnector,
6173 /// Forwarding state: arriving at a GKE Pod.
6174 ArriveAtGkePod,
6175 /// Forwarding state: for packets originating from a serverless endpoint
6176 /// forwarded through Direct VPC egress.
6177 DirectVpcEgressConnection,
6178 /// Forwarding state: for packets originating from a serverless endpoint
6179 /// forwarded through public (external) connectivity.
6180 ServerlessExternalConnection,
6181 /// Forwarding state: Layer 7 packet inspection by the firewall endpoint
6182 /// based on the configured security profile group.
6183 NgfwPacketInspection,
6184 /// Transition state: packet header translated. The `nat` field is populated
6185 /// with the translation information.
6186 Nat,
6187 /// Transition state: GKE Pod IP masquerading is skipped. The
6188 /// `ip_masquerading_skipped` field is populated with the reason.
6189 SkipGkePodIpMasquerading,
6190 /// Transition state: GKE Ingress Network Policy is skipped. The
6191 /// `gke_network_policy_skipped` field is populated with the reason.
6192 SkipGkeIngressNetworkPolicy,
6193 /// Transition state: GKE Egress Network Policy is skipped. The
6194 /// `gke_network_policy_skipped` field is populated with the reason.
6195 SkipGkeEgressNetworkPolicy,
6196 /// Config checking state: verify ingress GKE network policy.
6197 ApplyIngressGkeNetworkPolicy,
6198 /// Config checking state: verify egress GKE network policy.
6199 ApplyEgressGkeNetworkPolicy,
6200 /// Transition state: original connection is terminated and a new proxied
6201 /// connection is initiated.
6202 ProxyConnection,
6203 /// Final state: packet could be delivered.
6204 Deliver,
6205 /// Final state: packet could be dropped.
6206 Drop,
6207 /// Final state: packet could be forwarded to a network with an unknown
6208 /// configuration.
6209 Forward,
6210 /// Final state: analysis is aborted.
6211 Abort,
6212 /// Special state: viewer of the test result does not have permission to
6213 /// see the configuration in this step.
6214 ViewerPermissionMissing,
6215 /// If set, the enum was initialized with an unknown value.
6216 ///
6217 /// Applications can examine the value using [State::value] or
6218 /// [State::name].
6219 UnknownValue(state::UnknownValue),
6220 }
6221
6222 #[doc(hidden)]
6223 pub mod state {
6224 #[allow(unused_imports)]
6225 use super::*;
6226 #[derive(Clone, Debug, PartialEq)]
6227 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6228 }
6229
6230 impl State {
6231 /// Gets the enum value.
6232 ///
6233 /// Returns `None` if the enum contains an unknown value deserialized from
6234 /// the string representation of enums.
6235 pub fn value(&self) -> std::option::Option<i32> {
6236 match self {
6237 Self::Unspecified => std::option::Option::Some(0),
6238 Self::StartFromInstance => std::option::Option::Some(1),
6239 Self::StartFromInternet => std::option::Option::Some(2),
6240 Self::StartFromGoogleService => std::option::Option::Some(27),
6241 Self::StartFromPrivateNetwork => std::option::Option::Some(3),
6242 Self::StartFromGkeMaster => std::option::Option::Some(21),
6243 Self::StartFromCloudSqlInstance => std::option::Option::Some(22),
6244 Self::StartFromGkePod => std::option::Option::Some(39),
6245 Self::StartFromRedisInstance => std::option::Option::Some(32),
6246 Self::StartFromRedisCluster => std::option::Option::Some(33),
6247 Self::StartFromCloudFunction => std::option::Option::Some(23),
6248 Self::StartFromAppEngineVersion => std::option::Option::Some(25),
6249 Self::StartFromCloudRunRevision => std::option::Option::Some(26),
6250 Self::StartFromStorageBucket => std::option::Option::Some(29),
6251 Self::StartFromPscPublishedService => std::option::Option::Some(30),
6252 Self::StartFromServerlessNeg => std::option::Option::Some(31),
6253 Self::ApplyIngressFirewallRule => std::option::Option::Some(4),
6254 Self::ApplyEgressFirewallRule => std::option::Option::Some(5),
6255 Self::ApplyRoute => std::option::Option::Some(6),
6256 Self::ApplyForwardingRule => std::option::Option::Some(7),
6257 Self::AnalyzeLoadBalancerBackend => std::option::Option::Some(28),
6258 Self::SpoofingApproved => std::option::Option::Some(8),
6259 Self::ArriveAtInstance => std::option::Option::Some(9),
6260 Self::ArriveAtInternalLoadBalancer => std::option::Option::Some(10),
6261 Self::ArriveAtExternalLoadBalancer => std::option::Option::Some(11),
6262 Self::ArriveAtHybridSubnet => std::option::Option::Some(38),
6263 Self::ArriveAtVpnGateway => std::option::Option::Some(12),
6264 Self::ArriveAtVpnTunnel => std::option::Option::Some(13),
6265 Self::ArriveAtInterconnectAttachment => std::option::Option::Some(37),
6266 Self::ArriveAtVpcConnector => std::option::Option::Some(24),
6267 Self::ArriveAtGkePod => std::option::Option::Some(44),
6268 Self::DirectVpcEgressConnection => std::option::Option::Some(35),
6269 Self::ServerlessExternalConnection => std::option::Option::Some(36),
6270 Self::NgfwPacketInspection => std::option::Option::Some(47),
6271 Self::Nat => std::option::Option::Some(14),
6272 Self::SkipGkePodIpMasquerading => std::option::Option::Some(40),
6273 Self::SkipGkeIngressNetworkPolicy => std::option::Option::Some(41),
6274 Self::SkipGkeEgressNetworkPolicy => std::option::Option::Some(42),
6275 Self::ApplyIngressGkeNetworkPolicy => std::option::Option::Some(45),
6276 Self::ApplyEgressGkeNetworkPolicy => std::option::Option::Some(46),
6277 Self::ProxyConnection => std::option::Option::Some(15),
6278 Self::Deliver => std::option::Option::Some(16),
6279 Self::Drop => std::option::Option::Some(17),
6280 Self::Forward => std::option::Option::Some(18),
6281 Self::Abort => std::option::Option::Some(19),
6282 Self::ViewerPermissionMissing => std::option::Option::Some(20),
6283 Self::UnknownValue(u) => u.0.value(),
6284 }
6285 }
6286
6287 /// Gets the enum value as a string.
6288 ///
6289 /// Returns `None` if the enum contains an unknown value deserialized from
6290 /// the integer representation of enums.
6291 pub fn name(&self) -> std::option::Option<&str> {
6292 match self {
6293 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6294 Self::StartFromInstance => std::option::Option::Some("START_FROM_INSTANCE"),
6295 Self::StartFromInternet => std::option::Option::Some("START_FROM_INTERNET"),
6296 Self::StartFromGoogleService => {
6297 std::option::Option::Some("START_FROM_GOOGLE_SERVICE")
6298 }
6299 Self::StartFromPrivateNetwork => {
6300 std::option::Option::Some("START_FROM_PRIVATE_NETWORK")
6301 }
6302 Self::StartFromGkeMaster => std::option::Option::Some("START_FROM_GKE_MASTER"),
6303 Self::StartFromCloudSqlInstance => {
6304 std::option::Option::Some("START_FROM_CLOUD_SQL_INSTANCE")
6305 }
6306 Self::StartFromGkePod => std::option::Option::Some("START_FROM_GKE_POD"),
6307 Self::StartFromRedisInstance => {
6308 std::option::Option::Some("START_FROM_REDIS_INSTANCE")
6309 }
6310 Self::StartFromRedisCluster => {
6311 std::option::Option::Some("START_FROM_REDIS_CLUSTER")
6312 }
6313 Self::StartFromCloudFunction => {
6314 std::option::Option::Some("START_FROM_CLOUD_FUNCTION")
6315 }
6316 Self::StartFromAppEngineVersion => {
6317 std::option::Option::Some("START_FROM_APP_ENGINE_VERSION")
6318 }
6319 Self::StartFromCloudRunRevision => {
6320 std::option::Option::Some("START_FROM_CLOUD_RUN_REVISION")
6321 }
6322 Self::StartFromStorageBucket => {
6323 std::option::Option::Some("START_FROM_STORAGE_BUCKET")
6324 }
6325 Self::StartFromPscPublishedService => {
6326 std::option::Option::Some("START_FROM_PSC_PUBLISHED_SERVICE")
6327 }
6328 Self::StartFromServerlessNeg => {
6329 std::option::Option::Some("START_FROM_SERVERLESS_NEG")
6330 }
6331 Self::ApplyIngressFirewallRule => {
6332 std::option::Option::Some("APPLY_INGRESS_FIREWALL_RULE")
6333 }
6334 Self::ApplyEgressFirewallRule => {
6335 std::option::Option::Some("APPLY_EGRESS_FIREWALL_RULE")
6336 }
6337 Self::ApplyRoute => std::option::Option::Some("APPLY_ROUTE"),
6338 Self::ApplyForwardingRule => std::option::Option::Some("APPLY_FORWARDING_RULE"),
6339 Self::AnalyzeLoadBalancerBackend => {
6340 std::option::Option::Some("ANALYZE_LOAD_BALANCER_BACKEND")
6341 }
6342 Self::SpoofingApproved => std::option::Option::Some("SPOOFING_APPROVED"),
6343 Self::ArriveAtInstance => std::option::Option::Some("ARRIVE_AT_INSTANCE"),
6344 Self::ArriveAtInternalLoadBalancer => {
6345 std::option::Option::Some("ARRIVE_AT_INTERNAL_LOAD_BALANCER")
6346 }
6347 Self::ArriveAtExternalLoadBalancer => {
6348 std::option::Option::Some("ARRIVE_AT_EXTERNAL_LOAD_BALANCER")
6349 }
6350 Self::ArriveAtHybridSubnet => std::option::Option::Some("ARRIVE_AT_HYBRID_SUBNET"),
6351 Self::ArriveAtVpnGateway => std::option::Option::Some("ARRIVE_AT_VPN_GATEWAY"),
6352 Self::ArriveAtVpnTunnel => std::option::Option::Some("ARRIVE_AT_VPN_TUNNEL"),
6353 Self::ArriveAtInterconnectAttachment => {
6354 std::option::Option::Some("ARRIVE_AT_INTERCONNECT_ATTACHMENT")
6355 }
6356 Self::ArriveAtVpcConnector => std::option::Option::Some("ARRIVE_AT_VPC_CONNECTOR"),
6357 Self::ArriveAtGkePod => std::option::Option::Some("ARRIVE_AT_GKE_POD"),
6358 Self::DirectVpcEgressConnection => {
6359 std::option::Option::Some("DIRECT_VPC_EGRESS_CONNECTION")
6360 }
6361 Self::ServerlessExternalConnection => {
6362 std::option::Option::Some("SERVERLESS_EXTERNAL_CONNECTION")
6363 }
6364 Self::NgfwPacketInspection => std::option::Option::Some("NGFW_PACKET_INSPECTION"),
6365 Self::Nat => std::option::Option::Some("NAT"),
6366 Self::SkipGkePodIpMasquerading => {
6367 std::option::Option::Some("SKIP_GKE_POD_IP_MASQUERADING")
6368 }
6369 Self::SkipGkeIngressNetworkPolicy => {
6370 std::option::Option::Some("SKIP_GKE_INGRESS_NETWORK_POLICY")
6371 }
6372 Self::SkipGkeEgressNetworkPolicy => {
6373 std::option::Option::Some("SKIP_GKE_EGRESS_NETWORK_POLICY")
6374 }
6375 Self::ApplyIngressGkeNetworkPolicy => {
6376 std::option::Option::Some("APPLY_INGRESS_GKE_NETWORK_POLICY")
6377 }
6378 Self::ApplyEgressGkeNetworkPolicy => {
6379 std::option::Option::Some("APPLY_EGRESS_GKE_NETWORK_POLICY")
6380 }
6381 Self::ProxyConnection => std::option::Option::Some("PROXY_CONNECTION"),
6382 Self::Deliver => std::option::Option::Some("DELIVER"),
6383 Self::Drop => std::option::Option::Some("DROP"),
6384 Self::Forward => std::option::Option::Some("FORWARD"),
6385 Self::Abort => std::option::Option::Some("ABORT"),
6386 Self::ViewerPermissionMissing => {
6387 std::option::Option::Some("VIEWER_PERMISSION_MISSING")
6388 }
6389 Self::UnknownValue(u) => u.0.name(),
6390 }
6391 }
6392 }
6393
6394 impl std::default::Default for State {
6395 fn default() -> Self {
6396 use std::convert::From;
6397 Self::from(0)
6398 }
6399 }
6400
6401 impl std::fmt::Display for State {
6402 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6403 wkt::internal::display_enum(f, self.name(), self.value())
6404 }
6405 }
6406
6407 impl std::convert::From<i32> for State {
6408 fn from(value: i32) -> Self {
6409 match value {
6410 0 => Self::Unspecified,
6411 1 => Self::StartFromInstance,
6412 2 => Self::StartFromInternet,
6413 3 => Self::StartFromPrivateNetwork,
6414 4 => Self::ApplyIngressFirewallRule,
6415 5 => Self::ApplyEgressFirewallRule,
6416 6 => Self::ApplyRoute,
6417 7 => Self::ApplyForwardingRule,
6418 8 => Self::SpoofingApproved,
6419 9 => Self::ArriveAtInstance,
6420 10 => Self::ArriveAtInternalLoadBalancer,
6421 11 => Self::ArriveAtExternalLoadBalancer,
6422 12 => Self::ArriveAtVpnGateway,
6423 13 => Self::ArriveAtVpnTunnel,
6424 14 => Self::Nat,
6425 15 => Self::ProxyConnection,
6426 16 => Self::Deliver,
6427 17 => Self::Drop,
6428 18 => Self::Forward,
6429 19 => Self::Abort,
6430 20 => Self::ViewerPermissionMissing,
6431 21 => Self::StartFromGkeMaster,
6432 22 => Self::StartFromCloudSqlInstance,
6433 23 => Self::StartFromCloudFunction,
6434 24 => Self::ArriveAtVpcConnector,
6435 25 => Self::StartFromAppEngineVersion,
6436 26 => Self::StartFromCloudRunRevision,
6437 27 => Self::StartFromGoogleService,
6438 28 => Self::AnalyzeLoadBalancerBackend,
6439 29 => Self::StartFromStorageBucket,
6440 30 => Self::StartFromPscPublishedService,
6441 31 => Self::StartFromServerlessNeg,
6442 32 => Self::StartFromRedisInstance,
6443 33 => Self::StartFromRedisCluster,
6444 35 => Self::DirectVpcEgressConnection,
6445 36 => Self::ServerlessExternalConnection,
6446 37 => Self::ArriveAtInterconnectAttachment,
6447 38 => Self::ArriveAtHybridSubnet,
6448 39 => Self::StartFromGkePod,
6449 40 => Self::SkipGkePodIpMasquerading,
6450 41 => Self::SkipGkeIngressNetworkPolicy,
6451 42 => Self::SkipGkeEgressNetworkPolicy,
6452 44 => Self::ArriveAtGkePod,
6453 45 => Self::ApplyIngressGkeNetworkPolicy,
6454 46 => Self::ApplyEgressGkeNetworkPolicy,
6455 47 => Self::NgfwPacketInspection,
6456 _ => Self::UnknownValue(state::UnknownValue(
6457 wkt::internal::UnknownEnumValue::Integer(value),
6458 )),
6459 }
6460 }
6461 }
6462
6463 impl std::convert::From<&str> for State {
6464 fn from(value: &str) -> Self {
6465 use std::string::ToString;
6466 match value {
6467 "STATE_UNSPECIFIED" => Self::Unspecified,
6468 "START_FROM_INSTANCE" => Self::StartFromInstance,
6469 "START_FROM_INTERNET" => Self::StartFromInternet,
6470 "START_FROM_GOOGLE_SERVICE" => Self::StartFromGoogleService,
6471 "START_FROM_PRIVATE_NETWORK" => Self::StartFromPrivateNetwork,
6472 "START_FROM_GKE_MASTER" => Self::StartFromGkeMaster,
6473 "START_FROM_CLOUD_SQL_INSTANCE" => Self::StartFromCloudSqlInstance,
6474 "START_FROM_GKE_POD" => Self::StartFromGkePod,
6475 "START_FROM_REDIS_INSTANCE" => Self::StartFromRedisInstance,
6476 "START_FROM_REDIS_CLUSTER" => Self::StartFromRedisCluster,
6477 "START_FROM_CLOUD_FUNCTION" => Self::StartFromCloudFunction,
6478 "START_FROM_APP_ENGINE_VERSION" => Self::StartFromAppEngineVersion,
6479 "START_FROM_CLOUD_RUN_REVISION" => Self::StartFromCloudRunRevision,
6480 "START_FROM_STORAGE_BUCKET" => Self::StartFromStorageBucket,
6481 "START_FROM_PSC_PUBLISHED_SERVICE" => Self::StartFromPscPublishedService,
6482 "START_FROM_SERVERLESS_NEG" => Self::StartFromServerlessNeg,
6483 "APPLY_INGRESS_FIREWALL_RULE" => Self::ApplyIngressFirewallRule,
6484 "APPLY_EGRESS_FIREWALL_RULE" => Self::ApplyEgressFirewallRule,
6485 "APPLY_ROUTE" => Self::ApplyRoute,
6486 "APPLY_FORWARDING_RULE" => Self::ApplyForwardingRule,
6487 "ANALYZE_LOAD_BALANCER_BACKEND" => Self::AnalyzeLoadBalancerBackend,
6488 "SPOOFING_APPROVED" => Self::SpoofingApproved,
6489 "ARRIVE_AT_INSTANCE" => Self::ArriveAtInstance,
6490 "ARRIVE_AT_INTERNAL_LOAD_BALANCER" => Self::ArriveAtInternalLoadBalancer,
6491 "ARRIVE_AT_EXTERNAL_LOAD_BALANCER" => Self::ArriveAtExternalLoadBalancer,
6492 "ARRIVE_AT_HYBRID_SUBNET" => Self::ArriveAtHybridSubnet,
6493 "ARRIVE_AT_VPN_GATEWAY" => Self::ArriveAtVpnGateway,
6494 "ARRIVE_AT_VPN_TUNNEL" => Self::ArriveAtVpnTunnel,
6495 "ARRIVE_AT_INTERCONNECT_ATTACHMENT" => Self::ArriveAtInterconnectAttachment,
6496 "ARRIVE_AT_VPC_CONNECTOR" => Self::ArriveAtVpcConnector,
6497 "ARRIVE_AT_GKE_POD" => Self::ArriveAtGkePod,
6498 "DIRECT_VPC_EGRESS_CONNECTION" => Self::DirectVpcEgressConnection,
6499 "SERVERLESS_EXTERNAL_CONNECTION" => Self::ServerlessExternalConnection,
6500 "NGFW_PACKET_INSPECTION" => Self::NgfwPacketInspection,
6501 "NAT" => Self::Nat,
6502 "SKIP_GKE_POD_IP_MASQUERADING" => Self::SkipGkePodIpMasquerading,
6503 "SKIP_GKE_INGRESS_NETWORK_POLICY" => Self::SkipGkeIngressNetworkPolicy,
6504 "SKIP_GKE_EGRESS_NETWORK_POLICY" => Self::SkipGkeEgressNetworkPolicy,
6505 "APPLY_INGRESS_GKE_NETWORK_POLICY" => Self::ApplyIngressGkeNetworkPolicy,
6506 "APPLY_EGRESS_GKE_NETWORK_POLICY" => Self::ApplyEgressGkeNetworkPolicy,
6507 "PROXY_CONNECTION" => Self::ProxyConnection,
6508 "DELIVER" => Self::Deliver,
6509 "DROP" => Self::Drop,
6510 "FORWARD" => Self::Forward,
6511 "ABORT" => Self::Abort,
6512 "VIEWER_PERMISSION_MISSING" => Self::ViewerPermissionMissing,
6513 _ => Self::UnknownValue(state::UnknownValue(
6514 wkt::internal::UnknownEnumValue::String(value.to_string()),
6515 )),
6516 }
6517 }
6518 }
6519
6520 impl serde::ser::Serialize for State {
6521 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6522 where
6523 S: serde::Serializer,
6524 {
6525 match self {
6526 Self::Unspecified => serializer.serialize_i32(0),
6527 Self::StartFromInstance => serializer.serialize_i32(1),
6528 Self::StartFromInternet => serializer.serialize_i32(2),
6529 Self::StartFromGoogleService => serializer.serialize_i32(27),
6530 Self::StartFromPrivateNetwork => serializer.serialize_i32(3),
6531 Self::StartFromGkeMaster => serializer.serialize_i32(21),
6532 Self::StartFromCloudSqlInstance => serializer.serialize_i32(22),
6533 Self::StartFromGkePod => serializer.serialize_i32(39),
6534 Self::StartFromRedisInstance => serializer.serialize_i32(32),
6535 Self::StartFromRedisCluster => serializer.serialize_i32(33),
6536 Self::StartFromCloudFunction => serializer.serialize_i32(23),
6537 Self::StartFromAppEngineVersion => serializer.serialize_i32(25),
6538 Self::StartFromCloudRunRevision => serializer.serialize_i32(26),
6539 Self::StartFromStorageBucket => serializer.serialize_i32(29),
6540 Self::StartFromPscPublishedService => serializer.serialize_i32(30),
6541 Self::StartFromServerlessNeg => serializer.serialize_i32(31),
6542 Self::ApplyIngressFirewallRule => serializer.serialize_i32(4),
6543 Self::ApplyEgressFirewallRule => serializer.serialize_i32(5),
6544 Self::ApplyRoute => serializer.serialize_i32(6),
6545 Self::ApplyForwardingRule => serializer.serialize_i32(7),
6546 Self::AnalyzeLoadBalancerBackend => serializer.serialize_i32(28),
6547 Self::SpoofingApproved => serializer.serialize_i32(8),
6548 Self::ArriveAtInstance => serializer.serialize_i32(9),
6549 Self::ArriveAtInternalLoadBalancer => serializer.serialize_i32(10),
6550 Self::ArriveAtExternalLoadBalancer => serializer.serialize_i32(11),
6551 Self::ArriveAtHybridSubnet => serializer.serialize_i32(38),
6552 Self::ArriveAtVpnGateway => serializer.serialize_i32(12),
6553 Self::ArriveAtVpnTunnel => serializer.serialize_i32(13),
6554 Self::ArriveAtInterconnectAttachment => serializer.serialize_i32(37),
6555 Self::ArriveAtVpcConnector => serializer.serialize_i32(24),
6556 Self::ArriveAtGkePod => serializer.serialize_i32(44),
6557 Self::DirectVpcEgressConnection => serializer.serialize_i32(35),
6558 Self::ServerlessExternalConnection => serializer.serialize_i32(36),
6559 Self::NgfwPacketInspection => serializer.serialize_i32(47),
6560 Self::Nat => serializer.serialize_i32(14),
6561 Self::SkipGkePodIpMasquerading => serializer.serialize_i32(40),
6562 Self::SkipGkeIngressNetworkPolicy => serializer.serialize_i32(41),
6563 Self::SkipGkeEgressNetworkPolicy => serializer.serialize_i32(42),
6564 Self::ApplyIngressGkeNetworkPolicy => serializer.serialize_i32(45),
6565 Self::ApplyEgressGkeNetworkPolicy => serializer.serialize_i32(46),
6566 Self::ProxyConnection => serializer.serialize_i32(15),
6567 Self::Deliver => serializer.serialize_i32(16),
6568 Self::Drop => serializer.serialize_i32(17),
6569 Self::Forward => serializer.serialize_i32(18),
6570 Self::Abort => serializer.serialize_i32(19),
6571 Self::ViewerPermissionMissing => serializer.serialize_i32(20),
6572 Self::UnknownValue(u) => u.0.serialize(serializer),
6573 }
6574 }
6575 }
6576
6577 impl<'de> serde::de::Deserialize<'de> for State {
6578 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6579 where
6580 D: serde::Deserializer<'de>,
6581 {
6582 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6583 ".google.cloud.networkmanagement.v1.Step.State",
6584 ))
6585 }
6586 }
6587
6588 /// Configuration or metadata associated with each step.
6589 /// The configuration is filtered based on viewer's permission. If a viewer
6590 /// has no permission to view the configuration in this step, for non-final
6591 /// states a special state is populated (VIEWER_PERMISSION_MISSING), and for
6592 /// final state the configuration is cleared.
6593 #[derive(Clone, Debug, PartialEq)]
6594 #[non_exhaustive]
6595 pub enum StepInfo {
6596 /// Display information of a Compute Engine instance.
6597 Instance(std::boxed::Box<crate::model::InstanceInfo>),
6598 /// Display information of a Compute Engine firewall rule.
6599 Firewall(std::boxed::Box<crate::model::FirewallInfo>),
6600 /// Display information of a Compute Engine route.
6601 Route(std::boxed::Box<crate::model::RouteInfo>),
6602 /// Display information of the source and destination under analysis.
6603 /// The endpoint information in an intermediate state may differ with the
6604 /// initial input, as it might be modified by state like NAT,
6605 /// or Connection Proxy.
6606 Endpoint(std::boxed::Box<crate::model::EndpointInfo>),
6607 /// Display information of a Google service
6608 GoogleService(std::boxed::Box<crate::model::GoogleServiceInfo>),
6609 /// Display information of a Compute Engine forwarding rule.
6610 ForwardingRule(std::boxed::Box<crate::model::ForwardingRuleInfo>),
6611 /// Display information of a hybrid subnet.
6612 HybridSubnet(std::boxed::Box<crate::model::HybridSubnetInfo>),
6613 /// Display information of a Compute Engine VPN gateway.
6614 VpnGateway(std::boxed::Box<crate::model::VpnGatewayInfo>),
6615 /// Display information of a Compute Engine VPN tunnel.
6616 VpnTunnel(std::boxed::Box<crate::model::VpnTunnelInfo>),
6617 /// Display information of an interconnect attachment.
6618 InterconnectAttachment(std::boxed::Box<crate::model::InterconnectAttachmentInfo>),
6619 /// Display information of a VPC connector.
6620 VpcConnector(std::boxed::Box<crate::model::VpcConnectorInfo>),
6621 /// Display information of a serverless direct VPC egress connection.
6622 DirectVpcEgressConnection(std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>),
6623 /// Display information of a serverless public (external) connection.
6624 ServerlessExternalConnection(
6625 std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>,
6626 ),
6627 /// Display information of the final state "deliver" and reason.
6628 Deliver(std::boxed::Box<crate::model::DeliverInfo>),
6629 /// Display information of the final state "forward" and reason.
6630 Forward(std::boxed::Box<crate::model::ForwardInfo>),
6631 /// Display information of the final state "abort" and reason.
6632 Abort(std::boxed::Box<crate::model::AbortInfo>),
6633 /// Display information of the final state "drop" and reason.
6634 Drop(std::boxed::Box<crate::model::DropInfo>),
6635 /// Display information of the load balancers. Deprecated in favor of the
6636 /// `load_balancer_backend_info` field, not used in new tests.
6637 #[deprecated]
6638 LoadBalancer(std::boxed::Box<crate::model::LoadBalancerInfo>),
6639 /// Display information of a Google Cloud network.
6640 Network(std::boxed::Box<crate::model::NetworkInfo>),
6641 /// Display information of a Google Kubernetes Engine cluster master.
6642 GkeMaster(std::boxed::Box<crate::model::GKEMasterInfo>),
6643 /// Display information of a Google Kubernetes Engine Pod.
6644 GkePod(std::boxed::Box<crate::model::GkePodInfo>),
6645 /// Display information of the reason why GKE Pod IP masquerading was
6646 /// skipped.
6647 IpMasqueradingSkipped(std::boxed::Box<crate::model::IpMasqueradingSkippedInfo>),
6648 /// Display information of a GKE Network Policy.
6649 GkeNetworkPolicy(std::boxed::Box<crate::model::GkeNetworkPolicyInfo>),
6650 /// Display information of the reason why GKE Network Policy evaluation was
6651 /// skipped.
6652 GkeNetworkPolicySkipped(std::boxed::Box<crate::model::GkeNetworkPolicySkippedInfo>),
6653 /// Display information of a Cloud SQL instance.
6654 CloudSqlInstance(std::boxed::Box<crate::model::CloudSQLInstanceInfo>),
6655 /// Display information of a Redis Instance.
6656 RedisInstance(std::boxed::Box<crate::model::RedisInstanceInfo>),
6657 /// Display information of a Redis Cluster.
6658 RedisCluster(std::boxed::Box<crate::model::RedisClusterInfo>),
6659 /// Display information of a Cloud Function.
6660 CloudFunction(std::boxed::Box<crate::model::CloudFunctionInfo>),
6661 /// Display information of an App Engine service version.
6662 AppEngineVersion(std::boxed::Box<crate::model::AppEngineVersionInfo>),
6663 /// Display information of a Cloud Run revision.
6664 CloudRunRevision(std::boxed::Box<crate::model::CloudRunRevisionInfo>),
6665 /// Display information of a NAT.
6666 Nat(std::boxed::Box<crate::model::NatInfo>),
6667 /// Display information of a ProxyConnection.
6668 ProxyConnection(std::boxed::Box<crate::model::ProxyConnectionInfo>),
6669 /// Display information of a specific load balancer backend.
6670 LoadBalancerBackendInfo(std::boxed::Box<crate::model::LoadBalancerBackendInfo>),
6671 /// Display information of a Storage Bucket. Used only for return traces.
6672 StorageBucket(std::boxed::Box<crate::model::StorageBucketInfo>),
6673 /// Display information of a Serverless network endpoint group backend. Used
6674 /// only for return traces.
6675 ServerlessNeg(std::boxed::Box<crate::model::ServerlessNegInfo>),
6676 /// Display information of a layer 7 packet inspection by the firewall.
6677 NgfwPacketInspection(std::boxed::Box<crate::model::NgfwPacketInspectionInfo>),
6678 }
6679}
6680
6681/// For display only. Metadata associated with a Compute Engine instance.
6682#[derive(Clone, Default, PartialEq)]
6683#[non_exhaustive]
6684pub struct InstanceInfo {
6685 /// Name of a Compute Engine instance.
6686 pub display_name: std::string::String,
6687
6688 /// URI of a Compute Engine instance.
6689 pub uri: std::string::String,
6690
6691 /// Name of the network interface of a Compute Engine instance.
6692 pub interface: std::string::String,
6693
6694 /// URI of a Compute Engine network.
6695 pub network_uri: std::string::String,
6696
6697 /// Internal IP address of the network interface.
6698 pub internal_ip: std::string::String,
6699
6700 /// External IP address of the network interface.
6701 pub external_ip: std::string::String,
6702
6703 /// Network tags configured on the instance.
6704 pub network_tags: std::vec::Vec<std::string::String>,
6705
6706 /// Service account authorized for the instance.
6707 #[deprecated]
6708 pub service_account: std::string::String,
6709
6710 /// URI of the PSC network attachment the NIC is attached to (if relevant).
6711 pub psc_network_attachment_uri: std::string::String,
6712
6713 /// Indicates whether the Compute Engine instance is running.
6714 /// Deprecated: use the `status` field instead.
6715 #[deprecated]
6716 pub running: bool,
6717
6718 /// The status of the instance.
6719 pub status: crate::model::instance_info::Status,
6720
6721 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6722}
6723
6724impl InstanceInfo {
6725 /// Creates a new default instance.
6726 pub fn new() -> Self {
6727 std::default::Default::default()
6728 }
6729
6730 /// Sets the value of [display_name][crate::model::InstanceInfo::display_name].
6731 ///
6732 /// # Example
6733 /// ```ignore,no_run
6734 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6735 /// let x = InstanceInfo::new().set_display_name("example");
6736 /// ```
6737 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6738 self.display_name = v.into();
6739 self
6740 }
6741
6742 /// Sets the value of [uri][crate::model::InstanceInfo::uri].
6743 ///
6744 /// # Example
6745 /// ```ignore,no_run
6746 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6747 /// let x = InstanceInfo::new().set_uri("example");
6748 /// ```
6749 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6750 self.uri = v.into();
6751 self
6752 }
6753
6754 /// Sets the value of [interface][crate::model::InstanceInfo::interface].
6755 ///
6756 /// # Example
6757 /// ```ignore,no_run
6758 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6759 /// let x = InstanceInfo::new().set_interface("example");
6760 /// ```
6761 pub fn set_interface<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6762 self.interface = v.into();
6763 self
6764 }
6765
6766 /// Sets the value of [network_uri][crate::model::InstanceInfo::network_uri].
6767 ///
6768 /// # Example
6769 /// ```ignore,no_run
6770 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6771 /// let x = InstanceInfo::new().set_network_uri("example");
6772 /// ```
6773 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6774 self.network_uri = v.into();
6775 self
6776 }
6777
6778 /// Sets the value of [internal_ip][crate::model::InstanceInfo::internal_ip].
6779 ///
6780 /// # Example
6781 /// ```ignore,no_run
6782 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6783 /// let x = InstanceInfo::new().set_internal_ip("example");
6784 /// ```
6785 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6786 self.internal_ip = v.into();
6787 self
6788 }
6789
6790 /// Sets the value of [external_ip][crate::model::InstanceInfo::external_ip].
6791 ///
6792 /// # Example
6793 /// ```ignore,no_run
6794 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6795 /// let x = InstanceInfo::new().set_external_ip("example");
6796 /// ```
6797 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6798 self.external_ip = v.into();
6799 self
6800 }
6801
6802 /// Sets the value of [network_tags][crate::model::InstanceInfo::network_tags].
6803 ///
6804 /// # Example
6805 /// ```ignore,no_run
6806 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6807 /// let x = InstanceInfo::new().set_network_tags(["a", "b", "c"]);
6808 /// ```
6809 pub fn set_network_tags<T, V>(mut self, v: T) -> Self
6810 where
6811 T: std::iter::IntoIterator<Item = V>,
6812 V: std::convert::Into<std::string::String>,
6813 {
6814 use std::iter::Iterator;
6815 self.network_tags = v.into_iter().map(|i| i.into()).collect();
6816 self
6817 }
6818
6819 /// Sets the value of [service_account][crate::model::InstanceInfo::service_account].
6820 ///
6821 /// # Example
6822 /// ```ignore,no_run
6823 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6824 /// let x = InstanceInfo::new().set_service_account("example");
6825 /// ```
6826 #[deprecated]
6827 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6828 self.service_account = v.into();
6829 self
6830 }
6831
6832 /// Sets the value of [psc_network_attachment_uri][crate::model::InstanceInfo::psc_network_attachment_uri].
6833 ///
6834 /// # Example
6835 /// ```ignore,no_run
6836 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6837 /// let x = InstanceInfo::new().set_psc_network_attachment_uri("example");
6838 /// ```
6839 pub fn set_psc_network_attachment_uri<T: std::convert::Into<std::string::String>>(
6840 mut self,
6841 v: T,
6842 ) -> Self {
6843 self.psc_network_attachment_uri = v.into();
6844 self
6845 }
6846
6847 /// Sets the value of [running][crate::model::InstanceInfo::running].
6848 ///
6849 /// # Example
6850 /// ```ignore,no_run
6851 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6852 /// let x = InstanceInfo::new().set_running(true);
6853 /// ```
6854 #[deprecated]
6855 pub fn set_running<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6856 self.running = v.into();
6857 self
6858 }
6859
6860 /// Sets the value of [status][crate::model::InstanceInfo::status].
6861 ///
6862 /// # Example
6863 /// ```ignore,no_run
6864 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6865 /// use google_cloud_networkmanagement_v1::model::instance_info::Status;
6866 /// let x0 = InstanceInfo::new().set_status(Status::Running);
6867 /// let x1 = InstanceInfo::new().set_status(Status::NotRunning);
6868 /// ```
6869 pub fn set_status<T: std::convert::Into<crate::model::instance_info::Status>>(
6870 mut self,
6871 v: T,
6872 ) -> Self {
6873 self.status = v.into();
6874 self
6875 }
6876}
6877
6878impl wkt::message::Message for InstanceInfo {
6879 fn typename() -> &'static str {
6880 "type.googleapis.com/google.cloud.networkmanagement.v1.InstanceInfo"
6881 }
6882}
6883
6884/// Defines additional types related to [InstanceInfo].
6885pub mod instance_info {
6886 #[allow(unused_imports)]
6887 use super::*;
6888
6889 /// The status of the instance. We treat all states other than "RUNNING" as
6890 /// not running.
6891 ///
6892 /// # Working with unknown values
6893 ///
6894 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6895 /// additional enum variants at any time. Adding new variants is not considered
6896 /// a breaking change. Applications should write their code in anticipation of:
6897 ///
6898 /// - New values appearing in future releases of the client library, **and**
6899 /// - New values received dynamically, without application changes.
6900 ///
6901 /// Please consult the [Working with enums] section in the user guide for some
6902 /// guidelines.
6903 ///
6904 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6905 #[derive(Clone, Debug, PartialEq)]
6906 #[non_exhaustive]
6907 pub enum Status {
6908 /// Default unspecified value.
6909 Unspecified,
6910 /// The instance is running.
6911 Running,
6912 /// The instance has any status other than "RUNNING".
6913 NotRunning,
6914 /// If set, the enum was initialized with an unknown value.
6915 ///
6916 /// Applications can examine the value using [Status::value] or
6917 /// [Status::name].
6918 UnknownValue(status::UnknownValue),
6919 }
6920
6921 #[doc(hidden)]
6922 pub mod status {
6923 #[allow(unused_imports)]
6924 use super::*;
6925 #[derive(Clone, Debug, PartialEq)]
6926 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6927 }
6928
6929 impl Status {
6930 /// Gets the enum value.
6931 ///
6932 /// Returns `None` if the enum contains an unknown value deserialized from
6933 /// the string representation of enums.
6934 pub fn value(&self) -> std::option::Option<i32> {
6935 match self {
6936 Self::Unspecified => std::option::Option::Some(0),
6937 Self::Running => std::option::Option::Some(1),
6938 Self::NotRunning => std::option::Option::Some(2),
6939 Self::UnknownValue(u) => u.0.value(),
6940 }
6941 }
6942
6943 /// Gets the enum value as a string.
6944 ///
6945 /// Returns `None` if the enum contains an unknown value deserialized from
6946 /// the integer representation of enums.
6947 pub fn name(&self) -> std::option::Option<&str> {
6948 match self {
6949 Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
6950 Self::Running => std::option::Option::Some("RUNNING"),
6951 Self::NotRunning => std::option::Option::Some("NOT_RUNNING"),
6952 Self::UnknownValue(u) => u.0.name(),
6953 }
6954 }
6955 }
6956
6957 impl std::default::Default for Status {
6958 fn default() -> Self {
6959 use std::convert::From;
6960 Self::from(0)
6961 }
6962 }
6963
6964 impl std::fmt::Display for Status {
6965 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6966 wkt::internal::display_enum(f, self.name(), self.value())
6967 }
6968 }
6969
6970 impl std::convert::From<i32> for Status {
6971 fn from(value: i32) -> Self {
6972 match value {
6973 0 => Self::Unspecified,
6974 1 => Self::Running,
6975 2 => Self::NotRunning,
6976 _ => Self::UnknownValue(status::UnknownValue(
6977 wkt::internal::UnknownEnumValue::Integer(value),
6978 )),
6979 }
6980 }
6981 }
6982
6983 impl std::convert::From<&str> for Status {
6984 fn from(value: &str) -> Self {
6985 use std::string::ToString;
6986 match value {
6987 "STATUS_UNSPECIFIED" => Self::Unspecified,
6988 "RUNNING" => Self::Running,
6989 "NOT_RUNNING" => Self::NotRunning,
6990 _ => Self::UnknownValue(status::UnknownValue(
6991 wkt::internal::UnknownEnumValue::String(value.to_string()),
6992 )),
6993 }
6994 }
6995 }
6996
6997 impl serde::ser::Serialize for Status {
6998 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6999 where
7000 S: serde::Serializer,
7001 {
7002 match self {
7003 Self::Unspecified => serializer.serialize_i32(0),
7004 Self::Running => serializer.serialize_i32(1),
7005 Self::NotRunning => serializer.serialize_i32(2),
7006 Self::UnknownValue(u) => u.0.serialize(serializer),
7007 }
7008 }
7009 }
7010
7011 impl<'de> serde::de::Deserialize<'de> for Status {
7012 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7013 where
7014 D: serde::Deserializer<'de>,
7015 {
7016 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
7017 ".google.cloud.networkmanagement.v1.InstanceInfo.Status",
7018 ))
7019 }
7020 }
7021}
7022
7023/// For display only. Metadata associated with a Compute Engine network.
7024#[derive(Clone, Default, PartialEq)]
7025#[non_exhaustive]
7026pub struct NetworkInfo {
7027 /// Name of a Compute Engine network.
7028 pub display_name: std::string::String,
7029
7030 /// URI of a Compute Engine network.
7031 pub uri: std::string::String,
7032
7033 /// URI of the subnet matching the source IP address of the test.
7034 pub matched_subnet_uri: std::string::String,
7035
7036 /// The IP range of the subnet matching the source IP address of the test.
7037 pub matched_ip_range: std::string::String,
7038
7039 /// The region of the subnet matching the source IP address of the test.
7040 pub region: std::string::String,
7041
7042 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7043}
7044
7045impl NetworkInfo {
7046 /// Creates a new default instance.
7047 pub fn new() -> Self {
7048 std::default::Default::default()
7049 }
7050
7051 /// Sets the value of [display_name][crate::model::NetworkInfo::display_name].
7052 ///
7053 /// # Example
7054 /// ```ignore,no_run
7055 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7056 /// let x = NetworkInfo::new().set_display_name("example");
7057 /// ```
7058 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7059 self.display_name = v.into();
7060 self
7061 }
7062
7063 /// Sets the value of [uri][crate::model::NetworkInfo::uri].
7064 ///
7065 /// # Example
7066 /// ```ignore,no_run
7067 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7068 /// let x = NetworkInfo::new().set_uri("example");
7069 /// ```
7070 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7071 self.uri = v.into();
7072 self
7073 }
7074
7075 /// Sets the value of [matched_subnet_uri][crate::model::NetworkInfo::matched_subnet_uri].
7076 ///
7077 /// # Example
7078 /// ```ignore,no_run
7079 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7080 /// let x = NetworkInfo::new().set_matched_subnet_uri("example");
7081 /// ```
7082 pub fn set_matched_subnet_uri<T: std::convert::Into<std::string::String>>(
7083 mut self,
7084 v: T,
7085 ) -> Self {
7086 self.matched_subnet_uri = v.into();
7087 self
7088 }
7089
7090 /// Sets the value of [matched_ip_range][crate::model::NetworkInfo::matched_ip_range].
7091 ///
7092 /// # Example
7093 /// ```ignore,no_run
7094 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7095 /// let x = NetworkInfo::new().set_matched_ip_range("example");
7096 /// ```
7097 pub fn set_matched_ip_range<T: std::convert::Into<std::string::String>>(
7098 mut self,
7099 v: T,
7100 ) -> Self {
7101 self.matched_ip_range = v.into();
7102 self
7103 }
7104
7105 /// Sets the value of [region][crate::model::NetworkInfo::region].
7106 ///
7107 /// # Example
7108 /// ```ignore,no_run
7109 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7110 /// let x = NetworkInfo::new().set_region("example");
7111 /// ```
7112 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7113 self.region = v.into();
7114 self
7115 }
7116}
7117
7118impl wkt::message::Message for NetworkInfo {
7119 fn typename() -> &'static str {
7120 "type.googleapis.com/google.cloud.networkmanagement.v1.NetworkInfo"
7121 }
7122}
7123
7124/// For display only. Metadata associated with a VPC firewall rule, an implied
7125/// VPC firewall rule, or a firewall policy rule.
7126#[derive(Clone, Default, PartialEq)]
7127#[non_exhaustive]
7128pub struct FirewallInfo {
7129 /// The display name of the firewall rule. This field might be empty for
7130 /// firewall policy rules.
7131 pub display_name: std::string::String,
7132
7133 /// The URI of the firewall rule. This field is not applicable to implied
7134 /// VPC firewall rules.
7135 pub uri: std::string::String,
7136
7137 /// Possible values: INGRESS, EGRESS
7138 pub direction: std::string::String,
7139
7140 /// Possible values: ALLOW, DENY, APPLY_SECURITY_PROFILE_GROUP
7141 pub action: std::string::String,
7142
7143 /// The priority of the firewall rule.
7144 pub priority: i32,
7145
7146 /// The URI of the VPC network that the firewall rule is associated with.
7147 /// This field is not applicable to hierarchical firewall policy rules.
7148 pub network_uri: std::string::String,
7149
7150 /// The target tags defined by the VPC firewall rule. This field is not
7151 /// applicable to firewall policy rules.
7152 pub target_tags: std::vec::Vec<std::string::String>,
7153
7154 /// The target service accounts specified by the firewall rule.
7155 pub target_service_accounts: std::vec::Vec<std::string::String>,
7156
7157 /// The name of the firewall policy that this rule is associated with.
7158 /// This field is not applicable to VPC firewall rules and implied VPC firewall
7159 /// rules.
7160 pub policy: std::string::String,
7161
7162 /// The URI of the firewall policy that this rule is associated with.
7163 /// This field is not applicable to VPC firewall rules and implied VPC firewall
7164 /// rules.
7165 pub policy_uri: std::string::String,
7166
7167 /// The firewall rule's type.
7168 pub firewall_rule_type: crate::model::firewall_info::FirewallRuleType,
7169
7170 /// The priority of the firewall policy that this rule is associated with.
7171 /// This field is not applicable to VPC firewall rules and implied VPC firewall
7172 /// rules.
7173 pub policy_priority: i32,
7174
7175 /// Target type of the firewall rule.
7176 pub target_type: crate::model::firewall_info::TargetType,
7177
7178 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7179}
7180
7181impl FirewallInfo {
7182 /// Creates a new default instance.
7183 pub fn new() -> Self {
7184 std::default::Default::default()
7185 }
7186
7187 /// Sets the value of [display_name][crate::model::FirewallInfo::display_name].
7188 ///
7189 /// # Example
7190 /// ```ignore,no_run
7191 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7192 /// let x = FirewallInfo::new().set_display_name("example");
7193 /// ```
7194 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7195 self.display_name = v.into();
7196 self
7197 }
7198
7199 /// Sets the value of [uri][crate::model::FirewallInfo::uri].
7200 ///
7201 /// # Example
7202 /// ```ignore,no_run
7203 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7204 /// let x = FirewallInfo::new().set_uri("example");
7205 /// ```
7206 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7207 self.uri = v.into();
7208 self
7209 }
7210
7211 /// Sets the value of [direction][crate::model::FirewallInfo::direction].
7212 ///
7213 /// # Example
7214 /// ```ignore,no_run
7215 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7216 /// let x = FirewallInfo::new().set_direction("example");
7217 /// ```
7218 pub fn set_direction<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7219 self.direction = v.into();
7220 self
7221 }
7222
7223 /// Sets the value of [action][crate::model::FirewallInfo::action].
7224 ///
7225 /// # Example
7226 /// ```ignore,no_run
7227 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7228 /// let x = FirewallInfo::new().set_action("example");
7229 /// ```
7230 pub fn set_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7231 self.action = v.into();
7232 self
7233 }
7234
7235 /// Sets the value of [priority][crate::model::FirewallInfo::priority].
7236 ///
7237 /// # Example
7238 /// ```ignore,no_run
7239 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7240 /// let x = FirewallInfo::new().set_priority(42);
7241 /// ```
7242 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7243 self.priority = v.into();
7244 self
7245 }
7246
7247 /// Sets the value of [network_uri][crate::model::FirewallInfo::network_uri].
7248 ///
7249 /// # Example
7250 /// ```ignore,no_run
7251 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7252 /// let x = FirewallInfo::new().set_network_uri("example");
7253 /// ```
7254 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7255 self.network_uri = v.into();
7256 self
7257 }
7258
7259 /// Sets the value of [target_tags][crate::model::FirewallInfo::target_tags].
7260 ///
7261 /// # Example
7262 /// ```ignore,no_run
7263 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7264 /// let x = FirewallInfo::new().set_target_tags(["a", "b", "c"]);
7265 /// ```
7266 pub fn set_target_tags<T, V>(mut self, v: T) -> Self
7267 where
7268 T: std::iter::IntoIterator<Item = V>,
7269 V: std::convert::Into<std::string::String>,
7270 {
7271 use std::iter::Iterator;
7272 self.target_tags = v.into_iter().map(|i| i.into()).collect();
7273 self
7274 }
7275
7276 /// Sets the value of [target_service_accounts][crate::model::FirewallInfo::target_service_accounts].
7277 ///
7278 /// # Example
7279 /// ```ignore,no_run
7280 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7281 /// let x = FirewallInfo::new().set_target_service_accounts(["a", "b", "c"]);
7282 /// ```
7283 pub fn set_target_service_accounts<T, V>(mut self, v: T) -> Self
7284 where
7285 T: std::iter::IntoIterator<Item = V>,
7286 V: std::convert::Into<std::string::String>,
7287 {
7288 use std::iter::Iterator;
7289 self.target_service_accounts = v.into_iter().map(|i| i.into()).collect();
7290 self
7291 }
7292
7293 /// Sets the value of [policy][crate::model::FirewallInfo::policy].
7294 ///
7295 /// # Example
7296 /// ```ignore,no_run
7297 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7298 /// let x = FirewallInfo::new().set_policy("example");
7299 /// ```
7300 pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7301 self.policy = v.into();
7302 self
7303 }
7304
7305 /// Sets the value of [policy_uri][crate::model::FirewallInfo::policy_uri].
7306 ///
7307 /// # Example
7308 /// ```ignore,no_run
7309 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7310 /// let x = FirewallInfo::new().set_policy_uri("example");
7311 /// ```
7312 pub fn set_policy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7313 self.policy_uri = v.into();
7314 self
7315 }
7316
7317 /// Sets the value of [firewall_rule_type][crate::model::FirewallInfo::firewall_rule_type].
7318 ///
7319 /// # Example
7320 /// ```ignore,no_run
7321 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7322 /// use google_cloud_networkmanagement_v1::model::firewall_info::FirewallRuleType;
7323 /// let x0 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::HierarchicalFirewallPolicyRule);
7324 /// let x1 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::VpcFirewallRule);
7325 /// let x2 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::ImpliedVpcFirewallRule);
7326 /// ```
7327 pub fn set_firewall_rule_type<
7328 T: std::convert::Into<crate::model::firewall_info::FirewallRuleType>,
7329 >(
7330 mut self,
7331 v: T,
7332 ) -> Self {
7333 self.firewall_rule_type = v.into();
7334 self
7335 }
7336
7337 /// Sets the value of [policy_priority][crate::model::FirewallInfo::policy_priority].
7338 ///
7339 /// # Example
7340 /// ```ignore,no_run
7341 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7342 /// let x = FirewallInfo::new().set_policy_priority(42);
7343 /// ```
7344 pub fn set_policy_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7345 self.policy_priority = v.into();
7346 self
7347 }
7348
7349 /// Sets the value of [target_type][crate::model::FirewallInfo::target_type].
7350 ///
7351 /// # Example
7352 /// ```ignore,no_run
7353 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7354 /// use google_cloud_networkmanagement_v1::model::firewall_info::TargetType;
7355 /// let x0 = FirewallInfo::new().set_target_type(TargetType::Instances);
7356 /// let x1 = FirewallInfo::new().set_target_type(TargetType::InternalManagedLb);
7357 /// ```
7358 pub fn set_target_type<T: std::convert::Into<crate::model::firewall_info::TargetType>>(
7359 mut self,
7360 v: T,
7361 ) -> Self {
7362 self.target_type = v.into();
7363 self
7364 }
7365}
7366
7367impl wkt::message::Message for FirewallInfo {
7368 fn typename() -> &'static str {
7369 "type.googleapis.com/google.cloud.networkmanagement.v1.FirewallInfo"
7370 }
7371}
7372
7373/// Defines additional types related to [FirewallInfo].
7374pub mod firewall_info {
7375 #[allow(unused_imports)]
7376 use super::*;
7377
7378 /// The firewall rule's type.
7379 ///
7380 /// # Working with unknown values
7381 ///
7382 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7383 /// additional enum variants at any time. Adding new variants is not considered
7384 /// a breaking change. Applications should write their code in anticipation of:
7385 ///
7386 /// - New values appearing in future releases of the client library, **and**
7387 /// - New values received dynamically, without application changes.
7388 ///
7389 /// Please consult the [Working with enums] section in the user guide for some
7390 /// guidelines.
7391 ///
7392 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7393 #[derive(Clone, Debug, PartialEq)]
7394 #[non_exhaustive]
7395 pub enum FirewallRuleType {
7396 /// Unspecified type.
7397 Unspecified,
7398 /// Hierarchical firewall policy rule. For details, see
7399 /// [Hierarchical firewall policies
7400 /// overview](https://cloud.google.com/vpc/docs/firewall-policies).
7401 HierarchicalFirewallPolicyRule,
7402 /// VPC firewall rule. For details, see
7403 /// [VPC firewall rules
7404 /// overview](https://cloud.google.com/vpc/docs/firewalls).
7405 VpcFirewallRule,
7406 /// Implied VPC firewall rule. For details, see
7407 /// [Implied
7408 /// rules](https://cloud.google.com/vpc/docs/firewalls#default_firewall_rules).
7409 ImpliedVpcFirewallRule,
7410 /// Implicit firewall rules that are managed by serverless VPC access to
7411 /// allow ingress access. They are not visible in the Google Cloud console.
7412 /// For details, see [VPC connector's implicit
7413 /// rules](https://cloud.google.com/functions/docs/networking/connecting-vpc#restrict-access).
7414 ServerlessVpcAccessManagedFirewallRule,
7415 /// User-defined global network firewall policy rule.
7416 /// For details, see [Network firewall
7417 /// policies](https://cloud.google.com/vpc/docs/network-firewall-policies).
7418 NetworkFirewallPolicyRule,
7419 /// User-defined regional network firewall policy rule.
7420 /// For details, see [Regional network firewall
7421 /// policies](https://cloud.google.com/firewall/docs/regional-firewall-policies).
7422 NetworkRegionalFirewallPolicyRule,
7423 /// System-defined global network firewall policy rule.
7424 SystemNetworkFirewallPolicyRule,
7425 /// System-defined regional network firewall policy rule.
7426 SystemRegionalNetworkFirewallPolicyRule,
7427 /// Firewall policy rule containing attributes not yet supported in
7428 /// Connectivity tests. Firewall analysis is skipped if such a rule can
7429 /// potentially be matched. Please see the [list of unsupported
7430 /// configurations](https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/concepts/overview#unsupported-configs).
7431 UnsupportedFirewallPolicyRule,
7432 /// Tracking state for response traffic created when request traffic goes
7433 /// through allow firewall rule.
7434 /// For details, see [firewall rules
7435 /// specifications](https://cloud.google.com/firewall/docs/firewalls#specifications)
7436 TrackingState,
7437 /// Firewall analysis was skipped due to executing Connectivity Test in the
7438 /// BypassFirewallChecks mode
7439 AnalysisSkipped,
7440 /// If set, the enum was initialized with an unknown value.
7441 ///
7442 /// Applications can examine the value using [FirewallRuleType::value] or
7443 /// [FirewallRuleType::name].
7444 UnknownValue(firewall_rule_type::UnknownValue),
7445 }
7446
7447 #[doc(hidden)]
7448 pub mod firewall_rule_type {
7449 #[allow(unused_imports)]
7450 use super::*;
7451 #[derive(Clone, Debug, PartialEq)]
7452 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7453 }
7454
7455 impl FirewallRuleType {
7456 /// Gets the enum value.
7457 ///
7458 /// Returns `None` if the enum contains an unknown value deserialized from
7459 /// the string representation of enums.
7460 pub fn value(&self) -> std::option::Option<i32> {
7461 match self {
7462 Self::Unspecified => std::option::Option::Some(0),
7463 Self::HierarchicalFirewallPolicyRule => std::option::Option::Some(1),
7464 Self::VpcFirewallRule => std::option::Option::Some(2),
7465 Self::ImpliedVpcFirewallRule => std::option::Option::Some(3),
7466 Self::ServerlessVpcAccessManagedFirewallRule => std::option::Option::Some(4),
7467 Self::NetworkFirewallPolicyRule => std::option::Option::Some(5),
7468 Self::NetworkRegionalFirewallPolicyRule => std::option::Option::Some(6),
7469 Self::SystemNetworkFirewallPolicyRule => std::option::Option::Some(7),
7470 Self::SystemRegionalNetworkFirewallPolicyRule => std::option::Option::Some(8),
7471 Self::UnsupportedFirewallPolicyRule => std::option::Option::Some(100),
7472 Self::TrackingState => std::option::Option::Some(101),
7473 Self::AnalysisSkipped => std::option::Option::Some(102),
7474 Self::UnknownValue(u) => u.0.value(),
7475 }
7476 }
7477
7478 /// Gets the enum value as a string.
7479 ///
7480 /// Returns `None` if the enum contains an unknown value deserialized from
7481 /// the integer representation of enums.
7482 pub fn name(&self) -> std::option::Option<&str> {
7483 match self {
7484 Self::Unspecified => std::option::Option::Some("FIREWALL_RULE_TYPE_UNSPECIFIED"),
7485 Self::HierarchicalFirewallPolicyRule => {
7486 std::option::Option::Some("HIERARCHICAL_FIREWALL_POLICY_RULE")
7487 }
7488 Self::VpcFirewallRule => std::option::Option::Some("VPC_FIREWALL_RULE"),
7489 Self::ImpliedVpcFirewallRule => {
7490 std::option::Option::Some("IMPLIED_VPC_FIREWALL_RULE")
7491 }
7492 Self::ServerlessVpcAccessManagedFirewallRule => {
7493 std::option::Option::Some("SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE")
7494 }
7495 Self::NetworkFirewallPolicyRule => {
7496 std::option::Option::Some("NETWORK_FIREWALL_POLICY_RULE")
7497 }
7498 Self::NetworkRegionalFirewallPolicyRule => {
7499 std::option::Option::Some("NETWORK_REGIONAL_FIREWALL_POLICY_RULE")
7500 }
7501 Self::SystemNetworkFirewallPolicyRule => {
7502 std::option::Option::Some("SYSTEM_NETWORK_FIREWALL_POLICY_RULE")
7503 }
7504 Self::SystemRegionalNetworkFirewallPolicyRule => {
7505 std::option::Option::Some("SYSTEM_REGIONAL_NETWORK_FIREWALL_POLICY_RULE")
7506 }
7507 Self::UnsupportedFirewallPolicyRule => {
7508 std::option::Option::Some("UNSUPPORTED_FIREWALL_POLICY_RULE")
7509 }
7510 Self::TrackingState => std::option::Option::Some("TRACKING_STATE"),
7511 Self::AnalysisSkipped => std::option::Option::Some("ANALYSIS_SKIPPED"),
7512 Self::UnknownValue(u) => u.0.name(),
7513 }
7514 }
7515 }
7516
7517 impl std::default::Default for FirewallRuleType {
7518 fn default() -> Self {
7519 use std::convert::From;
7520 Self::from(0)
7521 }
7522 }
7523
7524 impl std::fmt::Display for FirewallRuleType {
7525 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7526 wkt::internal::display_enum(f, self.name(), self.value())
7527 }
7528 }
7529
7530 impl std::convert::From<i32> for FirewallRuleType {
7531 fn from(value: i32) -> Self {
7532 match value {
7533 0 => Self::Unspecified,
7534 1 => Self::HierarchicalFirewallPolicyRule,
7535 2 => Self::VpcFirewallRule,
7536 3 => Self::ImpliedVpcFirewallRule,
7537 4 => Self::ServerlessVpcAccessManagedFirewallRule,
7538 5 => Self::NetworkFirewallPolicyRule,
7539 6 => Self::NetworkRegionalFirewallPolicyRule,
7540 7 => Self::SystemNetworkFirewallPolicyRule,
7541 8 => Self::SystemRegionalNetworkFirewallPolicyRule,
7542 100 => Self::UnsupportedFirewallPolicyRule,
7543 101 => Self::TrackingState,
7544 102 => Self::AnalysisSkipped,
7545 _ => Self::UnknownValue(firewall_rule_type::UnknownValue(
7546 wkt::internal::UnknownEnumValue::Integer(value),
7547 )),
7548 }
7549 }
7550 }
7551
7552 impl std::convert::From<&str> for FirewallRuleType {
7553 fn from(value: &str) -> Self {
7554 use std::string::ToString;
7555 match value {
7556 "FIREWALL_RULE_TYPE_UNSPECIFIED" => Self::Unspecified,
7557 "HIERARCHICAL_FIREWALL_POLICY_RULE" => Self::HierarchicalFirewallPolicyRule,
7558 "VPC_FIREWALL_RULE" => Self::VpcFirewallRule,
7559 "IMPLIED_VPC_FIREWALL_RULE" => Self::ImpliedVpcFirewallRule,
7560 "SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE" => {
7561 Self::ServerlessVpcAccessManagedFirewallRule
7562 }
7563 "NETWORK_FIREWALL_POLICY_RULE" => Self::NetworkFirewallPolicyRule,
7564 "NETWORK_REGIONAL_FIREWALL_POLICY_RULE" => Self::NetworkRegionalFirewallPolicyRule,
7565 "SYSTEM_NETWORK_FIREWALL_POLICY_RULE" => Self::SystemNetworkFirewallPolicyRule,
7566 "SYSTEM_REGIONAL_NETWORK_FIREWALL_POLICY_RULE" => {
7567 Self::SystemRegionalNetworkFirewallPolicyRule
7568 }
7569 "UNSUPPORTED_FIREWALL_POLICY_RULE" => Self::UnsupportedFirewallPolicyRule,
7570 "TRACKING_STATE" => Self::TrackingState,
7571 "ANALYSIS_SKIPPED" => Self::AnalysisSkipped,
7572 _ => Self::UnknownValue(firewall_rule_type::UnknownValue(
7573 wkt::internal::UnknownEnumValue::String(value.to_string()),
7574 )),
7575 }
7576 }
7577 }
7578
7579 impl serde::ser::Serialize for FirewallRuleType {
7580 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7581 where
7582 S: serde::Serializer,
7583 {
7584 match self {
7585 Self::Unspecified => serializer.serialize_i32(0),
7586 Self::HierarchicalFirewallPolicyRule => serializer.serialize_i32(1),
7587 Self::VpcFirewallRule => serializer.serialize_i32(2),
7588 Self::ImpliedVpcFirewallRule => serializer.serialize_i32(3),
7589 Self::ServerlessVpcAccessManagedFirewallRule => serializer.serialize_i32(4),
7590 Self::NetworkFirewallPolicyRule => serializer.serialize_i32(5),
7591 Self::NetworkRegionalFirewallPolicyRule => serializer.serialize_i32(6),
7592 Self::SystemNetworkFirewallPolicyRule => serializer.serialize_i32(7),
7593 Self::SystemRegionalNetworkFirewallPolicyRule => serializer.serialize_i32(8),
7594 Self::UnsupportedFirewallPolicyRule => serializer.serialize_i32(100),
7595 Self::TrackingState => serializer.serialize_i32(101),
7596 Self::AnalysisSkipped => serializer.serialize_i32(102),
7597 Self::UnknownValue(u) => u.0.serialize(serializer),
7598 }
7599 }
7600 }
7601
7602 impl<'de> serde::de::Deserialize<'de> for FirewallRuleType {
7603 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7604 where
7605 D: serde::Deserializer<'de>,
7606 {
7607 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FirewallRuleType>::new(
7608 ".google.cloud.networkmanagement.v1.FirewallInfo.FirewallRuleType",
7609 ))
7610 }
7611 }
7612
7613 /// Target type of the firewall rule.
7614 ///
7615 /// # Working with unknown values
7616 ///
7617 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7618 /// additional enum variants at any time. Adding new variants is not considered
7619 /// a breaking change. Applications should write their code in anticipation of:
7620 ///
7621 /// - New values appearing in future releases of the client library, **and**
7622 /// - New values received dynamically, without application changes.
7623 ///
7624 /// Please consult the [Working with enums] section in the user guide for some
7625 /// guidelines.
7626 ///
7627 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7628 #[derive(Clone, Debug, PartialEq)]
7629 #[non_exhaustive]
7630 pub enum TargetType {
7631 /// Target type is not specified. In this case we treat the rule as applying
7632 /// to INSTANCES target type.
7633 Unspecified,
7634 /// Firewall rule applies to instances.
7635 Instances,
7636 /// Firewall rule applies to internal managed load balancers.
7637 InternalManagedLb,
7638 /// If set, the enum was initialized with an unknown value.
7639 ///
7640 /// Applications can examine the value using [TargetType::value] or
7641 /// [TargetType::name].
7642 UnknownValue(target_type::UnknownValue),
7643 }
7644
7645 #[doc(hidden)]
7646 pub mod target_type {
7647 #[allow(unused_imports)]
7648 use super::*;
7649 #[derive(Clone, Debug, PartialEq)]
7650 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7651 }
7652
7653 impl TargetType {
7654 /// Gets the enum value.
7655 ///
7656 /// Returns `None` if the enum contains an unknown value deserialized from
7657 /// the string representation of enums.
7658 pub fn value(&self) -> std::option::Option<i32> {
7659 match self {
7660 Self::Unspecified => std::option::Option::Some(0),
7661 Self::Instances => std::option::Option::Some(1),
7662 Self::InternalManagedLb => std::option::Option::Some(2),
7663 Self::UnknownValue(u) => u.0.value(),
7664 }
7665 }
7666
7667 /// Gets the enum value as a string.
7668 ///
7669 /// Returns `None` if the enum contains an unknown value deserialized from
7670 /// the integer representation of enums.
7671 pub fn name(&self) -> std::option::Option<&str> {
7672 match self {
7673 Self::Unspecified => std::option::Option::Some("TARGET_TYPE_UNSPECIFIED"),
7674 Self::Instances => std::option::Option::Some("INSTANCES"),
7675 Self::InternalManagedLb => std::option::Option::Some("INTERNAL_MANAGED_LB"),
7676 Self::UnknownValue(u) => u.0.name(),
7677 }
7678 }
7679 }
7680
7681 impl std::default::Default for TargetType {
7682 fn default() -> Self {
7683 use std::convert::From;
7684 Self::from(0)
7685 }
7686 }
7687
7688 impl std::fmt::Display for TargetType {
7689 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7690 wkt::internal::display_enum(f, self.name(), self.value())
7691 }
7692 }
7693
7694 impl std::convert::From<i32> for TargetType {
7695 fn from(value: i32) -> Self {
7696 match value {
7697 0 => Self::Unspecified,
7698 1 => Self::Instances,
7699 2 => Self::InternalManagedLb,
7700 _ => Self::UnknownValue(target_type::UnknownValue(
7701 wkt::internal::UnknownEnumValue::Integer(value),
7702 )),
7703 }
7704 }
7705 }
7706
7707 impl std::convert::From<&str> for TargetType {
7708 fn from(value: &str) -> Self {
7709 use std::string::ToString;
7710 match value {
7711 "TARGET_TYPE_UNSPECIFIED" => Self::Unspecified,
7712 "INSTANCES" => Self::Instances,
7713 "INTERNAL_MANAGED_LB" => Self::InternalManagedLb,
7714 _ => Self::UnknownValue(target_type::UnknownValue(
7715 wkt::internal::UnknownEnumValue::String(value.to_string()),
7716 )),
7717 }
7718 }
7719 }
7720
7721 impl serde::ser::Serialize for TargetType {
7722 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7723 where
7724 S: serde::Serializer,
7725 {
7726 match self {
7727 Self::Unspecified => serializer.serialize_i32(0),
7728 Self::Instances => serializer.serialize_i32(1),
7729 Self::InternalManagedLb => serializer.serialize_i32(2),
7730 Self::UnknownValue(u) => u.0.serialize(serializer),
7731 }
7732 }
7733 }
7734
7735 impl<'de> serde::de::Deserialize<'de> for TargetType {
7736 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7737 where
7738 D: serde::Deserializer<'de>,
7739 {
7740 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetType>::new(
7741 ".google.cloud.networkmanagement.v1.FirewallInfo.TargetType",
7742 ))
7743 }
7744 }
7745}
7746
7747/// For display only. Metadata associated with a Compute Engine route.
7748#[derive(Clone, Default, PartialEq)]
7749#[non_exhaustive]
7750pub struct RouteInfo {
7751 /// Type of route.
7752 pub route_type: crate::model::route_info::RouteType,
7753
7754 /// Type of next hop.
7755 pub next_hop_type: crate::model::route_info::NextHopType,
7756
7757 /// Indicates where route is applicable. Deprecated, routes with NCC_HUB scope
7758 /// are not included in the trace in new tests.
7759 #[deprecated]
7760 pub route_scope: crate::model::route_info::RouteScope,
7761
7762 /// Name of a route.
7763 pub display_name: std::string::String,
7764
7765 /// URI of a route. SUBNET, STATIC, PEERING_SUBNET (only for peering network)
7766 /// and POLICY_BASED routes only.
7767 pub uri: std::string::String,
7768
7769 /// Region of the route. DYNAMIC, PEERING_DYNAMIC, POLICY_BASED and ADVERTISED
7770 /// routes only. If set for POLICY_BASED route, this is a region of VLAN
7771 /// attachments for Cloud Interconnect the route applies to. If set to "all"
7772 /// for POLICY_BASED route, the route applies to VLAN attachments of Cloud
7773 /// Interconnect in all regions.
7774 pub region: std::string::String,
7775
7776 /// Destination IP range of the route.
7777 pub dest_ip_range: std::string::String,
7778
7779 /// String type of the next hop of the route (for example, "VPN tunnel").
7780 /// Deprecated in favor of the next_hop_type and next_hop_uri fields, not used
7781 /// in new tests.
7782 #[deprecated]
7783 pub next_hop: std::string::String,
7784
7785 /// URI of a VPC network where route is located.
7786 pub network_uri: std::string::String,
7787
7788 /// Priority of the route.
7789 pub priority: i32,
7790
7791 /// Instance tags of the route.
7792 pub instance_tags: std::vec::Vec<std::string::String>,
7793
7794 /// Source IP address range of the route. POLICY_BASED routes only.
7795 pub src_ip_range: std::string::String,
7796
7797 /// Destination port ranges of the route. POLICY_BASED routes only.
7798 pub dest_port_ranges: std::vec::Vec<std::string::String>,
7799
7800 /// Source port ranges of the route. POLICY_BASED routes only.
7801 pub src_port_ranges: std::vec::Vec<std::string::String>,
7802
7803 /// Protocols of the route. POLICY_BASED routes only.
7804 pub protocols: std::vec::Vec<std::string::String>,
7805
7806 /// URI of the NCC Hub the route is advertised by. PEERING_SUBNET and
7807 /// PEERING_DYNAMIC routes that are advertised by NCC Hub only.
7808 pub ncc_hub_uri: std::option::Option<std::string::String>,
7809
7810 /// URI of the destination NCC Spoke. PEERING_SUBNET and PEERING_DYNAMIC routes
7811 /// that are advertised by NCC Hub only.
7812 pub ncc_spoke_uri: std::option::Option<std::string::String>,
7813
7814 /// For ADVERTISED dynamic routes, the URI of the Cloud Router that advertised
7815 /// the corresponding IP prefix.
7816 pub advertised_route_source_router_uri: std::option::Option<std::string::String>,
7817
7818 /// For ADVERTISED routes, the URI of their next hop, i.e. the URI of the
7819 /// hybrid endpoint (VPN tunnel, Interconnect attachment, NCC router appliance)
7820 /// the advertised prefix is advertised through, or URI of the source peered
7821 /// network. Deprecated in favor of the next_hop_uri field, not used in new
7822 /// tests.
7823 #[deprecated]
7824 pub advertised_route_next_hop_uri: std::option::Option<std::string::String>,
7825
7826 /// URI of the next hop resource.
7827 pub next_hop_uri: std::string::String,
7828
7829 /// URI of a VPC network where the next hop resource is located.
7830 pub next_hop_network_uri: std::string::String,
7831
7832 /// For PEERING_SUBNET and PEERING_STATIC routes, the URI of the originating
7833 /// SUBNET/STATIC route.
7834 pub originating_route_uri: std::string::String,
7835
7836 /// For PEERING_SUBNET, PEERING_STATIC and PEERING_DYNAMIC routes, the name of
7837 /// the originating SUBNET/STATIC/DYNAMIC route.
7838 pub originating_route_display_name: std::string::String,
7839
7840 /// For PEERING_SUBNET and PEERING_DYNAMIC routes that are advertised by NCC
7841 /// Hub, the URI of the corresponding route in NCC Hub's routing table.
7842 pub ncc_hub_route_uri: std::string::String,
7843
7844 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7845}
7846
7847impl RouteInfo {
7848 /// Creates a new default instance.
7849 pub fn new() -> Self {
7850 std::default::Default::default()
7851 }
7852
7853 /// Sets the value of [route_type][crate::model::RouteInfo::route_type].
7854 ///
7855 /// # Example
7856 /// ```ignore,no_run
7857 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7858 /// use google_cloud_networkmanagement_v1::model::route_info::RouteType;
7859 /// let x0 = RouteInfo::new().set_route_type(RouteType::Subnet);
7860 /// let x1 = RouteInfo::new().set_route_type(RouteType::Static);
7861 /// let x2 = RouteInfo::new().set_route_type(RouteType::Dynamic);
7862 /// ```
7863 pub fn set_route_type<T: std::convert::Into<crate::model::route_info::RouteType>>(
7864 mut self,
7865 v: T,
7866 ) -> Self {
7867 self.route_type = v.into();
7868 self
7869 }
7870
7871 /// Sets the value of [next_hop_type][crate::model::RouteInfo::next_hop_type].
7872 ///
7873 /// # Example
7874 /// ```ignore,no_run
7875 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7876 /// use google_cloud_networkmanagement_v1::model::route_info::NextHopType;
7877 /// let x0 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopIp);
7878 /// let x1 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopInstance);
7879 /// let x2 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopNetwork);
7880 /// ```
7881 pub fn set_next_hop_type<T: std::convert::Into<crate::model::route_info::NextHopType>>(
7882 mut self,
7883 v: T,
7884 ) -> Self {
7885 self.next_hop_type = v.into();
7886 self
7887 }
7888
7889 /// Sets the value of [route_scope][crate::model::RouteInfo::route_scope].
7890 ///
7891 /// # Example
7892 /// ```ignore,no_run
7893 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7894 /// use google_cloud_networkmanagement_v1::model::route_info::RouteScope;
7895 /// let x0 = RouteInfo::new().set_route_scope(RouteScope::Network);
7896 /// let x1 = RouteInfo::new().set_route_scope(RouteScope::NccHub);
7897 /// ```
7898 #[deprecated]
7899 pub fn set_route_scope<T: std::convert::Into<crate::model::route_info::RouteScope>>(
7900 mut self,
7901 v: T,
7902 ) -> Self {
7903 self.route_scope = v.into();
7904 self
7905 }
7906
7907 /// Sets the value of [display_name][crate::model::RouteInfo::display_name].
7908 ///
7909 /// # Example
7910 /// ```ignore,no_run
7911 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7912 /// let x = RouteInfo::new().set_display_name("example");
7913 /// ```
7914 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7915 self.display_name = v.into();
7916 self
7917 }
7918
7919 /// Sets the value of [uri][crate::model::RouteInfo::uri].
7920 ///
7921 /// # Example
7922 /// ```ignore,no_run
7923 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7924 /// let x = RouteInfo::new().set_uri("example");
7925 /// ```
7926 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7927 self.uri = v.into();
7928 self
7929 }
7930
7931 /// Sets the value of [region][crate::model::RouteInfo::region].
7932 ///
7933 /// # Example
7934 /// ```ignore,no_run
7935 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7936 /// let x = RouteInfo::new().set_region("example");
7937 /// ```
7938 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7939 self.region = v.into();
7940 self
7941 }
7942
7943 /// Sets the value of [dest_ip_range][crate::model::RouteInfo::dest_ip_range].
7944 ///
7945 /// # Example
7946 /// ```ignore,no_run
7947 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7948 /// let x = RouteInfo::new().set_dest_ip_range("example");
7949 /// ```
7950 pub fn set_dest_ip_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7951 self.dest_ip_range = v.into();
7952 self
7953 }
7954
7955 /// Sets the value of [next_hop][crate::model::RouteInfo::next_hop].
7956 ///
7957 /// # Example
7958 /// ```ignore,no_run
7959 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7960 /// let x = RouteInfo::new().set_next_hop("example");
7961 /// ```
7962 #[deprecated]
7963 pub fn set_next_hop<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7964 self.next_hop = v.into();
7965 self
7966 }
7967
7968 /// Sets the value of [network_uri][crate::model::RouteInfo::network_uri].
7969 ///
7970 /// # Example
7971 /// ```ignore,no_run
7972 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7973 /// let x = RouteInfo::new().set_network_uri("example");
7974 /// ```
7975 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7976 self.network_uri = v.into();
7977 self
7978 }
7979
7980 /// Sets the value of [priority][crate::model::RouteInfo::priority].
7981 ///
7982 /// # Example
7983 /// ```ignore,no_run
7984 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7985 /// let x = RouteInfo::new().set_priority(42);
7986 /// ```
7987 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7988 self.priority = v.into();
7989 self
7990 }
7991
7992 /// Sets the value of [instance_tags][crate::model::RouteInfo::instance_tags].
7993 ///
7994 /// # Example
7995 /// ```ignore,no_run
7996 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7997 /// let x = RouteInfo::new().set_instance_tags(["a", "b", "c"]);
7998 /// ```
7999 pub fn set_instance_tags<T, V>(mut self, v: T) -> Self
8000 where
8001 T: std::iter::IntoIterator<Item = V>,
8002 V: std::convert::Into<std::string::String>,
8003 {
8004 use std::iter::Iterator;
8005 self.instance_tags = v.into_iter().map(|i| i.into()).collect();
8006 self
8007 }
8008
8009 /// Sets the value of [src_ip_range][crate::model::RouteInfo::src_ip_range].
8010 ///
8011 /// # Example
8012 /// ```ignore,no_run
8013 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8014 /// let x = RouteInfo::new().set_src_ip_range("example");
8015 /// ```
8016 pub fn set_src_ip_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8017 self.src_ip_range = v.into();
8018 self
8019 }
8020
8021 /// Sets the value of [dest_port_ranges][crate::model::RouteInfo::dest_port_ranges].
8022 ///
8023 /// # Example
8024 /// ```ignore,no_run
8025 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8026 /// let x = RouteInfo::new().set_dest_port_ranges(["a", "b", "c"]);
8027 /// ```
8028 pub fn set_dest_port_ranges<T, V>(mut self, v: T) -> Self
8029 where
8030 T: std::iter::IntoIterator<Item = V>,
8031 V: std::convert::Into<std::string::String>,
8032 {
8033 use std::iter::Iterator;
8034 self.dest_port_ranges = v.into_iter().map(|i| i.into()).collect();
8035 self
8036 }
8037
8038 /// Sets the value of [src_port_ranges][crate::model::RouteInfo::src_port_ranges].
8039 ///
8040 /// # Example
8041 /// ```ignore,no_run
8042 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8043 /// let x = RouteInfo::new().set_src_port_ranges(["a", "b", "c"]);
8044 /// ```
8045 pub fn set_src_port_ranges<T, V>(mut self, v: T) -> Self
8046 where
8047 T: std::iter::IntoIterator<Item = V>,
8048 V: std::convert::Into<std::string::String>,
8049 {
8050 use std::iter::Iterator;
8051 self.src_port_ranges = v.into_iter().map(|i| i.into()).collect();
8052 self
8053 }
8054
8055 /// Sets the value of [protocols][crate::model::RouteInfo::protocols].
8056 ///
8057 /// # Example
8058 /// ```ignore,no_run
8059 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8060 /// let x = RouteInfo::new().set_protocols(["a", "b", "c"]);
8061 /// ```
8062 pub fn set_protocols<T, V>(mut self, v: T) -> Self
8063 where
8064 T: std::iter::IntoIterator<Item = V>,
8065 V: std::convert::Into<std::string::String>,
8066 {
8067 use std::iter::Iterator;
8068 self.protocols = v.into_iter().map(|i| i.into()).collect();
8069 self
8070 }
8071
8072 /// Sets the value of [ncc_hub_uri][crate::model::RouteInfo::ncc_hub_uri].
8073 ///
8074 /// # Example
8075 /// ```ignore,no_run
8076 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8077 /// let x = RouteInfo::new().set_ncc_hub_uri("example");
8078 /// ```
8079 pub fn set_ncc_hub_uri<T>(mut self, v: T) -> Self
8080 where
8081 T: std::convert::Into<std::string::String>,
8082 {
8083 self.ncc_hub_uri = std::option::Option::Some(v.into());
8084 self
8085 }
8086
8087 /// Sets or clears the value of [ncc_hub_uri][crate::model::RouteInfo::ncc_hub_uri].
8088 ///
8089 /// # Example
8090 /// ```ignore,no_run
8091 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8092 /// let x = RouteInfo::new().set_or_clear_ncc_hub_uri(Some("example"));
8093 /// let x = RouteInfo::new().set_or_clear_ncc_hub_uri(None::<String>);
8094 /// ```
8095 pub fn set_or_clear_ncc_hub_uri<T>(mut self, v: std::option::Option<T>) -> Self
8096 where
8097 T: std::convert::Into<std::string::String>,
8098 {
8099 self.ncc_hub_uri = v.map(|x| x.into());
8100 self
8101 }
8102
8103 /// Sets the value of [ncc_spoke_uri][crate::model::RouteInfo::ncc_spoke_uri].
8104 ///
8105 /// # Example
8106 /// ```ignore,no_run
8107 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8108 /// let x = RouteInfo::new().set_ncc_spoke_uri("example");
8109 /// ```
8110 pub fn set_ncc_spoke_uri<T>(mut self, v: T) -> Self
8111 where
8112 T: std::convert::Into<std::string::String>,
8113 {
8114 self.ncc_spoke_uri = std::option::Option::Some(v.into());
8115 self
8116 }
8117
8118 /// Sets or clears the value of [ncc_spoke_uri][crate::model::RouteInfo::ncc_spoke_uri].
8119 ///
8120 /// # Example
8121 /// ```ignore,no_run
8122 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8123 /// let x = RouteInfo::new().set_or_clear_ncc_spoke_uri(Some("example"));
8124 /// let x = RouteInfo::new().set_or_clear_ncc_spoke_uri(None::<String>);
8125 /// ```
8126 pub fn set_or_clear_ncc_spoke_uri<T>(mut self, v: std::option::Option<T>) -> Self
8127 where
8128 T: std::convert::Into<std::string::String>,
8129 {
8130 self.ncc_spoke_uri = v.map(|x| x.into());
8131 self
8132 }
8133
8134 /// Sets the value of [advertised_route_source_router_uri][crate::model::RouteInfo::advertised_route_source_router_uri].
8135 ///
8136 /// # Example
8137 /// ```ignore,no_run
8138 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8139 /// let x = RouteInfo::new().set_advertised_route_source_router_uri("example");
8140 /// ```
8141 pub fn set_advertised_route_source_router_uri<T>(mut self, v: T) -> Self
8142 where
8143 T: std::convert::Into<std::string::String>,
8144 {
8145 self.advertised_route_source_router_uri = std::option::Option::Some(v.into());
8146 self
8147 }
8148
8149 /// Sets or clears the value of [advertised_route_source_router_uri][crate::model::RouteInfo::advertised_route_source_router_uri].
8150 ///
8151 /// # Example
8152 /// ```ignore,no_run
8153 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8154 /// let x = RouteInfo::new().set_or_clear_advertised_route_source_router_uri(Some("example"));
8155 /// let x = RouteInfo::new().set_or_clear_advertised_route_source_router_uri(None::<String>);
8156 /// ```
8157 pub fn set_or_clear_advertised_route_source_router_uri<T>(
8158 mut self,
8159 v: std::option::Option<T>,
8160 ) -> Self
8161 where
8162 T: std::convert::Into<std::string::String>,
8163 {
8164 self.advertised_route_source_router_uri = v.map(|x| x.into());
8165 self
8166 }
8167
8168 /// Sets the value of [advertised_route_next_hop_uri][crate::model::RouteInfo::advertised_route_next_hop_uri].
8169 ///
8170 /// # Example
8171 /// ```ignore,no_run
8172 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8173 /// let x = RouteInfo::new().set_advertised_route_next_hop_uri("example");
8174 /// ```
8175 #[deprecated]
8176 pub fn set_advertised_route_next_hop_uri<T>(mut self, v: T) -> Self
8177 where
8178 T: std::convert::Into<std::string::String>,
8179 {
8180 self.advertised_route_next_hop_uri = std::option::Option::Some(v.into());
8181 self
8182 }
8183
8184 /// Sets or clears the value of [advertised_route_next_hop_uri][crate::model::RouteInfo::advertised_route_next_hop_uri].
8185 ///
8186 /// # Example
8187 /// ```ignore,no_run
8188 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8189 /// let x = RouteInfo::new().set_or_clear_advertised_route_next_hop_uri(Some("example"));
8190 /// let x = RouteInfo::new().set_or_clear_advertised_route_next_hop_uri(None::<String>);
8191 /// ```
8192 #[deprecated]
8193 pub fn set_or_clear_advertised_route_next_hop_uri<T>(
8194 mut self,
8195 v: std::option::Option<T>,
8196 ) -> Self
8197 where
8198 T: std::convert::Into<std::string::String>,
8199 {
8200 self.advertised_route_next_hop_uri = v.map(|x| x.into());
8201 self
8202 }
8203
8204 /// Sets the value of [next_hop_uri][crate::model::RouteInfo::next_hop_uri].
8205 ///
8206 /// # Example
8207 /// ```ignore,no_run
8208 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8209 /// let x = RouteInfo::new().set_next_hop_uri("example");
8210 /// ```
8211 pub fn set_next_hop_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8212 self.next_hop_uri = v.into();
8213 self
8214 }
8215
8216 /// Sets the value of [next_hop_network_uri][crate::model::RouteInfo::next_hop_network_uri].
8217 ///
8218 /// # Example
8219 /// ```ignore,no_run
8220 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8221 /// let x = RouteInfo::new().set_next_hop_network_uri("example");
8222 /// ```
8223 pub fn set_next_hop_network_uri<T: std::convert::Into<std::string::String>>(
8224 mut self,
8225 v: T,
8226 ) -> Self {
8227 self.next_hop_network_uri = v.into();
8228 self
8229 }
8230
8231 /// Sets the value of [originating_route_uri][crate::model::RouteInfo::originating_route_uri].
8232 ///
8233 /// # Example
8234 /// ```ignore,no_run
8235 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8236 /// let x = RouteInfo::new().set_originating_route_uri("example");
8237 /// ```
8238 pub fn set_originating_route_uri<T: std::convert::Into<std::string::String>>(
8239 mut self,
8240 v: T,
8241 ) -> Self {
8242 self.originating_route_uri = v.into();
8243 self
8244 }
8245
8246 /// Sets the value of [originating_route_display_name][crate::model::RouteInfo::originating_route_display_name].
8247 ///
8248 /// # Example
8249 /// ```ignore,no_run
8250 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8251 /// let x = RouteInfo::new().set_originating_route_display_name("example");
8252 /// ```
8253 pub fn set_originating_route_display_name<T: std::convert::Into<std::string::String>>(
8254 mut self,
8255 v: T,
8256 ) -> Self {
8257 self.originating_route_display_name = v.into();
8258 self
8259 }
8260
8261 /// Sets the value of [ncc_hub_route_uri][crate::model::RouteInfo::ncc_hub_route_uri].
8262 ///
8263 /// # Example
8264 /// ```ignore,no_run
8265 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8266 /// let x = RouteInfo::new().set_ncc_hub_route_uri("example");
8267 /// ```
8268 pub fn set_ncc_hub_route_uri<T: std::convert::Into<std::string::String>>(
8269 mut self,
8270 v: T,
8271 ) -> Self {
8272 self.ncc_hub_route_uri = v.into();
8273 self
8274 }
8275}
8276
8277impl wkt::message::Message for RouteInfo {
8278 fn typename() -> &'static str {
8279 "type.googleapis.com/google.cloud.networkmanagement.v1.RouteInfo"
8280 }
8281}
8282
8283/// Defines additional types related to [RouteInfo].
8284pub mod route_info {
8285 #[allow(unused_imports)]
8286 use super::*;
8287
8288 /// Type of route:
8289 ///
8290 /// # Working with unknown values
8291 ///
8292 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8293 /// additional enum variants at any time. Adding new variants is not considered
8294 /// a breaking change. Applications should write their code in anticipation of:
8295 ///
8296 /// - New values appearing in future releases of the client library, **and**
8297 /// - New values received dynamically, without application changes.
8298 ///
8299 /// Please consult the [Working with enums] section in the user guide for some
8300 /// guidelines.
8301 ///
8302 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8303 #[derive(Clone, Debug, PartialEq)]
8304 #[non_exhaustive]
8305 pub enum RouteType {
8306 /// Unspecified type. Default value.
8307 Unspecified,
8308 /// Route is a subnet route automatically created by the system.
8309 Subnet,
8310 /// Static route created by the user, including the default route to the
8311 /// internet.
8312 Static,
8313 /// Dynamic route exchanged between BGP peers.
8314 Dynamic,
8315 /// A subnet route received from peering network or NCC Hub.
8316 PeeringSubnet,
8317 /// A static route received from peering network.
8318 PeeringStatic,
8319 /// A dynamic route received from peering network or NCC Hub.
8320 PeeringDynamic,
8321 /// Policy based route.
8322 PolicyBased,
8323 /// Advertised route. Synthetic route which is used to transition from the
8324 /// StartFromPrivateNetwork state in Connectivity tests.
8325 Advertised,
8326 /// If set, the enum was initialized with an unknown value.
8327 ///
8328 /// Applications can examine the value using [RouteType::value] or
8329 /// [RouteType::name].
8330 UnknownValue(route_type::UnknownValue),
8331 }
8332
8333 #[doc(hidden)]
8334 pub mod route_type {
8335 #[allow(unused_imports)]
8336 use super::*;
8337 #[derive(Clone, Debug, PartialEq)]
8338 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8339 }
8340
8341 impl RouteType {
8342 /// Gets the enum value.
8343 ///
8344 /// Returns `None` if the enum contains an unknown value deserialized from
8345 /// the string representation of enums.
8346 pub fn value(&self) -> std::option::Option<i32> {
8347 match self {
8348 Self::Unspecified => std::option::Option::Some(0),
8349 Self::Subnet => std::option::Option::Some(1),
8350 Self::Static => std::option::Option::Some(2),
8351 Self::Dynamic => std::option::Option::Some(3),
8352 Self::PeeringSubnet => std::option::Option::Some(4),
8353 Self::PeeringStatic => std::option::Option::Some(5),
8354 Self::PeeringDynamic => std::option::Option::Some(6),
8355 Self::PolicyBased => std::option::Option::Some(7),
8356 Self::Advertised => std::option::Option::Some(101),
8357 Self::UnknownValue(u) => u.0.value(),
8358 }
8359 }
8360
8361 /// Gets the enum value as a string.
8362 ///
8363 /// Returns `None` if the enum contains an unknown value deserialized from
8364 /// the integer representation of enums.
8365 pub fn name(&self) -> std::option::Option<&str> {
8366 match self {
8367 Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
8368 Self::Subnet => std::option::Option::Some("SUBNET"),
8369 Self::Static => std::option::Option::Some("STATIC"),
8370 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
8371 Self::PeeringSubnet => std::option::Option::Some("PEERING_SUBNET"),
8372 Self::PeeringStatic => std::option::Option::Some("PEERING_STATIC"),
8373 Self::PeeringDynamic => std::option::Option::Some("PEERING_DYNAMIC"),
8374 Self::PolicyBased => std::option::Option::Some("POLICY_BASED"),
8375 Self::Advertised => std::option::Option::Some("ADVERTISED"),
8376 Self::UnknownValue(u) => u.0.name(),
8377 }
8378 }
8379 }
8380
8381 impl std::default::Default for RouteType {
8382 fn default() -> Self {
8383 use std::convert::From;
8384 Self::from(0)
8385 }
8386 }
8387
8388 impl std::fmt::Display for RouteType {
8389 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8390 wkt::internal::display_enum(f, self.name(), self.value())
8391 }
8392 }
8393
8394 impl std::convert::From<i32> for RouteType {
8395 fn from(value: i32) -> Self {
8396 match value {
8397 0 => Self::Unspecified,
8398 1 => Self::Subnet,
8399 2 => Self::Static,
8400 3 => Self::Dynamic,
8401 4 => Self::PeeringSubnet,
8402 5 => Self::PeeringStatic,
8403 6 => Self::PeeringDynamic,
8404 7 => Self::PolicyBased,
8405 101 => Self::Advertised,
8406 _ => Self::UnknownValue(route_type::UnknownValue(
8407 wkt::internal::UnknownEnumValue::Integer(value),
8408 )),
8409 }
8410 }
8411 }
8412
8413 impl std::convert::From<&str> for RouteType {
8414 fn from(value: &str) -> Self {
8415 use std::string::ToString;
8416 match value {
8417 "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
8418 "SUBNET" => Self::Subnet,
8419 "STATIC" => Self::Static,
8420 "DYNAMIC" => Self::Dynamic,
8421 "PEERING_SUBNET" => Self::PeeringSubnet,
8422 "PEERING_STATIC" => Self::PeeringStatic,
8423 "PEERING_DYNAMIC" => Self::PeeringDynamic,
8424 "POLICY_BASED" => Self::PolicyBased,
8425 "ADVERTISED" => Self::Advertised,
8426 _ => Self::UnknownValue(route_type::UnknownValue(
8427 wkt::internal::UnknownEnumValue::String(value.to_string()),
8428 )),
8429 }
8430 }
8431 }
8432
8433 impl serde::ser::Serialize for RouteType {
8434 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8435 where
8436 S: serde::Serializer,
8437 {
8438 match self {
8439 Self::Unspecified => serializer.serialize_i32(0),
8440 Self::Subnet => serializer.serialize_i32(1),
8441 Self::Static => serializer.serialize_i32(2),
8442 Self::Dynamic => serializer.serialize_i32(3),
8443 Self::PeeringSubnet => serializer.serialize_i32(4),
8444 Self::PeeringStatic => serializer.serialize_i32(5),
8445 Self::PeeringDynamic => serializer.serialize_i32(6),
8446 Self::PolicyBased => serializer.serialize_i32(7),
8447 Self::Advertised => serializer.serialize_i32(101),
8448 Self::UnknownValue(u) => u.0.serialize(serializer),
8449 }
8450 }
8451 }
8452
8453 impl<'de> serde::de::Deserialize<'de> for RouteType {
8454 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8455 where
8456 D: serde::Deserializer<'de>,
8457 {
8458 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
8459 ".google.cloud.networkmanagement.v1.RouteInfo.RouteType",
8460 ))
8461 }
8462 }
8463
8464 /// Type of next hop:
8465 ///
8466 /// # Working with unknown values
8467 ///
8468 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8469 /// additional enum variants at any time. Adding new variants is not considered
8470 /// a breaking change. Applications should write their code in anticipation of:
8471 ///
8472 /// - New values appearing in future releases of the client library, **and**
8473 /// - New values received dynamically, without application changes.
8474 ///
8475 /// Please consult the [Working with enums] section in the user guide for some
8476 /// guidelines.
8477 ///
8478 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8479 #[derive(Clone, Debug, PartialEq)]
8480 #[non_exhaustive]
8481 pub enum NextHopType {
8482 /// Unspecified type. Default value.
8483 Unspecified,
8484 /// Next hop is an IP address.
8485 NextHopIp,
8486 /// Next hop is a Compute Engine instance.
8487 NextHopInstance,
8488 /// Next hop is a VPC network gateway.
8489 NextHopNetwork,
8490 /// Next hop is a peering VPC. This scenario only happens when the user
8491 /// doesn't have permissions to the project where the next hop resource is
8492 /// located.
8493 NextHopPeering,
8494 /// Next hop is an interconnect.
8495 NextHopInterconnect,
8496 /// Next hop is a VPN tunnel.
8497 NextHopVpnTunnel,
8498 /// Next hop is a VPN gateway. This scenario only happens when tracing
8499 /// connectivity from an on-premises network to Google Cloud through a VPN.
8500 /// The analysis simulates a packet departing from the on-premises network
8501 /// through a VPN tunnel and arriving at a Cloud VPN gateway.
8502 NextHopVpnGateway,
8503 /// Next hop is an internet gateway.
8504 NextHopInternetGateway,
8505 /// Next hop is blackhole; that is, the next hop either does not exist or is
8506 /// unusable.
8507 NextHopBlackhole,
8508 /// Next hop is the forwarding rule of an Internal Load Balancer.
8509 NextHopIlb,
8510 /// Next hop is a
8511 /// [router appliance
8512 /// instance](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/ra-overview).
8513 NextHopRouterAppliance,
8514 /// Next hop is an NCC hub. This scenario only happens when the user doesn't
8515 /// have permissions to the project where the next hop resource is located.
8516 NextHopNccHub,
8517 /// Next hop is Secure Web Proxy Gateway.
8518 SecureWebProxyGateway,
8519 /// If set, the enum was initialized with an unknown value.
8520 ///
8521 /// Applications can examine the value using [NextHopType::value] or
8522 /// [NextHopType::name].
8523 UnknownValue(next_hop_type::UnknownValue),
8524 }
8525
8526 #[doc(hidden)]
8527 pub mod next_hop_type {
8528 #[allow(unused_imports)]
8529 use super::*;
8530 #[derive(Clone, Debug, PartialEq)]
8531 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8532 }
8533
8534 impl NextHopType {
8535 /// Gets the enum value.
8536 ///
8537 /// Returns `None` if the enum contains an unknown value deserialized from
8538 /// the string representation of enums.
8539 pub fn value(&self) -> std::option::Option<i32> {
8540 match self {
8541 Self::Unspecified => std::option::Option::Some(0),
8542 Self::NextHopIp => std::option::Option::Some(1),
8543 Self::NextHopInstance => std::option::Option::Some(2),
8544 Self::NextHopNetwork => std::option::Option::Some(3),
8545 Self::NextHopPeering => std::option::Option::Some(4),
8546 Self::NextHopInterconnect => std::option::Option::Some(5),
8547 Self::NextHopVpnTunnel => std::option::Option::Some(6),
8548 Self::NextHopVpnGateway => std::option::Option::Some(7),
8549 Self::NextHopInternetGateway => std::option::Option::Some(8),
8550 Self::NextHopBlackhole => std::option::Option::Some(9),
8551 Self::NextHopIlb => std::option::Option::Some(10),
8552 Self::NextHopRouterAppliance => std::option::Option::Some(11),
8553 Self::NextHopNccHub => std::option::Option::Some(12),
8554 Self::SecureWebProxyGateway => std::option::Option::Some(13),
8555 Self::UnknownValue(u) => u.0.value(),
8556 }
8557 }
8558
8559 /// Gets the enum value as a string.
8560 ///
8561 /// Returns `None` if the enum contains an unknown value deserialized from
8562 /// the integer representation of enums.
8563 pub fn name(&self) -> std::option::Option<&str> {
8564 match self {
8565 Self::Unspecified => std::option::Option::Some("NEXT_HOP_TYPE_UNSPECIFIED"),
8566 Self::NextHopIp => std::option::Option::Some("NEXT_HOP_IP"),
8567 Self::NextHopInstance => std::option::Option::Some("NEXT_HOP_INSTANCE"),
8568 Self::NextHopNetwork => std::option::Option::Some("NEXT_HOP_NETWORK"),
8569 Self::NextHopPeering => std::option::Option::Some("NEXT_HOP_PEERING"),
8570 Self::NextHopInterconnect => std::option::Option::Some("NEXT_HOP_INTERCONNECT"),
8571 Self::NextHopVpnTunnel => std::option::Option::Some("NEXT_HOP_VPN_TUNNEL"),
8572 Self::NextHopVpnGateway => std::option::Option::Some("NEXT_HOP_VPN_GATEWAY"),
8573 Self::NextHopInternetGateway => {
8574 std::option::Option::Some("NEXT_HOP_INTERNET_GATEWAY")
8575 }
8576 Self::NextHopBlackhole => std::option::Option::Some("NEXT_HOP_BLACKHOLE"),
8577 Self::NextHopIlb => std::option::Option::Some("NEXT_HOP_ILB"),
8578 Self::NextHopRouterAppliance => {
8579 std::option::Option::Some("NEXT_HOP_ROUTER_APPLIANCE")
8580 }
8581 Self::NextHopNccHub => std::option::Option::Some("NEXT_HOP_NCC_HUB"),
8582 Self::SecureWebProxyGateway => {
8583 std::option::Option::Some("SECURE_WEB_PROXY_GATEWAY")
8584 }
8585 Self::UnknownValue(u) => u.0.name(),
8586 }
8587 }
8588 }
8589
8590 impl std::default::Default for NextHopType {
8591 fn default() -> Self {
8592 use std::convert::From;
8593 Self::from(0)
8594 }
8595 }
8596
8597 impl std::fmt::Display for NextHopType {
8598 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8599 wkt::internal::display_enum(f, self.name(), self.value())
8600 }
8601 }
8602
8603 impl std::convert::From<i32> for NextHopType {
8604 fn from(value: i32) -> Self {
8605 match value {
8606 0 => Self::Unspecified,
8607 1 => Self::NextHopIp,
8608 2 => Self::NextHopInstance,
8609 3 => Self::NextHopNetwork,
8610 4 => Self::NextHopPeering,
8611 5 => Self::NextHopInterconnect,
8612 6 => Self::NextHopVpnTunnel,
8613 7 => Self::NextHopVpnGateway,
8614 8 => Self::NextHopInternetGateway,
8615 9 => Self::NextHopBlackhole,
8616 10 => Self::NextHopIlb,
8617 11 => Self::NextHopRouterAppliance,
8618 12 => Self::NextHopNccHub,
8619 13 => Self::SecureWebProxyGateway,
8620 _ => Self::UnknownValue(next_hop_type::UnknownValue(
8621 wkt::internal::UnknownEnumValue::Integer(value),
8622 )),
8623 }
8624 }
8625 }
8626
8627 impl std::convert::From<&str> for NextHopType {
8628 fn from(value: &str) -> Self {
8629 use std::string::ToString;
8630 match value {
8631 "NEXT_HOP_TYPE_UNSPECIFIED" => Self::Unspecified,
8632 "NEXT_HOP_IP" => Self::NextHopIp,
8633 "NEXT_HOP_INSTANCE" => Self::NextHopInstance,
8634 "NEXT_HOP_NETWORK" => Self::NextHopNetwork,
8635 "NEXT_HOP_PEERING" => Self::NextHopPeering,
8636 "NEXT_HOP_INTERCONNECT" => Self::NextHopInterconnect,
8637 "NEXT_HOP_VPN_TUNNEL" => Self::NextHopVpnTunnel,
8638 "NEXT_HOP_VPN_GATEWAY" => Self::NextHopVpnGateway,
8639 "NEXT_HOP_INTERNET_GATEWAY" => Self::NextHopInternetGateway,
8640 "NEXT_HOP_BLACKHOLE" => Self::NextHopBlackhole,
8641 "NEXT_HOP_ILB" => Self::NextHopIlb,
8642 "NEXT_HOP_ROUTER_APPLIANCE" => Self::NextHopRouterAppliance,
8643 "NEXT_HOP_NCC_HUB" => Self::NextHopNccHub,
8644 "SECURE_WEB_PROXY_GATEWAY" => Self::SecureWebProxyGateway,
8645 _ => Self::UnknownValue(next_hop_type::UnknownValue(
8646 wkt::internal::UnknownEnumValue::String(value.to_string()),
8647 )),
8648 }
8649 }
8650 }
8651
8652 impl serde::ser::Serialize for NextHopType {
8653 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8654 where
8655 S: serde::Serializer,
8656 {
8657 match self {
8658 Self::Unspecified => serializer.serialize_i32(0),
8659 Self::NextHopIp => serializer.serialize_i32(1),
8660 Self::NextHopInstance => serializer.serialize_i32(2),
8661 Self::NextHopNetwork => serializer.serialize_i32(3),
8662 Self::NextHopPeering => serializer.serialize_i32(4),
8663 Self::NextHopInterconnect => serializer.serialize_i32(5),
8664 Self::NextHopVpnTunnel => serializer.serialize_i32(6),
8665 Self::NextHopVpnGateway => serializer.serialize_i32(7),
8666 Self::NextHopInternetGateway => serializer.serialize_i32(8),
8667 Self::NextHopBlackhole => serializer.serialize_i32(9),
8668 Self::NextHopIlb => serializer.serialize_i32(10),
8669 Self::NextHopRouterAppliance => serializer.serialize_i32(11),
8670 Self::NextHopNccHub => serializer.serialize_i32(12),
8671 Self::SecureWebProxyGateway => serializer.serialize_i32(13),
8672 Self::UnknownValue(u) => u.0.serialize(serializer),
8673 }
8674 }
8675 }
8676
8677 impl<'de> serde::de::Deserialize<'de> for NextHopType {
8678 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8679 where
8680 D: serde::Deserializer<'de>,
8681 {
8682 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NextHopType>::new(
8683 ".google.cloud.networkmanagement.v1.RouteInfo.NextHopType",
8684 ))
8685 }
8686 }
8687
8688 /// Indicates where routes are applicable.
8689 ///
8690 /// # Working with unknown values
8691 ///
8692 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8693 /// additional enum variants at any time. Adding new variants is not considered
8694 /// a breaking change. Applications should write their code in anticipation of:
8695 ///
8696 /// - New values appearing in future releases of the client library, **and**
8697 /// - New values received dynamically, without application changes.
8698 ///
8699 /// Please consult the [Working with enums] section in the user guide for some
8700 /// guidelines.
8701 ///
8702 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8703 #[derive(Clone, Debug, PartialEq)]
8704 #[non_exhaustive]
8705 pub enum RouteScope {
8706 /// Unspecified scope. Default value.
8707 Unspecified,
8708 /// Route is applicable to packets in Network.
8709 Network,
8710 /// Route is applicable to packets using NCC Hub's routing table.
8711 NccHub,
8712 /// If set, the enum was initialized with an unknown value.
8713 ///
8714 /// Applications can examine the value using [RouteScope::value] or
8715 /// [RouteScope::name].
8716 UnknownValue(route_scope::UnknownValue),
8717 }
8718
8719 #[doc(hidden)]
8720 pub mod route_scope {
8721 #[allow(unused_imports)]
8722 use super::*;
8723 #[derive(Clone, Debug, PartialEq)]
8724 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8725 }
8726
8727 impl RouteScope {
8728 /// Gets the enum value.
8729 ///
8730 /// Returns `None` if the enum contains an unknown value deserialized from
8731 /// the string representation of enums.
8732 pub fn value(&self) -> std::option::Option<i32> {
8733 match self {
8734 Self::Unspecified => std::option::Option::Some(0),
8735 Self::Network => std::option::Option::Some(1),
8736 Self::NccHub => std::option::Option::Some(2),
8737 Self::UnknownValue(u) => u.0.value(),
8738 }
8739 }
8740
8741 /// Gets the enum value as a string.
8742 ///
8743 /// Returns `None` if the enum contains an unknown value deserialized from
8744 /// the integer representation of enums.
8745 pub fn name(&self) -> std::option::Option<&str> {
8746 match self {
8747 Self::Unspecified => std::option::Option::Some("ROUTE_SCOPE_UNSPECIFIED"),
8748 Self::Network => std::option::Option::Some("NETWORK"),
8749 Self::NccHub => std::option::Option::Some("NCC_HUB"),
8750 Self::UnknownValue(u) => u.0.name(),
8751 }
8752 }
8753 }
8754
8755 impl std::default::Default for RouteScope {
8756 fn default() -> Self {
8757 use std::convert::From;
8758 Self::from(0)
8759 }
8760 }
8761
8762 impl std::fmt::Display for RouteScope {
8763 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8764 wkt::internal::display_enum(f, self.name(), self.value())
8765 }
8766 }
8767
8768 impl std::convert::From<i32> for RouteScope {
8769 fn from(value: i32) -> Self {
8770 match value {
8771 0 => Self::Unspecified,
8772 1 => Self::Network,
8773 2 => Self::NccHub,
8774 _ => Self::UnknownValue(route_scope::UnknownValue(
8775 wkt::internal::UnknownEnumValue::Integer(value),
8776 )),
8777 }
8778 }
8779 }
8780
8781 impl std::convert::From<&str> for RouteScope {
8782 fn from(value: &str) -> Self {
8783 use std::string::ToString;
8784 match value {
8785 "ROUTE_SCOPE_UNSPECIFIED" => Self::Unspecified,
8786 "NETWORK" => Self::Network,
8787 "NCC_HUB" => Self::NccHub,
8788 _ => Self::UnknownValue(route_scope::UnknownValue(
8789 wkt::internal::UnknownEnumValue::String(value.to_string()),
8790 )),
8791 }
8792 }
8793 }
8794
8795 impl serde::ser::Serialize for RouteScope {
8796 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8797 where
8798 S: serde::Serializer,
8799 {
8800 match self {
8801 Self::Unspecified => serializer.serialize_i32(0),
8802 Self::Network => serializer.serialize_i32(1),
8803 Self::NccHub => serializer.serialize_i32(2),
8804 Self::UnknownValue(u) => u.0.serialize(serializer),
8805 }
8806 }
8807 }
8808
8809 impl<'de> serde::de::Deserialize<'de> for RouteScope {
8810 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8811 where
8812 D: serde::Deserializer<'de>,
8813 {
8814 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteScope>::new(
8815 ".google.cloud.networkmanagement.v1.RouteInfo.RouteScope",
8816 ))
8817 }
8818 }
8819}
8820
8821/// For display only. Details of a Google Service sending packets to a
8822/// VPC network. Although the source IP might be a publicly routable address,
8823/// some Google Services use special routes within Google production
8824/// infrastructure to reach Compute Engine Instances.
8825/// <https://cloud.google.com/vpc/docs/routes#special_return_paths>
8826#[derive(Clone, Default, PartialEq)]
8827#[non_exhaustive]
8828pub struct GoogleServiceInfo {
8829 /// Source IP address.
8830 pub source_ip: std::string::String,
8831
8832 /// Recognized type of a Google Service.
8833 pub google_service_type: crate::model::google_service_info::GoogleServiceType,
8834
8835 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8836}
8837
8838impl GoogleServiceInfo {
8839 /// Creates a new default instance.
8840 pub fn new() -> Self {
8841 std::default::Default::default()
8842 }
8843
8844 /// Sets the value of [source_ip][crate::model::GoogleServiceInfo::source_ip].
8845 ///
8846 /// # Example
8847 /// ```ignore,no_run
8848 /// # use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
8849 /// let x = GoogleServiceInfo::new().set_source_ip("example");
8850 /// ```
8851 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8852 self.source_ip = v.into();
8853 self
8854 }
8855
8856 /// Sets the value of [google_service_type][crate::model::GoogleServiceInfo::google_service_type].
8857 ///
8858 /// # Example
8859 /// ```ignore,no_run
8860 /// # use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
8861 /// use google_cloud_networkmanagement_v1::model::google_service_info::GoogleServiceType;
8862 /// let x0 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::Iap);
8863 /// let x1 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::GfeProxyOrHealthCheckProber);
8864 /// let x2 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::CloudDns);
8865 /// ```
8866 pub fn set_google_service_type<
8867 T: std::convert::Into<crate::model::google_service_info::GoogleServiceType>,
8868 >(
8869 mut self,
8870 v: T,
8871 ) -> Self {
8872 self.google_service_type = v.into();
8873 self
8874 }
8875}
8876
8877impl wkt::message::Message for GoogleServiceInfo {
8878 fn typename() -> &'static str {
8879 "type.googleapis.com/google.cloud.networkmanagement.v1.GoogleServiceInfo"
8880 }
8881}
8882
8883/// Defines additional types related to [GoogleServiceInfo].
8884pub mod google_service_info {
8885 #[allow(unused_imports)]
8886 use super::*;
8887
8888 /// Recognized type of a Google Service.
8889 ///
8890 /// # Working with unknown values
8891 ///
8892 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8893 /// additional enum variants at any time. Adding new variants is not considered
8894 /// a breaking change. Applications should write their code in anticipation of:
8895 ///
8896 /// - New values appearing in future releases of the client library, **and**
8897 /// - New values received dynamically, without application changes.
8898 ///
8899 /// Please consult the [Working with enums] section in the user guide for some
8900 /// guidelines.
8901 ///
8902 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8903 #[derive(Clone, Debug, PartialEq)]
8904 #[non_exhaustive]
8905 pub enum GoogleServiceType {
8906 /// Unspecified Google Service.
8907 Unspecified,
8908 /// Identity aware proxy.
8909 /// <https://cloud.google.com/iap/docs/using-tcp-forwarding>
8910 Iap,
8911 /// One of two services sharing IP ranges:
8912 ///
8913 /// * Load Balancer proxy
8914 /// * Centralized Health Check prober
8915 /// <https://cloud.google.com/load-balancing/docs/firewall-rules>
8916 GfeProxyOrHealthCheckProber,
8917 /// Connectivity from Cloud DNS to forwarding targets or alternate name
8918 /// servers that use private routing.
8919 /// <https://cloud.google.com/dns/docs/zones/forwarding-zones#firewall-rules>
8920 /// <https://cloud.google.com/dns/docs/policies#firewall-rules>
8921 CloudDns,
8922 /// private.googleapis.com and restricted.googleapis.com
8923 GoogleApi,
8924 /// Google API via Private Service Connect.
8925 /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
8926 GoogleApiPsc,
8927 /// Google API via VPC Service Controls.
8928 /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
8929 GoogleApiVpcSc,
8930 /// Google API via Serverless VPC Access.
8931 /// <https://cloud.google.com/vpc/docs/serverless-vpc-access>
8932 ServerlessVpcAccess,
8933 /// If set, the enum was initialized with an unknown value.
8934 ///
8935 /// Applications can examine the value using [GoogleServiceType::value] or
8936 /// [GoogleServiceType::name].
8937 UnknownValue(google_service_type::UnknownValue),
8938 }
8939
8940 #[doc(hidden)]
8941 pub mod google_service_type {
8942 #[allow(unused_imports)]
8943 use super::*;
8944 #[derive(Clone, Debug, PartialEq)]
8945 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8946 }
8947
8948 impl GoogleServiceType {
8949 /// Gets the enum value.
8950 ///
8951 /// Returns `None` if the enum contains an unknown value deserialized from
8952 /// the string representation of enums.
8953 pub fn value(&self) -> std::option::Option<i32> {
8954 match self {
8955 Self::Unspecified => std::option::Option::Some(0),
8956 Self::Iap => std::option::Option::Some(1),
8957 Self::GfeProxyOrHealthCheckProber => std::option::Option::Some(2),
8958 Self::CloudDns => std::option::Option::Some(3),
8959 Self::GoogleApi => std::option::Option::Some(4),
8960 Self::GoogleApiPsc => std::option::Option::Some(5),
8961 Self::GoogleApiVpcSc => std::option::Option::Some(6),
8962 Self::ServerlessVpcAccess => std::option::Option::Some(7),
8963 Self::UnknownValue(u) => u.0.value(),
8964 }
8965 }
8966
8967 /// Gets the enum value as a string.
8968 ///
8969 /// Returns `None` if the enum contains an unknown value deserialized from
8970 /// the integer representation of enums.
8971 pub fn name(&self) -> std::option::Option<&str> {
8972 match self {
8973 Self::Unspecified => std::option::Option::Some("GOOGLE_SERVICE_TYPE_UNSPECIFIED"),
8974 Self::Iap => std::option::Option::Some("IAP"),
8975 Self::GfeProxyOrHealthCheckProber => {
8976 std::option::Option::Some("GFE_PROXY_OR_HEALTH_CHECK_PROBER")
8977 }
8978 Self::CloudDns => std::option::Option::Some("CLOUD_DNS"),
8979 Self::GoogleApi => std::option::Option::Some("GOOGLE_API"),
8980 Self::GoogleApiPsc => std::option::Option::Some("GOOGLE_API_PSC"),
8981 Self::GoogleApiVpcSc => std::option::Option::Some("GOOGLE_API_VPC_SC"),
8982 Self::ServerlessVpcAccess => std::option::Option::Some("SERVERLESS_VPC_ACCESS"),
8983 Self::UnknownValue(u) => u.0.name(),
8984 }
8985 }
8986 }
8987
8988 impl std::default::Default for GoogleServiceType {
8989 fn default() -> Self {
8990 use std::convert::From;
8991 Self::from(0)
8992 }
8993 }
8994
8995 impl std::fmt::Display for GoogleServiceType {
8996 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8997 wkt::internal::display_enum(f, self.name(), self.value())
8998 }
8999 }
9000
9001 impl std::convert::From<i32> for GoogleServiceType {
9002 fn from(value: i32) -> Self {
9003 match value {
9004 0 => Self::Unspecified,
9005 1 => Self::Iap,
9006 2 => Self::GfeProxyOrHealthCheckProber,
9007 3 => Self::CloudDns,
9008 4 => Self::GoogleApi,
9009 5 => Self::GoogleApiPsc,
9010 6 => Self::GoogleApiVpcSc,
9011 7 => Self::ServerlessVpcAccess,
9012 _ => Self::UnknownValue(google_service_type::UnknownValue(
9013 wkt::internal::UnknownEnumValue::Integer(value),
9014 )),
9015 }
9016 }
9017 }
9018
9019 impl std::convert::From<&str> for GoogleServiceType {
9020 fn from(value: &str) -> Self {
9021 use std::string::ToString;
9022 match value {
9023 "GOOGLE_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
9024 "IAP" => Self::Iap,
9025 "GFE_PROXY_OR_HEALTH_CHECK_PROBER" => Self::GfeProxyOrHealthCheckProber,
9026 "CLOUD_DNS" => Self::CloudDns,
9027 "GOOGLE_API" => Self::GoogleApi,
9028 "GOOGLE_API_PSC" => Self::GoogleApiPsc,
9029 "GOOGLE_API_VPC_SC" => Self::GoogleApiVpcSc,
9030 "SERVERLESS_VPC_ACCESS" => Self::ServerlessVpcAccess,
9031 _ => Self::UnknownValue(google_service_type::UnknownValue(
9032 wkt::internal::UnknownEnumValue::String(value.to_string()),
9033 )),
9034 }
9035 }
9036 }
9037
9038 impl serde::ser::Serialize for GoogleServiceType {
9039 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9040 where
9041 S: serde::Serializer,
9042 {
9043 match self {
9044 Self::Unspecified => serializer.serialize_i32(0),
9045 Self::Iap => serializer.serialize_i32(1),
9046 Self::GfeProxyOrHealthCheckProber => serializer.serialize_i32(2),
9047 Self::CloudDns => serializer.serialize_i32(3),
9048 Self::GoogleApi => serializer.serialize_i32(4),
9049 Self::GoogleApiPsc => serializer.serialize_i32(5),
9050 Self::GoogleApiVpcSc => serializer.serialize_i32(6),
9051 Self::ServerlessVpcAccess => serializer.serialize_i32(7),
9052 Self::UnknownValue(u) => u.0.serialize(serializer),
9053 }
9054 }
9055 }
9056
9057 impl<'de> serde::de::Deserialize<'de> for GoogleServiceType {
9058 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9059 where
9060 D: serde::Deserializer<'de>,
9061 {
9062 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GoogleServiceType>::new(
9063 ".google.cloud.networkmanagement.v1.GoogleServiceInfo.GoogleServiceType",
9064 ))
9065 }
9066 }
9067}
9068
9069/// For display only. Metadata associated with a Compute Engine forwarding rule.
9070#[derive(Clone, Default, PartialEq)]
9071#[non_exhaustive]
9072pub struct ForwardingRuleInfo {
9073 /// Name of the forwarding rule.
9074 pub display_name: std::string::String,
9075
9076 /// URI of the forwarding rule.
9077 pub uri: std::string::String,
9078
9079 /// Protocol defined in the forwarding rule that matches the packet.
9080 pub matched_protocol: std::string::String,
9081
9082 /// Port range defined in the forwarding rule that matches the packet.
9083 pub matched_port_range: std::string::String,
9084
9085 /// VIP of the forwarding rule.
9086 pub vip: std::string::String,
9087
9088 /// Target type of the forwarding rule.
9089 pub target: std::string::String,
9090
9091 /// Network URI.
9092 pub network_uri: std::string::String,
9093
9094 /// Region of the forwarding rule. Set only for regional forwarding rules.
9095 pub region: std::string::String,
9096
9097 /// Name of the load balancer the forwarding rule belongs to. Empty for
9098 /// forwarding rules not related to load balancers (like PSC forwarding rules).
9099 pub load_balancer_name: std::string::String,
9100
9101 /// URI of the PSC service attachment this forwarding rule targets (if
9102 /// applicable).
9103 pub psc_service_attachment_uri: std::string::String,
9104
9105 /// PSC Google API target this forwarding rule targets (if applicable).
9106 pub psc_google_api_target: std::string::String,
9107
9108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9109}
9110
9111impl ForwardingRuleInfo {
9112 /// Creates a new default instance.
9113 pub fn new() -> Self {
9114 std::default::Default::default()
9115 }
9116
9117 /// Sets the value of [display_name][crate::model::ForwardingRuleInfo::display_name].
9118 ///
9119 /// # Example
9120 /// ```ignore,no_run
9121 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9122 /// let x = ForwardingRuleInfo::new().set_display_name("example");
9123 /// ```
9124 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9125 self.display_name = v.into();
9126 self
9127 }
9128
9129 /// Sets the value of [uri][crate::model::ForwardingRuleInfo::uri].
9130 ///
9131 /// # Example
9132 /// ```ignore,no_run
9133 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9134 /// let x = ForwardingRuleInfo::new().set_uri("example");
9135 /// ```
9136 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9137 self.uri = v.into();
9138 self
9139 }
9140
9141 /// Sets the value of [matched_protocol][crate::model::ForwardingRuleInfo::matched_protocol].
9142 ///
9143 /// # Example
9144 /// ```ignore,no_run
9145 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9146 /// let x = ForwardingRuleInfo::new().set_matched_protocol("example");
9147 /// ```
9148 pub fn set_matched_protocol<T: std::convert::Into<std::string::String>>(
9149 mut self,
9150 v: T,
9151 ) -> Self {
9152 self.matched_protocol = v.into();
9153 self
9154 }
9155
9156 /// Sets the value of [matched_port_range][crate::model::ForwardingRuleInfo::matched_port_range].
9157 ///
9158 /// # Example
9159 /// ```ignore,no_run
9160 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9161 /// let x = ForwardingRuleInfo::new().set_matched_port_range("example");
9162 /// ```
9163 pub fn set_matched_port_range<T: std::convert::Into<std::string::String>>(
9164 mut self,
9165 v: T,
9166 ) -> Self {
9167 self.matched_port_range = v.into();
9168 self
9169 }
9170
9171 /// Sets the value of [vip][crate::model::ForwardingRuleInfo::vip].
9172 ///
9173 /// # Example
9174 /// ```ignore,no_run
9175 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9176 /// let x = ForwardingRuleInfo::new().set_vip("example");
9177 /// ```
9178 pub fn set_vip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9179 self.vip = v.into();
9180 self
9181 }
9182
9183 /// Sets the value of [target][crate::model::ForwardingRuleInfo::target].
9184 ///
9185 /// # Example
9186 /// ```ignore,no_run
9187 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9188 /// let x = ForwardingRuleInfo::new().set_target("example");
9189 /// ```
9190 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9191 self.target = v.into();
9192 self
9193 }
9194
9195 /// Sets the value of [network_uri][crate::model::ForwardingRuleInfo::network_uri].
9196 ///
9197 /// # Example
9198 /// ```ignore,no_run
9199 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9200 /// let x = ForwardingRuleInfo::new().set_network_uri("example");
9201 /// ```
9202 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9203 self.network_uri = v.into();
9204 self
9205 }
9206
9207 /// Sets the value of [region][crate::model::ForwardingRuleInfo::region].
9208 ///
9209 /// # Example
9210 /// ```ignore,no_run
9211 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9212 /// let x = ForwardingRuleInfo::new().set_region("example");
9213 /// ```
9214 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9215 self.region = v.into();
9216 self
9217 }
9218
9219 /// Sets the value of [load_balancer_name][crate::model::ForwardingRuleInfo::load_balancer_name].
9220 ///
9221 /// # Example
9222 /// ```ignore,no_run
9223 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9224 /// let x = ForwardingRuleInfo::new().set_load_balancer_name("example");
9225 /// ```
9226 pub fn set_load_balancer_name<T: std::convert::Into<std::string::String>>(
9227 mut self,
9228 v: T,
9229 ) -> Self {
9230 self.load_balancer_name = v.into();
9231 self
9232 }
9233
9234 /// Sets the value of [psc_service_attachment_uri][crate::model::ForwardingRuleInfo::psc_service_attachment_uri].
9235 ///
9236 /// # Example
9237 /// ```ignore,no_run
9238 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9239 /// let x = ForwardingRuleInfo::new().set_psc_service_attachment_uri("example");
9240 /// ```
9241 pub fn set_psc_service_attachment_uri<T: std::convert::Into<std::string::String>>(
9242 mut self,
9243 v: T,
9244 ) -> Self {
9245 self.psc_service_attachment_uri = v.into();
9246 self
9247 }
9248
9249 /// Sets the value of [psc_google_api_target][crate::model::ForwardingRuleInfo::psc_google_api_target].
9250 ///
9251 /// # Example
9252 /// ```ignore,no_run
9253 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9254 /// let x = ForwardingRuleInfo::new().set_psc_google_api_target("example");
9255 /// ```
9256 pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
9257 mut self,
9258 v: T,
9259 ) -> Self {
9260 self.psc_google_api_target = v.into();
9261 self
9262 }
9263}
9264
9265impl wkt::message::Message for ForwardingRuleInfo {
9266 fn typename() -> &'static str {
9267 "type.googleapis.com/google.cloud.networkmanagement.v1.ForwardingRuleInfo"
9268 }
9269}
9270
9271/// For display only. Metadata associated with a load balancer.
9272#[derive(Clone, Default, PartialEq)]
9273#[non_exhaustive]
9274pub struct LoadBalancerInfo {
9275 /// Type of the load balancer.
9276 pub load_balancer_type: crate::model::load_balancer_info::LoadBalancerType,
9277
9278 /// URI of the health check for the load balancer. Deprecated and no longer
9279 /// populated as different load balancer backends might have different health
9280 /// checks.
9281 #[deprecated]
9282 pub health_check_uri: std::string::String,
9283
9284 /// Information for the loadbalancer backends.
9285 pub backends: std::vec::Vec<crate::model::LoadBalancerBackend>,
9286
9287 /// Type of load balancer's backend configuration.
9288 pub backend_type: crate::model::load_balancer_info::BackendType,
9289
9290 /// Backend configuration URI.
9291 pub backend_uri: std::string::String,
9292
9293 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9294}
9295
9296impl LoadBalancerInfo {
9297 /// Creates a new default instance.
9298 pub fn new() -> Self {
9299 std::default::Default::default()
9300 }
9301
9302 /// Sets the value of [load_balancer_type][crate::model::LoadBalancerInfo::load_balancer_type].
9303 ///
9304 /// # Example
9305 /// ```ignore,no_run
9306 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9307 /// use google_cloud_networkmanagement_v1::model::load_balancer_info::LoadBalancerType;
9308 /// let x0 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::InternalTcpUdp);
9309 /// let x1 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::NetworkTcpUdp);
9310 /// let x2 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::HttpProxy);
9311 /// ```
9312 pub fn set_load_balancer_type<
9313 T: std::convert::Into<crate::model::load_balancer_info::LoadBalancerType>,
9314 >(
9315 mut self,
9316 v: T,
9317 ) -> Self {
9318 self.load_balancer_type = v.into();
9319 self
9320 }
9321
9322 /// Sets the value of [health_check_uri][crate::model::LoadBalancerInfo::health_check_uri].
9323 ///
9324 /// # Example
9325 /// ```ignore,no_run
9326 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9327 /// let x = LoadBalancerInfo::new().set_health_check_uri("example");
9328 /// ```
9329 #[deprecated]
9330 pub fn set_health_check_uri<T: std::convert::Into<std::string::String>>(
9331 mut self,
9332 v: T,
9333 ) -> Self {
9334 self.health_check_uri = v.into();
9335 self
9336 }
9337
9338 /// Sets the value of [backends][crate::model::LoadBalancerInfo::backends].
9339 ///
9340 /// # Example
9341 /// ```ignore,no_run
9342 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9343 /// use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9344 /// let x = LoadBalancerInfo::new()
9345 /// .set_backends([
9346 /// LoadBalancerBackend::default()/* use setters */,
9347 /// LoadBalancerBackend::default()/* use (different) setters */,
9348 /// ]);
9349 /// ```
9350 pub fn set_backends<T, V>(mut self, v: T) -> Self
9351 where
9352 T: std::iter::IntoIterator<Item = V>,
9353 V: std::convert::Into<crate::model::LoadBalancerBackend>,
9354 {
9355 use std::iter::Iterator;
9356 self.backends = v.into_iter().map(|i| i.into()).collect();
9357 self
9358 }
9359
9360 /// Sets the value of [backend_type][crate::model::LoadBalancerInfo::backend_type].
9361 ///
9362 /// # Example
9363 /// ```ignore,no_run
9364 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9365 /// use google_cloud_networkmanagement_v1::model::load_balancer_info::BackendType;
9366 /// let x0 = LoadBalancerInfo::new().set_backend_type(BackendType::BackendService);
9367 /// let x1 = LoadBalancerInfo::new().set_backend_type(BackendType::TargetPool);
9368 /// let x2 = LoadBalancerInfo::new().set_backend_type(BackendType::TargetInstance);
9369 /// ```
9370 pub fn set_backend_type<
9371 T: std::convert::Into<crate::model::load_balancer_info::BackendType>,
9372 >(
9373 mut self,
9374 v: T,
9375 ) -> Self {
9376 self.backend_type = v.into();
9377 self
9378 }
9379
9380 /// Sets the value of [backend_uri][crate::model::LoadBalancerInfo::backend_uri].
9381 ///
9382 /// # Example
9383 /// ```ignore,no_run
9384 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9385 /// let x = LoadBalancerInfo::new().set_backend_uri("example");
9386 /// ```
9387 pub fn set_backend_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9388 self.backend_uri = v.into();
9389 self
9390 }
9391}
9392
9393impl wkt::message::Message for LoadBalancerInfo {
9394 fn typename() -> &'static str {
9395 "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerInfo"
9396 }
9397}
9398
9399/// Defines additional types related to [LoadBalancerInfo].
9400pub mod load_balancer_info {
9401 #[allow(unused_imports)]
9402 use super::*;
9403
9404 /// The type definition for a load balancer:
9405 ///
9406 /// # Working with unknown values
9407 ///
9408 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9409 /// additional enum variants at any time. Adding new variants is not considered
9410 /// a breaking change. Applications should write their code in anticipation of:
9411 ///
9412 /// - New values appearing in future releases of the client library, **and**
9413 /// - New values received dynamically, without application changes.
9414 ///
9415 /// Please consult the [Working with enums] section in the user guide for some
9416 /// guidelines.
9417 ///
9418 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9419 #[derive(Clone, Debug, PartialEq)]
9420 #[non_exhaustive]
9421 pub enum LoadBalancerType {
9422 /// Type is unspecified.
9423 Unspecified,
9424 /// Internal TCP/UDP load balancer.
9425 InternalTcpUdp,
9426 /// Network TCP/UDP load balancer.
9427 NetworkTcpUdp,
9428 /// HTTP(S) proxy load balancer.
9429 HttpProxy,
9430 /// TCP proxy load balancer.
9431 TcpProxy,
9432 /// SSL proxy load balancer.
9433 SslProxy,
9434 /// If set, the enum was initialized with an unknown value.
9435 ///
9436 /// Applications can examine the value using [LoadBalancerType::value] or
9437 /// [LoadBalancerType::name].
9438 UnknownValue(load_balancer_type::UnknownValue),
9439 }
9440
9441 #[doc(hidden)]
9442 pub mod load_balancer_type {
9443 #[allow(unused_imports)]
9444 use super::*;
9445 #[derive(Clone, Debug, PartialEq)]
9446 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9447 }
9448
9449 impl LoadBalancerType {
9450 /// Gets the enum value.
9451 ///
9452 /// Returns `None` if the enum contains an unknown value deserialized from
9453 /// the string representation of enums.
9454 pub fn value(&self) -> std::option::Option<i32> {
9455 match self {
9456 Self::Unspecified => std::option::Option::Some(0),
9457 Self::InternalTcpUdp => std::option::Option::Some(1),
9458 Self::NetworkTcpUdp => std::option::Option::Some(2),
9459 Self::HttpProxy => std::option::Option::Some(3),
9460 Self::TcpProxy => std::option::Option::Some(4),
9461 Self::SslProxy => std::option::Option::Some(5),
9462 Self::UnknownValue(u) => u.0.value(),
9463 }
9464 }
9465
9466 /// Gets the enum value as a string.
9467 ///
9468 /// Returns `None` if the enum contains an unknown value deserialized from
9469 /// the integer representation of enums.
9470 pub fn name(&self) -> std::option::Option<&str> {
9471 match self {
9472 Self::Unspecified => std::option::Option::Some("LOAD_BALANCER_TYPE_UNSPECIFIED"),
9473 Self::InternalTcpUdp => std::option::Option::Some("INTERNAL_TCP_UDP"),
9474 Self::NetworkTcpUdp => std::option::Option::Some("NETWORK_TCP_UDP"),
9475 Self::HttpProxy => std::option::Option::Some("HTTP_PROXY"),
9476 Self::TcpProxy => std::option::Option::Some("TCP_PROXY"),
9477 Self::SslProxy => std::option::Option::Some("SSL_PROXY"),
9478 Self::UnknownValue(u) => u.0.name(),
9479 }
9480 }
9481 }
9482
9483 impl std::default::Default for LoadBalancerType {
9484 fn default() -> Self {
9485 use std::convert::From;
9486 Self::from(0)
9487 }
9488 }
9489
9490 impl std::fmt::Display for LoadBalancerType {
9491 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9492 wkt::internal::display_enum(f, self.name(), self.value())
9493 }
9494 }
9495
9496 impl std::convert::From<i32> for LoadBalancerType {
9497 fn from(value: i32) -> Self {
9498 match value {
9499 0 => Self::Unspecified,
9500 1 => Self::InternalTcpUdp,
9501 2 => Self::NetworkTcpUdp,
9502 3 => Self::HttpProxy,
9503 4 => Self::TcpProxy,
9504 5 => Self::SslProxy,
9505 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
9506 wkt::internal::UnknownEnumValue::Integer(value),
9507 )),
9508 }
9509 }
9510 }
9511
9512 impl std::convert::From<&str> for LoadBalancerType {
9513 fn from(value: &str) -> Self {
9514 use std::string::ToString;
9515 match value {
9516 "LOAD_BALANCER_TYPE_UNSPECIFIED" => Self::Unspecified,
9517 "INTERNAL_TCP_UDP" => Self::InternalTcpUdp,
9518 "NETWORK_TCP_UDP" => Self::NetworkTcpUdp,
9519 "HTTP_PROXY" => Self::HttpProxy,
9520 "TCP_PROXY" => Self::TcpProxy,
9521 "SSL_PROXY" => Self::SslProxy,
9522 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
9523 wkt::internal::UnknownEnumValue::String(value.to_string()),
9524 )),
9525 }
9526 }
9527 }
9528
9529 impl serde::ser::Serialize for LoadBalancerType {
9530 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9531 where
9532 S: serde::Serializer,
9533 {
9534 match self {
9535 Self::Unspecified => serializer.serialize_i32(0),
9536 Self::InternalTcpUdp => serializer.serialize_i32(1),
9537 Self::NetworkTcpUdp => serializer.serialize_i32(2),
9538 Self::HttpProxy => serializer.serialize_i32(3),
9539 Self::TcpProxy => serializer.serialize_i32(4),
9540 Self::SslProxy => serializer.serialize_i32(5),
9541 Self::UnknownValue(u) => u.0.serialize(serializer),
9542 }
9543 }
9544 }
9545
9546 impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
9547 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9548 where
9549 D: serde::Deserializer<'de>,
9550 {
9551 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
9552 ".google.cloud.networkmanagement.v1.LoadBalancerInfo.LoadBalancerType",
9553 ))
9554 }
9555 }
9556
9557 /// The type definition for a load balancer backend configuration:
9558 ///
9559 /// # Working with unknown values
9560 ///
9561 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9562 /// additional enum variants at any time. Adding new variants is not considered
9563 /// a breaking change. Applications should write their code in anticipation of:
9564 ///
9565 /// - New values appearing in future releases of the client library, **and**
9566 /// - New values received dynamically, without application changes.
9567 ///
9568 /// Please consult the [Working with enums] section in the user guide for some
9569 /// guidelines.
9570 ///
9571 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9572 #[derive(Clone, Debug, PartialEq)]
9573 #[non_exhaustive]
9574 pub enum BackendType {
9575 /// Type is unspecified.
9576 Unspecified,
9577 /// Backend Service as the load balancer's backend.
9578 BackendService,
9579 /// Target Pool as the load balancer's backend.
9580 TargetPool,
9581 /// Target Instance as the load balancer's backend.
9582 TargetInstance,
9583 /// If set, the enum was initialized with an unknown value.
9584 ///
9585 /// Applications can examine the value using [BackendType::value] or
9586 /// [BackendType::name].
9587 UnknownValue(backend_type::UnknownValue),
9588 }
9589
9590 #[doc(hidden)]
9591 pub mod backend_type {
9592 #[allow(unused_imports)]
9593 use super::*;
9594 #[derive(Clone, Debug, PartialEq)]
9595 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9596 }
9597
9598 impl BackendType {
9599 /// Gets the enum value.
9600 ///
9601 /// Returns `None` if the enum contains an unknown value deserialized from
9602 /// the string representation of enums.
9603 pub fn value(&self) -> std::option::Option<i32> {
9604 match self {
9605 Self::Unspecified => std::option::Option::Some(0),
9606 Self::BackendService => std::option::Option::Some(1),
9607 Self::TargetPool => std::option::Option::Some(2),
9608 Self::TargetInstance => std::option::Option::Some(3),
9609 Self::UnknownValue(u) => u.0.value(),
9610 }
9611 }
9612
9613 /// Gets the enum value as a string.
9614 ///
9615 /// Returns `None` if the enum contains an unknown value deserialized from
9616 /// the integer representation of enums.
9617 pub fn name(&self) -> std::option::Option<&str> {
9618 match self {
9619 Self::Unspecified => std::option::Option::Some("BACKEND_TYPE_UNSPECIFIED"),
9620 Self::BackendService => std::option::Option::Some("BACKEND_SERVICE"),
9621 Self::TargetPool => std::option::Option::Some("TARGET_POOL"),
9622 Self::TargetInstance => std::option::Option::Some("TARGET_INSTANCE"),
9623 Self::UnknownValue(u) => u.0.name(),
9624 }
9625 }
9626 }
9627
9628 impl std::default::Default for BackendType {
9629 fn default() -> Self {
9630 use std::convert::From;
9631 Self::from(0)
9632 }
9633 }
9634
9635 impl std::fmt::Display for BackendType {
9636 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9637 wkt::internal::display_enum(f, self.name(), self.value())
9638 }
9639 }
9640
9641 impl std::convert::From<i32> for BackendType {
9642 fn from(value: i32) -> Self {
9643 match value {
9644 0 => Self::Unspecified,
9645 1 => Self::BackendService,
9646 2 => Self::TargetPool,
9647 3 => Self::TargetInstance,
9648 _ => Self::UnknownValue(backend_type::UnknownValue(
9649 wkt::internal::UnknownEnumValue::Integer(value),
9650 )),
9651 }
9652 }
9653 }
9654
9655 impl std::convert::From<&str> for BackendType {
9656 fn from(value: &str) -> Self {
9657 use std::string::ToString;
9658 match value {
9659 "BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
9660 "BACKEND_SERVICE" => Self::BackendService,
9661 "TARGET_POOL" => Self::TargetPool,
9662 "TARGET_INSTANCE" => Self::TargetInstance,
9663 _ => Self::UnknownValue(backend_type::UnknownValue(
9664 wkt::internal::UnknownEnumValue::String(value.to_string()),
9665 )),
9666 }
9667 }
9668 }
9669
9670 impl serde::ser::Serialize for BackendType {
9671 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9672 where
9673 S: serde::Serializer,
9674 {
9675 match self {
9676 Self::Unspecified => serializer.serialize_i32(0),
9677 Self::BackendService => serializer.serialize_i32(1),
9678 Self::TargetPool => serializer.serialize_i32(2),
9679 Self::TargetInstance => serializer.serialize_i32(3),
9680 Self::UnknownValue(u) => u.0.serialize(serializer),
9681 }
9682 }
9683 }
9684
9685 impl<'de> serde::de::Deserialize<'de> for BackendType {
9686 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9687 where
9688 D: serde::Deserializer<'de>,
9689 {
9690 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackendType>::new(
9691 ".google.cloud.networkmanagement.v1.LoadBalancerInfo.BackendType",
9692 ))
9693 }
9694 }
9695}
9696
9697/// For display only. Metadata associated with a specific load balancer backend.
9698#[derive(Clone, Default, PartialEq)]
9699#[non_exhaustive]
9700pub struct LoadBalancerBackend {
9701 /// Name of a Compute Engine instance or network endpoint.
9702 pub display_name: std::string::String,
9703
9704 /// URI of a Compute Engine instance or network endpoint.
9705 pub uri: std::string::String,
9706
9707 /// State of the health check firewall configuration.
9708 pub health_check_firewall_state: crate::model::load_balancer_backend::HealthCheckFirewallState,
9709
9710 /// A list of firewall rule URIs allowing probes from health check IP ranges.
9711 pub health_check_allowing_firewall_rules: std::vec::Vec<std::string::String>,
9712
9713 /// A list of firewall rule URIs blocking probes from health check IP ranges.
9714 pub health_check_blocking_firewall_rules: std::vec::Vec<std::string::String>,
9715
9716 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9717}
9718
9719impl LoadBalancerBackend {
9720 /// Creates a new default instance.
9721 pub fn new() -> Self {
9722 std::default::Default::default()
9723 }
9724
9725 /// Sets the value of [display_name][crate::model::LoadBalancerBackend::display_name].
9726 ///
9727 /// # Example
9728 /// ```ignore,no_run
9729 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9730 /// let x = LoadBalancerBackend::new().set_display_name("example");
9731 /// ```
9732 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9733 self.display_name = v.into();
9734 self
9735 }
9736
9737 /// Sets the value of [uri][crate::model::LoadBalancerBackend::uri].
9738 ///
9739 /// # Example
9740 /// ```ignore,no_run
9741 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9742 /// let x = LoadBalancerBackend::new().set_uri("example");
9743 /// ```
9744 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9745 self.uri = v.into();
9746 self
9747 }
9748
9749 /// Sets the value of [health_check_firewall_state][crate::model::LoadBalancerBackend::health_check_firewall_state].
9750 ///
9751 /// # Example
9752 /// ```ignore,no_run
9753 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9754 /// use google_cloud_networkmanagement_v1::model::load_balancer_backend::HealthCheckFirewallState;
9755 /// let x0 = LoadBalancerBackend::new().set_health_check_firewall_state(HealthCheckFirewallState::Configured);
9756 /// let x1 = LoadBalancerBackend::new().set_health_check_firewall_state(HealthCheckFirewallState::Misconfigured);
9757 /// ```
9758 pub fn set_health_check_firewall_state<
9759 T: std::convert::Into<crate::model::load_balancer_backend::HealthCheckFirewallState>,
9760 >(
9761 mut self,
9762 v: T,
9763 ) -> Self {
9764 self.health_check_firewall_state = v.into();
9765 self
9766 }
9767
9768 /// Sets the value of [health_check_allowing_firewall_rules][crate::model::LoadBalancerBackend::health_check_allowing_firewall_rules].
9769 ///
9770 /// # Example
9771 /// ```ignore,no_run
9772 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9773 /// let x = LoadBalancerBackend::new().set_health_check_allowing_firewall_rules(["a", "b", "c"]);
9774 /// ```
9775 pub fn set_health_check_allowing_firewall_rules<T, V>(mut self, v: T) -> Self
9776 where
9777 T: std::iter::IntoIterator<Item = V>,
9778 V: std::convert::Into<std::string::String>,
9779 {
9780 use std::iter::Iterator;
9781 self.health_check_allowing_firewall_rules = v.into_iter().map(|i| i.into()).collect();
9782 self
9783 }
9784
9785 /// Sets the value of [health_check_blocking_firewall_rules][crate::model::LoadBalancerBackend::health_check_blocking_firewall_rules].
9786 ///
9787 /// # Example
9788 /// ```ignore,no_run
9789 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9790 /// let x = LoadBalancerBackend::new().set_health_check_blocking_firewall_rules(["a", "b", "c"]);
9791 /// ```
9792 pub fn set_health_check_blocking_firewall_rules<T, V>(mut self, v: T) -> Self
9793 where
9794 T: std::iter::IntoIterator<Item = V>,
9795 V: std::convert::Into<std::string::String>,
9796 {
9797 use std::iter::Iterator;
9798 self.health_check_blocking_firewall_rules = v.into_iter().map(|i| i.into()).collect();
9799 self
9800 }
9801}
9802
9803impl wkt::message::Message for LoadBalancerBackend {
9804 fn typename() -> &'static str {
9805 "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerBackend"
9806 }
9807}
9808
9809/// Defines additional types related to [LoadBalancerBackend].
9810pub mod load_balancer_backend {
9811 #[allow(unused_imports)]
9812 use super::*;
9813
9814 /// State of a health check firewall configuration:
9815 ///
9816 /// # Working with unknown values
9817 ///
9818 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9819 /// additional enum variants at any time. Adding new variants is not considered
9820 /// a breaking change. Applications should write their code in anticipation of:
9821 ///
9822 /// - New values appearing in future releases of the client library, **and**
9823 /// - New values received dynamically, without application changes.
9824 ///
9825 /// Please consult the [Working with enums] section in the user guide for some
9826 /// guidelines.
9827 ///
9828 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9829 #[derive(Clone, Debug, PartialEq)]
9830 #[non_exhaustive]
9831 pub enum HealthCheckFirewallState {
9832 /// State is unspecified. Default state if not populated.
9833 Unspecified,
9834 /// There are configured firewall rules to allow health check probes to the
9835 /// backend.
9836 Configured,
9837 /// There are firewall rules configured to allow partial health check ranges
9838 /// or block all health check ranges.
9839 /// If a health check probe is sent from denied IP ranges,
9840 /// the health check to the backend will fail. Then, the backend will be
9841 /// marked unhealthy and will not receive traffic sent to the load balancer.
9842 Misconfigured,
9843 /// If set, the enum was initialized with an unknown value.
9844 ///
9845 /// Applications can examine the value using [HealthCheckFirewallState::value] or
9846 /// [HealthCheckFirewallState::name].
9847 UnknownValue(health_check_firewall_state::UnknownValue),
9848 }
9849
9850 #[doc(hidden)]
9851 pub mod health_check_firewall_state {
9852 #[allow(unused_imports)]
9853 use super::*;
9854 #[derive(Clone, Debug, PartialEq)]
9855 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9856 }
9857
9858 impl HealthCheckFirewallState {
9859 /// Gets the enum value.
9860 ///
9861 /// Returns `None` if the enum contains an unknown value deserialized from
9862 /// the string representation of enums.
9863 pub fn value(&self) -> std::option::Option<i32> {
9864 match self {
9865 Self::Unspecified => std::option::Option::Some(0),
9866 Self::Configured => std::option::Option::Some(1),
9867 Self::Misconfigured => std::option::Option::Some(2),
9868 Self::UnknownValue(u) => u.0.value(),
9869 }
9870 }
9871
9872 /// Gets the enum value as a string.
9873 ///
9874 /// Returns `None` if the enum contains an unknown value deserialized from
9875 /// the integer representation of enums.
9876 pub fn name(&self) -> std::option::Option<&str> {
9877 match self {
9878 Self::Unspecified => {
9879 std::option::Option::Some("HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED")
9880 }
9881 Self::Configured => std::option::Option::Some("CONFIGURED"),
9882 Self::Misconfigured => std::option::Option::Some("MISCONFIGURED"),
9883 Self::UnknownValue(u) => u.0.name(),
9884 }
9885 }
9886 }
9887
9888 impl std::default::Default for HealthCheckFirewallState {
9889 fn default() -> Self {
9890 use std::convert::From;
9891 Self::from(0)
9892 }
9893 }
9894
9895 impl std::fmt::Display for HealthCheckFirewallState {
9896 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9897 wkt::internal::display_enum(f, self.name(), self.value())
9898 }
9899 }
9900
9901 impl std::convert::From<i32> for HealthCheckFirewallState {
9902 fn from(value: i32) -> Self {
9903 match value {
9904 0 => Self::Unspecified,
9905 1 => Self::Configured,
9906 2 => Self::Misconfigured,
9907 _ => Self::UnknownValue(health_check_firewall_state::UnknownValue(
9908 wkt::internal::UnknownEnumValue::Integer(value),
9909 )),
9910 }
9911 }
9912 }
9913
9914 impl std::convert::From<&str> for HealthCheckFirewallState {
9915 fn from(value: &str) -> Self {
9916 use std::string::ToString;
9917 match value {
9918 "HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED" => Self::Unspecified,
9919 "CONFIGURED" => Self::Configured,
9920 "MISCONFIGURED" => Self::Misconfigured,
9921 _ => Self::UnknownValue(health_check_firewall_state::UnknownValue(
9922 wkt::internal::UnknownEnumValue::String(value.to_string()),
9923 )),
9924 }
9925 }
9926 }
9927
9928 impl serde::ser::Serialize for HealthCheckFirewallState {
9929 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9930 where
9931 S: serde::Serializer,
9932 {
9933 match self {
9934 Self::Unspecified => serializer.serialize_i32(0),
9935 Self::Configured => serializer.serialize_i32(1),
9936 Self::Misconfigured => serializer.serialize_i32(2),
9937 Self::UnknownValue(u) => u.0.serialize(serializer),
9938 }
9939 }
9940 }
9941
9942 impl<'de> serde::de::Deserialize<'de> for HealthCheckFirewallState {
9943 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9944 where
9945 D: serde::Deserializer<'de>,
9946 {
9947 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HealthCheckFirewallState>::new(
9948 ".google.cloud.networkmanagement.v1.LoadBalancerBackend.HealthCheckFirewallState"))
9949 }
9950 }
9951}
9952
9953/// For display only. Metadata associated with a hybrid subnet.
9954#[derive(Clone, Default, PartialEq)]
9955#[non_exhaustive]
9956pub struct HybridSubnetInfo {
9957 /// Name of a hybrid subnet.
9958 pub display_name: std::string::String,
9959
9960 /// URI of a hybrid subnet.
9961 pub uri: std::string::String,
9962
9963 /// Name of a Google Cloud region where the hybrid subnet is configured.
9964 pub region: std::string::String,
9965
9966 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9967}
9968
9969impl HybridSubnetInfo {
9970 /// Creates a new default instance.
9971 pub fn new() -> Self {
9972 std::default::Default::default()
9973 }
9974
9975 /// Sets the value of [display_name][crate::model::HybridSubnetInfo::display_name].
9976 ///
9977 /// # Example
9978 /// ```ignore,no_run
9979 /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
9980 /// let x = HybridSubnetInfo::new().set_display_name("example");
9981 /// ```
9982 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9983 self.display_name = v.into();
9984 self
9985 }
9986
9987 /// Sets the value of [uri][crate::model::HybridSubnetInfo::uri].
9988 ///
9989 /// # Example
9990 /// ```ignore,no_run
9991 /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
9992 /// let x = HybridSubnetInfo::new().set_uri("example");
9993 /// ```
9994 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9995 self.uri = v.into();
9996 self
9997 }
9998
9999 /// Sets the value of [region][crate::model::HybridSubnetInfo::region].
10000 ///
10001 /// # Example
10002 /// ```ignore,no_run
10003 /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
10004 /// let x = HybridSubnetInfo::new().set_region("example");
10005 /// ```
10006 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10007 self.region = v.into();
10008 self
10009 }
10010}
10011
10012impl wkt::message::Message for HybridSubnetInfo {
10013 fn typename() -> &'static str {
10014 "type.googleapis.com/google.cloud.networkmanagement.v1.HybridSubnetInfo"
10015 }
10016}
10017
10018/// For display only. Metadata associated with a Compute Engine VPN gateway.
10019#[derive(Clone, Default, PartialEq)]
10020#[non_exhaustive]
10021pub struct VpnGatewayInfo {
10022 /// Name of a VPN gateway.
10023 pub display_name: std::string::String,
10024
10025 /// URI of a VPN gateway.
10026 pub uri: std::string::String,
10027
10028 /// URI of a Compute Engine network where the VPN gateway is configured.
10029 pub network_uri: std::string::String,
10030
10031 /// IP address of the VPN gateway.
10032 pub ip_address: std::string::String,
10033
10034 /// A VPN tunnel that is associated with this VPN gateway.
10035 /// There may be multiple VPN tunnels configured on a VPN gateway, and only
10036 /// the one relevant to the test is displayed.
10037 pub vpn_tunnel_uri: std::string::String,
10038
10039 /// Name of a Google Cloud region where this VPN gateway is configured.
10040 pub region: std::string::String,
10041
10042 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10043}
10044
10045impl VpnGatewayInfo {
10046 /// Creates a new default instance.
10047 pub fn new() -> Self {
10048 std::default::Default::default()
10049 }
10050
10051 /// Sets the value of [display_name][crate::model::VpnGatewayInfo::display_name].
10052 ///
10053 /// # Example
10054 /// ```ignore,no_run
10055 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10056 /// let x = VpnGatewayInfo::new().set_display_name("example");
10057 /// ```
10058 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10059 self.display_name = v.into();
10060 self
10061 }
10062
10063 /// Sets the value of [uri][crate::model::VpnGatewayInfo::uri].
10064 ///
10065 /// # Example
10066 /// ```ignore,no_run
10067 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10068 /// let x = VpnGatewayInfo::new().set_uri("example");
10069 /// ```
10070 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10071 self.uri = v.into();
10072 self
10073 }
10074
10075 /// Sets the value of [network_uri][crate::model::VpnGatewayInfo::network_uri].
10076 ///
10077 /// # Example
10078 /// ```ignore,no_run
10079 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10080 /// let x = VpnGatewayInfo::new().set_network_uri("example");
10081 /// ```
10082 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10083 self.network_uri = v.into();
10084 self
10085 }
10086
10087 /// Sets the value of [ip_address][crate::model::VpnGatewayInfo::ip_address].
10088 ///
10089 /// # Example
10090 /// ```ignore,no_run
10091 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10092 /// let x = VpnGatewayInfo::new().set_ip_address("example");
10093 /// ```
10094 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10095 self.ip_address = v.into();
10096 self
10097 }
10098
10099 /// Sets the value of [vpn_tunnel_uri][crate::model::VpnGatewayInfo::vpn_tunnel_uri].
10100 ///
10101 /// # Example
10102 /// ```ignore,no_run
10103 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10104 /// let x = VpnGatewayInfo::new().set_vpn_tunnel_uri("example");
10105 /// ```
10106 pub fn set_vpn_tunnel_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10107 self.vpn_tunnel_uri = v.into();
10108 self
10109 }
10110
10111 /// Sets the value of [region][crate::model::VpnGatewayInfo::region].
10112 ///
10113 /// # Example
10114 /// ```ignore,no_run
10115 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10116 /// let x = VpnGatewayInfo::new().set_region("example");
10117 /// ```
10118 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10119 self.region = v.into();
10120 self
10121 }
10122}
10123
10124impl wkt::message::Message for VpnGatewayInfo {
10125 fn typename() -> &'static str {
10126 "type.googleapis.com/google.cloud.networkmanagement.v1.VpnGatewayInfo"
10127 }
10128}
10129
10130/// For display only. Metadata associated with a Compute Engine VPN tunnel.
10131#[derive(Clone, Default, PartialEq)]
10132#[non_exhaustive]
10133pub struct VpnTunnelInfo {
10134 /// Name of a VPN tunnel.
10135 pub display_name: std::string::String,
10136
10137 /// URI of a VPN tunnel.
10138 pub uri: std::string::String,
10139
10140 /// URI of the VPN gateway at local end of the tunnel.
10141 pub source_gateway: std::string::String,
10142
10143 /// URI of a VPN gateway at remote end of the tunnel.
10144 pub remote_gateway: std::string::String,
10145
10146 /// Remote VPN gateway's IP address.
10147 pub remote_gateway_ip: std::string::String,
10148
10149 /// Local VPN gateway's IP address.
10150 pub source_gateway_ip: std::string::String,
10151
10152 /// URI of a Compute Engine network where the VPN tunnel is configured.
10153 pub network_uri: std::string::String,
10154
10155 /// Name of a Google Cloud region where this VPN tunnel is configured.
10156 pub region: std::string::String,
10157
10158 /// Type of the routing policy.
10159 pub routing_type: crate::model::vpn_tunnel_info::RoutingType,
10160
10161 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10162}
10163
10164impl VpnTunnelInfo {
10165 /// Creates a new default instance.
10166 pub fn new() -> Self {
10167 std::default::Default::default()
10168 }
10169
10170 /// Sets the value of [display_name][crate::model::VpnTunnelInfo::display_name].
10171 ///
10172 /// # Example
10173 /// ```ignore,no_run
10174 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10175 /// let x = VpnTunnelInfo::new().set_display_name("example");
10176 /// ```
10177 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10178 self.display_name = v.into();
10179 self
10180 }
10181
10182 /// Sets the value of [uri][crate::model::VpnTunnelInfo::uri].
10183 ///
10184 /// # Example
10185 /// ```ignore,no_run
10186 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10187 /// let x = VpnTunnelInfo::new().set_uri("example");
10188 /// ```
10189 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10190 self.uri = v.into();
10191 self
10192 }
10193
10194 /// Sets the value of [source_gateway][crate::model::VpnTunnelInfo::source_gateway].
10195 ///
10196 /// # Example
10197 /// ```ignore,no_run
10198 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10199 /// let x = VpnTunnelInfo::new().set_source_gateway("example");
10200 /// ```
10201 pub fn set_source_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10202 self.source_gateway = v.into();
10203 self
10204 }
10205
10206 /// Sets the value of [remote_gateway][crate::model::VpnTunnelInfo::remote_gateway].
10207 ///
10208 /// # Example
10209 /// ```ignore,no_run
10210 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10211 /// let x = VpnTunnelInfo::new().set_remote_gateway("example");
10212 /// ```
10213 pub fn set_remote_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10214 self.remote_gateway = v.into();
10215 self
10216 }
10217
10218 /// Sets the value of [remote_gateway_ip][crate::model::VpnTunnelInfo::remote_gateway_ip].
10219 ///
10220 /// # Example
10221 /// ```ignore,no_run
10222 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10223 /// let x = VpnTunnelInfo::new().set_remote_gateway_ip("example");
10224 /// ```
10225 pub fn set_remote_gateway_ip<T: std::convert::Into<std::string::String>>(
10226 mut self,
10227 v: T,
10228 ) -> Self {
10229 self.remote_gateway_ip = v.into();
10230 self
10231 }
10232
10233 /// Sets the value of [source_gateway_ip][crate::model::VpnTunnelInfo::source_gateway_ip].
10234 ///
10235 /// # Example
10236 /// ```ignore,no_run
10237 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10238 /// let x = VpnTunnelInfo::new().set_source_gateway_ip("example");
10239 /// ```
10240 pub fn set_source_gateway_ip<T: std::convert::Into<std::string::String>>(
10241 mut self,
10242 v: T,
10243 ) -> Self {
10244 self.source_gateway_ip = v.into();
10245 self
10246 }
10247
10248 /// Sets the value of [network_uri][crate::model::VpnTunnelInfo::network_uri].
10249 ///
10250 /// # Example
10251 /// ```ignore,no_run
10252 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10253 /// let x = VpnTunnelInfo::new().set_network_uri("example");
10254 /// ```
10255 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10256 self.network_uri = v.into();
10257 self
10258 }
10259
10260 /// Sets the value of [region][crate::model::VpnTunnelInfo::region].
10261 ///
10262 /// # Example
10263 /// ```ignore,no_run
10264 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10265 /// let x = VpnTunnelInfo::new().set_region("example");
10266 /// ```
10267 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10268 self.region = v.into();
10269 self
10270 }
10271
10272 /// Sets the value of [routing_type][crate::model::VpnTunnelInfo::routing_type].
10273 ///
10274 /// # Example
10275 /// ```ignore,no_run
10276 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10277 /// use google_cloud_networkmanagement_v1::model::vpn_tunnel_info::RoutingType;
10278 /// let x0 = VpnTunnelInfo::new().set_routing_type(RoutingType::RouteBased);
10279 /// let x1 = VpnTunnelInfo::new().set_routing_type(RoutingType::PolicyBased);
10280 /// let x2 = VpnTunnelInfo::new().set_routing_type(RoutingType::Dynamic);
10281 /// ```
10282 pub fn set_routing_type<T: std::convert::Into<crate::model::vpn_tunnel_info::RoutingType>>(
10283 mut self,
10284 v: T,
10285 ) -> Self {
10286 self.routing_type = v.into();
10287 self
10288 }
10289}
10290
10291impl wkt::message::Message for VpnTunnelInfo {
10292 fn typename() -> &'static str {
10293 "type.googleapis.com/google.cloud.networkmanagement.v1.VpnTunnelInfo"
10294 }
10295}
10296
10297/// Defines additional types related to [VpnTunnelInfo].
10298pub mod vpn_tunnel_info {
10299 #[allow(unused_imports)]
10300 use super::*;
10301
10302 /// Types of VPN routing policy. For details, refer to [Networks and Tunnel
10303 /// routing](https://cloud.google.com/network-connectivity/docs/vpn/concepts/choosing-networks-routing/).
10304 ///
10305 /// # Working with unknown values
10306 ///
10307 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10308 /// additional enum variants at any time. Adding new variants is not considered
10309 /// a breaking change. Applications should write their code in anticipation of:
10310 ///
10311 /// - New values appearing in future releases of the client library, **and**
10312 /// - New values received dynamically, without application changes.
10313 ///
10314 /// Please consult the [Working with enums] section in the user guide for some
10315 /// guidelines.
10316 ///
10317 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10318 #[derive(Clone, Debug, PartialEq)]
10319 #[non_exhaustive]
10320 pub enum RoutingType {
10321 /// Unspecified type. Default value.
10322 Unspecified,
10323 /// Route based VPN.
10324 RouteBased,
10325 /// Policy based routing.
10326 PolicyBased,
10327 /// Dynamic (BGP) routing.
10328 Dynamic,
10329 /// If set, the enum was initialized with an unknown value.
10330 ///
10331 /// Applications can examine the value using [RoutingType::value] or
10332 /// [RoutingType::name].
10333 UnknownValue(routing_type::UnknownValue),
10334 }
10335
10336 #[doc(hidden)]
10337 pub mod routing_type {
10338 #[allow(unused_imports)]
10339 use super::*;
10340 #[derive(Clone, Debug, PartialEq)]
10341 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10342 }
10343
10344 impl RoutingType {
10345 /// Gets the enum value.
10346 ///
10347 /// Returns `None` if the enum contains an unknown value deserialized from
10348 /// the string representation of enums.
10349 pub fn value(&self) -> std::option::Option<i32> {
10350 match self {
10351 Self::Unspecified => std::option::Option::Some(0),
10352 Self::RouteBased => std::option::Option::Some(1),
10353 Self::PolicyBased => std::option::Option::Some(2),
10354 Self::Dynamic => std::option::Option::Some(3),
10355 Self::UnknownValue(u) => u.0.value(),
10356 }
10357 }
10358
10359 /// Gets the enum value as a string.
10360 ///
10361 /// Returns `None` if the enum contains an unknown value deserialized from
10362 /// the integer representation of enums.
10363 pub fn name(&self) -> std::option::Option<&str> {
10364 match self {
10365 Self::Unspecified => std::option::Option::Some("ROUTING_TYPE_UNSPECIFIED"),
10366 Self::RouteBased => std::option::Option::Some("ROUTE_BASED"),
10367 Self::PolicyBased => std::option::Option::Some("POLICY_BASED"),
10368 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
10369 Self::UnknownValue(u) => u.0.name(),
10370 }
10371 }
10372 }
10373
10374 impl std::default::Default for RoutingType {
10375 fn default() -> Self {
10376 use std::convert::From;
10377 Self::from(0)
10378 }
10379 }
10380
10381 impl std::fmt::Display for RoutingType {
10382 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10383 wkt::internal::display_enum(f, self.name(), self.value())
10384 }
10385 }
10386
10387 impl std::convert::From<i32> for RoutingType {
10388 fn from(value: i32) -> Self {
10389 match value {
10390 0 => Self::Unspecified,
10391 1 => Self::RouteBased,
10392 2 => Self::PolicyBased,
10393 3 => Self::Dynamic,
10394 _ => Self::UnknownValue(routing_type::UnknownValue(
10395 wkt::internal::UnknownEnumValue::Integer(value),
10396 )),
10397 }
10398 }
10399 }
10400
10401 impl std::convert::From<&str> for RoutingType {
10402 fn from(value: &str) -> Self {
10403 use std::string::ToString;
10404 match value {
10405 "ROUTING_TYPE_UNSPECIFIED" => Self::Unspecified,
10406 "ROUTE_BASED" => Self::RouteBased,
10407 "POLICY_BASED" => Self::PolicyBased,
10408 "DYNAMIC" => Self::Dynamic,
10409 _ => Self::UnknownValue(routing_type::UnknownValue(
10410 wkt::internal::UnknownEnumValue::String(value.to_string()),
10411 )),
10412 }
10413 }
10414 }
10415
10416 impl serde::ser::Serialize for RoutingType {
10417 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10418 where
10419 S: serde::Serializer,
10420 {
10421 match self {
10422 Self::Unspecified => serializer.serialize_i32(0),
10423 Self::RouteBased => serializer.serialize_i32(1),
10424 Self::PolicyBased => serializer.serialize_i32(2),
10425 Self::Dynamic => serializer.serialize_i32(3),
10426 Self::UnknownValue(u) => u.0.serialize(serializer),
10427 }
10428 }
10429 }
10430
10431 impl<'de> serde::de::Deserialize<'de> for RoutingType {
10432 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10433 where
10434 D: serde::Deserializer<'de>,
10435 {
10436 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutingType>::new(
10437 ".google.cloud.networkmanagement.v1.VpnTunnelInfo.RoutingType",
10438 ))
10439 }
10440 }
10441}
10442
10443/// For display only. Metadata associated with an Interconnect attachment.
10444#[derive(Clone, Default, PartialEq)]
10445#[non_exhaustive]
10446pub struct InterconnectAttachmentInfo {
10447 /// Name of an Interconnect attachment.
10448 pub display_name: std::string::String,
10449
10450 /// URI of an Interconnect attachment.
10451 pub uri: std::string::String,
10452
10453 /// URI of the Interconnect where the Interconnect attachment is
10454 /// configured.
10455 pub interconnect_uri: std::string::String,
10456
10457 /// Name of a Google Cloud region where the Interconnect attachment is
10458 /// configured.
10459 pub region: std::string::String,
10460
10461 /// URI of the Cloud Router to be used for dynamic routing.
10462 pub cloud_router_uri: std::string::String,
10463
10464 /// The type of interconnect attachment this is.
10465 pub r#type: crate::model::interconnect_attachment_info::Type,
10466
10467 /// Appliance IP address that was matched for L2_DEDICATED attachments.
10468 pub l2_attachment_matched_ip_address: std::string::String,
10469
10470 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10471}
10472
10473impl InterconnectAttachmentInfo {
10474 /// Creates a new default instance.
10475 pub fn new() -> Self {
10476 std::default::Default::default()
10477 }
10478
10479 /// Sets the value of [display_name][crate::model::InterconnectAttachmentInfo::display_name].
10480 ///
10481 /// # Example
10482 /// ```ignore,no_run
10483 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10484 /// let x = InterconnectAttachmentInfo::new().set_display_name("example");
10485 /// ```
10486 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10487 self.display_name = v.into();
10488 self
10489 }
10490
10491 /// Sets the value of [uri][crate::model::InterconnectAttachmentInfo::uri].
10492 ///
10493 /// # Example
10494 /// ```ignore,no_run
10495 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10496 /// let x = InterconnectAttachmentInfo::new().set_uri("example");
10497 /// ```
10498 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10499 self.uri = v.into();
10500 self
10501 }
10502
10503 /// Sets the value of [interconnect_uri][crate::model::InterconnectAttachmentInfo::interconnect_uri].
10504 ///
10505 /// # Example
10506 /// ```ignore,no_run
10507 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10508 /// let x = InterconnectAttachmentInfo::new().set_interconnect_uri("example");
10509 /// ```
10510 pub fn set_interconnect_uri<T: std::convert::Into<std::string::String>>(
10511 mut self,
10512 v: T,
10513 ) -> Self {
10514 self.interconnect_uri = v.into();
10515 self
10516 }
10517
10518 /// Sets the value of [region][crate::model::InterconnectAttachmentInfo::region].
10519 ///
10520 /// # Example
10521 /// ```ignore,no_run
10522 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10523 /// let x = InterconnectAttachmentInfo::new().set_region("example");
10524 /// ```
10525 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10526 self.region = v.into();
10527 self
10528 }
10529
10530 /// Sets the value of [cloud_router_uri][crate::model::InterconnectAttachmentInfo::cloud_router_uri].
10531 ///
10532 /// # Example
10533 /// ```ignore,no_run
10534 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10535 /// let x = InterconnectAttachmentInfo::new().set_cloud_router_uri("example");
10536 /// ```
10537 pub fn set_cloud_router_uri<T: std::convert::Into<std::string::String>>(
10538 mut self,
10539 v: T,
10540 ) -> Self {
10541 self.cloud_router_uri = v.into();
10542 self
10543 }
10544
10545 /// Sets the value of [r#type][crate::model::InterconnectAttachmentInfo::type].
10546 ///
10547 /// # Example
10548 /// ```ignore,no_run
10549 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10550 /// use google_cloud_networkmanagement_v1::model::interconnect_attachment_info::Type;
10551 /// let x0 = InterconnectAttachmentInfo::new().set_type(Type::Dedicated);
10552 /// let x1 = InterconnectAttachmentInfo::new().set_type(Type::Partner);
10553 /// let x2 = InterconnectAttachmentInfo::new().set_type(Type::PartnerProvider);
10554 /// ```
10555 pub fn set_type<T: std::convert::Into<crate::model::interconnect_attachment_info::Type>>(
10556 mut self,
10557 v: T,
10558 ) -> Self {
10559 self.r#type = v.into();
10560 self
10561 }
10562
10563 /// Sets the value of [l2_attachment_matched_ip_address][crate::model::InterconnectAttachmentInfo::l2_attachment_matched_ip_address].
10564 ///
10565 /// # Example
10566 /// ```ignore,no_run
10567 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10568 /// let x = InterconnectAttachmentInfo::new().set_l2_attachment_matched_ip_address("example");
10569 /// ```
10570 pub fn set_l2_attachment_matched_ip_address<T: std::convert::Into<std::string::String>>(
10571 mut self,
10572 v: T,
10573 ) -> Self {
10574 self.l2_attachment_matched_ip_address = v.into();
10575 self
10576 }
10577}
10578
10579impl wkt::message::Message for InterconnectAttachmentInfo {
10580 fn typename() -> &'static str {
10581 "type.googleapis.com/google.cloud.networkmanagement.v1.InterconnectAttachmentInfo"
10582 }
10583}
10584
10585/// Defines additional types related to [InterconnectAttachmentInfo].
10586pub mod interconnect_attachment_info {
10587 #[allow(unused_imports)]
10588 use super::*;
10589
10590 /// What type of interconnect attachment this is.
10591 ///
10592 /// # Working with unknown values
10593 ///
10594 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10595 /// additional enum variants at any time. Adding new variants is not considered
10596 /// a breaking change. Applications should write their code in anticipation of:
10597 ///
10598 /// - New values appearing in future releases of the client library, **and**
10599 /// - New values received dynamically, without application changes.
10600 ///
10601 /// Please consult the [Working with enums] section in the user guide for some
10602 /// guidelines.
10603 ///
10604 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10605 #[derive(Clone, Debug, PartialEq)]
10606 #[non_exhaustive]
10607 pub enum Type {
10608 /// Unspecified type.
10609 Unspecified,
10610 /// Attachment to a dedicated interconnect.
10611 Dedicated,
10612 /// Attachment to a partner interconnect, created by the customer.
10613 Partner,
10614 /// Attachment to a partner interconnect, created by the partner.
10615 PartnerProvider,
10616 /// Attachment to a L2 interconnect, created by the customer.
10617 L2Dedicated,
10618 /// If set, the enum was initialized with an unknown value.
10619 ///
10620 /// Applications can examine the value using [Type::value] or
10621 /// [Type::name].
10622 UnknownValue(r#type::UnknownValue),
10623 }
10624
10625 #[doc(hidden)]
10626 pub mod r#type {
10627 #[allow(unused_imports)]
10628 use super::*;
10629 #[derive(Clone, Debug, PartialEq)]
10630 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10631 }
10632
10633 impl Type {
10634 /// Gets the enum value.
10635 ///
10636 /// Returns `None` if the enum contains an unknown value deserialized from
10637 /// the string representation of enums.
10638 pub fn value(&self) -> std::option::Option<i32> {
10639 match self {
10640 Self::Unspecified => std::option::Option::Some(0),
10641 Self::Dedicated => std::option::Option::Some(1),
10642 Self::Partner => std::option::Option::Some(2),
10643 Self::PartnerProvider => std::option::Option::Some(3),
10644 Self::L2Dedicated => std::option::Option::Some(4),
10645 Self::UnknownValue(u) => u.0.value(),
10646 }
10647 }
10648
10649 /// Gets the enum value as a string.
10650 ///
10651 /// Returns `None` if the enum contains an unknown value deserialized from
10652 /// the integer representation of enums.
10653 pub fn name(&self) -> std::option::Option<&str> {
10654 match self {
10655 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
10656 Self::Dedicated => std::option::Option::Some("DEDICATED"),
10657 Self::Partner => std::option::Option::Some("PARTNER"),
10658 Self::PartnerProvider => std::option::Option::Some("PARTNER_PROVIDER"),
10659 Self::L2Dedicated => std::option::Option::Some("L2_DEDICATED"),
10660 Self::UnknownValue(u) => u.0.name(),
10661 }
10662 }
10663 }
10664
10665 impl std::default::Default for Type {
10666 fn default() -> Self {
10667 use std::convert::From;
10668 Self::from(0)
10669 }
10670 }
10671
10672 impl std::fmt::Display for Type {
10673 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10674 wkt::internal::display_enum(f, self.name(), self.value())
10675 }
10676 }
10677
10678 impl std::convert::From<i32> for Type {
10679 fn from(value: i32) -> Self {
10680 match value {
10681 0 => Self::Unspecified,
10682 1 => Self::Dedicated,
10683 2 => Self::Partner,
10684 3 => Self::PartnerProvider,
10685 4 => Self::L2Dedicated,
10686 _ => Self::UnknownValue(r#type::UnknownValue(
10687 wkt::internal::UnknownEnumValue::Integer(value),
10688 )),
10689 }
10690 }
10691 }
10692
10693 impl std::convert::From<&str> for Type {
10694 fn from(value: &str) -> Self {
10695 use std::string::ToString;
10696 match value {
10697 "TYPE_UNSPECIFIED" => Self::Unspecified,
10698 "DEDICATED" => Self::Dedicated,
10699 "PARTNER" => Self::Partner,
10700 "PARTNER_PROVIDER" => Self::PartnerProvider,
10701 "L2_DEDICATED" => Self::L2Dedicated,
10702 _ => Self::UnknownValue(r#type::UnknownValue(
10703 wkt::internal::UnknownEnumValue::String(value.to_string()),
10704 )),
10705 }
10706 }
10707 }
10708
10709 impl serde::ser::Serialize for Type {
10710 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10711 where
10712 S: serde::Serializer,
10713 {
10714 match self {
10715 Self::Unspecified => serializer.serialize_i32(0),
10716 Self::Dedicated => serializer.serialize_i32(1),
10717 Self::Partner => serializer.serialize_i32(2),
10718 Self::PartnerProvider => serializer.serialize_i32(3),
10719 Self::L2Dedicated => serializer.serialize_i32(4),
10720 Self::UnknownValue(u) => u.0.serialize(serializer),
10721 }
10722 }
10723 }
10724
10725 impl<'de> serde::de::Deserialize<'de> for Type {
10726 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10727 where
10728 D: serde::Deserializer<'de>,
10729 {
10730 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
10731 ".google.cloud.networkmanagement.v1.InterconnectAttachmentInfo.Type",
10732 ))
10733 }
10734 }
10735}
10736
10737/// For display only. The specification of the endpoints for the test.
10738/// EndpointInfo is derived from source and destination Endpoint and validated
10739/// by the backend data plane model.
10740#[derive(Clone, Default, PartialEq)]
10741#[non_exhaustive]
10742pub struct EndpointInfo {
10743 /// Source IP address.
10744 pub source_ip: std::string::String,
10745
10746 /// Destination IP address.
10747 pub destination_ip: std::string::String,
10748
10749 /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
10750 pub protocol: std::string::String,
10751
10752 /// Source port. Only valid when protocol is TCP or UDP.
10753 pub source_port: i32,
10754
10755 /// Destination port. Only valid when protocol is TCP or UDP.
10756 pub destination_port: i32,
10757
10758 /// URI of the network where this packet originates from.
10759 pub source_network_uri: std::string::String,
10760
10761 /// URI of the network where this packet is sent to.
10762 pub destination_network_uri: std::string::String,
10763
10764 /// URI of the source telemetry agent this packet originates from.
10765 pub source_agent_uri: std::string::String,
10766
10767 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10768}
10769
10770impl EndpointInfo {
10771 /// Creates a new default instance.
10772 pub fn new() -> Self {
10773 std::default::Default::default()
10774 }
10775
10776 /// Sets the value of [source_ip][crate::model::EndpointInfo::source_ip].
10777 ///
10778 /// # Example
10779 /// ```ignore,no_run
10780 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10781 /// let x = EndpointInfo::new().set_source_ip("example");
10782 /// ```
10783 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10784 self.source_ip = v.into();
10785 self
10786 }
10787
10788 /// Sets the value of [destination_ip][crate::model::EndpointInfo::destination_ip].
10789 ///
10790 /// # Example
10791 /// ```ignore,no_run
10792 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10793 /// let x = EndpointInfo::new().set_destination_ip("example");
10794 /// ```
10795 pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10796 self.destination_ip = v.into();
10797 self
10798 }
10799
10800 /// Sets the value of [protocol][crate::model::EndpointInfo::protocol].
10801 ///
10802 /// # Example
10803 /// ```ignore,no_run
10804 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10805 /// let x = EndpointInfo::new().set_protocol("example");
10806 /// ```
10807 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10808 self.protocol = v.into();
10809 self
10810 }
10811
10812 /// Sets the value of [source_port][crate::model::EndpointInfo::source_port].
10813 ///
10814 /// # Example
10815 /// ```ignore,no_run
10816 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10817 /// let x = EndpointInfo::new().set_source_port(42);
10818 /// ```
10819 pub fn set_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10820 self.source_port = v.into();
10821 self
10822 }
10823
10824 /// Sets the value of [destination_port][crate::model::EndpointInfo::destination_port].
10825 ///
10826 /// # Example
10827 /// ```ignore,no_run
10828 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10829 /// let x = EndpointInfo::new().set_destination_port(42);
10830 /// ```
10831 pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10832 self.destination_port = v.into();
10833 self
10834 }
10835
10836 /// Sets the value of [source_network_uri][crate::model::EndpointInfo::source_network_uri].
10837 ///
10838 /// # Example
10839 /// ```ignore,no_run
10840 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10841 /// let x = EndpointInfo::new().set_source_network_uri("example");
10842 /// ```
10843 pub fn set_source_network_uri<T: std::convert::Into<std::string::String>>(
10844 mut self,
10845 v: T,
10846 ) -> Self {
10847 self.source_network_uri = v.into();
10848 self
10849 }
10850
10851 /// Sets the value of [destination_network_uri][crate::model::EndpointInfo::destination_network_uri].
10852 ///
10853 /// # Example
10854 /// ```ignore,no_run
10855 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10856 /// let x = EndpointInfo::new().set_destination_network_uri("example");
10857 /// ```
10858 pub fn set_destination_network_uri<T: std::convert::Into<std::string::String>>(
10859 mut self,
10860 v: T,
10861 ) -> Self {
10862 self.destination_network_uri = v.into();
10863 self
10864 }
10865
10866 /// Sets the value of [source_agent_uri][crate::model::EndpointInfo::source_agent_uri].
10867 ///
10868 /// # Example
10869 /// ```ignore,no_run
10870 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10871 /// let x = EndpointInfo::new().set_source_agent_uri("example");
10872 /// ```
10873 pub fn set_source_agent_uri<T: std::convert::Into<std::string::String>>(
10874 mut self,
10875 v: T,
10876 ) -> Self {
10877 self.source_agent_uri = v.into();
10878 self
10879 }
10880}
10881
10882impl wkt::message::Message for EndpointInfo {
10883 fn typename() -> &'static str {
10884 "type.googleapis.com/google.cloud.networkmanagement.v1.EndpointInfo"
10885 }
10886}
10887
10888/// Details of the final state "deliver" and associated resource.
10889#[derive(Clone, Default, PartialEq)]
10890#[non_exhaustive]
10891pub struct DeliverInfo {
10892 /// Target type where the packet is delivered to.
10893 pub target: crate::model::deliver_info::Target,
10894
10895 /// URI of the resource that the packet is delivered to.
10896 pub resource_uri: std::string::String,
10897
10898 /// IP address of the target (if applicable).
10899 pub ip_address: std::string::String,
10900
10901 /// Name of the Cloud Storage Bucket the packet is delivered to (if
10902 /// applicable).
10903 pub storage_bucket: std::string::String,
10904
10905 /// PSC Google API target the packet is delivered to (if applicable).
10906 pub psc_google_api_target: std::string::String,
10907
10908 /// Recognized type of a Google Service the packet is delivered to (if
10909 /// applicable).
10910 pub google_service_type: crate::model::deliver_info::GoogleServiceType,
10911
10912 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10913}
10914
10915impl DeliverInfo {
10916 /// Creates a new default instance.
10917 pub fn new() -> Self {
10918 std::default::Default::default()
10919 }
10920
10921 /// Sets the value of [target][crate::model::DeliverInfo::target].
10922 ///
10923 /// # Example
10924 /// ```ignore,no_run
10925 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10926 /// use google_cloud_networkmanagement_v1::model::deliver_info::Target;
10927 /// let x0 = DeliverInfo::new().set_target(Target::Instance);
10928 /// let x1 = DeliverInfo::new().set_target(Target::Internet);
10929 /// let x2 = DeliverInfo::new().set_target(Target::GoogleApi);
10930 /// ```
10931 pub fn set_target<T: std::convert::Into<crate::model::deliver_info::Target>>(
10932 mut self,
10933 v: T,
10934 ) -> Self {
10935 self.target = v.into();
10936 self
10937 }
10938
10939 /// Sets the value of [resource_uri][crate::model::DeliverInfo::resource_uri].
10940 ///
10941 /// # Example
10942 /// ```ignore,no_run
10943 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10944 /// let x = DeliverInfo::new().set_resource_uri("example");
10945 /// ```
10946 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10947 self.resource_uri = v.into();
10948 self
10949 }
10950
10951 /// Sets the value of [ip_address][crate::model::DeliverInfo::ip_address].
10952 ///
10953 /// # Example
10954 /// ```ignore,no_run
10955 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10956 /// let x = DeliverInfo::new().set_ip_address("example");
10957 /// ```
10958 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10959 self.ip_address = v.into();
10960 self
10961 }
10962
10963 /// Sets the value of [storage_bucket][crate::model::DeliverInfo::storage_bucket].
10964 ///
10965 /// # Example
10966 /// ```ignore,no_run
10967 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10968 /// let x = DeliverInfo::new().set_storage_bucket("example");
10969 /// ```
10970 pub fn set_storage_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10971 self.storage_bucket = v.into();
10972 self
10973 }
10974
10975 /// Sets the value of [psc_google_api_target][crate::model::DeliverInfo::psc_google_api_target].
10976 ///
10977 /// # Example
10978 /// ```ignore,no_run
10979 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10980 /// let x = DeliverInfo::new().set_psc_google_api_target("example");
10981 /// ```
10982 pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
10983 mut self,
10984 v: T,
10985 ) -> Self {
10986 self.psc_google_api_target = v.into();
10987 self
10988 }
10989
10990 /// Sets the value of [google_service_type][crate::model::DeliverInfo::google_service_type].
10991 ///
10992 /// # Example
10993 /// ```ignore,no_run
10994 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10995 /// use google_cloud_networkmanagement_v1::model::deliver_info::GoogleServiceType;
10996 /// let x0 = DeliverInfo::new().set_google_service_type(GoogleServiceType::Iap);
10997 /// let x1 = DeliverInfo::new().set_google_service_type(GoogleServiceType::GfeProxyOrHealthCheckProber);
10998 /// let x2 = DeliverInfo::new().set_google_service_type(GoogleServiceType::CloudDns);
10999 /// ```
11000 pub fn set_google_service_type<
11001 T: std::convert::Into<crate::model::deliver_info::GoogleServiceType>,
11002 >(
11003 mut self,
11004 v: T,
11005 ) -> Self {
11006 self.google_service_type = v.into();
11007 self
11008 }
11009}
11010
11011impl wkt::message::Message for DeliverInfo {
11012 fn typename() -> &'static str {
11013 "type.googleapis.com/google.cloud.networkmanagement.v1.DeliverInfo"
11014 }
11015}
11016
11017/// Defines additional types related to [DeliverInfo].
11018pub mod deliver_info {
11019 #[allow(unused_imports)]
11020 use super::*;
11021
11022 /// Deliver target types:
11023 ///
11024 /// # Working with unknown values
11025 ///
11026 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11027 /// additional enum variants at any time. Adding new variants is not considered
11028 /// a breaking change. Applications should write their code in anticipation of:
11029 ///
11030 /// - New values appearing in future releases of the client library, **and**
11031 /// - New values received dynamically, without application changes.
11032 ///
11033 /// Please consult the [Working with enums] section in the user guide for some
11034 /// guidelines.
11035 ///
11036 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11037 #[derive(Clone, Debug, PartialEq)]
11038 #[non_exhaustive]
11039 pub enum Target {
11040 /// Target not specified.
11041 Unspecified,
11042 /// Target is a Compute Engine instance.
11043 Instance,
11044 /// Target is the internet.
11045 Internet,
11046 /// Target is a Google API.
11047 GoogleApi,
11048 /// Target is a Google Kubernetes Engine cluster master.
11049 GkeMaster,
11050 /// Target is a Cloud SQL instance.
11051 CloudSqlInstance,
11052 /// Target is a published service that uses [Private Service
11053 /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
11054 PscPublishedService,
11055 /// Target is Google APIs that use [Private Service
11056 /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-apis).
11057 PscGoogleApi,
11058 /// Target is a VPC-SC that uses [Private Service
11059 /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-apis).
11060 PscVpcSc,
11061 /// Target is a serverless network endpoint group.
11062 ServerlessNeg,
11063 /// Target is a Cloud Storage bucket.
11064 StorageBucket,
11065 /// Target is a private network. Used only for return traces.
11066 PrivateNetwork,
11067 /// Target is a Cloud Function. Used only for return traces.
11068 CloudFunction,
11069 /// Target is a App Engine service version. Used only for return traces.
11070 AppEngineVersion,
11071 /// Target is a Cloud Run revision. Used only for return traces.
11072 CloudRunRevision,
11073 /// Target is a Google-managed service. Used only for return traces.
11074 GoogleManagedService,
11075 /// Target is a Redis Instance.
11076 RedisInstance,
11077 /// Target is a Redis Cluster.
11078 RedisCluster,
11079 /// Target is a GKE Pod.
11080 GkePod,
11081 /// If set, the enum was initialized with an unknown value.
11082 ///
11083 /// Applications can examine the value using [Target::value] or
11084 /// [Target::name].
11085 UnknownValue(target::UnknownValue),
11086 }
11087
11088 #[doc(hidden)]
11089 pub mod target {
11090 #[allow(unused_imports)]
11091 use super::*;
11092 #[derive(Clone, Debug, PartialEq)]
11093 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11094 }
11095
11096 impl Target {
11097 /// Gets the enum value.
11098 ///
11099 /// Returns `None` if the enum contains an unknown value deserialized from
11100 /// the string representation of enums.
11101 pub fn value(&self) -> std::option::Option<i32> {
11102 match self {
11103 Self::Unspecified => std::option::Option::Some(0),
11104 Self::Instance => std::option::Option::Some(1),
11105 Self::Internet => std::option::Option::Some(2),
11106 Self::GoogleApi => std::option::Option::Some(3),
11107 Self::GkeMaster => std::option::Option::Some(4),
11108 Self::CloudSqlInstance => std::option::Option::Some(5),
11109 Self::PscPublishedService => std::option::Option::Some(6),
11110 Self::PscGoogleApi => std::option::Option::Some(7),
11111 Self::PscVpcSc => std::option::Option::Some(8),
11112 Self::ServerlessNeg => std::option::Option::Some(9),
11113 Self::StorageBucket => std::option::Option::Some(10),
11114 Self::PrivateNetwork => std::option::Option::Some(11),
11115 Self::CloudFunction => std::option::Option::Some(12),
11116 Self::AppEngineVersion => std::option::Option::Some(13),
11117 Self::CloudRunRevision => std::option::Option::Some(14),
11118 Self::GoogleManagedService => std::option::Option::Some(15),
11119 Self::RedisInstance => std::option::Option::Some(16),
11120 Self::RedisCluster => std::option::Option::Some(17),
11121 Self::GkePod => std::option::Option::Some(19),
11122 Self::UnknownValue(u) => u.0.value(),
11123 }
11124 }
11125
11126 /// Gets the enum value as a string.
11127 ///
11128 /// Returns `None` if the enum contains an unknown value deserialized from
11129 /// the integer representation of enums.
11130 pub fn name(&self) -> std::option::Option<&str> {
11131 match self {
11132 Self::Unspecified => std::option::Option::Some("TARGET_UNSPECIFIED"),
11133 Self::Instance => std::option::Option::Some("INSTANCE"),
11134 Self::Internet => std::option::Option::Some("INTERNET"),
11135 Self::GoogleApi => std::option::Option::Some("GOOGLE_API"),
11136 Self::GkeMaster => std::option::Option::Some("GKE_MASTER"),
11137 Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
11138 Self::PscPublishedService => std::option::Option::Some("PSC_PUBLISHED_SERVICE"),
11139 Self::PscGoogleApi => std::option::Option::Some("PSC_GOOGLE_API"),
11140 Self::PscVpcSc => std::option::Option::Some("PSC_VPC_SC"),
11141 Self::ServerlessNeg => std::option::Option::Some("SERVERLESS_NEG"),
11142 Self::StorageBucket => std::option::Option::Some("STORAGE_BUCKET"),
11143 Self::PrivateNetwork => std::option::Option::Some("PRIVATE_NETWORK"),
11144 Self::CloudFunction => std::option::Option::Some("CLOUD_FUNCTION"),
11145 Self::AppEngineVersion => std::option::Option::Some("APP_ENGINE_VERSION"),
11146 Self::CloudRunRevision => std::option::Option::Some("CLOUD_RUN_REVISION"),
11147 Self::GoogleManagedService => std::option::Option::Some("GOOGLE_MANAGED_SERVICE"),
11148 Self::RedisInstance => std::option::Option::Some("REDIS_INSTANCE"),
11149 Self::RedisCluster => std::option::Option::Some("REDIS_CLUSTER"),
11150 Self::GkePod => std::option::Option::Some("GKE_POD"),
11151 Self::UnknownValue(u) => u.0.name(),
11152 }
11153 }
11154 }
11155
11156 impl std::default::Default for Target {
11157 fn default() -> Self {
11158 use std::convert::From;
11159 Self::from(0)
11160 }
11161 }
11162
11163 impl std::fmt::Display for Target {
11164 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11165 wkt::internal::display_enum(f, self.name(), self.value())
11166 }
11167 }
11168
11169 impl std::convert::From<i32> for Target {
11170 fn from(value: i32) -> Self {
11171 match value {
11172 0 => Self::Unspecified,
11173 1 => Self::Instance,
11174 2 => Self::Internet,
11175 3 => Self::GoogleApi,
11176 4 => Self::GkeMaster,
11177 5 => Self::CloudSqlInstance,
11178 6 => Self::PscPublishedService,
11179 7 => Self::PscGoogleApi,
11180 8 => Self::PscVpcSc,
11181 9 => Self::ServerlessNeg,
11182 10 => Self::StorageBucket,
11183 11 => Self::PrivateNetwork,
11184 12 => Self::CloudFunction,
11185 13 => Self::AppEngineVersion,
11186 14 => Self::CloudRunRevision,
11187 15 => Self::GoogleManagedService,
11188 16 => Self::RedisInstance,
11189 17 => Self::RedisCluster,
11190 19 => Self::GkePod,
11191 _ => Self::UnknownValue(target::UnknownValue(
11192 wkt::internal::UnknownEnumValue::Integer(value),
11193 )),
11194 }
11195 }
11196 }
11197
11198 impl std::convert::From<&str> for Target {
11199 fn from(value: &str) -> Self {
11200 use std::string::ToString;
11201 match value {
11202 "TARGET_UNSPECIFIED" => Self::Unspecified,
11203 "INSTANCE" => Self::Instance,
11204 "INTERNET" => Self::Internet,
11205 "GOOGLE_API" => Self::GoogleApi,
11206 "GKE_MASTER" => Self::GkeMaster,
11207 "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
11208 "PSC_PUBLISHED_SERVICE" => Self::PscPublishedService,
11209 "PSC_GOOGLE_API" => Self::PscGoogleApi,
11210 "PSC_VPC_SC" => Self::PscVpcSc,
11211 "SERVERLESS_NEG" => Self::ServerlessNeg,
11212 "STORAGE_BUCKET" => Self::StorageBucket,
11213 "PRIVATE_NETWORK" => Self::PrivateNetwork,
11214 "CLOUD_FUNCTION" => Self::CloudFunction,
11215 "APP_ENGINE_VERSION" => Self::AppEngineVersion,
11216 "CLOUD_RUN_REVISION" => Self::CloudRunRevision,
11217 "GOOGLE_MANAGED_SERVICE" => Self::GoogleManagedService,
11218 "REDIS_INSTANCE" => Self::RedisInstance,
11219 "REDIS_CLUSTER" => Self::RedisCluster,
11220 "GKE_POD" => Self::GkePod,
11221 _ => Self::UnknownValue(target::UnknownValue(
11222 wkt::internal::UnknownEnumValue::String(value.to_string()),
11223 )),
11224 }
11225 }
11226 }
11227
11228 impl serde::ser::Serialize for Target {
11229 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11230 where
11231 S: serde::Serializer,
11232 {
11233 match self {
11234 Self::Unspecified => serializer.serialize_i32(0),
11235 Self::Instance => serializer.serialize_i32(1),
11236 Self::Internet => serializer.serialize_i32(2),
11237 Self::GoogleApi => serializer.serialize_i32(3),
11238 Self::GkeMaster => serializer.serialize_i32(4),
11239 Self::CloudSqlInstance => serializer.serialize_i32(5),
11240 Self::PscPublishedService => serializer.serialize_i32(6),
11241 Self::PscGoogleApi => serializer.serialize_i32(7),
11242 Self::PscVpcSc => serializer.serialize_i32(8),
11243 Self::ServerlessNeg => serializer.serialize_i32(9),
11244 Self::StorageBucket => serializer.serialize_i32(10),
11245 Self::PrivateNetwork => serializer.serialize_i32(11),
11246 Self::CloudFunction => serializer.serialize_i32(12),
11247 Self::AppEngineVersion => serializer.serialize_i32(13),
11248 Self::CloudRunRevision => serializer.serialize_i32(14),
11249 Self::GoogleManagedService => serializer.serialize_i32(15),
11250 Self::RedisInstance => serializer.serialize_i32(16),
11251 Self::RedisCluster => serializer.serialize_i32(17),
11252 Self::GkePod => serializer.serialize_i32(19),
11253 Self::UnknownValue(u) => u.0.serialize(serializer),
11254 }
11255 }
11256 }
11257
11258 impl<'de> serde::de::Deserialize<'de> for Target {
11259 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11260 where
11261 D: serde::Deserializer<'de>,
11262 {
11263 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Target>::new(
11264 ".google.cloud.networkmanagement.v1.DeliverInfo.Target",
11265 ))
11266 }
11267 }
11268
11269 /// Recognized type of a Google Service.
11270 ///
11271 /// # Working with unknown values
11272 ///
11273 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11274 /// additional enum variants at any time. Adding new variants is not considered
11275 /// a breaking change. Applications should write their code in anticipation of:
11276 ///
11277 /// - New values appearing in future releases of the client library, **and**
11278 /// - New values received dynamically, without application changes.
11279 ///
11280 /// Please consult the [Working with enums] section in the user guide for some
11281 /// guidelines.
11282 ///
11283 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11284 #[derive(Clone, Debug, PartialEq)]
11285 #[non_exhaustive]
11286 pub enum GoogleServiceType {
11287 /// Unspecified Google Service.
11288 Unspecified,
11289 /// Identity aware proxy.
11290 /// <https://cloud.google.com/iap/docs/using-tcp-forwarding>
11291 Iap,
11292 /// One of two services sharing IP ranges:
11293 ///
11294 /// * Load Balancer proxy
11295 /// * Centralized Health Check prober
11296 /// <https://cloud.google.com/load-balancing/docs/firewall-rules>
11297 GfeProxyOrHealthCheckProber,
11298 /// Connectivity from Cloud DNS to forwarding targets or alternate name
11299 /// servers that use private routing.
11300 /// <https://cloud.google.com/dns/docs/zones/forwarding-zones#firewall-rules>
11301 /// <https://cloud.google.com/dns/docs/policies#firewall-rules>
11302 CloudDns,
11303 /// private.googleapis.com and restricted.googleapis.com
11304 PrivateGoogleAccess,
11305 /// Google API via Private Service Connect.
11306 /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
11307 /// Google API via Serverless VPC Access.
11308 /// <https://cloud.google.com/vpc/docs/serverless-vpc-access>
11309 ServerlessVpcAccess,
11310 /// If set, the enum was initialized with an unknown value.
11311 ///
11312 /// Applications can examine the value using [GoogleServiceType::value] or
11313 /// [GoogleServiceType::name].
11314 UnknownValue(google_service_type::UnknownValue),
11315 }
11316
11317 #[doc(hidden)]
11318 pub mod google_service_type {
11319 #[allow(unused_imports)]
11320 use super::*;
11321 #[derive(Clone, Debug, PartialEq)]
11322 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11323 }
11324
11325 impl GoogleServiceType {
11326 /// Gets the enum value.
11327 ///
11328 /// Returns `None` if the enum contains an unknown value deserialized from
11329 /// the string representation of enums.
11330 pub fn value(&self) -> std::option::Option<i32> {
11331 match self {
11332 Self::Unspecified => std::option::Option::Some(0),
11333 Self::Iap => std::option::Option::Some(1),
11334 Self::GfeProxyOrHealthCheckProber => std::option::Option::Some(2),
11335 Self::CloudDns => std::option::Option::Some(3),
11336 Self::PrivateGoogleAccess => std::option::Option::Some(4),
11337 Self::ServerlessVpcAccess => std::option::Option::Some(5),
11338 Self::UnknownValue(u) => u.0.value(),
11339 }
11340 }
11341
11342 /// Gets the enum value as a string.
11343 ///
11344 /// Returns `None` if the enum contains an unknown value deserialized from
11345 /// the integer representation of enums.
11346 pub fn name(&self) -> std::option::Option<&str> {
11347 match self {
11348 Self::Unspecified => std::option::Option::Some("GOOGLE_SERVICE_TYPE_UNSPECIFIED"),
11349 Self::Iap => std::option::Option::Some("IAP"),
11350 Self::GfeProxyOrHealthCheckProber => {
11351 std::option::Option::Some("GFE_PROXY_OR_HEALTH_CHECK_PROBER")
11352 }
11353 Self::CloudDns => std::option::Option::Some("CLOUD_DNS"),
11354 Self::PrivateGoogleAccess => std::option::Option::Some("PRIVATE_GOOGLE_ACCESS"),
11355 Self::ServerlessVpcAccess => std::option::Option::Some("SERVERLESS_VPC_ACCESS"),
11356 Self::UnknownValue(u) => u.0.name(),
11357 }
11358 }
11359 }
11360
11361 impl std::default::Default for GoogleServiceType {
11362 fn default() -> Self {
11363 use std::convert::From;
11364 Self::from(0)
11365 }
11366 }
11367
11368 impl std::fmt::Display for GoogleServiceType {
11369 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11370 wkt::internal::display_enum(f, self.name(), self.value())
11371 }
11372 }
11373
11374 impl std::convert::From<i32> for GoogleServiceType {
11375 fn from(value: i32) -> Self {
11376 match value {
11377 0 => Self::Unspecified,
11378 1 => Self::Iap,
11379 2 => Self::GfeProxyOrHealthCheckProber,
11380 3 => Self::CloudDns,
11381 4 => Self::PrivateGoogleAccess,
11382 5 => Self::ServerlessVpcAccess,
11383 _ => Self::UnknownValue(google_service_type::UnknownValue(
11384 wkt::internal::UnknownEnumValue::Integer(value),
11385 )),
11386 }
11387 }
11388 }
11389
11390 impl std::convert::From<&str> for GoogleServiceType {
11391 fn from(value: &str) -> Self {
11392 use std::string::ToString;
11393 match value {
11394 "GOOGLE_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
11395 "IAP" => Self::Iap,
11396 "GFE_PROXY_OR_HEALTH_CHECK_PROBER" => Self::GfeProxyOrHealthCheckProber,
11397 "CLOUD_DNS" => Self::CloudDns,
11398 "PRIVATE_GOOGLE_ACCESS" => Self::PrivateGoogleAccess,
11399 "SERVERLESS_VPC_ACCESS" => Self::ServerlessVpcAccess,
11400 _ => Self::UnknownValue(google_service_type::UnknownValue(
11401 wkt::internal::UnknownEnumValue::String(value.to_string()),
11402 )),
11403 }
11404 }
11405 }
11406
11407 impl serde::ser::Serialize for GoogleServiceType {
11408 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11409 where
11410 S: serde::Serializer,
11411 {
11412 match self {
11413 Self::Unspecified => serializer.serialize_i32(0),
11414 Self::Iap => serializer.serialize_i32(1),
11415 Self::GfeProxyOrHealthCheckProber => serializer.serialize_i32(2),
11416 Self::CloudDns => serializer.serialize_i32(3),
11417 Self::PrivateGoogleAccess => serializer.serialize_i32(4),
11418 Self::ServerlessVpcAccess => serializer.serialize_i32(5),
11419 Self::UnknownValue(u) => u.0.serialize(serializer),
11420 }
11421 }
11422 }
11423
11424 impl<'de> serde::de::Deserialize<'de> for GoogleServiceType {
11425 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11426 where
11427 D: serde::Deserializer<'de>,
11428 {
11429 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GoogleServiceType>::new(
11430 ".google.cloud.networkmanagement.v1.DeliverInfo.GoogleServiceType",
11431 ))
11432 }
11433 }
11434}
11435
11436/// Details of the final state "forward" and associated resource.
11437#[derive(Clone, Default, PartialEq)]
11438#[non_exhaustive]
11439pub struct ForwardInfo {
11440 /// Target type where this packet is forwarded to.
11441 pub target: crate::model::forward_info::Target,
11442
11443 /// URI of the resource that the packet is forwarded to.
11444 pub resource_uri: std::string::String,
11445
11446 /// IP address of the target (if applicable).
11447 pub ip_address: std::string::String,
11448
11449 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11450}
11451
11452impl ForwardInfo {
11453 /// Creates a new default instance.
11454 pub fn new() -> Self {
11455 std::default::Default::default()
11456 }
11457
11458 /// Sets the value of [target][crate::model::ForwardInfo::target].
11459 ///
11460 /// # Example
11461 /// ```ignore,no_run
11462 /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
11463 /// use google_cloud_networkmanagement_v1::model::forward_info::Target;
11464 /// let x0 = ForwardInfo::new().set_target(Target::PeeringVpc);
11465 /// let x1 = ForwardInfo::new().set_target(Target::VpnGateway);
11466 /// let x2 = ForwardInfo::new().set_target(Target::Interconnect);
11467 /// ```
11468 pub fn set_target<T: std::convert::Into<crate::model::forward_info::Target>>(
11469 mut self,
11470 v: T,
11471 ) -> Self {
11472 self.target = v.into();
11473 self
11474 }
11475
11476 /// Sets the value of [resource_uri][crate::model::ForwardInfo::resource_uri].
11477 ///
11478 /// # Example
11479 /// ```ignore,no_run
11480 /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
11481 /// let x = ForwardInfo::new().set_resource_uri("example");
11482 /// ```
11483 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11484 self.resource_uri = v.into();
11485 self
11486 }
11487
11488 /// Sets the value of [ip_address][crate::model::ForwardInfo::ip_address].
11489 ///
11490 /// # Example
11491 /// ```ignore,no_run
11492 /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
11493 /// let x = ForwardInfo::new().set_ip_address("example");
11494 /// ```
11495 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11496 self.ip_address = v.into();
11497 self
11498 }
11499}
11500
11501impl wkt::message::Message for ForwardInfo {
11502 fn typename() -> &'static str {
11503 "type.googleapis.com/google.cloud.networkmanagement.v1.ForwardInfo"
11504 }
11505}
11506
11507/// Defines additional types related to [ForwardInfo].
11508pub mod forward_info {
11509 #[allow(unused_imports)]
11510 use super::*;
11511
11512 /// Forward target types.
11513 ///
11514 /// # Working with unknown values
11515 ///
11516 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11517 /// additional enum variants at any time. Adding new variants is not considered
11518 /// a breaking change. Applications should write their code in anticipation of:
11519 ///
11520 /// - New values appearing in future releases of the client library, **and**
11521 /// - New values received dynamically, without application changes.
11522 ///
11523 /// Please consult the [Working with enums] section in the user guide for some
11524 /// guidelines.
11525 ///
11526 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11527 #[derive(Clone, Debug, PartialEq)]
11528 #[non_exhaustive]
11529 pub enum Target {
11530 /// Target not specified.
11531 Unspecified,
11532 /// Forwarded to a VPC peering network.
11533 PeeringVpc,
11534 /// Forwarded to a Cloud VPN gateway.
11535 VpnGateway,
11536 /// Forwarded to a Cloud Interconnect connection.
11537 Interconnect,
11538 /// Forwarded to a Google Kubernetes Engine Container cluster master.
11539 #[deprecated]
11540 GkeMaster,
11541 /// Forwarded to the next hop of a custom route imported from a peering VPC.
11542 ImportedCustomRouteNextHop,
11543 /// Forwarded to a Cloud SQL instance.
11544 #[deprecated]
11545 CloudSqlInstance,
11546 /// Forwarded to a VPC network in another project.
11547 AnotherProject,
11548 /// Forwarded to an NCC Hub.
11549 NccHub,
11550 /// Forwarded to a router appliance.
11551 RouterAppliance,
11552 /// Forwarded to a Secure Web Proxy Gateway.
11553 SecureWebProxyGateway,
11554 /// If set, the enum was initialized with an unknown value.
11555 ///
11556 /// Applications can examine the value using [Target::value] or
11557 /// [Target::name].
11558 UnknownValue(target::UnknownValue),
11559 }
11560
11561 #[doc(hidden)]
11562 pub mod target {
11563 #[allow(unused_imports)]
11564 use super::*;
11565 #[derive(Clone, Debug, PartialEq)]
11566 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11567 }
11568
11569 impl Target {
11570 /// Gets the enum value.
11571 ///
11572 /// Returns `None` if the enum contains an unknown value deserialized from
11573 /// the string representation of enums.
11574 pub fn value(&self) -> std::option::Option<i32> {
11575 match self {
11576 Self::Unspecified => std::option::Option::Some(0),
11577 Self::PeeringVpc => std::option::Option::Some(1),
11578 Self::VpnGateway => std::option::Option::Some(2),
11579 Self::Interconnect => std::option::Option::Some(3),
11580 Self::GkeMaster => std::option::Option::Some(4),
11581 Self::ImportedCustomRouteNextHop => std::option::Option::Some(5),
11582 Self::CloudSqlInstance => std::option::Option::Some(6),
11583 Self::AnotherProject => std::option::Option::Some(7),
11584 Self::NccHub => std::option::Option::Some(8),
11585 Self::RouterAppliance => std::option::Option::Some(9),
11586 Self::SecureWebProxyGateway => std::option::Option::Some(10),
11587 Self::UnknownValue(u) => u.0.value(),
11588 }
11589 }
11590
11591 /// Gets the enum value as a string.
11592 ///
11593 /// Returns `None` if the enum contains an unknown value deserialized from
11594 /// the integer representation of enums.
11595 pub fn name(&self) -> std::option::Option<&str> {
11596 match self {
11597 Self::Unspecified => std::option::Option::Some("TARGET_UNSPECIFIED"),
11598 Self::PeeringVpc => std::option::Option::Some("PEERING_VPC"),
11599 Self::VpnGateway => std::option::Option::Some("VPN_GATEWAY"),
11600 Self::Interconnect => std::option::Option::Some("INTERCONNECT"),
11601 Self::GkeMaster => std::option::Option::Some("GKE_MASTER"),
11602 Self::ImportedCustomRouteNextHop => {
11603 std::option::Option::Some("IMPORTED_CUSTOM_ROUTE_NEXT_HOP")
11604 }
11605 Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
11606 Self::AnotherProject => std::option::Option::Some("ANOTHER_PROJECT"),
11607 Self::NccHub => std::option::Option::Some("NCC_HUB"),
11608 Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
11609 Self::SecureWebProxyGateway => {
11610 std::option::Option::Some("SECURE_WEB_PROXY_GATEWAY")
11611 }
11612 Self::UnknownValue(u) => u.0.name(),
11613 }
11614 }
11615 }
11616
11617 impl std::default::Default for Target {
11618 fn default() -> Self {
11619 use std::convert::From;
11620 Self::from(0)
11621 }
11622 }
11623
11624 impl std::fmt::Display for Target {
11625 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11626 wkt::internal::display_enum(f, self.name(), self.value())
11627 }
11628 }
11629
11630 impl std::convert::From<i32> for Target {
11631 fn from(value: i32) -> Self {
11632 match value {
11633 0 => Self::Unspecified,
11634 1 => Self::PeeringVpc,
11635 2 => Self::VpnGateway,
11636 3 => Self::Interconnect,
11637 4 => Self::GkeMaster,
11638 5 => Self::ImportedCustomRouteNextHop,
11639 6 => Self::CloudSqlInstance,
11640 7 => Self::AnotherProject,
11641 8 => Self::NccHub,
11642 9 => Self::RouterAppliance,
11643 10 => Self::SecureWebProxyGateway,
11644 _ => Self::UnknownValue(target::UnknownValue(
11645 wkt::internal::UnknownEnumValue::Integer(value),
11646 )),
11647 }
11648 }
11649 }
11650
11651 impl std::convert::From<&str> for Target {
11652 fn from(value: &str) -> Self {
11653 use std::string::ToString;
11654 match value {
11655 "TARGET_UNSPECIFIED" => Self::Unspecified,
11656 "PEERING_VPC" => Self::PeeringVpc,
11657 "VPN_GATEWAY" => Self::VpnGateway,
11658 "INTERCONNECT" => Self::Interconnect,
11659 "GKE_MASTER" => Self::GkeMaster,
11660 "IMPORTED_CUSTOM_ROUTE_NEXT_HOP" => Self::ImportedCustomRouteNextHop,
11661 "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
11662 "ANOTHER_PROJECT" => Self::AnotherProject,
11663 "NCC_HUB" => Self::NccHub,
11664 "ROUTER_APPLIANCE" => Self::RouterAppliance,
11665 "SECURE_WEB_PROXY_GATEWAY" => Self::SecureWebProxyGateway,
11666 _ => Self::UnknownValue(target::UnknownValue(
11667 wkt::internal::UnknownEnumValue::String(value.to_string()),
11668 )),
11669 }
11670 }
11671 }
11672
11673 impl serde::ser::Serialize for Target {
11674 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11675 where
11676 S: serde::Serializer,
11677 {
11678 match self {
11679 Self::Unspecified => serializer.serialize_i32(0),
11680 Self::PeeringVpc => serializer.serialize_i32(1),
11681 Self::VpnGateway => serializer.serialize_i32(2),
11682 Self::Interconnect => serializer.serialize_i32(3),
11683 Self::GkeMaster => serializer.serialize_i32(4),
11684 Self::ImportedCustomRouteNextHop => serializer.serialize_i32(5),
11685 Self::CloudSqlInstance => serializer.serialize_i32(6),
11686 Self::AnotherProject => serializer.serialize_i32(7),
11687 Self::NccHub => serializer.serialize_i32(8),
11688 Self::RouterAppliance => serializer.serialize_i32(9),
11689 Self::SecureWebProxyGateway => serializer.serialize_i32(10),
11690 Self::UnknownValue(u) => u.0.serialize(serializer),
11691 }
11692 }
11693 }
11694
11695 impl<'de> serde::de::Deserialize<'de> for Target {
11696 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11697 where
11698 D: serde::Deserializer<'de>,
11699 {
11700 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Target>::new(
11701 ".google.cloud.networkmanagement.v1.ForwardInfo.Target",
11702 ))
11703 }
11704 }
11705}
11706
11707/// Details of the final state "abort" and associated resource.
11708#[derive(Clone, Default, PartialEq)]
11709#[non_exhaustive]
11710pub struct AbortInfo {
11711 /// Causes that the analysis is aborted.
11712 pub cause: crate::model::abort_info::Cause,
11713
11714 /// URI of the resource that caused the abort.
11715 pub resource_uri: std::string::String,
11716
11717 /// IP address that caused the abort.
11718 pub ip_address: std::string::String,
11719
11720 /// List of project IDs the user specified in the request but lacks access to.
11721 /// In this case, analysis is aborted with the PERMISSION_DENIED cause.
11722 pub projects_missing_permission: std::vec::Vec<std::string::String>,
11723
11724 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11725}
11726
11727impl AbortInfo {
11728 /// Creates a new default instance.
11729 pub fn new() -> Self {
11730 std::default::Default::default()
11731 }
11732
11733 /// Sets the value of [cause][crate::model::AbortInfo::cause].
11734 ///
11735 /// # Example
11736 /// ```ignore,no_run
11737 /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11738 /// use google_cloud_networkmanagement_v1::model::abort_info::Cause;
11739 /// let x0 = AbortInfo::new().set_cause(Cause::UnknownIp);
11740 /// let x1 = AbortInfo::new().set_cause(Cause::GoogleManagedServiceUnknownIp);
11741 /// let x2 = AbortInfo::new().set_cause(Cause::SourceIpAddressNotInSourceNetwork);
11742 /// ```
11743 pub fn set_cause<T: std::convert::Into<crate::model::abort_info::Cause>>(
11744 mut self,
11745 v: T,
11746 ) -> Self {
11747 self.cause = v.into();
11748 self
11749 }
11750
11751 /// Sets the value of [resource_uri][crate::model::AbortInfo::resource_uri].
11752 ///
11753 /// # Example
11754 /// ```ignore,no_run
11755 /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11756 /// let x = AbortInfo::new().set_resource_uri("example");
11757 /// ```
11758 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11759 self.resource_uri = v.into();
11760 self
11761 }
11762
11763 /// Sets the value of [ip_address][crate::model::AbortInfo::ip_address].
11764 ///
11765 /// # Example
11766 /// ```ignore,no_run
11767 /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11768 /// let x = AbortInfo::new().set_ip_address("example");
11769 /// ```
11770 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11771 self.ip_address = v.into();
11772 self
11773 }
11774
11775 /// Sets the value of [projects_missing_permission][crate::model::AbortInfo::projects_missing_permission].
11776 ///
11777 /// # Example
11778 /// ```ignore,no_run
11779 /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11780 /// let x = AbortInfo::new().set_projects_missing_permission(["a", "b", "c"]);
11781 /// ```
11782 pub fn set_projects_missing_permission<T, V>(mut self, v: T) -> Self
11783 where
11784 T: std::iter::IntoIterator<Item = V>,
11785 V: std::convert::Into<std::string::String>,
11786 {
11787 use std::iter::Iterator;
11788 self.projects_missing_permission = v.into_iter().map(|i| i.into()).collect();
11789 self
11790 }
11791}
11792
11793impl wkt::message::Message for AbortInfo {
11794 fn typename() -> &'static str {
11795 "type.googleapis.com/google.cloud.networkmanagement.v1.AbortInfo"
11796 }
11797}
11798
11799/// Defines additional types related to [AbortInfo].
11800pub mod abort_info {
11801 #[allow(unused_imports)]
11802 use super::*;
11803
11804 /// Abort cause types:
11805 ///
11806 /// # Working with unknown values
11807 ///
11808 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11809 /// additional enum variants at any time. Adding new variants is not considered
11810 /// a breaking change. Applications should write their code in anticipation of:
11811 ///
11812 /// - New values appearing in future releases of the client library, **and**
11813 /// - New values received dynamically, without application changes.
11814 ///
11815 /// Please consult the [Working with enums] section in the user guide for some
11816 /// guidelines.
11817 ///
11818 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11819 #[derive(Clone, Debug, PartialEq)]
11820 #[non_exhaustive]
11821 pub enum Cause {
11822 /// Cause is unspecified.
11823 Unspecified,
11824 /// Aborted due to unknown network. Deprecated, not used in the new tests.
11825 #[deprecated]
11826 UnknownNetwork,
11827 /// Aborted because no project information can be derived from the test
11828 /// input. Deprecated, not used in the new tests.
11829 #[deprecated]
11830 UnknownProject,
11831 /// Aborted because traffic is sent from a public IP to an instance without
11832 /// an external IP. Deprecated, not used in the new tests.
11833 #[deprecated]
11834 NoExternalIp,
11835 /// Aborted because none of the traces matches destination information
11836 /// specified in the input test request. Deprecated, not used in the new
11837 /// tests.
11838 #[deprecated]
11839 UnintendedDestination,
11840 /// Aborted because the source endpoint could not be found. Deprecated, not
11841 /// used in the new tests.
11842 #[deprecated]
11843 SourceEndpointNotFound,
11844 /// Aborted because the source network does not match the source endpoint.
11845 /// Deprecated, not used in the new tests.
11846 #[deprecated]
11847 MismatchedSourceNetwork,
11848 /// Aborted because the destination endpoint could not be found. Deprecated,
11849 /// not used in the new tests.
11850 #[deprecated]
11851 DestinationEndpointNotFound,
11852 /// Aborted because the destination network does not match the destination
11853 /// endpoint. Deprecated, not used in the new tests.
11854 #[deprecated]
11855 MismatchedDestinationNetwork,
11856 /// Aborted because no endpoint with the packet's destination IP address is
11857 /// found.
11858 UnknownIp,
11859 /// Aborted because no endpoint with the packet's destination IP is found in
11860 /// the Google-managed project.
11861 GoogleManagedServiceUnknownIp,
11862 /// Aborted because the source IP address doesn't belong to any of the
11863 /// subnets of the source VPC network.
11864 SourceIpAddressNotInSourceNetwork,
11865 /// Aborted because user lacks permission to access all or part of the
11866 /// network configurations required to run the test.
11867 PermissionDenied,
11868 /// Aborted because user lacks permission to access Cloud NAT configs
11869 /// required to run the test.
11870 PermissionDeniedNoCloudNatConfigs,
11871 /// Aborted because user lacks permission to access Network endpoint group
11872 /// endpoint configs required to run the test.
11873 PermissionDeniedNoNegEndpointConfigs,
11874 /// Aborted because user lacks permission to access Cloud Router configs
11875 /// required to run the test.
11876 PermissionDeniedNoCloudRouterConfigs,
11877 /// Aborted because no valid source or destination endpoint can be derived
11878 /// from the test request.
11879 NoSourceLocation,
11880 /// Aborted because the source IP address is not contained within the subnet
11881 /// ranges of the provided VPC network.
11882 NoSourceGcpNetworkLocation,
11883 /// Aborted because the source IP address is not contained within the
11884 /// destination ranges of the routes towards non-GCP networks in the provided
11885 /// VPC network.
11886 NoSourceNonGcpNetworkLocation,
11887 /// Aborted because the source IP address can't be resolved as an Internet
11888 /// IP address.
11889 NoSourceInternetLocation,
11890 /// Aborted because the source or destination endpoint specified in
11891 /// the request is invalid. Some examples:
11892 ///
11893 /// - The request might contain malformed resource URI, project ID, or IP
11894 /// address.
11895 /// - The request might contain inconsistent information (for example, the
11896 /// request might include both the instance and the network, but the instance
11897 /// might not have a NIC in that network).
11898 InvalidArgument,
11899 /// Aborted because the number of steps in the trace exceeds a certain
11900 /// limit. It might be caused by a routing loop.
11901 TraceTooLong,
11902 /// Aborted due to internal server error.
11903 InternalError,
11904 /// Aborted because the test scenario is not supported.
11905 Unsupported,
11906 /// Aborted because the source and destination resources have no common IP
11907 /// version.
11908 MismatchedIpVersion,
11909 /// Aborted because the connection between the control plane and the node of
11910 /// the source cluster is initiated by the node and managed by the
11911 /// Konnectivity proxy.
11912 GkeKonnectivityProxyUnsupported,
11913 /// Aborted because expected resource configuration was missing.
11914 ResourceConfigNotFound,
11915 /// Aborted because expected VM instance configuration was missing.
11916 VmInstanceConfigNotFound,
11917 /// Aborted because expected network configuration was missing.
11918 NetworkConfigNotFound,
11919 /// Aborted because expected firewall configuration was missing.
11920 FirewallConfigNotFound,
11921 /// Aborted because expected route configuration was missing.
11922 RouteConfigNotFound,
11923 /// Aborted because PSC endpoint selection for the Google-managed service
11924 /// is ambiguous (several PSC endpoints satisfy test input).
11925 GoogleManagedServiceAmbiguousPscEndpoint,
11926 /// Aborted because endpoint selection for the Google-managed service is
11927 /// ambiguous (several endpoints satisfy test input).
11928 GoogleManagedServiceAmbiguousEndpoint,
11929 /// Aborted because tests with a PSC-based Cloud SQL instance as a source are
11930 /// not supported.
11931 SourcePscCloudSqlUnsupported,
11932 /// Aborted because tests with the external database as a source are not
11933 /// supported. In such replication scenarios, the connection is initiated by
11934 /// the Cloud SQL replica instance.
11935 SourceExternalCloudSqlUnsupported,
11936 /// Aborted because tests with a Redis Cluster as a source are not supported.
11937 SourceRedisClusterUnsupported,
11938 /// Aborted because tests with a Redis Instance as a source are not
11939 /// supported.
11940 SourceRedisInstanceUnsupported,
11941 /// Aborted because tests with a forwarding rule as a source are not
11942 /// supported.
11943 SourceForwardingRuleUnsupported,
11944 /// Aborted because one of the endpoints is a non-routable IP address
11945 /// (loopback, link-local, etc).
11946 NonRoutableIpAddress,
11947 /// Aborted due to an unknown issue in the Google-managed project.
11948 UnknownIssueInGoogleManagedProject,
11949 /// Aborted due to an unsupported configuration of the Google-managed
11950 /// project.
11951 UnsupportedGoogleManagedProjectConfig,
11952 /// Aborted because the source endpoint is a Cloud Run revision with direct
11953 /// VPC access enabled, but there are no reserved serverless IP ranges.
11954 NoServerlessIpRanges,
11955 /// Aborted because the used protocol is not supported for the used IP
11956 /// version.
11957 IpVersionProtocolMismatch,
11958 /// Aborted because selected GKE Pod endpoint location is unknown. This is
11959 /// often the case for "Pending" Pods, which don't have assigned IP addresses
11960 /// yet.
11961 GkePodUnknownEndpointLocation,
11962 /// If set, the enum was initialized with an unknown value.
11963 ///
11964 /// Applications can examine the value using [Cause::value] or
11965 /// [Cause::name].
11966 UnknownValue(cause::UnknownValue),
11967 }
11968
11969 #[doc(hidden)]
11970 pub mod cause {
11971 #[allow(unused_imports)]
11972 use super::*;
11973 #[derive(Clone, Debug, PartialEq)]
11974 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11975 }
11976
11977 impl Cause {
11978 /// Gets the enum value.
11979 ///
11980 /// Returns `None` if the enum contains an unknown value deserialized from
11981 /// the string representation of enums.
11982 pub fn value(&self) -> std::option::Option<i32> {
11983 match self {
11984 Self::Unspecified => std::option::Option::Some(0),
11985 Self::UnknownNetwork => std::option::Option::Some(1),
11986 Self::UnknownProject => std::option::Option::Some(3),
11987 Self::NoExternalIp => std::option::Option::Some(7),
11988 Self::UnintendedDestination => std::option::Option::Some(8),
11989 Self::SourceEndpointNotFound => std::option::Option::Some(11),
11990 Self::MismatchedSourceNetwork => std::option::Option::Some(12),
11991 Self::DestinationEndpointNotFound => std::option::Option::Some(13),
11992 Self::MismatchedDestinationNetwork => std::option::Option::Some(14),
11993 Self::UnknownIp => std::option::Option::Some(2),
11994 Self::GoogleManagedServiceUnknownIp => std::option::Option::Some(32),
11995 Self::SourceIpAddressNotInSourceNetwork => std::option::Option::Some(23),
11996 Self::PermissionDenied => std::option::Option::Some(4),
11997 Self::PermissionDeniedNoCloudNatConfigs => std::option::Option::Some(28),
11998 Self::PermissionDeniedNoNegEndpointConfigs => std::option::Option::Some(29),
11999 Self::PermissionDeniedNoCloudRouterConfigs => std::option::Option::Some(36),
12000 Self::NoSourceLocation => std::option::Option::Some(5),
12001 Self::NoSourceGcpNetworkLocation => std::option::Option::Some(42),
12002 Self::NoSourceNonGcpNetworkLocation => std::option::Option::Some(43),
12003 Self::NoSourceInternetLocation => std::option::Option::Some(44),
12004 Self::InvalidArgument => std::option::Option::Some(6),
12005 Self::TraceTooLong => std::option::Option::Some(9),
12006 Self::InternalError => std::option::Option::Some(10),
12007 Self::Unsupported => std::option::Option::Some(15),
12008 Self::MismatchedIpVersion => std::option::Option::Some(16),
12009 Self::GkeKonnectivityProxyUnsupported => std::option::Option::Some(17),
12010 Self::ResourceConfigNotFound => std::option::Option::Some(18),
12011 Self::VmInstanceConfigNotFound => std::option::Option::Some(24),
12012 Self::NetworkConfigNotFound => std::option::Option::Some(25),
12013 Self::FirewallConfigNotFound => std::option::Option::Some(26),
12014 Self::RouteConfigNotFound => std::option::Option::Some(27),
12015 Self::GoogleManagedServiceAmbiguousPscEndpoint => std::option::Option::Some(19),
12016 Self::GoogleManagedServiceAmbiguousEndpoint => std::option::Option::Some(39),
12017 Self::SourcePscCloudSqlUnsupported => std::option::Option::Some(20),
12018 Self::SourceExternalCloudSqlUnsupported => std::option::Option::Some(45),
12019 Self::SourceRedisClusterUnsupported => std::option::Option::Some(34),
12020 Self::SourceRedisInstanceUnsupported => std::option::Option::Some(35),
12021 Self::SourceForwardingRuleUnsupported => std::option::Option::Some(21),
12022 Self::NonRoutableIpAddress => std::option::Option::Some(22),
12023 Self::UnknownIssueInGoogleManagedProject => std::option::Option::Some(30),
12024 Self::UnsupportedGoogleManagedProjectConfig => std::option::Option::Some(31),
12025 Self::NoServerlessIpRanges => std::option::Option::Some(37),
12026 Self::IpVersionProtocolMismatch => std::option::Option::Some(40),
12027 Self::GkePodUnknownEndpointLocation => std::option::Option::Some(41),
12028 Self::UnknownValue(u) => u.0.value(),
12029 }
12030 }
12031
12032 /// Gets the enum value as a string.
12033 ///
12034 /// Returns `None` if the enum contains an unknown value deserialized from
12035 /// the integer representation of enums.
12036 pub fn name(&self) -> std::option::Option<&str> {
12037 match self {
12038 Self::Unspecified => std::option::Option::Some("CAUSE_UNSPECIFIED"),
12039 Self::UnknownNetwork => std::option::Option::Some("UNKNOWN_NETWORK"),
12040 Self::UnknownProject => std::option::Option::Some("UNKNOWN_PROJECT"),
12041 Self::NoExternalIp => std::option::Option::Some("NO_EXTERNAL_IP"),
12042 Self::UnintendedDestination => std::option::Option::Some("UNINTENDED_DESTINATION"),
12043 Self::SourceEndpointNotFound => {
12044 std::option::Option::Some("SOURCE_ENDPOINT_NOT_FOUND")
12045 }
12046 Self::MismatchedSourceNetwork => {
12047 std::option::Option::Some("MISMATCHED_SOURCE_NETWORK")
12048 }
12049 Self::DestinationEndpointNotFound => {
12050 std::option::Option::Some("DESTINATION_ENDPOINT_NOT_FOUND")
12051 }
12052 Self::MismatchedDestinationNetwork => {
12053 std::option::Option::Some("MISMATCHED_DESTINATION_NETWORK")
12054 }
12055 Self::UnknownIp => std::option::Option::Some("UNKNOWN_IP"),
12056 Self::GoogleManagedServiceUnknownIp => {
12057 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_UNKNOWN_IP")
12058 }
12059 Self::SourceIpAddressNotInSourceNetwork => {
12060 std::option::Option::Some("SOURCE_IP_ADDRESS_NOT_IN_SOURCE_NETWORK")
12061 }
12062 Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
12063 Self::PermissionDeniedNoCloudNatConfigs => {
12064 std::option::Option::Some("PERMISSION_DENIED_NO_CLOUD_NAT_CONFIGS")
12065 }
12066 Self::PermissionDeniedNoNegEndpointConfigs => {
12067 std::option::Option::Some("PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS")
12068 }
12069 Self::PermissionDeniedNoCloudRouterConfigs => {
12070 std::option::Option::Some("PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS")
12071 }
12072 Self::NoSourceLocation => std::option::Option::Some("NO_SOURCE_LOCATION"),
12073 Self::NoSourceGcpNetworkLocation => {
12074 std::option::Option::Some("NO_SOURCE_GCP_NETWORK_LOCATION")
12075 }
12076 Self::NoSourceNonGcpNetworkLocation => {
12077 std::option::Option::Some("NO_SOURCE_NON_GCP_NETWORK_LOCATION")
12078 }
12079 Self::NoSourceInternetLocation => {
12080 std::option::Option::Some("NO_SOURCE_INTERNET_LOCATION")
12081 }
12082 Self::InvalidArgument => std::option::Option::Some("INVALID_ARGUMENT"),
12083 Self::TraceTooLong => std::option::Option::Some("TRACE_TOO_LONG"),
12084 Self::InternalError => std::option::Option::Some("INTERNAL_ERROR"),
12085 Self::Unsupported => std::option::Option::Some("UNSUPPORTED"),
12086 Self::MismatchedIpVersion => std::option::Option::Some("MISMATCHED_IP_VERSION"),
12087 Self::GkeKonnectivityProxyUnsupported => {
12088 std::option::Option::Some("GKE_KONNECTIVITY_PROXY_UNSUPPORTED")
12089 }
12090 Self::ResourceConfigNotFound => {
12091 std::option::Option::Some("RESOURCE_CONFIG_NOT_FOUND")
12092 }
12093 Self::VmInstanceConfigNotFound => {
12094 std::option::Option::Some("VM_INSTANCE_CONFIG_NOT_FOUND")
12095 }
12096 Self::NetworkConfigNotFound => {
12097 std::option::Option::Some("NETWORK_CONFIG_NOT_FOUND")
12098 }
12099 Self::FirewallConfigNotFound => {
12100 std::option::Option::Some("FIREWALL_CONFIG_NOT_FOUND")
12101 }
12102 Self::RouteConfigNotFound => std::option::Option::Some("ROUTE_CONFIG_NOT_FOUND"),
12103 Self::GoogleManagedServiceAmbiguousPscEndpoint => {
12104 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT")
12105 }
12106 Self::GoogleManagedServiceAmbiguousEndpoint => {
12107 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT")
12108 }
12109 Self::SourcePscCloudSqlUnsupported => {
12110 std::option::Option::Some("SOURCE_PSC_CLOUD_SQL_UNSUPPORTED")
12111 }
12112 Self::SourceExternalCloudSqlUnsupported => {
12113 std::option::Option::Some("SOURCE_EXTERNAL_CLOUD_SQL_UNSUPPORTED")
12114 }
12115 Self::SourceRedisClusterUnsupported => {
12116 std::option::Option::Some("SOURCE_REDIS_CLUSTER_UNSUPPORTED")
12117 }
12118 Self::SourceRedisInstanceUnsupported => {
12119 std::option::Option::Some("SOURCE_REDIS_INSTANCE_UNSUPPORTED")
12120 }
12121 Self::SourceForwardingRuleUnsupported => {
12122 std::option::Option::Some("SOURCE_FORWARDING_RULE_UNSUPPORTED")
12123 }
12124 Self::NonRoutableIpAddress => std::option::Option::Some("NON_ROUTABLE_IP_ADDRESS"),
12125 Self::UnknownIssueInGoogleManagedProject => {
12126 std::option::Option::Some("UNKNOWN_ISSUE_IN_GOOGLE_MANAGED_PROJECT")
12127 }
12128 Self::UnsupportedGoogleManagedProjectConfig => {
12129 std::option::Option::Some("UNSUPPORTED_GOOGLE_MANAGED_PROJECT_CONFIG")
12130 }
12131 Self::NoServerlessIpRanges => std::option::Option::Some("NO_SERVERLESS_IP_RANGES"),
12132 Self::IpVersionProtocolMismatch => {
12133 std::option::Option::Some("IP_VERSION_PROTOCOL_MISMATCH")
12134 }
12135 Self::GkePodUnknownEndpointLocation => {
12136 std::option::Option::Some("GKE_POD_UNKNOWN_ENDPOINT_LOCATION")
12137 }
12138 Self::UnknownValue(u) => u.0.name(),
12139 }
12140 }
12141 }
12142
12143 impl std::default::Default for Cause {
12144 fn default() -> Self {
12145 use std::convert::From;
12146 Self::from(0)
12147 }
12148 }
12149
12150 impl std::fmt::Display for Cause {
12151 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12152 wkt::internal::display_enum(f, self.name(), self.value())
12153 }
12154 }
12155
12156 impl std::convert::From<i32> for Cause {
12157 fn from(value: i32) -> Self {
12158 match value {
12159 0 => Self::Unspecified,
12160 1 => Self::UnknownNetwork,
12161 2 => Self::UnknownIp,
12162 3 => Self::UnknownProject,
12163 4 => Self::PermissionDenied,
12164 5 => Self::NoSourceLocation,
12165 6 => Self::InvalidArgument,
12166 7 => Self::NoExternalIp,
12167 8 => Self::UnintendedDestination,
12168 9 => Self::TraceTooLong,
12169 10 => Self::InternalError,
12170 11 => Self::SourceEndpointNotFound,
12171 12 => Self::MismatchedSourceNetwork,
12172 13 => Self::DestinationEndpointNotFound,
12173 14 => Self::MismatchedDestinationNetwork,
12174 15 => Self::Unsupported,
12175 16 => Self::MismatchedIpVersion,
12176 17 => Self::GkeKonnectivityProxyUnsupported,
12177 18 => Self::ResourceConfigNotFound,
12178 19 => Self::GoogleManagedServiceAmbiguousPscEndpoint,
12179 20 => Self::SourcePscCloudSqlUnsupported,
12180 21 => Self::SourceForwardingRuleUnsupported,
12181 22 => Self::NonRoutableIpAddress,
12182 23 => Self::SourceIpAddressNotInSourceNetwork,
12183 24 => Self::VmInstanceConfigNotFound,
12184 25 => Self::NetworkConfigNotFound,
12185 26 => Self::FirewallConfigNotFound,
12186 27 => Self::RouteConfigNotFound,
12187 28 => Self::PermissionDeniedNoCloudNatConfigs,
12188 29 => Self::PermissionDeniedNoNegEndpointConfigs,
12189 30 => Self::UnknownIssueInGoogleManagedProject,
12190 31 => Self::UnsupportedGoogleManagedProjectConfig,
12191 32 => Self::GoogleManagedServiceUnknownIp,
12192 34 => Self::SourceRedisClusterUnsupported,
12193 35 => Self::SourceRedisInstanceUnsupported,
12194 36 => Self::PermissionDeniedNoCloudRouterConfigs,
12195 37 => Self::NoServerlessIpRanges,
12196 39 => Self::GoogleManagedServiceAmbiguousEndpoint,
12197 40 => Self::IpVersionProtocolMismatch,
12198 41 => Self::GkePodUnknownEndpointLocation,
12199 42 => Self::NoSourceGcpNetworkLocation,
12200 43 => Self::NoSourceNonGcpNetworkLocation,
12201 44 => Self::NoSourceInternetLocation,
12202 45 => Self::SourceExternalCloudSqlUnsupported,
12203 _ => Self::UnknownValue(cause::UnknownValue(
12204 wkt::internal::UnknownEnumValue::Integer(value),
12205 )),
12206 }
12207 }
12208 }
12209
12210 impl std::convert::From<&str> for Cause {
12211 fn from(value: &str) -> Self {
12212 use std::string::ToString;
12213 match value {
12214 "CAUSE_UNSPECIFIED" => Self::Unspecified,
12215 "UNKNOWN_NETWORK" => Self::UnknownNetwork,
12216 "UNKNOWN_PROJECT" => Self::UnknownProject,
12217 "NO_EXTERNAL_IP" => Self::NoExternalIp,
12218 "UNINTENDED_DESTINATION" => Self::UnintendedDestination,
12219 "SOURCE_ENDPOINT_NOT_FOUND" => Self::SourceEndpointNotFound,
12220 "MISMATCHED_SOURCE_NETWORK" => Self::MismatchedSourceNetwork,
12221 "DESTINATION_ENDPOINT_NOT_FOUND" => Self::DestinationEndpointNotFound,
12222 "MISMATCHED_DESTINATION_NETWORK" => Self::MismatchedDestinationNetwork,
12223 "UNKNOWN_IP" => Self::UnknownIp,
12224 "GOOGLE_MANAGED_SERVICE_UNKNOWN_IP" => Self::GoogleManagedServiceUnknownIp,
12225 "SOURCE_IP_ADDRESS_NOT_IN_SOURCE_NETWORK" => {
12226 Self::SourceIpAddressNotInSourceNetwork
12227 }
12228 "PERMISSION_DENIED" => Self::PermissionDenied,
12229 "PERMISSION_DENIED_NO_CLOUD_NAT_CONFIGS" => Self::PermissionDeniedNoCloudNatConfigs,
12230 "PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS" => {
12231 Self::PermissionDeniedNoNegEndpointConfigs
12232 }
12233 "PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS" => {
12234 Self::PermissionDeniedNoCloudRouterConfigs
12235 }
12236 "NO_SOURCE_LOCATION" => Self::NoSourceLocation,
12237 "NO_SOURCE_GCP_NETWORK_LOCATION" => Self::NoSourceGcpNetworkLocation,
12238 "NO_SOURCE_NON_GCP_NETWORK_LOCATION" => Self::NoSourceNonGcpNetworkLocation,
12239 "NO_SOURCE_INTERNET_LOCATION" => Self::NoSourceInternetLocation,
12240 "INVALID_ARGUMENT" => Self::InvalidArgument,
12241 "TRACE_TOO_LONG" => Self::TraceTooLong,
12242 "INTERNAL_ERROR" => Self::InternalError,
12243 "UNSUPPORTED" => Self::Unsupported,
12244 "MISMATCHED_IP_VERSION" => Self::MismatchedIpVersion,
12245 "GKE_KONNECTIVITY_PROXY_UNSUPPORTED" => Self::GkeKonnectivityProxyUnsupported,
12246 "RESOURCE_CONFIG_NOT_FOUND" => Self::ResourceConfigNotFound,
12247 "VM_INSTANCE_CONFIG_NOT_FOUND" => Self::VmInstanceConfigNotFound,
12248 "NETWORK_CONFIG_NOT_FOUND" => Self::NetworkConfigNotFound,
12249 "FIREWALL_CONFIG_NOT_FOUND" => Self::FirewallConfigNotFound,
12250 "ROUTE_CONFIG_NOT_FOUND" => Self::RouteConfigNotFound,
12251 "GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT" => {
12252 Self::GoogleManagedServiceAmbiguousPscEndpoint
12253 }
12254 "GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT" => {
12255 Self::GoogleManagedServiceAmbiguousEndpoint
12256 }
12257 "SOURCE_PSC_CLOUD_SQL_UNSUPPORTED" => Self::SourcePscCloudSqlUnsupported,
12258 "SOURCE_EXTERNAL_CLOUD_SQL_UNSUPPORTED" => Self::SourceExternalCloudSqlUnsupported,
12259 "SOURCE_REDIS_CLUSTER_UNSUPPORTED" => Self::SourceRedisClusterUnsupported,
12260 "SOURCE_REDIS_INSTANCE_UNSUPPORTED" => Self::SourceRedisInstanceUnsupported,
12261 "SOURCE_FORWARDING_RULE_UNSUPPORTED" => Self::SourceForwardingRuleUnsupported,
12262 "NON_ROUTABLE_IP_ADDRESS" => Self::NonRoutableIpAddress,
12263 "UNKNOWN_ISSUE_IN_GOOGLE_MANAGED_PROJECT" => {
12264 Self::UnknownIssueInGoogleManagedProject
12265 }
12266 "UNSUPPORTED_GOOGLE_MANAGED_PROJECT_CONFIG" => {
12267 Self::UnsupportedGoogleManagedProjectConfig
12268 }
12269 "NO_SERVERLESS_IP_RANGES" => Self::NoServerlessIpRanges,
12270 "IP_VERSION_PROTOCOL_MISMATCH" => Self::IpVersionProtocolMismatch,
12271 "GKE_POD_UNKNOWN_ENDPOINT_LOCATION" => Self::GkePodUnknownEndpointLocation,
12272 _ => Self::UnknownValue(cause::UnknownValue(
12273 wkt::internal::UnknownEnumValue::String(value.to_string()),
12274 )),
12275 }
12276 }
12277 }
12278
12279 impl serde::ser::Serialize for Cause {
12280 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12281 where
12282 S: serde::Serializer,
12283 {
12284 match self {
12285 Self::Unspecified => serializer.serialize_i32(0),
12286 Self::UnknownNetwork => serializer.serialize_i32(1),
12287 Self::UnknownProject => serializer.serialize_i32(3),
12288 Self::NoExternalIp => serializer.serialize_i32(7),
12289 Self::UnintendedDestination => serializer.serialize_i32(8),
12290 Self::SourceEndpointNotFound => serializer.serialize_i32(11),
12291 Self::MismatchedSourceNetwork => serializer.serialize_i32(12),
12292 Self::DestinationEndpointNotFound => serializer.serialize_i32(13),
12293 Self::MismatchedDestinationNetwork => serializer.serialize_i32(14),
12294 Self::UnknownIp => serializer.serialize_i32(2),
12295 Self::GoogleManagedServiceUnknownIp => serializer.serialize_i32(32),
12296 Self::SourceIpAddressNotInSourceNetwork => serializer.serialize_i32(23),
12297 Self::PermissionDenied => serializer.serialize_i32(4),
12298 Self::PermissionDeniedNoCloudNatConfigs => serializer.serialize_i32(28),
12299 Self::PermissionDeniedNoNegEndpointConfigs => serializer.serialize_i32(29),
12300 Self::PermissionDeniedNoCloudRouterConfigs => serializer.serialize_i32(36),
12301 Self::NoSourceLocation => serializer.serialize_i32(5),
12302 Self::NoSourceGcpNetworkLocation => serializer.serialize_i32(42),
12303 Self::NoSourceNonGcpNetworkLocation => serializer.serialize_i32(43),
12304 Self::NoSourceInternetLocation => serializer.serialize_i32(44),
12305 Self::InvalidArgument => serializer.serialize_i32(6),
12306 Self::TraceTooLong => serializer.serialize_i32(9),
12307 Self::InternalError => serializer.serialize_i32(10),
12308 Self::Unsupported => serializer.serialize_i32(15),
12309 Self::MismatchedIpVersion => serializer.serialize_i32(16),
12310 Self::GkeKonnectivityProxyUnsupported => serializer.serialize_i32(17),
12311 Self::ResourceConfigNotFound => serializer.serialize_i32(18),
12312 Self::VmInstanceConfigNotFound => serializer.serialize_i32(24),
12313 Self::NetworkConfigNotFound => serializer.serialize_i32(25),
12314 Self::FirewallConfigNotFound => serializer.serialize_i32(26),
12315 Self::RouteConfigNotFound => serializer.serialize_i32(27),
12316 Self::GoogleManagedServiceAmbiguousPscEndpoint => serializer.serialize_i32(19),
12317 Self::GoogleManagedServiceAmbiguousEndpoint => serializer.serialize_i32(39),
12318 Self::SourcePscCloudSqlUnsupported => serializer.serialize_i32(20),
12319 Self::SourceExternalCloudSqlUnsupported => serializer.serialize_i32(45),
12320 Self::SourceRedisClusterUnsupported => serializer.serialize_i32(34),
12321 Self::SourceRedisInstanceUnsupported => serializer.serialize_i32(35),
12322 Self::SourceForwardingRuleUnsupported => serializer.serialize_i32(21),
12323 Self::NonRoutableIpAddress => serializer.serialize_i32(22),
12324 Self::UnknownIssueInGoogleManagedProject => serializer.serialize_i32(30),
12325 Self::UnsupportedGoogleManagedProjectConfig => serializer.serialize_i32(31),
12326 Self::NoServerlessIpRanges => serializer.serialize_i32(37),
12327 Self::IpVersionProtocolMismatch => serializer.serialize_i32(40),
12328 Self::GkePodUnknownEndpointLocation => serializer.serialize_i32(41),
12329 Self::UnknownValue(u) => u.0.serialize(serializer),
12330 }
12331 }
12332 }
12333
12334 impl<'de> serde::de::Deserialize<'de> for Cause {
12335 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12336 where
12337 D: serde::Deserializer<'de>,
12338 {
12339 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Cause>::new(
12340 ".google.cloud.networkmanagement.v1.AbortInfo.Cause",
12341 ))
12342 }
12343 }
12344}
12345
12346/// Details of the final state "drop" and associated resource.
12347#[derive(Clone, Default, PartialEq)]
12348#[non_exhaustive]
12349pub struct DropInfo {
12350 /// Cause that the packet is dropped.
12351 pub cause: crate::model::drop_info::Cause,
12352
12353 /// URI of the resource that caused the drop.
12354 pub resource_uri: std::string::String,
12355
12356 /// Source IP address of the dropped packet (if relevant).
12357 pub source_ip: std::string::String,
12358
12359 /// Destination IP address of the dropped packet (if relevant).
12360 pub destination_ip: std::string::String,
12361
12362 /// Region of the dropped packet (if relevant).
12363 pub region: std::string::String,
12364
12365 /// Geolocation (region code) of the source IP address (if relevant).
12366 pub source_geolocation_code: std::string::String,
12367
12368 /// Geolocation (region code) of the destination IP address (if relevant).
12369 pub destination_geolocation_code: std::string::String,
12370
12371 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12372}
12373
12374impl DropInfo {
12375 /// Creates a new default instance.
12376 pub fn new() -> Self {
12377 std::default::Default::default()
12378 }
12379
12380 /// Sets the value of [cause][crate::model::DropInfo::cause].
12381 ///
12382 /// # Example
12383 /// ```ignore,no_run
12384 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12385 /// use google_cloud_networkmanagement_v1::model::drop_info::Cause;
12386 /// let x0 = DropInfo::new().set_cause(Cause::UnknownExternalAddress);
12387 /// let x1 = DropInfo::new().set_cause(Cause::ForeignIpDisallowed);
12388 /// let x2 = DropInfo::new().set_cause(Cause::FirewallRule);
12389 /// ```
12390 pub fn set_cause<T: std::convert::Into<crate::model::drop_info::Cause>>(
12391 mut self,
12392 v: T,
12393 ) -> Self {
12394 self.cause = v.into();
12395 self
12396 }
12397
12398 /// Sets the value of [resource_uri][crate::model::DropInfo::resource_uri].
12399 ///
12400 /// # Example
12401 /// ```ignore,no_run
12402 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12403 /// let x = DropInfo::new().set_resource_uri("example");
12404 /// ```
12405 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12406 self.resource_uri = v.into();
12407 self
12408 }
12409
12410 /// Sets the value of [source_ip][crate::model::DropInfo::source_ip].
12411 ///
12412 /// # Example
12413 /// ```ignore,no_run
12414 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12415 /// let x = DropInfo::new().set_source_ip("example");
12416 /// ```
12417 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12418 self.source_ip = v.into();
12419 self
12420 }
12421
12422 /// Sets the value of [destination_ip][crate::model::DropInfo::destination_ip].
12423 ///
12424 /// # Example
12425 /// ```ignore,no_run
12426 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12427 /// let x = DropInfo::new().set_destination_ip("example");
12428 /// ```
12429 pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12430 self.destination_ip = v.into();
12431 self
12432 }
12433
12434 /// Sets the value of [region][crate::model::DropInfo::region].
12435 ///
12436 /// # Example
12437 /// ```ignore,no_run
12438 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12439 /// let x = DropInfo::new().set_region("example");
12440 /// ```
12441 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12442 self.region = v.into();
12443 self
12444 }
12445
12446 /// Sets the value of [source_geolocation_code][crate::model::DropInfo::source_geolocation_code].
12447 ///
12448 /// # Example
12449 /// ```ignore,no_run
12450 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12451 /// let x = DropInfo::new().set_source_geolocation_code("example");
12452 /// ```
12453 pub fn set_source_geolocation_code<T: std::convert::Into<std::string::String>>(
12454 mut self,
12455 v: T,
12456 ) -> Self {
12457 self.source_geolocation_code = v.into();
12458 self
12459 }
12460
12461 /// Sets the value of [destination_geolocation_code][crate::model::DropInfo::destination_geolocation_code].
12462 ///
12463 /// # Example
12464 /// ```ignore,no_run
12465 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12466 /// let x = DropInfo::new().set_destination_geolocation_code("example");
12467 /// ```
12468 pub fn set_destination_geolocation_code<T: std::convert::Into<std::string::String>>(
12469 mut self,
12470 v: T,
12471 ) -> Self {
12472 self.destination_geolocation_code = v.into();
12473 self
12474 }
12475}
12476
12477impl wkt::message::Message for DropInfo {
12478 fn typename() -> &'static str {
12479 "type.googleapis.com/google.cloud.networkmanagement.v1.DropInfo"
12480 }
12481}
12482
12483/// Defines additional types related to [DropInfo].
12484pub mod drop_info {
12485 #[allow(unused_imports)]
12486 use super::*;
12487
12488 /// Drop cause types:
12489 ///
12490 /// # Working with unknown values
12491 ///
12492 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12493 /// additional enum variants at any time. Adding new variants is not considered
12494 /// a breaking change. Applications should write their code in anticipation of:
12495 ///
12496 /// - New values appearing in future releases of the client library, **and**
12497 /// - New values received dynamically, without application changes.
12498 ///
12499 /// Please consult the [Working with enums] section in the user guide for some
12500 /// guidelines.
12501 ///
12502 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12503 #[derive(Clone, Debug, PartialEq)]
12504 #[non_exhaustive]
12505 pub enum Cause {
12506 /// Cause is unspecified.
12507 Unspecified,
12508 /// Destination external address cannot be resolved to a known target. If
12509 /// the address is used in a Google Cloud project, provide the project ID
12510 /// as test input.
12511 UnknownExternalAddress,
12512 /// A Compute Engine instance can only send or receive a packet with a
12513 /// foreign IP address if ip_forward is enabled.
12514 ForeignIpDisallowed,
12515 /// Dropped due to a firewall rule, unless allowed due to connection
12516 /// tracking.
12517 FirewallRule,
12518 /// Dropped due to no matching routes.
12519 NoRoute,
12520 /// Dropped due to invalid route. Route's next hop is a blackhole.
12521 RouteBlackhole,
12522 /// Packet is sent to a wrong (unintended) network. Example: you trace a
12523 /// packet from VM1:Network1 to VM2:Network2, however, the route configured
12524 /// in Network1 sends the packet destined for VM2's IP address to Network3.
12525 RouteWrongNetwork,
12526 /// Route's next hop IP address cannot be resolved to a GCP resource.
12527 RouteNextHopIpAddressNotResolved,
12528 /// Route's next hop resource is not found.
12529 RouteNextHopResourceNotFound,
12530 /// Route's next hop instance doesn't have a NIC in the route's network.
12531 RouteNextHopInstanceWrongNetwork,
12532 /// Route's next hop IP address is not a primary IP address of the next hop
12533 /// instance.
12534 RouteNextHopInstanceNonPrimaryIp,
12535 /// Route's next hop forwarding rule doesn't match next hop IP address.
12536 RouteNextHopForwardingRuleIpMismatch,
12537 /// Route's next hop VPN tunnel is down (does not have valid IKE SAs).
12538 RouteNextHopVpnTunnelNotEstablished,
12539 /// Route's next hop forwarding rule type is invalid (it's not a forwarding
12540 /// rule of the internal passthrough load balancer).
12541 RouteNextHopForwardingRuleTypeInvalid,
12542 /// Packet is sent from the Internet to the private IPv6 address.
12543 NoRouteFromInternetToPrivateIpv6Address,
12544 /// Packet is sent from the Internet to the private IPv4 address.
12545 NoRouteFromInternetToPrivateIpv4Address,
12546 /// Packet is sent from the external IPv6 source address of an instance to
12547 /// the private IPv6 address of an instance.
12548 NoRouteFromExternalIpv6SourceToPrivateIpv6Address,
12549 /// The packet does not match a policy-based VPN tunnel local selector.
12550 VpnTunnelLocalSelectorMismatch,
12551 /// The packet does not match a policy-based VPN tunnel remote selector.
12552 VpnTunnelRemoteSelectorMismatch,
12553 /// Packet with internal destination address sent to the internet gateway.
12554 PrivateTrafficToInternet,
12555 /// Endpoint with only an internal IP address tries to access Google API and
12556 /// services, but Private Google Access is not enabled in the subnet or is
12557 /// not applicable.
12558 PrivateGoogleAccessDisallowed,
12559 /// Source endpoint tries to access Google API and services through the VPN
12560 /// tunnel to another network, but Private Google Access needs to be enabled
12561 /// in the source endpoint network.
12562 PrivateGoogleAccessViaVpnTunnelUnsupported,
12563 /// Endpoint with only an internal IP address tries to access external hosts,
12564 /// but there is no matching Cloud NAT gateway in the subnet.
12565 NoExternalAddress,
12566 /// Destination internal address cannot be resolved to a known target. If
12567 /// this is a shared VPC scenario, verify if the service project ID is
12568 /// provided as test input. Otherwise, verify if the IP address is being
12569 /// used in the project.
12570 UnknownInternalAddress,
12571 /// Forwarding rule's protocol and ports do not match the packet header.
12572 ForwardingRuleMismatch,
12573 /// Forwarding rule does not have backends configured.
12574 ForwardingRuleNoInstances,
12575 /// Firewalls block the health check probes to the backends and cause
12576 /// the backends to be unavailable for traffic from the load balancer.
12577 /// For more details, see [Health check firewall
12578 /// rules](https://cloud.google.com/load-balancing/docs/health-checks#firewall_rules).
12579 FirewallBlockingLoadBalancerBackendHealthCheck,
12580 /// Matching ingress firewall rules by network tags for packets sent via
12581 /// serverless VPC direct egress is unsupported. Behavior is undefined.
12582 /// <https://cloud.google.com/run/docs/configuring/vpc-direct-vpc#limitations>
12583 IngressFirewallTagsUnsupportedByDirectVpcEgress,
12584 /// Packet is sent from or to a Compute Engine instance that is not in a
12585 /// running state.
12586 InstanceNotRunning,
12587 /// Packet sent from or to a GKE cluster that is not in running state.
12588 GkeClusterNotRunning,
12589 /// Packet sent from or to a GKE Pod that is not in running state.
12590 GkePodNotRunning,
12591 /// Packet sent from or to a Cloud SQL instance that is not in running state.
12592 CloudSqlInstanceNotRunning,
12593 /// Packet sent from or to a Redis Instance that is not in running state.
12594 RedisInstanceNotRunning,
12595 /// Packet sent from or to a Redis Cluster that is not in running state.
12596 RedisClusterNotRunning,
12597 /// The type of traffic is blocked and the user cannot configure a firewall
12598 /// rule to enable it. See [Always blocked
12599 /// traffic](https://cloud.google.com/vpc/docs/firewalls#blockedtraffic) for
12600 /// more details.
12601 TrafficTypeBlocked,
12602 /// Access to Google Kubernetes Engine cluster master's endpoint is not
12603 /// authorized. See [Access to the cluster
12604 /// endpoints](https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#access_to_the_cluster_endpoints)
12605 /// for more details.
12606 GkeMasterUnauthorizedAccess,
12607 /// Access to the Cloud SQL instance endpoint is not authorized.
12608 /// See [Authorizing with authorized
12609 /// networks](https://cloud.google.com/sql/docs/mysql/authorize-networks) for
12610 /// more details.
12611 CloudSqlInstanceUnauthorizedAccess,
12612 /// Packet was dropped inside Google Kubernetes Engine Service.
12613 DroppedInsideGkeService,
12614 /// Packet was dropped inside Cloud SQL Service.
12615 DroppedInsideCloudSqlService,
12616 /// Packet was dropped because there is no peering between the originating
12617 /// network and the Google Managed Services Network.
12618 GoogleManagedServiceNoPeering,
12619 /// Packet was dropped because the Google-managed service uses Private
12620 /// Service Connect (PSC), but the PSC endpoint is not found in the project.
12621 GoogleManagedServiceNoPscEndpoint,
12622 /// Packet was dropped because the GKE cluster uses Private Service Connect
12623 /// (PSC), but the PSC endpoint is not found in the project.
12624 GkePscEndpointMissing,
12625 /// Packet was dropped because the Cloud SQL instance has neither a private
12626 /// nor a public IP address.
12627 CloudSqlInstanceNoIpAddress,
12628 /// Packet was dropped because a GKE cluster private endpoint is
12629 /// unreachable from a region different from the cluster's region.
12630 GkeControlPlaneRegionMismatch,
12631 /// Packet sent from a public GKE cluster control plane to a private
12632 /// IP address.
12633 PublicGkeControlPlaneToPrivateDestination,
12634 /// Packet was dropped because there is no route from a GKE cluster
12635 /// control plane to a destination network.
12636 GkeControlPlaneNoRoute,
12637 /// Packet sent from a Cloud SQL instance to an external IP address is not
12638 /// allowed. The Cloud SQL instance is not configured to send packets to
12639 /// external IP addresses.
12640 CloudSqlInstanceNotConfiguredForExternalTraffic,
12641 /// Packet sent from a Cloud SQL instance with only a public IP address to a
12642 /// private IP address.
12643 PublicCloudSqlInstanceToPrivateDestination,
12644 /// Packet was dropped because there is no route from a Cloud SQL
12645 /// instance to a destination network.
12646 CloudSqlInstanceNoRoute,
12647 /// Packet was dropped because the Cloud SQL instance requires all
12648 /// connections to use Cloud SQL connectors and to target the Cloud SQL proxy
12649 /// port (3307).
12650 CloudSqlConnectorRequired,
12651 /// Packet could be dropped because the Cloud Function is not in an active
12652 /// status.
12653 CloudFunctionNotActive,
12654 /// Packet could be dropped because no VPC connector is set.
12655 VpcConnectorNotSet,
12656 /// Packet could be dropped because the VPC connector is not in a running
12657 /// state.
12658 VpcConnectorNotRunning,
12659 /// Packet could be dropped because the traffic from the serverless service
12660 /// to the VPC connector is not allowed.
12661 VpcConnectorServerlessTrafficBlocked,
12662 /// Packet could be dropped because the health check traffic to the VPC
12663 /// connector is not allowed.
12664 VpcConnectorHealthCheckTrafficBlocked,
12665 /// Packet could be dropped because it was sent from a different region
12666 /// to a regional forwarding without global access.
12667 ForwardingRuleRegionMismatch,
12668 /// The Private Service Connect endpoint is in a project that is not approved
12669 /// to connect to the service.
12670 PscConnectionNotAccepted,
12671 /// The packet is sent to the Private Service Connect endpoint over the
12672 /// peering, but [it's not
12673 /// supported](https://cloud.google.com/vpc/docs/configure-private-service-connect-services#on-premises).
12674 PscEndpointAccessedFromPeeredNetwork,
12675 /// The packet is sent to the Private Service Connect backend (network
12676 /// endpoint group), but the producer PSC forwarding rule does not have
12677 /// global access enabled.
12678 PscNegProducerEndpointNoGlobalAccess,
12679 /// The packet is sent to the Private Service Connect backend (network
12680 /// endpoint group), but the producer PSC forwarding rule has multiple ports
12681 /// specified.
12682 PscNegProducerForwardingRuleMultiplePorts,
12683 /// The packet is sent to the Private Service Connect backend (network
12684 /// endpoint group) targeting a Cloud SQL service attachment, but this
12685 /// configuration is not supported.
12686 CloudSqlPscNegUnsupported,
12687 /// No NAT subnets are defined for the PSC service attachment.
12688 NoNatSubnetsForPscServiceAttachment,
12689 /// PSC endpoint is accessed via NCC, but PSC transitivity configuration is
12690 /// not yet propagated.
12691 PscTransitivityNotPropagated,
12692 /// The packet sent from the hybrid NEG proxy matches a non-dynamic route,
12693 /// but such a configuration is not supported.
12694 HybridNegNonDynamicRouteMatched,
12695 /// The packet sent from the hybrid NEG proxy matches a dynamic route with a
12696 /// next hop in a different region, but such a configuration is not
12697 /// supported.
12698 HybridNegNonLocalDynamicRouteMatched,
12699 /// Packet sent from a Cloud Run revision that is not ready.
12700 CloudRunRevisionNotReady,
12701 /// Packet was dropped inside Private Service Connect service producer.
12702 DroppedInsidePscServiceProducer,
12703 /// Packet sent to a load balancer, which requires a proxy-only subnet and
12704 /// the subnet is not found.
12705 LoadBalancerHasNoProxySubnet,
12706 /// Packet sent to Cloud Nat without active NAT IPs.
12707 CloudNatNoAddresses,
12708 /// Packet is stuck in a routing loop.
12709 RoutingLoop,
12710 /// Packet is dropped inside a Google-managed service due to being delivered
12711 /// in return trace to an endpoint that doesn't match the endpoint the packet
12712 /// was sent from in forward trace. Used only for return traces.
12713 DroppedInsideGoogleManagedService,
12714 /// Packet is dropped due to a load balancer backend instance not having a
12715 /// network interface in the network expected by the load balancer.
12716 LoadBalancerBackendInvalidNetwork,
12717 /// Packet is dropped due to a backend service named port not being defined
12718 /// on the instance group level.
12719 BackendServiceNamedPortNotDefined,
12720 /// Packet is dropped due to a destination IP range being part of a Private
12721 /// NAT IP range.
12722 DestinationIsPrivateNatIpRange,
12723 /// Generic drop cause for a packet being dropped inside a Redis Instance
12724 /// service project.
12725 DroppedInsideRedisInstanceService,
12726 /// Packet is dropped due to an unsupported port being used to connect to a
12727 /// Redis Instance. Port 6379 should be used to connect to a Redis Instance.
12728 RedisInstanceUnsupportedPort,
12729 /// Packet is dropped due to connecting from PUPI address to a PSA based
12730 /// Redis Instance.
12731 RedisInstanceConnectingFromPupiAddress,
12732 /// Packet is dropped due to no route to the destination network.
12733 RedisInstanceNoRouteToDestinationNetwork,
12734 /// Redis Instance does not have an external IP address.
12735 RedisInstanceNoExternalIp,
12736 /// Packet is dropped due to an unsupported protocol being used to connect to
12737 /// a Redis Instance. Only TCP connections are accepted by a Redis Instance.
12738 RedisInstanceUnsupportedProtocol,
12739 /// Generic drop cause for a packet being dropped inside a Redis Cluster
12740 /// service project.
12741 DroppedInsideRedisClusterService,
12742 /// Packet is dropped due to an unsupported port being used to connect to a
12743 /// Redis Cluster. Ports 6379 and 11000 to 13047 should be used to connect to
12744 /// a Redis Cluster.
12745 RedisClusterUnsupportedPort,
12746 /// Redis Cluster does not have an external IP address.
12747 RedisClusterNoExternalIp,
12748 /// Packet is dropped due to an unsupported protocol being used to connect to
12749 /// a Redis Cluster. Only TCP connections are accepted by a Redis Cluster.
12750 RedisClusterUnsupportedProtocol,
12751 /// Packet from the non-GCP (on-prem) or unknown GCP network is dropped due
12752 /// to the destination IP address not belonging to any IP prefix advertised
12753 /// via BGP by the Cloud Router.
12754 NoAdvertisedRouteToGcpDestination,
12755 /// Packet from the non-GCP (on-prem) or unknown GCP network is dropped due
12756 /// to the destination IP address not belonging to any IP prefix included to
12757 /// the local traffic selector of the VPN tunnel.
12758 NoTrafficSelectorToGcpDestination,
12759 /// Packet from the unknown peered network is dropped due to no known route
12760 /// from the source network to the destination IP address.
12761 NoKnownRouteFromPeeredNetworkToDestination,
12762 /// Sending packets processed by the Private NAT Gateways to the Private
12763 /// Service Connect endpoints is not supported.
12764 PrivateNatToPscEndpointUnsupported,
12765 /// Packet is sent to the PSC port mapping service, but its destination port
12766 /// does not match any port mapping rules.
12767 PscPortMappingPortMismatch,
12768 /// Sending packets directly to the PSC port mapping service without going
12769 /// through the PSC connection is not supported.
12770 PscPortMappingWithoutPscConnectionUnsupported,
12771 /// Packet with destination IP address within the reserved NAT64 range is
12772 /// dropped due to matching a route of an unsupported type.
12773 UnsupportedRouteMatchedForNat64Destination,
12774 /// Packet could be dropped because hybrid endpoint like a VPN gateway or
12775 /// Interconnect is not allowed to send traffic to the Internet.
12776 TrafficFromHybridEndpointToInternetDisallowed,
12777 /// Packet with destination IP address within the reserved NAT64 range is
12778 /// dropped due to no matching NAT gateway in the subnet.
12779 NoMatchingNat64Gateway,
12780 /// Packet is dropped due to matching a Private NAT64 gateway with no rules
12781 /// for source IPv6 addresses.
12782 NoConfiguredPrivateNat64Rule,
12783 /// Packet is dropped due to being sent to a backend of a passthrough load
12784 /// balancer that doesn't use the same IP version as the frontend.
12785 LoadBalancerBackendIpVersionMismatch,
12786 /// Packet from the unknown NCC network is dropped due to no known route
12787 /// from the source network to the destination IP address.
12788 NoKnownRouteFromNccNetworkToDestination,
12789 /// Packet is dropped by Cloud NAT due to using an unsupported protocol.
12790 CloudNatProtocolUnsupported,
12791 /// Packet is dropped due to using an unsupported protocol (any other than
12792 /// UDP) for L2 Interconnect.
12793 L2InterconnectUnsupportedProtocol,
12794 /// Packet is dropped due to using an unsupported port (any other than
12795 /// 6081) for L2 Interconnect.
12796 L2InterconnectUnsupportedPort,
12797 /// Packet is dropped due to destination IP not matching the appliance
12798 /// mapping IPs configured on the L2 Interconnect attachment.
12799 L2InterconnectDestinationIpMismatch,
12800 /// Packet could be dropped because it matches a route associated with an NCC
12801 /// spoke in the hybrid subnet context, but such a configuration is not
12802 /// supported.
12803 NccRouteWithinHybridSubnetUnsupported,
12804 /// Packet is dropped because the region of the hybrid subnet is different
12805 /// from the region of the next hop of the route matched within this hybrid
12806 /// subnet.
12807 HybridSubnetRegionMismatch,
12808 /// Packet is dropped because no matching route was found in the hybrid
12809 /// subnet.
12810 HybridSubnetNoRoute,
12811 /// Packet is dropped by GKE Network Policy.
12812 GkeNetworkPolicy,
12813 /// Packet is dropped because there is no valid matching route from the
12814 /// network of the Google-managed service to the destination.
12815 NoValidRouteFromGoogleManagedNetworkToDestination,
12816 /// If set, the enum was initialized with an unknown value.
12817 ///
12818 /// Applications can examine the value using [Cause::value] or
12819 /// [Cause::name].
12820 UnknownValue(cause::UnknownValue),
12821 }
12822
12823 #[doc(hidden)]
12824 pub mod cause {
12825 #[allow(unused_imports)]
12826 use super::*;
12827 #[derive(Clone, Debug, PartialEq)]
12828 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12829 }
12830
12831 impl Cause {
12832 /// Gets the enum value.
12833 ///
12834 /// Returns `None` if the enum contains an unknown value deserialized from
12835 /// the string representation of enums.
12836 pub fn value(&self) -> std::option::Option<i32> {
12837 match self {
12838 Self::Unspecified => std::option::Option::Some(0),
12839 Self::UnknownExternalAddress => std::option::Option::Some(1),
12840 Self::ForeignIpDisallowed => std::option::Option::Some(2),
12841 Self::FirewallRule => std::option::Option::Some(3),
12842 Self::NoRoute => std::option::Option::Some(4),
12843 Self::RouteBlackhole => std::option::Option::Some(5),
12844 Self::RouteWrongNetwork => std::option::Option::Some(6),
12845 Self::RouteNextHopIpAddressNotResolved => std::option::Option::Some(42),
12846 Self::RouteNextHopResourceNotFound => std::option::Option::Some(43),
12847 Self::RouteNextHopInstanceWrongNetwork => std::option::Option::Some(49),
12848 Self::RouteNextHopInstanceNonPrimaryIp => std::option::Option::Some(50),
12849 Self::RouteNextHopForwardingRuleIpMismatch => std::option::Option::Some(51),
12850 Self::RouteNextHopVpnTunnelNotEstablished => std::option::Option::Some(52),
12851 Self::RouteNextHopForwardingRuleTypeInvalid => std::option::Option::Some(53),
12852 Self::NoRouteFromInternetToPrivateIpv6Address => std::option::Option::Some(44),
12853 Self::NoRouteFromInternetToPrivateIpv4Address => std::option::Option::Some(109),
12854 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
12855 std::option::Option::Some(98)
12856 }
12857 Self::VpnTunnelLocalSelectorMismatch => std::option::Option::Some(45),
12858 Self::VpnTunnelRemoteSelectorMismatch => std::option::Option::Some(46),
12859 Self::PrivateTrafficToInternet => std::option::Option::Some(7),
12860 Self::PrivateGoogleAccessDisallowed => std::option::Option::Some(8),
12861 Self::PrivateGoogleAccessViaVpnTunnelUnsupported => std::option::Option::Some(47),
12862 Self::NoExternalAddress => std::option::Option::Some(9),
12863 Self::UnknownInternalAddress => std::option::Option::Some(10),
12864 Self::ForwardingRuleMismatch => std::option::Option::Some(11),
12865 Self::ForwardingRuleNoInstances => std::option::Option::Some(12),
12866 Self::FirewallBlockingLoadBalancerBackendHealthCheck => {
12867 std::option::Option::Some(13)
12868 }
12869 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => {
12870 std::option::Option::Some(85)
12871 }
12872 Self::InstanceNotRunning => std::option::Option::Some(14),
12873 Self::GkeClusterNotRunning => std::option::Option::Some(27),
12874 Self::GkePodNotRunning => std::option::Option::Some(103),
12875 Self::CloudSqlInstanceNotRunning => std::option::Option::Some(28),
12876 Self::RedisInstanceNotRunning => std::option::Option::Some(68),
12877 Self::RedisClusterNotRunning => std::option::Option::Some(69),
12878 Self::TrafficTypeBlocked => std::option::Option::Some(15),
12879 Self::GkeMasterUnauthorizedAccess => std::option::Option::Some(16),
12880 Self::CloudSqlInstanceUnauthorizedAccess => std::option::Option::Some(17),
12881 Self::DroppedInsideGkeService => std::option::Option::Some(18),
12882 Self::DroppedInsideCloudSqlService => std::option::Option::Some(19),
12883 Self::GoogleManagedServiceNoPeering => std::option::Option::Some(20),
12884 Self::GoogleManagedServiceNoPscEndpoint => std::option::Option::Some(38),
12885 Self::GkePscEndpointMissing => std::option::Option::Some(36),
12886 Self::CloudSqlInstanceNoIpAddress => std::option::Option::Some(21),
12887 Self::GkeControlPlaneRegionMismatch => std::option::Option::Some(30),
12888 Self::PublicGkeControlPlaneToPrivateDestination => std::option::Option::Some(31),
12889 Self::GkeControlPlaneNoRoute => std::option::Option::Some(32),
12890 Self::CloudSqlInstanceNotConfiguredForExternalTraffic => {
12891 std::option::Option::Some(33)
12892 }
12893 Self::PublicCloudSqlInstanceToPrivateDestination => std::option::Option::Some(34),
12894 Self::CloudSqlInstanceNoRoute => std::option::Option::Some(35),
12895 Self::CloudSqlConnectorRequired => std::option::Option::Some(63),
12896 Self::CloudFunctionNotActive => std::option::Option::Some(22),
12897 Self::VpcConnectorNotSet => std::option::Option::Some(23),
12898 Self::VpcConnectorNotRunning => std::option::Option::Some(24),
12899 Self::VpcConnectorServerlessTrafficBlocked => std::option::Option::Some(60),
12900 Self::VpcConnectorHealthCheckTrafficBlocked => std::option::Option::Some(61),
12901 Self::ForwardingRuleRegionMismatch => std::option::Option::Some(25),
12902 Self::PscConnectionNotAccepted => std::option::Option::Some(26),
12903 Self::PscEndpointAccessedFromPeeredNetwork => std::option::Option::Some(41),
12904 Self::PscNegProducerEndpointNoGlobalAccess => std::option::Option::Some(48),
12905 Self::PscNegProducerForwardingRuleMultiplePorts => std::option::Option::Some(54),
12906 Self::CloudSqlPscNegUnsupported => std::option::Option::Some(58),
12907 Self::NoNatSubnetsForPscServiceAttachment => std::option::Option::Some(57),
12908 Self::PscTransitivityNotPropagated => std::option::Option::Some(64),
12909 Self::HybridNegNonDynamicRouteMatched => std::option::Option::Some(55),
12910 Self::HybridNegNonLocalDynamicRouteMatched => std::option::Option::Some(56),
12911 Self::CloudRunRevisionNotReady => std::option::Option::Some(29),
12912 Self::DroppedInsidePscServiceProducer => std::option::Option::Some(37),
12913 Self::LoadBalancerHasNoProxySubnet => std::option::Option::Some(39),
12914 Self::CloudNatNoAddresses => std::option::Option::Some(40),
12915 Self::RoutingLoop => std::option::Option::Some(59),
12916 Self::DroppedInsideGoogleManagedService => std::option::Option::Some(62),
12917 Self::LoadBalancerBackendInvalidNetwork => std::option::Option::Some(65),
12918 Self::BackendServiceNamedPortNotDefined => std::option::Option::Some(66),
12919 Self::DestinationIsPrivateNatIpRange => std::option::Option::Some(67),
12920 Self::DroppedInsideRedisInstanceService => std::option::Option::Some(70),
12921 Self::RedisInstanceUnsupportedPort => std::option::Option::Some(71),
12922 Self::RedisInstanceConnectingFromPupiAddress => std::option::Option::Some(72),
12923 Self::RedisInstanceNoRouteToDestinationNetwork => std::option::Option::Some(73),
12924 Self::RedisInstanceNoExternalIp => std::option::Option::Some(74),
12925 Self::RedisInstanceUnsupportedProtocol => std::option::Option::Some(78),
12926 Self::DroppedInsideRedisClusterService => std::option::Option::Some(75),
12927 Self::RedisClusterUnsupportedPort => std::option::Option::Some(76),
12928 Self::RedisClusterNoExternalIp => std::option::Option::Some(77),
12929 Self::RedisClusterUnsupportedProtocol => std::option::Option::Some(79),
12930 Self::NoAdvertisedRouteToGcpDestination => std::option::Option::Some(80),
12931 Self::NoTrafficSelectorToGcpDestination => std::option::Option::Some(81),
12932 Self::NoKnownRouteFromPeeredNetworkToDestination => std::option::Option::Some(82),
12933 Self::PrivateNatToPscEndpointUnsupported => std::option::Option::Some(83),
12934 Self::PscPortMappingPortMismatch => std::option::Option::Some(86),
12935 Self::PscPortMappingWithoutPscConnectionUnsupported => {
12936 std::option::Option::Some(87)
12937 }
12938 Self::UnsupportedRouteMatchedForNat64Destination => std::option::Option::Some(88),
12939 Self::TrafficFromHybridEndpointToInternetDisallowed => {
12940 std::option::Option::Some(89)
12941 }
12942 Self::NoMatchingNat64Gateway => std::option::Option::Some(90),
12943 Self::NoConfiguredPrivateNat64Rule => std::option::Option::Some(107),
12944 Self::LoadBalancerBackendIpVersionMismatch => std::option::Option::Some(96),
12945 Self::NoKnownRouteFromNccNetworkToDestination => std::option::Option::Some(97),
12946 Self::CloudNatProtocolUnsupported => std::option::Option::Some(99),
12947 Self::L2InterconnectUnsupportedProtocol => std::option::Option::Some(100),
12948 Self::L2InterconnectUnsupportedPort => std::option::Option::Some(101),
12949 Self::L2InterconnectDestinationIpMismatch => std::option::Option::Some(102),
12950 Self::NccRouteWithinHybridSubnetUnsupported => std::option::Option::Some(104),
12951 Self::HybridSubnetRegionMismatch => std::option::Option::Some(105),
12952 Self::HybridSubnetNoRoute => std::option::Option::Some(106),
12953 Self::GkeNetworkPolicy => std::option::Option::Some(108),
12954 Self::NoValidRouteFromGoogleManagedNetworkToDestination => {
12955 std::option::Option::Some(110)
12956 }
12957 Self::UnknownValue(u) => u.0.value(),
12958 }
12959 }
12960
12961 /// Gets the enum value as a string.
12962 ///
12963 /// Returns `None` if the enum contains an unknown value deserialized from
12964 /// the integer representation of enums.
12965 pub fn name(&self) -> std::option::Option<&str> {
12966 match self {
12967 Self::Unspecified => std::option::Option::Some("CAUSE_UNSPECIFIED"),
12968 Self::UnknownExternalAddress => {
12969 std::option::Option::Some("UNKNOWN_EXTERNAL_ADDRESS")
12970 }
12971 Self::ForeignIpDisallowed => std::option::Option::Some("FOREIGN_IP_DISALLOWED"),
12972 Self::FirewallRule => std::option::Option::Some("FIREWALL_RULE"),
12973 Self::NoRoute => std::option::Option::Some("NO_ROUTE"),
12974 Self::RouteBlackhole => std::option::Option::Some("ROUTE_BLACKHOLE"),
12975 Self::RouteWrongNetwork => std::option::Option::Some("ROUTE_WRONG_NETWORK"),
12976 Self::RouteNextHopIpAddressNotResolved => {
12977 std::option::Option::Some("ROUTE_NEXT_HOP_IP_ADDRESS_NOT_RESOLVED")
12978 }
12979 Self::RouteNextHopResourceNotFound => {
12980 std::option::Option::Some("ROUTE_NEXT_HOP_RESOURCE_NOT_FOUND")
12981 }
12982 Self::RouteNextHopInstanceWrongNetwork => {
12983 std::option::Option::Some("ROUTE_NEXT_HOP_INSTANCE_WRONG_NETWORK")
12984 }
12985 Self::RouteNextHopInstanceNonPrimaryIp => {
12986 std::option::Option::Some("ROUTE_NEXT_HOP_INSTANCE_NON_PRIMARY_IP")
12987 }
12988 Self::RouteNextHopForwardingRuleIpMismatch => {
12989 std::option::Option::Some("ROUTE_NEXT_HOP_FORWARDING_RULE_IP_MISMATCH")
12990 }
12991 Self::RouteNextHopVpnTunnelNotEstablished => {
12992 std::option::Option::Some("ROUTE_NEXT_HOP_VPN_TUNNEL_NOT_ESTABLISHED")
12993 }
12994 Self::RouteNextHopForwardingRuleTypeInvalid => {
12995 std::option::Option::Some("ROUTE_NEXT_HOP_FORWARDING_RULE_TYPE_INVALID")
12996 }
12997 Self::NoRouteFromInternetToPrivateIpv6Address => {
12998 std::option::Option::Some("NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV6_ADDRESS")
12999 }
13000 Self::NoRouteFromInternetToPrivateIpv4Address => {
13001 std::option::Option::Some("NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV4_ADDRESS")
13002 }
13003 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
13004 std::option::Option::Some(
13005 "NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS",
13006 )
13007 }
13008 Self::VpnTunnelLocalSelectorMismatch => {
13009 std::option::Option::Some("VPN_TUNNEL_LOCAL_SELECTOR_MISMATCH")
13010 }
13011 Self::VpnTunnelRemoteSelectorMismatch => {
13012 std::option::Option::Some("VPN_TUNNEL_REMOTE_SELECTOR_MISMATCH")
13013 }
13014 Self::PrivateTrafficToInternet => {
13015 std::option::Option::Some("PRIVATE_TRAFFIC_TO_INTERNET")
13016 }
13017 Self::PrivateGoogleAccessDisallowed => {
13018 std::option::Option::Some("PRIVATE_GOOGLE_ACCESS_DISALLOWED")
13019 }
13020 Self::PrivateGoogleAccessViaVpnTunnelUnsupported => {
13021 std::option::Option::Some("PRIVATE_GOOGLE_ACCESS_VIA_VPN_TUNNEL_UNSUPPORTED")
13022 }
13023 Self::NoExternalAddress => std::option::Option::Some("NO_EXTERNAL_ADDRESS"),
13024 Self::UnknownInternalAddress => {
13025 std::option::Option::Some("UNKNOWN_INTERNAL_ADDRESS")
13026 }
13027 Self::ForwardingRuleMismatch => {
13028 std::option::Option::Some("FORWARDING_RULE_MISMATCH")
13029 }
13030 Self::ForwardingRuleNoInstances => {
13031 std::option::Option::Some("FORWARDING_RULE_NO_INSTANCES")
13032 }
13033 Self::FirewallBlockingLoadBalancerBackendHealthCheck => std::option::Option::Some(
13034 "FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK",
13035 ),
13036 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => std::option::Option::Some(
13037 "INGRESS_FIREWALL_TAGS_UNSUPPORTED_BY_DIRECT_VPC_EGRESS",
13038 ),
13039 Self::InstanceNotRunning => std::option::Option::Some("INSTANCE_NOT_RUNNING"),
13040 Self::GkeClusterNotRunning => std::option::Option::Some("GKE_CLUSTER_NOT_RUNNING"),
13041 Self::GkePodNotRunning => std::option::Option::Some("GKE_POD_NOT_RUNNING"),
13042 Self::CloudSqlInstanceNotRunning => {
13043 std::option::Option::Some("CLOUD_SQL_INSTANCE_NOT_RUNNING")
13044 }
13045 Self::RedisInstanceNotRunning => {
13046 std::option::Option::Some("REDIS_INSTANCE_NOT_RUNNING")
13047 }
13048 Self::RedisClusterNotRunning => {
13049 std::option::Option::Some("REDIS_CLUSTER_NOT_RUNNING")
13050 }
13051 Self::TrafficTypeBlocked => std::option::Option::Some("TRAFFIC_TYPE_BLOCKED"),
13052 Self::GkeMasterUnauthorizedAccess => {
13053 std::option::Option::Some("GKE_MASTER_UNAUTHORIZED_ACCESS")
13054 }
13055 Self::CloudSqlInstanceUnauthorizedAccess => {
13056 std::option::Option::Some("CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS")
13057 }
13058 Self::DroppedInsideGkeService => {
13059 std::option::Option::Some("DROPPED_INSIDE_GKE_SERVICE")
13060 }
13061 Self::DroppedInsideCloudSqlService => {
13062 std::option::Option::Some("DROPPED_INSIDE_CLOUD_SQL_SERVICE")
13063 }
13064 Self::GoogleManagedServiceNoPeering => {
13065 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_NO_PEERING")
13066 }
13067 Self::GoogleManagedServiceNoPscEndpoint => {
13068 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_NO_PSC_ENDPOINT")
13069 }
13070 Self::GkePscEndpointMissing => {
13071 std::option::Option::Some("GKE_PSC_ENDPOINT_MISSING")
13072 }
13073 Self::CloudSqlInstanceNoIpAddress => {
13074 std::option::Option::Some("CLOUD_SQL_INSTANCE_NO_IP_ADDRESS")
13075 }
13076 Self::GkeControlPlaneRegionMismatch => {
13077 std::option::Option::Some("GKE_CONTROL_PLANE_REGION_MISMATCH")
13078 }
13079 Self::PublicGkeControlPlaneToPrivateDestination => {
13080 std::option::Option::Some("PUBLIC_GKE_CONTROL_PLANE_TO_PRIVATE_DESTINATION")
13081 }
13082 Self::GkeControlPlaneNoRoute => {
13083 std::option::Option::Some("GKE_CONTROL_PLANE_NO_ROUTE")
13084 }
13085 Self::CloudSqlInstanceNotConfiguredForExternalTraffic => std::option::Option::Some(
13086 "CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC",
13087 ),
13088 Self::PublicCloudSqlInstanceToPrivateDestination => {
13089 std::option::Option::Some("PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION")
13090 }
13091 Self::CloudSqlInstanceNoRoute => {
13092 std::option::Option::Some("CLOUD_SQL_INSTANCE_NO_ROUTE")
13093 }
13094 Self::CloudSqlConnectorRequired => {
13095 std::option::Option::Some("CLOUD_SQL_CONNECTOR_REQUIRED")
13096 }
13097 Self::CloudFunctionNotActive => {
13098 std::option::Option::Some("CLOUD_FUNCTION_NOT_ACTIVE")
13099 }
13100 Self::VpcConnectorNotSet => std::option::Option::Some("VPC_CONNECTOR_NOT_SET"),
13101 Self::VpcConnectorNotRunning => {
13102 std::option::Option::Some("VPC_CONNECTOR_NOT_RUNNING")
13103 }
13104 Self::VpcConnectorServerlessTrafficBlocked => {
13105 std::option::Option::Some("VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED")
13106 }
13107 Self::VpcConnectorHealthCheckTrafficBlocked => {
13108 std::option::Option::Some("VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED")
13109 }
13110 Self::ForwardingRuleRegionMismatch => {
13111 std::option::Option::Some("FORWARDING_RULE_REGION_MISMATCH")
13112 }
13113 Self::PscConnectionNotAccepted => {
13114 std::option::Option::Some("PSC_CONNECTION_NOT_ACCEPTED")
13115 }
13116 Self::PscEndpointAccessedFromPeeredNetwork => {
13117 std::option::Option::Some("PSC_ENDPOINT_ACCESSED_FROM_PEERED_NETWORK")
13118 }
13119 Self::PscNegProducerEndpointNoGlobalAccess => {
13120 std::option::Option::Some("PSC_NEG_PRODUCER_ENDPOINT_NO_GLOBAL_ACCESS")
13121 }
13122 Self::PscNegProducerForwardingRuleMultiplePorts => {
13123 std::option::Option::Some("PSC_NEG_PRODUCER_FORWARDING_RULE_MULTIPLE_PORTS")
13124 }
13125 Self::CloudSqlPscNegUnsupported => {
13126 std::option::Option::Some("CLOUD_SQL_PSC_NEG_UNSUPPORTED")
13127 }
13128 Self::NoNatSubnetsForPscServiceAttachment => {
13129 std::option::Option::Some("NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT")
13130 }
13131 Self::PscTransitivityNotPropagated => {
13132 std::option::Option::Some("PSC_TRANSITIVITY_NOT_PROPAGATED")
13133 }
13134 Self::HybridNegNonDynamicRouteMatched => {
13135 std::option::Option::Some("HYBRID_NEG_NON_DYNAMIC_ROUTE_MATCHED")
13136 }
13137 Self::HybridNegNonLocalDynamicRouteMatched => {
13138 std::option::Option::Some("HYBRID_NEG_NON_LOCAL_DYNAMIC_ROUTE_MATCHED")
13139 }
13140 Self::CloudRunRevisionNotReady => {
13141 std::option::Option::Some("CLOUD_RUN_REVISION_NOT_READY")
13142 }
13143 Self::DroppedInsidePscServiceProducer => {
13144 std::option::Option::Some("DROPPED_INSIDE_PSC_SERVICE_PRODUCER")
13145 }
13146 Self::LoadBalancerHasNoProxySubnet => {
13147 std::option::Option::Some("LOAD_BALANCER_HAS_NO_PROXY_SUBNET")
13148 }
13149 Self::CloudNatNoAddresses => std::option::Option::Some("CLOUD_NAT_NO_ADDRESSES"),
13150 Self::RoutingLoop => std::option::Option::Some("ROUTING_LOOP"),
13151 Self::DroppedInsideGoogleManagedService => {
13152 std::option::Option::Some("DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE")
13153 }
13154 Self::LoadBalancerBackendInvalidNetwork => {
13155 std::option::Option::Some("LOAD_BALANCER_BACKEND_INVALID_NETWORK")
13156 }
13157 Self::BackendServiceNamedPortNotDefined => {
13158 std::option::Option::Some("BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED")
13159 }
13160 Self::DestinationIsPrivateNatIpRange => {
13161 std::option::Option::Some("DESTINATION_IS_PRIVATE_NAT_IP_RANGE")
13162 }
13163 Self::DroppedInsideRedisInstanceService => {
13164 std::option::Option::Some("DROPPED_INSIDE_REDIS_INSTANCE_SERVICE")
13165 }
13166 Self::RedisInstanceUnsupportedPort => {
13167 std::option::Option::Some("REDIS_INSTANCE_UNSUPPORTED_PORT")
13168 }
13169 Self::RedisInstanceConnectingFromPupiAddress => {
13170 std::option::Option::Some("REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS")
13171 }
13172 Self::RedisInstanceNoRouteToDestinationNetwork => {
13173 std::option::Option::Some("REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK")
13174 }
13175 Self::RedisInstanceNoExternalIp => {
13176 std::option::Option::Some("REDIS_INSTANCE_NO_EXTERNAL_IP")
13177 }
13178 Self::RedisInstanceUnsupportedProtocol => {
13179 std::option::Option::Some("REDIS_INSTANCE_UNSUPPORTED_PROTOCOL")
13180 }
13181 Self::DroppedInsideRedisClusterService => {
13182 std::option::Option::Some("DROPPED_INSIDE_REDIS_CLUSTER_SERVICE")
13183 }
13184 Self::RedisClusterUnsupportedPort => {
13185 std::option::Option::Some("REDIS_CLUSTER_UNSUPPORTED_PORT")
13186 }
13187 Self::RedisClusterNoExternalIp => {
13188 std::option::Option::Some("REDIS_CLUSTER_NO_EXTERNAL_IP")
13189 }
13190 Self::RedisClusterUnsupportedProtocol => {
13191 std::option::Option::Some("REDIS_CLUSTER_UNSUPPORTED_PROTOCOL")
13192 }
13193 Self::NoAdvertisedRouteToGcpDestination => {
13194 std::option::Option::Some("NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION")
13195 }
13196 Self::NoTrafficSelectorToGcpDestination => {
13197 std::option::Option::Some("NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION")
13198 }
13199 Self::NoKnownRouteFromPeeredNetworkToDestination => {
13200 std::option::Option::Some("NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION")
13201 }
13202 Self::PrivateNatToPscEndpointUnsupported => {
13203 std::option::Option::Some("PRIVATE_NAT_TO_PSC_ENDPOINT_UNSUPPORTED")
13204 }
13205 Self::PscPortMappingPortMismatch => {
13206 std::option::Option::Some("PSC_PORT_MAPPING_PORT_MISMATCH")
13207 }
13208 Self::PscPortMappingWithoutPscConnectionUnsupported => {
13209 std::option::Option::Some("PSC_PORT_MAPPING_WITHOUT_PSC_CONNECTION_UNSUPPORTED")
13210 }
13211 Self::UnsupportedRouteMatchedForNat64Destination => {
13212 std::option::Option::Some("UNSUPPORTED_ROUTE_MATCHED_FOR_NAT64_DESTINATION")
13213 }
13214 Self::TrafficFromHybridEndpointToInternetDisallowed => {
13215 std::option::Option::Some("TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED")
13216 }
13217 Self::NoMatchingNat64Gateway => {
13218 std::option::Option::Some("NO_MATCHING_NAT64_GATEWAY")
13219 }
13220 Self::NoConfiguredPrivateNat64Rule => {
13221 std::option::Option::Some("NO_CONFIGURED_PRIVATE_NAT64_RULE")
13222 }
13223 Self::LoadBalancerBackendIpVersionMismatch => {
13224 std::option::Option::Some("LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH")
13225 }
13226 Self::NoKnownRouteFromNccNetworkToDestination => {
13227 std::option::Option::Some("NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION")
13228 }
13229 Self::CloudNatProtocolUnsupported => {
13230 std::option::Option::Some("CLOUD_NAT_PROTOCOL_UNSUPPORTED")
13231 }
13232 Self::L2InterconnectUnsupportedProtocol => {
13233 std::option::Option::Some("L2_INTERCONNECT_UNSUPPORTED_PROTOCOL")
13234 }
13235 Self::L2InterconnectUnsupportedPort => {
13236 std::option::Option::Some("L2_INTERCONNECT_UNSUPPORTED_PORT")
13237 }
13238 Self::L2InterconnectDestinationIpMismatch => {
13239 std::option::Option::Some("L2_INTERCONNECT_DESTINATION_IP_MISMATCH")
13240 }
13241 Self::NccRouteWithinHybridSubnetUnsupported => {
13242 std::option::Option::Some("NCC_ROUTE_WITHIN_HYBRID_SUBNET_UNSUPPORTED")
13243 }
13244 Self::HybridSubnetRegionMismatch => {
13245 std::option::Option::Some("HYBRID_SUBNET_REGION_MISMATCH")
13246 }
13247 Self::HybridSubnetNoRoute => std::option::Option::Some("HYBRID_SUBNET_NO_ROUTE"),
13248 Self::GkeNetworkPolicy => std::option::Option::Some("GKE_NETWORK_POLICY"),
13249 Self::NoValidRouteFromGoogleManagedNetworkToDestination => {
13250 std::option::Option::Some(
13251 "NO_VALID_ROUTE_FROM_GOOGLE_MANAGED_NETWORK_TO_DESTINATION",
13252 )
13253 }
13254 Self::UnknownValue(u) => u.0.name(),
13255 }
13256 }
13257 }
13258
13259 impl std::default::Default for Cause {
13260 fn default() -> Self {
13261 use std::convert::From;
13262 Self::from(0)
13263 }
13264 }
13265
13266 impl std::fmt::Display for Cause {
13267 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13268 wkt::internal::display_enum(f, self.name(), self.value())
13269 }
13270 }
13271
13272 impl std::convert::From<i32> for Cause {
13273 fn from(value: i32) -> Self {
13274 match value {
13275 0 => Self::Unspecified,
13276 1 => Self::UnknownExternalAddress,
13277 2 => Self::ForeignIpDisallowed,
13278 3 => Self::FirewallRule,
13279 4 => Self::NoRoute,
13280 5 => Self::RouteBlackhole,
13281 6 => Self::RouteWrongNetwork,
13282 7 => Self::PrivateTrafficToInternet,
13283 8 => Self::PrivateGoogleAccessDisallowed,
13284 9 => Self::NoExternalAddress,
13285 10 => Self::UnknownInternalAddress,
13286 11 => Self::ForwardingRuleMismatch,
13287 12 => Self::ForwardingRuleNoInstances,
13288 13 => Self::FirewallBlockingLoadBalancerBackendHealthCheck,
13289 14 => Self::InstanceNotRunning,
13290 15 => Self::TrafficTypeBlocked,
13291 16 => Self::GkeMasterUnauthorizedAccess,
13292 17 => Self::CloudSqlInstanceUnauthorizedAccess,
13293 18 => Self::DroppedInsideGkeService,
13294 19 => Self::DroppedInsideCloudSqlService,
13295 20 => Self::GoogleManagedServiceNoPeering,
13296 21 => Self::CloudSqlInstanceNoIpAddress,
13297 22 => Self::CloudFunctionNotActive,
13298 23 => Self::VpcConnectorNotSet,
13299 24 => Self::VpcConnectorNotRunning,
13300 25 => Self::ForwardingRuleRegionMismatch,
13301 26 => Self::PscConnectionNotAccepted,
13302 27 => Self::GkeClusterNotRunning,
13303 28 => Self::CloudSqlInstanceNotRunning,
13304 29 => Self::CloudRunRevisionNotReady,
13305 30 => Self::GkeControlPlaneRegionMismatch,
13306 31 => Self::PublicGkeControlPlaneToPrivateDestination,
13307 32 => Self::GkeControlPlaneNoRoute,
13308 33 => Self::CloudSqlInstanceNotConfiguredForExternalTraffic,
13309 34 => Self::PublicCloudSqlInstanceToPrivateDestination,
13310 35 => Self::CloudSqlInstanceNoRoute,
13311 36 => Self::GkePscEndpointMissing,
13312 37 => Self::DroppedInsidePscServiceProducer,
13313 38 => Self::GoogleManagedServiceNoPscEndpoint,
13314 39 => Self::LoadBalancerHasNoProxySubnet,
13315 40 => Self::CloudNatNoAddresses,
13316 41 => Self::PscEndpointAccessedFromPeeredNetwork,
13317 42 => Self::RouteNextHopIpAddressNotResolved,
13318 43 => Self::RouteNextHopResourceNotFound,
13319 44 => Self::NoRouteFromInternetToPrivateIpv6Address,
13320 45 => Self::VpnTunnelLocalSelectorMismatch,
13321 46 => Self::VpnTunnelRemoteSelectorMismatch,
13322 47 => Self::PrivateGoogleAccessViaVpnTunnelUnsupported,
13323 48 => Self::PscNegProducerEndpointNoGlobalAccess,
13324 49 => Self::RouteNextHopInstanceWrongNetwork,
13325 50 => Self::RouteNextHopInstanceNonPrimaryIp,
13326 51 => Self::RouteNextHopForwardingRuleIpMismatch,
13327 52 => Self::RouteNextHopVpnTunnelNotEstablished,
13328 53 => Self::RouteNextHopForwardingRuleTypeInvalid,
13329 54 => Self::PscNegProducerForwardingRuleMultiplePorts,
13330 55 => Self::HybridNegNonDynamicRouteMatched,
13331 56 => Self::HybridNegNonLocalDynamicRouteMatched,
13332 57 => Self::NoNatSubnetsForPscServiceAttachment,
13333 58 => Self::CloudSqlPscNegUnsupported,
13334 59 => Self::RoutingLoop,
13335 60 => Self::VpcConnectorServerlessTrafficBlocked,
13336 61 => Self::VpcConnectorHealthCheckTrafficBlocked,
13337 62 => Self::DroppedInsideGoogleManagedService,
13338 63 => Self::CloudSqlConnectorRequired,
13339 64 => Self::PscTransitivityNotPropagated,
13340 65 => Self::LoadBalancerBackendInvalidNetwork,
13341 66 => Self::BackendServiceNamedPortNotDefined,
13342 67 => Self::DestinationIsPrivateNatIpRange,
13343 68 => Self::RedisInstanceNotRunning,
13344 69 => Self::RedisClusterNotRunning,
13345 70 => Self::DroppedInsideRedisInstanceService,
13346 71 => Self::RedisInstanceUnsupportedPort,
13347 72 => Self::RedisInstanceConnectingFromPupiAddress,
13348 73 => Self::RedisInstanceNoRouteToDestinationNetwork,
13349 74 => Self::RedisInstanceNoExternalIp,
13350 75 => Self::DroppedInsideRedisClusterService,
13351 76 => Self::RedisClusterUnsupportedPort,
13352 77 => Self::RedisClusterNoExternalIp,
13353 78 => Self::RedisInstanceUnsupportedProtocol,
13354 79 => Self::RedisClusterUnsupportedProtocol,
13355 80 => Self::NoAdvertisedRouteToGcpDestination,
13356 81 => Self::NoTrafficSelectorToGcpDestination,
13357 82 => Self::NoKnownRouteFromPeeredNetworkToDestination,
13358 83 => Self::PrivateNatToPscEndpointUnsupported,
13359 85 => Self::IngressFirewallTagsUnsupportedByDirectVpcEgress,
13360 86 => Self::PscPortMappingPortMismatch,
13361 87 => Self::PscPortMappingWithoutPscConnectionUnsupported,
13362 88 => Self::UnsupportedRouteMatchedForNat64Destination,
13363 89 => Self::TrafficFromHybridEndpointToInternetDisallowed,
13364 90 => Self::NoMatchingNat64Gateway,
13365 96 => Self::LoadBalancerBackendIpVersionMismatch,
13366 97 => Self::NoKnownRouteFromNccNetworkToDestination,
13367 98 => Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address,
13368 99 => Self::CloudNatProtocolUnsupported,
13369 100 => Self::L2InterconnectUnsupportedProtocol,
13370 101 => Self::L2InterconnectUnsupportedPort,
13371 102 => Self::L2InterconnectDestinationIpMismatch,
13372 103 => Self::GkePodNotRunning,
13373 104 => Self::NccRouteWithinHybridSubnetUnsupported,
13374 105 => Self::HybridSubnetRegionMismatch,
13375 106 => Self::HybridSubnetNoRoute,
13376 107 => Self::NoConfiguredPrivateNat64Rule,
13377 108 => Self::GkeNetworkPolicy,
13378 109 => Self::NoRouteFromInternetToPrivateIpv4Address,
13379 110 => Self::NoValidRouteFromGoogleManagedNetworkToDestination,
13380 _ => Self::UnknownValue(cause::UnknownValue(
13381 wkt::internal::UnknownEnumValue::Integer(value),
13382 )),
13383 }
13384 }
13385 }
13386
13387 impl std::convert::From<&str> for Cause {
13388 fn from(value: &str) -> Self {
13389 use std::string::ToString;
13390 match value {
13391 "CAUSE_UNSPECIFIED" => Self::Unspecified,
13392 "UNKNOWN_EXTERNAL_ADDRESS" => Self::UnknownExternalAddress,
13393 "FOREIGN_IP_DISALLOWED" => Self::ForeignIpDisallowed,
13394 "FIREWALL_RULE" => Self::FirewallRule,
13395 "NO_ROUTE" => Self::NoRoute,
13396 "ROUTE_BLACKHOLE" => Self::RouteBlackhole,
13397 "ROUTE_WRONG_NETWORK" => Self::RouteWrongNetwork,
13398 "ROUTE_NEXT_HOP_IP_ADDRESS_NOT_RESOLVED" => Self::RouteNextHopIpAddressNotResolved,
13399 "ROUTE_NEXT_HOP_RESOURCE_NOT_FOUND" => Self::RouteNextHopResourceNotFound,
13400 "ROUTE_NEXT_HOP_INSTANCE_WRONG_NETWORK" => Self::RouteNextHopInstanceWrongNetwork,
13401 "ROUTE_NEXT_HOP_INSTANCE_NON_PRIMARY_IP" => Self::RouteNextHopInstanceNonPrimaryIp,
13402 "ROUTE_NEXT_HOP_FORWARDING_RULE_IP_MISMATCH" => {
13403 Self::RouteNextHopForwardingRuleIpMismatch
13404 }
13405 "ROUTE_NEXT_HOP_VPN_TUNNEL_NOT_ESTABLISHED" => {
13406 Self::RouteNextHopVpnTunnelNotEstablished
13407 }
13408 "ROUTE_NEXT_HOP_FORWARDING_RULE_TYPE_INVALID" => {
13409 Self::RouteNextHopForwardingRuleTypeInvalid
13410 }
13411 "NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV6_ADDRESS" => {
13412 Self::NoRouteFromInternetToPrivateIpv6Address
13413 }
13414 "NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV4_ADDRESS" => {
13415 Self::NoRouteFromInternetToPrivateIpv4Address
13416 }
13417 "NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS" => {
13418 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address
13419 }
13420 "VPN_TUNNEL_LOCAL_SELECTOR_MISMATCH" => Self::VpnTunnelLocalSelectorMismatch,
13421 "VPN_TUNNEL_REMOTE_SELECTOR_MISMATCH" => Self::VpnTunnelRemoteSelectorMismatch,
13422 "PRIVATE_TRAFFIC_TO_INTERNET" => Self::PrivateTrafficToInternet,
13423 "PRIVATE_GOOGLE_ACCESS_DISALLOWED" => Self::PrivateGoogleAccessDisallowed,
13424 "PRIVATE_GOOGLE_ACCESS_VIA_VPN_TUNNEL_UNSUPPORTED" => {
13425 Self::PrivateGoogleAccessViaVpnTunnelUnsupported
13426 }
13427 "NO_EXTERNAL_ADDRESS" => Self::NoExternalAddress,
13428 "UNKNOWN_INTERNAL_ADDRESS" => Self::UnknownInternalAddress,
13429 "FORWARDING_RULE_MISMATCH" => Self::ForwardingRuleMismatch,
13430 "FORWARDING_RULE_NO_INSTANCES" => Self::ForwardingRuleNoInstances,
13431 "FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK" => {
13432 Self::FirewallBlockingLoadBalancerBackendHealthCheck
13433 }
13434 "INGRESS_FIREWALL_TAGS_UNSUPPORTED_BY_DIRECT_VPC_EGRESS" => {
13435 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress
13436 }
13437 "INSTANCE_NOT_RUNNING" => Self::InstanceNotRunning,
13438 "GKE_CLUSTER_NOT_RUNNING" => Self::GkeClusterNotRunning,
13439 "GKE_POD_NOT_RUNNING" => Self::GkePodNotRunning,
13440 "CLOUD_SQL_INSTANCE_NOT_RUNNING" => Self::CloudSqlInstanceNotRunning,
13441 "REDIS_INSTANCE_NOT_RUNNING" => Self::RedisInstanceNotRunning,
13442 "REDIS_CLUSTER_NOT_RUNNING" => Self::RedisClusterNotRunning,
13443 "TRAFFIC_TYPE_BLOCKED" => Self::TrafficTypeBlocked,
13444 "GKE_MASTER_UNAUTHORIZED_ACCESS" => Self::GkeMasterUnauthorizedAccess,
13445 "CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS" => {
13446 Self::CloudSqlInstanceUnauthorizedAccess
13447 }
13448 "DROPPED_INSIDE_GKE_SERVICE" => Self::DroppedInsideGkeService,
13449 "DROPPED_INSIDE_CLOUD_SQL_SERVICE" => Self::DroppedInsideCloudSqlService,
13450 "GOOGLE_MANAGED_SERVICE_NO_PEERING" => Self::GoogleManagedServiceNoPeering,
13451 "GOOGLE_MANAGED_SERVICE_NO_PSC_ENDPOINT" => Self::GoogleManagedServiceNoPscEndpoint,
13452 "GKE_PSC_ENDPOINT_MISSING" => Self::GkePscEndpointMissing,
13453 "CLOUD_SQL_INSTANCE_NO_IP_ADDRESS" => Self::CloudSqlInstanceNoIpAddress,
13454 "GKE_CONTROL_PLANE_REGION_MISMATCH" => Self::GkeControlPlaneRegionMismatch,
13455 "PUBLIC_GKE_CONTROL_PLANE_TO_PRIVATE_DESTINATION" => {
13456 Self::PublicGkeControlPlaneToPrivateDestination
13457 }
13458 "GKE_CONTROL_PLANE_NO_ROUTE" => Self::GkeControlPlaneNoRoute,
13459 "CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC" => {
13460 Self::CloudSqlInstanceNotConfiguredForExternalTraffic
13461 }
13462 "PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION" => {
13463 Self::PublicCloudSqlInstanceToPrivateDestination
13464 }
13465 "CLOUD_SQL_INSTANCE_NO_ROUTE" => Self::CloudSqlInstanceNoRoute,
13466 "CLOUD_SQL_CONNECTOR_REQUIRED" => Self::CloudSqlConnectorRequired,
13467 "CLOUD_FUNCTION_NOT_ACTIVE" => Self::CloudFunctionNotActive,
13468 "VPC_CONNECTOR_NOT_SET" => Self::VpcConnectorNotSet,
13469 "VPC_CONNECTOR_NOT_RUNNING" => Self::VpcConnectorNotRunning,
13470 "VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED" => {
13471 Self::VpcConnectorServerlessTrafficBlocked
13472 }
13473 "VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED" => {
13474 Self::VpcConnectorHealthCheckTrafficBlocked
13475 }
13476 "FORWARDING_RULE_REGION_MISMATCH" => Self::ForwardingRuleRegionMismatch,
13477 "PSC_CONNECTION_NOT_ACCEPTED" => Self::PscConnectionNotAccepted,
13478 "PSC_ENDPOINT_ACCESSED_FROM_PEERED_NETWORK" => {
13479 Self::PscEndpointAccessedFromPeeredNetwork
13480 }
13481 "PSC_NEG_PRODUCER_ENDPOINT_NO_GLOBAL_ACCESS" => {
13482 Self::PscNegProducerEndpointNoGlobalAccess
13483 }
13484 "PSC_NEG_PRODUCER_FORWARDING_RULE_MULTIPLE_PORTS" => {
13485 Self::PscNegProducerForwardingRuleMultiplePorts
13486 }
13487 "CLOUD_SQL_PSC_NEG_UNSUPPORTED" => Self::CloudSqlPscNegUnsupported,
13488 "NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT" => {
13489 Self::NoNatSubnetsForPscServiceAttachment
13490 }
13491 "PSC_TRANSITIVITY_NOT_PROPAGATED" => Self::PscTransitivityNotPropagated,
13492 "HYBRID_NEG_NON_DYNAMIC_ROUTE_MATCHED" => Self::HybridNegNonDynamicRouteMatched,
13493 "HYBRID_NEG_NON_LOCAL_DYNAMIC_ROUTE_MATCHED" => {
13494 Self::HybridNegNonLocalDynamicRouteMatched
13495 }
13496 "CLOUD_RUN_REVISION_NOT_READY" => Self::CloudRunRevisionNotReady,
13497 "DROPPED_INSIDE_PSC_SERVICE_PRODUCER" => Self::DroppedInsidePscServiceProducer,
13498 "LOAD_BALANCER_HAS_NO_PROXY_SUBNET" => Self::LoadBalancerHasNoProxySubnet,
13499 "CLOUD_NAT_NO_ADDRESSES" => Self::CloudNatNoAddresses,
13500 "ROUTING_LOOP" => Self::RoutingLoop,
13501 "DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE" => Self::DroppedInsideGoogleManagedService,
13502 "LOAD_BALANCER_BACKEND_INVALID_NETWORK" => Self::LoadBalancerBackendInvalidNetwork,
13503 "BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED" => Self::BackendServiceNamedPortNotDefined,
13504 "DESTINATION_IS_PRIVATE_NAT_IP_RANGE" => Self::DestinationIsPrivateNatIpRange,
13505 "DROPPED_INSIDE_REDIS_INSTANCE_SERVICE" => Self::DroppedInsideRedisInstanceService,
13506 "REDIS_INSTANCE_UNSUPPORTED_PORT" => Self::RedisInstanceUnsupportedPort,
13507 "REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS" => {
13508 Self::RedisInstanceConnectingFromPupiAddress
13509 }
13510 "REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK" => {
13511 Self::RedisInstanceNoRouteToDestinationNetwork
13512 }
13513 "REDIS_INSTANCE_NO_EXTERNAL_IP" => Self::RedisInstanceNoExternalIp,
13514 "REDIS_INSTANCE_UNSUPPORTED_PROTOCOL" => Self::RedisInstanceUnsupportedProtocol,
13515 "DROPPED_INSIDE_REDIS_CLUSTER_SERVICE" => Self::DroppedInsideRedisClusterService,
13516 "REDIS_CLUSTER_UNSUPPORTED_PORT" => Self::RedisClusterUnsupportedPort,
13517 "REDIS_CLUSTER_NO_EXTERNAL_IP" => Self::RedisClusterNoExternalIp,
13518 "REDIS_CLUSTER_UNSUPPORTED_PROTOCOL" => Self::RedisClusterUnsupportedProtocol,
13519 "NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION" => Self::NoAdvertisedRouteToGcpDestination,
13520 "NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION" => Self::NoTrafficSelectorToGcpDestination,
13521 "NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION" => {
13522 Self::NoKnownRouteFromPeeredNetworkToDestination
13523 }
13524 "PRIVATE_NAT_TO_PSC_ENDPOINT_UNSUPPORTED" => {
13525 Self::PrivateNatToPscEndpointUnsupported
13526 }
13527 "PSC_PORT_MAPPING_PORT_MISMATCH" => Self::PscPortMappingPortMismatch,
13528 "PSC_PORT_MAPPING_WITHOUT_PSC_CONNECTION_UNSUPPORTED" => {
13529 Self::PscPortMappingWithoutPscConnectionUnsupported
13530 }
13531 "UNSUPPORTED_ROUTE_MATCHED_FOR_NAT64_DESTINATION" => {
13532 Self::UnsupportedRouteMatchedForNat64Destination
13533 }
13534 "TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED" => {
13535 Self::TrafficFromHybridEndpointToInternetDisallowed
13536 }
13537 "NO_MATCHING_NAT64_GATEWAY" => Self::NoMatchingNat64Gateway,
13538 "NO_CONFIGURED_PRIVATE_NAT64_RULE" => Self::NoConfiguredPrivateNat64Rule,
13539 "LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH" => {
13540 Self::LoadBalancerBackendIpVersionMismatch
13541 }
13542 "NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION" => {
13543 Self::NoKnownRouteFromNccNetworkToDestination
13544 }
13545 "CLOUD_NAT_PROTOCOL_UNSUPPORTED" => Self::CloudNatProtocolUnsupported,
13546 "L2_INTERCONNECT_UNSUPPORTED_PROTOCOL" => Self::L2InterconnectUnsupportedProtocol,
13547 "L2_INTERCONNECT_UNSUPPORTED_PORT" => Self::L2InterconnectUnsupportedPort,
13548 "L2_INTERCONNECT_DESTINATION_IP_MISMATCH" => {
13549 Self::L2InterconnectDestinationIpMismatch
13550 }
13551 "NCC_ROUTE_WITHIN_HYBRID_SUBNET_UNSUPPORTED" => {
13552 Self::NccRouteWithinHybridSubnetUnsupported
13553 }
13554 "HYBRID_SUBNET_REGION_MISMATCH" => Self::HybridSubnetRegionMismatch,
13555 "HYBRID_SUBNET_NO_ROUTE" => Self::HybridSubnetNoRoute,
13556 "GKE_NETWORK_POLICY" => Self::GkeNetworkPolicy,
13557 "NO_VALID_ROUTE_FROM_GOOGLE_MANAGED_NETWORK_TO_DESTINATION" => {
13558 Self::NoValidRouteFromGoogleManagedNetworkToDestination
13559 }
13560 _ => Self::UnknownValue(cause::UnknownValue(
13561 wkt::internal::UnknownEnumValue::String(value.to_string()),
13562 )),
13563 }
13564 }
13565 }
13566
13567 impl serde::ser::Serialize for Cause {
13568 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13569 where
13570 S: serde::Serializer,
13571 {
13572 match self {
13573 Self::Unspecified => serializer.serialize_i32(0),
13574 Self::UnknownExternalAddress => serializer.serialize_i32(1),
13575 Self::ForeignIpDisallowed => serializer.serialize_i32(2),
13576 Self::FirewallRule => serializer.serialize_i32(3),
13577 Self::NoRoute => serializer.serialize_i32(4),
13578 Self::RouteBlackhole => serializer.serialize_i32(5),
13579 Self::RouteWrongNetwork => serializer.serialize_i32(6),
13580 Self::RouteNextHopIpAddressNotResolved => serializer.serialize_i32(42),
13581 Self::RouteNextHopResourceNotFound => serializer.serialize_i32(43),
13582 Self::RouteNextHopInstanceWrongNetwork => serializer.serialize_i32(49),
13583 Self::RouteNextHopInstanceNonPrimaryIp => serializer.serialize_i32(50),
13584 Self::RouteNextHopForwardingRuleIpMismatch => serializer.serialize_i32(51),
13585 Self::RouteNextHopVpnTunnelNotEstablished => serializer.serialize_i32(52),
13586 Self::RouteNextHopForwardingRuleTypeInvalid => serializer.serialize_i32(53),
13587 Self::NoRouteFromInternetToPrivateIpv6Address => serializer.serialize_i32(44),
13588 Self::NoRouteFromInternetToPrivateIpv4Address => serializer.serialize_i32(109),
13589 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
13590 serializer.serialize_i32(98)
13591 }
13592 Self::VpnTunnelLocalSelectorMismatch => serializer.serialize_i32(45),
13593 Self::VpnTunnelRemoteSelectorMismatch => serializer.serialize_i32(46),
13594 Self::PrivateTrafficToInternet => serializer.serialize_i32(7),
13595 Self::PrivateGoogleAccessDisallowed => serializer.serialize_i32(8),
13596 Self::PrivateGoogleAccessViaVpnTunnelUnsupported => serializer.serialize_i32(47),
13597 Self::NoExternalAddress => serializer.serialize_i32(9),
13598 Self::UnknownInternalAddress => serializer.serialize_i32(10),
13599 Self::ForwardingRuleMismatch => serializer.serialize_i32(11),
13600 Self::ForwardingRuleNoInstances => serializer.serialize_i32(12),
13601 Self::FirewallBlockingLoadBalancerBackendHealthCheck => {
13602 serializer.serialize_i32(13)
13603 }
13604 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => {
13605 serializer.serialize_i32(85)
13606 }
13607 Self::InstanceNotRunning => serializer.serialize_i32(14),
13608 Self::GkeClusterNotRunning => serializer.serialize_i32(27),
13609 Self::GkePodNotRunning => serializer.serialize_i32(103),
13610 Self::CloudSqlInstanceNotRunning => serializer.serialize_i32(28),
13611 Self::RedisInstanceNotRunning => serializer.serialize_i32(68),
13612 Self::RedisClusterNotRunning => serializer.serialize_i32(69),
13613 Self::TrafficTypeBlocked => serializer.serialize_i32(15),
13614 Self::GkeMasterUnauthorizedAccess => serializer.serialize_i32(16),
13615 Self::CloudSqlInstanceUnauthorizedAccess => serializer.serialize_i32(17),
13616 Self::DroppedInsideGkeService => serializer.serialize_i32(18),
13617 Self::DroppedInsideCloudSqlService => serializer.serialize_i32(19),
13618 Self::GoogleManagedServiceNoPeering => serializer.serialize_i32(20),
13619 Self::GoogleManagedServiceNoPscEndpoint => serializer.serialize_i32(38),
13620 Self::GkePscEndpointMissing => serializer.serialize_i32(36),
13621 Self::CloudSqlInstanceNoIpAddress => serializer.serialize_i32(21),
13622 Self::GkeControlPlaneRegionMismatch => serializer.serialize_i32(30),
13623 Self::PublicGkeControlPlaneToPrivateDestination => serializer.serialize_i32(31),
13624 Self::GkeControlPlaneNoRoute => serializer.serialize_i32(32),
13625 Self::CloudSqlInstanceNotConfiguredForExternalTraffic => {
13626 serializer.serialize_i32(33)
13627 }
13628 Self::PublicCloudSqlInstanceToPrivateDestination => serializer.serialize_i32(34),
13629 Self::CloudSqlInstanceNoRoute => serializer.serialize_i32(35),
13630 Self::CloudSqlConnectorRequired => serializer.serialize_i32(63),
13631 Self::CloudFunctionNotActive => serializer.serialize_i32(22),
13632 Self::VpcConnectorNotSet => serializer.serialize_i32(23),
13633 Self::VpcConnectorNotRunning => serializer.serialize_i32(24),
13634 Self::VpcConnectorServerlessTrafficBlocked => serializer.serialize_i32(60),
13635 Self::VpcConnectorHealthCheckTrafficBlocked => serializer.serialize_i32(61),
13636 Self::ForwardingRuleRegionMismatch => serializer.serialize_i32(25),
13637 Self::PscConnectionNotAccepted => serializer.serialize_i32(26),
13638 Self::PscEndpointAccessedFromPeeredNetwork => serializer.serialize_i32(41),
13639 Self::PscNegProducerEndpointNoGlobalAccess => serializer.serialize_i32(48),
13640 Self::PscNegProducerForwardingRuleMultiplePorts => serializer.serialize_i32(54),
13641 Self::CloudSqlPscNegUnsupported => serializer.serialize_i32(58),
13642 Self::NoNatSubnetsForPscServiceAttachment => serializer.serialize_i32(57),
13643 Self::PscTransitivityNotPropagated => serializer.serialize_i32(64),
13644 Self::HybridNegNonDynamicRouteMatched => serializer.serialize_i32(55),
13645 Self::HybridNegNonLocalDynamicRouteMatched => serializer.serialize_i32(56),
13646 Self::CloudRunRevisionNotReady => serializer.serialize_i32(29),
13647 Self::DroppedInsidePscServiceProducer => serializer.serialize_i32(37),
13648 Self::LoadBalancerHasNoProxySubnet => serializer.serialize_i32(39),
13649 Self::CloudNatNoAddresses => serializer.serialize_i32(40),
13650 Self::RoutingLoop => serializer.serialize_i32(59),
13651 Self::DroppedInsideGoogleManagedService => serializer.serialize_i32(62),
13652 Self::LoadBalancerBackendInvalidNetwork => serializer.serialize_i32(65),
13653 Self::BackendServiceNamedPortNotDefined => serializer.serialize_i32(66),
13654 Self::DestinationIsPrivateNatIpRange => serializer.serialize_i32(67),
13655 Self::DroppedInsideRedisInstanceService => serializer.serialize_i32(70),
13656 Self::RedisInstanceUnsupportedPort => serializer.serialize_i32(71),
13657 Self::RedisInstanceConnectingFromPupiAddress => serializer.serialize_i32(72),
13658 Self::RedisInstanceNoRouteToDestinationNetwork => serializer.serialize_i32(73),
13659 Self::RedisInstanceNoExternalIp => serializer.serialize_i32(74),
13660 Self::RedisInstanceUnsupportedProtocol => serializer.serialize_i32(78),
13661 Self::DroppedInsideRedisClusterService => serializer.serialize_i32(75),
13662 Self::RedisClusterUnsupportedPort => serializer.serialize_i32(76),
13663 Self::RedisClusterNoExternalIp => serializer.serialize_i32(77),
13664 Self::RedisClusterUnsupportedProtocol => serializer.serialize_i32(79),
13665 Self::NoAdvertisedRouteToGcpDestination => serializer.serialize_i32(80),
13666 Self::NoTrafficSelectorToGcpDestination => serializer.serialize_i32(81),
13667 Self::NoKnownRouteFromPeeredNetworkToDestination => serializer.serialize_i32(82),
13668 Self::PrivateNatToPscEndpointUnsupported => serializer.serialize_i32(83),
13669 Self::PscPortMappingPortMismatch => serializer.serialize_i32(86),
13670 Self::PscPortMappingWithoutPscConnectionUnsupported => serializer.serialize_i32(87),
13671 Self::UnsupportedRouteMatchedForNat64Destination => serializer.serialize_i32(88),
13672 Self::TrafficFromHybridEndpointToInternetDisallowed => serializer.serialize_i32(89),
13673 Self::NoMatchingNat64Gateway => serializer.serialize_i32(90),
13674 Self::NoConfiguredPrivateNat64Rule => serializer.serialize_i32(107),
13675 Self::LoadBalancerBackendIpVersionMismatch => serializer.serialize_i32(96),
13676 Self::NoKnownRouteFromNccNetworkToDestination => serializer.serialize_i32(97),
13677 Self::CloudNatProtocolUnsupported => serializer.serialize_i32(99),
13678 Self::L2InterconnectUnsupportedProtocol => serializer.serialize_i32(100),
13679 Self::L2InterconnectUnsupportedPort => serializer.serialize_i32(101),
13680 Self::L2InterconnectDestinationIpMismatch => serializer.serialize_i32(102),
13681 Self::NccRouteWithinHybridSubnetUnsupported => serializer.serialize_i32(104),
13682 Self::HybridSubnetRegionMismatch => serializer.serialize_i32(105),
13683 Self::HybridSubnetNoRoute => serializer.serialize_i32(106),
13684 Self::GkeNetworkPolicy => serializer.serialize_i32(108),
13685 Self::NoValidRouteFromGoogleManagedNetworkToDestination => {
13686 serializer.serialize_i32(110)
13687 }
13688 Self::UnknownValue(u) => u.0.serialize(serializer),
13689 }
13690 }
13691 }
13692
13693 impl<'de> serde::de::Deserialize<'de> for Cause {
13694 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13695 where
13696 D: serde::Deserializer<'de>,
13697 {
13698 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Cause>::new(
13699 ".google.cloud.networkmanagement.v1.DropInfo.Cause",
13700 ))
13701 }
13702 }
13703}
13704
13705/// For display only. Metadata associated with a Google Kubernetes Engine (GKE)
13706/// cluster master.
13707#[derive(Clone, Default, PartialEq)]
13708#[non_exhaustive]
13709pub struct GKEMasterInfo {
13710 /// URI of a GKE cluster.
13711 pub cluster_uri: std::string::String,
13712
13713 /// URI of a GKE cluster network.
13714 pub cluster_network_uri: std::string::String,
13715
13716 /// Internal IP address of a GKE cluster control plane.
13717 pub internal_ip: std::string::String,
13718
13719 /// External IP address of a GKE cluster control plane.
13720 pub external_ip: std::string::String,
13721
13722 /// DNS endpoint of a GKE cluster control plane.
13723 pub dns_endpoint: std::string::String,
13724
13725 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13726}
13727
13728impl GKEMasterInfo {
13729 /// Creates a new default instance.
13730 pub fn new() -> Self {
13731 std::default::Default::default()
13732 }
13733
13734 /// Sets the value of [cluster_uri][crate::model::GKEMasterInfo::cluster_uri].
13735 ///
13736 /// # Example
13737 /// ```ignore,no_run
13738 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13739 /// let x = GKEMasterInfo::new().set_cluster_uri("example");
13740 /// ```
13741 pub fn set_cluster_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13742 self.cluster_uri = v.into();
13743 self
13744 }
13745
13746 /// Sets the value of [cluster_network_uri][crate::model::GKEMasterInfo::cluster_network_uri].
13747 ///
13748 /// # Example
13749 /// ```ignore,no_run
13750 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13751 /// let x = GKEMasterInfo::new().set_cluster_network_uri("example");
13752 /// ```
13753 pub fn set_cluster_network_uri<T: std::convert::Into<std::string::String>>(
13754 mut self,
13755 v: T,
13756 ) -> Self {
13757 self.cluster_network_uri = v.into();
13758 self
13759 }
13760
13761 /// Sets the value of [internal_ip][crate::model::GKEMasterInfo::internal_ip].
13762 ///
13763 /// # Example
13764 /// ```ignore,no_run
13765 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13766 /// let x = GKEMasterInfo::new().set_internal_ip("example");
13767 /// ```
13768 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13769 self.internal_ip = v.into();
13770 self
13771 }
13772
13773 /// Sets the value of [external_ip][crate::model::GKEMasterInfo::external_ip].
13774 ///
13775 /// # Example
13776 /// ```ignore,no_run
13777 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13778 /// let x = GKEMasterInfo::new().set_external_ip("example");
13779 /// ```
13780 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13781 self.external_ip = v.into();
13782 self
13783 }
13784
13785 /// Sets the value of [dns_endpoint][crate::model::GKEMasterInfo::dns_endpoint].
13786 ///
13787 /// # Example
13788 /// ```ignore,no_run
13789 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
13790 /// let x = GKEMasterInfo::new().set_dns_endpoint("example");
13791 /// ```
13792 pub fn set_dns_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13793 self.dns_endpoint = v.into();
13794 self
13795 }
13796}
13797
13798impl wkt::message::Message for GKEMasterInfo {
13799 fn typename() -> &'static str {
13800 "type.googleapis.com/google.cloud.networkmanagement.v1.GKEMasterInfo"
13801 }
13802}
13803
13804/// For display only. Metadata associated with a Google Kubernetes Engine (GKE)
13805/// Pod.
13806#[derive(Clone, Default, PartialEq)]
13807#[non_exhaustive]
13808pub struct GkePodInfo {
13809 /// URI of a GKE Pod.
13810 /// For Pods in regional Clusters, the URI format is:
13811 /// `projects/{project}/locations/{location}/clusters/{cluster}/k8s/namespaces/{namespace}/pods/{pod}`
13812 /// For Pods in zonal Clusters, the URI format is:
13813 /// `projects/{project}/zones/{zone}/clusters/{cluster}/k8s/namespaces/{namespace}/pods/{pod}`
13814 pub pod_uri: std::string::String,
13815
13816 /// IP address of a GKE Pod. If the Pod is dual-stack, this is the IP address
13817 /// relevant to the trace.
13818 pub ip_address: std::string::String,
13819
13820 /// URI of the network containing the GKE Pod.
13821 pub network_uri: std::string::String,
13822
13823 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13824}
13825
13826impl GkePodInfo {
13827 /// Creates a new default instance.
13828 pub fn new() -> Self {
13829 std::default::Default::default()
13830 }
13831
13832 /// Sets the value of [pod_uri][crate::model::GkePodInfo::pod_uri].
13833 ///
13834 /// # Example
13835 /// ```ignore,no_run
13836 /// # use google_cloud_networkmanagement_v1::model::GkePodInfo;
13837 /// let x = GkePodInfo::new().set_pod_uri("example");
13838 /// ```
13839 pub fn set_pod_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13840 self.pod_uri = v.into();
13841 self
13842 }
13843
13844 /// Sets the value of [ip_address][crate::model::GkePodInfo::ip_address].
13845 ///
13846 /// # Example
13847 /// ```ignore,no_run
13848 /// # use google_cloud_networkmanagement_v1::model::GkePodInfo;
13849 /// let x = GkePodInfo::new().set_ip_address("example");
13850 /// ```
13851 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13852 self.ip_address = v.into();
13853 self
13854 }
13855
13856 /// Sets the value of [network_uri][crate::model::GkePodInfo::network_uri].
13857 ///
13858 /// # Example
13859 /// ```ignore,no_run
13860 /// # use google_cloud_networkmanagement_v1::model::GkePodInfo;
13861 /// let x = GkePodInfo::new().set_network_uri("example");
13862 /// ```
13863 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13864 self.network_uri = v.into();
13865 self
13866 }
13867}
13868
13869impl wkt::message::Message for GkePodInfo {
13870 fn typename() -> &'static str {
13871 "type.googleapis.com/google.cloud.networkmanagement.v1.GkePodInfo"
13872 }
13873}
13874
13875/// For display only. Contains information about why IP masquerading was skipped
13876/// for the packet.
13877#[derive(Clone, Default, PartialEq)]
13878#[non_exhaustive]
13879pub struct IpMasqueradingSkippedInfo {
13880 /// Reason why IP masquerading was not applied.
13881 pub reason: crate::model::ip_masquerading_skipped_info::Reason,
13882
13883 /// The matched non-masquerade IP range. Only set if reason is
13884 /// DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE or
13885 /// DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE.
13886 pub non_masquerade_range: std::string::String,
13887
13888 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13889}
13890
13891impl IpMasqueradingSkippedInfo {
13892 /// Creates a new default instance.
13893 pub fn new() -> Self {
13894 std::default::Default::default()
13895 }
13896
13897 /// Sets the value of [reason][crate::model::IpMasqueradingSkippedInfo::reason].
13898 ///
13899 /// # Example
13900 /// ```ignore,no_run
13901 /// # use google_cloud_networkmanagement_v1::model::IpMasqueradingSkippedInfo;
13902 /// use google_cloud_networkmanagement_v1::model::ip_masquerading_skipped_info::Reason;
13903 /// let x0 = IpMasqueradingSkippedInfo::new().set_reason(Reason::DestinationIpInConfiguredNonMasqueradeRange);
13904 /// let x1 = IpMasqueradingSkippedInfo::new().set_reason(Reason::DestinationIpInDefaultNonMasqueradeRange);
13905 /// let x2 = IpMasqueradingSkippedInfo::new().set_reason(Reason::DestinationOnSameNode);
13906 /// ```
13907 pub fn set_reason<T: std::convert::Into<crate::model::ip_masquerading_skipped_info::Reason>>(
13908 mut self,
13909 v: T,
13910 ) -> Self {
13911 self.reason = v.into();
13912 self
13913 }
13914
13915 /// Sets the value of [non_masquerade_range][crate::model::IpMasqueradingSkippedInfo::non_masquerade_range].
13916 ///
13917 /// # Example
13918 /// ```ignore,no_run
13919 /// # use google_cloud_networkmanagement_v1::model::IpMasqueradingSkippedInfo;
13920 /// let x = IpMasqueradingSkippedInfo::new().set_non_masquerade_range("example");
13921 /// ```
13922 pub fn set_non_masquerade_range<T: std::convert::Into<std::string::String>>(
13923 mut self,
13924 v: T,
13925 ) -> Self {
13926 self.non_masquerade_range = v.into();
13927 self
13928 }
13929}
13930
13931impl wkt::message::Message for IpMasqueradingSkippedInfo {
13932 fn typename() -> &'static str {
13933 "type.googleapis.com/google.cloud.networkmanagement.v1.IpMasqueradingSkippedInfo"
13934 }
13935}
13936
13937/// Defines additional types related to [IpMasqueradingSkippedInfo].
13938pub mod ip_masquerading_skipped_info {
13939 #[allow(unused_imports)]
13940 use super::*;
13941
13942 /// Reason why IP masquerading was skipped.
13943 ///
13944 /// # Working with unknown values
13945 ///
13946 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13947 /// additional enum variants at any time. Adding new variants is not considered
13948 /// a breaking change. Applications should write their code in anticipation of:
13949 ///
13950 /// - New values appearing in future releases of the client library, **and**
13951 /// - New values received dynamically, without application changes.
13952 ///
13953 /// Please consult the [Working with enums] section in the user guide for some
13954 /// guidelines.
13955 ///
13956 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13957 #[derive(Clone, Debug, PartialEq)]
13958 #[non_exhaustive]
13959 pub enum Reason {
13960 /// Unused default value.
13961 Unspecified,
13962 /// Masquerading not applied because destination IP is in one of configured
13963 /// non-masquerade ranges.
13964 DestinationIpInConfiguredNonMasqueradeRange,
13965 /// Masquerading not applied because destination IP is in one of default
13966 /// non-masquerade ranges.
13967 DestinationIpInDefaultNonMasqueradeRange,
13968 /// Masquerading not applied because destination is on the same Node.
13969 DestinationOnSameNode,
13970 /// Masquerading not applied because ip-masq-agent doesn't exist and default
13971 /// SNAT is disabled.
13972 DefaultSnatDisabled,
13973 /// Masquerading not applied because the packet's IP version is IPv6.
13974 NoMasqueradingForIpv6,
13975 /// Masquerading not applied because the source Pod uses the host Node's
13976 /// network namespace, including the Node's IP address.
13977 PodUsesNodeNetworkNamespace,
13978 /// Masquerading not applied because the packet is a return packet.
13979 NoMasqueradingForReturnPacket,
13980 /// If set, the enum was initialized with an unknown value.
13981 ///
13982 /// Applications can examine the value using [Reason::value] or
13983 /// [Reason::name].
13984 UnknownValue(reason::UnknownValue),
13985 }
13986
13987 #[doc(hidden)]
13988 pub mod reason {
13989 #[allow(unused_imports)]
13990 use super::*;
13991 #[derive(Clone, Debug, PartialEq)]
13992 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13993 }
13994
13995 impl Reason {
13996 /// Gets the enum value.
13997 ///
13998 /// Returns `None` if the enum contains an unknown value deserialized from
13999 /// the string representation of enums.
14000 pub fn value(&self) -> std::option::Option<i32> {
14001 match self {
14002 Self::Unspecified => std::option::Option::Some(0),
14003 Self::DestinationIpInConfiguredNonMasqueradeRange => std::option::Option::Some(1),
14004 Self::DestinationIpInDefaultNonMasqueradeRange => std::option::Option::Some(2),
14005 Self::DestinationOnSameNode => std::option::Option::Some(3),
14006 Self::DefaultSnatDisabled => std::option::Option::Some(4),
14007 Self::NoMasqueradingForIpv6 => std::option::Option::Some(5),
14008 Self::PodUsesNodeNetworkNamespace => std::option::Option::Some(6),
14009 Self::NoMasqueradingForReturnPacket => std::option::Option::Some(7),
14010 Self::UnknownValue(u) => u.0.value(),
14011 }
14012 }
14013
14014 /// Gets the enum value as a string.
14015 ///
14016 /// Returns `None` if the enum contains an unknown value deserialized from
14017 /// the integer representation of enums.
14018 pub fn name(&self) -> std::option::Option<&str> {
14019 match self {
14020 Self::Unspecified => std::option::Option::Some("REASON_UNSPECIFIED"),
14021 Self::DestinationIpInConfiguredNonMasqueradeRange => {
14022 std::option::Option::Some("DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE")
14023 }
14024 Self::DestinationIpInDefaultNonMasqueradeRange => {
14025 std::option::Option::Some("DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE")
14026 }
14027 Self::DestinationOnSameNode => {
14028 std::option::Option::Some("DESTINATION_ON_SAME_NODE")
14029 }
14030 Self::DefaultSnatDisabled => std::option::Option::Some("DEFAULT_SNAT_DISABLED"),
14031 Self::NoMasqueradingForIpv6 => {
14032 std::option::Option::Some("NO_MASQUERADING_FOR_IPV6")
14033 }
14034 Self::PodUsesNodeNetworkNamespace => {
14035 std::option::Option::Some("POD_USES_NODE_NETWORK_NAMESPACE")
14036 }
14037 Self::NoMasqueradingForReturnPacket => {
14038 std::option::Option::Some("NO_MASQUERADING_FOR_RETURN_PACKET")
14039 }
14040 Self::UnknownValue(u) => u.0.name(),
14041 }
14042 }
14043 }
14044
14045 impl std::default::Default for Reason {
14046 fn default() -> Self {
14047 use std::convert::From;
14048 Self::from(0)
14049 }
14050 }
14051
14052 impl std::fmt::Display for Reason {
14053 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14054 wkt::internal::display_enum(f, self.name(), self.value())
14055 }
14056 }
14057
14058 impl std::convert::From<i32> for Reason {
14059 fn from(value: i32) -> Self {
14060 match value {
14061 0 => Self::Unspecified,
14062 1 => Self::DestinationIpInConfiguredNonMasqueradeRange,
14063 2 => Self::DestinationIpInDefaultNonMasqueradeRange,
14064 3 => Self::DestinationOnSameNode,
14065 4 => Self::DefaultSnatDisabled,
14066 5 => Self::NoMasqueradingForIpv6,
14067 6 => Self::PodUsesNodeNetworkNamespace,
14068 7 => Self::NoMasqueradingForReturnPacket,
14069 _ => Self::UnknownValue(reason::UnknownValue(
14070 wkt::internal::UnknownEnumValue::Integer(value),
14071 )),
14072 }
14073 }
14074 }
14075
14076 impl std::convert::From<&str> for Reason {
14077 fn from(value: &str) -> Self {
14078 use std::string::ToString;
14079 match value {
14080 "REASON_UNSPECIFIED" => Self::Unspecified,
14081 "DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE" => {
14082 Self::DestinationIpInConfiguredNonMasqueradeRange
14083 }
14084 "DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE" => {
14085 Self::DestinationIpInDefaultNonMasqueradeRange
14086 }
14087 "DESTINATION_ON_SAME_NODE" => Self::DestinationOnSameNode,
14088 "DEFAULT_SNAT_DISABLED" => Self::DefaultSnatDisabled,
14089 "NO_MASQUERADING_FOR_IPV6" => Self::NoMasqueradingForIpv6,
14090 "POD_USES_NODE_NETWORK_NAMESPACE" => Self::PodUsesNodeNetworkNamespace,
14091 "NO_MASQUERADING_FOR_RETURN_PACKET" => Self::NoMasqueradingForReturnPacket,
14092 _ => Self::UnknownValue(reason::UnknownValue(
14093 wkt::internal::UnknownEnumValue::String(value.to_string()),
14094 )),
14095 }
14096 }
14097 }
14098
14099 impl serde::ser::Serialize for Reason {
14100 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14101 where
14102 S: serde::Serializer,
14103 {
14104 match self {
14105 Self::Unspecified => serializer.serialize_i32(0),
14106 Self::DestinationIpInConfiguredNonMasqueradeRange => serializer.serialize_i32(1),
14107 Self::DestinationIpInDefaultNonMasqueradeRange => serializer.serialize_i32(2),
14108 Self::DestinationOnSameNode => serializer.serialize_i32(3),
14109 Self::DefaultSnatDisabled => serializer.serialize_i32(4),
14110 Self::NoMasqueradingForIpv6 => serializer.serialize_i32(5),
14111 Self::PodUsesNodeNetworkNamespace => serializer.serialize_i32(6),
14112 Self::NoMasqueradingForReturnPacket => serializer.serialize_i32(7),
14113 Self::UnknownValue(u) => u.0.serialize(serializer),
14114 }
14115 }
14116 }
14117
14118 impl<'de> serde::de::Deserialize<'de> for Reason {
14119 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14120 where
14121 D: serde::Deserializer<'de>,
14122 {
14123 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Reason>::new(
14124 ".google.cloud.networkmanagement.v1.IpMasqueradingSkippedInfo.Reason",
14125 ))
14126 }
14127 }
14128}
14129
14130/// For display only. Metadata associated with a GKE Network Policy.
14131#[derive(Clone, Default, PartialEq)]
14132#[non_exhaustive]
14133pub struct GkeNetworkPolicyInfo {
14134 /// The name of the Network Policy.
14135 pub display_name: std::string::String,
14136
14137 /// The URI of the Network Policy.
14138 /// Format for a Network Policy in a zonal cluster:
14139 /// `projects/<project_id>/zones/<zone>/clusters/<cluster>/k8s/namespaces/<namespace>/networking.k8s.io/networkpolicies/<networkpolicy>`
14140 /// Format for a Network Policy in a regional cluster:
14141 /// `projects/<project_id>/locations/<location>/clusters/<cluster>/k8s/namespaces/<namespace>/networking.k8s.io/networkpolicies/<networkpolicy>`
14142 pub uri: std::string::String,
14143
14144 /// Possible values: INGRESS, EGRESS
14145 pub direction: std::string::String,
14146
14147 /// Possible values: ALLOW, DENY
14148 pub action: std::string::String,
14149
14150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14151}
14152
14153impl GkeNetworkPolicyInfo {
14154 /// Creates a new default instance.
14155 pub fn new() -> Self {
14156 std::default::Default::default()
14157 }
14158
14159 /// Sets the value of [display_name][crate::model::GkeNetworkPolicyInfo::display_name].
14160 ///
14161 /// # Example
14162 /// ```ignore,no_run
14163 /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
14164 /// let x = GkeNetworkPolicyInfo::new().set_display_name("example");
14165 /// ```
14166 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14167 self.display_name = v.into();
14168 self
14169 }
14170
14171 /// Sets the value of [uri][crate::model::GkeNetworkPolicyInfo::uri].
14172 ///
14173 /// # Example
14174 /// ```ignore,no_run
14175 /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
14176 /// let x = GkeNetworkPolicyInfo::new().set_uri("example");
14177 /// ```
14178 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14179 self.uri = v.into();
14180 self
14181 }
14182
14183 /// Sets the value of [direction][crate::model::GkeNetworkPolicyInfo::direction].
14184 ///
14185 /// # Example
14186 /// ```ignore,no_run
14187 /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
14188 /// let x = GkeNetworkPolicyInfo::new().set_direction("example");
14189 /// ```
14190 pub fn set_direction<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14191 self.direction = v.into();
14192 self
14193 }
14194
14195 /// Sets the value of [action][crate::model::GkeNetworkPolicyInfo::action].
14196 ///
14197 /// # Example
14198 /// ```ignore,no_run
14199 /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
14200 /// let x = GkeNetworkPolicyInfo::new().set_action("example");
14201 /// ```
14202 pub fn set_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14203 self.action = v.into();
14204 self
14205 }
14206}
14207
14208impl wkt::message::Message for GkeNetworkPolicyInfo {
14209 fn typename() -> &'static str {
14210 "type.googleapis.com/google.cloud.networkmanagement.v1.GkeNetworkPolicyInfo"
14211 }
14212}
14213
14214/// For display only. Contains information about why GKE Network Policy
14215/// evaluation was skipped.
14216#[derive(Clone, Default, PartialEq)]
14217#[non_exhaustive]
14218pub struct GkeNetworkPolicySkippedInfo {
14219 /// Reason why Network Policy evaluation was skipped.
14220 pub reason: crate::model::gke_network_policy_skipped_info::Reason,
14221
14222 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14223}
14224
14225impl GkeNetworkPolicySkippedInfo {
14226 /// Creates a new default instance.
14227 pub fn new() -> Self {
14228 std::default::Default::default()
14229 }
14230
14231 /// Sets the value of [reason][crate::model::GkeNetworkPolicySkippedInfo::reason].
14232 ///
14233 /// # Example
14234 /// ```ignore,no_run
14235 /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicySkippedInfo;
14236 /// use google_cloud_networkmanagement_v1::model::gke_network_policy_skipped_info::Reason;
14237 /// let x0 = GkeNetworkPolicySkippedInfo::new().set_reason(Reason::NetworkPolicyDisabled);
14238 /// let x1 = GkeNetworkPolicySkippedInfo::new().set_reason(Reason::IngressSourceOnSameNode);
14239 /// let x2 = GkeNetworkPolicySkippedInfo::new().set_reason(Reason::EgressFromNodeNetworkNamespacePod);
14240 /// ```
14241 pub fn set_reason<
14242 T: std::convert::Into<crate::model::gke_network_policy_skipped_info::Reason>,
14243 >(
14244 mut self,
14245 v: T,
14246 ) -> Self {
14247 self.reason = v.into();
14248 self
14249 }
14250}
14251
14252impl wkt::message::Message for GkeNetworkPolicySkippedInfo {
14253 fn typename() -> &'static str {
14254 "type.googleapis.com/google.cloud.networkmanagement.v1.GkeNetworkPolicySkippedInfo"
14255 }
14256}
14257
14258/// Defines additional types related to [GkeNetworkPolicySkippedInfo].
14259pub mod gke_network_policy_skipped_info {
14260 #[allow(unused_imports)]
14261 use super::*;
14262
14263 /// Enum for [Reason].
14264 ///
14265 /// # Working with unknown values
14266 ///
14267 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14268 /// additional enum variants at any time. Adding new variants is not considered
14269 /// a breaking change. Applications should write their code in anticipation of:
14270 ///
14271 /// - New values appearing in future releases of the client library, **and**
14272 /// - New values received dynamically, without application changes.
14273 ///
14274 /// Please consult the [Working with enums] section in the user guide for some
14275 /// guidelines.
14276 ///
14277 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14278 #[derive(Clone, Debug, PartialEq)]
14279 #[non_exhaustive]
14280 pub enum Reason {
14281 /// Unused default value.
14282 Unspecified,
14283 /// Network Policy is disabled on the cluster.
14284 NetworkPolicyDisabled,
14285 /// Ingress traffic to a Pod from a source on the same Node is always
14286 /// allowed.
14287 IngressSourceOnSameNode,
14288 /// Egress traffic from a Pod that uses the Node's network namespace is not
14289 /// subject to Network Policy.
14290 EgressFromNodeNetworkNamespacePod,
14291 /// Network Policy is not applied to response traffic. This is because GKE
14292 /// Network Policy evaluation is stateful in both GKE Dataplane V2 (eBPF) and
14293 /// legacy (iptables) implementations.
14294 NetworkPolicyNotAppliedToResponseTraffic,
14295 /// Network Policy evaluation is currently not supported for clusters with
14296 /// FQDN Network Policies enabled.
14297 NetworkPolicyAnalysisUnsupported,
14298 /// If set, the enum was initialized with an unknown value.
14299 ///
14300 /// Applications can examine the value using [Reason::value] or
14301 /// [Reason::name].
14302 UnknownValue(reason::UnknownValue),
14303 }
14304
14305 #[doc(hidden)]
14306 pub mod reason {
14307 #[allow(unused_imports)]
14308 use super::*;
14309 #[derive(Clone, Debug, PartialEq)]
14310 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14311 }
14312
14313 impl Reason {
14314 /// Gets the enum value.
14315 ///
14316 /// Returns `None` if the enum contains an unknown value deserialized from
14317 /// the string representation of enums.
14318 pub fn value(&self) -> std::option::Option<i32> {
14319 match self {
14320 Self::Unspecified => std::option::Option::Some(0),
14321 Self::NetworkPolicyDisabled => std::option::Option::Some(1),
14322 Self::IngressSourceOnSameNode => std::option::Option::Some(2),
14323 Self::EgressFromNodeNetworkNamespacePod => std::option::Option::Some(3),
14324 Self::NetworkPolicyNotAppliedToResponseTraffic => std::option::Option::Some(4),
14325 Self::NetworkPolicyAnalysisUnsupported => std::option::Option::Some(100),
14326 Self::UnknownValue(u) => u.0.value(),
14327 }
14328 }
14329
14330 /// Gets the enum value as a string.
14331 ///
14332 /// Returns `None` if the enum contains an unknown value deserialized from
14333 /// the integer representation of enums.
14334 pub fn name(&self) -> std::option::Option<&str> {
14335 match self {
14336 Self::Unspecified => std::option::Option::Some("REASON_UNSPECIFIED"),
14337 Self::NetworkPolicyDisabled => std::option::Option::Some("NETWORK_POLICY_DISABLED"),
14338 Self::IngressSourceOnSameNode => {
14339 std::option::Option::Some("INGRESS_SOURCE_ON_SAME_NODE")
14340 }
14341 Self::EgressFromNodeNetworkNamespacePod => {
14342 std::option::Option::Some("EGRESS_FROM_NODE_NETWORK_NAMESPACE_POD")
14343 }
14344 Self::NetworkPolicyNotAppliedToResponseTraffic => {
14345 std::option::Option::Some("NETWORK_POLICY_NOT_APPLIED_TO_RESPONSE_TRAFFIC")
14346 }
14347 Self::NetworkPolicyAnalysisUnsupported => {
14348 std::option::Option::Some("NETWORK_POLICY_ANALYSIS_UNSUPPORTED")
14349 }
14350 Self::UnknownValue(u) => u.0.name(),
14351 }
14352 }
14353 }
14354
14355 impl std::default::Default for Reason {
14356 fn default() -> Self {
14357 use std::convert::From;
14358 Self::from(0)
14359 }
14360 }
14361
14362 impl std::fmt::Display for Reason {
14363 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14364 wkt::internal::display_enum(f, self.name(), self.value())
14365 }
14366 }
14367
14368 impl std::convert::From<i32> for Reason {
14369 fn from(value: i32) -> Self {
14370 match value {
14371 0 => Self::Unspecified,
14372 1 => Self::NetworkPolicyDisabled,
14373 2 => Self::IngressSourceOnSameNode,
14374 3 => Self::EgressFromNodeNetworkNamespacePod,
14375 4 => Self::NetworkPolicyNotAppliedToResponseTraffic,
14376 100 => Self::NetworkPolicyAnalysisUnsupported,
14377 _ => Self::UnknownValue(reason::UnknownValue(
14378 wkt::internal::UnknownEnumValue::Integer(value),
14379 )),
14380 }
14381 }
14382 }
14383
14384 impl std::convert::From<&str> for Reason {
14385 fn from(value: &str) -> Self {
14386 use std::string::ToString;
14387 match value {
14388 "REASON_UNSPECIFIED" => Self::Unspecified,
14389 "NETWORK_POLICY_DISABLED" => Self::NetworkPolicyDisabled,
14390 "INGRESS_SOURCE_ON_SAME_NODE" => Self::IngressSourceOnSameNode,
14391 "EGRESS_FROM_NODE_NETWORK_NAMESPACE_POD" => Self::EgressFromNodeNetworkNamespacePod,
14392 "NETWORK_POLICY_NOT_APPLIED_TO_RESPONSE_TRAFFIC" => {
14393 Self::NetworkPolicyNotAppliedToResponseTraffic
14394 }
14395 "NETWORK_POLICY_ANALYSIS_UNSUPPORTED" => Self::NetworkPolicyAnalysisUnsupported,
14396 _ => Self::UnknownValue(reason::UnknownValue(
14397 wkt::internal::UnknownEnumValue::String(value.to_string()),
14398 )),
14399 }
14400 }
14401 }
14402
14403 impl serde::ser::Serialize for Reason {
14404 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14405 where
14406 S: serde::Serializer,
14407 {
14408 match self {
14409 Self::Unspecified => serializer.serialize_i32(0),
14410 Self::NetworkPolicyDisabled => serializer.serialize_i32(1),
14411 Self::IngressSourceOnSameNode => serializer.serialize_i32(2),
14412 Self::EgressFromNodeNetworkNamespacePod => serializer.serialize_i32(3),
14413 Self::NetworkPolicyNotAppliedToResponseTraffic => serializer.serialize_i32(4),
14414 Self::NetworkPolicyAnalysisUnsupported => serializer.serialize_i32(100),
14415 Self::UnknownValue(u) => u.0.serialize(serializer),
14416 }
14417 }
14418 }
14419
14420 impl<'de> serde::de::Deserialize<'de> for Reason {
14421 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14422 where
14423 D: serde::Deserializer<'de>,
14424 {
14425 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Reason>::new(
14426 ".google.cloud.networkmanagement.v1.GkeNetworkPolicySkippedInfo.Reason",
14427 ))
14428 }
14429 }
14430}
14431
14432/// For display only. Metadata associated with a Cloud SQL instance.
14433#[derive(Clone, Default, PartialEq)]
14434#[non_exhaustive]
14435pub struct CloudSQLInstanceInfo {
14436 /// Name of a Cloud SQL instance.
14437 pub display_name: std::string::String,
14438
14439 /// URI of a Cloud SQL instance.
14440 pub uri: std::string::String,
14441
14442 /// URI of a Cloud SQL instance network or empty string if the instance does
14443 /// not have one.
14444 pub network_uri: std::string::String,
14445
14446 /// Internal IP address of a Cloud SQL instance.
14447 pub internal_ip: std::string::String,
14448
14449 /// External IP address of a Cloud SQL instance.
14450 pub external_ip: std::string::String,
14451
14452 /// Region in which the Cloud SQL instance is running.
14453 pub region: std::string::String,
14454
14455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14456}
14457
14458impl CloudSQLInstanceInfo {
14459 /// Creates a new default instance.
14460 pub fn new() -> Self {
14461 std::default::Default::default()
14462 }
14463
14464 /// Sets the value of [display_name][crate::model::CloudSQLInstanceInfo::display_name].
14465 ///
14466 /// # Example
14467 /// ```ignore,no_run
14468 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14469 /// let x = CloudSQLInstanceInfo::new().set_display_name("example");
14470 /// ```
14471 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14472 self.display_name = v.into();
14473 self
14474 }
14475
14476 /// Sets the value of [uri][crate::model::CloudSQLInstanceInfo::uri].
14477 ///
14478 /// # Example
14479 /// ```ignore,no_run
14480 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14481 /// let x = CloudSQLInstanceInfo::new().set_uri("example");
14482 /// ```
14483 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14484 self.uri = v.into();
14485 self
14486 }
14487
14488 /// Sets the value of [network_uri][crate::model::CloudSQLInstanceInfo::network_uri].
14489 ///
14490 /// # Example
14491 /// ```ignore,no_run
14492 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14493 /// let x = CloudSQLInstanceInfo::new().set_network_uri("example");
14494 /// ```
14495 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14496 self.network_uri = v.into();
14497 self
14498 }
14499
14500 /// Sets the value of [internal_ip][crate::model::CloudSQLInstanceInfo::internal_ip].
14501 ///
14502 /// # Example
14503 /// ```ignore,no_run
14504 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14505 /// let x = CloudSQLInstanceInfo::new().set_internal_ip("example");
14506 /// ```
14507 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14508 self.internal_ip = v.into();
14509 self
14510 }
14511
14512 /// Sets the value of [external_ip][crate::model::CloudSQLInstanceInfo::external_ip].
14513 ///
14514 /// # Example
14515 /// ```ignore,no_run
14516 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14517 /// let x = CloudSQLInstanceInfo::new().set_external_ip("example");
14518 /// ```
14519 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14520 self.external_ip = v.into();
14521 self
14522 }
14523
14524 /// Sets the value of [region][crate::model::CloudSQLInstanceInfo::region].
14525 ///
14526 /// # Example
14527 /// ```ignore,no_run
14528 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14529 /// let x = CloudSQLInstanceInfo::new().set_region("example");
14530 /// ```
14531 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14532 self.region = v.into();
14533 self
14534 }
14535}
14536
14537impl wkt::message::Message for CloudSQLInstanceInfo {
14538 fn typename() -> &'static str {
14539 "type.googleapis.com/google.cloud.networkmanagement.v1.CloudSQLInstanceInfo"
14540 }
14541}
14542
14543/// For display only. Metadata associated with a Cloud Redis Instance.
14544#[derive(Clone, Default, PartialEq)]
14545#[non_exhaustive]
14546pub struct RedisInstanceInfo {
14547 /// Name of a Cloud Redis Instance.
14548 pub display_name: std::string::String,
14549
14550 /// URI of a Cloud Redis Instance.
14551 pub uri: std::string::String,
14552
14553 /// URI of a Cloud Redis Instance network.
14554 pub network_uri: std::string::String,
14555
14556 /// Primary endpoint IP address of a Cloud Redis Instance.
14557 pub primary_endpoint_ip: std::string::String,
14558
14559 /// Read endpoint IP address of a Cloud Redis Instance (if applicable).
14560 pub read_endpoint_ip: std::string::String,
14561
14562 /// Region in which the Cloud Redis Instance is defined.
14563 pub region: std::string::String,
14564
14565 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14566}
14567
14568impl RedisInstanceInfo {
14569 /// Creates a new default instance.
14570 pub fn new() -> Self {
14571 std::default::Default::default()
14572 }
14573
14574 /// Sets the value of [display_name][crate::model::RedisInstanceInfo::display_name].
14575 ///
14576 /// # Example
14577 /// ```ignore,no_run
14578 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14579 /// let x = RedisInstanceInfo::new().set_display_name("example");
14580 /// ```
14581 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14582 self.display_name = v.into();
14583 self
14584 }
14585
14586 /// Sets the value of [uri][crate::model::RedisInstanceInfo::uri].
14587 ///
14588 /// # Example
14589 /// ```ignore,no_run
14590 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14591 /// let x = RedisInstanceInfo::new().set_uri("example");
14592 /// ```
14593 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14594 self.uri = v.into();
14595 self
14596 }
14597
14598 /// Sets the value of [network_uri][crate::model::RedisInstanceInfo::network_uri].
14599 ///
14600 /// # Example
14601 /// ```ignore,no_run
14602 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14603 /// let x = RedisInstanceInfo::new().set_network_uri("example");
14604 /// ```
14605 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14606 self.network_uri = v.into();
14607 self
14608 }
14609
14610 /// Sets the value of [primary_endpoint_ip][crate::model::RedisInstanceInfo::primary_endpoint_ip].
14611 ///
14612 /// # Example
14613 /// ```ignore,no_run
14614 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14615 /// let x = RedisInstanceInfo::new().set_primary_endpoint_ip("example");
14616 /// ```
14617 pub fn set_primary_endpoint_ip<T: std::convert::Into<std::string::String>>(
14618 mut self,
14619 v: T,
14620 ) -> Self {
14621 self.primary_endpoint_ip = v.into();
14622 self
14623 }
14624
14625 /// Sets the value of [read_endpoint_ip][crate::model::RedisInstanceInfo::read_endpoint_ip].
14626 ///
14627 /// # Example
14628 /// ```ignore,no_run
14629 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14630 /// let x = RedisInstanceInfo::new().set_read_endpoint_ip("example");
14631 /// ```
14632 pub fn set_read_endpoint_ip<T: std::convert::Into<std::string::String>>(
14633 mut self,
14634 v: T,
14635 ) -> Self {
14636 self.read_endpoint_ip = v.into();
14637 self
14638 }
14639
14640 /// Sets the value of [region][crate::model::RedisInstanceInfo::region].
14641 ///
14642 /// # Example
14643 /// ```ignore,no_run
14644 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14645 /// let x = RedisInstanceInfo::new().set_region("example");
14646 /// ```
14647 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14648 self.region = v.into();
14649 self
14650 }
14651}
14652
14653impl wkt::message::Message for RedisInstanceInfo {
14654 fn typename() -> &'static str {
14655 "type.googleapis.com/google.cloud.networkmanagement.v1.RedisInstanceInfo"
14656 }
14657}
14658
14659/// For display only. Metadata associated with a Redis Cluster.
14660#[derive(Clone, Default, PartialEq)]
14661#[non_exhaustive]
14662pub struct RedisClusterInfo {
14663 /// Name of a Redis Cluster.
14664 pub display_name: std::string::String,
14665
14666 /// URI of a Redis Cluster in format
14667 /// "projects/{project_id}/locations/{location}/clusters/{cluster_id}"
14668 pub uri: std::string::String,
14669
14670 /// URI of the network containing the Redis Cluster endpoints in format
14671 /// "projects/{project_id}/global/networks/{network_id}".
14672 pub network_uri: std::string::String,
14673
14674 /// Discovery endpoint IP address of a Redis Cluster.
14675 pub discovery_endpoint_ip_address: std::string::String,
14676
14677 /// Secondary endpoint IP address of a Redis Cluster.
14678 pub secondary_endpoint_ip_address: std::string::String,
14679
14680 /// Name of the region in which the Redis Cluster is defined. For example,
14681 /// "us-central1".
14682 pub location: std::string::String,
14683
14684 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14685}
14686
14687impl RedisClusterInfo {
14688 /// Creates a new default instance.
14689 pub fn new() -> Self {
14690 std::default::Default::default()
14691 }
14692
14693 /// Sets the value of [display_name][crate::model::RedisClusterInfo::display_name].
14694 ///
14695 /// # Example
14696 /// ```ignore,no_run
14697 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14698 /// let x = RedisClusterInfo::new().set_display_name("example");
14699 /// ```
14700 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14701 self.display_name = v.into();
14702 self
14703 }
14704
14705 /// Sets the value of [uri][crate::model::RedisClusterInfo::uri].
14706 ///
14707 /// # Example
14708 /// ```ignore,no_run
14709 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14710 /// let x = RedisClusterInfo::new().set_uri("example");
14711 /// ```
14712 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14713 self.uri = v.into();
14714 self
14715 }
14716
14717 /// Sets the value of [network_uri][crate::model::RedisClusterInfo::network_uri].
14718 ///
14719 /// # Example
14720 /// ```ignore,no_run
14721 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14722 /// let x = RedisClusterInfo::new().set_network_uri("example");
14723 /// ```
14724 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14725 self.network_uri = v.into();
14726 self
14727 }
14728
14729 /// Sets the value of [discovery_endpoint_ip_address][crate::model::RedisClusterInfo::discovery_endpoint_ip_address].
14730 ///
14731 /// # Example
14732 /// ```ignore,no_run
14733 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14734 /// let x = RedisClusterInfo::new().set_discovery_endpoint_ip_address("example");
14735 /// ```
14736 pub fn set_discovery_endpoint_ip_address<T: std::convert::Into<std::string::String>>(
14737 mut self,
14738 v: T,
14739 ) -> Self {
14740 self.discovery_endpoint_ip_address = v.into();
14741 self
14742 }
14743
14744 /// Sets the value of [secondary_endpoint_ip_address][crate::model::RedisClusterInfo::secondary_endpoint_ip_address].
14745 ///
14746 /// # Example
14747 /// ```ignore,no_run
14748 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14749 /// let x = RedisClusterInfo::new().set_secondary_endpoint_ip_address("example");
14750 /// ```
14751 pub fn set_secondary_endpoint_ip_address<T: std::convert::Into<std::string::String>>(
14752 mut self,
14753 v: T,
14754 ) -> Self {
14755 self.secondary_endpoint_ip_address = v.into();
14756 self
14757 }
14758
14759 /// Sets the value of [location][crate::model::RedisClusterInfo::location].
14760 ///
14761 /// # Example
14762 /// ```ignore,no_run
14763 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
14764 /// let x = RedisClusterInfo::new().set_location("example");
14765 /// ```
14766 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14767 self.location = v.into();
14768 self
14769 }
14770}
14771
14772impl wkt::message::Message for RedisClusterInfo {
14773 fn typename() -> &'static str {
14774 "type.googleapis.com/google.cloud.networkmanagement.v1.RedisClusterInfo"
14775 }
14776}
14777
14778/// For display only. Metadata associated with a Cloud Function.
14779#[derive(Clone, Default, PartialEq)]
14780#[non_exhaustive]
14781pub struct CloudFunctionInfo {
14782 /// Name of a Cloud Function.
14783 pub display_name: std::string::String,
14784
14785 /// URI of a Cloud Function.
14786 pub uri: std::string::String,
14787
14788 /// Location in which the Cloud Function is deployed.
14789 pub location: std::string::String,
14790
14791 /// Latest successfully deployed version id of the Cloud Function.
14792 pub version_id: i64,
14793
14794 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14795}
14796
14797impl CloudFunctionInfo {
14798 /// Creates a new default instance.
14799 pub fn new() -> Self {
14800 std::default::Default::default()
14801 }
14802
14803 /// Sets the value of [display_name][crate::model::CloudFunctionInfo::display_name].
14804 ///
14805 /// # Example
14806 /// ```ignore,no_run
14807 /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
14808 /// let x = CloudFunctionInfo::new().set_display_name("example");
14809 /// ```
14810 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14811 self.display_name = v.into();
14812 self
14813 }
14814
14815 /// Sets the value of [uri][crate::model::CloudFunctionInfo::uri].
14816 ///
14817 /// # Example
14818 /// ```ignore,no_run
14819 /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
14820 /// let x = CloudFunctionInfo::new().set_uri("example");
14821 /// ```
14822 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14823 self.uri = v.into();
14824 self
14825 }
14826
14827 /// Sets the value of [location][crate::model::CloudFunctionInfo::location].
14828 ///
14829 /// # Example
14830 /// ```ignore,no_run
14831 /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
14832 /// let x = CloudFunctionInfo::new().set_location("example");
14833 /// ```
14834 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14835 self.location = v.into();
14836 self
14837 }
14838
14839 /// Sets the value of [version_id][crate::model::CloudFunctionInfo::version_id].
14840 ///
14841 /// # Example
14842 /// ```ignore,no_run
14843 /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
14844 /// let x = CloudFunctionInfo::new().set_version_id(42);
14845 /// ```
14846 pub fn set_version_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14847 self.version_id = v.into();
14848 self
14849 }
14850}
14851
14852impl wkt::message::Message for CloudFunctionInfo {
14853 fn typename() -> &'static str {
14854 "type.googleapis.com/google.cloud.networkmanagement.v1.CloudFunctionInfo"
14855 }
14856}
14857
14858/// For display only. Metadata associated with a Cloud Run revision.
14859#[derive(Clone, Default, PartialEq)]
14860#[non_exhaustive]
14861pub struct CloudRunRevisionInfo {
14862 /// Name of a Cloud Run revision.
14863 pub display_name: std::string::String,
14864
14865 /// URI of a Cloud Run revision.
14866 pub uri: std::string::String,
14867
14868 /// Location in which this revision is deployed.
14869 pub location: std::string::String,
14870
14871 /// URI of Cloud Run service this revision belongs to.
14872 pub service_uri: std::string::String,
14873
14874 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14875}
14876
14877impl CloudRunRevisionInfo {
14878 /// Creates a new default instance.
14879 pub fn new() -> Self {
14880 std::default::Default::default()
14881 }
14882
14883 /// Sets the value of [display_name][crate::model::CloudRunRevisionInfo::display_name].
14884 ///
14885 /// # Example
14886 /// ```ignore,no_run
14887 /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
14888 /// let x = CloudRunRevisionInfo::new().set_display_name("example");
14889 /// ```
14890 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14891 self.display_name = v.into();
14892 self
14893 }
14894
14895 /// Sets the value of [uri][crate::model::CloudRunRevisionInfo::uri].
14896 ///
14897 /// # Example
14898 /// ```ignore,no_run
14899 /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
14900 /// let x = CloudRunRevisionInfo::new().set_uri("example");
14901 /// ```
14902 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14903 self.uri = v.into();
14904 self
14905 }
14906
14907 /// Sets the value of [location][crate::model::CloudRunRevisionInfo::location].
14908 ///
14909 /// # Example
14910 /// ```ignore,no_run
14911 /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
14912 /// let x = CloudRunRevisionInfo::new().set_location("example");
14913 /// ```
14914 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14915 self.location = v.into();
14916 self
14917 }
14918
14919 /// Sets the value of [service_uri][crate::model::CloudRunRevisionInfo::service_uri].
14920 ///
14921 /// # Example
14922 /// ```ignore,no_run
14923 /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
14924 /// let x = CloudRunRevisionInfo::new().set_service_uri("example");
14925 /// ```
14926 pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14927 self.service_uri = v.into();
14928 self
14929 }
14930}
14931
14932impl wkt::message::Message for CloudRunRevisionInfo {
14933 fn typename() -> &'static str {
14934 "type.googleapis.com/google.cloud.networkmanagement.v1.CloudRunRevisionInfo"
14935 }
14936}
14937
14938/// For display only. Metadata associated with an App Engine version.
14939#[derive(Clone, Default, PartialEq)]
14940#[non_exhaustive]
14941pub struct AppEngineVersionInfo {
14942 /// Name of an App Engine version.
14943 pub display_name: std::string::String,
14944
14945 /// URI of an App Engine version.
14946 pub uri: std::string::String,
14947
14948 /// Runtime of the App Engine version.
14949 pub runtime: std::string::String,
14950
14951 /// App Engine execution environment for a version.
14952 pub environment: std::string::String,
14953
14954 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14955}
14956
14957impl AppEngineVersionInfo {
14958 /// Creates a new default instance.
14959 pub fn new() -> Self {
14960 std::default::Default::default()
14961 }
14962
14963 /// Sets the value of [display_name][crate::model::AppEngineVersionInfo::display_name].
14964 ///
14965 /// # Example
14966 /// ```ignore,no_run
14967 /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
14968 /// let x = AppEngineVersionInfo::new().set_display_name("example");
14969 /// ```
14970 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14971 self.display_name = v.into();
14972 self
14973 }
14974
14975 /// Sets the value of [uri][crate::model::AppEngineVersionInfo::uri].
14976 ///
14977 /// # Example
14978 /// ```ignore,no_run
14979 /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
14980 /// let x = AppEngineVersionInfo::new().set_uri("example");
14981 /// ```
14982 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14983 self.uri = v.into();
14984 self
14985 }
14986
14987 /// Sets the value of [runtime][crate::model::AppEngineVersionInfo::runtime].
14988 ///
14989 /// # Example
14990 /// ```ignore,no_run
14991 /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
14992 /// let x = AppEngineVersionInfo::new().set_runtime("example");
14993 /// ```
14994 pub fn set_runtime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14995 self.runtime = v.into();
14996 self
14997 }
14998
14999 /// Sets the value of [environment][crate::model::AppEngineVersionInfo::environment].
15000 ///
15001 /// # Example
15002 /// ```ignore,no_run
15003 /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
15004 /// let x = AppEngineVersionInfo::new().set_environment("example");
15005 /// ```
15006 pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15007 self.environment = v.into();
15008 self
15009 }
15010}
15011
15012impl wkt::message::Message for AppEngineVersionInfo {
15013 fn typename() -> &'static str {
15014 "type.googleapis.com/google.cloud.networkmanagement.v1.AppEngineVersionInfo"
15015 }
15016}
15017
15018/// For display only. Metadata associated with a VPC connector.
15019#[derive(Clone, Default, PartialEq)]
15020#[non_exhaustive]
15021pub struct VpcConnectorInfo {
15022 /// Name of a VPC connector.
15023 pub display_name: std::string::String,
15024
15025 /// URI of a VPC connector.
15026 pub uri: std::string::String,
15027
15028 /// Location in which the VPC connector is deployed.
15029 pub location: std::string::String,
15030
15031 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15032}
15033
15034impl VpcConnectorInfo {
15035 /// Creates a new default instance.
15036 pub fn new() -> Self {
15037 std::default::Default::default()
15038 }
15039
15040 /// Sets the value of [display_name][crate::model::VpcConnectorInfo::display_name].
15041 ///
15042 /// # Example
15043 /// ```ignore,no_run
15044 /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
15045 /// let x = VpcConnectorInfo::new().set_display_name("example");
15046 /// ```
15047 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15048 self.display_name = v.into();
15049 self
15050 }
15051
15052 /// Sets the value of [uri][crate::model::VpcConnectorInfo::uri].
15053 ///
15054 /// # Example
15055 /// ```ignore,no_run
15056 /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
15057 /// let x = VpcConnectorInfo::new().set_uri("example");
15058 /// ```
15059 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15060 self.uri = v.into();
15061 self
15062 }
15063
15064 /// Sets the value of [location][crate::model::VpcConnectorInfo::location].
15065 ///
15066 /// # Example
15067 /// ```ignore,no_run
15068 /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
15069 /// let x = VpcConnectorInfo::new().set_location("example");
15070 /// ```
15071 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15072 self.location = v.into();
15073 self
15074 }
15075}
15076
15077impl wkt::message::Message for VpcConnectorInfo {
15078 fn typename() -> &'static str {
15079 "type.googleapis.com/google.cloud.networkmanagement.v1.VpcConnectorInfo"
15080 }
15081}
15082
15083/// For display only. Metadata associated with a serverless direct VPC egress
15084/// connection.
15085#[derive(Clone, Default, PartialEq)]
15086#[non_exhaustive]
15087pub struct DirectVpcEgressConnectionInfo {
15088 /// URI of direct access network.
15089 pub network_uri: std::string::String,
15090
15091 /// URI of direct access subnetwork.
15092 pub subnetwork_uri: std::string::String,
15093
15094 /// Selected IP range.
15095 pub selected_ip_range: std::string::String,
15096
15097 /// Selected starting IP address, from the selected IP range.
15098 pub selected_ip_address: std::string::String,
15099
15100 /// Region in which the Direct VPC egress is deployed.
15101 pub region: std::string::String,
15102
15103 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15104}
15105
15106impl DirectVpcEgressConnectionInfo {
15107 /// Creates a new default instance.
15108 pub fn new() -> Self {
15109 std::default::Default::default()
15110 }
15111
15112 /// Sets the value of [network_uri][crate::model::DirectVpcEgressConnectionInfo::network_uri].
15113 ///
15114 /// # Example
15115 /// ```ignore,no_run
15116 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15117 /// let x = DirectVpcEgressConnectionInfo::new().set_network_uri("example");
15118 /// ```
15119 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15120 self.network_uri = v.into();
15121 self
15122 }
15123
15124 /// Sets the value of [subnetwork_uri][crate::model::DirectVpcEgressConnectionInfo::subnetwork_uri].
15125 ///
15126 /// # Example
15127 /// ```ignore,no_run
15128 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15129 /// let x = DirectVpcEgressConnectionInfo::new().set_subnetwork_uri("example");
15130 /// ```
15131 pub fn set_subnetwork_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15132 self.subnetwork_uri = v.into();
15133 self
15134 }
15135
15136 /// Sets the value of [selected_ip_range][crate::model::DirectVpcEgressConnectionInfo::selected_ip_range].
15137 ///
15138 /// # Example
15139 /// ```ignore,no_run
15140 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15141 /// let x = DirectVpcEgressConnectionInfo::new().set_selected_ip_range("example");
15142 /// ```
15143 pub fn set_selected_ip_range<T: std::convert::Into<std::string::String>>(
15144 mut self,
15145 v: T,
15146 ) -> Self {
15147 self.selected_ip_range = v.into();
15148 self
15149 }
15150
15151 /// Sets the value of [selected_ip_address][crate::model::DirectVpcEgressConnectionInfo::selected_ip_address].
15152 ///
15153 /// # Example
15154 /// ```ignore,no_run
15155 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15156 /// let x = DirectVpcEgressConnectionInfo::new().set_selected_ip_address("example");
15157 /// ```
15158 pub fn set_selected_ip_address<T: std::convert::Into<std::string::String>>(
15159 mut self,
15160 v: T,
15161 ) -> Self {
15162 self.selected_ip_address = v.into();
15163 self
15164 }
15165
15166 /// Sets the value of [region][crate::model::DirectVpcEgressConnectionInfo::region].
15167 ///
15168 /// # Example
15169 /// ```ignore,no_run
15170 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15171 /// let x = DirectVpcEgressConnectionInfo::new().set_region("example");
15172 /// ```
15173 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15174 self.region = v.into();
15175 self
15176 }
15177}
15178
15179impl wkt::message::Message for DirectVpcEgressConnectionInfo {
15180 fn typename() -> &'static str {
15181 "type.googleapis.com/google.cloud.networkmanagement.v1.DirectVpcEgressConnectionInfo"
15182 }
15183}
15184
15185/// For display only. Metadata associated with a serverless public connection.
15186#[derive(Clone, Default, PartialEq)]
15187#[non_exhaustive]
15188pub struct ServerlessExternalConnectionInfo {
15189 /// Selected starting IP address, from the Google dynamic address pool.
15190 pub selected_ip_address: std::string::String,
15191
15192 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15193}
15194
15195impl ServerlessExternalConnectionInfo {
15196 /// Creates a new default instance.
15197 pub fn new() -> Self {
15198 std::default::Default::default()
15199 }
15200
15201 /// Sets the value of [selected_ip_address][crate::model::ServerlessExternalConnectionInfo::selected_ip_address].
15202 ///
15203 /// # Example
15204 /// ```ignore,no_run
15205 /// # use google_cloud_networkmanagement_v1::model::ServerlessExternalConnectionInfo;
15206 /// let x = ServerlessExternalConnectionInfo::new().set_selected_ip_address("example");
15207 /// ```
15208 pub fn set_selected_ip_address<T: std::convert::Into<std::string::String>>(
15209 mut self,
15210 v: T,
15211 ) -> Self {
15212 self.selected_ip_address = v.into();
15213 self
15214 }
15215}
15216
15217impl wkt::message::Message for ServerlessExternalConnectionInfo {
15218 fn typename() -> &'static str {
15219 "type.googleapis.com/google.cloud.networkmanagement.v1.ServerlessExternalConnectionInfo"
15220 }
15221}
15222
15223/// For display only. Metadata associated with NAT.
15224#[derive(Clone, Default, PartialEq)]
15225#[non_exhaustive]
15226pub struct NatInfo {
15227 /// Type of NAT.
15228 pub r#type: crate::model::nat_info::Type,
15229
15230 /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
15231 pub protocol: std::string::String,
15232
15233 /// URI of the network where NAT translation takes place.
15234 pub network_uri: std::string::String,
15235
15236 /// Source IP address before NAT translation.
15237 pub old_source_ip: std::string::String,
15238
15239 /// Source IP address after NAT translation.
15240 pub new_source_ip: std::string::String,
15241
15242 /// Destination IP address before NAT translation.
15243 pub old_destination_ip: std::string::String,
15244
15245 /// Destination IP address after NAT translation.
15246 pub new_destination_ip: std::string::String,
15247
15248 /// Source port before NAT translation. Only valid when protocol is TCP or UDP.
15249 pub old_source_port: i32,
15250
15251 /// Source port after NAT translation. Only valid when protocol is TCP or UDP.
15252 pub new_source_port: i32,
15253
15254 /// Destination port before NAT translation. Only valid when protocol is TCP or
15255 /// UDP.
15256 pub old_destination_port: i32,
15257
15258 /// Destination port after NAT translation. Only valid when protocol is TCP or
15259 /// UDP.
15260 pub new_destination_port: i32,
15261
15262 /// Uri of the Cloud Router. Only valid when type is CLOUD_NAT.
15263 pub router_uri: std::string::String,
15264
15265 /// The name of Cloud NAT Gateway. Only valid when type is CLOUD_NAT.
15266 pub nat_gateway_name: std::string::String,
15267
15268 /// Type of Cloud NAT gateway. Only valid when `type` is CLOUD_NAT.
15269 pub cloud_nat_gateway_type: crate::model::nat_info::CloudNatGatewayType,
15270
15271 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15272}
15273
15274impl NatInfo {
15275 /// Creates a new default instance.
15276 pub fn new() -> Self {
15277 std::default::Default::default()
15278 }
15279
15280 /// Sets the value of [r#type][crate::model::NatInfo::type].
15281 ///
15282 /// # Example
15283 /// ```ignore,no_run
15284 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15285 /// use google_cloud_networkmanagement_v1::model::nat_info::Type;
15286 /// let x0 = NatInfo::new().set_type(Type::InternalToExternal);
15287 /// let x1 = NatInfo::new().set_type(Type::ExternalToInternal);
15288 /// let x2 = NatInfo::new().set_type(Type::CloudNat);
15289 /// ```
15290 pub fn set_type<T: std::convert::Into<crate::model::nat_info::Type>>(mut self, v: T) -> Self {
15291 self.r#type = v.into();
15292 self
15293 }
15294
15295 /// Sets the value of [protocol][crate::model::NatInfo::protocol].
15296 ///
15297 /// # Example
15298 /// ```ignore,no_run
15299 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15300 /// let x = NatInfo::new().set_protocol("example");
15301 /// ```
15302 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15303 self.protocol = v.into();
15304 self
15305 }
15306
15307 /// Sets the value of [network_uri][crate::model::NatInfo::network_uri].
15308 ///
15309 /// # Example
15310 /// ```ignore,no_run
15311 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15312 /// let x = NatInfo::new().set_network_uri("example");
15313 /// ```
15314 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15315 self.network_uri = v.into();
15316 self
15317 }
15318
15319 /// Sets the value of [old_source_ip][crate::model::NatInfo::old_source_ip].
15320 ///
15321 /// # Example
15322 /// ```ignore,no_run
15323 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15324 /// let x = NatInfo::new().set_old_source_ip("example");
15325 /// ```
15326 pub fn set_old_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15327 self.old_source_ip = v.into();
15328 self
15329 }
15330
15331 /// Sets the value of [new_source_ip][crate::model::NatInfo::new_source_ip].
15332 ///
15333 /// # Example
15334 /// ```ignore,no_run
15335 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15336 /// let x = NatInfo::new().set_new_source_ip("example");
15337 /// ```
15338 pub fn set_new_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15339 self.new_source_ip = v.into();
15340 self
15341 }
15342
15343 /// Sets the value of [old_destination_ip][crate::model::NatInfo::old_destination_ip].
15344 ///
15345 /// # Example
15346 /// ```ignore,no_run
15347 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15348 /// let x = NatInfo::new().set_old_destination_ip("example");
15349 /// ```
15350 pub fn set_old_destination_ip<T: std::convert::Into<std::string::String>>(
15351 mut self,
15352 v: T,
15353 ) -> Self {
15354 self.old_destination_ip = v.into();
15355 self
15356 }
15357
15358 /// Sets the value of [new_destination_ip][crate::model::NatInfo::new_destination_ip].
15359 ///
15360 /// # Example
15361 /// ```ignore,no_run
15362 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15363 /// let x = NatInfo::new().set_new_destination_ip("example");
15364 /// ```
15365 pub fn set_new_destination_ip<T: std::convert::Into<std::string::String>>(
15366 mut self,
15367 v: T,
15368 ) -> Self {
15369 self.new_destination_ip = v.into();
15370 self
15371 }
15372
15373 /// Sets the value of [old_source_port][crate::model::NatInfo::old_source_port].
15374 ///
15375 /// # Example
15376 /// ```ignore,no_run
15377 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15378 /// let x = NatInfo::new().set_old_source_port(42);
15379 /// ```
15380 pub fn set_old_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15381 self.old_source_port = v.into();
15382 self
15383 }
15384
15385 /// Sets the value of [new_source_port][crate::model::NatInfo::new_source_port].
15386 ///
15387 /// # Example
15388 /// ```ignore,no_run
15389 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15390 /// let x = NatInfo::new().set_new_source_port(42);
15391 /// ```
15392 pub fn set_new_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15393 self.new_source_port = v.into();
15394 self
15395 }
15396
15397 /// Sets the value of [old_destination_port][crate::model::NatInfo::old_destination_port].
15398 ///
15399 /// # Example
15400 /// ```ignore,no_run
15401 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15402 /// let x = NatInfo::new().set_old_destination_port(42);
15403 /// ```
15404 pub fn set_old_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15405 self.old_destination_port = v.into();
15406 self
15407 }
15408
15409 /// Sets the value of [new_destination_port][crate::model::NatInfo::new_destination_port].
15410 ///
15411 /// # Example
15412 /// ```ignore,no_run
15413 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15414 /// let x = NatInfo::new().set_new_destination_port(42);
15415 /// ```
15416 pub fn set_new_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15417 self.new_destination_port = v.into();
15418 self
15419 }
15420
15421 /// Sets the value of [router_uri][crate::model::NatInfo::router_uri].
15422 ///
15423 /// # Example
15424 /// ```ignore,no_run
15425 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15426 /// let x = NatInfo::new().set_router_uri("example");
15427 /// ```
15428 pub fn set_router_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15429 self.router_uri = v.into();
15430 self
15431 }
15432
15433 /// Sets the value of [nat_gateway_name][crate::model::NatInfo::nat_gateway_name].
15434 ///
15435 /// # Example
15436 /// ```ignore,no_run
15437 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15438 /// let x = NatInfo::new().set_nat_gateway_name("example");
15439 /// ```
15440 pub fn set_nat_gateway_name<T: std::convert::Into<std::string::String>>(
15441 mut self,
15442 v: T,
15443 ) -> Self {
15444 self.nat_gateway_name = v.into();
15445 self
15446 }
15447
15448 /// Sets the value of [cloud_nat_gateway_type][crate::model::NatInfo::cloud_nat_gateway_type].
15449 ///
15450 /// # Example
15451 /// ```ignore,no_run
15452 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15453 /// use google_cloud_networkmanagement_v1::model::nat_info::CloudNatGatewayType;
15454 /// let x0 = NatInfo::new().set_cloud_nat_gateway_type(CloudNatGatewayType::PublicNat44);
15455 /// let x1 = NatInfo::new().set_cloud_nat_gateway_type(CloudNatGatewayType::PublicNat64);
15456 /// let x2 = NatInfo::new().set_cloud_nat_gateway_type(CloudNatGatewayType::PrivateNatNcc);
15457 /// ```
15458 pub fn set_cloud_nat_gateway_type<
15459 T: std::convert::Into<crate::model::nat_info::CloudNatGatewayType>,
15460 >(
15461 mut self,
15462 v: T,
15463 ) -> Self {
15464 self.cloud_nat_gateway_type = v.into();
15465 self
15466 }
15467}
15468
15469impl wkt::message::Message for NatInfo {
15470 fn typename() -> &'static str {
15471 "type.googleapis.com/google.cloud.networkmanagement.v1.NatInfo"
15472 }
15473}
15474
15475/// Defines additional types related to [NatInfo].
15476pub mod nat_info {
15477 #[allow(unused_imports)]
15478 use super::*;
15479
15480 /// Types of NAT.
15481 ///
15482 /// # Working with unknown values
15483 ///
15484 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15485 /// additional enum variants at any time. Adding new variants is not considered
15486 /// a breaking change. Applications should write their code in anticipation of:
15487 ///
15488 /// - New values appearing in future releases of the client library, **and**
15489 /// - New values received dynamically, without application changes.
15490 ///
15491 /// Please consult the [Working with enums] section in the user guide for some
15492 /// guidelines.
15493 ///
15494 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15495 #[derive(Clone, Debug, PartialEq)]
15496 #[non_exhaustive]
15497 pub enum Type {
15498 /// Type is unspecified.
15499 Unspecified,
15500 /// From Compute Engine instance's internal address to external address.
15501 InternalToExternal,
15502 /// From Compute Engine instance's external address to internal address.
15503 ExternalToInternal,
15504 /// Cloud NAT Gateway.
15505 CloudNat,
15506 /// Private service connect NAT.
15507 PrivateServiceConnect,
15508 /// GKE Pod IP address masquerading.
15509 GkePodIpMasquerading,
15510 /// If set, the enum was initialized with an unknown value.
15511 ///
15512 /// Applications can examine the value using [Type::value] or
15513 /// [Type::name].
15514 UnknownValue(r#type::UnknownValue),
15515 }
15516
15517 #[doc(hidden)]
15518 pub mod r#type {
15519 #[allow(unused_imports)]
15520 use super::*;
15521 #[derive(Clone, Debug, PartialEq)]
15522 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15523 }
15524
15525 impl Type {
15526 /// Gets the enum value.
15527 ///
15528 /// Returns `None` if the enum contains an unknown value deserialized from
15529 /// the string representation of enums.
15530 pub fn value(&self) -> std::option::Option<i32> {
15531 match self {
15532 Self::Unspecified => std::option::Option::Some(0),
15533 Self::InternalToExternal => std::option::Option::Some(1),
15534 Self::ExternalToInternal => std::option::Option::Some(2),
15535 Self::CloudNat => std::option::Option::Some(3),
15536 Self::PrivateServiceConnect => std::option::Option::Some(4),
15537 Self::GkePodIpMasquerading => std::option::Option::Some(5),
15538 Self::UnknownValue(u) => u.0.value(),
15539 }
15540 }
15541
15542 /// Gets the enum value as a string.
15543 ///
15544 /// Returns `None` if the enum contains an unknown value deserialized from
15545 /// the integer representation of enums.
15546 pub fn name(&self) -> std::option::Option<&str> {
15547 match self {
15548 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
15549 Self::InternalToExternal => std::option::Option::Some("INTERNAL_TO_EXTERNAL"),
15550 Self::ExternalToInternal => std::option::Option::Some("EXTERNAL_TO_INTERNAL"),
15551 Self::CloudNat => std::option::Option::Some("CLOUD_NAT"),
15552 Self::PrivateServiceConnect => std::option::Option::Some("PRIVATE_SERVICE_CONNECT"),
15553 Self::GkePodIpMasquerading => std::option::Option::Some("GKE_POD_IP_MASQUERADING"),
15554 Self::UnknownValue(u) => u.0.name(),
15555 }
15556 }
15557 }
15558
15559 impl std::default::Default for Type {
15560 fn default() -> Self {
15561 use std::convert::From;
15562 Self::from(0)
15563 }
15564 }
15565
15566 impl std::fmt::Display for Type {
15567 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15568 wkt::internal::display_enum(f, self.name(), self.value())
15569 }
15570 }
15571
15572 impl std::convert::From<i32> for Type {
15573 fn from(value: i32) -> Self {
15574 match value {
15575 0 => Self::Unspecified,
15576 1 => Self::InternalToExternal,
15577 2 => Self::ExternalToInternal,
15578 3 => Self::CloudNat,
15579 4 => Self::PrivateServiceConnect,
15580 5 => Self::GkePodIpMasquerading,
15581 _ => Self::UnknownValue(r#type::UnknownValue(
15582 wkt::internal::UnknownEnumValue::Integer(value),
15583 )),
15584 }
15585 }
15586 }
15587
15588 impl std::convert::From<&str> for Type {
15589 fn from(value: &str) -> Self {
15590 use std::string::ToString;
15591 match value {
15592 "TYPE_UNSPECIFIED" => Self::Unspecified,
15593 "INTERNAL_TO_EXTERNAL" => Self::InternalToExternal,
15594 "EXTERNAL_TO_INTERNAL" => Self::ExternalToInternal,
15595 "CLOUD_NAT" => Self::CloudNat,
15596 "PRIVATE_SERVICE_CONNECT" => Self::PrivateServiceConnect,
15597 "GKE_POD_IP_MASQUERADING" => Self::GkePodIpMasquerading,
15598 _ => Self::UnknownValue(r#type::UnknownValue(
15599 wkt::internal::UnknownEnumValue::String(value.to_string()),
15600 )),
15601 }
15602 }
15603 }
15604
15605 impl serde::ser::Serialize for Type {
15606 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15607 where
15608 S: serde::Serializer,
15609 {
15610 match self {
15611 Self::Unspecified => serializer.serialize_i32(0),
15612 Self::InternalToExternal => serializer.serialize_i32(1),
15613 Self::ExternalToInternal => serializer.serialize_i32(2),
15614 Self::CloudNat => serializer.serialize_i32(3),
15615 Self::PrivateServiceConnect => serializer.serialize_i32(4),
15616 Self::GkePodIpMasquerading => serializer.serialize_i32(5),
15617 Self::UnknownValue(u) => u.0.serialize(serializer),
15618 }
15619 }
15620 }
15621
15622 impl<'de> serde::de::Deserialize<'de> for Type {
15623 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15624 where
15625 D: serde::Deserializer<'de>,
15626 {
15627 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
15628 ".google.cloud.networkmanagement.v1.NatInfo.Type",
15629 ))
15630 }
15631 }
15632
15633 /// Types of Cloud NAT gateway.
15634 ///
15635 /// # Working with unknown values
15636 ///
15637 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15638 /// additional enum variants at any time. Adding new variants is not considered
15639 /// a breaking change. Applications should write their code in anticipation of:
15640 ///
15641 /// - New values appearing in future releases of the client library, **and**
15642 /// - New values received dynamically, without application changes.
15643 ///
15644 /// Please consult the [Working with enums] section in the user guide for some
15645 /// guidelines.
15646 ///
15647 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15648 #[derive(Clone, Debug, PartialEq)]
15649 #[non_exhaustive]
15650 pub enum CloudNatGatewayType {
15651 /// Type is unspecified.
15652 Unspecified,
15653 /// Public NAT gateway.
15654 PublicNat44,
15655 /// Public NAT64 gateway.
15656 PublicNat64,
15657 /// Private NAT gateway for NCC.
15658 PrivateNatNcc,
15659 /// Private NAT gateway for hybrid connectivity.
15660 PrivateNatHybrid,
15661 /// Private NAT64 gateway.
15662 PrivateNat64,
15663 /// If set, the enum was initialized with an unknown value.
15664 ///
15665 /// Applications can examine the value using [CloudNatGatewayType::value] or
15666 /// [CloudNatGatewayType::name].
15667 UnknownValue(cloud_nat_gateway_type::UnknownValue),
15668 }
15669
15670 #[doc(hidden)]
15671 pub mod cloud_nat_gateway_type {
15672 #[allow(unused_imports)]
15673 use super::*;
15674 #[derive(Clone, Debug, PartialEq)]
15675 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15676 }
15677
15678 impl CloudNatGatewayType {
15679 /// Gets the enum value.
15680 ///
15681 /// Returns `None` if the enum contains an unknown value deserialized from
15682 /// the string representation of enums.
15683 pub fn value(&self) -> std::option::Option<i32> {
15684 match self {
15685 Self::Unspecified => std::option::Option::Some(0),
15686 Self::PublicNat44 => std::option::Option::Some(1),
15687 Self::PublicNat64 => std::option::Option::Some(2),
15688 Self::PrivateNatNcc => std::option::Option::Some(3),
15689 Self::PrivateNatHybrid => std::option::Option::Some(4),
15690 Self::PrivateNat64 => std::option::Option::Some(5),
15691 Self::UnknownValue(u) => u.0.value(),
15692 }
15693 }
15694
15695 /// Gets the enum value as a string.
15696 ///
15697 /// Returns `None` if the enum contains an unknown value deserialized from
15698 /// the integer representation of enums.
15699 pub fn name(&self) -> std::option::Option<&str> {
15700 match self {
15701 Self::Unspecified => {
15702 std::option::Option::Some("CLOUD_NAT_GATEWAY_TYPE_UNSPECIFIED")
15703 }
15704 Self::PublicNat44 => std::option::Option::Some("PUBLIC_NAT44"),
15705 Self::PublicNat64 => std::option::Option::Some("PUBLIC_NAT64"),
15706 Self::PrivateNatNcc => std::option::Option::Some("PRIVATE_NAT_NCC"),
15707 Self::PrivateNatHybrid => std::option::Option::Some("PRIVATE_NAT_HYBRID"),
15708 Self::PrivateNat64 => std::option::Option::Some("PRIVATE_NAT64"),
15709 Self::UnknownValue(u) => u.0.name(),
15710 }
15711 }
15712 }
15713
15714 impl std::default::Default for CloudNatGatewayType {
15715 fn default() -> Self {
15716 use std::convert::From;
15717 Self::from(0)
15718 }
15719 }
15720
15721 impl std::fmt::Display for CloudNatGatewayType {
15722 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15723 wkt::internal::display_enum(f, self.name(), self.value())
15724 }
15725 }
15726
15727 impl std::convert::From<i32> for CloudNatGatewayType {
15728 fn from(value: i32) -> Self {
15729 match value {
15730 0 => Self::Unspecified,
15731 1 => Self::PublicNat44,
15732 2 => Self::PublicNat64,
15733 3 => Self::PrivateNatNcc,
15734 4 => Self::PrivateNatHybrid,
15735 5 => Self::PrivateNat64,
15736 _ => Self::UnknownValue(cloud_nat_gateway_type::UnknownValue(
15737 wkt::internal::UnknownEnumValue::Integer(value),
15738 )),
15739 }
15740 }
15741 }
15742
15743 impl std::convert::From<&str> for CloudNatGatewayType {
15744 fn from(value: &str) -> Self {
15745 use std::string::ToString;
15746 match value {
15747 "CLOUD_NAT_GATEWAY_TYPE_UNSPECIFIED" => Self::Unspecified,
15748 "PUBLIC_NAT44" => Self::PublicNat44,
15749 "PUBLIC_NAT64" => Self::PublicNat64,
15750 "PRIVATE_NAT_NCC" => Self::PrivateNatNcc,
15751 "PRIVATE_NAT_HYBRID" => Self::PrivateNatHybrid,
15752 "PRIVATE_NAT64" => Self::PrivateNat64,
15753 _ => Self::UnknownValue(cloud_nat_gateway_type::UnknownValue(
15754 wkt::internal::UnknownEnumValue::String(value.to_string()),
15755 )),
15756 }
15757 }
15758 }
15759
15760 impl serde::ser::Serialize for CloudNatGatewayType {
15761 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15762 where
15763 S: serde::Serializer,
15764 {
15765 match self {
15766 Self::Unspecified => serializer.serialize_i32(0),
15767 Self::PublicNat44 => serializer.serialize_i32(1),
15768 Self::PublicNat64 => serializer.serialize_i32(2),
15769 Self::PrivateNatNcc => serializer.serialize_i32(3),
15770 Self::PrivateNatHybrid => serializer.serialize_i32(4),
15771 Self::PrivateNat64 => serializer.serialize_i32(5),
15772 Self::UnknownValue(u) => u.0.serialize(serializer),
15773 }
15774 }
15775 }
15776
15777 impl<'de> serde::de::Deserialize<'de> for CloudNatGatewayType {
15778 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15779 where
15780 D: serde::Deserializer<'de>,
15781 {
15782 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudNatGatewayType>::new(
15783 ".google.cloud.networkmanagement.v1.NatInfo.CloudNatGatewayType",
15784 ))
15785 }
15786 }
15787}
15788
15789/// For display only. Metadata associated with ProxyConnection.
15790#[derive(Clone, Default, PartialEq)]
15791#[non_exhaustive]
15792pub struct ProxyConnectionInfo {
15793 /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
15794 pub protocol: std::string::String,
15795
15796 /// Source IP address of an original connection.
15797 pub old_source_ip: std::string::String,
15798
15799 /// Source IP address of a new connection.
15800 pub new_source_ip: std::string::String,
15801
15802 /// Destination IP address of an original connection
15803 pub old_destination_ip: std::string::String,
15804
15805 /// Destination IP address of a new connection.
15806 pub new_destination_ip: std::string::String,
15807
15808 /// Source port of an original connection. Only valid when protocol is TCP or
15809 /// UDP.
15810 pub old_source_port: i32,
15811
15812 /// Source port of a new connection. Only valid when protocol is TCP or UDP.
15813 pub new_source_port: i32,
15814
15815 /// Destination port of an original connection. Only valid when protocol is TCP
15816 /// or UDP.
15817 pub old_destination_port: i32,
15818
15819 /// Destination port of a new connection. Only valid when protocol is TCP or
15820 /// UDP.
15821 pub new_destination_port: i32,
15822
15823 /// Uri of proxy subnet.
15824 pub subnet_uri: std::string::String,
15825
15826 /// URI of the network where connection is proxied.
15827 pub network_uri: std::string::String,
15828
15829 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15830}
15831
15832impl ProxyConnectionInfo {
15833 /// Creates a new default instance.
15834 pub fn new() -> Self {
15835 std::default::Default::default()
15836 }
15837
15838 /// Sets the value of [protocol][crate::model::ProxyConnectionInfo::protocol].
15839 ///
15840 /// # Example
15841 /// ```ignore,no_run
15842 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15843 /// let x = ProxyConnectionInfo::new().set_protocol("example");
15844 /// ```
15845 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15846 self.protocol = v.into();
15847 self
15848 }
15849
15850 /// Sets the value of [old_source_ip][crate::model::ProxyConnectionInfo::old_source_ip].
15851 ///
15852 /// # Example
15853 /// ```ignore,no_run
15854 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15855 /// let x = ProxyConnectionInfo::new().set_old_source_ip("example");
15856 /// ```
15857 pub fn set_old_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15858 self.old_source_ip = v.into();
15859 self
15860 }
15861
15862 /// Sets the value of [new_source_ip][crate::model::ProxyConnectionInfo::new_source_ip].
15863 ///
15864 /// # Example
15865 /// ```ignore,no_run
15866 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15867 /// let x = ProxyConnectionInfo::new().set_new_source_ip("example");
15868 /// ```
15869 pub fn set_new_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15870 self.new_source_ip = v.into();
15871 self
15872 }
15873
15874 /// Sets the value of [old_destination_ip][crate::model::ProxyConnectionInfo::old_destination_ip].
15875 ///
15876 /// # Example
15877 /// ```ignore,no_run
15878 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15879 /// let x = ProxyConnectionInfo::new().set_old_destination_ip("example");
15880 /// ```
15881 pub fn set_old_destination_ip<T: std::convert::Into<std::string::String>>(
15882 mut self,
15883 v: T,
15884 ) -> Self {
15885 self.old_destination_ip = v.into();
15886 self
15887 }
15888
15889 /// Sets the value of [new_destination_ip][crate::model::ProxyConnectionInfo::new_destination_ip].
15890 ///
15891 /// # Example
15892 /// ```ignore,no_run
15893 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15894 /// let x = ProxyConnectionInfo::new().set_new_destination_ip("example");
15895 /// ```
15896 pub fn set_new_destination_ip<T: std::convert::Into<std::string::String>>(
15897 mut self,
15898 v: T,
15899 ) -> Self {
15900 self.new_destination_ip = v.into();
15901 self
15902 }
15903
15904 /// Sets the value of [old_source_port][crate::model::ProxyConnectionInfo::old_source_port].
15905 ///
15906 /// # Example
15907 /// ```ignore,no_run
15908 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15909 /// let x = ProxyConnectionInfo::new().set_old_source_port(42);
15910 /// ```
15911 pub fn set_old_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15912 self.old_source_port = v.into();
15913 self
15914 }
15915
15916 /// Sets the value of [new_source_port][crate::model::ProxyConnectionInfo::new_source_port].
15917 ///
15918 /// # Example
15919 /// ```ignore,no_run
15920 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15921 /// let x = ProxyConnectionInfo::new().set_new_source_port(42);
15922 /// ```
15923 pub fn set_new_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15924 self.new_source_port = v.into();
15925 self
15926 }
15927
15928 /// Sets the value of [old_destination_port][crate::model::ProxyConnectionInfo::old_destination_port].
15929 ///
15930 /// # Example
15931 /// ```ignore,no_run
15932 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15933 /// let x = ProxyConnectionInfo::new().set_old_destination_port(42);
15934 /// ```
15935 pub fn set_old_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15936 self.old_destination_port = v.into();
15937 self
15938 }
15939
15940 /// Sets the value of [new_destination_port][crate::model::ProxyConnectionInfo::new_destination_port].
15941 ///
15942 /// # Example
15943 /// ```ignore,no_run
15944 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15945 /// let x = ProxyConnectionInfo::new().set_new_destination_port(42);
15946 /// ```
15947 pub fn set_new_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15948 self.new_destination_port = v.into();
15949 self
15950 }
15951
15952 /// Sets the value of [subnet_uri][crate::model::ProxyConnectionInfo::subnet_uri].
15953 ///
15954 /// # Example
15955 /// ```ignore,no_run
15956 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15957 /// let x = ProxyConnectionInfo::new().set_subnet_uri("example");
15958 /// ```
15959 pub fn set_subnet_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15960 self.subnet_uri = v.into();
15961 self
15962 }
15963
15964 /// Sets the value of [network_uri][crate::model::ProxyConnectionInfo::network_uri].
15965 ///
15966 /// # Example
15967 /// ```ignore,no_run
15968 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
15969 /// let x = ProxyConnectionInfo::new().set_network_uri("example");
15970 /// ```
15971 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15972 self.network_uri = v.into();
15973 self
15974 }
15975}
15976
15977impl wkt::message::Message for ProxyConnectionInfo {
15978 fn typename() -> &'static str {
15979 "type.googleapis.com/google.cloud.networkmanagement.v1.ProxyConnectionInfo"
15980 }
15981}
15982
15983/// For display only. Metadata associated with the load balancer backend.
15984#[derive(Clone, Default, PartialEq)]
15985#[non_exhaustive]
15986pub struct LoadBalancerBackendInfo {
15987 /// Display name of the backend. For example, it might be an instance name for
15988 /// the instance group backends, or an IP address and port for zonal network
15989 /// endpoint group backends.
15990 pub name: std::string::String,
15991
15992 /// URI of the backend instance (if applicable). Populated for instance group
15993 /// backends, and zonal NEG backends.
15994 pub instance_uri: std::string::String,
15995
15996 /// URI of the backend service this backend belongs to (if applicable).
15997 pub backend_service_uri: std::string::String,
15998
15999 /// URI of the instance group this backend belongs to (if applicable).
16000 pub instance_group_uri: std::string::String,
16001
16002 /// URI of the network endpoint group this backend belongs to (if applicable).
16003 pub network_endpoint_group_uri: std::string::String,
16004
16005 /// URI of the backend bucket this backend targets (if applicable).
16006 pub backend_bucket_uri: std::string::String,
16007
16008 /// URI of the PSC service attachment this PSC NEG backend targets (if
16009 /// applicable).
16010 pub psc_service_attachment_uri: std::string::String,
16011
16012 /// PSC Google API target this PSC NEG backend targets (if applicable).
16013 pub psc_google_api_target: std::string::String,
16014
16015 /// URI of the health check attached to this backend (if applicable).
16016 pub health_check_uri: std::string::String,
16017
16018 /// Output only. Health check firewalls configuration state for the backend.
16019 /// This is a result of the static firewall analysis (verifying that health
16020 /// check traffic from required IP ranges to the backend is allowed or not).
16021 /// The backend might still be unhealthy even if these firewalls are
16022 /// configured. Please refer to the documentation for more information:
16023 /// <https://cloud.google.com/load-balancing/docs/firewall-rules>
16024 pub health_check_firewalls_config_state:
16025 crate::model::load_balancer_backend_info::HealthCheckFirewallsConfigState,
16026
16027 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16028}
16029
16030impl LoadBalancerBackendInfo {
16031 /// Creates a new default instance.
16032 pub fn new() -> Self {
16033 std::default::Default::default()
16034 }
16035
16036 /// Sets the value of [name][crate::model::LoadBalancerBackendInfo::name].
16037 ///
16038 /// # Example
16039 /// ```ignore,no_run
16040 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16041 /// let x = LoadBalancerBackendInfo::new().set_name("example");
16042 /// ```
16043 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16044 self.name = v.into();
16045 self
16046 }
16047
16048 /// Sets the value of [instance_uri][crate::model::LoadBalancerBackendInfo::instance_uri].
16049 ///
16050 /// # Example
16051 /// ```ignore,no_run
16052 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16053 /// let x = LoadBalancerBackendInfo::new().set_instance_uri("example");
16054 /// ```
16055 pub fn set_instance_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16056 self.instance_uri = v.into();
16057 self
16058 }
16059
16060 /// Sets the value of [backend_service_uri][crate::model::LoadBalancerBackendInfo::backend_service_uri].
16061 ///
16062 /// # Example
16063 /// ```ignore,no_run
16064 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16065 /// let x = LoadBalancerBackendInfo::new().set_backend_service_uri("example");
16066 /// ```
16067 pub fn set_backend_service_uri<T: std::convert::Into<std::string::String>>(
16068 mut self,
16069 v: T,
16070 ) -> Self {
16071 self.backend_service_uri = v.into();
16072 self
16073 }
16074
16075 /// Sets the value of [instance_group_uri][crate::model::LoadBalancerBackendInfo::instance_group_uri].
16076 ///
16077 /// # Example
16078 /// ```ignore,no_run
16079 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16080 /// let x = LoadBalancerBackendInfo::new().set_instance_group_uri("example");
16081 /// ```
16082 pub fn set_instance_group_uri<T: std::convert::Into<std::string::String>>(
16083 mut self,
16084 v: T,
16085 ) -> Self {
16086 self.instance_group_uri = v.into();
16087 self
16088 }
16089
16090 /// Sets the value of [network_endpoint_group_uri][crate::model::LoadBalancerBackendInfo::network_endpoint_group_uri].
16091 ///
16092 /// # Example
16093 /// ```ignore,no_run
16094 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16095 /// let x = LoadBalancerBackendInfo::new().set_network_endpoint_group_uri("example");
16096 /// ```
16097 pub fn set_network_endpoint_group_uri<T: std::convert::Into<std::string::String>>(
16098 mut self,
16099 v: T,
16100 ) -> Self {
16101 self.network_endpoint_group_uri = v.into();
16102 self
16103 }
16104
16105 /// Sets the value of [backend_bucket_uri][crate::model::LoadBalancerBackendInfo::backend_bucket_uri].
16106 ///
16107 /// # Example
16108 /// ```ignore,no_run
16109 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16110 /// let x = LoadBalancerBackendInfo::new().set_backend_bucket_uri("example");
16111 /// ```
16112 pub fn set_backend_bucket_uri<T: std::convert::Into<std::string::String>>(
16113 mut self,
16114 v: T,
16115 ) -> Self {
16116 self.backend_bucket_uri = v.into();
16117 self
16118 }
16119
16120 /// Sets the value of [psc_service_attachment_uri][crate::model::LoadBalancerBackendInfo::psc_service_attachment_uri].
16121 ///
16122 /// # Example
16123 /// ```ignore,no_run
16124 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16125 /// let x = LoadBalancerBackendInfo::new().set_psc_service_attachment_uri("example");
16126 /// ```
16127 pub fn set_psc_service_attachment_uri<T: std::convert::Into<std::string::String>>(
16128 mut self,
16129 v: T,
16130 ) -> Self {
16131 self.psc_service_attachment_uri = v.into();
16132 self
16133 }
16134
16135 /// Sets the value of [psc_google_api_target][crate::model::LoadBalancerBackendInfo::psc_google_api_target].
16136 ///
16137 /// # Example
16138 /// ```ignore,no_run
16139 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16140 /// let x = LoadBalancerBackendInfo::new().set_psc_google_api_target("example");
16141 /// ```
16142 pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
16143 mut self,
16144 v: T,
16145 ) -> Self {
16146 self.psc_google_api_target = v.into();
16147 self
16148 }
16149
16150 /// Sets the value of [health_check_uri][crate::model::LoadBalancerBackendInfo::health_check_uri].
16151 ///
16152 /// # Example
16153 /// ```ignore,no_run
16154 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16155 /// let x = LoadBalancerBackendInfo::new().set_health_check_uri("example");
16156 /// ```
16157 pub fn set_health_check_uri<T: std::convert::Into<std::string::String>>(
16158 mut self,
16159 v: T,
16160 ) -> Self {
16161 self.health_check_uri = v.into();
16162 self
16163 }
16164
16165 /// Sets the value of [health_check_firewalls_config_state][crate::model::LoadBalancerBackendInfo::health_check_firewalls_config_state].
16166 ///
16167 /// # Example
16168 /// ```ignore,no_run
16169 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16170 /// use google_cloud_networkmanagement_v1::model::load_balancer_backend_info::HealthCheckFirewallsConfigState;
16171 /// let x0 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsConfigured);
16172 /// let x1 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsPartiallyConfigured);
16173 /// let x2 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsNotConfigured);
16174 /// ```
16175 pub fn set_health_check_firewalls_config_state<
16176 T: std::convert::Into<
16177 crate::model::load_balancer_backend_info::HealthCheckFirewallsConfigState,
16178 >,
16179 >(
16180 mut self,
16181 v: T,
16182 ) -> Self {
16183 self.health_check_firewalls_config_state = v.into();
16184 self
16185 }
16186}
16187
16188impl wkt::message::Message for LoadBalancerBackendInfo {
16189 fn typename() -> &'static str {
16190 "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerBackendInfo"
16191 }
16192}
16193
16194/// Defines additional types related to [LoadBalancerBackendInfo].
16195pub mod load_balancer_backend_info {
16196 #[allow(unused_imports)]
16197 use super::*;
16198
16199 /// Health check firewalls configuration state enum.
16200 ///
16201 /// # Working with unknown values
16202 ///
16203 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16204 /// additional enum variants at any time. Adding new variants is not considered
16205 /// a breaking change. Applications should write their code in anticipation of:
16206 ///
16207 /// - New values appearing in future releases of the client library, **and**
16208 /// - New values received dynamically, without application changes.
16209 ///
16210 /// Please consult the [Working with enums] section in the user guide for some
16211 /// guidelines.
16212 ///
16213 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16214 #[derive(Clone, Debug, PartialEq)]
16215 #[non_exhaustive]
16216 pub enum HealthCheckFirewallsConfigState {
16217 /// Configuration state unspecified. It usually means that the backend has
16218 /// no health check attached, or there was an unexpected configuration error
16219 /// preventing Connectivity tests from verifying health check configuration.
16220 Unspecified,
16221 /// Firewall rules (policies) allowing health check traffic from all required
16222 /// IP ranges to the backend are configured.
16223 FirewallsConfigured,
16224 /// Firewall rules (policies) allow health check traffic only from a part of
16225 /// required IP ranges.
16226 FirewallsPartiallyConfigured,
16227 /// Firewall rules (policies) deny health check traffic from all required
16228 /// IP ranges to the backend.
16229 FirewallsNotConfigured,
16230 /// The network contains firewall rules of unsupported types, so Connectivity
16231 /// tests were not able to verify health check configuration status. Please
16232 /// refer to the documentation for the list of unsupported configurations:
16233 /// <https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/concepts/overview#unsupported-configs>
16234 FirewallsUnsupported,
16235 /// If set, the enum was initialized with an unknown value.
16236 ///
16237 /// Applications can examine the value using [HealthCheckFirewallsConfigState::value] or
16238 /// [HealthCheckFirewallsConfigState::name].
16239 UnknownValue(health_check_firewalls_config_state::UnknownValue),
16240 }
16241
16242 #[doc(hidden)]
16243 pub mod health_check_firewalls_config_state {
16244 #[allow(unused_imports)]
16245 use super::*;
16246 #[derive(Clone, Debug, PartialEq)]
16247 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16248 }
16249
16250 impl HealthCheckFirewallsConfigState {
16251 /// Gets the enum value.
16252 ///
16253 /// Returns `None` if the enum contains an unknown value deserialized from
16254 /// the string representation of enums.
16255 pub fn value(&self) -> std::option::Option<i32> {
16256 match self {
16257 Self::Unspecified => std::option::Option::Some(0),
16258 Self::FirewallsConfigured => std::option::Option::Some(1),
16259 Self::FirewallsPartiallyConfigured => std::option::Option::Some(2),
16260 Self::FirewallsNotConfigured => std::option::Option::Some(3),
16261 Self::FirewallsUnsupported => std::option::Option::Some(4),
16262 Self::UnknownValue(u) => u.0.value(),
16263 }
16264 }
16265
16266 /// Gets the enum value as a string.
16267 ///
16268 /// Returns `None` if the enum contains an unknown value deserialized from
16269 /// the integer representation of enums.
16270 pub fn name(&self) -> std::option::Option<&str> {
16271 match self {
16272 Self::Unspecified => {
16273 std::option::Option::Some("HEALTH_CHECK_FIREWALLS_CONFIG_STATE_UNSPECIFIED")
16274 }
16275 Self::FirewallsConfigured => std::option::Option::Some("FIREWALLS_CONFIGURED"),
16276 Self::FirewallsPartiallyConfigured => {
16277 std::option::Option::Some("FIREWALLS_PARTIALLY_CONFIGURED")
16278 }
16279 Self::FirewallsNotConfigured => {
16280 std::option::Option::Some("FIREWALLS_NOT_CONFIGURED")
16281 }
16282 Self::FirewallsUnsupported => std::option::Option::Some("FIREWALLS_UNSUPPORTED"),
16283 Self::UnknownValue(u) => u.0.name(),
16284 }
16285 }
16286 }
16287
16288 impl std::default::Default for HealthCheckFirewallsConfigState {
16289 fn default() -> Self {
16290 use std::convert::From;
16291 Self::from(0)
16292 }
16293 }
16294
16295 impl std::fmt::Display for HealthCheckFirewallsConfigState {
16296 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16297 wkt::internal::display_enum(f, self.name(), self.value())
16298 }
16299 }
16300
16301 impl std::convert::From<i32> for HealthCheckFirewallsConfigState {
16302 fn from(value: i32) -> Self {
16303 match value {
16304 0 => Self::Unspecified,
16305 1 => Self::FirewallsConfigured,
16306 2 => Self::FirewallsPartiallyConfigured,
16307 3 => Self::FirewallsNotConfigured,
16308 4 => Self::FirewallsUnsupported,
16309 _ => Self::UnknownValue(health_check_firewalls_config_state::UnknownValue(
16310 wkt::internal::UnknownEnumValue::Integer(value),
16311 )),
16312 }
16313 }
16314 }
16315
16316 impl std::convert::From<&str> for HealthCheckFirewallsConfigState {
16317 fn from(value: &str) -> Self {
16318 use std::string::ToString;
16319 match value {
16320 "HEALTH_CHECK_FIREWALLS_CONFIG_STATE_UNSPECIFIED" => Self::Unspecified,
16321 "FIREWALLS_CONFIGURED" => Self::FirewallsConfigured,
16322 "FIREWALLS_PARTIALLY_CONFIGURED" => Self::FirewallsPartiallyConfigured,
16323 "FIREWALLS_NOT_CONFIGURED" => Self::FirewallsNotConfigured,
16324 "FIREWALLS_UNSUPPORTED" => Self::FirewallsUnsupported,
16325 _ => Self::UnknownValue(health_check_firewalls_config_state::UnknownValue(
16326 wkt::internal::UnknownEnumValue::String(value.to_string()),
16327 )),
16328 }
16329 }
16330 }
16331
16332 impl serde::ser::Serialize for HealthCheckFirewallsConfigState {
16333 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16334 where
16335 S: serde::Serializer,
16336 {
16337 match self {
16338 Self::Unspecified => serializer.serialize_i32(0),
16339 Self::FirewallsConfigured => serializer.serialize_i32(1),
16340 Self::FirewallsPartiallyConfigured => serializer.serialize_i32(2),
16341 Self::FirewallsNotConfigured => serializer.serialize_i32(3),
16342 Self::FirewallsUnsupported => serializer.serialize_i32(4),
16343 Self::UnknownValue(u) => u.0.serialize(serializer),
16344 }
16345 }
16346 }
16347
16348 impl<'de> serde::de::Deserialize<'de> for HealthCheckFirewallsConfigState {
16349 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16350 where
16351 D: serde::Deserializer<'de>,
16352 {
16353 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HealthCheckFirewallsConfigState>::new(
16354 ".google.cloud.networkmanagement.v1.LoadBalancerBackendInfo.HealthCheckFirewallsConfigState"))
16355 }
16356 }
16357}
16358
16359/// For display only. Metadata associated with Storage Bucket.
16360#[derive(Clone, Default, PartialEq)]
16361#[non_exhaustive]
16362pub struct StorageBucketInfo {
16363 /// Cloud Storage Bucket name.
16364 pub bucket: std::string::String,
16365
16366 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16367}
16368
16369impl StorageBucketInfo {
16370 /// Creates a new default instance.
16371 pub fn new() -> Self {
16372 std::default::Default::default()
16373 }
16374
16375 /// Sets the value of [bucket][crate::model::StorageBucketInfo::bucket].
16376 ///
16377 /// # Example
16378 /// ```ignore,no_run
16379 /// # use google_cloud_networkmanagement_v1::model::StorageBucketInfo;
16380 /// let x = StorageBucketInfo::new().set_bucket("example");
16381 /// ```
16382 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16383 self.bucket = v.into();
16384 self
16385 }
16386}
16387
16388impl wkt::message::Message for StorageBucketInfo {
16389 fn typename() -> &'static str {
16390 "type.googleapis.com/google.cloud.networkmanagement.v1.StorageBucketInfo"
16391 }
16392}
16393
16394/// For display only. Metadata associated with the serverless network endpoint
16395/// group backend.
16396#[derive(Clone, Default, PartialEq)]
16397#[non_exhaustive]
16398pub struct ServerlessNegInfo {
16399 /// URI of the serverless network endpoint group.
16400 pub neg_uri: std::string::String,
16401
16402 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16403}
16404
16405impl ServerlessNegInfo {
16406 /// Creates a new default instance.
16407 pub fn new() -> Self {
16408 std::default::Default::default()
16409 }
16410
16411 /// Sets the value of [neg_uri][crate::model::ServerlessNegInfo::neg_uri].
16412 ///
16413 /// # Example
16414 /// ```ignore,no_run
16415 /// # use google_cloud_networkmanagement_v1::model::ServerlessNegInfo;
16416 /// let x = ServerlessNegInfo::new().set_neg_uri("example");
16417 /// ```
16418 pub fn set_neg_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16419 self.neg_uri = v.into();
16420 self
16421 }
16422}
16423
16424impl wkt::message::Message for ServerlessNegInfo {
16425 fn typename() -> &'static str {
16426 "type.googleapis.com/google.cloud.networkmanagement.v1.ServerlessNegInfo"
16427 }
16428}
16429
16430/// For display only. Metadata associated with a layer 7 packet inspection by the
16431/// firewall.
16432#[derive(Clone, Default, PartialEq)]
16433#[non_exhaustive]
16434pub struct NgfwPacketInspectionInfo {
16435 /// URI of the security profile group associated with this firewall packet
16436 /// inspection.
16437 pub security_profile_group_uri: std::string::String,
16438
16439 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16440}
16441
16442impl NgfwPacketInspectionInfo {
16443 /// Creates a new default instance.
16444 pub fn new() -> Self {
16445 std::default::Default::default()
16446 }
16447
16448 /// Sets the value of [security_profile_group_uri][crate::model::NgfwPacketInspectionInfo::security_profile_group_uri].
16449 ///
16450 /// # Example
16451 /// ```ignore,no_run
16452 /// # use google_cloud_networkmanagement_v1::model::NgfwPacketInspectionInfo;
16453 /// let x = NgfwPacketInspectionInfo::new().set_security_profile_group_uri("example");
16454 /// ```
16455 pub fn set_security_profile_group_uri<T: std::convert::Into<std::string::String>>(
16456 mut self,
16457 v: T,
16458 ) -> Self {
16459 self.security_profile_group_uri = v.into();
16460 self
16461 }
16462}
16463
16464impl wkt::message::Message for NgfwPacketInspectionInfo {
16465 fn typename() -> &'static str {
16466 "type.googleapis.com/google.cloud.networkmanagement.v1.NgfwPacketInspectionInfo"
16467 }
16468}
16469
16470/// Request for the `ListVpcFlowLogsConfigs` method.
16471#[derive(Clone, Default, PartialEq)]
16472#[non_exhaustive]
16473pub struct ListVpcFlowLogsConfigsRequest {
16474 /// Required. The parent resource of the VpcFlowLogsConfig,
16475 /// in one of the following formats:
16476 ///
16477 /// - For project-level resources: `projects/{project_id}/locations/global`
16478 ///
16479 /// - For organization-level resources:
16480 /// `organizations/{organization_id}/locations/global`
16481 ///
16482 pub parent: std::string::String,
16483
16484 /// Optional. Number of `VpcFlowLogsConfigs` to return.
16485 pub page_size: i32,
16486
16487 /// Optional. Page token from an earlier query, as returned in
16488 /// `next_page_token`.
16489 pub page_token: std::string::String,
16490
16491 /// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
16492 /// A filter expression must use the supported [CEL logic operators]
16493 /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
16494 pub filter: std::string::String,
16495
16496 /// Optional. Field to use to sort the list.
16497 pub order_by: std::string::String,
16498
16499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16500}
16501
16502impl ListVpcFlowLogsConfigsRequest {
16503 /// Creates a new default instance.
16504 pub fn new() -> Self {
16505 std::default::Default::default()
16506 }
16507
16508 /// Sets the value of [parent][crate::model::ListVpcFlowLogsConfigsRequest::parent].
16509 ///
16510 /// # Example
16511 /// ```ignore,no_run
16512 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16513 /// let x = ListVpcFlowLogsConfigsRequest::new().set_parent("example");
16514 /// ```
16515 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16516 self.parent = v.into();
16517 self
16518 }
16519
16520 /// Sets the value of [page_size][crate::model::ListVpcFlowLogsConfigsRequest::page_size].
16521 ///
16522 /// # Example
16523 /// ```ignore,no_run
16524 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16525 /// let x = ListVpcFlowLogsConfigsRequest::new().set_page_size(42);
16526 /// ```
16527 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16528 self.page_size = v.into();
16529 self
16530 }
16531
16532 /// Sets the value of [page_token][crate::model::ListVpcFlowLogsConfigsRequest::page_token].
16533 ///
16534 /// # Example
16535 /// ```ignore,no_run
16536 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16537 /// let x = ListVpcFlowLogsConfigsRequest::new().set_page_token("example");
16538 /// ```
16539 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16540 self.page_token = v.into();
16541 self
16542 }
16543
16544 /// Sets the value of [filter][crate::model::ListVpcFlowLogsConfigsRequest::filter].
16545 ///
16546 /// # Example
16547 /// ```ignore,no_run
16548 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16549 /// let x = ListVpcFlowLogsConfigsRequest::new().set_filter("example");
16550 /// ```
16551 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16552 self.filter = v.into();
16553 self
16554 }
16555
16556 /// Sets the value of [order_by][crate::model::ListVpcFlowLogsConfigsRequest::order_by].
16557 ///
16558 /// # Example
16559 /// ```ignore,no_run
16560 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16561 /// let x = ListVpcFlowLogsConfigsRequest::new().set_order_by("example");
16562 /// ```
16563 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16564 self.order_by = v.into();
16565 self
16566 }
16567}
16568
16569impl wkt::message::Message for ListVpcFlowLogsConfigsRequest {
16570 fn typename() -> &'static str {
16571 "type.googleapis.com/google.cloud.networkmanagement.v1.ListVpcFlowLogsConfigsRequest"
16572 }
16573}
16574
16575/// Response for the `ListVpcFlowLogsConfigs` method.
16576#[derive(Clone, Default, PartialEq)]
16577#[non_exhaustive]
16578pub struct ListVpcFlowLogsConfigsResponse {
16579 /// List of VPC Flow Log configurations.
16580 pub vpc_flow_logs_configs: std::vec::Vec<crate::model::VpcFlowLogsConfig>,
16581
16582 /// Page token to fetch the next set of configurations.
16583 pub next_page_token: std::string::String,
16584
16585 /// Locations that could not be reached (when querying all locations with `-`).
16586 pub unreachable: std::vec::Vec<std::string::String>,
16587
16588 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16589}
16590
16591impl ListVpcFlowLogsConfigsResponse {
16592 /// Creates a new default instance.
16593 pub fn new() -> Self {
16594 std::default::Default::default()
16595 }
16596
16597 /// Sets the value of [vpc_flow_logs_configs][crate::model::ListVpcFlowLogsConfigsResponse::vpc_flow_logs_configs].
16598 ///
16599 /// # Example
16600 /// ```ignore,no_run
16601 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
16602 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16603 /// let x = ListVpcFlowLogsConfigsResponse::new()
16604 /// .set_vpc_flow_logs_configs([
16605 /// VpcFlowLogsConfig::default()/* use setters */,
16606 /// VpcFlowLogsConfig::default()/* use (different) setters */,
16607 /// ]);
16608 /// ```
16609 pub fn set_vpc_flow_logs_configs<T, V>(mut self, v: T) -> Self
16610 where
16611 T: std::iter::IntoIterator<Item = V>,
16612 V: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16613 {
16614 use std::iter::Iterator;
16615 self.vpc_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
16616 self
16617 }
16618
16619 /// Sets the value of [next_page_token][crate::model::ListVpcFlowLogsConfigsResponse::next_page_token].
16620 ///
16621 /// # Example
16622 /// ```ignore,no_run
16623 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
16624 /// let x = ListVpcFlowLogsConfigsResponse::new().set_next_page_token("example");
16625 /// ```
16626 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16627 self.next_page_token = v.into();
16628 self
16629 }
16630
16631 /// Sets the value of [unreachable][crate::model::ListVpcFlowLogsConfigsResponse::unreachable].
16632 ///
16633 /// # Example
16634 /// ```ignore,no_run
16635 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
16636 /// let x = ListVpcFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
16637 /// ```
16638 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
16639 where
16640 T: std::iter::IntoIterator<Item = V>,
16641 V: std::convert::Into<std::string::String>,
16642 {
16643 use std::iter::Iterator;
16644 self.unreachable = v.into_iter().map(|i| i.into()).collect();
16645 self
16646 }
16647}
16648
16649impl wkt::message::Message for ListVpcFlowLogsConfigsResponse {
16650 fn typename() -> &'static str {
16651 "type.googleapis.com/google.cloud.networkmanagement.v1.ListVpcFlowLogsConfigsResponse"
16652 }
16653}
16654
16655#[doc(hidden)]
16656impl google_cloud_gax::paginator::internal::PageableResponse for ListVpcFlowLogsConfigsResponse {
16657 type PageItem = crate::model::VpcFlowLogsConfig;
16658
16659 fn items(self) -> std::vec::Vec<Self::PageItem> {
16660 self.vpc_flow_logs_configs
16661 }
16662
16663 fn next_page_token(&self) -> std::string::String {
16664 use std::clone::Clone;
16665 self.next_page_token.clone()
16666 }
16667}
16668
16669/// Request for the `GetVpcFlowLogsConfig` method.
16670#[derive(Clone, Default, PartialEq)]
16671#[non_exhaustive]
16672pub struct GetVpcFlowLogsConfigRequest {
16673 /// Required. The resource name of the VpcFlowLogsConfig,
16674 /// in one of the following formats:
16675 ///
16676 /// - For project-level resources:
16677 /// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
16678 ///
16679 /// - For organization-level resources:
16680 /// `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
16681 ///
16682 pub name: std::string::String,
16683
16684 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16685}
16686
16687impl GetVpcFlowLogsConfigRequest {
16688 /// Creates a new default instance.
16689 pub fn new() -> Self {
16690 std::default::Default::default()
16691 }
16692
16693 /// Sets the value of [name][crate::model::GetVpcFlowLogsConfigRequest::name].
16694 ///
16695 /// # Example
16696 /// ```ignore,no_run
16697 /// # use google_cloud_networkmanagement_v1::model::GetVpcFlowLogsConfigRequest;
16698 /// let x = GetVpcFlowLogsConfigRequest::new().set_name("example");
16699 /// ```
16700 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16701 self.name = v.into();
16702 self
16703 }
16704}
16705
16706impl wkt::message::Message for GetVpcFlowLogsConfigRequest {
16707 fn typename() -> &'static str {
16708 "type.googleapis.com/google.cloud.networkmanagement.v1.GetVpcFlowLogsConfigRequest"
16709 }
16710}
16711
16712/// Request for the `CreateVpcFlowLogsConfig` method.
16713#[derive(Clone, Default, PartialEq)]
16714#[non_exhaustive]
16715pub struct CreateVpcFlowLogsConfigRequest {
16716 /// Required. The parent resource of the VpcFlowLogsConfig to create,
16717 /// in one of the following formats:
16718 ///
16719 /// - For project-level resources: `projects/{project_id}/locations/global`
16720 ///
16721 /// - For organization-level resources:
16722 /// `organizations/{organization_id}/locations/global`
16723 ///
16724 pub parent: std::string::String,
16725
16726 /// Required. ID of the `VpcFlowLogsConfig`.
16727 pub vpc_flow_logs_config_id: std::string::String,
16728
16729 /// Required. A `VpcFlowLogsConfig` resource
16730 pub vpc_flow_logs_config: std::option::Option<crate::model::VpcFlowLogsConfig>,
16731
16732 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16733}
16734
16735impl CreateVpcFlowLogsConfigRequest {
16736 /// Creates a new default instance.
16737 pub fn new() -> Self {
16738 std::default::Default::default()
16739 }
16740
16741 /// Sets the value of [parent][crate::model::CreateVpcFlowLogsConfigRequest::parent].
16742 ///
16743 /// # Example
16744 /// ```ignore,no_run
16745 /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
16746 /// let x = CreateVpcFlowLogsConfigRequest::new().set_parent("example");
16747 /// ```
16748 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16749 self.parent = v.into();
16750 self
16751 }
16752
16753 /// Sets the value of [vpc_flow_logs_config_id][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config_id].
16754 ///
16755 /// # Example
16756 /// ```ignore,no_run
16757 /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
16758 /// let x = CreateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config_id("example");
16759 /// ```
16760 pub fn set_vpc_flow_logs_config_id<T: std::convert::Into<std::string::String>>(
16761 mut self,
16762 v: T,
16763 ) -> Self {
16764 self.vpc_flow_logs_config_id = v.into();
16765 self
16766 }
16767
16768 /// Sets the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
16769 ///
16770 /// # Example
16771 /// ```ignore,no_run
16772 /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
16773 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16774 /// let x = CreateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config(VpcFlowLogsConfig::default()/* use setters */);
16775 /// ```
16776 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
16777 where
16778 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16779 {
16780 self.vpc_flow_logs_config = std::option::Option::Some(v.into());
16781 self
16782 }
16783
16784 /// Sets or clears the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
16785 ///
16786 /// # Example
16787 /// ```ignore,no_run
16788 /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
16789 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16790 /// let x = CreateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(Some(VpcFlowLogsConfig::default()/* use setters */));
16791 /// let x = CreateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(None::<VpcFlowLogsConfig>);
16792 /// ```
16793 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
16794 where
16795 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16796 {
16797 self.vpc_flow_logs_config = v.map(|x| x.into());
16798 self
16799 }
16800}
16801
16802impl wkt::message::Message for CreateVpcFlowLogsConfigRequest {
16803 fn typename() -> &'static str {
16804 "type.googleapis.com/google.cloud.networkmanagement.v1.CreateVpcFlowLogsConfigRequest"
16805 }
16806}
16807
16808/// Request for the `UpdateVpcFlowLogsConfig` method.
16809#[derive(Clone, Default, PartialEq)]
16810#[non_exhaustive]
16811pub struct UpdateVpcFlowLogsConfigRequest {
16812 /// Required. Mask of fields to update. At least one path must be supplied in
16813 /// this field.
16814 /// For example, to change the state of the configuration to ENABLED, specify
16815 /// `update_mask` = `"state"`, and the `vpc_flow_logs_config` would be:
16816 /// `vpc_flow_logs_config = {
16817 /// name =
16818 /// "projects/my-project/locations/global/vpcFlowLogsConfigs/my-config"
16819 /// state = "ENABLED" }`
16820 pub update_mask: std::option::Option<wkt::FieldMask>,
16821
16822 /// Required. Only fields specified in update_mask are updated.
16823 pub vpc_flow_logs_config: std::option::Option<crate::model::VpcFlowLogsConfig>,
16824
16825 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16826}
16827
16828impl UpdateVpcFlowLogsConfigRequest {
16829 /// Creates a new default instance.
16830 pub fn new() -> Self {
16831 std::default::Default::default()
16832 }
16833
16834 /// Sets the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
16835 ///
16836 /// # Example
16837 /// ```ignore,no_run
16838 /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
16839 /// use wkt::FieldMask;
16840 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
16841 /// ```
16842 pub fn set_update_mask<T>(mut self, v: T) -> Self
16843 where
16844 T: std::convert::Into<wkt::FieldMask>,
16845 {
16846 self.update_mask = std::option::Option::Some(v.into());
16847 self
16848 }
16849
16850 /// Sets or clears the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
16851 ///
16852 /// # Example
16853 /// ```ignore,no_run
16854 /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
16855 /// use wkt::FieldMask;
16856 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
16857 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
16858 /// ```
16859 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16860 where
16861 T: std::convert::Into<wkt::FieldMask>,
16862 {
16863 self.update_mask = v.map(|x| x.into());
16864 self
16865 }
16866
16867 /// Sets the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
16868 ///
16869 /// # Example
16870 /// ```ignore,no_run
16871 /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
16872 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16873 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config(VpcFlowLogsConfig::default()/* use setters */);
16874 /// ```
16875 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
16876 where
16877 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16878 {
16879 self.vpc_flow_logs_config = std::option::Option::Some(v.into());
16880 self
16881 }
16882
16883 /// Sets or clears the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
16884 ///
16885 /// # Example
16886 /// ```ignore,no_run
16887 /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
16888 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16889 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(Some(VpcFlowLogsConfig::default()/* use setters */));
16890 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(None::<VpcFlowLogsConfig>);
16891 /// ```
16892 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
16893 where
16894 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
16895 {
16896 self.vpc_flow_logs_config = v.map(|x| x.into());
16897 self
16898 }
16899}
16900
16901impl wkt::message::Message for UpdateVpcFlowLogsConfigRequest {
16902 fn typename() -> &'static str {
16903 "type.googleapis.com/google.cloud.networkmanagement.v1.UpdateVpcFlowLogsConfigRequest"
16904 }
16905}
16906
16907/// Request for the `DeleteVpcFlowLogsConfig` method.
16908#[derive(Clone, Default, PartialEq)]
16909#[non_exhaustive]
16910pub struct DeleteVpcFlowLogsConfigRequest {
16911 /// Required. The resource name of the VpcFlowLogsConfig,
16912 /// in one of the following formats:
16913 ///
16914 /// - For a project-level resource:
16915 /// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
16916 ///
16917 /// - For an organization-level resource:
16918 /// `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
16919 ///
16920 pub name: std::string::String,
16921
16922 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16923}
16924
16925impl DeleteVpcFlowLogsConfigRequest {
16926 /// Creates a new default instance.
16927 pub fn new() -> Self {
16928 std::default::Default::default()
16929 }
16930
16931 /// Sets the value of [name][crate::model::DeleteVpcFlowLogsConfigRequest::name].
16932 ///
16933 /// # Example
16934 /// ```ignore,no_run
16935 /// # use google_cloud_networkmanagement_v1::model::DeleteVpcFlowLogsConfigRequest;
16936 /// let x = DeleteVpcFlowLogsConfigRequest::new().set_name("example");
16937 /// ```
16938 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16939 self.name = v.into();
16940 self
16941 }
16942}
16943
16944impl wkt::message::Message for DeleteVpcFlowLogsConfigRequest {
16945 fn typename() -> &'static str {
16946 "type.googleapis.com/google.cloud.networkmanagement.v1.DeleteVpcFlowLogsConfigRequest"
16947 }
16948}
16949
16950/// Request for the `QueryOrgVpcFlowLogsConfigs` method.
16951#[derive(Clone, Default, PartialEq)]
16952#[non_exhaustive]
16953pub struct QueryOrgVpcFlowLogsConfigsRequest {
16954 /// Required. The parent resource of the VpcFlowLogsConfig, specified in
16955 /// the following format: `projects/{project_id}/locations/global`
16956 pub parent: std::string::String,
16957
16958 /// Optional. Number of `VpcFlowLogsConfigs` to return.
16959 pub page_size: i32,
16960
16961 /// Optional. Page token from an earlier query, as returned in
16962 /// `next_page_token`.
16963 pub page_token: std::string::String,
16964
16965 /// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
16966 /// A filter expression must use the supported [CEL logic operators]
16967 /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
16968 pub filter: std::string::String,
16969
16970 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16971}
16972
16973impl QueryOrgVpcFlowLogsConfigsRequest {
16974 /// Creates a new default instance.
16975 pub fn new() -> Self {
16976 std::default::Default::default()
16977 }
16978
16979 /// Sets the value of [parent][crate::model::QueryOrgVpcFlowLogsConfigsRequest::parent].
16980 ///
16981 /// # Example
16982 /// ```ignore,no_run
16983 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
16984 /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_parent("example");
16985 /// ```
16986 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16987 self.parent = v.into();
16988 self
16989 }
16990
16991 /// Sets the value of [page_size][crate::model::QueryOrgVpcFlowLogsConfigsRequest::page_size].
16992 ///
16993 /// # Example
16994 /// ```ignore,no_run
16995 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
16996 /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_page_size(42);
16997 /// ```
16998 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16999 self.page_size = v.into();
17000 self
17001 }
17002
17003 /// Sets the value of [page_token][crate::model::QueryOrgVpcFlowLogsConfigsRequest::page_token].
17004 ///
17005 /// # Example
17006 /// ```ignore,no_run
17007 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
17008 /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_page_token("example");
17009 /// ```
17010 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17011 self.page_token = v.into();
17012 self
17013 }
17014
17015 /// Sets the value of [filter][crate::model::QueryOrgVpcFlowLogsConfigsRequest::filter].
17016 ///
17017 /// # Example
17018 /// ```ignore,no_run
17019 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
17020 /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_filter("example");
17021 /// ```
17022 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17023 self.filter = v.into();
17024 self
17025 }
17026}
17027
17028impl wkt::message::Message for QueryOrgVpcFlowLogsConfigsRequest {
17029 fn typename() -> &'static str {
17030 "type.googleapis.com/google.cloud.networkmanagement.v1.QueryOrgVpcFlowLogsConfigsRequest"
17031 }
17032}
17033
17034/// Response for the `QueryVpcFlowLogsConfigs` method.
17035#[derive(Clone, Default, PartialEq)]
17036#[non_exhaustive]
17037pub struct QueryOrgVpcFlowLogsConfigsResponse {
17038 /// List of VPC Flow Log configurations.
17039 pub vpc_flow_logs_configs: std::vec::Vec<crate::model::VpcFlowLogsConfig>,
17040
17041 /// Page token to fetch the next set of configurations.
17042 pub next_page_token: std::string::String,
17043
17044 /// Locations that could not be reached (when querying all locations with `-`).
17045 pub unreachable: std::vec::Vec<std::string::String>,
17046
17047 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17048}
17049
17050impl QueryOrgVpcFlowLogsConfigsResponse {
17051 /// Creates a new default instance.
17052 pub fn new() -> Self {
17053 std::default::Default::default()
17054 }
17055
17056 /// Sets the value of [vpc_flow_logs_configs][crate::model::QueryOrgVpcFlowLogsConfigsResponse::vpc_flow_logs_configs].
17057 ///
17058 /// # Example
17059 /// ```ignore,no_run
17060 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
17061 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17062 /// let x = QueryOrgVpcFlowLogsConfigsResponse::new()
17063 /// .set_vpc_flow_logs_configs([
17064 /// VpcFlowLogsConfig::default()/* use setters */,
17065 /// VpcFlowLogsConfig::default()/* use (different) setters */,
17066 /// ]);
17067 /// ```
17068 pub fn set_vpc_flow_logs_configs<T, V>(mut self, v: T) -> Self
17069 where
17070 T: std::iter::IntoIterator<Item = V>,
17071 V: std::convert::Into<crate::model::VpcFlowLogsConfig>,
17072 {
17073 use std::iter::Iterator;
17074 self.vpc_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
17075 self
17076 }
17077
17078 /// Sets the value of [next_page_token][crate::model::QueryOrgVpcFlowLogsConfigsResponse::next_page_token].
17079 ///
17080 /// # Example
17081 /// ```ignore,no_run
17082 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
17083 /// let x = QueryOrgVpcFlowLogsConfigsResponse::new().set_next_page_token("example");
17084 /// ```
17085 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17086 self.next_page_token = v.into();
17087 self
17088 }
17089
17090 /// Sets the value of [unreachable][crate::model::QueryOrgVpcFlowLogsConfigsResponse::unreachable].
17091 ///
17092 /// # Example
17093 /// ```ignore,no_run
17094 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
17095 /// let x = QueryOrgVpcFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
17096 /// ```
17097 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17098 where
17099 T: std::iter::IntoIterator<Item = V>,
17100 V: std::convert::Into<std::string::String>,
17101 {
17102 use std::iter::Iterator;
17103 self.unreachable = v.into_iter().map(|i| i.into()).collect();
17104 self
17105 }
17106}
17107
17108impl wkt::message::Message for QueryOrgVpcFlowLogsConfigsResponse {
17109 fn typename() -> &'static str {
17110 "type.googleapis.com/google.cloud.networkmanagement.v1.QueryOrgVpcFlowLogsConfigsResponse"
17111 }
17112}
17113
17114#[doc(hidden)]
17115impl google_cloud_gax::paginator::internal::PageableResponse
17116 for QueryOrgVpcFlowLogsConfigsResponse
17117{
17118 type PageItem = crate::model::VpcFlowLogsConfig;
17119
17120 fn items(self) -> std::vec::Vec<Self::PageItem> {
17121 self.vpc_flow_logs_configs
17122 }
17123
17124 fn next_page_token(&self) -> std::string::String {
17125 use std::clone::Clone;
17126 self.next_page_token.clone()
17127 }
17128}
17129
17130/// Request for the `ShowEffectiveFlowLogsConfigs` method.
17131#[derive(Clone, Default, PartialEq)]
17132#[non_exhaustive]
17133pub struct ShowEffectiveFlowLogsConfigsRequest {
17134 /// Required. The parent resource of the VpcFlowLogsConfig, specified in
17135 /// the following format: `projects/{project_id}/locations/global`
17136 pub parent: std::string::String,
17137
17138 /// Required. The resource to get the effective VPC Flow Logs configuration
17139 /// for. The resource must belong to the same project as the parent. The
17140 /// resource must be a network, subnetwork, interconnect attachment, VPN
17141 /// tunnel, or a project.
17142 pub resource: std::string::String,
17143
17144 /// Optional. Number of `EffectiveVpcFlowLogsConfigs` to return. Default is 30.
17145 pub page_size: i32,
17146
17147 /// Optional. Page token from an earlier query, as returned in
17148 /// `next_page_token`.
17149 pub page_token: std::string::String,
17150
17151 /// Optional. Lists the `EffectiveVpcFlowLogsConfigs` that match the filter
17152 /// expression. A filter expression must use the supported [CEL logic
17153 /// operators]
17154 /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
17155 pub filter: std::string::String,
17156
17157 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17158}
17159
17160impl ShowEffectiveFlowLogsConfigsRequest {
17161 /// Creates a new default instance.
17162 pub fn new() -> Self {
17163 std::default::Default::default()
17164 }
17165
17166 /// Sets the value of [parent][crate::model::ShowEffectiveFlowLogsConfigsRequest::parent].
17167 ///
17168 /// # Example
17169 /// ```ignore,no_run
17170 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17171 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_parent("example");
17172 /// ```
17173 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17174 self.parent = v.into();
17175 self
17176 }
17177
17178 /// Sets the value of [resource][crate::model::ShowEffectiveFlowLogsConfigsRequest::resource].
17179 ///
17180 /// # Example
17181 /// ```ignore,no_run
17182 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17183 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_resource("example");
17184 /// ```
17185 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17186 self.resource = v.into();
17187 self
17188 }
17189
17190 /// Sets the value of [page_size][crate::model::ShowEffectiveFlowLogsConfigsRequest::page_size].
17191 ///
17192 /// # Example
17193 /// ```ignore,no_run
17194 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17195 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_page_size(42);
17196 /// ```
17197 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17198 self.page_size = v.into();
17199 self
17200 }
17201
17202 /// Sets the value of [page_token][crate::model::ShowEffectiveFlowLogsConfigsRequest::page_token].
17203 ///
17204 /// # Example
17205 /// ```ignore,no_run
17206 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17207 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_page_token("example");
17208 /// ```
17209 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17210 self.page_token = v.into();
17211 self
17212 }
17213
17214 /// Sets the value of [filter][crate::model::ShowEffectiveFlowLogsConfigsRequest::filter].
17215 ///
17216 /// # Example
17217 /// ```ignore,no_run
17218 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17219 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_filter("example");
17220 /// ```
17221 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17222 self.filter = v.into();
17223 self
17224 }
17225}
17226
17227impl wkt::message::Message for ShowEffectiveFlowLogsConfigsRequest {
17228 fn typename() -> &'static str {
17229 "type.googleapis.com/google.cloud.networkmanagement.v1.ShowEffectiveFlowLogsConfigsRequest"
17230 }
17231}
17232
17233/// Response for the `ShowEffectiveFlowLogsConfigs` method.
17234#[derive(Clone, Default, PartialEq)]
17235#[non_exhaustive]
17236pub struct ShowEffectiveFlowLogsConfigsResponse {
17237 /// List of Effective Vpc Flow Logs configurations.
17238 pub effective_flow_logs_configs: std::vec::Vec<crate::model::EffectiveVpcFlowLogsConfig>,
17239
17240 /// Page token to fetch the next set of configurations.
17241 pub next_page_token: std::string::String,
17242
17243 /// Locations that could not be reached (when querying all locations with `-`).
17244 pub unreachable: std::vec::Vec<std::string::String>,
17245
17246 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17247}
17248
17249impl ShowEffectiveFlowLogsConfigsResponse {
17250 /// Creates a new default instance.
17251 pub fn new() -> Self {
17252 std::default::Default::default()
17253 }
17254
17255 /// Sets the value of [effective_flow_logs_configs][crate::model::ShowEffectiveFlowLogsConfigsResponse::effective_flow_logs_configs].
17256 ///
17257 /// # Example
17258 /// ```ignore,no_run
17259 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
17260 /// use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17261 /// let x = ShowEffectiveFlowLogsConfigsResponse::new()
17262 /// .set_effective_flow_logs_configs([
17263 /// EffectiveVpcFlowLogsConfig::default()/* use setters */,
17264 /// EffectiveVpcFlowLogsConfig::default()/* use (different) setters */,
17265 /// ]);
17266 /// ```
17267 pub fn set_effective_flow_logs_configs<T, V>(mut self, v: T) -> Self
17268 where
17269 T: std::iter::IntoIterator<Item = V>,
17270 V: std::convert::Into<crate::model::EffectiveVpcFlowLogsConfig>,
17271 {
17272 use std::iter::Iterator;
17273 self.effective_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
17274 self
17275 }
17276
17277 /// Sets the value of [next_page_token][crate::model::ShowEffectiveFlowLogsConfigsResponse::next_page_token].
17278 ///
17279 /// # Example
17280 /// ```ignore,no_run
17281 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
17282 /// let x = ShowEffectiveFlowLogsConfigsResponse::new().set_next_page_token("example");
17283 /// ```
17284 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17285 self.next_page_token = v.into();
17286 self
17287 }
17288
17289 /// Sets the value of [unreachable][crate::model::ShowEffectiveFlowLogsConfigsResponse::unreachable].
17290 ///
17291 /// # Example
17292 /// ```ignore,no_run
17293 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
17294 /// let x = ShowEffectiveFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
17295 /// ```
17296 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17297 where
17298 T: std::iter::IntoIterator<Item = V>,
17299 V: std::convert::Into<std::string::String>,
17300 {
17301 use std::iter::Iterator;
17302 self.unreachable = v.into_iter().map(|i| i.into()).collect();
17303 self
17304 }
17305}
17306
17307impl wkt::message::Message for ShowEffectiveFlowLogsConfigsResponse {
17308 fn typename() -> &'static str {
17309 "type.googleapis.com/google.cloud.networkmanagement.v1.ShowEffectiveFlowLogsConfigsResponse"
17310 }
17311}
17312
17313#[doc(hidden)]
17314impl google_cloud_gax::paginator::internal::PageableResponse
17315 for ShowEffectiveFlowLogsConfigsResponse
17316{
17317 type PageItem = crate::model::EffectiveVpcFlowLogsConfig;
17318
17319 fn items(self) -> std::vec::Vec<Self::PageItem> {
17320 self.effective_flow_logs_configs
17321 }
17322
17323 fn next_page_token(&self) -> std::string::String {
17324 use std::clone::Clone;
17325 self.next_page_token.clone()
17326 }
17327}
17328
17329/// A configuration to generate VPC Flow Logs.
17330#[derive(Clone, Default, PartialEq)]
17331#[non_exhaustive]
17332pub struct VpcFlowLogsConfig {
17333 /// Identifier. Unique name of the configuration. The name can have one of the
17334 /// following forms:
17335 ///
17336 /// - For project-level configurations:
17337 /// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
17338 ///
17339 /// - For organization-level configurations:
17340 /// `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
17341 ///
17342 pub name: std::string::String,
17343
17344 /// Optional. The user-supplied description of the VPC Flow Logs configuration.
17345 /// Maximum of 512 characters.
17346 pub description: std::option::Option<std::string::String>,
17347
17348 /// Optional. The state of the VPC Flow Log configuration. Default value is
17349 /// ENABLED. When creating a new configuration, it must be enabled. Setting
17350 /// state=DISABLED will pause the log generation for this config.
17351 pub state: std::option::Option<crate::model::vpc_flow_logs_config::State>,
17352
17353 /// Optional. The aggregation interval for the logs. Default value is
17354 /// INTERVAL_5_SEC.
17355 pub aggregation_interval:
17356 std::option::Option<crate::model::vpc_flow_logs_config::AggregationInterval>,
17357
17358 /// Optional. The value of the field must be in (0, 1]. The sampling rate of
17359 /// VPC Flow Logs where 1.0 means all collected logs are reported. Setting the
17360 /// sampling rate to 0.0 is not allowed. If you want to disable VPC Flow Logs,
17361 /// use the state field instead. Default value is 1.0.
17362 pub flow_sampling: std::option::Option<f32>,
17363
17364 /// Optional. Configures whether all, none or a subset of metadata fields
17365 /// should be added to the reported VPC flow logs. Default value is
17366 /// INCLUDE_ALL_METADATA.
17367 pub metadata: std::option::Option<crate::model::vpc_flow_logs_config::Metadata>,
17368
17369 /// Optional. Custom metadata fields to include in the reported VPC flow logs.
17370 /// Can only be specified if "metadata" was set to CUSTOM_METADATA.
17371 pub metadata_fields: std::vec::Vec<std::string::String>,
17372
17373 /// Optional. Export filter used to define which VPC Flow Logs should be
17374 /// logged.
17375 pub filter_expr: std::option::Option<std::string::String>,
17376
17377 /// Optional. Determines whether to include cross project annotations in the
17378 /// logs. This field is available only for organization configurations. If not
17379 /// specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
17380 pub cross_project_metadata:
17381 std::option::Option<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
17382
17383 /// Output only. Describes the state of the configured target resource for
17384 /// diagnostic purposes.
17385 pub target_resource_state:
17386 std::option::Option<crate::model::vpc_flow_logs_config::TargetResourceState>,
17387
17388 /// Optional. Resource labels to represent user-provided metadata.
17389 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
17390
17391 /// Output only. The time the config was created.
17392 pub create_time: std::option::Option<wkt::Timestamp>,
17393
17394 /// Output only. The time the config was updated.
17395 pub update_time: std::option::Option<wkt::Timestamp>,
17396
17397 /// Reference to the resource of the config scope. That is, the scope from
17398 /// which traffic is logged. The target resource must belong to the same
17399 /// project as the configuration.
17400 /// This field is not supported for organization level configurations.
17401 pub target_resource: std::option::Option<crate::model::vpc_flow_logs_config::TargetResource>,
17402
17403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17404}
17405
17406impl VpcFlowLogsConfig {
17407 /// Creates a new default instance.
17408 pub fn new() -> Self {
17409 std::default::Default::default()
17410 }
17411
17412 /// Sets the value of [name][crate::model::VpcFlowLogsConfig::name].
17413 ///
17414 /// # Example
17415 /// ```ignore,no_run
17416 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17417 /// let x = VpcFlowLogsConfig::new().set_name("example");
17418 /// ```
17419 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17420 self.name = v.into();
17421 self
17422 }
17423
17424 /// Sets the value of [description][crate::model::VpcFlowLogsConfig::description].
17425 ///
17426 /// # Example
17427 /// ```ignore,no_run
17428 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17429 /// let x = VpcFlowLogsConfig::new().set_description("example");
17430 /// ```
17431 pub fn set_description<T>(mut self, v: T) -> Self
17432 where
17433 T: std::convert::Into<std::string::String>,
17434 {
17435 self.description = std::option::Option::Some(v.into());
17436 self
17437 }
17438
17439 /// Sets or clears the value of [description][crate::model::VpcFlowLogsConfig::description].
17440 ///
17441 /// # Example
17442 /// ```ignore,no_run
17443 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17444 /// let x = VpcFlowLogsConfig::new().set_or_clear_description(Some("example"));
17445 /// let x = VpcFlowLogsConfig::new().set_or_clear_description(None::<String>);
17446 /// ```
17447 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
17448 where
17449 T: std::convert::Into<std::string::String>,
17450 {
17451 self.description = v.map(|x| x.into());
17452 self
17453 }
17454
17455 /// Sets the value of [state][crate::model::VpcFlowLogsConfig::state].
17456 ///
17457 /// # Example
17458 /// ```ignore,no_run
17459 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17460 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
17461 /// let x0 = VpcFlowLogsConfig::new().set_state(State::Enabled);
17462 /// let x1 = VpcFlowLogsConfig::new().set_state(State::Disabled);
17463 /// ```
17464 pub fn set_state<T>(mut self, v: T) -> Self
17465 where
17466 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
17467 {
17468 self.state = std::option::Option::Some(v.into());
17469 self
17470 }
17471
17472 /// Sets or clears the value of [state][crate::model::VpcFlowLogsConfig::state].
17473 ///
17474 /// # Example
17475 /// ```ignore,no_run
17476 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17477 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
17478 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_state(Some(State::Enabled));
17479 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_state(Some(State::Disabled));
17480 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_state(None::<State>);
17481 /// ```
17482 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
17483 where
17484 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
17485 {
17486 self.state = v.map(|x| x.into());
17487 self
17488 }
17489
17490 /// Sets the value of [aggregation_interval][crate::model::VpcFlowLogsConfig::aggregation_interval].
17491 ///
17492 /// # Example
17493 /// ```ignore,no_run
17494 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17495 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
17496 /// let x0 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval5Sec);
17497 /// let x1 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval30Sec);
17498 /// let x2 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval1Min);
17499 /// ```
17500 pub fn set_aggregation_interval<T>(mut self, v: T) -> Self
17501 where
17502 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
17503 {
17504 self.aggregation_interval = std::option::Option::Some(v.into());
17505 self
17506 }
17507
17508 /// Sets or clears the value of [aggregation_interval][crate::model::VpcFlowLogsConfig::aggregation_interval].
17509 ///
17510 /// # Example
17511 /// ```ignore,no_run
17512 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17513 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
17514 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval5Sec));
17515 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval30Sec));
17516 /// let x2 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval1Min));
17517 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(None::<AggregationInterval>);
17518 /// ```
17519 pub fn set_or_clear_aggregation_interval<T>(mut self, v: std::option::Option<T>) -> Self
17520 where
17521 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
17522 {
17523 self.aggregation_interval = v.map(|x| x.into());
17524 self
17525 }
17526
17527 /// Sets the value of [flow_sampling][crate::model::VpcFlowLogsConfig::flow_sampling].
17528 ///
17529 /// # Example
17530 /// ```ignore,no_run
17531 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17532 /// let x = VpcFlowLogsConfig::new().set_flow_sampling(42.0);
17533 /// ```
17534 pub fn set_flow_sampling<T>(mut self, v: T) -> Self
17535 where
17536 T: std::convert::Into<f32>,
17537 {
17538 self.flow_sampling = std::option::Option::Some(v.into());
17539 self
17540 }
17541
17542 /// Sets or clears the value of [flow_sampling][crate::model::VpcFlowLogsConfig::flow_sampling].
17543 ///
17544 /// # Example
17545 /// ```ignore,no_run
17546 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17547 /// let x = VpcFlowLogsConfig::new().set_or_clear_flow_sampling(Some(42.0));
17548 /// let x = VpcFlowLogsConfig::new().set_or_clear_flow_sampling(None::<f32>);
17549 /// ```
17550 pub fn set_or_clear_flow_sampling<T>(mut self, v: std::option::Option<T>) -> Self
17551 where
17552 T: std::convert::Into<f32>,
17553 {
17554 self.flow_sampling = v.map(|x| x.into());
17555 self
17556 }
17557
17558 /// Sets the value of [metadata][crate::model::VpcFlowLogsConfig::metadata].
17559 ///
17560 /// # Example
17561 /// ```ignore,no_run
17562 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17563 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
17564 /// let x0 = VpcFlowLogsConfig::new().set_metadata(Metadata::IncludeAllMetadata);
17565 /// let x1 = VpcFlowLogsConfig::new().set_metadata(Metadata::ExcludeAllMetadata);
17566 /// let x2 = VpcFlowLogsConfig::new().set_metadata(Metadata::CustomMetadata);
17567 /// ```
17568 pub fn set_metadata<T>(mut self, v: T) -> Self
17569 where
17570 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
17571 {
17572 self.metadata = std::option::Option::Some(v.into());
17573 self
17574 }
17575
17576 /// Sets or clears the value of [metadata][crate::model::VpcFlowLogsConfig::metadata].
17577 ///
17578 /// # Example
17579 /// ```ignore,no_run
17580 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17581 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
17582 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::IncludeAllMetadata));
17583 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::ExcludeAllMetadata));
17584 /// let x2 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::CustomMetadata));
17585 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_metadata(None::<Metadata>);
17586 /// ```
17587 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
17588 where
17589 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
17590 {
17591 self.metadata = v.map(|x| x.into());
17592 self
17593 }
17594
17595 /// Sets the value of [metadata_fields][crate::model::VpcFlowLogsConfig::metadata_fields].
17596 ///
17597 /// # Example
17598 /// ```ignore,no_run
17599 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17600 /// let x = VpcFlowLogsConfig::new().set_metadata_fields(["a", "b", "c"]);
17601 /// ```
17602 pub fn set_metadata_fields<T, V>(mut self, v: T) -> Self
17603 where
17604 T: std::iter::IntoIterator<Item = V>,
17605 V: std::convert::Into<std::string::String>,
17606 {
17607 use std::iter::Iterator;
17608 self.metadata_fields = v.into_iter().map(|i| i.into()).collect();
17609 self
17610 }
17611
17612 /// Sets the value of [filter_expr][crate::model::VpcFlowLogsConfig::filter_expr].
17613 ///
17614 /// # Example
17615 /// ```ignore,no_run
17616 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17617 /// let x = VpcFlowLogsConfig::new().set_filter_expr("example");
17618 /// ```
17619 pub fn set_filter_expr<T>(mut self, v: T) -> Self
17620 where
17621 T: std::convert::Into<std::string::String>,
17622 {
17623 self.filter_expr = std::option::Option::Some(v.into());
17624 self
17625 }
17626
17627 /// Sets or clears the value of [filter_expr][crate::model::VpcFlowLogsConfig::filter_expr].
17628 ///
17629 /// # Example
17630 /// ```ignore,no_run
17631 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17632 /// let x = VpcFlowLogsConfig::new().set_or_clear_filter_expr(Some("example"));
17633 /// let x = VpcFlowLogsConfig::new().set_or_clear_filter_expr(None::<String>);
17634 /// ```
17635 pub fn set_or_clear_filter_expr<T>(mut self, v: std::option::Option<T>) -> Self
17636 where
17637 T: std::convert::Into<std::string::String>,
17638 {
17639 self.filter_expr = v.map(|x| x.into());
17640 self
17641 }
17642
17643 /// Sets the value of [cross_project_metadata][crate::model::VpcFlowLogsConfig::cross_project_metadata].
17644 ///
17645 /// # Example
17646 /// ```ignore,no_run
17647 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17648 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
17649 /// let x0 = VpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Enabled);
17650 /// let x1 = VpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Disabled);
17651 /// ```
17652 pub fn set_cross_project_metadata<T>(mut self, v: T) -> Self
17653 where
17654 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
17655 {
17656 self.cross_project_metadata = std::option::Option::Some(v.into());
17657 self
17658 }
17659
17660 /// Sets or clears the value of [cross_project_metadata][crate::model::VpcFlowLogsConfig::cross_project_metadata].
17661 ///
17662 /// # Example
17663 /// ```ignore,no_run
17664 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17665 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
17666 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Enabled));
17667 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Disabled));
17668 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(None::<CrossProjectMetadata>);
17669 /// ```
17670 pub fn set_or_clear_cross_project_metadata<T>(mut self, v: std::option::Option<T>) -> Self
17671 where
17672 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
17673 {
17674 self.cross_project_metadata = v.map(|x| x.into());
17675 self
17676 }
17677
17678 /// Sets the value of [target_resource_state][crate::model::VpcFlowLogsConfig::target_resource_state].
17679 ///
17680 /// # Example
17681 /// ```ignore,no_run
17682 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17683 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResourceState;
17684 /// let x0 = VpcFlowLogsConfig::new().set_target_resource_state(TargetResourceState::TargetResourceExists);
17685 /// let x1 = VpcFlowLogsConfig::new().set_target_resource_state(TargetResourceState::TargetResourceDoesNotExist);
17686 /// ```
17687 pub fn set_target_resource_state<T>(mut self, v: T) -> Self
17688 where
17689 T: std::convert::Into<crate::model::vpc_flow_logs_config::TargetResourceState>,
17690 {
17691 self.target_resource_state = std::option::Option::Some(v.into());
17692 self
17693 }
17694
17695 /// Sets or clears the value of [target_resource_state][crate::model::VpcFlowLogsConfig::target_resource_state].
17696 ///
17697 /// # Example
17698 /// ```ignore,no_run
17699 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17700 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResourceState;
17701 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(Some(TargetResourceState::TargetResourceExists));
17702 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(Some(TargetResourceState::TargetResourceDoesNotExist));
17703 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(None::<TargetResourceState>);
17704 /// ```
17705 pub fn set_or_clear_target_resource_state<T>(mut self, v: std::option::Option<T>) -> Self
17706 where
17707 T: std::convert::Into<crate::model::vpc_flow_logs_config::TargetResourceState>,
17708 {
17709 self.target_resource_state = v.map(|x| x.into());
17710 self
17711 }
17712
17713 /// Sets the value of [labels][crate::model::VpcFlowLogsConfig::labels].
17714 ///
17715 /// # Example
17716 /// ```ignore,no_run
17717 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17718 /// let x = VpcFlowLogsConfig::new().set_labels([
17719 /// ("key0", "abc"),
17720 /// ("key1", "xyz"),
17721 /// ]);
17722 /// ```
17723 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
17724 where
17725 T: std::iter::IntoIterator<Item = (K, V)>,
17726 K: std::convert::Into<std::string::String>,
17727 V: std::convert::Into<std::string::String>,
17728 {
17729 use std::iter::Iterator;
17730 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17731 self
17732 }
17733
17734 /// Sets the value of [create_time][crate::model::VpcFlowLogsConfig::create_time].
17735 ///
17736 /// # Example
17737 /// ```ignore,no_run
17738 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17739 /// use wkt::Timestamp;
17740 /// let x = VpcFlowLogsConfig::new().set_create_time(Timestamp::default()/* use setters */);
17741 /// ```
17742 pub fn set_create_time<T>(mut self, v: T) -> Self
17743 where
17744 T: std::convert::Into<wkt::Timestamp>,
17745 {
17746 self.create_time = std::option::Option::Some(v.into());
17747 self
17748 }
17749
17750 /// Sets or clears the value of [create_time][crate::model::VpcFlowLogsConfig::create_time].
17751 ///
17752 /// # Example
17753 /// ```ignore,no_run
17754 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17755 /// use wkt::Timestamp;
17756 /// let x = VpcFlowLogsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17757 /// let x = VpcFlowLogsConfig::new().set_or_clear_create_time(None::<Timestamp>);
17758 /// ```
17759 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17760 where
17761 T: std::convert::Into<wkt::Timestamp>,
17762 {
17763 self.create_time = v.map(|x| x.into());
17764 self
17765 }
17766
17767 /// Sets the value of [update_time][crate::model::VpcFlowLogsConfig::update_time].
17768 ///
17769 /// # Example
17770 /// ```ignore,no_run
17771 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17772 /// use wkt::Timestamp;
17773 /// let x = VpcFlowLogsConfig::new().set_update_time(Timestamp::default()/* use setters */);
17774 /// ```
17775 pub fn set_update_time<T>(mut self, v: T) -> Self
17776 where
17777 T: std::convert::Into<wkt::Timestamp>,
17778 {
17779 self.update_time = std::option::Option::Some(v.into());
17780 self
17781 }
17782
17783 /// Sets or clears the value of [update_time][crate::model::VpcFlowLogsConfig::update_time].
17784 ///
17785 /// # Example
17786 /// ```ignore,no_run
17787 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17788 /// use wkt::Timestamp;
17789 /// let x = VpcFlowLogsConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
17790 /// let x = VpcFlowLogsConfig::new().set_or_clear_update_time(None::<Timestamp>);
17791 /// ```
17792 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
17793 where
17794 T: std::convert::Into<wkt::Timestamp>,
17795 {
17796 self.update_time = v.map(|x| x.into());
17797 self
17798 }
17799
17800 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource].
17801 ///
17802 /// Note that all the setters affecting `target_resource` are mutually
17803 /// exclusive.
17804 ///
17805 /// # Example
17806 /// ```ignore,no_run
17807 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17808 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResource;
17809 /// let x = VpcFlowLogsConfig::new().set_target_resource(Some(TargetResource::Network("example".to_string())));
17810 /// ```
17811 pub fn set_target_resource<
17812 T: std::convert::Into<std::option::Option<crate::model::vpc_flow_logs_config::TargetResource>>,
17813 >(
17814 mut self,
17815 v: T,
17816 ) -> Self {
17817 self.target_resource = v.into();
17818 self
17819 }
17820
17821 /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17822 /// if it holds a `Network`, `None` if the field is not set or
17823 /// holds a different branch.
17824 pub fn network(&self) -> std::option::Option<&std::string::String> {
17825 #[allow(unreachable_patterns)]
17826 self.target_resource.as_ref().and_then(|v| match v {
17827 crate::model::vpc_flow_logs_config::TargetResource::Network(v) => {
17828 std::option::Option::Some(v)
17829 }
17830 _ => std::option::Option::None,
17831 })
17832 }
17833
17834 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17835 /// to hold a `Network`.
17836 ///
17837 /// Note that all the setters affecting `target_resource` are
17838 /// mutually exclusive.
17839 ///
17840 /// # Example
17841 /// ```ignore,no_run
17842 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17843 /// let x = VpcFlowLogsConfig::new().set_network("example");
17844 /// assert!(x.network().is_some());
17845 /// assert!(x.subnet().is_none());
17846 /// assert!(x.interconnect_attachment().is_none());
17847 /// assert!(x.vpn_tunnel().is_none());
17848 /// ```
17849 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17850 self.target_resource = std::option::Option::Some(
17851 crate::model::vpc_flow_logs_config::TargetResource::Network(v.into()),
17852 );
17853 self
17854 }
17855
17856 /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17857 /// if it holds a `Subnet`, `None` if the field is not set or
17858 /// holds a different branch.
17859 pub fn subnet(&self) -> std::option::Option<&std::string::String> {
17860 #[allow(unreachable_patterns)]
17861 self.target_resource.as_ref().and_then(|v| match v {
17862 crate::model::vpc_flow_logs_config::TargetResource::Subnet(v) => {
17863 std::option::Option::Some(v)
17864 }
17865 _ => std::option::Option::None,
17866 })
17867 }
17868
17869 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17870 /// to hold a `Subnet`.
17871 ///
17872 /// Note that all the setters affecting `target_resource` are
17873 /// mutually exclusive.
17874 ///
17875 /// # Example
17876 /// ```ignore,no_run
17877 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17878 /// let x = VpcFlowLogsConfig::new().set_subnet("example");
17879 /// assert!(x.subnet().is_some());
17880 /// assert!(x.network().is_none());
17881 /// assert!(x.interconnect_attachment().is_none());
17882 /// assert!(x.vpn_tunnel().is_none());
17883 /// ```
17884 pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17885 self.target_resource = std::option::Option::Some(
17886 crate::model::vpc_flow_logs_config::TargetResource::Subnet(v.into()),
17887 );
17888 self
17889 }
17890
17891 /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17892 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
17893 /// holds a different branch.
17894 pub fn interconnect_attachment(&self) -> std::option::Option<&std::string::String> {
17895 #[allow(unreachable_patterns)]
17896 self.target_resource.as_ref().and_then(|v| match v {
17897 crate::model::vpc_flow_logs_config::TargetResource::InterconnectAttachment(v) => {
17898 std::option::Option::Some(v)
17899 }
17900 _ => std::option::Option::None,
17901 })
17902 }
17903
17904 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17905 /// to hold a `InterconnectAttachment`.
17906 ///
17907 /// Note that all the setters affecting `target_resource` are
17908 /// mutually exclusive.
17909 ///
17910 /// # Example
17911 /// ```ignore,no_run
17912 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17913 /// let x = VpcFlowLogsConfig::new().set_interconnect_attachment("example");
17914 /// assert!(x.interconnect_attachment().is_some());
17915 /// assert!(x.network().is_none());
17916 /// assert!(x.subnet().is_none());
17917 /// assert!(x.vpn_tunnel().is_none());
17918 /// ```
17919 pub fn set_interconnect_attachment<T: std::convert::Into<std::string::String>>(
17920 mut self,
17921 v: T,
17922 ) -> Self {
17923 self.target_resource = std::option::Option::Some(
17924 crate::model::vpc_flow_logs_config::TargetResource::InterconnectAttachment(v.into()),
17925 );
17926 self
17927 }
17928
17929 /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17930 /// if it holds a `VpnTunnel`, `None` if the field is not set or
17931 /// holds a different branch.
17932 pub fn vpn_tunnel(&self) -> std::option::Option<&std::string::String> {
17933 #[allow(unreachable_patterns)]
17934 self.target_resource.as_ref().and_then(|v| match v {
17935 crate::model::vpc_flow_logs_config::TargetResource::VpnTunnel(v) => {
17936 std::option::Option::Some(v)
17937 }
17938 _ => std::option::Option::None,
17939 })
17940 }
17941
17942 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
17943 /// to hold a `VpnTunnel`.
17944 ///
17945 /// Note that all the setters affecting `target_resource` are
17946 /// mutually exclusive.
17947 ///
17948 /// # Example
17949 /// ```ignore,no_run
17950 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17951 /// let x = VpcFlowLogsConfig::new().set_vpn_tunnel("example");
17952 /// assert!(x.vpn_tunnel().is_some());
17953 /// assert!(x.network().is_none());
17954 /// assert!(x.subnet().is_none());
17955 /// assert!(x.interconnect_attachment().is_none());
17956 /// ```
17957 pub fn set_vpn_tunnel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17958 self.target_resource = std::option::Option::Some(
17959 crate::model::vpc_flow_logs_config::TargetResource::VpnTunnel(v.into()),
17960 );
17961 self
17962 }
17963}
17964
17965impl wkt::message::Message for VpcFlowLogsConfig {
17966 fn typename() -> &'static str {
17967 "type.googleapis.com/google.cloud.networkmanagement.v1.VpcFlowLogsConfig"
17968 }
17969}
17970
17971/// Defines additional types related to [VpcFlowLogsConfig].
17972pub mod vpc_flow_logs_config {
17973 #[allow(unused_imports)]
17974 use super::*;
17975
17976 /// Determines whether this configuration will be generating logs.
17977 ///
17978 /// # Working with unknown values
17979 ///
17980 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17981 /// additional enum variants at any time. Adding new variants is not considered
17982 /// a breaking change. Applications should write their code in anticipation of:
17983 ///
17984 /// - New values appearing in future releases of the client library, **and**
17985 /// - New values received dynamically, without application changes.
17986 ///
17987 /// Please consult the [Working with enums] section in the user guide for some
17988 /// guidelines.
17989 ///
17990 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17991 #[derive(Clone, Debug, PartialEq)]
17992 #[non_exhaustive]
17993 pub enum State {
17994 /// If not specified, will default to ENABLED.
17995 Unspecified,
17996 /// When ENABLED, this configuration will generate logs.
17997 Enabled,
17998 /// When DISABLED, this configuration will not generate logs.
17999 Disabled,
18000 /// If set, the enum was initialized with an unknown value.
18001 ///
18002 /// Applications can examine the value using [State::value] or
18003 /// [State::name].
18004 UnknownValue(state::UnknownValue),
18005 }
18006
18007 #[doc(hidden)]
18008 pub mod state {
18009 #[allow(unused_imports)]
18010 use super::*;
18011 #[derive(Clone, Debug, PartialEq)]
18012 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18013 }
18014
18015 impl State {
18016 /// Gets the enum value.
18017 ///
18018 /// Returns `None` if the enum contains an unknown value deserialized from
18019 /// the string representation of enums.
18020 pub fn value(&self) -> std::option::Option<i32> {
18021 match self {
18022 Self::Unspecified => std::option::Option::Some(0),
18023 Self::Enabled => std::option::Option::Some(1),
18024 Self::Disabled => std::option::Option::Some(2),
18025 Self::UnknownValue(u) => u.0.value(),
18026 }
18027 }
18028
18029 /// Gets the enum value as a string.
18030 ///
18031 /// Returns `None` if the enum contains an unknown value deserialized from
18032 /// the integer representation of enums.
18033 pub fn name(&self) -> std::option::Option<&str> {
18034 match self {
18035 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18036 Self::Enabled => std::option::Option::Some("ENABLED"),
18037 Self::Disabled => std::option::Option::Some("DISABLED"),
18038 Self::UnknownValue(u) => u.0.name(),
18039 }
18040 }
18041 }
18042
18043 impl std::default::Default for State {
18044 fn default() -> Self {
18045 use std::convert::From;
18046 Self::from(0)
18047 }
18048 }
18049
18050 impl std::fmt::Display for State {
18051 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18052 wkt::internal::display_enum(f, self.name(), self.value())
18053 }
18054 }
18055
18056 impl std::convert::From<i32> for State {
18057 fn from(value: i32) -> Self {
18058 match value {
18059 0 => Self::Unspecified,
18060 1 => Self::Enabled,
18061 2 => Self::Disabled,
18062 _ => Self::UnknownValue(state::UnknownValue(
18063 wkt::internal::UnknownEnumValue::Integer(value),
18064 )),
18065 }
18066 }
18067 }
18068
18069 impl std::convert::From<&str> for State {
18070 fn from(value: &str) -> Self {
18071 use std::string::ToString;
18072 match value {
18073 "STATE_UNSPECIFIED" => Self::Unspecified,
18074 "ENABLED" => Self::Enabled,
18075 "DISABLED" => Self::Disabled,
18076 _ => Self::UnknownValue(state::UnknownValue(
18077 wkt::internal::UnknownEnumValue::String(value.to_string()),
18078 )),
18079 }
18080 }
18081 }
18082
18083 impl serde::ser::Serialize for State {
18084 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18085 where
18086 S: serde::Serializer,
18087 {
18088 match self {
18089 Self::Unspecified => serializer.serialize_i32(0),
18090 Self::Enabled => serializer.serialize_i32(1),
18091 Self::Disabled => serializer.serialize_i32(2),
18092 Self::UnknownValue(u) => u.0.serialize(serializer),
18093 }
18094 }
18095 }
18096
18097 impl<'de> serde::de::Deserialize<'de> for State {
18098 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18099 where
18100 D: serde::Deserializer<'de>,
18101 {
18102 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18103 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.State",
18104 ))
18105 }
18106 }
18107
18108 /// Toggles the aggregation interval for collecting flow logs by 5-tuple.
18109 ///
18110 /// # Working with unknown values
18111 ///
18112 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18113 /// additional enum variants at any time. Adding new variants is not considered
18114 /// a breaking change. Applications should write their code in anticipation of:
18115 ///
18116 /// - New values appearing in future releases of the client library, **and**
18117 /// - New values received dynamically, without application changes.
18118 ///
18119 /// Please consult the [Working with enums] section in the user guide for some
18120 /// guidelines.
18121 ///
18122 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18123 #[derive(Clone, Debug, PartialEq)]
18124 #[non_exhaustive]
18125 pub enum AggregationInterval {
18126 /// If not specified, will default to INTERVAL_5_SEC.
18127 Unspecified,
18128 /// Aggregate logs in 5s intervals.
18129 Interval5Sec,
18130 /// Aggregate logs in 30s intervals.
18131 Interval30Sec,
18132 /// Aggregate logs in 1m intervals.
18133 Interval1Min,
18134 /// Aggregate logs in 5m intervals.
18135 Interval5Min,
18136 /// Aggregate logs in 10m intervals.
18137 Interval10Min,
18138 /// Aggregate logs in 15m intervals.
18139 Interval15Min,
18140 /// If set, the enum was initialized with an unknown value.
18141 ///
18142 /// Applications can examine the value using [AggregationInterval::value] or
18143 /// [AggregationInterval::name].
18144 UnknownValue(aggregation_interval::UnknownValue),
18145 }
18146
18147 #[doc(hidden)]
18148 pub mod aggregation_interval {
18149 #[allow(unused_imports)]
18150 use super::*;
18151 #[derive(Clone, Debug, PartialEq)]
18152 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18153 }
18154
18155 impl AggregationInterval {
18156 /// Gets the enum value.
18157 ///
18158 /// Returns `None` if the enum contains an unknown value deserialized from
18159 /// the string representation of enums.
18160 pub fn value(&self) -> std::option::Option<i32> {
18161 match self {
18162 Self::Unspecified => std::option::Option::Some(0),
18163 Self::Interval5Sec => std::option::Option::Some(1),
18164 Self::Interval30Sec => std::option::Option::Some(2),
18165 Self::Interval1Min => std::option::Option::Some(3),
18166 Self::Interval5Min => std::option::Option::Some(4),
18167 Self::Interval10Min => std::option::Option::Some(5),
18168 Self::Interval15Min => std::option::Option::Some(6),
18169 Self::UnknownValue(u) => u.0.value(),
18170 }
18171 }
18172
18173 /// Gets the enum value as a string.
18174 ///
18175 /// Returns `None` if the enum contains an unknown value deserialized from
18176 /// the integer representation of enums.
18177 pub fn name(&self) -> std::option::Option<&str> {
18178 match self {
18179 Self::Unspecified => std::option::Option::Some("AGGREGATION_INTERVAL_UNSPECIFIED"),
18180 Self::Interval5Sec => std::option::Option::Some("INTERVAL_5_SEC"),
18181 Self::Interval30Sec => std::option::Option::Some("INTERVAL_30_SEC"),
18182 Self::Interval1Min => std::option::Option::Some("INTERVAL_1_MIN"),
18183 Self::Interval5Min => std::option::Option::Some("INTERVAL_5_MIN"),
18184 Self::Interval10Min => std::option::Option::Some("INTERVAL_10_MIN"),
18185 Self::Interval15Min => std::option::Option::Some("INTERVAL_15_MIN"),
18186 Self::UnknownValue(u) => u.0.name(),
18187 }
18188 }
18189 }
18190
18191 impl std::default::Default for AggregationInterval {
18192 fn default() -> Self {
18193 use std::convert::From;
18194 Self::from(0)
18195 }
18196 }
18197
18198 impl std::fmt::Display for AggregationInterval {
18199 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18200 wkt::internal::display_enum(f, self.name(), self.value())
18201 }
18202 }
18203
18204 impl std::convert::From<i32> for AggregationInterval {
18205 fn from(value: i32) -> Self {
18206 match value {
18207 0 => Self::Unspecified,
18208 1 => Self::Interval5Sec,
18209 2 => Self::Interval30Sec,
18210 3 => Self::Interval1Min,
18211 4 => Self::Interval5Min,
18212 5 => Self::Interval10Min,
18213 6 => Self::Interval15Min,
18214 _ => Self::UnknownValue(aggregation_interval::UnknownValue(
18215 wkt::internal::UnknownEnumValue::Integer(value),
18216 )),
18217 }
18218 }
18219 }
18220
18221 impl std::convert::From<&str> for AggregationInterval {
18222 fn from(value: &str) -> Self {
18223 use std::string::ToString;
18224 match value {
18225 "AGGREGATION_INTERVAL_UNSPECIFIED" => Self::Unspecified,
18226 "INTERVAL_5_SEC" => Self::Interval5Sec,
18227 "INTERVAL_30_SEC" => Self::Interval30Sec,
18228 "INTERVAL_1_MIN" => Self::Interval1Min,
18229 "INTERVAL_5_MIN" => Self::Interval5Min,
18230 "INTERVAL_10_MIN" => Self::Interval10Min,
18231 "INTERVAL_15_MIN" => Self::Interval15Min,
18232 _ => Self::UnknownValue(aggregation_interval::UnknownValue(
18233 wkt::internal::UnknownEnumValue::String(value.to_string()),
18234 )),
18235 }
18236 }
18237 }
18238
18239 impl serde::ser::Serialize for AggregationInterval {
18240 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18241 where
18242 S: serde::Serializer,
18243 {
18244 match self {
18245 Self::Unspecified => serializer.serialize_i32(0),
18246 Self::Interval5Sec => serializer.serialize_i32(1),
18247 Self::Interval30Sec => serializer.serialize_i32(2),
18248 Self::Interval1Min => serializer.serialize_i32(3),
18249 Self::Interval5Min => serializer.serialize_i32(4),
18250 Self::Interval10Min => serializer.serialize_i32(5),
18251 Self::Interval15Min => serializer.serialize_i32(6),
18252 Self::UnknownValue(u) => u.0.serialize(serializer),
18253 }
18254 }
18255 }
18256
18257 impl<'de> serde::de::Deserialize<'de> for AggregationInterval {
18258 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18259 where
18260 D: serde::Deserializer<'de>,
18261 {
18262 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AggregationInterval>::new(
18263 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.AggregationInterval",
18264 ))
18265 }
18266 }
18267
18268 /// Configures which log fields would be included.
18269 ///
18270 /// # Working with unknown values
18271 ///
18272 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18273 /// additional enum variants at any time. Adding new variants is not considered
18274 /// a breaking change. Applications should write their code in anticipation of:
18275 ///
18276 /// - New values appearing in future releases of the client library, **and**
18277 /// - New values received dynamically, without application changes.
18278 ///
18279 /// Please consult the [Working with enums] section in the user guide for some
18280 /// guidelines.
18281 ///
18282 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18283 #[derive(Clone, Debug, PartialEq)]
18284 #[non_exhaustive]
18285 pub enum Metadata {
18286 /// If not specified, will default to INCLUDE_ALL_METADATA.
18287 Unspecified,
18288 /// Include all metadata fields.
18289 IncludeAllMetadata,
18290 /// Exclude all metadata fields.
18291 ExcludeAllMetadata,
18292 /// Include only custom fields (specified in metadata_fields).
18293 CustomMetadata,
18294 /// If set, the enum was initialized with an unknown value.
18295 ///
18296 /// Applications can examine the value using [Metadata::value] or
18297 /// [Metadata::name].
18298 UnknownValue(metadata::UnknownValue),
18299 }
18300
18301 #[doc(hidden)]
18302 pub mod metadata {
18303 #[allow(unused_imports)]
18304 use super::*;
18305 #[derive(Clone, Debug, PartialEq)]
18306 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18307 }
18308
18309 impl Metadata {
18310 /// Gets the enum value.
18311 ///
18312 /// Returns `None` if the enum contains an unknown value deserialized from
18313 /// the string representation of enums.
18314 pub fn value(&self) -> std::option::Option<i32> {
18315 match self {
18316 Self::Unspecified => std::option::Option::Some(0),
18317 Self::IncludeAllMetadata => std::option::Option::Some(1),
18318 Self::ExcludeAllMetadata => std::option::Option::Some(2),
18319 Self::CustomMetadata => std::option::Option::Some(3),
18320 Self::UnknownValue(u) => u.0.value(),
18321 }
18322 }
18323
18324 /// Gets the enum value as a string.
18325 ///
18326 /// Returns `None` if the enum contains an unknown value deserialized from
18327 /// the integer representation of enums.
18328 pub fn name(&self) -> std::option::Option<&str> {
18329 match self {
18330 Self::Unspecified => std::option::Option::Some("METADATA_UNSPECIFIED"),
18331 Self::IncludeAllMetadata => std::option::Option::Some("INCLUDE_ALL_METADATA"),
18332 Self::ExcludeAllMetadata => std::option::Option::Some("EXCLUDE_ALL_METADATA"),
18333 Self::CustomMetadata => std::option::Option::Some("CUSTOM_METADATA"),
18334 Self::UnknownValue(u) => u.0.name(),
18335 }
18336 }
18337 }
18338
18339 impl std::default::Default for Metadata {
18340 fn default() -> Self {
18341 use std::convert::From;
18342 Self::from(0)
18343 }
18344 }
18345
18346 impl std::fmt::Display for Metadata {
18347 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18348 wkt::internal::display_enum(f, self.name(), self.value())
18349 }
18350 }
18351
18352 impl std::convert::From<i32> for Metadata {
18353 fn from(value: i32) -> Self {
18354 match value {
18355 0 => Self::Unspecified,
18356 1 => Self::IncludeAllMetadata,
18357 2 => Self::ExcludeAllMetadata,
18358 3 => Self::CustomMetadata,
18359 _ => Self::UnknownValue(metadata::UnknownValue(
18360 wkt::internal::UnknownEnumValue::Integer(value),
18361 )),
18362 }
18363 }
18364 }
18365
18366 impl std::convert::From<&str> for Metadata {
18367 fn from(value: &str) -> Self {
18368 use std::string::ToString;
18369 match value {
18370 "METADATA_UNSPECIFIED" => Self::Unspecified,
18371 "INCLUDE_ALL_METADATA" => Self::IncludeAllMetadata,
18372 "EXCLUDE_ALL_METADATA" => Self::ExcludeAllMetadata,
18373 "CUSTOM_METADATA" => Self::CustomMetadata,
18374 _ => Self::UnknownValue(metadata::UnknownValue(
18375 wkt::internal::UnknownEnumValue::String(value.to_string()),
18376 )),
18377 }
18378 }
18379 }
18380
18381 impl serde::ser::Serialize for Metadata {
18382 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18383 where
18384 S: serde::Serializer,
18385 {
18386 match self {
18387 Self::Unspecified => serializer.serialize_i32(0),
18388 Self::IncludeAllMetadata => serializer.serialize_i32(1),
18389 Self::ExcludeAllMetadata => serializer.serialize_i32(2),
18390 Self::CustomMetadata => serializer.serialize_i32(3),
18391 Self::UnknownValue(u) => u.0.serialize(serializer),
18392 }
18393 }
18394 }
18395
18396 impl<'de> serde::de::Deserialize<'de> for Metadata {
18397 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18398 where
18399 D: serde::Deserializer<'de>,
18400 {
18401 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Metadata>::new(
18402 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.Metadata",
18403 ))
18404 }
18405 }
18406
18407 /// Determines whether to include cross project annotations in the logs.
18408 /// Project configurations will always have CROSS_PROJECT_METADATA_DISABLED.
18409 ///
18410 /// # Working with unknown values
18411 ///
18412 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18413 /// additional enum variants at any time. Adding new variants is not considered
18414 /// a breaking change. Applications should write their code in anticipation of:
18415 ///
18416 /// - New values appearing in future releases of the client library, **and**
18417 /// - New values received dynamically, without application changes.
18418 ///
18419 /// Please consult the [Working with enums] section in the user guide for some
18420 /// guidelines.
18421 ///
18422 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18423 #[derive(Clone, Debug, PartialEq)]
18424 #[non_exhaustive]
18425 pub enum CrossProjectMetadata {
18426 /// If not specified, the default is CROSS_PROJECT_METADATA_ENABLED.
18427 Unspecified,
18428 /// When CROSS_PROJECT_METADATA_ENABLED, metadata from other projects will be
18429 /// included in the logs.
18430 Enabled,
18431 /// When CROSS_PROJECT_METADATA_DISABLED, metadata from other projects will
18432 /// not be included in the logs.
18433 Disabled,
18434 /// If set, the enum was initialized with an unknown value.
18435 ///
18436 /// Applications can examine the value using [CrossProjectMetadata::value] or
18437 /// [CrossProjectMetadata::name].
18438 UnknownValue(cross_project_metadata::UnknownValue),
18439 }
18440
18441 #[doc(hidden)]
18442 pub mod cross_project_metadata {
18443 #[allow(unused_imports)]
18444 use super::*;
18445 #[derive(Clone, Debug, PartialEq)]
18446 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18447 }
18448
18449 impl CrossProjectMetadata {
18450 /// Gets the enum value.
18451 ///
18452 /// Returns `None` if the enum contains an unknown value deserialized from
18453 /// the string representation of enums.
18454 pub fn value(&self) -> std::option::Option<i32> {
18455 match self {
18456 Self::Unspecified => std::option::Option::Some(0),
18457 Self::Enabled => std::option::Option::Some(1),
18458 Self::Disabled => std::option::Option::Some(2),
18459 Self::UnknownValue(u) => u.0.value(),
18460 }
18461 }
18462
18463 /// Gets the enum value as a string.
18464 ///
18465 /// Returns `None` if the enum contains an unknown value deserialized from
18466 /// the integer representation of enums.
18467 pub fn name(&self) -> std::option::Option<&str> {
18468 match self {
18469 Self::Unspecified => {
18470 std::option::Option::Some("CROSS_PROJECT_METADATA_UNSPECIFIED")
18471 }
18472 Self::Enabled => std::option::Option::Some("CROSS_PROJECT_METADATA_ENABLED"),
18473 Self::Disabled => std::option::Option::Some("CROSS_PROJECT_METADATA_DISABLED"),
18474 Self::UnknownValue(u) => u.0.name(),
18475 }
18476 }
18477 }
18478
18479 impl std::default::Default for CrossProjectMetadata {
18480 fn default() -> Self {
18481 use std::convert::From;
18482 Self::from(0)
18483 }
18484 }
18485
18486 impl std::fmt::Display for CrossProjectMetadata {
18487 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18488 wkt::internal::display_enum(f, self.name(), self.value())
18489 }
18490 }
18491
18492 impl std::convert::From<i32> for CrossProjectMetadata {
18493 fn from(value: i32) -> Self {
18494 match value {
18495 0 => Self::Unspecified,
18496 1 => Self::Enabled,
18497 2 => Self::Disabled,
18498 _ => Self::UnknownValue(cross_project_metadata::UnknownValue(
18499 wkt::internal::UnknownEnumValue::Integer(value),
18500 )),
18501 }
18502 }
18503 }
18504
18505 impl std::convert::From<&str> for CrossProjectMetadata {
18506 fn from(value: &str) -> Self {
18507 use std::string::ToString;
18508 match value {
18509 "CROSS_PROJECT_METADATA_UNSPECIFIED" => Self::Unspecified,
18510 "CROSS_PROJECT_METADATA_ENABLED" => Self::Enabled,
18511 "CROSS_PROJECT_METADATA_DISABLED" => Self::Disabled,
18512 _ => Self::UnknownValue(cross_project_metadata::UnknownValue(
18513 wkt::internal::UnknownEnumValue::String(value.to_string()),
18514 )),
18515 }
18516 }
18517 }
18518
18519 impl serde::ser::Serialize for CrossProjectMetadata {
18520 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18521 where
18522 S: serde::Serializer,
18523 {
18524 match self {
18525 Self::Unspecified => serializer.serialize_i32(0),
18526 Self::Enabled => serializer.serialize_i32(1),
18527 Self::Disabled => serializer.serialize_i32(2),
18528 Self::UnknownValue(u) => u.0.serialize(serializer),
18529 }
18530 }
18531 }
18532
18533 impl<'de> serde::de::Deserialize<'de> for CrossProjectMetadata {
18534 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18535 where
18536 D: serde::Deserializer<'de>,
18537 {
18538 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CrossProjectMetadata>::new(
18539 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.CrossProjectMetadata",
18540 ))
18541 }
18542 }
18543
18544 /// Output only. Indicates whether the target resource exists, for diagnostic
18545 /// purposes.
18546 ///
18547 /// # Working with unknown values
18548 ///
18549 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18550 /// additional enum variants at any time. Adding new variants is not considered
18551 /// a breaking change. Applications should write their code in anticipation of:
18552 ///
18553 /// - New values appearing in future releases of the client library, **and**
18554 /// - New values received dynamically, without application changes.
18555 ///
18556 /// Please consult the [Working with enums] section in the user guide for some
18557 /// guidelines.
18558 ///
18559 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18560 #[derive(Clone, Debug, PartialEq)]
18561 #[non_exhaustive]
18562 pub enum TargetResourceState {
18563 /// Unspecified target resource state.
18564 Unspecified,
18565 /// Indicates that the target resource exists.
18566 TargetResourceExists,
18567 /// Indicates that the target resource does not exist.
18568 TargetResourceDoesNotExist,
18569 /// If set, the enum was initialized with an unknown value.
18570 ///
18571 /// Applications can examine the value using [TargetResourceState::value] or
18572 /// [TargetResourceState::name].
18573 UnknownValue(target_resource_state::UnknownValue),
18574 }
18575
18576 #[doc(hidden)]
18577 pub mod target_resource_state {
18578 #[allow(unused_imports)]
18579 use super::*;
18580 #[derive(Clone, Debug, PartialEq)]
18581 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18582 }
18583
18584 impl TargetResourceState {
18585 /// Gets the enum value.
18586 ///
18587 /// Returns `None` if the enum contains an unknown value deserialized from
18588 /// the string representation of enums.
18589 pub fn value(&self) -> std::option::Option<i32> {
18590 match self {
18591 Self::Unspecified => std::option::Option::Some(0),
18592 Self::TargetResourceExists => std::option::Option::Some(1),
18593 Self::TargetResourceDoesNotExist => std::option::Option::Some(2),
18594 Self::UnknownValue(u) => u.0.value(),
18595 }
18596 }
18597
18598 /// Gets the enum value as a string.
18599 ///
18600 /// Returns `None` if the enum contains an unknown value deserialized from
18601 /// the integer representation of enums.
18602 pub fn name(&self) -> std::option::Option<&str> {
18603 match self {
18604 Self::Unspecified => std::option::Option::Some("TARGET_RESOURCE_STATE_UNSPECIFIED"),
18605 Self::TargetResourceExists => std::option::Option::Some("TARGET_RESOURCE_EXISTS"),
18606 Self::TargetResourceDoesNotExist => {
18607 std::option::Option::Some("TARGET_RESOURCE_DOES_NOT_EXIST")
18608 }
18609 Self::UnknownValue(u) => u.0.name(),
18610 }
18611 }
18612 }
18613
18614 impl std::default::Default for TargetResourceState {
18615 fn default() -> Self {
18616 use std::convert::From;
18617 Self::from(0)
18618 }
18619 }
18620
18621 impl std::fmt::Display for TargetResourceState {
18622 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18623 wkt::internal::display_enum(f, self.name(), self.value())
18624 }
18625 }
18626
18627 impl std::convert::From<i32> for TargetResourceState {
18628 fn from(value: i32) -> Self {
18629 match value {
18630 0 => Self::Unspecified,
18631 1 => Self::TargetResourceExists,
18632 2 => Self::TargetResourceDoesNotExist,
18633 _ => Self::UnknownValue(target_resource_state::UnknownValue(
18634 wkt::internal::UnknownEnumValue::Integer(value),
18635 )),
18636 }
18637 }
18638 }
18639
18640 impl std::convert::From<&str> for TargetResourceState {
18641 fn from(value: &str) -> Self {
18642 use std::string::ToString;
18643 match value {
18644 "TARGET_RESOURCE_STATE_UNSPECIFIED" => Self::Unspecified,
18645 "TARGET_RESOURCE_EXISTS" => Self::TargetResourceExists,
18646 "TARGET_RESOURCE_DOES_NOT_EXIST" => Self::TargetResourceDoesNotExist,
18647 _ => Self::UnknownValue(target_resource_state::UnknownValue(
18648 wkt::internal::UnknownEnumValue::String(value.to_string()),
18649 )),
18650 }
18651 }
18652 }
18653
18654 impl serde::ser::Serialize for TargetResourceState {
18655 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18656 where
18657 S: serde::Serializer,
18658 {
18659 match self {
18660 Self::Unspecified => serializer.serialize_i32(0),
18661 Self::TargetResourceExists => serializer.serialize_i32(1),
18662 Self::TargetResourceDoesNotExist => serializer.serialize_i32(2),
18663 Self::UnknownValue(u) => u.0.serialize(serializer),
18664 }
18665 }
18666 }
18667
18668 impl<'de> serde::de::Deserialize<'de> for TargetResourceState {
18669 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18670 where
18671 D: serde::Deserializer<'de>,
18672 {
18673 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetResourceState>::new(
18674 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.TargetResourceState",
18675 ))
18676 }
18677 }
18678
18679 /// Reference to the resource of the config scope. That is, the scope from
18680 /// which traffic is logged. The target resource must belong to the same
18681 /// project as the configuration.
18682 /// This field is not supported for organization level configurations.
18683 #[derive(Clone, Debug, PartialEq)]
18684 #[non_exhaustive]
18685 pub enum TargetResource {
18686 /// Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
18687 /// within the network.
18688 /// Format: projects/{project_id}/global/networks/{name}
18689 Network(std::string::String),
18690 /// Traffic will be logged from VMs within the subnetwork.
18691 /// Format: projects/{project_id}/regions/{region}/subnetworks/{name}
18692 Subnet(std::string::String),
18693 /// Traffic will be logged from the Interconnect Attachment.
18694 /// Format:
18695 /// projects/{project_id}/regions/{region}/interconnectAttachments/{name}
18696 InterconnectAttachment(std::string::String),
18697 /// Traffic will be logged from the VPN Tunnel.
18698 /// Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
18699 VpnTunnel(std::string::String),
18700 }
18701}
18702
18703/// A configuration to generate a response for GetEffectiveVpcFlowLogsConfig
18704/// request.
18705#[derive(Clone, Default, PartialEq)]
18706#[non_exhaustive]
18707pub struct EffectiveVpcFlowLogsConfig {
18708 /// Unique name of the configuration. The name can have one of the following
18709 /// forms:
18710 ///
18711 /// - For project-level configurations:
18712 /// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
18713 ///
18714 /// - For organization-level configurations:
18715 /// `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
18716 ///
18717 /// - For a Compute config, the name will be the path of the subnet:
18718 /// `projects/{project_id}/regions/{region}/subnetworks/{subnet_id}`
18719 ///
18720 pub name: std::string::String,
18721
18722 /// The state of the VPC Flow Log configuration. Default value is ENABLED.
18723 /// When creating a new configuration, it must be enabled.
18724 /// Setting state=DISABLED will pause the log generation for this config.
18725 pub state: std::option::Option<crate::model::vpc_flow_logs_config::State>,
18726
18727 /// The aggregation interval for the logs. Default value is INTERVAL_5_SEC.
18728 pub aggregation_interval:
18729 std::option::Option<crate::model::vpc_flow_logs_config::AggregationInterval>,
18730
18731 /// The value of the field must be in (0, 1]. The sampling rate of VPC Flow
18732 /// Logs where 1.0 means all collected logs are reported.
18733 /// Setting the sampling rate to 0.0 is not allowed. If you want to disable VPC
18734 /// Flow Logs, use the state field instead.
18735 /// Default value is 1.0.
18736 pub flow_sampling: std::option::Option<f32>,
18737
18738 /// Configures whether all, none or a subset of metadata fields should be
18739 /// added to the reported VPC flow logs.
18740 /// Default value is INCLUDE_ALL_METADATA.
18741 pub metadata: std::option::Option<crate::model::vpc_flow_logs_config::Metadata>,
18742
18743 /// Custom metadata fields to include in the reported VPC flow logs.
18744 /// Can only be specified if "metadata" was set to CUSTOM_METADATA.
18745 pub metadata_fields: std::vec::Vec<std::string::String>,
18746
18747 /// Export filter used to define which VPC Flow Logs should be logged.
18748 pub filter_expr: std::option::Option<std::string::String>,
18749
18750 /// Determines whether to include cross project annotations in the logs.
18751 /// This field is available only for organization configurations. If not
18752 /// specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
18753 pub cross_project_metadata:
18754 std::option::Option<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
18755
18756 /// Specifies the scope of the config (e.g., SUBNET, NETWORK, ORGANIZATION..).
18757 pub scope: std::option::Option<crate::model::effective_vpc_flow_logs_config::Scope>,
18758
18759 /// Reference to the resource of the config scope. That is, the scope from
18760 /// which traffic is logged. The target resource must belong to the same
18761 /// project as the configuration.
18762 /// This field is not supported for organization level configurations.
18763 pub target_resource:
18764 std::option::Option<crate::model::effective_vpc_flow_logs_config::TargetResource>,
18765
18766 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18767}
18768
18769impl EffectiveVpcFlowLogsConfig {
18770 /// Creates a new default instance.
18771 pub fn new() -> Self {
18772 std::default::Default::default()
18773 }
18774
18775 /// Sets the value of [name][crate::model::EffectiveVpcFlowLogsConfig::name].
18776 ///
18777 /// # Example
18778 /// ```ignore,no_run
18779 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18780 /// let x = EffectiveVpcFlowLogsConfig::new().set_name("example");
18781 /// ```
18782 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18783 self.name = v.into();
18784 self
18785 }
18786
18787 /// Sets the value of [state][crate::model::EffectiveVpcFlowLogsConfig::state].
18788 ///
18789 /// # Example
18790 /// ```ignore,no_run
18791 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18792 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
18793 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_state(State::Enabled);
18794 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_state(State::Disabled);
18795 /// ```
18796 pub fn set_state<T>(mut self, v: T) -> Self
18797 where
18798 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
18799 {
18800 self.state = std::option::Option::Some(v.into());
18801 self
18802 }
18803
18804 /// Sets or clears the value of [state][crate::model::EffectiveVpcFlowLogsConfig::state].
18805 ///
18806 /// # Example
18807 /// ```ignore,no_run
18808 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18809 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
18810 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(Some(State::Enabled));
18811 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(Some(State::Disabled));
18812 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(None::<State>);
18813 /// ```
18814 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
18815 where
18816 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
18817 {
18818 self.state = v.map(|x| x.into());
18819 self
18820 }
18821
18822 /// Sets the value of [aggregation_interval][crate::model::EffectiveVpcFlowLogsConfig::aggregation_interval].
18823 ///
18824 /// # Example
18825 /// ```ignore,no_run
18826 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18827 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
18828 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval5Sec);
18829 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval30Sec);
18830 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval1Min);
18831 /// ```
18832 pub fn set_aggregation_interval<T>(mut self, v: T) -> Self
18833 where
18834 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
18835 {
18836 self.aggregation_interval = std::option::Option::Some(v.into());
18837 self
18838 }
18839
18840 /// Sets or clears the value of [aggregation_interval][crate::model::EffectiveVpcFlowLogsConfig::aggregation_interval].
18841 ///
18842 /// # Example
18843 /// ```ignore,no_run
18844 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18845 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
18846 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval5Sec));
18847 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval30Sec));
18848 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval1Min));
18849 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(None::<AggregationInterval>);
18850 /// ```
18851 pub fn set_or_clear_aggregation_interval<T>(mut self, v: std::option::Option<T>) -> Self
18852 where
18853 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
18854 {
18855 self.aggregation_interval = v.map(|x| x.into());
18856 self
18857 }
18858
18859 /// Sets the value of [flow_sampling][crate::model::EffectiveVpcFlowLogsConfig::flow_sampling].
18860 ///
18861 /// # Example
18862 /// ```ignore,no_run
18863 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18864 /// let x = EffectiveVpcFlowLogsConfig::new().set_flow_sampling(42.0);
18865 /// ```
18866 pub fn set_flow_sampling<T>(mut self, v: T) -> Self
18867 where
18868 T: std::convert::Into<f32>,
18869 {
18870 self.flow_sampling = std::option::Option::Some(v.into());
18871 self
18872 }
18873
18874 /// Sets or clears the value of [flow_sampling][crate::model::EffectiveVpcFlowLogsConfig::flow_sampling].
18875 ///
18876 /// # Example
18877 /// ```ignore,no_run
18878 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18879 /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_flow_sampling(Some(42.0));
18880 /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_flow_sampling(None::<f32>);
18881 /// ```
18882 pub fn set_or_clear_flow_sampling<T>(mut self, v: std::option::Option<T>) -> Self
18883 where
18884 T: std::convert::Into<f32>,
18885 {
18886 self.flow_sampling = v.map(|x| x.into());
18887 self
18888 }
18889
18890 /// Sets the value of [metadata][crate::model::EffectiveVpcFlowLogsConfig::metadata].
18891 ///
18892 /// # Example
18893 /// ```ignore,no_run
18894 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18895 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
18896 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::IncludeAllMetadata);
18897 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::ExcludeAllMetadata);
18898 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::CustomMetadata);
18899 /// ```
18900 pub fn set_metadata<T>(mut self, v: T) -> Self
18901 where
18902 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
18903 {
18904 self.metadata = std::option::Option::Some(v.into());
18905 self
18906 }
18907
18908 /// Sets or clears the value of [metadata][crate::model::EffectiveVpcFlowLogsConfig::metadata].
18909 ///
18910 /// # Example
18911 /// ```ignore,no_run
18912 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18913 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
18914 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::IncludeAllMetadata));
18915 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::ExcludeAllMetadata));
18916 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::CustomMetadata));
18917 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(None::<Metadata>);
18918 /// ```
18919 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
18920 where
18921 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
18922 {
18923 self.metadata = v.map(|x| x.into());
18924 self
18925 }
18926
18927 /// Sets the value of [metadata_fields][crate::model::EffectiveVpcFlowLogsConfig::metadata_fields].
18928 ///
18929 /// # Example
18930 /// ```ignore,no_run
18931 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18932 /// let x = EffectiveVpcFlowLogsConfig::new().set_metadata_fields(["a", "b", "c"]);
18933 /// ```
18934 pub fn set_metadata_fields<T, V>(mut self, v: T) -> Self
18935 where
18936 T: std::iter::IntoIterator<Item = V>,
18937 V: std::convert::Into<std::string::String>,
18938 {
18939 use std::iter::Iterator;
18940 self.metadata_fields = v.into_iter().map(|i| i.into()).collect();
18941 self
18942 }
18943
18944 /// Sets the value of [filter_expr][crate::model::EffectiveVpcFlowLogsConfig::filter_expr].
18945 ///
18946 /// # Example
18947 /// ```ignore,no_run
18948 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18949 /// let x = EffectiveVpcFlowLogsConfig::new().set_filter_expr("example");
18950 /// ```
18951 pub fn set_filter_expr<T>(mut self, v: T) -> Self
18952 where
18953 T: std::convert::Into<std::string::String>,
18954 {
18955 self.filter_expr = std::option::Option::Some(v.into());
18956 self
18957 }
18958
18959 /// Sets or clears the value of [filter_expr][crate::model::EffectiveVpcFlowLogsConfig::filter_expr].
18960 ///
18961 /// # Example
18962 /// ```ignore,no_run
18963 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18964 /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_filter_expr(Some("example"));
18965 /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_filter_expr(None::<String>);
18966 /// ```
18967 pub fn set_or_clear_filter_expr<T>(mut self, v: std::option::Option<T>) -> Self
18968 where
18969 T: std::convert::Into<std::string::String>,
18970 {
18971 self.filter_expr = v.map(|x| x.into());
18972 self
18973 }
18974
18975 /// Sets the value of [cross_project_metadata][crate::model::EffectiveVpcFlowLogsConfig::cross_project_metadata].
18976 ///
18977 /// # Example
18978 /// ```ignore,no_run
18979 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18980 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
18981 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Enabled);
18982 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Disabled);
18983 /// ```
18984 pub fn set_cross_project_metadata<T>(mut self, v: T) -> Self
18985 where
18986 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
18987 {
18988 self.cross_project_metadata = std::option::Option::Some(v.into());
18989 self
18990 }
18991
18992 /// Sets or clears the value of [cross_project_metadata][crate::model::EffectiveVpcFlowLogsConfig::cross_project_metadata].
18993 ///
18994 /// # Example
18995 /// ```ignore,no_run
18996 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
18997 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
18998 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Enabled));
18999 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Disabled));
19000 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(None::<CrossProjectMetadata>);
19001 /// ```
19002 pub fn set_or_clear_cross_project_metadata<T>(mut self, v: std::option::Option<T>) -> Self
19003 where
19004 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
19005 {
19006 self.cross_project_metadata = v.map(|x| x.into());
19007 self
19008 }
19009
19010 /// Sets the value of [scope][crate::model::EffectiveVpcFlowLogsConfig::scope].
19011 ///
19012 /// # Example
19013 /// ```ignore,no_run
19014 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19015 /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::Scope;
19016 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::Subnet);
19017 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::ComputeApiSubnet);
19018 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::Network);
19019 /// ```
19020 pub fn set_scope<T>(mut self, v: T) -> Self
19021 where
19022 T: std::convert::Into<crate::model::effective_vpc_flow_logs_config::Scope>,
19023 {
19024 self.scope = std::option::Option::Some(v.into());
19025 self
19026 }
19027
19028 /// Sets or clears the value of [scope][crate::model::EffectiveVpcFlowLogsConfig::scope].
19029 ///
19030 /// # Example
19031 /// ```ignore,no_run
19032 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19033 /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::Scope;
19034 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::Subnet));
19035 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::ComputeApiSubnet));
19036 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::Network));
19037 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(None::<Scope>);
19038 /// ```
19039 pub fn set_or_clear_scope<T>(mut self, v: std::option::Option<T>) -> Self
19040 where
19041 T: std::convert::Into<crate::model::effective_vpc_flow_logs_config::Scope>,
19042 {
19043 self.scope = v.map(|x| x.into());
19044 self
19045 }
19046
19047 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource].
19048 ///
19049 /// Note that all the setters affecting `target_resource` are mutually
19050 /// exclusive.
19051 ///
19052 /// # Example
19053 /// ```ignore,no_run
19054 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19055 /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::TargetResource;
19056 /// let x = EffectiveVpcFlowLogsConfig::new().set_target_resource(Some(TargetResource::Network("example".to_string())));
19057 /// ```
19058 pub fn set_target_resource<
19059 T: std::convert::Into<
19060 std::option::Option<crate::model::effective_vpc_flow_logs_config::TargetResource>,
19061 >,
19062 >(
19063 mut self,
19064 v: T,
19065 ) -> Self {
19066 self.target_resource = v.into();
19067 self
19068 }
19069
19070 /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19071 /// if it holds a `Network`, `None` if the field is not set or
19072 /// holds a different branch.
19073 pub fn network(&self) -> std::option::Option<&std::string::String> {
19074 #[allow(unreachable_patterns)]
19075 self.target_resource.as_ref().and_then(|v| match v {
19076 crate::model::effective_vpc_flow_logs_config::TargetResource::Network(v) => {
19077 std::option::Option::Some(v)
19078 }
19079 _ => std::option::Option::None,
19080 })
19081 }
19082
19083 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19084 /// to hold a `Network`.
19085 ///
19086 /// Note that all the setters affecting `target_resource` are
19087 /// mutually exclusive.
19088 ///
19089 /// # Example
19090 /// ```ignore,no_run
19091 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19092 /// let x = EffectiveVpcFlowLogsConfig::new().set_network("example");
19093 /// assert!(x.network().is_some());
19094 /// assert!(x.subnet().is_none());
19095 /// assert!(x.interconnect_attachment().is_none());
19096 /// assert!(x.vpn_tunnel().is_none());
19097 /// ```
19098 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19099 self.target_resource = std::option::Option::Some(
19100 crate::model::effective_vpc_flow_logs_config::TargetResource::Network(v.into()),
19101 );
19102 self
19103 }
19104
19105 /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19106 /// if it holds a `Subnet`, `None` if the field is not set or
19107 /// holds a different branch.
19108 pub fn subnet(&self) -> std::option::Option<&std::string::String> {
19109 #[allow(unreachable_patterns)]
19110 self.target_resource.as_ref().and_then(|v| match v {
19111 crate::model::effective_vpc_flow_logs_config::TargetResource::Subnet(v) => {
19112 std::option::Option::Some(v)
19113 }
19114 _ => std::option::Option::None,
19115 })
19116 }
19117
19118 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19119 /// to hold a `Subnet`.
19120 ///
19121 /// Note that all the setters affecting `target_resource` are
19122 /// mutually exclusive.
19123 ///
19124 /// # Example
19125 /// ```ignore,no_run
19126 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19127 /// let x = EffectiveVpcFlowLogsConfig::new().set_subnet("example");
19128 /// assert!(x.subnet().is_some());
19129 /// assert!(x.network().is_none());
19130 /// assert!(x.interconnect_attachment().is_none());
19131 /// assert!(x.vpn_tunnel().is_none());
19132 /// ```
19133 pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19134 self.target_resource = std::option::Option::Some(
19135 crate::model::effective_vpc_flow_logs_config::TargetResource::Subnet(v.into()),
19136 );
19137 self
19138 }
19139
19140 /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19141 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
19142 /// holds a different branch.
19143 pub fn interconnect_attachment(&self) -> std::option::Option<&std::string::String> {
19144 #[allow(unreachable_patterns)]
19145 self.target_resource.as_ref().and_then(|v| match v {
19146 crate::model::effective_vpc_flow_logs_config::TargetResource::InterconnectAttachment(v) => std::option::Option::Some(v),
19147 _ => std::option::Option::None,
19148 })
19149 }
19150
19151 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19152 /// to hold a `InterconnectAttachment`.
19153 ///
19154 /// Note that all the setters affecting `target_resource` are
19155 /// mutually exclusive.
19156 ///
19157 /// # Example
19158 /// ```ignore,no_run
19159 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19160 /// let x = EffectiveVpcFlowLogsConfig::new().set_interconnect_attachment("example");
19161 /// assert!(x.interconnect_attachment().is_some());
19162 /// assert!(x.network().is_none());
19163 /// assert!(x.subnet().is_none());
19164 /// assert!(x.vpn_tunnel().is_none());
19165 /// ```
19166 pub fn set_interconnect_attachment<T: std::convert::Into<std::string::String>>(
19167 mut self,
19168 v: T,
19169 ) -> Self {
19170 self.target_resource = std::option::Option::Some(
19171 crate::model::effective_vpc_flow_logs_config::TargetResource::InterconnectAttachment(
19172 v.into(),
19173 ),
19174 );
19175 self
19176 }
19177
19178 /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19179 /// if it holds a `VpnTunnel`, `None` if the field is not set or
19180 /// holds a different branch.
19181 pub fn vpn_tunnel(&self) -> std::option::Option<&std::string::String> {
19182 #[allow(unreachable_patterns)]
19183 self.target_resource.as_ref().and_then(|v| match v {
19184 crate::model::effective_vpc_flow_logs_config::TargetResource::VpnTunnel(v) => {
19185 std::option::Option::Some(v)
19186 }
19187 _ => std::option::Option::None,
19188 })
19189 }
19190
19191 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19192 /// to hold a `VpnTunnel`.
19193 ///
19194 /// Note that all the setters affecting `target_resource` are
19195 /// mutually exclusive.
19196 ///
19197 /// # Example
19198 /// ```ignore,no_run
19199 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19200 /// let x = EffectiveVpcFlowLogsConfig::new().set_vpn_tunnel("example");
19201 /// assert!(x.vpn_tunnel().is_some());
19202 /// assert!(x.network().is_none());
19203 /// assert!(x.subnet().is_none());
19204 /// assert!(x.interconnect_attachment().is_none());
19205 /// ```
19206 pub fn set_vpn_tunnel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19207 self.target_resource = std::option::Option::Some(
19208 crate::model::effective_vpc_flow_logs_config::TargetResource::VpnTunnel(v.into()),
19209 );
19210 self
19211 }
19212}
19213
19214impl wkt::message::Message for EffectiveVpcFlowLogsConfig {
19215 fn typename() -> &'static str {
19216 "type.googleapis.com/google.cloud.networkmanagement.v1.EffectiveVpcFlowLogsConfig"
19217 }
19218}
19219
19220/// Defines additional types related to [EffectiveVpcFlowLogsConfig].
19221pub mod effective_vpc_flow_logs_config {
19222 #[allow(unused_imports)]
19223 use super::*;
19224
19225 /// The scope for this flow log configuration.
19226 ///
19227 /// # Working with unknown values
19228 ///
19229 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19230 /// additional enum variants at any time. Adding new variants is not considered
19231 /// a breaking change. Applications should write their code in anticipation of:
19232 ///
19233 /// - New values appearing in future releases of the client library, **and**
19234 /// - New values received dynamically, without application changes.
19235 ///
19236 /// Please consult the [Working with enums] section in the user guide for some
19237 /// guidelines.
19238 ///
19239 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19240 #[derive(Clone, Debug, PartialEq)]
19241 #[non_exhaustive]
19242 pub enum Scope {
19243 /// Scope is unspecified.
19244 Unspecified,
19245 /// Target resource is a subnet (Network Management API).
19246 Subnet,
19247 /// Target resource is a subnet, and the config originates from the Compute
19248 /// API.
19249 ComputeApiSubnet,
19250 /// Target resource is a network.
19251 Network,
19252 /// Target resource is a VPN tunnel.
19253 VpnTunnel,
19254 /// Target resource is an interconnect attachment.
19255 InterconnectAttachment,
19256 /// Configuration applies to an entire organization.
19257 Organization,
19258 /// If set, the enum was initialized with an unknown value.
19259 ///
19260 /// Applications can examine the value using [Scope::value] or
19261 /// [Scope::name].
19262 UnknownValue(scope::UnknownValue),
19263 }
19264
19265 #[doc(hidden)]
19266 pub mod scope {
19267 #[allow(unused_imports)]
19268 use super::*;
19269 #[derive(Clone, Debug, PartialEq)]
19270 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19271 }
19272
19273 impl Scope {
19274 /// Gets the enum value.
19275 ///
19276 /// Returns `None` if the enum contains an unknown value deserialized from
19277 /// the string representation of enums.
19278 pub fn value(&self) -> std::option::Option<i32> {
19279 match self {
19280 Self::Unspecified => std::option::Option::Some(0),
19281 Self::Subnet => std::option::Option::Some(1),
19282 Self::ComputeApiSubnet => std::option::Option::Some(2),
19283 Self::Network => std::option::Option::Some(3),
19284 Self::VpnTunnel => std::option::Option::Some(4),
19285 Self::InterconnectAttachment => std::option::Option::Some(5),
19286 Self::Organization => std::option::Option::Some(6),
19287 Self::UnknownValue(u) => u.0.value(),
19288 }
19289 }
19290
19291 /// Gets the enum value as a string.
19292 ///
19293 /// Returns `None` if the enum contains an unknown value deserialized from
19294 /// the integer representation of enums.
19295 pub fn name(&self) -> std::option::Option<&str> {
19296 match self {
19297 Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
19298 Self::Subnet => std::option::Option::Some("SUBNET"),
19299 Self::ComputeApiSubnet => std::option::Option::Some("COMPUTE_API_SUBNET"),
19300 Self::Network => std::option::Option::Some("NETWORK"),
19301 Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
19302 Self::InterconnectAttachment => {
19303 std::option::Option::Some("INTERCONNECT_ATTACHMENT")
19304 }
19305 Self::Organization => std::option::Option::Some("ORGANIZATION"),
19306 Self::UnknownValue(u) => u.0.name(),
19307 }
19308 }
19309 }
19310
19311 impl std::default::Default for Scope {
19312 fn default() -> Self {
19313 use std::convert::From;
19314 Self::from(0)
19315 }
19316 }
19317
19318 impl std::fmt::Display for Scope {
19319 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19320 wkt::internal::display_enum(f, self.name(), self.value())
19321 }
19322 }
19323
19324 impl std::convert::From<i32> for Scope {
19325 fn from(value: i32) -> Self {
19326 match value {
19327 0 => Self::Unspecified,
19328 1 => Self::Subnet,
19329 2 => Self::ComputeApiSubnet,
19330 3 => Self::Network,
19331 4 => Self::VpnTunnel,
19332 5 => Self::InterconnectAttachment,
19333 6 => Self::Organization,
19334 _ => Self::UnknownValue(scope::UnknownValue(
19335 wkt::internal::UnknownEnumValue::Integer(value),
19336 )),
19337 }
19338 }
19339 }
19340
19341 impl std::convert::From<&str> for Scope {
19342 fn from(value: &str) -> Self {
19343 use std::string::ToString;
19344 match value {
19345 "SCOPE_UNSPECIFIED" => Self::Unspecified,
19346 "SUBNET" => Self::Subnet,
19347 "COMPUTE_API_SUBNET" => Self::ComputeApiSubnet,
19348 "NETWORK" => Self::Network,
19349 "VPN_TUNNEL" => Self::VpnTunnel,
19350 "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
19351 "ORGANIZATION" => Self::Organization,
19352 _ => Self::UnknownValue(scope::UnknownValue(
19353 wkt::internal::UnknownEnumValue::String(value.to_string()),
19354 )),
19355 }
19356 }
19357 }
19358
19359 impl serde::ser::Serialize for Scope {
19360 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19361 where
19362 S: serde::Serializer,
19363 {
19364 match self {
19365 Self::Unspecified => serializer.serialize_i32(0),
19366 Self::Subnet => serializer.serialize_i32(1),
19367 Self::ComputeApiSubnet => serializer.serialize_i32(2),
19368 Self::Network => serializer.serialize_i32(3),
19369 Self::VpnTunnel => serializer.serialize_i32(4),
19370 Self::InterconnectAttachment => serializer.serialize_i32(5),
19371 Self::Organization => serializer.serialize_i32(6),
19372 Self::UnknownValue(u) => u.0.serialize(serializer),
19373 }
19374 }
19375 }
19376
19377 impl<'de> serde::de::Deserialize<'de> for Scope {
19378 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19379 where
19380 D: serde::Deserializer<'de>,
19381 {
19382 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
19383 ".google.cloud.networkmanagement.v1.EffectiveVpcFlowLogsConfig.Scope",
19384 ))
19385 }
19386 }
19387
19388 /// Reference to the resource of the config scope. That is, the scope from
19389 /// which traffic is logged. The target resource must belong to the same
19390 /// project as the configuration.
19391 /// This field is not supported for organization level configurations.
19392 #[derive(Clone, Debug, PartialEq)]
19393 #[non_exhaustive]
19394 pub enum TargetResource {
19395 /// Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
19396 /// within the network.
19397 /// Format: projects/{project_id}/global/networks/{name}
19398 Network(std::string::String),
19399 /// Traffic will be logged from VMs within the subnetwork.
19400 /// Format: projects/{project_id}/regions/{region}/subnetworks/{name}
19401 Subnet(std::string::String),
19402 /// Traffic will be logged from the Interconnect Attachment.
19403 /// Format:
19404 /// projects/{project_id}/regions/{region}/interconnectAttachments/{name}
19405 InterconnectAttachment(std::string::String),
19406 /// Traffic will be logged from the VPN Tunnel.
19407 /// Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
19408 VpnTunnel(std::string::String),
19409 }
19410}
19411
19412/// Type of a load balancer. For more information, see [Summary of Google Cloud
19413/// load
19414/// balancers](https://cloud.google.com/load-balancing/docs/load-balancing-overview#summary-of-google-cloud-load-balancers).
19415///
19416/// # Working with unknown values
19417///
19418/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19419/// additional enum variants at any time. Adding new variants is not considered
19420/// a breaking change. Applications should write their code in anticipation of:
19421///
19422/// - New values appearing in future releases of the client library, **and**
19423/// - New values received dynamically, without application changes.
19424///
19425/// Please consult the [Working with enums] section in the user guide for some
19426/// guidelines.
19427///
19428/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19429#[derive(Clone, Debug, PartialEq)]
19430#[non_exhaustive]
19431pub enum LoadBalancerType {
19432 /// Forwarding rule points to a different target than a load balancer or a
19433 /// load balancer type is unknown.
19434 Unspecified,
19435 /// Global external HTTP(S) load balancer.
19436 HttpsAdvancedLoadBalancer,
19437 /// Global external HTTP(S) load balancer (classic)
19438 HttpsLoadBalancer,
19439 /// Regional external HTTP(S) load balancer.
19440 RegionalHttpsLoadBalancer,
19441 /// Internal HTTP(S) load balancer.
19442 InternalHttpsLoadBalancer,
19443 /// External SSL proxy load balancer.
19444 SslProxyLoadBalancer,
19445 /// External TCP proxy load balancer.
19446 TcpProxyLoadBalancer,
19447 /// Internal regional TCP proxy load balancer.
19448 InternalTcpProxyLoadBalancer,
19449 /// External TCP/UDP Network load balancer.
19450 NetworkLoadBalancer,
19451 /// Target-pool based external TCP/UDP Network load balancer.
19452 LegacyNetworkLoadBalancer,
19453 /// Internal TCP/UDP load balancer.
19454 TcpUdpInternalLoadBalancer,
19455 /// If set, the enum was initialized with an unknown value.
19456 ///
19457 /// Applications can examine the value using [LoadBalancerType::value] or
19458 /// [LoadBalancerType::name].
19459 UnknownValue(load_balancer_type::UnknownValue),
19460}
19461
19462#[doc(hidden)]
19463pub mod load_balancer_type {
19464 #[allow(unused_imports)]
19465 use super::*;
19466 #[derive(Clone, Debug, PartialEq)]
19467 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19468}
19469
19470impl LoadBalancerType {
19471 /// Gets the enum value.
19472 ///
19473 /// Returns `None` if the enum contains an unknown value deserialized from
19474 /// the string representation of enums.
19475 pub fn value(&self) -> std::option::Option<i32> {
19476 match self {
19477 Self::Unspecified => std::option::Option::Some(0),
19478 Self::HttpsAdvancedLoadBalancer => std::option::Option::Some(1),
19479 Self::HttpsLoadBalancer => std::option::Option::Some(2),
19480 Self::RegionalHttpsLoadBalancer => std::option::Option::Some(3),
19481 Self::InternalHttpsLoadBalancer => std::option::Option::Some(4),
19482 Self::SslProxyLoadBalancer => std::option::Option::Some(5),
19483 Self::TcpProxyLoadBalancer => std::option::Option::Some(6),
19484 Self::InternalTcpProxyLoadBalancer => std::option::Option::Some(7),
19485 Self::NetworkLoadBalancer => std::option::Option::Some(8),
19486 Self::LegacyNetworkLoadBalancer => std::option::Option::Some(9),
19487 Self::TcpUdpInternalLoadBalancer => std::option::Option::Some(10),
19488 Self::UnknownValue(u) => u.0.value(),
19489 }
19490 }
19491
19492 /// Gets the enum value as a string.
19493 ///
19494 /// Returns `None` if the enum contains an unknown value deserialized from
19495 /// the integer representation of enums.
19496 pub fn name(&self) -> std::option::Option<&str> {
19497 match self {
19498 Self::Unspecified => std::option::Option::Some("LOAD_BALANCER_TYPE_UNSPECIFIED"),
19499 Self::HttpsAdvancedLoadBalancer => {
19500 std::option::Option::Some("HTTPS_ADVANCED_LOAD_BALANCER")
19501 }
19502 Self::HttpsLoadBalancer => std::option::Option::Some("HTTPS_LOAD_BALANCER"),
19503 Self::RegionalHttpsLoadBalancer => {
19504 std::option::Option::Some("REGIONAL_HTTPS_LOAD_BALANCER")
19505 }
19506 Self::InternalHttpsLoadBalancer => {
19507 std::option::Option::Some("INTERNAL_HTTPS_LOAD_BALANCER")
19508 }
19509 Self::SslProxyLoadBalancer => std::option::Option::Some("SSL_PROXY_LOAD_BALANCER"),
19510 Self::TcpProxyLoadBalancer => std::option::Option::Some("TCP_PROXY_LOAD_BALANCER"),
19511 Self::InternalTcpProxyLoadBalancer => {
19512 std::option::Option::Some("INTERNAL_TCP_PROXY_LOAD_BALANCER")
19513 }
19514 Self::NetworkLoadBalancer => std::option::Option::Some("NETWORK_LOAD_BALANCER"),
19515 Self::LegacyNetworkLoadBalancer => {
19516 std::option::Option::Some("LEGACY_NETWORK_LOAD_BALANCER")
19517 }
19518 Self::TcpUdpInternalLoadBalancer => {
19519 std::option::Option::Some("TCP_UDP_INTERNAL_LOAD_BALANCER")
19520 }
19521 Self::UnknownValue(u) => u.0.name(),
19522 }
19523 }
19524}
19525
19526impl std::default::Default for LoadBalancerType {
19527 fn default() -> Self {
19528 use std::convert::From;
19529 Self::from(0)
19530 }
19531}
19532
19533impl std::fmt::Display for LoadBalancerType {
19534 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19535 wkt::internal::display_enum(f, self.name(), self.value())
19536 }
19537}
19538
19539impl std::convert::From<i32> for LoadBalancerType {
19540 fn from(value: i32) -> Self {
19541 match value {
19542 0 => Self::Unspecified,
19543 1 => Self::HttpsAdvancedLoadBalancer,
19544 2 => Self::HttpsLoadBalancer,
19545 3 => Self::RegionalHttpsLoadBalancer,
19546 4 => Self::InternalHttpsLoadBalancer,
19547 5 => Self::SslProxyLoadBalancer,
19548 6 => Self::TcpProxyLoadBalancer,
19549 7 => Self::InternalTcpProxyLoadBalancer,
19550 8 => Self::NetworkLoadBalancer,
19551 9 => Self::LegacyNetworkLoadBalancer,
19552 10 => Self::TcpUdpInternalLoadBalancer,
19553 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
19554 wkt::internal::UnknownEnumValue::Integer(value),
19555 )),
19556 }
19557 }
19558}
19559
19560impl std::convert::From<&str> for LoadBalancerType {
19561 fn from(value: &str) -> Self {
19562 use std::string::ToString;
19563 match value {
19564 "LOAD_BALANCER_TYPE_UNSPECIFIED" => Self::Unspecified,
19565 "HTTPS_ADVANCED_LOAD_BALANCER" => Self::HttpsAdvancedLoadBalancer,
19566 "HTTPS_LOAD_BALANCER" => Self::HttpsLoadBalancer,
19567 "REGIONAL_HTTPS_LOAD_BALANCER" => Self::RegionalHttpsLoadBalancer,
19568 "INTERNAL_HTTPS_LOAD_BALANCER" => Self::InternalHttpsLoadBalancer,
19569 "SSL_PROXY_LOAD_BALANCER" => Self::SslProxyLoadBalancer,
19570 "TCP_PROXY_LOAD_BALANCER" => Self::TcpProxyLoadBalancer,
19571 "INTERNAL_TCP_PROXY_LOAD_BALANCER" => Self::InternalTcpProxyLoadBalancer,
19572 "NETWORK_LOAD_BALANCER" => Self::NetworkLoadBalancer,
19573 "LEGACY_NETWORK_LOAD_BALANCER" => Self::LegacyNetworkLoadBalancer,
19574 "TCP_UDP_INTERNAL_LOAD_BALANCER" => Self::TcpUdpInternalLoadBalancer,
19575 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
19576 wkt::internal::UnknownEnumValue::String(value.to_string()),
19577 )),
19578 }
19579 }
19580}
19581
19582impl serde::ser::Serialize for LoadBalancerType {
19583 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19584 where
19585 S: serde::Serializer,
19586 {
19587 match self {
19588 Self::Unspecified => serializer.serialize_i32(0),
19589 Self::HttpsAdvancedLoadBalancer => serializer.serialize_i32(1),
19590 Self::HttpsLoadBalancer => serializer.serialize_i32(2),
19591 Self::RegionalHttpsLoadBalancer => serializer.serialize_i32(3),
19592 Self::InternalHttpsLoadBalancer => serializer.serialize_i32(4),
19593 Self::SslProxyLoadBalancer => serializer.serialize_i32(5),
19594 Self::TcpProxyLoadBalancer => serializer.serialize_i32(6),
19595 Self::InternalTcpProxyLoadBalancer => serializer.serialize_i32(7),
19596 Self::NetworkLoadBalancer => serializer.serialize_i32(8),
19597 Self::LegacyNetworkLoadBalancer => serializer.serialize_i32(9),
19598 Self::TcpUdpInternalLoadBalancer => serializer.serialize_i32(10),
19599 Self::UnknownValue(u) => u.0.serialize(serializer),
19600 }
19601 }
19602}
19603
19604impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
19605 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19606 where
19607 D: serde::Deserializer<'de>,
19608 {
19609 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
19610 ".google.cloud.networkmanagement.v1.LoadBalancerType",
19611 ))
19612 }
19613}