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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_iam_v1;
27extern crate google_cloud_location;
28extern crate google_cloud_longrunning;
29extern crate google_cloud_lro;
30extern crate google_cloud_rpc;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// A Connectivity Test for a network reachability analysis.
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct ConnectivityTest {
46 /// Identifier. Unique name of the resource using the form:
47 /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
48 pub name: std::string::String,
49
50 /// The user-supplied description of the Connectivity Test.
51 /// Maximum of 512 characters.
52 pub description: std::string::String,
53
54 /// Required. Source specification of the Connectivity Test.
55 ///
56 /// You can use a combination of source IP address, URI of a supported
57 /// endpoint, project ID, or VPC network to identify the source location.
58 ///
59 /// Reachability analysis might proceed even if the source location is
60 /// ambiguous. However, the test result might include endpoints or use a source
61 /// that you don't intend to test.
62 pub source: std::option::Option<crate::model::Endpoint>,
63
64 /// Required. Destination specification of the Connectivity Test.
65 ///
66 /// You can use a combination of destination IP address, URI of a supported
67 /// endpoint, project ID, or VPC network to identify the destination location.
68 ///
69 /// Reachability analysis proceeds even if the destination location is
70 /// ambiguous. However, the test result might include endpoints or use a
71 /// destination that you don't intend to test.
72 pub destination: std::option::Option<crate::model::Endpoint>,
73
74 /// IP Protocol of the test. When not provided, "TCP" is assumed.
75 pub protocol: std::string::String,
76
77 /// Other projects that may be relevant for reachability analysis.
78 /// This is applicable to scenarios where a test can cross project boundaries.
79 pub related_projects: std::vec::Vec<std::string::String>,
80
81 /// Output only. The display name of a Connectivity Test.
82 pub display_name: std::string::String,
83
84 /// Resource labels to represent user-provided metadata.
85 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
86
87 /// Output only. The time the test was created.
88 pub create_time: std::option::Option<wkt::Timestamp>,
89
90 /// Output only. The time the test's configuration was updated.
91 pub update_time: std::option::Option<wkt::Timestamp>,
92
93 /// Output only. The reachability details of this test from the latest run.
94 /// The details are updated when creating a new test, updating an
95 /// existing test, or triggering a one-time rerun of an existing test.
96 pub reachability_details: std::option::Option<crate::model::ReachabilityDetails>,
97
98 /// Output only. The probing details of this test from the latest run, present
99 /// for applicable tests only. The details are updated when creating a new
100 /// test, updating an existing test, or triggering a one-time rerun of an
101 /// existing test.
102 pub probing_details: std::option::Option<crate::model::ProbingDetails>,
103
104 /// Whether run analysis for the return path from destination to source.
105 /// Default value is false.
106 pub round_trip: bool,
107
108 /// Output only. The reachability details of this test from the latest run for
109 /// the return path. The details are updated when creating a new test,
110 /// updating an existing test, or triggering a one-time rerun of an existing
111 /// test.
112 pub return_reachability_details: std::option::Option<crate::model::ReachabilityDetails>,
113
114 /// Whether the analysis should skip firewall checking. Default value is false.
115 pub bypass_firewall_checks: bool,
116
117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
118}
119
120impl ConnectivityTest {
121 /// Creates a new default instance.
122 pub fn new() -> Self {
123 std::default::Default::default()
124 }
125
126 /// Sets the value of [name][crate::model::ConnectivityTest::name].
127 ///
128 /// # Example
129 /// ```ignore,no_run
130 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
131 /// # let project_id = "project_id";
132 /// # let test_id = "test_id";
133 /// let x = ConnectivityTest::new().set_name(format!("projects/{project_id}/locations/global/connectivityTests/{test_id}"));
134 /// ```
135 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
136 self.name = v.into();
137 self
138 }
139
140 /// Sets the value of [description][crate::model::ConnectivityTest::description].
141 ///
142 /// # Example
143 /// ```ignore,no_run
144 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
145 /// let x = ConnectivityTest::new().set_description("example");
146 /// ```
147 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
148 self.description = v.into();
149 self
150 }
151
152 /// Sets the value of [source][crate::model::ConnectivityTest::source].
153 ///
154 /// # Example
155 /// ```ignore,no_run
156 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
157 /// use google_cloud_networkmanagement_v1::model::Endpoint;
158 /// let x = ConnectivityTest::new().set_source(Endpoint::default()/* use setters */);
159 /// ```
160 pub fn set_source<T>(mut self, v: T) -> Self
161 where
162 T: std::convert::Into<crate::model::Endpoint>,
163 {
164 self.source = std::option::Option::Some(v.into());
165 self
166 }
167
168 /// Sets or clears the value of [source][crate::model::ConnectivityTest::source].
169 ///
170 /// # Example
171 /// ```ignore,no_run
172 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
173 /// use google_cloud_networkmanagement_v1::model::Endpoint;
174 /// let x = ConnectivityTest::new().set_or_clear_source(Some(Endpoint::default()/* use setters */));
175 /// let x = ConnectivityTest::new().set_or_clear_source(None::<Endpoint>);
176 /// ```
177 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
178 where
179 T: std::convert::Into<crate::model::Endpoint>,
180 {
181 self.source = v.map(|x| x.into());
182 self
183 }
184
185 /// Sets the value of [destination][crate::model::ConnectivityTest::destination].
186 ///
187 /// # Example
188 /// ```ignore,no_run
189 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
190 /// use google_cloud_networkmanagement_v1::model::Endpoint;
191 /// let x = ConnectivityTest::new().set_destination(Endpoint::default()/* use setters */);
192 /// ```
193 pub fn set_destination<T>(mut self, v: T) -> Self
194 where
195 T: std::convert::Into<crate::model::Endpoint>,
196 {
197 self.destination = std::option::Option::Some(v.into());
198 self
199 }
200
201 /// Sets or clears the value of [destination][crate::model::ConnectivityTest::destination].
202 ///
203 /// # Example
204 /// ```ignore,no_run
205 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
206 /// use google_cloud_networkmanagement_v1::model::Endpoint;
207 /// let x = ConnectivityTest::new().set_or_clear_destination(Some(Endpoint::default()/* use setters */));
208 /// let x = ConnectivityTest::new().set_or_clear_destination(None::<Endpoint>);
209 /// ```
210 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
211 where
212 T: std::convert::Into<crate::model::Endpoint>,
213 {
214 self.destination = v.map(|x| x.into());
215 self
216 }
217
218 /// Sets the value of [protocol][crate::model::ConnectivityTest::protocol].
219 ///
220 /// # Example
221 /// ```ignore,no_run
222 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
223 /// let x = ConnectivityTest::new().set_protocol("example");
224 /// ```
225 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
226 self.protocol = v.into();
227 self
228 }
229
230 /// Sets the value of [related_projects][crate::model::ConnectivityTest::related_projects].
231 ///
232 /// # Example
233 /// ```ignore,no_run
234 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
235 /// let x = ConnectivityTest::new().set_related_projects(["a", "b", "c"]);
236 /// ```
237 pub fn set_related_projects<T, V>(mut self, v: T) -> Self
238 where
239 T: std::iter::IntoIterator<Item = V>,
240 V: std::convert::Into<std::string::String>,
241 {
242 use std::iter::Iterator;
243 self.related_projects = v.into_iter().map(|i| i.into()).collect();
244 self
245 }
246
247 /// Sets the value of [display_name][crate::model::ConnectivityTest::display_name].
248 ///
249 /// # Example
250 /// ```ignore,no_run
251 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
252 /// let x = ConnectivityTest::new().set_display_name("example");
253 /// ```
254 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
255 self.display_name = v.into();
256 self
257 }
258
259 /// Sets the value of [labels][crate::model::ConnectivityTest::labels].
260 ///
261 /// # Example
262 /// ```ignore,no_run
263 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
264 /// let x = ConnectivityTest::new().set_labels([
265 /// ("key0", "abc"),
266 /// ("key1", "xyz"),
267 /// ]);
268 /// ```
269 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
270 where
271 T: std::iter::IntoIterator<Item = (K, V)>,
272 K: std::convert::Into<std::string::String>,
273 V: std::convert::Into<std::string::String>,
274 {
275 use std::iter::Iterator;
276 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
277 self
278 }
279
280 /// Sets the value of [create_time][crate::model::ConnectivityTest::create_time].
281 ///
282 /// # Example
283 /// ```ignore,no_run
284 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
285 /// use wkt::Timestamp;
286 /// let x = ConnectivityTest::new().set_create_time(Timestamp::default()/* use setters */);
287 /// ```
288 pub fn set_create_time<T>(mut self, v: T) -> Self
289 where
290 T: std::convert::Into<wkt::Timestamp>,
291 {
292 self.create_time = std::option::Option::Some(v.into());
293 self
294 }
295
296 /// Sets or clears the value of [create_time][crate::model::ConnectivityTest::create_time].
297 ///
298 /// # Example
299 /// ```ignore,no_run
300 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
301 /// use wkt::Timestamp;
302 /// let x = ConnectivityTest::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
303 /// let x = ConnectivityTest::new().set_or_clear_create_time(None::<Timestamp>);
304 /// ```
305 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
306 where
307 T: std::convert::Into<wkt::Timestamp>,
308 {
309 self.create_time = v.map(|x| x.into());
310 self
311 }
312
313 /// Sets the value of [update_time][crate::model::ConnectivityTest::update_time].
314 ///
315 /// # Example
316 /// ```ignore,no_run
317 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
318 /// use wkt::Timestamp;
319 /// let x = ConnectivityTest::new().set_update_time(Timestamp::default()/* use setters */);
320 /// ```
321 pub fn set_update_time<T>(mut self, v: T) -> Self
322 where
323 T: std::convert::Into<wkt::Timestamp>,
324 {
325 self.update_time = std::option::Option::Some(v.into());
326 self
327 }
328
329 /// Sets or clears the value of [update_time][crate::model::ConnectivityTest::update_time].
330 ///
331 /// # Example
332 /// ```ignore,no_run
333 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
334 /// use wkt::Timestamp;
335 /// let x = ConnectivityTest::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
336 /// let x = ConnectivityTest::new().set_or_clear_update_time(None::<Timestamp>);
337 /// ```
338 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
339 where
340 T: std::convert::Into<wkt::Timestamp>,
341 {
342 self.update_time = v.map(|x| x.into());
343 self
344 }
345
346 /// Sets the value of [reachability_details][crate::model::ConnectivityTest::reachability_details].
347 ///
348 /// # Example
349 /// ```ignore,no_run
350 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
351 /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
352 /// let x = ConnectivityTest::new().set_reachability_details(ReachabilityDetails::default()/* use setters */);
353 /// ```
354 pub fn set_reachability_details<T>(mut self, v: T) -> Self
355 where
356 T: std::convert::Into<crate::model::ReachabilityDetails>,
357 {
358 self.reachability_details = std::option::Option::Some(v.into());
359 self
360 }
361
362 /// Sets or clears the value of [reachability_details][crate::model::ConnectivityTest::reachability_details].
363 ///
364 /// # Example
365 /// ```ignore,no_run
366 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
367 /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
368 /// let x = ConnectivityTest::new().set_or_clear_reachability_details(Some(ReachabilityDetails::default()/* use setters */));
369 /// let x = ConnectivityTest::new().set_or_clear_reachability_details(None::<ReachabilityDetails>);
370 /// ```
371 pub fn set_or_clear_reachability_details<T>(mut self, v: std::option::Option<T>) -> Self
372 where
373 T: std::convert::Into<crate::model::ReachabilityDetails>,
374 {
375 self.reachability_details = v.map(|x| x.into());
376 self
377 }
378
379 /// Sets the value of [probing_details][crate::model::ConnectivityTest::probing_details].
380 ///
381 /// # Example
382 /// ```ignore,no_run
383 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
384 /// use google_cloud_networkmanagement_v1::model::ProbingDetails;
385 /// let x = ConnectivityTest::new().set_probing_details(ProbingDetails::default()/* use setters */);
386 /// ```
387 pub fn set_probing_details<T>(mut self, v: T) -> Self
388 where
389 T: std::convert::Into<crate::model::ProbingDetails>,
390 {
391 self.probing_details = std::option::Option::Some(v.into());
392 self
393 }
394
395 /// Sets or clears the value of [probing_details][crate::model::ConnectivityTest::probing_details].
396 ///
397 /// # Example
398 /// ```ignore,no_run
399 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
400 /// use google_cloud_networkmanagement_v1::model::ProbingDetails;
401 /// let x = ConnectivityTest::new().set_or_clear_probing_details(Some(ProbingDetails::default()/* use setters */));
402 /// let x = ConnectivityTest::new().set_or_clear_probing_details(None::<ProbingDetails>);
403 /// ```
404 pub fn set_or_clear_probing_details<T>(mut self, v: std::option::Option<T>) -> Self
405 where
406 T: std::convert::Into<crate::model::ProbingDetails>,
407 {
408 self.probing_details = v.map(|x| x.into());
409 self
410 }
411
412 /// Sets the value of [round_trip][crate::model::ConnectivityTest::round_trip].
413 ///
414 /// # Example
415 /// ```ignore,no_run
416 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
417 /// let x = ConnectivityTest::new().set_round_trip(true);
418 /// ```
419 pub fn set_round_trip<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
420 self.round_trip = v.into();
421 self
422 }
423
424 /// Sets the value of [return_reachability_details][crate::model::ConnectivityTest::return_reachability_details].
425 ///
426 /// # Example
427 /// ```ignore,no_run
428 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
429 /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
430 /// let x = ConnectivityTest::new().set_return_reachability_details(ReachabilityDetails::default()/* use setters */);
431 /// ```
432 pub fn set_return_reachability_details<T>(mut self, v: T) -> Self
433 where
434 T: std::convert::Into<crate::model::ReachabilityDetails>,
435 {
436 self.return_reachability_details = std::option::Option::Some(v.into());
437 self
438 }
439
440 /// Sets or clears the value of [return_reachability_details][crate::model::ConnectivityTest::return_reachability_details].
441 ///
442 /// # Example
443 /// ```ignore,no_run
444 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
445 /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
446 /// let x = ConnectivityTest::new().set_or_clear_return_reachability_details(Some(ReachabilityDetails::default()/* use setters */));
447 /// let x = ConnectivityTest::new().set_or_clear_return_reachability_details(None::<ReachabilityDetails>);
448 /// ```
449 pub fn set_or_clear_return_reachability_details<T>(mut self, v: std::option::Option<T>) -> Self
450 where
451 T: std::convert::Into<crate::model::ReachabilityDetails>,
452 {
453 self.return_reachability_details = v.map(|x| x.into());
454 self
455 }
456
457 /// Sets the value of [bypass_firewall_checks][crate::model::ConnectivityTest::bypass_firewall_checks].
458 ///
459 /// # Example
460 /// ```ignore,no_run
461 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
462 /// let x = ConnectivityTest::new().set_bypass_firewall_checks(true);
463 /// ```
464 pub fn set_bypass_firewall_checks<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
465 self.bypass_firewall_checks = v.into();
466 self
467 }
468}
469
470impl wkt::message::Message for ConnectivityTest {
471 fn typename() -> &'static str {
472 "type.googleapis.com/google.cloud.networkmanagement.v1.ConnectivityTest"
473 }
474}
475
476/// Source or destination of the Connectivity Test.
477#[derive(Clone, Default, PartialEq)]
478#[non_exhaustive]
479pub struct Endpoint {
480 /// The IP address of the endpoint, which can be an external or internal IP.
481 pub ip_address: std::string::String,
482
483 /// The IP protocol port of the endpoint.
484 /// Only applicable when protocol is TCP or UDP.
485 pub port: i32,
486
487 /// A Compute Engine instance URI.
488 pub instance: std::string::String,
489
490 /// A forwarding rule and its corresponding IP address represent the frontend
491 /// configuration of a Google Cloud load balancer. Forwarding rules are also
492 /// used for protocol forwarding, Private Service Connect and other network
493 /// services to provide forwarding information in the control plane. Applicable
494 /// only to destination endpoint. Format:
495 /// `projects/{project}/global/forwardingRules/{id}` or
496 /// `projects/{project}/regions/{region}/forwardingRules/{id}`
497 pub forwarding_rule: std::string::String,
498
499 /// Output only. Specifies the type of the target of the forwarding rule.
500 pub forwarding_rule_target: std::option::Option<crate::model::endpoint::ForwardingRuleTarget>,
501
502 /// Output only. ID of the load balancer the forwarding rule points to. Empty
503 /// for forwarding rules not related to load balancers.
504 pub load_balancer_id: std::option::Option<std::string::String>,
505
506 /// Output only. Type of the load balancer the forwarding rule points to.
507 pub load_balancer_type: std::option::Option<crate::model::LoadBalancerType>,
508
509 /// A cluster URI for [Google Kubernetes Engine cluster control
510 /// plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
511 pub gke_master_cluster: std::string::String,
512
513 /// DNS endpoint of [Google Kubernetes Engine cluster control
514 /// plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
515 /// Requires gke_master_cluster to be set, can't be used simultaneoulsly with
516 /// ip_address or network. Applicable only to destination endpoint.
517 pub fqdn: std::string::String,
518
519 /// A [Cloud SQL](https://cloud.google.com/sql) instance URI.
520 pub cloud_sql_instance: std::string::String,
521
522 /// A [Redis Instance](https://cloud.google.com/memorystore/docs/redis) URI.
523 /// Applicable only to destination endpoint.
524 pub redis_instance: std::string::String,
525
526 /// A [Redis Cluster](https://cloud.google.com/memorystore/docs/cluster) URI.
527 /// Applicable only to destination endpoint.
528 pub redis_cluster: std::string::String,
529
530 /// A [GKE Pod](https://cloud.google.com/kubernetes-engine/docs/concepts/pod)
531 /// URI.
532 pub gke_pod: std::string::String,
533
534 /// A [DMS Private
535 /// Connection](https://docs.cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.privateConnections)
536 /// name format:
537 /// projects/{project}/locations/{location}/privateConnections/{privateConnection}.
538 pub dms_private_connection: std::string::String,
539
540 /// A [Cloud Function](https://cloud.google.com/functions). Applicable only to
541 /// source endpoint.
542 pub cloud_function: std::option::Option<crate::model::endpoint::CloudFunctionEndpoint>,
543
544 /// An [App Engine](https://cloud.google.com/appengine) [service
545 /// version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions).
546 /// Applicable only to source endpoint.
547 pub app_engine_version: std::option::Option<crate::model::endpoint::AppEngineVersionEndpoint>,
548
549 /// A [Cloud Run](https://cloud.google.com/run)
550 /// [revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get)
551 /// Applicable only to source endpoint.
552 pub cloud_run_revision: std::option::Option<crate::model::endpoint::CloudRunRevisionEndpoint>,
553
554 /// A [Cloud Run](https://cloud.google.com/run)
555 /// [job](https://docs.cloud.google.com/run/docs/reference/rest/v2/projects.locations.jobs#Job)
556 /// URI.
557 /// Applicable only to source endpoint.
558 /// The format is: projects/{project}/locations/{location}/jobs/{job}
559 pub cloud_run_job: std::string::String,
560
561 /// A VPC network URI. For source endpoints, used according to the
562 /// `network_type`. For destination endpoints, used only when the source is an
563 /// external IP address endpoint, and the destination is an internal IP address
564 /// endpoint.
565 pub network: std::string::String,
566
567 /// For source endpoints, type of the network where the endpoint is located.
568 /// Not relevant for destination endpoints.
569 pub network_type: crate::model::endpoint::NetworkType,
570
571 /// For source endpoints, endpoint project ID. Used according to the
572 /// `network_type`. Not relevant for destination endpoints.
573 pub project_id: std::string::String,
574
575 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
576}
577
578impl Endpoint {
579 /// Creates a new default instance.
580 pub fn new() -> Self {
581 std::default::Default::default()
582 }
583
584 /// Sets the value of [ip_address][crate::model::Endpoint::ip_address].
585 ///
586 /// # Example
587 /// ```ignore,no_run
588 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
589 /// let x = Endpoint::new().set_ip_address("example");
590 /// ```
591 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
592 self.ip_address = v.into();
593 self
594 }
595
596 /// Sets the value of [port][crate::model::Endpoint::port].
597 ///
598 /// # Example
599 /// ```ignore,no_run
600 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
601 /// let x = Endpoint::new().set_port(42);
602 /// ```
603 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
604 self.port = v.into();
605 self
606 }
607
608 /// Sets the value of [instance][crate::model::Endpoint::instance].
609 ///
610 /// # Example
611 /// ```ignore,no_run
612 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
613 /// let x = Endpoint::new().set_instance("example");
614 /// ```
615 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
616 self.instance = v.into();
617 self
618 }
619
620 /// Sets the value of [forwarding_rule][crate::model::Endpoint::forwarding_rule].
621 ///
622 /// # Example
623 /// ```ignore,no_run
624 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
625 /// let x = Endpoint::new().set_forwarding_rule("example");
626 /// ```
627 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
628 self.forwarding_rule = v.into();
629 self
630 }
631
632 /// Sets the value of [forwarding_rule_target][crate::model::Endpoint::forwarding_rule_target].
633 ///
634 /// # Example
635 /// ```ignore,no_run
636 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
637 /// use google_cloud_networkmanagement_v1::model::endpoint::ForwardingRuleTarget;
638 /// let x0 = Endpoint::new().set_forwarding_rule_target(ForwardingRuleTarget::Instance);
639 /// let x1 = Endpoint::new().set_forwarding_rule_target(ForwardingRuleTarget::LoadBalancer);
640 /// let x2 = Endpoint::new().set_forwarding_rule_target(ForwardingRuleTarget::VpnGateway);
641 /// ```
642 pub fn set_forwarding_rule_target<T>(mut self, v: T) -> Self
643 where
644 T: std::convert::Into<crate::model::endpoint::ForwardingRuleTarget>,
645 {
646 self.forwarding_rule_target = std::option::Option::Some(v.into());
647 self
648 }
649
650 /// Sets or clears the value of [forwarding_rule_target][crate::model::Endpoint::forwarding_rule_target].
651 ///
652 /// # Example
653 /// ```ignore,no_run
654 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
655 /// use google_cloud_networkmanagement_v1::model::endpoint::ForwardingRuleTarget;
656 /// let x0 = Endpoint::new().set_or_clear_forwarding_rule_target(Some(ForwardingRuleTarget::Instance));
657 /// let x1 = Endpoint::new().set_or_clear_forwarding_rule_target(Some(ForwardingRuleTarget::LoadBalancer));
658 /// let x2 = Endpoint::new().set_or_clear_forwarding_rule_target(Some(ForwardingRuleTarget::VpnGateway));
659 /// let x_none = Endpoint::new().set_or_clear_forwarding_rule_target(None::<ForwardingRuleTarget>);
660 /// ```
661 pub fn set_or_clear_forwarding_rule_target<T>(mut self, v: std::option::Option<T>) -> Self
662 where
663 T: std::convert::Into<crate::model::endpoint::ForwardingRuleTarget>,
664 {
665 self.forwarding_rule_target = v.map(|x| x.into());
666 self
667 }
668
669 /// Sets the value of [load_balancer_id][crate::model::Endpoint::load_balancer_id].
670 ///
671 /// # Example
672 /// ```ignore,no_run
673 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
674 /// let x = Endpoint::new().set_load_balancer_id("example");
675 /// ```
676 pub fn set_load_balancer_id<T>(mut self, v: T) -> Self
677 where
678 T: std::convert::Into<std::string::String>,
679 {
680 self.load_balancer_id = std::option::Option::Some(v.into());
681 self
682 }
683
684 /// Sets or clears the value of [load_balancer_id][crate::model::Endpoint::load_balancer_id].
685 ///
686 /// # Example
687 /// ```ignore,no_run
688 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
689 /// let x = Endpoint::new().set_or_clear_load_balancer_id(Some("example"));
690 /// let x = Endpoint::new().set_or_clear_load_balancer_id(None::<String>);
691 /// ```
692 pub fn set_or_clear_load_balancer_id<T>(mut self, v: std::option::Option<T>) -> Self
693 where
694 T: std::convert::Into<std::string::String>,
695 {
696 self.load_balancer_id = v.map(|x| x.into());
697 self
698 }
699
700 /// Sets the value of [load_balancer_type][crate::model::Endpoint::load_balancer_type].
701 ///
702 /// # Example
703 /// ```ignore,no_run
704 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
705 /// use google_cloud_networkmanagement_v1::model::LoadBalancerType;
706 /// let x0 = Endpoint::new().set_load_balancer_type(LoadBalancerType::HttpsAdvancedLoadBalancer);
707 /// let x1 = Endpoint::new().set_load_balancer_type(LoadBalancerType::HttpsLoadBalancer);
708 /// let x2 = Endpoint::new().set_load_balancer_type(LoadBalancerType::RegionalHttpsLoadBalancer);
709 /// ```
710 pub fn set_load_balancer_type<T>(mut self, v: T) -> Self
711 where
712 T: std::convert::Into<crate::model::LoadBalancerType>,
713 {
714 self.load_balancer_type = std::option::Option::Some(v.into());
715 self
716 }
717
718 /// Sets or clears the value of [load_balancer_type][crate::model::Endpoint::load_balancer_type].
719 ///
720 /// # Example
721 /// ```ignore,no_run
722 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
723 /// use google_cloud_networkmanagement_v1::model::LoadBalancerType;
724 /// let x0 = Endpoint::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::HttpsAdvancedLoadBalancer));
725 /// let x1 = Endpoint::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::HttpsLoadBalancer));
726 /// let x2 = Endpoint::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::RegionalHttpsLoadBalancer));
727 /// let x_none = Endpoint::new().set_or_clear_load_balancer_type(None::<LoadBalancerType>);
728 /// ```
729 pub fn set_or_clear_load_balancer_type<T>(mut self, v: std::option::Option<T>) -> Self
730 where
731 T: std::convert::Into<crate::model::LoadBalancerType>,
732 {
733 self.load_balancer_type = v.map(|x| x.into());
734 self
735 }
736
737 /// Sets the value of [gke_master_cluster][crate::model::Endpoint::gke_master_cluster].
738 ///
739 /// # Example
740 /// ```ignore,no_run
741 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
742 /// let x = Endpoint::new().set_gke_master_cluster("example");
743 /// ```
744 pub fn set_gke_master_cluster<T: std::convert::Into<std::string::String>>(
745 mut self,
746 v: T,
747 ) -> Self {
748 self.gke_master_cluster = v.into();
749 self
750 }
751
752 /// Sets the value of [fqdn][crate::model::Endpoint::fqdn].
753 ///
754 /// # Example
755 /// ```ignore,no_run
756 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
757 /// let x = Endpoint::new().set_fqdn("example");
758 /// ```
759 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
760 self.fqdn = v.into();
761 self
762 }
763
764 /// Sets the value of [cloud_sql_instance][crate::model::Endpoint::cloud_sql_instance].
765 ///
766 /// # Example
767 /// ```ignore,no_run
768 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
769 /// let x = Endpoint::new().set_cloud_sql_instance("example");
770 /// ```
771 pub fn set_cloud_sql_instance<T: std::convert::Into<std::string::String>>(
772 mut self,
773 v: T,
774 ) -> Self {
775 self.cloud_sql_instance = v.into();
776 self
777 }
778
779 /// Sets the value of [redis_instance][crate::model::Endpoint::redis_instance].
780 ///
781 /// # Example
782 /// ```ignore,no_run
783 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
784 /// let x = Endpoint::new().set_redis_instance("example");
785 /// ```
786 pub fn set_redis_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
787 self.redis_instance = v.into();
788 self
789 }
790
791 /// Sets the value of [redis_cluster][crate::model::Endpoint::redis_cluster].
792 ///
793 /// # Example
794 /// ```ignore,no_run
795 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
796 /// let x = Endpoint::new().set_redis_cluster("example");
797 /// ```
798 pub fn set_redis_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
799 self.redis_cluster = v.into();
800 self
801 }
802
803 /// Sets the value of [gke_pod][crate::model::Endpoint::gke_pod].
804 ///
805 /// # Example
806 /// ```ignore,no_run
807 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
808 /// let x = Endpoint::new().set_gke_pod("example");
809 /// ```
810 pub fn set_gke_pod<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
811 self.gke_pod = v.into();
812 self
813 }
814
815 /// Sets the value of [dms_private_connection][crate::model::Endpoint::dms_private_connection].
816 ///
817 /// # Example
818 /// ```ignore,no_run
819 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
820 /// let x = Endpoint::new().set_dms_private_connection("example");
821 /// ```
822 pub fn set_dms_private_connection<T: std::convert::Into<std::string::String>>(
823 mut self,
824 v: T,
825 ) -> Self {
826 self.dms_private_connection = v.into();
827 self
828 }
829
830 /// Sets the value of [cloud_function][crate::model::Endpoint::cloud_function].
831 ///
832 /// # Example
833 /// ```ignore,no_run
834 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
835 /// use google_cloud_networkmanagement_v1::model::endpoint::CloudFunctionEndpoint;
836 /// let x = Endpoint::new().set_cloud_function(CloudFunctionEndpoint::default()/* use setters */);
837 /// ```
838 pub fn set_cloud_function<T>(mut self, v: T) -> Self
839 where
840 T: std::convert::Into<crate::model::endpoint::CloudFunctionEndpoint>,
841 {
842 self.cloud_function = std::option::Option::Some(v.into());
843 self
844 }
845
846 /// Sets or clears the value of [cloud_function][crate::model::Endpoint::cloud_function].
847 ///
848 /// # Example
849 /// ```ignore,no_run
850 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
851 /// use google_cloud_networkmanagement_v1::model::endpoint::CloudFunctionEndpoint;
852 /// let x = Endpoint::new().set_or_clear_cloud_function(Some(CloudFunctionEndpoint::default()/* use setters */));
853 /// let x = Endpoint::new().set_or_clear_cloud_function(None::<CloudFunctionEndpoint>);
854 /// ```
855 pub fn set_or_clear_cloud_function<T>(mut self, v: std::option::Option<T>) -> Self
856 where
857 T: std::convert::Into<crate::model::endpoint::CloudFunctionEndpoint>,
858 {
859 self.cloud_function = v.map(|x| x.into());
860 self
861 }
862
863 /// Sets the value of [app_engine_version][crate::model::Endpoint::app_engine_version].
864 ///
865 /// # Example
866 /// ```ignore,no_run
867 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
868 /// use google_cloud_networkmanagement_v1::model::endpoint::AppEngineVersionEndpoint;
869 /// let x = Endpoint::new().set_app_engine_version(AppEngineVersionEndpoint::default()/* use setters */);
870 /// ```
871 pub fn set_app_engine_version<T>(mut self, v: T) -> Self
872 where
873 T: std::convert::Into<crate::model::endpoint::AppEngineVersionEndpoint>,
874 {
875 self.app_engine_version = std::option::Option::Some(v.into());
876 self
877 }
878
879 /// Sets or clears the value of [app_engine_version][crate::model::Endpoint::app_engine_version].
880 ///
881 /// # Example
882 /// ```ignore,no_run
883 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
884 /// use google_cloud_networkmanagement_v1::model::endpoint::AppEngineVersionEndpoint;
885 /// let x = Endpoint::new().set_or_clear_app_engine_version(Some(AppEngineVersionEndpoint::default()/* use setters */));
886 /// let x = Endpoint::new().set_or_clear_app_engine_version(None::<AppEngineVersionEndpoint>);
887 /// ```
888 pub fn set_or_clear_app_engine_version<T>(mut self, v: std::option::Option<T>) -> Self
889 where
890 T: std::convert::Into<crate::model::endpoint::AppEngineVersionEndpoint>,
891 {
892 self.app_engine_version = v.map(|x| x.into());
893 self
894 }
895
896 /// Sets the value of [cloud_run_revision][crate::model::Endpoint::cloud_run_revision].
897 ///
898 /// # Example
899 /// ```ignore,no_run
900 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
901 /// use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
902 /// let x = Endpoint::new().set_cloud_run_revision(CloudRunRevisionEndpoint::default()/* use setters */);
903 /// ```
904 pub fn set_cloud_run_revision<T>(mut self, v: T) -> Self
905 where
906 T: std::convert::Into<crate::model::endpoint::CloudRunRevisionEndpoint>,
907 {
908 self.cloud_run_revision = std::option::Option::Some(v.into());
909 self
910 }
911
912 /// Sets or clears the value of [cloud_run_revision][crate::model::Endpoint::cloud_run_revision].
913 ///
914 /// # Example
915 /// ```ignore,no_run
916 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
917 /// use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
918 /// let x = Endpoint::new().set_or_clear_cloud_run_revision(Some(CloudRunRevisionEndpoint::default()/* use setters */));
919 /// let x = Endpoint::new().set_or_clear_cloud_run_revision(None::<CloudRunRevisionEndpoint>);
920 /// ```
921 pub fn set_or_clear_cloud_run_revision<T>(mut self, v: std::option::Option<T>) -> Self
922 where
923 T: std::convert::Into<crate::model::endpoint::CloudRunRevisionEndpoint>,
924 {
925 self.cloud_run_revision = v.map(|x| x.into());
926 self
927 }
928
929 /// Sets the value of [cloud_run_job][crate::model::Endpoint::cloud_run_job].
930 ///
931 /// # Example
932 /// ```ignore,no_run
933 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
934 /// let x = Endpoint::new().set_cloud_run_job("example");
935 /// ```
936 pub fn set_cloud_run_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
937 self.cloud_run_job = v.into();
938 self
939 }
940
941 /// Sets the value of [network][crate::model::Endpoint::network].
942 ///
943 /// # Example
944 /// ```ignore,no_run
945 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
946 /// let x = Endpoint::new().set_network("example");
947 /// ```
948 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
949 self.network = v.into();
950 self
951 }
952
953 /// Sets the value of [network_type][crate::model::Endpoint::network_type].
954 ///
955 /// # Example
956 /// ```ignore,no_run
957 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
958 /// use google_cloud_networkmanagement_v1::model::endpoint::NetworkType;
959 /// let x0 = Endpoint::new().set_network_type(NetworkType::GcpNetwork);
960 /// let x1 = Endpoint::new().set_network_type(NetworkType::NonGcpNetwork);
961 /// let x2 = Endpoint::new().set_network_type(NetworkType::Internet);
962 /// ```
963 pub fn set_network_type<T: std::convert::Into<crate::model::endpoint::NetworkType>>(
964 mut self,
965 v: T,
966 ) -> Self {
967 self.network_type = v.into();
968 self
969 }
970
971 /// Sets the value of [project_id][crate::model::Endpoint::project_id].
972 ///
973 /// # Example
974 /// ```ignore,no_run
975 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
976 /// let x = Endpoint::new().set_project_id("example");
977 /// ```
978 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
979 self.project_id = v.into();
980 self
981 }
982}
983
984impl wkt::message::Message for Endpoint {
985 fn typename() -> &'static str {
986 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint"
987 }
988}
989
990/// Defines additional types related to [Endpoint].
991pub mod endpoint {
992 #[allow(unused_imports)]
993 use super::*;
994
995 /// Wrapper for Cloud Function attributes.
996 #[derive(Clone, Default, PartialEq)]
997 #[non_exhaustive]
998 pub struct CloudFunctionEndpoint {
999 /// A [Cloud Function](https://cloud.google.com/functions) name.
1000 pub uri: std::string::String,
1001
1002 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1003 }
1004
1005 impl CloudFunctionEndpoint {
1006 /// Creates a new default instance.
1007 pub fn new() -> Self {
1008 std::default::Default::default()
1009 }
1010
1011 /// Sets the value of [uri][crate::model::endpoint::CloudFunctionEndpoint::uri].
1012 ///
1013 /// # Example
1014 /// ```ignore,no_run
1015 /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudFunctionEndpoint;
1016 /// let x = CloudFunctionEndpoint::new().set_uri("example");
1017 /// ```
1018 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1019 self.uri = v.into();
1020 self
1021 }
1022 }
1023
1024 impl wkt::message::Message for CloudFunctionEndpoint {
1025 fn typename() -> &'static str {
1026 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.CloudFunctionEndpoint"
1027 }
1028 }
1029
1030 /// Wrapper for the App Engine service version attributes.
1031 #[derive(Clone, Default, PartialEq)]
1032 #[non_exhaustive]
1033 pub struct AppEngineVersionEndpoint {
1034 /// An [App Engine](https://cloud.google.com/appengine) [service
1035 /// version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions)
1036 /// name.
1037 pub uri: std::string::String,
1038
1039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1040 }
1041
1042 impl AppEngineVersionEndpoint {
1043 /// Creates a new default instance.
1044 pub fn new() -> Self {
1045 std::default::Default::default()
1046 }
1047
1048 /// Sets the value of [uri][crate::model::endpoint::AppEngineVersionEndpoint::uri].
1049 ///
1050 /// # Example
1051 /// ```ignore,no_run
1052 /// # use google_cloud_networkmanagement_v1::model::endpoint::AppEngineVersionEndpoint;
1053 /// let x = AppEngineVersionEndpoint::new().set_uri("example");
1054 /// ```
1055 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1056 self.uri = v.into();
1057 self
1058 }
1059 }
1060
1061 impl wkt::message::Message for AppEngineVersionEndpoint {
1062 fn typename() -> &'static str {
1063 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.AppEngineVersionEndpoint"
1064 }
1065 }
1066
1067 /// Wrapper for Cloud Run revision attributes.
1068 #[derive(Clone, Default, PartialEq)]
1069 #[non_exhaustive]
1070 pub struct CloudRunRevisionEndpoint {
1071 /// A [Cloud Run](https://cloud.google.com/run)
1072 /// [revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get)
1073 /// URI. The format is:
1074 /// projects/{project}/locations/{location}/revisions/{revision}
1075 pub uri: std::string::String,
1076
1077 /// Output only. The URI of the Cloud Run service that the revision belongs
1078 /// to. The format is:
1079 /// projects/{project}/locations/{location}/services/{service}
1080 pub service_uri: std::string::String,
1081
1082 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1083 }
1084
1085 impl CloudRunRevisionEndpoint {
1086 /// Creates a new default instance.
1087 pub fn new() -> Self {
1088 std::default::Default::default()
1089 }
1090
1091 /// Sets the value of [uri][crate::model::endpoint::CloudRunRevisionEndpoint::uri].
1092 ///
1093 /// # Example
1094 /// ```ignore,no_run
1095 /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
1096 /// let x = CloudRunRevisionEndpoint::new().set_uri("example");
1097 /// ```
1098 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1099 self.uri = v.into();
1100 self
1101 }
1102
1103 /// Sets the value of [service_uri][crate::model::endpoint::CloudRunRevisionEndpoint::service_uri].
1104 ///
1105 /// # Example
1106 /// ```ignore,no_run
1107 /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
1108 /// let x = CloudRunRevisionEndpoint::new().set_service_uri("example");
1109 /// ```
1110 pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1111 self.service_uri = v.into();
1112 self
1113 }
1114 }
1115
1116 impl wkt::message::Message for CloudRunRevisionEndpoint {
1117 fn typename() -> &'static str {
1118 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.CloudRunRevisionEndpoint"
1119 }
1120 }
1121
1122 /// The type of the network of the IP address endpoint. Relevant for the source
1123 /// IP address endpoints.
1124 ///
1125 /// # Working with unknown values
1126 ///
1127 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1128 /// additional enum variants at any time. Adding new variants is not considered
1129 /// a breaking change. Applications should write their code in anticipation of:
1130 ///
1131 /// - New values appearing in future releases of the client library, **and**
1132 /// - New values received dynamically, without application changes.
1133 ///
1134 /// Please consult the [Working with enums] section in the user guide for some
1135 /// guidelines.
1136 ///
1137 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1138 #[derive(Clone, Debug, PartialEq)]
1139 #[non_exhaustive]
1140 pub enum NetworkType {
1141 /// Unspecified. The test will analyze all possible IP address locations.
1142 /// This might take longer and produce inaccurate or ambiguous results, so
1143 /// prefer specifying an explicit network type.
1144 ///
1145 /// The `project_id` field should be set to the project where the GCP
1146 /// endpoint is located, or where the non-GCP endpoint should be reachable
1147 /// from (via routes to non-GCP networks). The project might also be inferred
1148 /// from the Connectivity Test project or other projects referenced in the
1149 /// request.
1150 Unspecified,
1151 /// A VPC network. Should be used for internal IP addresses in VPC networks.
1152 /// The `network` field should be set to the URI of this network. Only
1153 /// endpoints within this network will be considered.
1154 GcpNetwork,
1155 /// A non-GCP network (for example, an on-premises network or another cloud
1156 /// provider network). Should be used for internal IP addresses outside of
1157 /// Google Cloud. The `network` field should be set to the URI of the VPC
1158 /// network containing a corresponding Cloud VPN tunnel, Cloud Interconnect
1159 /// VLAN attachment, or a router appliance instance. Only endpoints reachable
1160 /// from the provided VPC network via the routes to non-GCP networks will be
1161 /// considered.
1162 NonGcpNetwork,
1163 /// Internet. Should be used for internet-routable external IP addresses or
1164 /// IP addresses for global Google APIs and services.
1165 Internet,
1166 /// If set, the enum was initialized with an unknown value.
1167 ///
1168 /// Applications can examine the value using [NetworkType::value] or
1169 /// [NetworkType::name].
1170 UnknownValue(network_type::UnknownValue),
1171 }
1172
1173 #[doc(hidden)]
1174 pub mod network_type {
1175 #[allow(unused_imports)]
1176 use super::*;
1177 #[derive(Clone, Debug, PartialEq)]
1178 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1179 }
1180
1181 impl NetworkType {
1182 /// Gets the enum value.
1183 ///
1184 /// Returns `None` if the enum contains an unknown value deserialized from
1185 /// the string representation of enums.
1186 pub fn value(&self) -> std::option::Option<i32> {
1187 match self {
1188 Self::Unspecified => std::option::Option::Some(0),
1189 Self::GcpNetwork => std::option::Option::Some(1),
1190 Self::NonGcpNetwork => std::option::Option::Some(2),
1191 Self::Internet => std::option::Option::Some(3),
1192 Self::UnknownValue(u) => u.0.value(),
1193 }
1194 }
1195
1196 /// Gets the enum value as a string.
1197 ///
1198 /// Returns `None` if the enum contains an unknown value deserialized from
1199 /// the integer representation of enums.
1200 pub fn name(&self) -> std::option::Option<&str> {
1201 match self {
1202 Self::Unspecified => std::option::Option::Some("NETWORK_TYPE_UNSPECIFIED"),
1203 Self::GcpNetwork => std::option::Option::Some("GCP_NETWORK"),
1204 Self::NonGcpNetwork => std::option::Option::Some("NON_GCP_NETWORK"),
1205 Self::Internet => std::option::Option::Some("INTERNET"),
1206 Self::UnknownValue(u) => u.0.name(),
1207 }
1208 }
1209 }
1210
1211 impl std::default::Default for NetworkType {
1212 fn default() -> Self {
1213 use std::convert::From;
1214 Self::from(0)
1215 }
1216 }
1217
1218 impl std::fmt::Display for NetworkType {
1219 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1220 wkt::internal::display_enum(f, self.name(), self.value())
1221 }
1222 }
1223
1224 impl std::convert::From<i32> for NetworkType {
1225 fn from(value: i32) -> Self {
1226 match value {
1227 0 => Self::Unspecified,
1228 1 => Self::GcpNetwork,
1229 2 => Self::NonGcpNetwork,
1230 3 => Self::Internet,
1231 _ => Self::UnknownValue(network_type::UnknownValue(
1232 wkt::internal::UnknownEnumValue::Integer(value),
1233 )),
1234 }
1235 }
1236 }
1237
1238 impl std::convert::From<&str> for NetworkType {
1239 fn from(value: &str) -> Self {
1240 use std::string::ToString;
1241 match value {
1242 "NETWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
1243 "GCP_NETWORK" => Self::GcpNetwork,
1244 "NON_GCP_NETWORK" => Self::NonGcpNetwork,
1245 "INTERNET" => Self::Internet,
1246 _ => Self::UnknownValue(network_type::UnknownValue(
1247 wkt::internal::UnknownEnumValue::String(value.to_string()),
1248 )),
1249 }
1250 }
1251 }
1252
1253 impl serde::ser::Serialize for NetworkType {
1254 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1255 where
1256 S: serde::Serializer,
1257 {
1258 match self {
1259 Self::Unspecified => serializer.serialize_i32(0),
1260 Self::GcpNetwork => serializer.serialize_i32(1),
1261 Self::NonGcpNetwork => serializer.serialize_i32(2),
1262 Self::Internet => serializer.serialize_i32(3),
1263 Self::UnknownValue(u) => u.0.serialize(serializer),
1264 }
1265 }
1266 }
1267
1268 impl<'de> serde::de::Deserialize<'de> for NetworkType {
1269 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1270 where
1271 D: serde::Deserializer<'de>,
1272 {
1273 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NetworkType>::new(
1274 ".google.cloud.networkmanagement.v1.Endpoint.NetworkType",
1275 ))
1276 }
1277 }
1278
1279 /// Type of the target of a forwarding rule.
1280 ///
1281 /// # Working with unknown values
1282 ///
1283 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1284 /// additional enum variants at any time. Adding new variants is not considered
1285 /// a breaking change. Applications should write their code in anticipation of:
1286 ///
1287 /// - New values appearing in future releases of the client library, **and**
1288 /// - New values received dynamically, without application changes.
1289 ///
1290 /// Please consult the [Working with enums] section in the user guide for some
1291 /// guidelines.
1292 ///
1293 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1294 #[derive(Clone, Debug, PartialEq)]
1295 #[non_exhaustive]
1296 pub enum ForwardingRuleTarget {
1297 /// Forwarding rule target is unknown.
1298 Unspecified,
1299 /// Compute Engine instance for protocol forwarding.
1300 Instance,
1301 /// Load Balancer. The specific type can be found from [load_balancer_type]
1302 /// [google.cloud.networkmanagement.v1.Endpoint.load_balancer_type].
1303 LoadBalancer,
1304 /// Classic Cloud VPN Gateway.
1305 VpnGateway,
1306 /// Forwarding Rule is a Private Service Connect endpoint.
1307 Psc,
1308 /// If set, the enum was initialized with an unknown value.
1309 ///
1310 /// Applications can examine the value using [ForwardingRuleTarget::value] or
1311 /// [ForwardingRuleTarget::name].
1312 UnknownValue(forwarding_rule_target::UnknownValue),
1313 }
1314
1315 #[doc(hidden)]
1316 pub mod forwarding_rule_target {
1317 #[allow(unused_imports)]
1318 use super::*;
1319 #[derive(Clone, Debug, PartialEq)]
1320 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1321 }
1322
1323 impl ForwardingRuleTarget {
1324 /// Gets the enum value.
1325 ///
1326 /// Returns `None` if the enum contains an unknown value deserialized from
1327 /// the string representation of enums.
1328 pub fn value(&self) -> std::option::Option<i32> {
1329 match self {
1330 Self::Unspecified => std::option::Option::Some(0),
1331 Self::Instance => std::option::Option::Some(1),
1332 Self::LoadBalancer => std::option::Option::Some(2),
1333 Self::VpnGateway => std::option::Option::Some(3),
1334 Self::Psc => std::option::Option::Some(4),
1335 Self::UnknownValue(u) => u.0.value(),
1336 }
1337 }
1338
1339 /// Gets the enum value as a string.
1340 ///
1341 /// Returns `None` if the enum contains an unknown value deserialized from
1342 /// the integer representation of enums.
1343 pub fn name(&self) -> std::option::Option<&str> {
1344 match self {
1345 Self::Unspecified => {
1346 std::option::Option::Some("FORWARDING_RULE_TARGET_UNSPECIFIED")
1347 }
1348 Self::Instance => std::option::Option::Some("INSTANCE"),
1349 Self::LoadBalancer => std::option::Option::Some("LOAD_BALANCER"),
1350 Self::VpnGateway => std::option::Option::Some("VPN_GATEWAY"),
1351 Self::Psc => std::option::Option::Some("PSC"),
1352 Self::UnknownValue(u) => u.0.name(),
1353 }
1354 }
1355 }
1356
1357 impl std::default::Default for ForwardingRuleTarget {
1358 fn default() -> Self {
1359 use std::convert::From;
1360 Self::from(0)
1361 }
1362 }
1363
1364 impl std::fmt::Display for ForwardingRuleTarget {
1365 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1366 wkt::internal::display_enum(f, self.name(), self.value())
1367 }
1368 }
1369
1370 impl std::convert::From<i32> for ForwardingRuleTarget {
1371 fn from(value: i32) -> Self {
1372 match value {
1373 0 => Self::Unspecified,
1374 1 => Self::Instance,
1375 2 => Self::LoadBalancer,
1376 3 => Self::VpnGateway,
1377 4 => Self::Psc,
1378 _ => Self::UnknownValue(forwarding_rule_target::UnknownValue(
1379 wkt::internal::UnknownEnumValue::Integer(value),
1380 )),
1381 }
1382 }
1383 }
1384
1385 impl std::convert::From<&str> for ForwardingRuleTarget {
1386 fn from(value: &str) -> Self {
1387 use std::string::ToString;
1388 match value {
1389 "FORWARDING_RULE_TARGET_UNSPECIFIED" => Self::Unspecified,
1390 "INSTANCE" => Self::Instance,
1391 "LOAD_BALANCER" => Self::LoadBalancer,
1392 "VPN_GATEWAY" => Self::VpnGateway,
1393 "PSC" => Self::Psc,
1394 _ => Self::UnknownValue(forwarding_rule_target::UnknownValue(
1395 wkt::internal::UnknownEnumValue::String(value.to_string()),
1396 )),
1397 }
1398 }
1399 }
1400
1401 impl serde::ser::Serialize for ForwardingRuleTarget {
1402 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1403 where
1404 S: serde::Serializer,
1405 {
1406 match self {
1407 Self::Unspecified => serializer.serialize_i32(0),
1408 Self::Instance => serializer.serialize_i32(1),
1409 Self::LoadBalancer => serializer.serialize_i32(2),
1410 Self::VpnGateway => serializer.serialize_i32(3),
1411 Self::Psc => serializer.serialize_i32(4),
1412 Self::UnknownValue(u) => u.0.serialize(serializer),
1413 }
1414 }
1415 }
1416
1417 impl<'de> serde::de::Deserialize<'de> for ForwardingRuleTarget {
1418 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1419 where
1420 D: serde::Deserializer<'de>,
1421 {
1422 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ForwardingRuleTarget>::new(
1423 ".google.cloud.networkmanagement.v1.Endpoint.ForwardingRuleTarget",
1424 ))
1425 }
1426 }
1427}
1428
1429/// Results of the configuration analysis from the last run of the test.
1430#[derive(Clone, Default, PartialEq)]
1431#[non_exhaustive]
1432pub struct ReachabilityDetails {
1433 /// The overall result of the test's configuration analysis.
1434 pub result: crate::model::reachability_details::Result,
1435
1436 /// The time of the configuration analysis.
1437 pub verify_time: std::option::Option<wkt::Timestamp>,
1438
1439 /// The details of a failure or a cancellation of reachability analysis.
1440 pub error: std::option::Option<google_cloud_rpc::model::Status>,
1441
1442 /// Result may contain a list of traces if a test has multiple possible
1443 /// paths in the network, such as when destination endpoint is a load balancer
1444 /// with multiple backends.
1445 pub traces: std::vec::Vec<crate::model::Trace>,
1446
1447 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1448}
1449
1450impl ReachabilityDetails {
1451 /// Creates a new default instance.
1452 pub fn new() -> Self {
1453 std::default::Default::default()
1454 }
1455
1456 /// Sets the value of [result][crate::model::ReachabilityDetails::result].
1457 ///
1458 /// # Example
1459 /// ```ignore,no_run
1460 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1461 /// use google_cloud_networkmanagement_v1::model::reachability_details::Result;
1462 /// let x0 = ReachabilityDetails::new().set_result(Result::Reachable);
1463 /// let x1 = ReachabilityDetails::new().set_result(Result::Unreachable);
1464 /// let x2 = ReachabilityDetails::new().set_result(Result::Ambiguous);
1465 /// ```
1466 pub fn set_result<T: std::convert::Into<crate::model::reachability_details::Result>>(
1467 mut self,
1468 v: T,
1469 ) -> Self {
1470 self.result = v.into();
1471 self
1472 }
1473
1474 /// Sets the value of [verify_time][crate::model::ReachabilityDetails::verify_time].
1475 ///
1476 /// # Example
1477 /// ```ignore,no_run
1478 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1479 /// use wkt::Timestamp;
1480 /// let x = ReachabilityDetails::new().set_verify_time(Timestamp::default()/* use setters */);
1481 /// ```
1482 pub fn set_verify_time<T>(mut self, v: T) -> Self
1483 where
1484 T: std::convert::Into<wkt::Timestamp>,
1485 {
1486 self.verify_time = std::option::Option::Some(v.into());
1487 self
1488 }
1489
1490 /// Sets or clears the value of [verify_time][crate::model::ReachabilityDetails::verify_time].
1491 ///
1492 /// # Example
1493 /// ```ignore,no_run
1494 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1495 /// use wkt::Timestamp;
1496 /// let x = ReachabilityDetails::new().set_or_clear_verify_time(Some(Timestamp::default()/* use setters */));
1497 /// let x = ReachabilityDetails::new().set_or_clear_verify_time(None::<Timestamp>);
1498 /// ```
1499 pub fn set_or_clear_verify_time<T>(mut self, v: std::option::Option<T>) -> Self
1500 where
1501 T: std::convert::Into<wkt::Timestamp>,
1502 {
1503 self.verify_time = v.map(|x| x.into());
1504 self
1505 }
1506
1507 /// Sets the value of [error][crate::model::ReachabilityDetails::error].
1508 ///
1509 /// # Example
1510 /// ```ignore,no_run
1511 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1512 /// use google_cloud_rpc::model::Status;
1513 /// let x = ReachabilityDetails::new().set_error(Status::default()/* use setters */);
1514 /// ```
1515 pub fn set_error<T>(mut self, v: T) -> Self
1516 where
1517 T: std::convert::Into<google_cloud_rpc::model::Status>,
1518 {
1519 self.error = std::option::Option::Some(v.into());
1520 self
1521 }
1522
1523 /// Sets or clears the value of [error][crate::model::ReachabilityDetails::error].
1524 ///
1525 /// # Example
1526 /// ```ignore,no_run
1527 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1528 /// use google_cloud_rpc::model::Status;
1529 /// let x = ReachabilityDetails::new().set_or_clear_error(Some(Status::default()/* use setters */));
1530 /// let x = ReachabilityDetails::new().set_or_clear_error(None::<Status>);
1531 /// ```
1532 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1533 where
1534 T: std::convert::Into<google_cloud_rpc::model::Status>,
1535 {
1536 self.error = v.map(|x| x.into());
1537 self
1538 }
1539
1540 /// Sets the value of [traces][crate::model::ReachabilityDetails::traces].
1541 ///
1542 /// # Example
1543 /// ```ignore,no_run
1544 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1545 /// use google_cloud_networkmanagement_v1::model::Trace;
1546 /// let x = ReachabilityDetails::new()
1547 /// .set_traces([
1548 /// Trace::default()/* use setters */,
1549 /// Trace::default()/* use (different) setters */,
1550 /// ]);
1551 /// ```
1552 pub fn set_traces<T, V>(mut self, v: T) -> Self
1553 where
1554 T: std::iter::IntoIterator<Item = V>,
1555 V: std::convert::Into<crate::model::Trace>,
1556 {
1557 use std::iter::Iterator;
1558 self.traces = v.into_iter().map(|i| i.into()).collect();
1559 self
1560 }
1561}
1562
1563impl wkt::message::Message for ReachabilityDetails {
1564 fn typename() -> &'static str {
1565 "type.googleapis.com/google.cloud.networkmanagement.v1.ReachabilityDetails"
1566 }
1567}
1568
1569/// Defines additional types related to [ReachabilityDetails].
1570pub mod reachability_details {
1571 #[allow(unused_imports)]
1572 use super::*;
1573
1574 /// The overall result of the test's configuration analysis.
1575 ///
1576 /// # Working with unknown values
1577 ///
1578 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1579 /// additional enum variants at any time. Adding new variants is not considered
1580 /// a breaking change. Applications should write their code in anticipation of:
1581 ///
1582 /// - New values appearing in future releases of the client library, **and**
1583 /// - New values received dynamically, without application changes.
1584 ///
1585 /// Please consult the [Working with enums] section in the user guide for some
1586 /// guidelines.
1587 ///
1588 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1589 #[derive(Clone, Debug, PartialEq)]
1590 #[non_exhaustive]
1591 pub enum Result {
1592 /// No result was specified.
1593 Unspecified,
1594 /// Possible scenarios are:
1595 ///
1596 /// * The configuration analysis determined that a packet originating from
1597 /// the source is expected to reach the destination.
1598 /// * The analysis didn't complete because the user lacks permission for
1599 /// some of the resources in the trace. However, at the time the user's
1600 /// permission became insufficient, the trace had been successful so far.
1601 Reachable,
1602 /// A packet originating from the source is expected to be dropped before
1603 /// reaching the destination.
1604 Unreachable,
1605 /// The source and destination endpoints do not uniquely identify
1606 /// the test location in the network, and the reachability result contains
1607 /// multiple traces. For some traces, a packet could be delivered, and for
1608 /// others, it would not be. This result is also assigned to
1609 /// configuration analysis of return path if on its own it should be
1610 /// REACHABLE, but configuration analysis of forward path is AMBIGUOUS.
1611 Ambiguous,
1612 /// The configuration analysis did not complete. Possible reasons are:
1613 ///
1614 /// * A permissions error occurred--for example, the user might not have
1615 /// read permission for all of the resources named in the test.
1616 /// * An internal error occurred.
1617 /// * The analyzer received an invalid or unsupported argument or was unable
1618 /// to identify a known endpoint.
1619 Undetermined,
1620 /// If set, the enum was initialized with an unknown value.
1621 ///
1622 /// Applications can examine the value using [Result::value] or
1623 /// [Result::name].
1624 UnknownValue(result::UnknownValue),
1625 }
1626
1627 #[doc(hidden)]
1628 pub mod result {
1629 #[allow(unused_imports)]
1630 use super::*;
1631 #[derive(Clone, Debug, PartialEq)]
1632 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1633 }
1634
1635 impl Result {
1636 /// Gets the enum value.
1637 ///
1638 /// Returns `None` if the enum contains an unknown value deserialized from
1639 /// the string representation of enums.
1640 pub fn value(&self) -> std::option::Option<i32> {
1641 match self {
1642 Self::Unspecified => std::option::Option::Some(0),
1643 Self::Reachable => std::option::Option::Some(1),
1644 Self::Unreachable => std::option::Option::Some(2),
1645 Self::Ambiguous => std::option::Option::Some(4),
1646 Self::Undetermined => std::option::Option::Some(5),
1647 Self::UnknownValue(u) => u.0.value(),
1648 }
1649 }
1650
1651 /// Gets the enum value as a string.
1652 ///
1653 /// Returns `None` if the enum contains an unknown value deserialized from
1654 /// the integer representation of enums.
1655 pub fn name(&self) -> std::option::Option<&str> {
1656 match self {
1657 Self::Unspecified => std::option::Option::Some("RESULT_UNSPECIFIED"),
1658 Self::Reachable => std::option::Option::Some("REACHABLE"),
1659 Self::Unreachable => std::option::Option::Some("UNREACHABLE"),
1660 Self::Ambiguous => std::option::Option::Some("AMBIGUOUS"),
1661 Self::Undetermined => std::option::Option::Some("UNDETERMINED"),
1662 Self::UnknownValue(u) => u.0.name(),
1663 }
1664 }
1665 }
1666
1667 impl std::default::Default for Result {
1668 fn default() -> Self {
1669 use std::convert::From;
1670 Self::from(0)
1671 }
1672 }
1673
1674 impl std::fmt::Display for Result {
1675 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1676 wkt::internal::display_enum(f, self.name(), self.value())
1677 }
1678 }
1679
1680 impl std::convert::From<i32> for Result {
1681 fn from(value: i32) -> Self {
1682 match value {
1683 0 => Self::Unspecified,
1684 1 => Self::Reachable,
1685 2 => Self::Unreachable,
1686 4 => Self::Ambiguous,
1687 5 => Self::Undetermined,
1688 _ => Self::UnknownValue(result::UnknownValue(
1689 wkt::internal::UnknownEnumValue::Integer(value),
1690 )),
1691 }
1692 }
1693 }
1694
1695 impl std::convert::From<&str> for Result {
1696 fn from(value: &str) -> Self {
1697 use std::string::ToString;
1698 match value {
1699 "RESULT_UNSPECIFIED" => Self::Unspecified,
1700 "REACHABLE" => Self::Reachable,
1701 "UNREACHABLE" => Self::Unreachable,
1702 "AMBIGUOUS" => Self::Ambiguous,
1703 "UNDETERMINED" => Self::Undetermined,
1704 _ => Self::UnknownValue(result::UnknownValue(
1705 wkt::internal::UnknownEnumValue::String(value.to_string()),
1706 )),
1707 }
1708 }
1709 }
1710
1711 impl serde::ser::Serialize for Result {
1712 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1713 where
1714 S: serde::Serializer,
1715 {
1716 match self {
1717 Self::Unspecified => serializer.serialize_i32(0),
1718 Self::Reachable => serializer.serialize_i32(1),
1719 Self::Unreachable => serializer.serialize_i32(2),
1720 Self::Ambiguous => serializer.serialize_i32(4),
1721 Self::Undetermined => serializer.serialize_i32(5),
1722 Self::UnknownValue(u) => u.0.serialize(serializer),
1723 }
1724 }
1725 }
1726
1727 impl<'de> serde::de::Deserialize<'de> for Result {
1728 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1729 where
1730 D: serde::Deserializer<'de>,
1731 {
1732 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Result>::new(
1733 ".google.cloud.networkmanagement.v1.ReachabilityDetails.Result",
1734 ))
1735 }
1736 }
1737}
1738
1739/// Latency percentile rank and value.
1740#[derive(Clone, Default, PartialEq)]
1741#[non_exhaustive]
1742pub struct LatencyPercentile {
1743 /// Percentage of samples this data point applies to.
1744 pub percent: i32,
1745
1746 /// percent-th percentile of latency observed, in microseconds.
1747 /// Fraction of percent/100 of samples have latency lower or
1748 /// equal to the value of this field.
1749 pub latency_micros: i64,
1750
1751 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1752}
1753
1754impl LatencyPercentile {
1755 /// Creates a new default instance.
1756 pub fn new() -> Self {
1757 std::default::Default::default()
1758 }
1759
1760 /// Sets the value of [percent][crate::model::LatencyPercentile::percent].
1761 ///
1762 /// # Example
1763 /// ```ignore,no_run
1764 /// # use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1765 /// let x = LatencyPercentile::new().set_percent(42);
1766 /// ```
1767 pub fn set_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1768 self.percent = v.into();
1769 self
1770 }
1771
1772 /// Sets the value of [latency_micros][crate::model::LatencyPercentile::latency_micros].
1773 ///
1774 /// # Example
1775 /// ```ignore,no_run
1776 /// # use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1777 /// let x = LatencyPercentile::new().set_latency_micros(42);
1778 /// ```
1779 pub fn set_latency_micros<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1780 self.latency_micros = v.into();
1781 self
1782 }
1783}
1784
1785impl wkt::message::Message for LatencyPercentile {
1786 fn typename() -> &'static str {
1787 "type.googleapis.com/google.cloud.networkmanagement.v1.LatencyPercentile"
1788 }
1789}
1790
1791/// Describes measured latency distribution.
1792#[derive(Clone, Default, PartialEq)]
1793#[non_exhaustive]
1794pub struct LatencyDistribution {
1795 /// Representative latency percentiles.
1796 pub latency_percentiles: std::vec::Vec<crate::model::LatencyPercentile>,
1797
1798 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1799}
1800
1801impl LatencyDistribution {
1802 /// Creates a new default instance.
1803 pub fn new() -> Self {
1804 std::default::Default::default()
1805 }
1806
1807 /// Sets the value of [latency_percentiles][crate::model::LatencyDistribution::latency_percentiles].
1808 ///
1809 /// # Example
1810 /// ```ignore,no_run
1811 /// # use google_cloud_networkmanagement_v1::model::LatencyDistribution;
1812 /// use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1813 /// let x = LatencyDistribution::new()
1814 /// .set_latency_percentiles([
1815 /// LatencyPercentile::default()/* use setters */,
1816 /// LatencyPercentile::default()/* use (different) setters */,
1817 /// ]);
1818 /// ```
1819 pub fn set_latency_percentiles<T, V>(mut self, v: T) -> Self
1820 where
1821 T: std::iter::IntoIterator<Item = V>,
1822 V: std::convert::Into<crate::model::LatencyPercentile>,
1823 {
1824 use std::iter::Iterator;
1825 self.latency_percentiles = v.into_iter().map(|i| i.into()).collect();
1826 self
1827 }
1828}
1829
1830impl wkt::message::Message for LatencyDistribution {
1831 fn typename() -> &'static str {
1832 "type.googleapis.com/google.cloud.networkmanagement.v1.LatencyDistribution"
1833 }
1834}
1835
1836/// Results of active probing from the last run of the test.
1837#[derive(Clone, Default, PartialEq)]
1838#[non_exhaustive]
1839pub struct ProbingDetails {
1840 /// The overall result of active probing.
1841 pub result: crate::model::probing_details::ProbingResult,
1842
1843 /// The time that reachability was assessed through active probing.
1844 pub verify_time: std::option::Option<wkt::Timestamp>,
1845
1846 /// Details about an internal failure or the cancellation of active probing.
1847 pub error: std::option::Option<google_cloud_rpc::model::Status>,
1848
1849 /// The reason probing was aborted.
1850 pub abort_cause: crate::model::probing_details::ProbingAbortCause,
1851
1852 /// Number of probes sent.
1853 pub sent_probe_count: i32,
1854
1855 /// Number of probes that reached the destination.
1856 pub successful_probe_count: i32,
1857
1858 /// The source and destination endpoints derived from the test input and used
1859 /// for active probing.
1860 pub endpoint_info: std::option::Option<crate::model::EndpointInfo>,
1861
1862 /// Latency as measured by active probing in one direction:
1863 /// from the source to the destination endpoint.
1864 pub probing_latency: std::option::Option<crate::model::LatencyDistribution>,
1865
1866 /// The EdgeLocation from which a packet, destined to the internet, will egress
1867 /// the Google network.
1868 /// This will only be populated for a connectivity test which has an internet
1869 /// destination address.
1870 /// The absence of this field *must not* be used as an indication that the
1871 /// destination is part of the Google network.
1872 pub destination_egress_location:
1873 std::option::Option<crate::model::probing_details::EdgeLocation>,
1874
1875 /// Probing results for all edge devices.
1876 pub edge_responses: std::vec::Vec<crate::model::probing_details::SingleEdgeResponse>,
1877
1878 /// Whether all relevant edge devices were probed.
1879 pub probed_all_devices: bool,
1880
1881 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1882}
1883
1884impl ProbingDetails {
1885 /// Creates a new default instance.
1886 pub fn new() -> Self {
1887 std::default::Default::default()
1888 }
1889
1890 /// Sets the value of [result][crate::model::ProbingDetails::result].
1891 ///
1892 /// # Example
1893 /// ```ignore,no_run
1894 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1895 /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingResult;
1896 /// let x0 = ProbingDetails::new().set_result(ProbingResult::Reachable);
1897 /// let x1 = ProbingDetails::new().set_result(ProbingResult::Unreachable);
1898 /// let x2 = ProbingDetails::new().set_result(ProbingResult::ReachabilityInconsistent);
1899 /// ```
1900 pub fn set_result<T: std::convert::Into<crate::model::probing_details::ProbingResult>>(
1901 mut self,
1902 v: T,
1903 ) -> Self {
1904 self.result = v.into();
1905 self
1906 }
1907
1908 /// Sets the value of [verify_time][crate::model::ProbingDetails::verify_time].
1909 ///
1910 /// # Example
1911 /// ```ignore,no_run
1912 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1913 /// use wkt::Timestamp;
1914 /// let x = ProbingDetails::new().set_verify_time(Timestamp::default()/* use setters */);
1915 /// ```
1916 pub fn set_verify_time<T>(mut self, v: T) -> Self
1917 where
1918 T: std::convert::Into<wkt::Timestamp>,
1919 {
1920 self.verify_time = std::option::Option::Some(v.into());
1921 self
1922 }
1923
1924 /// Sets or clears the value of [verify_time][crate::model::ProbingDetails::verify_time].
1925 ///
1926 /// # Example
1927 /// ```ignore,no_run
1928 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1929 /// use wkt::Timestamp;
1930 /// let x = ProbingDetails::new().set_or_clear_verify_time(Some(Timestamp::default()/* use setters */));
1931 /// let x = ProbingDetails::new().set_or_clear_verify_time(None::<Timestamp>);
1932 /// ```
1933 pub fn set_or_clear_verify_time<T>(mut self, v: std::option::Option<T>) -> Self
1934 where
1935 T: std::convert::Into<wkt::Timestamp>,
1936 {
1937 self.verify_time = v.map(|x| x.into());
1938 self
1939 }
1940
1941 /// Sets the value of [error][crate::model::ProbingDetails::error].
1942 ///
1943 /// # Example
1944 /// ```ignore,no_run
1945 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1946 /// use google_cloud_rpc::model::Status;
1947 /// let x = ProbingDetails::new().set_error(Status::default()/* use setters */);
1948 /// ```
1949 pub fn set_error<T>(mut self, v: T) -> Self
1950 where
1951 T: std::convert::Into<google_cloud_rpc::model::Status>,
1952 {
1953 self.error = std::option::Option::Some(v.into());
1954 self
1955 }
1956
1957 /// Sets or clears the value of [error][crate::model::ProbingDetails::error].
1958 ///
1959 /// # Example
1960 /// ```ignore,no_run
1961 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1962 /// use google_cloud_rpc::model::Status;
1963 /// let x = ProbingDetails::new().set_or_clear_error(Some(Status::default()/* use setters */));
1964 /// let x = ProbingDetails::new().set_or_clear_error(None::<Status>);
1965 /// ```
1966 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1967 where
1968 T: std::convert::Into<google_cloud_rpc::model::Status>,
1969 {
1970 self.error = v.map(|x| x.into());
1971 self
1972 }
1973
1974 /// Sets the value of [abort_cause][crate::model::ProbingDetails::abort_cause].
1975 ///
1976 /// # Example
1977 /// ```ignore,no_run
1978 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1979 /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingAbortCause;
1980 /// let x0 = ProbingDetails::new().set_abort_cause(ProbingAbortCause::PermissionDenied);
1981 /// let x1 = ProbingDetails::new().set_abort_cause(ProbingAbortCause::NoSourceLocation);
1982 /// ```
1983 pub fn set_abort_cause<
1984 T: std::convert::Into<crate::model::probing_details::ProbingAbortCause>,
1985 >(
1986 mut self,
1987 v: T,
1988 ) -> Self {
1989 self.abort_cause = v.into();
1990 self
1991 }
1992
1993 /// Sets the value of [sent_probe_count][crate::model::ProbingDetails::sent_probe_count].
1994 ///
1995 /// # Example
1996 /// ```ignore,no_run
1997 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1998 /// let x = ProbingDetails::new().set_sent_probe_count(42);
1999 /// ```
2000 pub fn set_sent_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2001 self.sent_probe_count = v.into();
2002 self
2003 }
2004
2005 /// Sets the value of [successful_probe_count][crate::model::ProbingDetails::successful_probe_count].
2006 ///
2007 /// # Example
2008 /// ```ignore,no_run
2009 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2010 /// let x = ProbingDetails::new().set_successful_probe_count(42);
2011 /// ```
2012 pub fn set_successful_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2013 self.successful_probe_count = v.into();
2014 self
2015 }
2016
2017 /// Sets the value of [endpoint_info][crate::model::ProbingDetails::endpoint_info].
2018 ///
2019 /// # Example
2020 /// ```ignore,no_run
2021 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2022 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
2023 /// let x = ProbingDetails::new().set_endpoint_info(EndpointInfo::default()/* use setters */);
2024 /// ```
2025 pub fn set_endpoint_info<T>(mut self, v: T) -> Self
2026 where
2027 T: std::convert::Into<crate::model::EndpointInfo>,
2028 {
2029 self.endpoint_info = std::option::Option::Some(v.into());
2030 self
2031 }
2032
2033 /// Sets or clears the value of [endpoint_info][crate::model::ProbingDetails::endpoint_info].
2034 ///
2035 /// # Example
2036 /// ```ignore,no_run
2037 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2038 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
2039 /// let x = ProbingDetails::new().set_or_clear_endpoint_info(Some(EndpointInfo::default()/* use setters */));
2040 /// let x = ProbingDetails::new().set_or_clear_endpoint_info(None::<EndpointInfo>);
2041 /// ```
2042 pub fn set_or_clear_endpoint_info<T>(mut self, v: std::option::Option<T>) -> Self
2043 where
2044 T: std::convert::Into<crate::model::EndpointInfo>,
2045 {
2046 self.endpoint_info = v.map(|x| x.into());
2047 self
2048 }
2049
2050 /// Sets the value of [probing_latency][crate::model::ProbingDetails::probing_latency].
2051 ///
2052 /// # Example
2053 /// ```ignore,no_run
2054 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2055 /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2056 /// let x = ProbingDetails::new().set_probing_latency(LatencyDistribution::default()/* use setters */);
2057 /// ```
2058 pub fn set_probing_latency<T>(mut self, v: T) -> Self
2059 where
2060 T: std::convert::Into<crate::model::LatencyDistribution>,
2061 {
2062 self.probing_latency = std::option::Option::Some(v.into());
2063 self
2064 }
2065
2066 /// Sets or clears the value of [probing_latency][crate::model::ProbingDetails::probing_latency].
2067 ///
2068 /// # Example
2069 /// ```ignore,no_run
2070 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2071 /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2072 /// let x = ProbingDetails::new().set_or_clear_probing_latency(Some(LatencyDistribution::default()/* use setters */));
2073 /// let x = ProbingDetails::new().set_or_clear_probing_latency(None::<LatencyDistribution>);
2074 /// ```
2075 pub fn set_or_clear_probing_latency<T>(mut self, v: std::option::Option<T>) -> Self
2076 where
2077 T: std::convert::Into<crate::model::LatencyDistribution>,
2078 {
2079 self.probing_latency = v.map(|x| x.into());
2080 self
2081 }
2082
2083 /// Sets the value of [destination_egress_location][crate::model::ProbingDetails::destination_egress_location].
2084 ///
2085 /// # Example
2086 /// ```ignore,no_run
2087 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2088 /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2089 /// let x = ProbingDetails::new().set_destination_egress_location(EdgeLocation::default()/* use setters */);
2090 /// ```
2091 pub fn set_destination_egress_location<T>(mut self, v: T) -> Self
2092 where
2093 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2094 {
2095 self.destination_egress_location = std::option::Option::Some(v.into());
2096 self
2097 }
2098
2099 /// Sets or clears the value of [destination_egress_location][crate::model::ProbingDetails::destination_egress_location].
2100 ///
2101 /// # Example
2102 /// ```ignore,no_run
2103 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2104 /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2105 /// let x = ProbingDetails::new().set_or_clear_destination_egress_location(Some(EdgeLocation::default()/* use setters */));
2106 /// let x = ProbingDetails::new().set_or_clear_destination_egress_location(None::<EdgeLocation>);
2107 /// ```
2108 pub fn set_or_clear_destination_egress_location<T>(mut self, v: std::option::Option<T>) -> Self
2109 where
2110 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2111 {
2112 self.destination_egress_location = v.map(|x| x.into());
2113 self
2114 }
2115
2116 /// Sets the value of [edge_responses][crate::model::ProbingDetails::edge_responses].
2117 ///
2118 /// # Example
2119 /// ```ignore,no_run
2120 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2121 /// use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2122 /// let x = ProbingDetails::new()
2123 /// .set_edge_responses([
2124 /// SingleEdgeResponse::default()/* use setters */,
2125 /// SingleEdgeResponse::default()/* use (different) setters */,
2126 /// ]);
2127 /// ```
2128 pub fn set_edge_responses<T, V>(mut self, v: T) -> Self
2129 where
2130 T: std::iter::IntoIterator<Item = V>,
2131 V: std::convert::Into<crate::model::probing_details::SingleEdgeResponse>,
2132 {
2133 use std::iter::Iterator;
2134 self.edge_responses = v.into_iter().map(|i| i.into()).collect();
2135 self
2136 }
2137
2138 /// Sets the value of [probed_all_devices][crate::model::ProbingDetails::probed_all_devices].
2139 ///
2140 /// # Example
2141 /// ```ignore,no_run
2142 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2143 /// let x = ProbingDetails::new().set_probed_all_devices(true);
2144 /// ```
2145 pub fn set_probed_all_devices<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2146 self.probed_all_devices = v.into();
2147 self
2148 }
2149}
2150
2151impl wkt::message::Message for ProbingDetails {
2152 fn typename() -> &'static str {
2153 "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails"
2154 }
2155}
2156
2157/// Defines additional types related to [ProbingDetails].
2158pub mod probing_details {
2159 #[allow(unused_imports)]
2160 use super::*;
2161
2162 /// Representation of a network edge location as per
2163 /// <https://cloud.google.com/vpc/docs/edge-locations>.
2164 #[derive(Clone, Default, PartialEq)]
2165 #[non_exhaustive]
2166 pub struct EdgeLocation {
2167 /// Name of the metropolitan area.
2168 pub metropolitan_area: std::string::String,
2169
2170 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2171 }
2172
2173 impl EdgeLocation {
2174 /// Creates a new default instance.
2175 pub fn new() -> Self {
2176 std::default::Default::default()
2177 }
2178
2179 /// Sets the value of [metropolitan_area][crate::model::probing_details::EdgeLocation::metropolitan_area].
2180 ///
2181 /// # Example
2182 /// ```ignore,no_run
2183 /// # use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2184 /// let x = EdgeLocation::new().set_metropolitan_area("example");
2185 /// ```
2186 pub fn set_metropolitan_area<T: std::convert::Into<std::string::String>>(
2187 mut self,
2188 v: T,
2189 ) -> Self {
2190 self.metropolitan_area = v.into();
2191 self
2192 }
2193 }
2194
2195 impl wkt::message::Message for EdgeLocation {
2196 fn typename() -> &'static str {
2197 "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails.EdgeLocation"
2198 }
2199 }
2200
2201 /// Probing results for a single edge device.
2202 #[derive(Clone, Default, PartialEq)]
2203 #[non_exhaustive]
2204 pub struct SingleEdgeResponse {
2205 /// The overall result of active probing for this egress device.
2206 pub result: crate::model::probing_details::ProbingResult,
2207
2208 /// Number of probes sent.
2209 pub sent_probe_count: i32,
2210
2211 /// Number of probes that reached the destination.
2212 pub successful_probe_count: i32,
2213
2214 /// Latency as measured by active probing in one direction: from the source
2215 /// to the destination endpoint.
2216 pub probing_latency: std::option::Option<crate::model::LatencyDistribution>,
2217
2218 /// The EdgeLocation from which a packet, destined to the internet, will
2219 /// egress the Google network.
2220 /// This will only be populated for a connectivity test which has an internet
2221 /// destination address.
2222 /// The absence of this field *must not* be used as an indication that the
2223 /// destination is part of the Google network.
2224 pub destination_egress_location:
2225 std::option::Option<crate::model::probing_details::EdgeLocation>,
2226
2227 /// Router name in the format '{router}.{metroshard}'. For example:
2228 /// pf01.aaa01, pr02.aaa01.
2229 pub destination_router: std::string::String,
2230
2231 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2232 }
2233
2234 impl SingleEdgeResponse {
2235 /// Creates a new default instance.
2236 pub fn new() -> Self {
2237 std::default::Default::default()
2238 }
2239
2240 /// Sets the value of [result][crate::model::probing_details::SingleEdgeResponse::result].
2241 ///
2242 /// # Example
2243 /// ```ignore,no_run
2244 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2245 /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingResult;
2246 /// let x0 = SingleEdgeResponse::new().set_result(ProbingResult::Reachable);
2247 /// let x1 = SingleEdgeResponse::new().set_result(ProbingResult::Unreachable);
2248 /// let x2 = SingleEdgeResponse::new().set_result(ProbingResult::ReachabilityInconsistent);
2249 /// ```
2250 pub fn set_result<T: std::convert::Into<crate::model::probing_details::ProbingResult>>(
2251 mut self,
2252 v: T,
2253 ) -> Self {
2254 self.result = v.into();
2255 self
2256 }
2257
2258 /// Sets the value of [sent_probe_count][crate::model::probing_details::SingleEdgeResponse::sent_probe_count].
2259 ///
2260 /// # Example
2261 /// ```ignore,no_run
2262 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2263 /// let x = SingleEdgeResponse::new().set_sent_probe_count(42);
2264 /// ```
2265 pub fn set_sent_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2266 self.sent_probe_count = v.into();
2267 self
2268 }
2269
2270 /// Sets the value of [successful_probe_count][crate::model::probing_details::SingleEdgeResponse::successful_probe_count].
2271 ///
2272 /// # Example
2273 /// ```ignore,no_run
2274 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2275 /// let x = SingleEdgeResponse::new().set_successful_probe_count(42);
2276 /// ```
2277 pub fn set_successful_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2278 self.successful_probe_count = v.into();
2279 self
2280 }
2281
2282 /// Sets the value of [probing_latency][crate::model::probing_details::SingleEdgeResponse::probing_latency].
2283 ///
2284 /// # Example
2285 /// ```ignore,no_run
2286 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2287 /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2288 /// let x = SingleEdgeResponse::new().set_probing_latency(LatencyDistribution::default()/* use setters */);
2289 /// ```
2290 pub fn set_probing_latency<T>(mut self, v: T) -> Self
2291 where
2292 T: std::convert::Into<crate::model::LatencyDistribution>,
2293 {
2294 self.probing_latency = std::option::Option::Some(v.into());
2295 self
2296 }
2297
2298 /// Sets or clears the value of [probing_latency][crate::model::probing_details::SingleEdgeResponse::probing_latency].
2299 ///
2300 /// # Example
2301 /// ```ignore,no_run
2302 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2303 /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2304 /// let x = SingleEdgeResponse::new().set_or_clear_probing_latency(Some(LatencyDistribution::default()/* use setters */));
2305 /// let x = SingleEdgeResponse::new().set_or_clear_probing_latency(None::<LatencyDistribution>);
2306 /// ```
2307 pub fn set_or_clear_probing_latency<T>(mut self, v: std::option::Option<T>) -> Self
2308 where
2309 T: std::convert::Into<crate::model::LatencyDistribution>,
2310 {
2311 self.probing_latency = v.map(|x| x.into());
2312 self
2313 }
2314
2315 /// Sets the value of [destination_egress_location][crate::model::probing_details::SingleEdgeResponse::destination_egress_location].
2316 ///
2317 /// # Example
2318 /// ```ignore,no_run
2319 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2320 /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2321 /// let x = SingleEdgeResponse::new().set_destination_egress_location(EdgeLocation::default()/* use setters */);
2322 /// ```
2323 pub fn set_destination_egress_location<T>(mut self, v: T) -> Self
2324 where
2325 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2326 {
2327 self.destination_egress_location = std::option::Option::Some(v.into());
2328 self
2329 }
2330
2331 /// Sets or clears the value of [destination_egress_location][crate::model::probing_details::SingleEdgeResponse::destination_egress_location].
2332 ///
2333 /// # Example
2334 /// ```ignore,no_run
2335 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2336 /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2337 /// let x = SingleEdgeResponse::new().set_or_clear_destination_egress_location(Some(EdgeLocation::default()/* use setters */));
2338 /// let x = SingleEdgeResponse::new().set_or_clear_destination_egress_location(None::<EdgeLocation>);
2339 /// ```
2340 pub fn set_or_clear_destination_egress_location<T>(
2341 mut self,
2342 v: std::option::Option<T>,
2343 ) -> Self
2344 where
2345 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2346 {
2347 self.destination_egress_location = v.map(|x| x.into());
2348 self
2349 }
2350
2351 /// Sets the value of [destination_router][crate::model::probing_details::SingleEdgeResponse::destination_router].
2352 ///
2353 /// # Example
2354 /// ```ignore,no_run
2355 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2356 /// let x = SingleEdgeResponse::new().set_destination_router("example");
2357 /// ```
2358 pub fn set_destination_router<T: std::convert::Into<std::string::String>>(
2359 mut self,
2360 v: T,
2361 ) -> Self {
2362 self.destination_router = v.into();
2363 self
2364 }
2365 }
2366
2367 impl wkt::message::Message for SingleEdgeResponse {
2368 fn typename() -> &'static str {
2369 "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails.SingleEdgeResponse"
2370 }
2371 }
2372
2373 /// Overall probing result of the test.
2374 ///
2375 /// # Working with unknown values
2376 ///
2377 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2378 /// additional enum variants at any time. Adding new variants is not considered
2379 /// a breaking change. Applications should write their code in anticipation of:
2380 ///
2381 /// - New values appearing in future releases of the client library, **and**
2382 /// - New values received dynamically, without application changes.
2383 ///
2384 /// Please consult the [Working with enums] section in the user guide for some
2385 /// guidelines.
2386 ///
2387 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2388 #[derive(Clone, Debug, PartialEq)]
2389 #[non_exhaustive]
2390 pub enum ProbingResult {
2391 /// No result was specified.
2392 Unspecified,
2393 /// At least 95% of packets reached the destination.
2394 Reachable,
2395 /// No packets reached the destination.
2396 Unreachable,
2397 /// Less than 95% of packets reached the destination.
2398 ReachabilityInconsistent,
2399 /// Reachability could not be determined. Possible reasons are:
2400 ///
2401 /// * The user lacks permission to access some of the network resources
2402 /// required to run the test.
2403 /// * No valid source endpoint could be derived from the request.
2404 /// * An internal error occurred.
2405 Undetermined,
2406 /// If set, the enum was initialized with an unknown value.
2407 ///
2408 /// Applications can examine the value using [ProbingResult::value] or
2409 /// [ProbingResult::name].
2410 UnknownValue(probing_result::UnknownValue),
2411 }
2412
2413 #[doc(hidden)]
2414 pub mod probing_result {
2415 #[allow(unused_imports)]
2416 use super::*;
2417 #[derive(Clone, Debug, PartialEq)]
2418 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2419 }
2420
2421 impl ProbingResult {
2422 /// Gets the enum value.
2423 ///
2424 /// Returns `None` if the enum contains an unknown value deserialized from
2425 /// the string representation of enums.
2426 pub fn value(&self) -> std::option::Option<i32> {
2427 match self {
2428 Self::Unspecified => std::option::Option::Some(0),
2429 Self::Reachable => std::option::Option::Some(1),
2430 Self::Unreachable => std::option::Option::Some(2),
2431 Self::ReachabilityInconsistent => std::option::Option::Some(3),
2432 Self::Undetermined => std::option::Option::Some(4),
2433 Self::UnknownValue(u) => u.0.value(),
2434 }
2435 }
2436
2437 /// Gets the enum value as a string.
2438 ///
2439 /// Returns `None` if the enum contains an unknown value deserialized from
2440 /// the integer representation of enums.
2441 pub fn name(&self) -> std::option::Option<&str> {
2442 match self {
2443 Self::Unspecified => std::option::Option::Some("PROBING_RESULT_UNSPECIFIED"),
2444 Self::Reachable => std::option::Option::Some("REACHABLE"),
2445 Self::Unreachable => std::option::Option::Some("UNREACHABLE"),
2446 Self::ReachabilityInconsistent => {
2447 std::option::Option::Some("REACHABILITY_INCONSISTENT")
2448 }
2449 Self::Undetermined => std::option::Option::Some("UNDETERMINED"),
2450 Self::UnknownValue(u) => u.0.name(),
2451 }
2452 }
2453 }
2454
2455 impl std::default::Default for ProbingResult {
2456 fn default() -> Self {
2457 use std::convert::From;
2458 Self::from(0)
2459 }
2460 }
2461
2462 impl std::fmt::Display for ProbingResult {
2463 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2464 wkt::internal::display_enum(f, self.name(), self.value())
2465 }
2466 }
2467
2468 impl std::convert::From<i32> for ProbingResult {
2469 fn from(value: i32) -> Self {
2470 match value {
2471 0 => Self::Unspecified,
2472 1 => Self::Reachable,
2473 2 => Self::Unreachable,
2474 3 => Self::ReachabilityInconsistent,
2475 4 => Self::Undetermined,
2476 _ => Self::UnknownValue(probing_result::UnknownValue(
2477 wkt::internal::UnknownEnumValue::Integer(value),
2478 )),
2479 }
2480 }
2481 }
2482
2483 impl std::convert::From<&str> for ProbingResult {
2484 fn from(value: &str) -> Self {
2485 use std::string::ToString;
2486 match value {
2487 "PROBING_RESULT_UNSPECIFIED" => Self::Unspecified,
2488 "REACHABLE" => Self::Reachable,
2489 "UNREACHABLE" => Self::Unreachable,
2490 "REACHABILITY_INCONSISTENT" => Self::ReachabilityInconsistent,
2491 "UNDETERMINED" => Self::Undetermined,
2492 _ => Self::UnknownValue(probing_result::UnknownValue(
2493 wkt::internal::UnknownEnumValue::String(value.to_string()),
2494 )),
2495 }
2496 }
2497 }
2498
2499 impl serde::ser::Serialize for ProbingResult {
2500 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2501 where
2502 S: serde::Serializer,
2503 {
2504 match self {
2505 Self::Unspecified => serializer.serialize_i32(0),
2506 Self::Reachable => serializer.serialize_i32(1),
2507 Self::Unreachable => serializer.serialize_i32(2),
2508 Self::ReachabilityInconsistent => serializer.serialize_i32(3),
2509 Self::Undetermined => serializer.serialize_i32(4),
2510 Self::UnknownValue(u) => u.0.serialize(serializer),
2511 }
2512 }
2513 }
2514
2515 impl<'de> serde::de::Deserialize<'de> for ProbingResult {
2516 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2517 where
2518 D: serde::Deserializer<'de>,
2519 {
2520 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProbingResult>::new(
2521 ".google.cloud.networkmanagement.v1.ProbingDetails.ProbingResult",
2522 ))
2523 }
2524 }
2525
2526 /// Abort cause types.
2527 ///
2528 /// # Working with unknown values
2529 ///
2530 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2531 /// additional enum variants at any time. Adding new variants is not considered
2532 /// a breaking change. Applications should write their code in anticipation of:
2533 ///
2534 /// - New values appearing in future releases of the client library, **and**
2535 /// - New values received dynamically, without application changes.
2536 ///
2537 /// Please consult the [Working with enums] section in the user guide for some
2538 /// guidelines.
2539 ///
2540 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2541 #[derive(Clone, Debug, PartialEq)]
2542 #[non_exhaustive]
2543 pub enum ProbingAbortCause {
2544 /// No reason was specified.
2545 Unspecified,
2546 /// The user lacks permission to access some of the
2547 /// network resources required to run the test.
2548 PermissionDenied,
2549 /// No valid source endpoint could be derived from the request.
2550 NoSourceLocation,
2551 /// If set, the enum was initialized with an unknown value.
2552 ///
2553 /// Applications can examine the value using [ProbingAbortCause::value] or
2554 /// [ProbingAbortCause::name].
2555 UnknownValue(probing_abort_cause::UnknownValue),
2556 }
2557
2558 #[doc(hidden)]
2559 pub mod probing_abort_cause {
2560 #[allow(unused_imports)]
2561 use super::*;
2562 #[derive(Clone, Debug, PartialEq)]
2563 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2564 }
2565
2566 impl ProbingAbortCause {
2567 /// Gets the enum value.
2568 ///
2569 /// Returns `None` if the enum contains an unknown value deserialized from
2570 /// the string representation of enums.
2571 pub fn value(&self) -> std::option::Option<i32> {
2572 match self {
2573 Self::Unspecified => std::option::Option::Some(0),
2574 Self::PermissionDenied => std::option::Option::Some(1),
2575 Self::NoSourceLocation => std::option::Option::Some(2),
2576 Self::UnknownValue(u) => u.0.value(),
2577 }
2578 }
2579
2580 /// Gets the enum value as a string.
2581 ///
2582 /// Returns `None` if the enum contains an unknown value deserialized from
2583 /// the integer representation of enums.
2584 pub fn name(&self) -> std::option::Option<&str> {
2585 match self {
2586 Self::Unspecified => std::option::Option::Some("PROBING_ABORT_CAUSE_UNSPECIFIED"),
2587 Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
2588 Self::NoSourceLocation => std::option::Option::Some("NO_SOURCE_LOCATION"),
2589 Self::UnknownValue(u) => u.0.name(),
2590 }
2591 }
2592 }
2593
2594 impl std::default::Default for ProbingAbortCause {
2595 fn default() -> Self {
2596 use std::convert::From;
2597 Self::from(0)
2598 }
2599 }
2600
2601 impl std::fmt::Display for ProbingAbortCause {
2602 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2603 wkt::internal::display_enum(f, self.name(), self.value())
2604 }
2605 }
2606
2607 impl std::convert::From<i32> for ProbingAbortCause {
2608 fn from(value: i32) -> Self {
2609 match value {
2610 0 => Self::Unspecified,
2611 1 => Self::PermissionDenied,
2612 2 => Self::NoSourceLocation,
2613 _ => Self::UnknownValue(probing_abort_cause::UnknownValue(
2614 wkt::internal::UnknownEnumValue::Integer(value),
2615 )),
2616 }
2617 }
2618 }
2619
2620 impl std::convert::From<&str> for ProbingAbortCause {
2621 fn from(value: &str) -> Self {
2622 use std::string::ToString;
2623 match value {
2624 "PROBING_ABORT_CAUSE_UNSPECIFIED" => Self::Unspecified,
2625 "PERMISSION_DENIED" => Self::PermissionDenied,
2626 "NO_SOURCE_LOCATION" => Self::NoSourceLocation,
2627 _ => Self::UnknownValue(probing_abort_cause::UnknownValue(
2628 wkt::internal::UnknownEnumValue::String(value.to_string()),
2629 )),
2630 }
2631 }
2632 }
2633
2634 impl serde::ser::Serialize for ProbingAbortCause {
2635 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2636 where
2637 S: serde::Serializer,
2638 {
2639 match self {
2640 Self::Unspecified => serializer.serialize_i32(0),
2641 Self::PermissionDenied => serializer.serialize_i32(1),
2642 Self::NoSourceLocation => serializer.serialize_i32(2),
2643 Self::UnknownValue(u) => u.0.serialize(serializer),
2644 }
2645 }
2646 }
2647
2648 impl<'de> serde::de::Deserialize<'de> for ProbingAbortCause {
2649 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2650 where
2651 D: serde::Deserializer<'de>,
2652 {
2653 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProbingAbortCause>::new(
2654 ".google.cloud.networkmanagement.v1.ProbingDetails.ProbingAbortCause",
2655 ))
2656 }
2657 }
2658}
2659
2660/// Request for the `ListConnectivityTests` method.
2661#[derive(Clone, Default, PartialEq)]
2662#[non_exhaustive]
2663pub struct ListConnectivityTestsRequest {
2664 /// Required. The parent resource of the Connectivity Tests:
2665 /// `projects/{project_id}/locations/global`
2666 pub parent: std::string::String,
2667
2668 /// Number of `ConnectivityTests` to return.
2669 pub page_size: i32,
2670
2671 /// Page token from an earlier query, as returned in `next_page_token`.
2672 pub page_token: std::string::String,
2673
2674 /// Lists the `ConnectivityTests` that match the filter expression. A filter
2675 /// expression filters the resources listed in the response. The expression
2676 /// must be of the form `<field> <operator> <value>` where operators: `<`, `>`,
2677 /// `<=`,
2678 /// `>=`,
2679 /// `!=`, `=`, `:` are supported (colon `:` represents a HAS operator which is
2680 /// roughly synonymous with equality). \<field\> can refer to a proto or JSON
2681 /// field, or a synthetic field. Field names can be camelCase or snake_case.
2682 ///
2683 /// Examples:
2684 ///
2685 /// - Filter by name:
2686 /// name = "projects/proj-1/locations/global/connectivityTests/test-1
2687 ///
2688 /// - Filter by labels:
2689 ///
2690 /// - Resources that have a key called `foo`
2691 /// labels.foo:*
2692 /// - Resources that have a key called `foo` whose value is `bar`
2693 /// labels.foo = bar
2694 pub filter: std::string::String,
2695
2696 /// Field to use to sort the list.
2697 pub order_by: std::string::String,
2698
2699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2700}
2701
2702impl ListConnectivityTestsRequest {
2703 /// Creates a new default instance.
2704 pub fn new() -> Self {
2705 std::default::Default::default()
2706 }
2707
2708 /// Sets the value of [parent][crate::model::ListConnectivityTestsRequest::parent].
2709 ///
2710 /// # Example
2711 /// ```ignore,no_run
2712 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2713 /// let x = ListConnectivityTestsRequest::new().set_parent("example");
2714 /// ```
2715 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2716 self.parent = v.into();
2717 self
2718 }
2719
2720 /// Sets the value of [page_size][crate::model::ListConnectivityTestsRequest::page_size].
2721 ///
2722 /// # Example
2723 /// ```ignore,no_run
2724 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2725 /// let x = ListConnectivityTestsRequest::new().set_page_size(42);
2726 /// ```
2727 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2728 self.page_size = v.into();
2729 self
2730 }
2731
2732 /// Sets the value of [page_token][crate::model::ListConnectivityTestsRequest::page_token].
2733 ///
2734 /// # Example
2735 /// ```ignore,no_run
2736 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2737 /// let x = ListConnectivityTestsRequest::new().set_page_token("example");
2738 /// ```
2739 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2740 self.page_token = v.into();
2741 self
2742 }
2743
2744 /// Sets the value of [filter][crate::model::ListConnectivityTestsRequest::filter].
2745 ///
2746 /// # Example
2747 /// ```ignore,no_run
2748 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2749 /// let x = ListConnectivityTestsRequest::new().set_filter("example");
2750 /// ```
2751 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2752 self.filter = v.into();
2753 self
2754 }
2755
2756 /// Sets the value of [order_by][crate::model::ListConnectivityTestsRequest::order_by].
2757 ///
2758 /// # Example
2759 /// ```ignore,no_run
2760 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2761 /// let x = ListConnectivityTestsRequest::new().set_order_by("example");
2762 /// ```
2763 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2764 self.order_by = v.into();
2765 self
2766 }
2767}
2768
2769impl wkt::message::Message for ListConnectivityTestsRequest {
2770 fn typename() -> &'static str {
2771 "type.googleapis.com/google.cloud.networkmanagement.v1.ListConnectivityTestsRequest"
2772 }
2773}
2774
2775/// Response for the `ListConnectivityTests` method.
2776#[derive(Clone, Default, PartialEq)]
2777#[non_exhaustive]
2778pub struct ListConnectivityTestsResponse {
2779 /// List of Connectivity Tests.
2780 pub resources: std::vec::Vec<crate::model::ConnectivityTest>,
2781
2782 /// Page token to fetch the next set of Connectivity Tests.
2783 pub next_page_token: std::string::String,
2784
2785 /// Locations that could not be reached (when querying all locations with `-`).
2786 pub unreachable: std::vec::Vec<std::string::String>,
2787
2788 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2789}
2790
2791impl ListConnectivityTestsResponse {
2792 /// Creates a new default instance.
2793 pub fn new() -> Self {
2794 std::default::Default::default()
2795 }
2796
2797 /// Sets the value of [resources][crate::model::ListConnectivityTestsResponse::resources].
2798 ///
2799 /// # Example
2800 /// ```ignore,no_run
2801 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2802 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2803 /// let x = ListConnectivityTestsResponse::new()
2804 /// .set_resources([
2805 /// ConnectivityTest::default()/* use setters */,
2806 /// ConnectivityTest::default()/* use (different) setters */,
2807 /// ]);
2808 /// ```
2809 pub fn set_resources<T, V>(mut self, v: T) -> Self
2810 where
2811 T: std::iter::IntoIterator<Item = V>,
2812 V: std::convert::Into<crate::model::ConnectivityTest>,
2813 {
2814 use std::iter::Iterator;
2815 self.resources = v.into_iter().map(|i| i.into()).collect();
2816 self
2817 }
2818
2819 /// Sets the value of [next_page_token][crate::model::ListConnectivityTestsResponse::next_page_token].
2820 ///
2821 /// # Example
2822 /// ```ignore,no_run
2823 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2824 /// let x = ListConnectivityTestsResponse::new().set_next_page_token("example");
2825 /// ```
2826 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2827 self.next_page_token = v.into();
2828 self
2829 }
2830
2831 /// Sets the value of [unreachable][crate::model::ListConnectivityTestsResponse::unreachable].
2832 ///
2833 /// # Example
2834 /// ```ignore,no_run
2835 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2836 /// let x = ListConnectivityTestsResponse::new().set_unreachable(["a", "b", "c"]);
2837 /// ```
2838 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2839 where
2840 T: std::iter::IntoIterator<Item = V>,
2841 V: std::convert::Into<std::string::String>,
2842 {
2843 use std::iter::Iterator;
2844 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2845 self
2846 }
2847}
2848
2849impl wkt::message::Message for ListConnectivityTestsResponse {
2850 fn typename() -> &'static str {
2851 "type.googleapis.com/google.cloud.networkmanagement.v1.ListConnectivityTestsResponse"
2852 }
2853}
2854
2855#[doc(hidden)]
2856impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectivityTestsResponse {
2857 type PageItem = crate::model::ConnectivityTest;
2858
2859 fn items(self) -> std::vec::Vec<Self::PageItem> {
2860 self.resources
2861 }
2862
2863 fn next_page_token(&self) -> std::string::String {
2864 use std::clone::Clone;
2865 self.next_page_token.clone()
2866 }
2867}
2868
2869/// Request for the `GetConnectivityTest` method.
2870#[derive(Clone, Default, PartialEq)]
2871#[non_exhaustive]
2872pub struct GetConnectivityTestRequest {
2873 /// Required. `ConnectivityTest` resource name using the form:
2874 /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
2875 pub name: std::string::String,
2876
2877 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2878}
2879
2880impl GetConnectivityTestRequest {
2881 /// Creates a new default instance.
2882 pub fn new() -> Self {
2883 std::default::Default::default()
2884 }
2885
2886 /// Sets the value of [name][crate::model::GetConnectivityTestRequest::name].
2887 ///
2888 /// # Example
2889 /// ```ignore,no_run
2890 /// # use google_cloud_networkmanagement_v1::model::GetConnectivityTestRequest;
2891 /// # let project_id = "project_id";
2892 /// # let test_id = "test_id";
2893 /// let x = GetConnectivityTestRequest::new().set_name(format!("projects/{project_id}/locations/global/connectivityTests/{test_id}"));
2894 /// ```
2895 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2896 self.name = v.into();
2897 self
2898 }
2899}
2900
2901impl wkt::message::Message for GetConnectivityTestRequest {
2902 fn typename() -> &'static str {
2903 "type.googleapis.com/google.cloud.networkmanagement.v1.GetConnectivityTestRequest"
2904 }
2905}
2906
2907/// Request for the `CreateConnectivityTest` method.
2908#[derive(Clone, Default, PartialEq)]
2909#[non_exhaustive]
2910pub struct CreateConnectivityTestRequest {
2911 /// Required. The parent resource of the Connectivity Test to create:
2912 /// `projects/{project_id}/locations/global`
2913 pub parent: std::string::String,
2914
2915 /// Required. The logical name of the Connectivity Test in your project
2916 /// with the following restrictions:
2917 ///
2918 /// * Must contain only lowercase letters, numbers, and hyphens.
2919 /// * Must start with a letter.
2920 /// * Must be between 1-40 characters.
2921 /// * Must end with a number or a letter.
2922 /// * Must be unique within the customer project
2923 pub test_id: std::string::String,
2924
2925 /// Required. A `ConnectivityTest` resource
2926 pub resource: std::option::Option<crate::model::ConnectivityTest>,
2927
2928 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2929}
2930
2931impl CreateConnectivityTestRequest {
2932 /// Creates a new default instance.
2933 pub fn new() -> Self {
2934 std::default::Default::default()
2935 }
2936
2937 /// Sets the value of [parent][crate::model::CreateConnectivityTestRequest::parent].
2938 ///
2939 /// # Example
2940 /// ```ignore,no_run
2941 /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2942 /// let x = CreateConnectivityTestRequest::new().set_parent("example");
2943 /// ```
2944 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2945 self.parent = v.into();
2946 self
2947 }
2948
2949 /// Sets the value of [test_id][crate::model::CreateConnectivityTestRequest::test_id].
2950 ///
2951 /// # Example
2952 /// ```ignore,no_run
2953 /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2954 /// let x = CreateConnectivityTestRequest::new().set_test_id("example");
2955 /// ```
2956 pub fn set_test_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2957 self.test_id = v.into();
2958 self
2959 }
2960
2961 /// Sets the value of [resource][crate::model::CreateConnectivityTestRequest::resource].
2962 ///
2963 /// # Example
2964 /// ```ignore,no_run
2965 /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2966 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2967 /// let x = CreateConnectivityTestRequest::new().set_resource(ConnectivityTest::default()/* use setters */);
2968 /// ```
2969 pub fn set_resource<T>(mut self, v: T) -> Self
2970 where
2971 T: std::convert::Into<crate::model::ConnectivityTest>,
2972 {
2973 self.resource = std::option::Option::Some(v.into());
2974 self
2975 }
2976
2977 /// Sets or clears the value of [resource][crate::model::CreateConnectivityTestRequest::resource].
2978 ///
2979 /// # Example
2980 /// ```ignore,no_run
2981 /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2982 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2983 /// let x = CreateConnectivityTestRequest::new().set_or_clear_resource(Some(ConnectivityTest::default()/* use setters */));
2984 /// let x = CreateConnectivityTestRequest::new().set_or_clear_resource(None::<ConnectivityTest>);
2985 /// ```
2986 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
2987 where
2988 T: std::convert::Into<crate::model::ConnectivityTest>,
2989 {
2990 self.resource = v.map(|x| x.into());
2991 self
2992 }
2993}
2994
2995impl wkt::message::Message for CreateConnectivityTestRequest {
2996 fn typename() -> &'static str {
2997 "type.googleapis.com/google.cloud.networkmanagement.v1.CreateConnectivityTestRequest"
2998 }
2999}
3000
3001/// Request for the `UpdateConnectivityTest` method.
3002#[derive(Clone, Default, PartialEq)]
3003#[non_exhaustive]
3004pub struct UpdateConnectivityTestRequest {
3005 /// Required. Mask of fields to update. At least one path must be supplied in
3006 /// this field.
3007 pub update_mask: std::option::Option<wkt::FieldMask>,
3008
3009 /// Required. Only fields specified in update_mask are updated.
3010 pub resource: std::option::Option<crate::model::ConnectivityTest>,
3011
3012 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3013}
3014
3015impl UpdateConnectivityTestRequest {
3016 /// Creates a new default instance.
3017 pub fn new() -> Self {
3018 std::default::Default::default()
3019 }
3020
3021 /// Sets the value of [update_mask][crate::model::UpdateConnectivityTestRequest::update_mask].
3022 ///
3023 /// # Example
3024 /// ```ignore,no_run
3025 /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
3026 /// use wkt::FieldMask;
3027 /// let x = UpdateConnectivityTestRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3028 /// ```
3029 pub fn set_update_mask<T>(mut self, v: T) -> Self
3030 where
3031 T: std::convert::Into<wkt::FieldMask>,
3032 {
3033 self.update_mask = std::option::Option::Some(v.into());
3034 self
3035 }
3036
3037 /// Sets or clears the value of [update_mask][crate::model::UpdateConnectivityTestRequest::update_mask].
3038 ///
3039 /// # Example
3040 /// ```ignore,no_run
3041 /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
3042 /// use wkt::FieldMask;
3043 /// let x = UpdateConnectivityTestRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3044 /// let x = UpdateConnectivityTestRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3045 /// ```
3046 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3047 where
3048 T: std::convert::Into<wkt::FieldMask>,
3049 {
3050 self.update_mask = v.map(|x| x.into());
3051 self
3052 }
3053
3054 /// Sets the value of [resource][crate::model::UpdateConnectivityTestRequest::resource].
3055 ///
3056 /// # Example
3057 /// ```ignore,no_run
3058 /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
3059 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
3060 /// let x = UpdateConnectivityTestRequest::new().set_resource(ConnectivityTest::default()/* use setters */);
3061 /// ```
3062 pub fn set_resource<T>(mut self, v: T) -> Self
3063 where
3064 T: std::convert::Into<crate::model::ConnectivityTest>,
3065 {
3066 self.resource = std::option::Option::Some(v.into());
3067 self
3068 }
3069
3070 /// Sets or clears the value of [resource][crate::model::UpdateConnectivityTestRequest::resource].
3071 ///
3072 /// # Example
3073 /// ```ignore,no_run
3074 /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
3075 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
3076 /// let x = UpdateConnectivityTestRequest::new().set_or_clear_resource(Some(ConnectivityTest::default()/* use setters */));
3077 /// let x = UpdateConnectivityTestRequest::new().set_or_clear_resource(None::<ConnectivityTest>);
3078 /// ```
3079 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
3080 where
3081 T: std::convert::Into<crate::model::ConnectivityTest>,
3082 {
3083 self.resource = v.map(|x| x.into());
3084 self
3085 }
3086}
3087
3088impl wkt::message::Message for UpdateConnectivityTestRequest {
3089 fn typename() -> &'static str {
3090 "type.googleapis.com/google.cloud.networkmanagement.v1.UpdateConnectivityTestRequest"
3091 }
3092}
3093
3094/// Request for the `DeleteConnectivityTest` method.
3095#[derive(Clone, Default, PartialEq)]
3096#[non_exhaustive]
3097pub struct DeleteConnectivityTestRequest {
3098 /// Required. Connectivity Test resource name using the form:
3099 /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
3100 pub name: std::string::String,
3101
3102 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3103}
3104
3105impl DeleteConnectivityTestRequest {
3106 /// Creates a new default instance.
3107 pub fn new() -> Self {
3108 std::default::Default::default()
3109 }
3110
3111 /// Sets the value of [name][crate::model::DeleteConnectivityTestRequest::name].
3112 ///
3113 /// # Example
3114 /// ```ignore,no_run
3115 /// # use google_cloud_networkmanagement_v1::model::DeleteConnectivityTestRequest;
3116 /// # let project_id = "project_id";
3117 /// # let test_id = "test_id";
3118 /// let x = DeleteConnectivityTestRequest::new().set_name(format!("projects/{project_id}/locations/global/connectivityTests/{test_id}"));
3119 /// ```
3120 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3121 self.name = v.into();
3122 self
3123 }
3124}
3125
3126impl wkt::message::Message for DeleteConnectivityTestRequest {
3127 fn typename() -> &'static str {
3128 "type.googleapis.com/google.cloud.networkmanagement.v1.DeleteConnectivityTestRequest"
3129 }
3130}
3131
3132/// Request for the `RerunConnectivityTest` method.
3133#[derive(Clone, Default, PartialEq)]
3134#[non_exhaustive]
3135pub struct RerunConnectivityTestRequest {
3136 /// Required. Connectivity Test resource name using the form:
3137 /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
3138 pub name: std::string::String,
3139
3140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3141}
3142
3143impl RerunConnectivityTestRequest {
3144 /// Creates a new default instance.
3145 pub fn new() -> Self {
3146 std::default::Default::default()
3147 }
3148
3149 /// Sets the value of [name][crate::model::RerunConnectivityTestRequest::name].
3150 ///
3151 /// # Example
3152 /// ```ignore,no_run
3153 /// # use google_cloud_networkmanagement_v1::model::RerunConnectivityTestRequest;
3154 /// # let project_id = "project_id";
3155 /// # let test_id = "test_id";
3156 /// let x = RerunConnectivityTestRequest::new().set_name(format!("projects/{project_id}/locations/global/connectivityTests/{test_id}"));
3157 /// ```
3158 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3159 self.name = v.into();
3160 self
3161 }
3162}
3163
3164impl wkt::message::Message for RerunConnectivityTestRequest {
3165 fn typename() -> &'static str {
3166 "type.googleapis.com/google.cloud.networkmanagement.v1.RerunConnectivityTestRequest"
3167 }
3168}
3169
3170/// Metadata describing an [Operation][google.longrunning.Operation]
3171///
3172/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
3173#[derive(Clone, Default, PartialEq)]
3174#[non_exhaustive]
3175pub struct OperationMetadata {
3176 /// The time the operation was created.
3177 pub create_time: std::option::Option<wkt::Timestamp>,
3178
3179 /// The time the operation finished running.
3180 pub end_time: std::option::Option<wkt::Timestamp>,
3181
3182 /// Target of the operation - for example
3183 /// projects/project-1/locations/global/connectivityTests/test-1
3184 pub target: std::string::String,
3185
3186 /// Name of the verb executed by the operation.
3187 pub verb: std::string::String,
3188
3189 /// Human-readable status of the operation, if any.
3190 pub status_detail: std::string::String,
3191
3192 /// Specifies if cancellation was requested for the operation.
3193 pub cancel_requested: bool,
3194
3195 /// API version.
3196 pub api_version: std::string::String,
3197
3198 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3199}
3200
3201impl OperationMetadata {
3202 /// Creates a new default instance.
3203 pub fn new() -> Self {
3204 std::default::Default::default()
3205 }
3206
3207 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3208 ///
3209 /// # Example
3210 /// ```ignore,no_run
3211 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3212 /// use wkt::Timestamp;
3213 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
3214 /// ```
3215 pub fn set_create_time<T>(mut self, v: T) -> Self
3216 where
3217 T: std::convert::Into<wkt::Timestamp>,
3218 {
3219 self.create_time = std::option::Option::Some(v.into());
3220 self
3221 }
3222
3223 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3224 ///
3225 /// # Example
3226 /// ```ignore,no_run
3227 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3228 /// use wkt::Timestamp;
3229 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3230 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
3231 /// ```
3232 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3233 where
3234 T: std::convert::Into<wkt::Timestamp>,
3235 {
3236 self.create_time = v.map(|x| x.into());
3237 self
3238 }
3239
3240 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3241 ///
3242 /// # Example
3243 /// ```ignore,no_run
3244 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3245 /// use wkt::Timestamp;
3246 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3247 /// ```
3248 pub fn set_end_time<T>(mut self, v: T) -> Self
3249 where
3250 T: std::convert::Into<wkt::Timestamp>,
3251 {
3252 self.end_time = std::option::Option::Some(v.into());
3253 self
3254 }
3255
3256 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3257 ///
3258 /// # Example
3259 /// ```ignore,no_run
3260 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3261 /// use wkt::Timestamp;
3262 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3263 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3264 /// ```
3265 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3266 where
3267 T: std::convert::Into<wkt::Timestamp>,
3268 {
3269 self.end_time = v.map(|x| x.into());
3270 self
3271 }
3272
3273 /// Sets the value of [target][crate::model::OperationMetadata::target].
3274 ///
3275 /// # Example
3276 /// ```ignore,no_run
3277 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3278 /// let x = OperationMetadata::new().set_target("example");
3279 /// ```
3280 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3281 self.target = v.into();
3282 self
3283 }
3284
3285 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3286 ///
3287 /// # Example
3288 /// ```ignore,no_run
3289 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3290 /// let x = OperationMetadata::new().set_verb("example");
3291 /// ```
3292 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3293 self.verb = v.into();
3294 self
3295 }
3296
3297 /// Sets the value of [status_detail][crate::model::OperationMetadata::status_detail].
3298 ///
3299 /// # Example
3300 /// ```ignore,no_run
3301 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3302 /// let x = OperationMetadata::new().set_status_detail("example");
3303 /// ```
3304 pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3305 self.status_detail = v.into();
3306 self
3307 }
3308
3309 /// Sets the value of [cancel_requested][crate::model::OperationMetadata::cancel_requested].
3310 ///
3311 /// # Example
3312 /// ```ignore,no_run
3313 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3314 /// let x = OperationMetadata::new().set_cancel_requested(true);
3315 /// ```
3316 pub fn set_cancel_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3317 self.cancel_requested = v.into();
3318 self
3319 }
3320
3321 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3322 ///
3323 /// # Example
3324 /// ```ignore,no_run
3325 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3326 /// let x = OperationMetadata::new().set_api_version("example");
3327 /// ```
3328 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3329 self.api_version = v.into();
3330 self
3331 }
3332}
3333
3334impl wkt::message::Message for OperationMetadata {
3335 fn typename() -> &'static str {
3336 "type.googleapis.com/google.cloud.networkmanagement.v1.OperationMetadata"
3337 }
3338}
3339
3340/// Trace represents one simulated packet forwarding path.
3341///
3342/// * Each trace contains multiple ordered steps.
3343/// * Each step is in a particular state with associated configuration.
3344/// * State is categorized as final or non-final states.
3345/// * Each final state has a reason associated.
3346/// * Each trace must end with a final state (the last step).
3347///
3348/// ```norust
3349/// |---------------------Trace----------------------|
3350/// Step1(State) Step2(State) --- StepN(State(final))
3351/// ```
3352#[derive(Clone, Default, PartialEq)]
3353#[non_exhaustive]
3354pub struct Trace {
3355 /// Derived from the source and destination endpoints definition specified by
3356 /// user request, and validated by the data plane model.
3357 /// If there are multiple traces starting from different source locations, then
3358 /// the endpoint_info may be different between traces.
3359 pub endpoint_info: std::option::Option<crate::model::EndpointInfo>,
3360
3361 /// A trace of a test contains multiple steps from the initial state to the
3362 /// final state (delivered, dropped, forwarded, or aborted).
3363 ///
3364 /// The steps are ordered by the processing sequence within the simulated
3365 /// network state machine. It is critical to preserve the order of the steps
3366 /// and avoid reordering or sorting them.
3367 pub steps: std::vec::Vec<crate::model::Step>,
3368
3369 /// ID of trace. For forward traces, this ID is unique for each trace. For
3370 /// return traces, it matches ID of associated forward trace. A single forward
3371 /// trace can be associated with none, one or more than one return trace.
3372 pub forward_trace_id: i32,
3373
3374 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3375}
3376
3377impl Trace {
3378 /// Creates a new default instance.
3379 pub fn new() -> Self {
3380 std::default::Default::default()
3381 }
3382
3383 /// Sets the value of [endpoint_info][crate::model::Trace::endpoint_info].
3384 ///
3385 /// # Example
3386 /// ```ignore,no_run
3387 /// # use google_cloud_networkmanagement_v1::model::Trace;
3388 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3389 /// let x = Trace::new().set_endpoint_info(EndpointInfo::default()/* use setters */);
3390 /// ```
3391 pub fn set_endpoint_info<T>(mut self, v: T) -> Self
3392 where
3393 T: std::convert::Into<crate::model::EndpointInfo>,
3394 {
3395 self.endpoint_info = std::option::Option::Some(v.into());
3396 self
3397 }
3398
3399 /// Sets or clears the value of [endpoint_info][crate::model::Trace::endpoint_info].
3400 ///
3401 /// # Example
3402 /// ```ignore,no_run
3403 /// # use google_cloud_networkmanagement_v1::model::Trace;
3404 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3405 /// let x = Trace::new().set_or_clear_endpoint_info(Some(EndpointInfo::default()/* use setters */));
3406 /// let x = Trace::new().set_or_clear_endpoint_info(None::<EndpointInfo>);
3407 /// ```
3408 pub fn set_or_clear_endpoint_info<T>(mut self, v: std::option::Option<T>) -> Self
3409 where
3410 T: std::convert::Into<crate::model::EndpointInfo>,
3411 {
3412 self.endpoint_info = v.map(|x| x.into());
3413 self
3414 }
3415
3416 /// Sets the value of [steps][crate::model::Trace::steps].
3417 ///
3418 /// # Example
3419 /// ```ignore,no_run
3420 /// # use google_cloud_networkmanagement_v1::model::Trace;
3421 /// use google_cloud_networkmanagement_v1::model::Step;
3422 /// let x = Trace::new()
3423 /// .set_steps([
3424 /// Step::default()/* use setters */,
3425 /// Step::default()/* use (different) setters */,
3426 /// ]);
3427 /// ```
3428 pub fn set_steps<T, V>(mut self, v: T) -> Self
3429 where
3430 T: std::iter::IntoIterator<Item = V>,
3431 V: std::convert::Into<crate::model::Step>,
3432 {
3433 use std::iter::Iterator;
3434 self.steps = v.into_iter().map(|i| i.into()).collect();
3435 self
3436 }
3437
3438 /// Sets the value of [forward_trace_id][crate::model::Trace::forward_trace_id].
3439 ///
3440 /// # Example
3441 /// ```ignore,no_run
3442 /// # use google_cloud_networkmanagement_v1::model::Trace;
3443 /// let x = Trace::new().set_forward_trace_id(42);
3444 /// ```
3445 pub fn set_forward_trace_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3446 self.forward_trace_id = v.into();
3447 self
3448 }
3449}
3450
3451impl wkt::message::Message for Trace {
3452 fn typename() -> &'static str {
3453 "type.googleapis.com/google.cloud.networkmanagement.v1.Trace"
3454 }
3455}
3456
3457/// A simulated forwarding path is composed of multiple steps.
3458/// Each step has a well-defined state and an associated configuration.
3459#[derive(Clone, Default, PartialEq)]
3460#[non_exhaustive]
3461pub struct Step {
3462 /// A description of the step. Usually this is a summary of the state.
3463 pub description: std::string::String,
3464
3465 /// Each step is in one of the pre-defined states.
3466 pub state: crate::model::step::State,
3467
3468 /// This is a step that leads to the final state Drop.
3469 pub causes_drop: bool,
3470
3471 /// Project ID that contains the configuration this step is validating.
3472 pub project_id: std::string::String,
3473
3474 /// Configuration or metadata associated with each step.
3475 /// The configuration is filtered based on viewer's permission. If a viewer
3476 /// has no permission to view the configuration in this step, for non-final
3477 /// states a special state is populated (VIEWER_PERMISSION_MISSING), and for
3478 /// final state the configuration is cleared.
3479 pub step_info: std::option::Option<crate::model::step::StepInfo>,
3480
3481 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3482}
3483
3484impl Step {
3485 /// Creates a new default instance.
3486 pub fn new() -> Self {
3487 std::default::Default::default()
3488 }
3489
3490 /// Sets the value of [description][crate::model::Step::description].
3491 ///
3492 /// # Example
3493 /// ```ignore,no_run
3494 /// # use google_cloud_networkmanagement_v1::model::Step;
3495 /// let x = Step::new().set_description("example");
3496 /// ```
3497 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3498 self.description = v.into();
3499 self
3500 }
3501
3502 /// Sets the value of [state][crate::model::Step::state].
3503 ///
3504 /// # Example
3505 /// ```ignore,no_run
3506 /// # use google_cloud_networkmanagement_v1::model::Step;
3507 /// use google_cloud_networkmanagement_v1::model::step::State;
3508 /// let x0 = Step::new().set_state(State::StartFromInstance);
3509 /// let x1 = Step::new().set_state(State::StartFromInternet);
3510 /// let x2 = Step::new().set_state(State::StartFromGoogleService);
3511 /// ```
3512 pub fn set_state<T: std::convert::Into<crate::model::step::State>>(mut self, v: T) -> Self {
3513 self.state = v.into();
3514 self
3515 }
3516
3517 /// Sets the value of [causes_drop][crate::model::Step::causes_drop].
3518 ///
3519 /// # Example
3520 /// ```ignore,no_run
3521 /// # use google_cloud_networkmanagement_v1::model::Step;
3522 /// let x = Step::new().set_causes_drop(true);
3523 /// ```
3524 pub fn set_causes_drop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3525 self.causes_drop = v.into();
3526 self
3527 }
3528
3529 /// Sets the value of [project_id][crate::model::Step::project_id].
3530 ///
3531 /// # Example
3532 /// ```ignore,no_run
3533 /// # use google_cloud_networkmanagement_v1::model::Step;
3534 /// let x = Step::new().set_project_id("example");
3535 /// ```
3536 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3537 self.project_id = v.into();
3538 self
3539 }
3540
3541 /// Sets the value of [step_info][crate::model::Step::step_info].
3542 ///
3543 /// Note that all the setters affecting `step_info` are mutually
3544 /// exclusive.
3545 ///
3546 /// # Example
3547 /// ```ignore,no_run
3548 /// # use google_cloud_networkmanagement_v1::model::Step;
3549 /// use google_cloud_networkmanagement_v1::model::InstanceInfo;
3550 /// let x = Step::new().set_step_info(Some(
3551 /// google_cloud_networkmanagement_v1::model::step::StepInfo::Instance(InstanceInfo::default().into())));
3552 /// ```
3553 pub fn set_step_info<
3554 T: std::convert::Into<std::option::Option<crate::model::step::StepInfo>>,
3555 >(
3556 mut self,
3557 v: T,
3558 ) -> Self {
3559 self.step_info = v.into();
3560 self
3561 }
3562
3563 /// The value of [step_info][crate::model::Step::step_info]
3564 /// if it holds a `Instance`, `None` if the field is not set or
3565 /// holds a different branch.
3566 pub fn instance(&self) -> std::option::Option<&std::boxed::Box<crate::model::InstanceInfo>> {
3567 #[allow(unreachable_patterns)]
3568 self.step_info.as_ref().and_then(|v| match v {
3569 crate::model::step::StepInfo::Instance(v) => std::option::Option::Some(v),
3570 _ => std::option::Option::None,
3571 })
3572 }
3573
3574 /// Sets the value of [step_info][crate::model::Step::step_info]
3575 /// to hold a `Instance`.
3576 ///
3577 /// Note that all the setters affecting `step_info` are
3578 /// mutually exclusive.
3579 ///
3580 /// # Example
3581 /// ```ignore,no_run
3582 /// # use google_cloud_networkmanagement_v1::model::Step;
3583 /// use google_cloud_networkmanagement_v1::model::InstanceInfo;
3584 /// let x = Step::new().set_instance(InstanceInfo::default()/* use setters */);
3585 /// assert!(x.instance().is_some());
3586 /// assert!(x.firewall().is_none());
3587 /// assert!(x.route().is_none());
3588 /// assert!(x.endpoint().is_none());
3589 /// assert!(x.google_service().is_none());
3590 /// assert!(x.forwarding_rule().is_none());
3591 /// assert!(x.hybrid_subnet().is_none());
3592 /// assert!(x.vpn_gateway().is_none());
3593 /// assert!(x.vpn_tunnel().is_none());
3594 /// assert!(x.interconnect_attachment().is_none());
3595 /// assert!(x.vpc_connector().is_none());
3596 /// assert!(x.direct_vpc_egress_connection().is_none());
3597 /// assert!(x.serverless_external_connection().is_none());
3598 /// assert!(x.deliver().is_none());
3599 /// assert!(x.forward().is_none());
3600 /// assert!(x.abort().is_none());
3601 /// assert!(x.drop().is_none());
3602 /// assert!(x.load_balancer().is_none());
3603 /// assert!(x.network().is_none());
3604 /// assert!(x.gke_master().is_none());
3605 /// assert!(x.gke_pod().is_none());
3606 /// assert!(x.ip_masquerading_skipped().is_none());
3607 /// assert!(x.gke_network_policy().is_none());
3608 /// assert!(x.gke_network_policy_skipped().is_none());
3609 /// assert!(x.cloud_sql_instance().is_none());
3610 /// assert!(x.redis_instance().is_none());
3611 /// assert!(x.redis_cluster().is_none());
3612 /// assert!(x.cloud_function().is_none());
3613 /// assert!(x.app_engine_version().is_none());
3614 /// assert!(x.cloud_run_revision().is_none());
3615 /// assert!(x.cloud_run_job().is_none());
3616 /// assert!(x.nat().is_none());
3617 /// assert!(x.proxy_connection().is_none());
3618 /// assert!(x.load_balancer_backend_info().is_none());
3619 /// assert!(x.storage_bucket().is_none());
3620 /// assert!(x.serverless_neg().is_none());
3621 /// assert!(x.ngfw_packet_inspection().is_none());
3622 /// assert!(x.dms_private_connection().is_none());
3623 /// ```
3624 pub fn set_instance<T: std::convert::Into<std::boxed::Box<crate::model::InstanceInfo>>>(
3625 mut self,
3626 v: T,
3627 ) -> Self {
3628 self.step_info =
3629 std::option::Option::Some(crate::model::step::StepInfo::Instance(v.into()));
3630 self
3631 }
3632
3633 /// The value of [step_info][crate::model::Step::step_info]
3634 /// if it holds a `Firewall`, `None` if the field is not set or
3635 /// holds a different branch.
3636 pub fn firewall(&self) -> std::option::Option<&std::boxed::Box<crate::model::FirewallInfo>> {
3637 #[allow(unreachable_patterns)]
3638 self.step_info.as_ref().and_then(|v| match v {
3639 crate::model::step::StepInfo::Firewall(v) => std::option::Option::Some(v),
3640 _ => std::option::Option::None,
3641 })
3642 }
3643
3644 /// Sets the value of [step_info][crate::model::Step::step_info]
3645 /// to hold a `Firewall`.
3646 ///
3647 /// Note that all the setters affecting `step_info` are
3648 /// mutually exclusive.
3649 ///
3650 /// # Example
3651 /// ```ignore,no_run
3652 /// # use google_cloud_networkmanagement_v1::model::Step;
3653 /// use google_cloud_networkmanagement_v1::model::FirewallInfo;
3654 /// let x = Step::new().set_firewall(FirewallInfo::default()/* use setters */);
3655 /// assert!(x.firewall().is_some());
3656 /// assert!(x.instance().is_none());
3657 /// assert!(x.route().is_none());
3658 /// assert!(x.endpoint().is_none());
3659 /// assert!(x.google_service().is_none());
3660 /// assert!(x.forwarding_rule().is_none());
3661 /// assert!(x.hybrid_subnet().is_none());
3662 /// assert!(x.vpn_gateway().is_none());
3663 /// assert!(x.vpn_tunnel().is_none());
3664 /// assert!(x.interconnect_attachment().is_none());
3665 /// assert!(x.vpc_connector().is_none());
3666 /// assert!(x.direct_vpc_egress_connection().is_none());
3667 /// assert!(x.serverless_external_connection().is_none());
3668 /// assert!(x.deliver().is_none());
3669 /// assert!(x.forward().is_none());
3670 /// assert!(x.abort().is_none());
3671 /// assert!(x.drop().is_none());
3672 /// assert!(x.load_balancer().is_none());
3673 /// assert!(x.network().is_none());
3674 /// assert!(x.gke_master().is_none());
3675 /// assert!(x.gke_pod().is_none());
3676 /// assert!(x.ip_masquerading_skipped().is_none());
3677 /// assert!(x.gke_network_policy().is_none());
3678 /// assert!(x.gke_network_policy_skipped().is_none());
3679 /// assert!(x.cloud_sql_instance().is_none());
3680 /// assert!(x.redis_instance().is_none());
3681 /// assert!(x.redis_cluster().is_none());
3682 /// assert!(x.cloud_function().is_none());
3683 /// assert!(x.app_engine_version().is_none());
3684 /// assert!(x.cloud_run_revision().is_none());
3685 /// assert!(x.cloud_run_job().is_none());
3686 /// assert!(x.nat().is_none());
3687 /// assert!(x.proxy_connection().is_none());
3688 /// assert!(x.load_balancer_backend_info().is_none());
3689 /// assert!(x.storage_bucket().is_none());
3690 /// assert!(x.serverless_neg().is_none());
3691 /// assert!(x.ngfw_packet_inspection().is_none());
3692 /// assert!(x.dms_private_connection().is_none());
3693 /// ```
3694 pub fn set_firewall<T: std::convert::Into<std::boxed::Box<crate::model::FirewallInfo>>>(
3695 mut self,
3696 v: T,
3697 ) -> Self {
3698 self.step_info =
3699 std::option::Option::Some(crate::model::step::StepInfo::Firewall(v.into()));
3700 self
3701 }
3702
3703 /// The value of [step_info][crate::model::Step::step_info]
3704 /// if it holds a `Route`, `None` if the field is not set or
3705 /// holds a different branch.
3706 pub fn route(&self) -> std::option::Option<&std::boxed::Box<crate::model::RouteInfo>> {
3707 #[allow(unreachable_patterns)]
3708 self.step_info.as_ref().and_then(|v| match v {
3709 crate::model::step::StepInfo::Route(v) => std::option::Option::Some(v),
3710 _ => std::option::Option::None,
3711 })
3712 }
3713
3714 /// Sets the value of [step_info][crate::model::Step::step_info]
3715 /// to hold a `Route`.
3716 ///
3717 /// Note that all the setters affecting `step_info` are
3718 /// mutually exclusive.
3719 ///
3720 /// # Example
3721 /// ```ignore,no_run
3722 /// # use google_cloud_networkmanagement_v1::model::Step;
3723 /// use google_cloud_networkmanagement_v1::model::RouteInfo;
3724 /// let x = Step::new().set_route(RouteInfo::default()/* use setters */);
3725 /// assert!(x.route().is_some());
3726 /// assert!(x.instance().is_none());
3727 /// assert!(x.firewall().is_none());
3728 /// assert!(x.endpoint().is_none());
3729 /// assert!(x.google_service().is_none());
3730 /// assert!(x.forwarding_rule().is_none());
3731 /// assert!(x.hybrid_subnet().is_none());
3732 /// assert!(x.vpn_gateway().is_none());
3733 /// assert!(x.vpn_tunnel().is_none());
3734 /// assert!(x.interconnect_attachment().is_none());
3735 /// assert!(x.vpc_connector().is_none());
3736 /// assert!(x.direct_vpc_egress_connection().is_none());
3737 /// assert!(x.serverless_external_connection().is_none());
3738 /// assert!(x.deliver().is_none());
3739 /// assert!(x.forward().is_none());
3740 /// assert!(x.abort().is_none());
3741 /// assert!(x.drop().is_none());
3742 /// assert!(x.load_balancer().is_none());
3743 /// assert!(x.network().is_none());
3744 /// assert!(x.gke_master().is_none());
3745 /// assert!(x.gke_pod().is_none());
3746 /// assert!(x.ip_masquerading_skipped().is_none());
3747 /// assert!(x.gke_network_policy().is_none());
3748 /// assert!(x.gke_network_policy_skipped().is_none());
3749 /// assert!(x.cloud_sql_instance().is_none());
3750 /// assert!(x.redis_instance().is_none());
3751 /// assert!(x.redis_cluster().is_none());
3752 /// assert!(x.cloud_function().is_none());
3753 /// assert!(x.app_engine_version().is_none());
3754 /// assert!(x.cloud_run_revision().is_none());
3755 /// assert!(x.cloud_run_job().is_none());
3756 /// assert!(x.nat().is_none());
3757 /// assert!(x.proxy_connection().is_none());
3758 /// assert!(x.load_balancer_backend_info().is_none());
3759 /// assert!(x.storage_bucket().is_none());
3760 /// assert!(x.serverless_neg().is_none());
3761 /// assert!(x.ngfw_packet_inspection().is_none());
3762 /// assert!(x.dms_private_connection().is_none());
3763 /// ```
3764 pub fn set_route<T: std::convert::Into<std::boxed::Box<crate::model::RouteInfo>>>(
3765 mut self,
3766 v: T,
3767 ) -> Self {
3768 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Route(v.into()));
3769 self
3770 }
3771
3772 /// The value of [step_info][crate::model::Step::step_info]
3773 /// if it holds a `Endpoint`, `None` if the field is not set or
3774 /// holds a different branch.
3775 pub fn endpoint(&self) -> std::option::Option<&std::boxed::Box<crate::model::EndpointInfo>> {
3776 #[allow(unreachable_patterns)]
3777 self.step_info.as_ref().and_then(|v| match v {
3778 crate::model::step::StepInfo::Endpoint(v) => std::option::Option::Some(v),
3779 _ => std::option::Option::None,
3780 })
3781 }
3782
3783 /// Sets the value of [step_info][crate::model::Step::step_info]
3784 /// to hold a `Endpoint`.
3785 ///
3786 /// Note that all the setters affecting `step_info` are
3787 /// mutually exclusive.
3788 ///
3789 /// # Example
3790 /// ```ignore,no_run
3791 /// # use google_cloud_networkmanagement_v1::model::Step;
3792 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3793 /// let x = Step::new().set_endpoint(EndpointInfo::default()/* use setters */);
3794 /// assert!(x.endpoint().is_some());
3795 /// assert!(x.instance().is_none());
3796 /// assert!(x.firewall().is_none());
3797 /// assert!(x.route().is_none());
3798 /// assert!(x.google_service().is_none());
3799 /// assert!(x.forwarding_rule().is_none());
3800 /// assert!(x.hybrid_subnet().is_none());
3801 /// assert!(x.vpn_gateway().is_none());
3802 /// assert!(x.vpn_tunnel().is_none());
3803 /// assert!(x.interconnect_attachment().is_none());
3804 /// assert!(x.vpc_connector().is_none());
3805 /// assert!(x.direct_vpc_egress_connection().is_none());
3806 /// assert!(x.serverless_external_connection().is_none());
3807 /// assert!(x.deliver().is_none());
3808 /// assert!(x.forward().is_none());
3809 /// assert!(x.abort().is_none());
3810 /// assert!(x.drop().is_none());
3811 /// assert!(x.load_balancer().is_none());
3812 /// assert!(x.network().is_none());
3813 /// assert!(x.gke_master().is_none());
3814 /// assert!(x.gke_pod().is_none());
3815 /// assert!(x.ip_masquerading_skipped().is_none());
3816 /// assert!(x.gke_network_policy().is_none());
3817 /// assert!(x.gke_network_policy_skipped().is_none());
3818 /// assert!(x.cloud_sql_instance().is_none());
3819 /// assert!(x.redis_instance().is_none());
3820 /// assert!(x.redis_cluster().is_none());
3821 /// assert!(x.cloud_function().is_none());
3822 /// assert!(x.app_engine_version().is_none());
3823 /// assert!(x.cloud_run_revision().is_none());
3824 /// assert!(x.cloud_run_job().is_none());
3825 /// assert!(x.nat().is_none());
3826 /// assert!(x.proxy_connection().is_none());
3827 /// assert!(x.load_balancer_backend_info().is_none());
3828 /// assert!(x.storage_bucket().is_none());
3829 /// assert!(x.serverless_neg().is_none());
3830 /// assert!(x.ngfw_packet_inspection().is_none());
3831 /// assert!(x.dms_private_connection().is_none());
3832 /// ```
3833 pub fn set_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::EndpointInfo>>>(
3834 mut self,
3835 v: T,
3836 ) -> Self {
3837 self.step_info =
3838 std::option::Option::Some(crate::model::step::StepInfo::Endpoint(v.into()));
3839 self
3840 }
3841
3842 /// The value of [step_info][crate::model::Step::step_info]
3843 /// if it holds a `GoogleService`, `None` if the field is not set or
3844 /// holds a different branch.
3845 pub fn google_service(
3846 &self,
3847 ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleServiceInfo>> {
3848 #[allow(unreachable_patterns)]
3849 self.step_info.as_ref().and_then(|v| match v {
3850 crate::model::step::StepInfo::GoogleService(v) => std::option::Option::Some(v),
3851 _ => std::option::Option::None,
3852 })
3853 }
3854
3855 /// Sets the value of [step_info][crate::model::Step::step_info]
3856 /// to hold a `GoogleService`.
3857 ///
3858 /// Note that all the setters affecting `step_info` are
3859 /// mutually exclusive.
3860 ///
3861 /// # Example
3862 /// ```ignore,no_run
3863 /// # use google_cloud_networkmanagement_v1::model::Step;
3864 /// use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
3865 /// let x = Step::new().set_google_service(GoogleServiceInfo::default()/* use setters */);
3866 /// assert!(x.google_service().is_some());
3867 /// assert!(x.instance().is_none());
3868 /// assert!(x.firewall().is_none());
3869 /// assert!(x.route().is_none());
3870 /// assert!(x.endpoint().is_none());
3871 /// assert!(x.forwarding_rule().is_none());
3872 /// assert!(x.hybrid_subnet().is_none());
3873 /// assert!(x.vpn_gateway().is_none());
3874 /// assert!(x.vpn_tunnel().is_none());
3875 /// assert!(x.interconnect_attachment().is_none());
3876 /// assert!(x.vpc_connector().is_none());
3877 /// assert!(x.direct_vpc_egress_connection().is_none());
3878 /// assert!(x.serverless_external_connection().is_none());
3879 /// assert!(x.deliver().is_none());
3880 /// assert!(x.forward().is_none());
3881 /// assert!(x.abort().is_none());
3882 /// assert!(x.drop().is_none());
3883 /// assert!(x.load_balancer().is_none());
3884 /// assert!(x.network().is_none());
3885 /// assert!(x.gke_master().is_none());
3886 /// assert!(x.gke_pod().is_none());
3887 /// assert!(x.ip_masquerading_skipped().is_none());
3888 /// assert!(x.gke_network_policy().is_none());
3889 /// assert!(x.gke_network_policy_skipped().is_none());
3890 /// assert!(x.cloud_sql_instance().is_none());
3891 /// assert!(x.redis_instance().is_none());
3892 /// assert!(x.redis_cluster().is_none());
3893 /// assert!(x.cloud_function().is_none());
3894 /// assert!(x.app_engine_version().is_none());
3895 /// assert!(x.cloud_run_revision().is_none());
3896 /// assert!(x.cloud_run_job().is_none());
3897 /// assert!(x.nat().is_none());
3898 /// assert!(x.proxy_connection().is_none());
3899 /// assert!(x.load_balancer_backend_info().is_none());
3900 /// assert!(x.storage_bucket().is_none());
3901 /// assert!(x.serverless_neg().is_none());
3902 /// assert!(x.ngfw_packet_inspection().is_none());
3903 /// assert!(x.dms_private_connection().is_none());
3904 /// ```
3905 pub fn set_google_service<
3906 T: std::convert::Into<std::boxed::Box<crate::model::GoogleServiceInfo>>,
3907 >(
3908 mut self,
3909 v: T,
3910 ) -> Self {
3911 self.step_info =
3912 std::option::Option::Some(crate::model::step::StepInfo::GoogleService(v.into()));
3913 self
3914 }
3915
3916 /// The value of [step_info][crate::model::Step::step_info]
3917 /// if it holds a `ForwardingRule`, `None` if the field is not set or
3918 /// holds a different branch.
3919 pub fn forwarding_rule(
3920 &self,
3921 ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardingRuleInfo>> {
3922 #[allow(unreachable_patterns)]
3923 self.step_info.as_ref().and_then(|v| match v {
3924 crate::model::step::StepInfo::ForwardingRule(v) => std::option::Option::Some(v),
3925 _ => std::option::Option::None,
3926 })
3927 }
3928
3929 /// Sets the value of [step_info][crate::model::Step::step_info]
3930 /// to hold a `ForwardingRule`.
3931 ///
3932 /// Note that all the setters affecting `step_info` are
3933 /// mutually exclusive.
3934 ///
3935 /// # Example
3936 /// ```ignore,no_run
3937 /// # use google_cloud_networkmanagement_v1::model::Step;
3938 /// use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
3939 /// let x = Step::new().set_forwarding_rule(ForwardingRuleInfo::default()/* use setters */);
3940 /// assert!(x.forwarding_rule().is_some());
3941 /// assert!(x.instance().is_none());
3942 /// assert!(x.firewall().is_none());
3943 /// assert!(x.route().is_none());
3944 /// assert!(x.endpoint().is_none());
3945 /// assert!(x.google_service().is_none());
3946 /// assert!(x.hybrid_subnet().is_none());
3947 /// assert!(x.vpn_gateway().is_none());
3948 /// assert!(x.vpn_tunnel().is_none());
3949 /// assert!(x.interconnect_attachment().is_none());
3950 /// assert!(x.vpc_connector().is_none());
3951 /// assert!(x.direct_vpc_egress_connection().is_none());
3952 /// assert!(x.serverless_external_connection().is_none());
3953 /// assert!(x.deliver().is_none());
3954 /// assert!(x.forward().is_none());
3955 /// assert!(x.abort().is_none());
3956 /// assert!(x.drop().is_none());
3957 /// assert!(x.load_balancer().is_none());
3958 /// assert!(x.network().is_none());
3959 /// assert!(x.gke_master().is_none());
3960 /// assert!(x.gke_pod().is_none());
3961 /// assert!(x.ip_masquerading_skipped().is_none());
3962 /// assert!(x.gke_network_policy().is_none());
3963 /// assert!(x.gke_network_policy_skipped().is_none());
3964 /// assert!(x.cloud_sql_instance().is_none());
3965 /// assert!(x.redis_instance().is_none());
3966 /// assert!(x.redis_cluster().is_none());
3967 /// assert!(x.cloud_function().is_none());
3968 /// assert!(x.app_engine_version().is_none());
3969 /// assert!(x.cloud_run_revision().is_none());
3970 /// assert!(x.cloud_run_job().is_none());
3971 /// assert!(x.nat().is_none());
3972 /// assert!(x.proxy_connection().is_none());
3973 /// assert!(x.load_balancer_backend_info().is_none());
3974 /// assert!(x.storage_bucket().is_none());
3975 /// assert!(x.serverless_neg().is_none());
3976 /// assert!(x.ngfw_packet_inspection().is_none());
3977 /// assert!(x.dms_private_connection().is_none());
3978 /// ```
3979 pub fn set_forwarding_rule<
3980 T: std::convert::Into<std::boxed::Box<crate::model::ForwardingRuleInfo>>,
3981 >(
3982 mut self,
3983 v: T,
3984 ) -> Self {
3985 self.step_info =
3986 std::option::Option::Some(crate::model::step::StepInfo::ForwardingRule(v.into()));
3987 self
3988 }
3989
3990 /// The value of [step_info][crate::model::Step::step_info]
3991 /// if it holds a `HybridSubnet`, `None` if the field is not set or
3992 /// holds a different branch.
3993 pub fn hybrid_subnet(
3994 &self,
3995 ) -> std::option::Option<&std::boxed::Box<crate::model::HybridSubnetInfo>> {
3996 #[allow(unreachable_patterns)]
3997 self.step_info.as_ref().and_then(|v| match v {
3998 crate::model::step::StepInfo::HybridSubnet(v) => std::option::Option::Some(v),
3999 _ => std::option::Option::None,
4000 })
4001 }
4002
4003 /// Sets the value of [step_info][crate::model::Step::step_info]
4004 /// to hold a `HybridSubnet`.
4005 ///
4006 /// Note that all the setters affecting `step_info` are
4007 /// mutually exclusive.
4008 ///
4009 /// # Example
4010 /// ```ignore,no_run
4011 /// # use google_cloud_networkmanagement_v1::model::Step;
4012 /// use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
4013 /// let x = Step::new().set_hybrid_subnet(HybridSubnetInfo::default()/* use setters */);
4014 /// assert!(x.hybrid_subnet().is_some());
4015 /// assert!(x.instance().is_none());
4016 /// assert!(x.firewall().is_none());
4017 /// assert!(x.route().is_none());
4018 /// assert!(x.endpoint().is_none());
4019 /// assert!(x.google_service().is_none());
4020 /// assert!(x.forwarding_rule().is_none());
4021 /// assert!(x.vpn_gateway().is_none());
4022 /// assert!(x.vpn_tunnel().is_none());
4023 /// assert!(x.interconnect_attachment().is_none());
4024 /// assert!(x.vpc_connector().is_none());
4025 /// assert!(x.direct_vpc_egress_connection().is_none());
4026 /// assert!(x.serverless_external_connection().is_none());
4027 /// assert!(x.deliver().is_none());
4028 /// assert!(x.forward().is_none());
4029 /// assert!(x.abort().is_none());
4030 /// assert!(x.drop().is_none());
4031 /// assert!(x.load_balancer().is_none());
4032 /// assert!(x.network().is_none());
4033 /// assert!(x.gke_master().is_none());
4034 /// assert!(x.gke_pod().is_none());
4035 /// assert!(x.ip_masquerading_skipped().is_none());
4036 /// assert!(x.gke_network_policy().is_none());
4037 /// assert!(x.gke_network_policy_skipped().is_none());
4038 /// assert!(x.cloud_sql_instance().is_none());
4039 /// assert!(x.redis_instance().is_none());
4040 /// assert!(x.redis_cluster().is_none());
4041 /// assert!(x.cloud_function().is_none());
4042 /// assert!(x.app_engine_version().is_none());
4043 /// assert!(x.cloud_run_revision().is_none());
4044 /// assert!(x.cloud_run_job().is_none());
4045 /// assert!(x.nat().is_none());
4046 /// assert!(x.proxy_connection().is_none());
4047 /// assert!(x.load_balancer_backend_info().is_none());
4048 /// assert!(x.storage_bucket().is_none());
4049 /// assert!(x.serverless_neg().is_none());
4050 /// assert!(x.ngfw_packet_inspection().is_none());
4051 /// assert!(x.dms_private_connection().is_none());
4052 /// ```
4053 pub fn set_hybrid_subnet<
4054 T: std::convert::Into<std::boxed::Box<crate::model::HybridSubnetInfo>>,
4055 >(
4056 mut self,
4057 v: T,
4058 ) -> Self {
4059 self.step_info =
4060 std::option::Option::Some(crate::model::step::StepInfo::HybridSubnet(v.into()));
4061 self
4062 }
4063
4064 /// The value of [step_info][crate::model::Step::step_info]
4065 /// if it holds a `VpnGateway`, `None` if the field is not set or
4066 /// holds a different branch.
4067 pub fn vpn_gateway(
4068 &self,
4069 ) -> std::option::Option<&std::boxed::Box<crate::model::VpnGatewayInfo>> {
4070 #[allow(unreachable_patterns)]
4071 self.step_info.as_ref().and_then(|v| match v {
4072 crate::model::step::StepInfo::VpnGateway(v) => std::option::Option::Some(v),
4073 _ => std::option::Option::None,
4074 })
4075 }
4076
4077 /// Sets the value of [step_info][crate::model::Step::step_info]
4078 /// to hold a `VpnGateway`.
4079 ///
4080 /// Note that all the setters affecting `step_info` are
4081 /// mutually exclusive.
4082 ///
4083 /// # Example
4084 /// ```ignore,no_run
4085 /// # use google_cloud_networkmanagement_v1::model::Step;
4086 /// use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
4087 /// let x = Step::new().set_vpn_gateway(VpnGatewayInfo::default()/* use setters */);
4088 /// assert!(x.vpn_gateway().is_some());
4089 /// assert!(x.instance().is_none());
4090 /// assert!(x.firewall().is_none());
4091 /// assert!(x.route().is_none());
4092 /// assert!(x.endpoint().is_none());
4093 /// assert!(x.google_service().is_none());
4094 /// assert!(x.forwarding_rule().is_none());
4095 /// assert!(x.hybrid_subnet().is_none());
4096 /// assert!(x.vpn_tunnel().is_none());
4097 /// assert!(x.interconnect_attachment().is_none());
4098 /// assert!(x.vpc_connector().is_none());
4099 /// assert!(x.direct_vpc_egress_connection().is_none());
4100 /// assert!(x.serverless_external_connection().is_none());
4101 /// assert!(x.deliver().is_none());
4102 /// assert!(x.forward().is_none());
4103 /// assert!(x.abort().is_none());
4104 /// assert!(x.drop().is_none());
4105 /// assert!(x.load_balancer().is_none());
4106 /// assert!(x.network().is_none());
4107 /// assert!(x.gke_master().is_none());
4108 /// assert!(x.gke_pod().is_none());
4109 /// assert!(x.ip_masquerading_skipped().is_none());
4110 /// assert!(x.gke_network_policy().is_none());
4111 /// assert!(x.gke_network_policy_skipped().is_none());
4112 /// assert!(x.cloud_sql_instance().is_none());
4113 /// assert!(x.redis_instance().is_none());
4114 /// assert!(x.redis_cluster().is_none());
4115 /// assert!(x.cloud_function().is_none());
4116 /// assert!(x.app_engine_version().is_none());
4117 /// assert!(x.cloud_run_revision().is_none());
4118 /// assert!(x.cloud_run_job().is_none());
4119 /// assert!(x.nat().is_none());
4120 /// assert!(x.proxy_connection().is_none());
4121 /// assert!(x.load_balancer_backend_info().is_none());
4122 /// assert!(x.storage_bucket().is_none());
4123 /// assert!(x.serverless_neg().is_none());
4124 /// assert!(x.ngfw_packet_inspection().is_none());
4125 /// assert!(x.dms_private_connection().is_none());
4126 /// ```
4127 pub fn set_vpn_gateway<T: std::convert::Into<std::boxed::Box<crate::model::VpnGatewayInfo>>>(
4128 mut self,
4129 v: T,
4130 ) -> Self {
4131 self.step_info =
4132 std::option::Option::Some(crate::model::step::StepInfo::VpnGateway(v.into()));
4133 self
4134 }
4135
4136 /// The value of [step_info][crate::model::Step::step_info]
4137 /// if it holds a `VpnTunnel`, `None` if the field is not set or
4138 /// holds a different branch.
4139 pub fn vpn_tunnel(&self) -> std::option::Option<&std::boxed::Box<crate::model::VpnTunnelInfo>> {
4140 #[allow(unreachable_patterns)]
4141 self.step_info.as_ref().and_then(|v| match v {
4142 crate::model::step::StepInfo::VpnTunnel(v) => std::option::Option::Some(v),
4143 _ => std::option::Option::None,
4144 })
4145 }
4146
4147 /// Sets the value of [step_info][crate::model::Step::step_info]
4148 /// to hold a `VpnTunnel`.
4149 ///
4150 /// Note that all the setters affecting `step_info` are
4151 /// mutually exclusive.
4152 ///
4153 /// # Example
4154 /// ```ignore,no_run
4155 /// # use google_cloud_networkmanagement_v1::model::Step;
4156 /// use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
4157 /// let x = Step::new().set_vpn_tunnel(VpnTunnelInfo::default()/* use setters */);
4158 /// assert!(x.vpn_tunnel().is_some());
4159 /// assert!(x.instance().is_none());
4160 /// assert!(x.firewall().is_none());
4161 /// assert!(x.route().is_none());
4162 /// assert!(x.endpoint().is_none());
4163 /// assert!(x.google_service().is_none());
4164 /// assert!(x.forwarding_rule().is_none());
4165 /// assert!(x.hybrid_subnet().is_none());
4166 /// assert!(x.vpn_gateway().is_none());
4167 /// assert!(x.interconnect_attachment().is_none());
4168 /// assert!(x.vpc_connector().is_none());
4169 /// assert!(x.direct_vpc_egress_connection().is_none());
4170 /// assert!(x.serverless_external_connection().is_none());
4171 /// assert!(x.deliver().is_none());
4172 /// assert!(x.forward().is_none());
4173 /// assert!(x.abort().is_none());
4174 /// assert!(x.drop().is_none());
4175 /// assert!(x.load_balancer().is_none());
4176 /// assert!(x.network().is_none());
4177 /// assert!(x.gke_master().is_none());
4178 /// assert!(x.gke_pod().is_none());
4179 /// assert!(x.ip_masquerading_skipped().is_none());
4180 /// assert!(x.gke_network_policy().is_none());
4181 /// assert!(x.gke_network_policy_skipped().is_none());
4182 /// assert!(x.cloud_sql_instance().is_none());
4183 /// assert!(x.redis_instance().is_none());
4184 /// assert!(x.redis_cluster().is_none());
4185 /// assert!(x.cloud_function().is_none());
4186 /// assert!(x.app_engine_version().is_none());
4187 /// assert!(x.cloud_run_revision().is_none());
4188 /// assert!(x.cloud_run_job().is_none());
4189 /// assert!(x.nat().is_none());
4190 /// assert!(x.proxy_connection().is_none());
4191 /// assert!(x.load_balancer_backend_info().is_none());
4192 /// assert!(x.storage_bucket().is_none());
4193 /// assert!(x.serverless_neg().is_none());
4194 /// assert!(x.ngfw_packet_inspection().is_none());
4195 /// assert!(x.dms_private_connection().is_none());
4196 /// ```
4197 pub fn set_vpn_tunnel<T: std::convert::Into<std::boxed::Box<crate::model::VpnTunnelInfo>>>(
4198 mut self,
4199 v: T,
4200 ) -> Self {
4201 self.step_info =
4202 std::option::Option::Some(crate::model::step::StepInfo::VpnTunnel(v.into()));
4203 self
4204 }
4205
4206 /// The value of [step_info][crate::model::Step::step_info]
4207 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
4208 /// holds a different branch.
4209 pub fn interconnect_attachment(
4210 &self,
4211 ) -> std::option::Option<&std::boxed::Box<crate::model::InterconnectAttachmentInfo>> {
4212 #[allow(unreachable_patterns)]
4213 self.step_info.as_ref().and_then(|v| match v {
4214 crate::model::step::StepInfo::InterconnectAttachment(v) => std::option::Option::Some(v),
4215 _ => std::option::Option::None,
4216 })
4217 }
4218
4219 /// Sets the value of [step_info][crate::model::Step::step_info]
4220 /// to hold a `InterconnectAttachment`.
4221 ///
4222 /// Note that all the setters affecting `step_info` are
4223 /// mutually exclusive.
4224 ///
4225 /// # Example
4226 /// ```ignore,no_run
4227 /// # use google_cloud_networkmanagement_v1::model::Step;
4228 /// use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
4229 /// let x = Step::new().set_interconnect_attachment(InterconnectAttachmentInfo::default()/* use setters */);
4230 /// assert!(x.interconnect_attachment().is_some());
4231 /// assert!(x.instance().is_none());
4232 /// assert!(x.firewall().is_none());
4233 /// assert!(x.route().is_none());
4234 /// assert!(x.endpoint().is_none());
4235 /// assert!(x.google_service().is_none());
4236 /// assert!(x.forwarding_rule().is_none());
4237 /// assert!(x.hybrid_subnet().is_none());
4238 /// assert!(x.vpn_gateway().is_none());
4239 /// assert!(x.vpn_tunnel().is_none());
4240 /// assert!(x.vpc_connector().is_none());
4241 /// assert!(x.direct_vpc_egress_connection().is_none());
4242 /// assert!(x.serverless_external_connection().is_none());
4243 /// assert!(x.deliver().is_none());
4244 /// assert!(x.forward().is_none());
4245 /// assert!(x.abort().is_none());
4246 /// assert!(x.drop().is_none());
4247 /// assert!(x.load_balancer().is_none());
4248 /// assert!(x.network().is_none());
4249 /// assert!(x.gke_master().is_none());
4250 /// assert!(x.gke_pod().is_none());
4251 /// assert!(x.ip_masquerading_skipped().is_none());
4252 /// assert!(x.gke_network_policy().is_none());
4253 /// assert!(x.gke_network_policy_skipped().is_none());
4254 /// assert!(x.cloud_sql_instance().is_none());
4255 /// assert!(x.redis_instance().is_none());
4256 /// assert!(x.redis_cluster().is_none());
4257 /// assert!(x.cloud_function().is_none());
4258 /// assert!(x.app_engine_version().is_none());
4259 /// assert!(x.cloud_run_revision().is_none());
4260 /// assert!(x.cloud_run_job().is_none());
4261 /// assert!(x.nat().is_none());
4262 /// assert!(x.proxy_connection().is_none());
4263 /// assert!(x.load_balancer_backend_info().is_none());
4264 /// assert!(x.storage_bucket().is_none());
4265 /// assert!(x.serverless_neg().is_none());
4266 /// assert!(x.ngfw_packet_inspection().is_none());
4267 /// assert!(x.dms_private_connection().is_none());
4268 /// ```
4269 pub fn set_interconnect_attachment<
4270 T: std::convert::Into<std::boxed::Box<crate::model::InterconnectAttachmentInfo>>,
4271 >(
4272 mut self,
4273 v: T,
4274 ) -> Self {
4275 self.step_info = std::option::Option::Some(
4276 crate::model::step::StepInfo::InterconnectAttachment(v.into()),
4277 );
4278 self
4279 }
4280
4281 /// The value of [step_info][crate::model::Step::step_info]
4282 /// if it holds a `VpcConnector`, `None` if the field is not set or
4283 /// holds a different branch.
4284 pub fn vpc_connector(
4285 &self,
4286 ) -> std::option::Option<&std::boxed::Box<crate::model::VpcConnectorInfo>> {
4287 #[allow(unreachable_patterns)]
4288 self.step_info.as_ref().and_then(|v| match v {
4289 crate::model::step::StepInfo::VpcConnector(v) => std::option::Option::Some(v),
4290 _ => std::option::Option::None,
4291 })
4292 }
4293
4294 /// Sets the value of [step_info][crate::model::Step::step_info]
4295 /// to hold a `VpcConnector`.
4296 ///
4297 /// Note that all the setters affecting `step_info` are
4298 /// mutually exclusive.
4299 ///
4300 /// # Example
4301 /// ```ignore,no_run
4302 /// # use google_cloud_networkmanagement_v1::model::Step;
4303 /// use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
4304 /// let x = Step::new().set_vpc_connector(VpcConnectorInfo::default()/* use setters */);
4305 /// assert!(x.vpc_connector().is_some());
4306 /// assert!(x.instance().is_none());
4307 /// assert!(x.firewall().is_none());
4308 /// assert!(x.route().is_none());
4309 /// assert!(x.endpoint().is_none());
4310 /// assert!(x.google_service().is_none());
4311 /// assert!(x.forwarding_rule().is_none());
4312 /// assert!(x.hybrid_subnet().is_none());
4313 /// assert!(x.vpn_gateway().is_none());
4314 /// assert!(x.vpn_tunnel().is_none());
4315 /// assert!(x.interconnect_attachment().is_none());
4316 /// assert!(x.direct_vpc_egress_connection().is_none());
4317 /// assert!(x.serverless_external_connection().is_none());
4318 /// assert!(x.deliver().is_none());
4319 /// assert!(x.forward().is_none());
4320 /// assert!(x.abort().is_none());
4321 /// assert!(x.drop().is_none());
4322 /// assert!(x.load_balancer().is_none());
4323 /// assert!(x.network().is_none());
4324 /// assert!(x.gke_master().is_none());
4325 /// assert!(x.gke_pod().is_none());
4326 /// assert!(x.ip_masquerading_skipped().is_none());
4327 /// assert!(x.gke_network_policy().is_none());
4328 /// assert!(x.gke_network_policy_skipped().is_none());
4329 /// assert!(x.cloud_sql_instance().is_none());
4330 /// assert!(x.redis_instance().is_none());
4331 /// assert!(x.redis_cluster().is_none());
4332 /// assert!(x.cloud_function().is_none());
4333 /// assert!(x.app_engine_version().is_none());
4334 /// assert!(x.cloud_run_revision().is_none());
4335 /// assert!(x.cloud_run_job().is_none());
4336 /// assert!(x.nat().is_none());
4337 /// assert!(x.proxy_connection().is_none());
4338 /// assert!(x.load_balancer_backend_info().is_none());
4339 /// assert!(x.storage_bucket().is_none());
4340 /// assert!(x.serverless_neg().is_none());
4341 /// assert!(x.ngfw_packet_inspection().is_none());
4342 /// assert!(x.dms_private_connection().is_none());
4343 /// ```
4344 pub fn set_vpc_connector<
4345 T: std::convert::Into<std::boxed::Box<crate::model::VpcConnectorInfo>>,
4346 >(
4347 mut self,
4348 v: T,
4349 ) -> Self {
4350 self.step_info =
4351 std::option::Option::Some(crate::model::step::StepInfo::VpcConnector(v.into()));
4352 self
4353 }
4354
4355 /// The value of [step_info][crate::model::Step::step_info]
4356 /// if it holds a `DirectVpcEgressConnection`, `None` if the field is not set or
4357 /// holds a different branch.
4358 pub fn direct_vpc_egress_connection(
4359 &self,
4360 ) -> std::option::Option<&std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>> {
4361 #[allow(unreachable_patterns)]
4362 self.step_info.as_ref().and_then(|v| match v {
4363 crate::model::step::StepInfo::DirectVpcEgressConnection(v) => {
4364 std::option::Option::Some(v)
4365 }
4366 _ => std::option::Option::None,
4367 })
4368 }
4369
4370 /// Sets the value of [step_info][crate::model::Step::step_info]
4371 /// to hold a `DirectVpcEgressConnection`.
4372 ///
4373 /// Note that all the setters affecting `step_info` are
4374 /// mutually exclusive.
4375 ///
4376 /// # Example
4377 /// ```ignore,no_run
4378 /// # use google_cloud_networkmanagement_v1::model::Step;
4379 /// use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
4380 /// let x = Step::new().set_direct_vpc_egress_connection(DirectVpcEgressConnectionInfo::default()/* use setters */);
4381 /// assert!(x.direct_vpc_egress_connection().is_some());
4382 /// assert!(x.instance().is_none());
4383 /// assert!(x.firewall().is_none());
4384 /// assert!(x.route().is_none());
4385 /// assert!(x.endpoint().is_none());
4386 /// assert!(x.google_service().is_none());
4387 /// assert!(x.forwarding_rule().is_none());
4388 /// assert!(x.hybrid_subnet().is_none());
4389 /// assert!(x.vpn_gateway().is_none());
4390 /// assert!(x.vpn_tunnel().is_none());
4391 /// assert!(x.interconnect_attachment().is_none());
4392 /// assert!(x.vpc_connector().is_none());
4393 /// assert!(x.serverless_external_connection().is_none());
4394 /// assert!(x.deliver().is_none());
4395 /// assert!(x.forward().is_none());
4396 /// assert!(x.abort().is_none());
4397 /// assert!(x.drop().is_none());
4398 /// assert!(x.load_balancer().is_none());
4399 /// assert!(x.network().is_none());
4400 /// assert!(x.gke_master().is_none());
4401 /// assert!(x.gke_pod().is_none());
4402 /// assert!(x.ip_masquerading_skipped().is_none());
4403 /// assert!(x.gke_network_policy().is_none());
4404 /// assert!(x.gke_network_policy_skipped().is_none());
4405 /// assert!(x.cloud_sql_instance().is_none());
4406 /// assert!(x.redis_instance().is_none());
4407 /// assert!(x.redis_cluster().is_none());
4408 /// assert!(x.cloud_function().is_none());
4409 /// assert!(x.app_engine_version().is_none());
4410 /// assert!(x.cloud_run_revision().is_none());
4411 /// assert!(x.cloud_run_job().is_none());
4412 /// assert!(x.nat().is_none());
4413 /// assert!(x.proxy_connection().is_none());
4414 /// assert!(x.load_balancer_backend_info().is_none());
4415 /// assert!(x.storage_bucket().is_none());
4416 /// assert!(x.serverless_neg().is_none());
4417 /// assert!(x.ngfw_packet_inspection().is_none());
4418 /// assert!(x.dms_private_connection().is_none());
4419 /// ```
4420 pub fn set_direct_vpc_egress_connection<
4421 T: std::convert::Into<std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>>,
4422 >(
4423 mut self,
4424 v: T,
4425 ) -> Self {
4426 self.step_info = std::option::Option::Some(
4427 crate::model::step::StepInfo::DirectVpcEgressConnection(v.into()),
4428 );
4429 self
4430 }
4431
4432 /// The value of [step_info][crate::model::Step::step_info]
4433 /// if it holds a `ServerlessExternalConnection`, `None` if the field is not set or
4434 /// holds a different branch.
4435 pub fn serverless_external_connection(
4436 &self,
4437 ) -> std::option::Option<&std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>> {
4438 #[allow(unreachable_patterns)]
4439 self.step_info.as_ref().and_then(|v| match v {
4440 crate::model::step::StepInfo::ServerlessExternalConnection(v) => {
4441 std::option::Option::Some(v)
4442 }
4443 _ => std::option::Option::None,
4444 })
4445 }
4446
4447 /// Sets the value of [step_info][crate::model::Step::step_info]
4448 /// to hold a `ServerlessExternalConnection`.
4449 ///
4450 /// Note that all the setters affecting `step_info` are
4451 /// mutually exclusive.
4452 ///
4453 /// # Example
4454 /// ```ignore,no_run
4455 /// # use google_cloud_networkmanagement_v1::model::Step;
4456 /// use google_cloud_networkmanagement_v1::model::ServerlessExternalConnectionInfo;
4457 /// let x = Step::new().set_serverless_external_connection(ServerlessExternalConnectionInfo::default()/* use setters */);
4458 /// assert!(x.serverless_external_connection().is_some());
4459 /// assert!(x.instance().is_none());
4460 /// assert!(x.firewall().is_none());
4461 /// assert!(x.route().is_none());
4462 /// assert!(x.endpoint().is_none());
4463 /// assert!(x.google_service().is_none());
4464 /// assert!(x.forwarding_rule().is_none());
4465 /// assert!(x.hybrid_subnet().is_none());
4466 /// assert!(x.vpn_gateway().is_none());
4467 /// assert!(x.vpn_tunnel().is_none());
4468 /// assert!(x.interconnect_attachment().is_none());
4469 /// assert!(x.vpc_connector().is_none());
4470 /// assert!(x.direct_vpc_egress_connection().is_none());
4471 /// assert!(x.deliver().is_none());
4472 /// assert!(x.forward().is_none());
4473 /// assert!(x.abort().is_none());
4474 /// assert!(x.drop().is_none());
4475 /// assert!(x.load_balancer().is_none());
4476 /// assert!(x.network().is_none());
4477 /// assert!(x.gke_master().is_none());
4478 /// assert!(x.gke_pod().is_none());
4479 /// assert!(x.ip_masquerading_skipped().is_none());
4480 /// assert!(x.gke_network_policy().is_none());
4481 /// assert!(x.gke_network_policy_skipped().is_none());
4482 /// assert!(x.cloud_sql_instance().is_none());
4483 /// assert!(x.redis_instance().is_none());
4484 /// assert!(x.redis_cluster().is_none());
4485 /// assert!(x.cloud_function().is_none());
4486 /// assert!(x.app_engine_version().is_none());
4487 /// assert!(x.cloud_run_revision().is_none());
4488 /// assert!(x.cloud_run_job().is_none());
4489 /// assert!(x.nat().is_none());
4490 /// assert!(x.proxy_connection().is_none());
4491 /// assert!(x.load_balancer_backend_info().is_none());
4492 /// assert!(x.storage_bucket().is_none());
4493 /// assert!(x.serverless_neg().is_none());
4494 /// assert!(x.ngfw_packet_inspection().is_none());
4495 /// assert!(x.dms_private_connection().is_none());
4496 /// ```
4497 pub fn set_serverless_external_connection<
4498 T: std::convert::Into<std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>>,
4499 >(
4500 mut self,
4501 v: T,
4502 ) -> Self {
4503 self.step_info = std::option::Option::Some(
4504 crate::model::step::StepInfo::ServerlessExternalConnection(v.into()),
4505 );
4506 self
4507 }
4508
4509 /// The value of [step_info][crate::model::Step::step_info]
4510 /// if it holds a `Deliver`, `None` if the field is not set or
4511 /// holds a different branch.
4512 pub fn deliver(&self) -> std::option::Option<&std::boxed::Box<crate::model::DeliverInfo>> {
4513 #[allow(unreachable_patterns)]
4514 self.step_info.as_ref().and_then(|v| match v {
4515 crate::model::step::StepInfo::Deliver(v) => std::option::Option::Some(v),
4516 _ => std::option::Option::None,
4517 })
4518 }
4519
4520 /// Sets the value of [step_info][crate::model::Step::step_info]
4521 /// to hold a `Deliver`.
4522 ///
4523 /// Note that all the setters affecting `step_info` are
4524 /// mutually exclusive.
4525 ///
4526 /// # Example
4527 /// ```ignore,no_run
4528 /// # use google_cloud_networkmanagement_v1::model::Step;
4529 /// use google_cloud_networkmanagement_v1::model::DeliverInfo;
4530 /// let x = Step::new().set_deliver(DeliverInfo::default()/* use setters */);
4531 /// assert!(x.deliver().is_some());
4532 /// assert!(x.instance().is_none());
4533 /// assert!(x.firewall().is_none());
4534 /// assert!(x.route().is_none());
4535 /// assert!(x.endpoint().is_none());
4536 /// assert!(x.google_service().is_none());
4537 /// assert!(x.forwarding_rule().is_none());
4538 /// assert!(x.hybrid_subnet().is_none());
4539 /// assert!(x.vpn_gateway().is_none());
4540 /// assert!(x.vpn_tunnel().is_none());
4541 /// assert!(x.interconnect_attachment().is_none());
4542 /// assert!(x.vpc_connector().is_none());
4543 /// assert!(x.direct_vpc_egress_connection().is_none());
4544 /// assert!(x.serverless_external_connection().is_none());
4545 /// assert!(x.forward().is_none());
4546 /// assert!(x.abort().is_none());
4547 /// assert!(x.drop().is_none());
4548 /// assert!(x.load_balancer().is_none());
4549 /// assert!(x.network().is_none());
4550 /// assert!(x.gke_master().is_none());
4551 /// assert!(x.gke_pod().is_none());
4552 /// assert!(x.ip_masquerading_skipped().is_none());
4553 /// assert!(x.gke_network_policy().is_none());
4554 /// assert!(x.gke_network_policy_skipped().is_none());
4555 /// assert!(x.cloud_sql_instance().is_none());
4556 /// assert!(x.redis_instance().is_none());
4557 /// assert!(x.redis_cluster().is_none());
4558 /// assert!(x.cloud_function().is_none());
4559 /// assert!(x.app_engine_version().is_none());
4560 /// assert!(x.cloud_run_revision().is_none());
4561 /// assert!(x.cloud_run_job().is_none());
4562 /// assert!(x.nat().is_none());
4563 /// assert!(x.proxy_connection().is_none());
4564 /// assert!(x.load_balancer_backend_info().is_none());
4565 /// assert!(x.storage_bucket().is_none());
4566 /// assert!(x.serverless_neg().is_none());
4567 /// assert!(x.ngfw_packet_inspection().is_none());
4568 /// assert!(x.dms_private_connection().is_none());
4569 /// ```
4570 pub fn set_deliver<T: std::convert::Into<std::boxed::Box<crate::model::DeliverInfo>>>(
4571 mut self,
4572 v: T,
4573 ) -> Self {
4574 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Deliver(v.into()));
4575 self
4576 }
4577
4578 /// The value of [step_info][crate::model::Step::step_info]
4579 /// if it holds a `Forward`, `None` if the field is not set or
4580 /// holds a different branch.
4581 pub fn forward(&self) -> std::option::Option<&std::boxed::Box<crate::model::ForwardInfo>> {
4582 #[allow(unreachable_patterns)]
4583 self.step_info.as_ref().and_then(|v| match v {
4584 crate::model::step::StepInfo::Forward(v) => std::option::Option::Some(v),
4585 _ => std::option::Option::None,
4586 })
4587 }
4588
4589 /// Sets the value of [step_info][crate::model::Step::step_info]
4590 /// to hold a `Forward`.
4591 ///
4592 /// Note that all the setters affecting `step_info` are
4593 /// mutually exclusive.
4594 ///
4595 /// # Example
4596 /// ```ignore,no_run
4597 /// # use google_cloud_networkmanagement_v1::model::Step;
4598 /// use google_cloud_networkmanagement_v1::model::ForwardInfo;
4599 /// let x = Step::new().set_forward(ForwardInfo::default()/* use setters */);
4600 /// assert!(x.forward().is_some());
4601 /// assert!(x.instance().is_none());
4602 /// assert!(x.firewall().is_none());
4603 /// assert!(x.route().is_none());
4604 /// assert!(x.endpoint().is_none());
4605 /// assert!(x.google_service().is_none());
4606 /// assert!(x.forwarding_rule().is_none());
4607 /// assert!(x.hybrid_subnet().is_none());
4608 /// assert!(x.vpn_gateway().is_none());
4609 /// assert!(x.vpn_tunnel().is_none());
4610 /// assert!(x.interconnect_attachment().is_none());
4611 /// assert!(x.vpc_connector().is_none());
4612 /// assert!(x.direct_vpc_egress_connection().is_none());
4613 /// assert!(x.serverless_external_connection().is_none());
4614 /// assert!(x.deliver().is_none());
4615 /// assert!(x.abort().is_none());
4616 /// assert!(x.drop().is_none());
4617 /// assert!(x.load_balancer().is_none());
4618 /// assert!(x.network().is_none());
4619 /// assert!(x.gke_master().is_none());
4620 /// assert!(x.gke_pod().is_none());
4621 /// assert!(x.ip_masquerading_skipped().is_none());
4622 /// assert!(x.gke_network_policy().is_none());
4623 /// assert!(x.gke_network_policy_skipped().is_none());
4624 /// assert!(x.cloud_sql_instance().is_none());
4625 /// assert!(x.redis_instance().is_none());
4626 /// assert!(x.redis_cluster().is_none());
4627 /// assert!(x.cloud_function().is_none());
4628 /// assert!(x.app_engine_version().is_none());
4629 /// assert!(x.cloud_run_revision().is_none());
4630 /// assert!(x.cloud_run_job().is_none());
4631 /// assert!(x.nat().is_none());
4632 /// assert!(x.proxy_connection().is_none());
4633 /// assert!(x.load_balancer_backend_info().is_none());
4634 /// assert!(x.storage_bucket().is_none());
4635 /// assert!(x.serverless_neg().is_none());
4636 /// assert!(x.ngfw_packet_inspection().is_none());
4637 /// assert!(x.dms_private_connection().is_none());
4638 /// ```
4639 pub fn set_forward<T: std::convert::Into<std::boxed::Box<crate::model::ForwardInfo>>>(
4640 mut self,
4641 v: T,
4642 ) -> Self {
4643 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Forward(v.into()));
4644 self
4645 }
4646
4647 /// The value of [step_info][crate::model::Step::step_info]
4648 /// if it holds a `Abort`, `None` if the field is not set or
4649 /// holds a different branch.
4650 pub fn abort(&self) -> std::option::Option<&std::boxed::Box<crate::model::AbortInfo>> {
4651 #[allow(unreachable_patterns)]
4652 self.step_info.as_ref().and_then(|v| match v {
4653 crate::model::step::StepInfo::Abort(v) => std::option::Option::Some(v),
4654 _ => std::option::Option::None,
4655 })
4656 }
4657
4658 /// Sets the value of [step_info][crate::model::Step::step_info]
4659 /// to hold a `Abort`.
4660 ///
4661 /// Note that all the setters affecting `step_info` are
4662 /// mutually exclusive.
4663 ///
4664 /// # Example
4665 /// ```ignore,no_run
4666 /// # use google_cloud_networkmanagement_v1::model::Step;
4667 /// use google_cloud_networkmanagement_v1::model::AbortInfo;
4668 /// let x = Step::new().set_abort(AbortInfo::default()/* use setters */);
4669 /// assert!(x.abort().is_some());
4670 /// assert!(x.instance().is_none());
4671 /// assert!(x.firewall().is_none());
4672 /// assert!(x.route().is_none());
4673 /// assert!(x.endpoint().is_none());
4674 /// assert!(x.google_service().is_none());
4675 /// assert!(x.forwarding_rule().is_none());
4676 /// assert!(x.hybrid_subnet().is_none());
4677 /// assert!(x.vpn_gateway().is_none());
4678 /// assert!(x.vpn_tunnel().is_none());
4679 /// assert!(x.interconnect_attachment().is_none());
4680 /// assert!(x.vpc_connector().is_none());
4681 /// assert!(x.direct_vpc_egress_connection().is_none());
4682 /// assert!(x.serverless_external_connection().is_none());
4683 /// assert!(x.deliver().is_none());
4684 /// assert!(x.forward().is_none());
4685 /// assert!(x.drop().is_none());
4686 /// assert!(x.load_balancer().is_none());
4687 /// assert!(x.network().is_none());
4688 /// assert!(x.gke_master().is_none());
4689 /// assert!(x.gke_pod().is_none());
4690 /// assert!(x.ip_masquerading_skipped().is_none());
4691 /// assert!(x.gke_network_policy().is_none());
4692 /// assert!(x.gke_network_policy_skipped().is_none());
4693 /// assert!(x.cloud_sql_instance().is_none());
4694 /// assert!(x.redis_instance().is_none());
4695 /// assert!(x.redis_cluster().is_none());
4696 /// assert!(x.cloud_function().is_none());
4697 /// assert!(x.app_engine_version().is_none());
4698 /// assert!(x.cloud_run_revision().is_none());
4699 /// assert!(x.cloud_run_job().is_none());
4700 /// assert!(x.nat().is_none());
4701 /// assert!(x.proxy_connection().is_none());
4702 /// assert!(x.load_balancer_backend_info().is_none());
4703 /// assert!(x.storage_bucket().is_none());
4704 /// assert!(x.serverless_neg().is_none());
4705 /// assert!(x.ngfw_packet_inspection().is_none());
4706 /// assert!(x.dms_private_connection().is_none());
4707 /// ```
4708 pub fn set_abort<T: std::convert::Into<std::boxed::Box<crate::model::AbortInfo>>>(
4709 mut self,
4710 v: T,
4711 ) -> Self {
4712 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Abort(v.into()));
4713 self
4714 }
4715
4716 /// The value of [step_info][crate::model::Step::step_info]
4717 /// if it holds a `Drop`, `None` if the field is not set or
4718 /// holds a different branch.
4719 pub fn drop(&self) -> std::option::Option<&std::boxed::Box<crate::model::DropInfo>> {
4720 #[allow(unreachable_patterns)]
4721 self.step_info.as_ref().and_then(|v| match v {
4722 crate::model::step::StepInfo::Drop(v) => std::option::Option::Some(v),
4723 _ => std::option::Option::None,
4724 })
4725 }
4726
4727 /// Sets the value of [step_info][crate::model::Step::step_info]
4728 /// to hold a `Drop`.
4729 ///
4730 /// Note that all the setters affecting `step_info` are
4731 /// mutually exclusive.
4732 ///
4733 /// # Example
4734 /// ```ignore,no_run
4735 /// # use google_cloud_networkmanagement_v1::model::Step;
4736 /// use google_cloud_networkmanagement_v1::model::DropInfo;
4737 /// let x = Step::new().set_drop(DropInfo::default()/* use setters */);
4738 /// assert!(x.drop().is_some());
4739 /// assert!(x.instance().is_none());
4740 /// assert!(x.firewall().is_none());
4741 /// assert!(x.route().is_none());
4742 /// assert!(x.endpoint().is_none());
4743 /// assert!(x.google_service().is_none());
4744 /// assert!(x.forwarding_rule().is_none());
4745 /// assert!(x.hybrid_subnet().is_none());
4746 /// assert!(x.vpn_gateway().is_none());
4747 /// assert!(x.vpn_tunnel().is_none());
4748 /// assert!(x.interconnect_attachment().is_none());
4749 /// assert!(x.vpc_connector().is_none());
4750 /// assert!(x.direct_vpc_egress_connection().is_none());
4751 /// assert!(x.serverless_external_connection().is_none());
4752 /// assert!(x.deliver().is_none());
4753 /// assert!(x.forward().is_none());
4754 /// assert!(x.abort().is_none());
4755 /// assert!(x.load_balancer().is_none());
4756 /// assert!(x.network().is_none());
4757 /// assert!(x.gke_master().is_none());
4758 /// assert!(x.gke_pod().is_none());
4759 /// assert!(x.ip_masquerading_skipped().is_none());
4760 /// assert!(x.gke_network_policy().is_none());
4761 /// assert!(x.gke_network_policy_skipped().is_none());
4762 /// assert!(x.cloud_sql_instance().is_none());
4763 /// assert!(x.redis_instance().is_none());
4764 /// assert!(x.redis_cluster().is_none());
4765 /// assert!(x.cloud_function().is_none());
4766 /// assert!(x.app_engine_version().is_none());
4767 /// assert!(x.cloud_run_revision().is_none());
4768 /// assert!(x.cloud_run_job().is_none());
4769 /// assert!(x.nat().is_none());
4770 /// assert!(x.proxy_connection().is_none());
4771 /// assert!(x.load_balancer_backend_info().is_none());
4772 /// assert!(x.storage_bucket().is_none());
4773 /// assert!(x.serverless_neg().is_none());
4774 /// assert!(x.ngfw_packet_inspection().is_none());
4775 /// assert!(x.dms_private_connection().is_none());
4776 /// ```
4777 pub fn set_drop<T: std::convert::Into<std::boxed::Box<crate::model::DropInfo>>>(
4778 mut self,
4779 v: T,
4780 ) -> Self {
4781 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Drop(v.into()));
4782 self
4783 }
4784
4785 /// The value of [step_info][crate::model::Step::step_info]
4786 /// if it holds a `LoadBalancer`, `None` if the field is not set or
4787 /// holds a different branch.
4788 #[deprecated]
4789 pub fn load_balancer(
4790 &self,
4791 ) -> std::option::Option<&std::boxed::Box<crate::model::LoadBalancerInfo>> {
4792 #[allow(unreachable_patterns)]
4793 self.step_info.as_ref().and_then(|v| match v {
4794 crate::model::step::StepInfo::LoadBalancer(v) => std::option::Option::Some(v),
4795 _ => std::option::Option::None,
4796 })
4797 }
4798
4799 /// Sets the value of [step_info][crate::model::Step::step_info]
4800 /// to hold a `LoadBalancer`.
4801 ///
4802 /// Note that all the setters affecting `step_info` are
4803 /// mutually exclusive.
4804 ///
4805 /// # Example
4806 /// ```ignore,no_run
4807 /// # use google_cloud_networkmanagement_v1::model::Step;
4808 /// use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
4809 /// let x = Step::new().set_load_balancer(LoadBalancerInfo::default()/* use setters */);
4810 /// assert!(x.load_balancer().is_some());
4811 /// assert!(x.instance().is_none());
4812 /// assert!(x.firewall().is_none());
4813 /// assert!(x.route().is_none());
4814 /// assert!(x.endpoint().is_none());
4815 /// assert!(x.google_service().is_none());
4816 /// assert!(x.forwarding_rule().is_none());
4817 /// assert!(x.hybrid_subnet().is_none());
4818 /// assert!(x.vpn_gateway().is_none());
4819 /// assert!(x.vpn_tunnel().is_none());
4820 /// assert!(x.interconnect_attachment().is_none());
4821 /// assert!(x.vpc_connector().is_none());
4822 /// assert!(x.direct_vpc_egress_connection().is_none());
4823 /// assert!(x.serverless_external_connection().is_none());
4824 /// assert!(x.deliver().is_none());
4825 /// assert!(x.forward().is_none());
4826 /// assert!(x.abort().is_none());
4827 /// assert!(x.drop().is_none());
4828 /// assert!(x.network().is_none());
4829 /// assert!(x.gke_master().is_none());
4830 /// assert!(x.gke_pod().is_none());
4831 /// assert!(x.ip_masquerading_skipped().is_none());
4832 /// assert!(x.gke_network_policy().is_none());
4833 /// assert!(x.gke_network_policy_skipped().is_none());
4834 /// assert!(x.cloud_sql_instance().is_none());
4835 /// assert!(x.redis_instance().is_none());
4836 /// assert!(x.redis_cluster().is_none());
4837 /// assert!(x.cloud_function().is_none());
4838 /// assert!(x.app_engine_version().is_none());
4839 /// assert!(x.cloud_run_revision().is_none());
4840 /// assert!(x.cloud_run_job().is_none());
4841 /// assert!(x.nat().is_none());
4842 /// assert!(x.proxy_connection().is_none());
4843 /// assert!(x.load_balancer_backend_info().is_none());
4844 /// assert!(x.storage_bucket().is_none());
4845 /// assert!(x.serverless_neg().is_none());
4846 /// assert!(x.ngfw_packet_inspection().is_none());
4847 /// assert!(x.dms_private_connection().is_none());
4848 /// ```
4849 #[deprecated]
4850 pub fn set_load_balancer<
4851 T: std::convert::Into<std::boxed::Box<crate::model::LoadBalancerInfo>>,
4852 >(
4853 mut self,
4854 v: T,
4855 ) -> Self {
4856 self.step_info =
4857 std::option::Option::Some(crate::model::step::StepInfo::LoadBalancer(v.into()));
4858 self
4859 }
4860
4861 /// The value of [step_info][crate::model::Step::step_info]
4862 /// if it holds a `Network`, `None` if the field is not set or
4863 /// holds a different branch.
4864 pub fn network(&self) -> std::option::Option<&std::boxed::Box<crate::model::NetworkInfo>> {
4865 #[allow(unreachable_patterns)]
4866 self.step_info.as_ref().and_then(|v| match v {
4867 crate::model::step::StepInfo::Network(v) => std::option::Option::Some(v),
4868 _ => std::option::Option::None,
4869 })
4870 }
4871
4872 /// Sets the value of [step_info][crate::model::Step::step_info]
4873 /// to hold a `Network`.
4874 ///
4875 /// Note that all the setters affecting `step_info` are
4876 /// mutually exclusive.
4877 ///
4878 /// # Example
4879 /// ```ignore,no_run
4880 /// # use google_cloud_networkmanagement_v1::model::Step;
4881 /// use google_cloud_networkmanagement_v1::model::NetworkInfo;
4882 /// let x = Step::new().set_network(NetworkInfo::default()/* use setters */);
4883 /// assert!(x.network().is_some());
4884 /// assert!(x.instance().is_none());
4885 /// assert!(x.firewall().is_none());
4886 /// assert!(x.route().is_none());
4887 /// assert!(x.endpoint().is_none());
4888 /// assert!(x.google_service().is_none());
4889 /// assert!(x.forwarding_rule().is_none());
4890 /// assert!(x.hybrid_subnet().is_none());
4891 /// assert!(x.vpn_gateway().is_none());
4892 /// assert!(x.vpn_tunnel().is_none());
4893 /// assert!(x.interconnect_attachment().is_none());
4894 /// assert!(x.vpc_connector().is_none());
4895 /// assert!(x.direct_vpc_egress_connection().is_none());
4896 /// assert!(x.serverless_external_connection().is_none());
4897 /// assert!(x.deliver().is_none());
4898 /// assert!(x.forward().is_none());
4899 /// assert!(x.abort().is_none());
4900 /// assert!(x.drop().is_none());
4901 /// assert!(x.load_balancer().is_none());
4902 /// assert!(x.gke_master().is_none());
4903 /// assert!(x.gke_pod().is_none());
4904 /// assert!(x.ip_masquerading_skipped().is_none());
4905 /// assert!(x.gke_network_policy().is_none());
4906 /// assert!(x.gke_network_policy_skipped().is_none());
4907 /// assert!(x.cloud_sql_instance().is_none());
4908 /// assert!(x.redis_instance().is_none());
4909 /// assert!(x.redis_cluster().is_none());
4910 /// assert!(x.cloud_function().is_none());
4911 /// assert!(x.app_engine_version().is_none());
4912 /// assert!(x.cloud_run_revision().is_none());
4913 /// assert!(x.cloud_run_job().is_none());
4914 /// assert!(x.nat().is_none());
4915 /// assert!(x.proxy_connection().is_none());
4916 /// assert!(x.load_balancer_backend_info().is_none());
4917 /// assert!(x.storage_bucket().is_none());
4918 /// assert!(x.serverless_neg().is_none());
4919 /// assert!(x.ngfw_packet_inspection().is_none());
4920 /// assert!(x.dms_private_connection().is_none());
4921 /// ```
4922 pub fn set_network<T: std::convert::Into<std::boxed::Box<crate::model::NetworkInfo>>>(
4923 mut self,
4924 v: T,
4925 ) -> Self {
4926 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Network(v.into()));
4927 self
4928 }
4929
4930 /// The value of [step_info][crate::model::Step::step_info]
4931 /// if it holds a `GkeMaster`, `None` if the field is not set or
4932 /// holds a different branch.
4933 pub fn gke_master(&self) -> std::option::Option<&std::boxed::Box<crate::model::GKEMasterInfo>> {
4934 #[allow(unreachable_patterns)]
4935 self.step_info.as_ref().and_then(|v| match v {
4936 crate::model::step::StepInfo::GkeMaster(v) => std::option::Option::Some(v),
4937 _ => std::option::Option::None,
4938 })
4939 }
4940
4941 /// Sets the value of [step_info][crate::model::Step::step_info]
4942 /// to hold a `GkeMaster`.
4943 ///
4944 /// Note that all the setters affecting `step_info` are
4945 /// mutually exclusive.
4946 ///
4947 /// # Example
4948 /// ```ignore,no_run
4949 /// # use google_cloud_networkmanagement_v1::model::Step;
4950 /// use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
4951 /// let x = Step::new().set_gke_master(GKEMasterInfo::default()/* use setters */);
4952 /// assert!(x.gke_master().is_some());
4953 /// assert!(x.instance().is_none());
4954 /// assert!(x.firewall().is_none());
4955 /// assert!(x.route().is_none());
4956 /// assert!(x.endpoint().is_none());
4957 /// assert!(x.google_service().is_none());
4958 /// assert!(x.forwarding_rule().is_none());
4959 /// assert!(x.hybrid_subnet().is_none());
4960 /// assert!(x.vpn_gateway().is_none());
4961 /// assert!(x.vpn_tunnel().is_none());
4962 /// assert!(x.interconnect_attachment().is_none());
4963 /// assert!(x.vpc_connector().is_none());
4964 /// assert!(x.direct_vpc_egress_connection().is_none());
4965 /// assert!(x.serverless_external_connection().is_none());
4966 /// assert!(x.deliver().is_none());
4967 /// assert!(x.forward().is_none());
4968 /// assert!(x.abort().is_none());
4969 /// assert!(x.drop().is_none());
4970 /// assert!(x.load_balancer().is_none());
4971 /// assert!(x.network().is_none());
4972 /// assert!(x.gke_pod().is_none());
4973 /// assert!(x.ip_masquerading_skipped().is_none());
4974 /// assert!(x.gke_network_policy().is_none());
4975 /// assert!(x.gke_network_policy_skipped().is_none());
4976 /// assert!(x.cloud_sql_instance().is_none());
4977 /// assert!(x.redis_instance().is_none());
4978 /// assert!(x.redis_cluster().is_none());
4979 /// assert!(x.cloud_function().is_none());
4980 /// assert!(x.app_engine_version().is_none());
4981 /// assert!(x.cloud_run_revision().is_none());
4982 /// assert!(x.cloud_run_job().is_none());
4983 /// assert!(x.nat().is_none());
4984 /// assert!(x.proxy_connection().is_none());
4985 /// assert!(x.load_balancer_backend_info().is_none());
4986 /// assert!(x.storage_bucket().is_none());
4987 /// assert!(x.serverless_neg().is_none());
4988 /// assert!(x.ngfw_packet_inspection().is_none());
4989 /// assert!(x.dms_private_connection().is_none());
4990 /// ```
4991 pub fn set_gke_master<T: std::convert::Into<std::boxed::Box<crate::model::GKEMasterInfo>>>(
4992 mut self,
4993 v: T,
4994 ) -> Self {
4995 self.step_info =
4996 std::option::Option::Some(crate::model::step::StepInfo::GkeMaster(v.into()));
4997 self
4998 }
4999
5000 /// The value of [step_info][crate::model::Step::step_info]
5001 /// if it holds a `GkePod`, `None` if the field is not set or
5002 /// holds a different branch.
5003 pub fn gke_pod(&self) -> std::option::Option<&std::boxed::Box<crate::model::GkePodInfo>> {
5004 #[allow(unreachable_patterns)]
5005 self.step_info.as_ref().and_then(|v| match v {
5006 crate::model::step::StepInfo::GkePod(v) => std::option::Option::Some(v),
5007 _ => std::option::Option::None,
5008 })
5009 }
5010
5011 /// Sets the value of [step_info][crate::model::Step::step_info]
5012 /// to hold a `GkePod`.
5013 ///
5014 /// Note that all the setters affecting `step_info` are
5015 /// mutually exclusive.
5016 ///
5017 /// # Example
5018 /// ```ignore,no_run
5019 /// # use google_cloud_networkmanagement_v1::model::Step;
5020 /// use google_cloud_networkmanagement_v1::model::GkePodInfo;
5021 /// let x = Step::new().set_gke_pod(GkePodInfo::default()/* use setters */);
5022 /// assert!(x.gke_pod().is_some());
5023 /// assert!(x.instance().is_none());
5024 /// assert!(x.firewall().is_none());
5025 /// assert!(x.route().is_none());
5026 /// assert!(x.endpoint().is_none());
5027 /// assert!(x.google_service().is_none());
5028 /// assert!(x.forwarding_rule().is_none());
5029 /// assert!(x.hybrid_subnet().is_none());
5030 /// assert!(x.vpn_gateway().is_none());
5031 /// assert!(x.vpn_tunnel().is_none());
5032 /// assert!(x.interconnect_attachment().is_none());
5033 /// assert!(x.vpc_connector().is_none());
5034 /// assert!(x.direct_vpc_egress_connection().is_none());
5035 /// assert!(x.serverless_external_connection().is_none());
5036 /// assert!(x.deliver().is_none());
5037 /// assert!(x.forward().is_none());
5038 /// assert!(x.abort().is_none());
5039 /// assert!(x.drop().is_none());
5040 /// assert!(x.load_balancer().is_none());
5041 /// assert!(x.network().is_none());
5042 /// assert!(x.gke_master().is_none());
5043 /// assert!(x.ip_masquerading_skipped().is_none());
5044 /// assert!(x.gke_network_policy().is_none());
5045 /// assert!(x.gke_network_policy_skipped().is_none());
5046 /// assert!(x.cloud_sql_instance().is_none());
5047 /// assert!(x.redis_instance().is_none());
5048 /// assert!(x.redis_cluster().is_none());
5049 /// assert!(x.cloud_function().is_none());
5050 /// assert!(x.app_engine_version().is_none());
5051 /// assert!(x.cloud_run_revision().is_none());
5052 /// assert!(x.cloud_run_job().is_none());
5053 /// assert!(x.nat().is_none());
5054 /// assert!(x.proxy_connection().is_none());
5055 /// assert!(x.load_balancer_backend_info().is_none());
5056 /// assert!(x.storage_bucket().is_none());
5057 /// assert!(x.serverless_neg().is_none());
5058 /// assert!(x.ngfw_packet_inspection().is_none());
5059 /// assert!(x.dms_private_connection().is_none());
5060 /// ```
5061 pub fn set_gke_pod<T: std::convert::Into<std::boxed::Box<crate::model::GkePodInfo>>>(
5062 mut self,
5063 v: T,
5064 ) -> Self {
5065 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::GkePod(v.into()));
5066 self
5067 }
5068
5069 /// The value of [step_info][crate::model::Step::step_info]
5070 /// if it holds a `IpMasqueradingSkipped`, `None` if the field is not set or
5071 /// holds a different branch.
5072 pub fn ip_masquerading_skipped(
5073 &self,
5074 ) -> std::option::Option<&std::boxed::Box<crate::model::IpMasqueradingSkippedInfo>> {
5075 #[allow(unreachable_patterns)]
5076 self.step_info.as_ref().and_then(|v| match v {
5077 crate::model::step::StepInfo::IpMasqueradingSkipped(v) => std::option::Option::Some(v),
5078 _ => std::option::Option::None,
5079 })
5080 }
5081
5082 /// Sets the value of [step_info][crate::model::Step::step_info]
5083 /// to hold a `IpMasqueradingSkipped`.
5084 ///
5085 /// Note that all the setters affecting `step_info` are
5086 /// mutually exclusive.
5087 ///
5088 /// # Example
5089 /// ```ignore,no_run
5090 /// # use google_cloud_networkmanagement_v1::model::Step;
5091 /// use google_cloud_networkmanagement_v1::model::IpMasqueradingSkippedInfo;
5092 /// let x = Step::new().set_ip_masquerading_skipped(IpMasqueradingSkippedInfo::default()/* use setters */);
5093 /// assert!(x.ip_masquerading_skipped().is_some());
5094 /// assert!(x.instance().is_none());
5095 /// assert!(x.firewall().is_none());
5096 /// assert!(x.route().is_none());
5097 /// assert!(x.endpoint().is_none());
5098 /// assert!(x.google_service().is_none());
5099 /// assert!(x.forwarding_rule().is_none());
5100 /// assert!(x.hybrid_subnet().is_none());
5101 /// assert!(x.vpn_gateway().is_none());
5102 /// assert!(x.vpn_tunnel().is_none());
5103 /// assert!(x.interconnect_attachment().is_none());
5104 /// assert!(x.vpc_connector().is_none());
5105 /// assert!(x.direct_vpc_egress_connection().is_none());
5106 /// assert!(x.serverless_external_connection().is_none());
5107 /// assert!(x.deliver().is_none());
5108 /// assert!(x.forward().is_none());
5109 /// assert!(x.abort().is_none());
5110 /// assert!(x.drop().is_none());
5111 /// assert!(x.load_balancer().is_none());
5112 /// assert!(x.network().is_none());
5113 /// assert!(x.gke_master().is_none());
5114 /// assert!(x.gke_pod().is_none());
5115 /// assert!(x.gke_network_policy().is_none());
5116 /// assert!(x.gke_network_policy_skipped().is_none());
5117 /// assert!(x.cloud_sql_instance().is_none());
5118 /// assert!(x.redis_instance().is_none());
5119 /// assert!(x.redis_cluster().is_none());
5120 /// assert!(x.cloud_function().is_none());
5121 /// assert!(x.app_engine_version().is_none());
5122 /// assert!(x.cloud_run_revision().is_none());
5123 /// assert!(x.cloud_run_job().is_none());
5124 /// assert!(x.nat().is_none());
5125 /// assert!(x.proxy_connection().is_none());
5126 /// assert!(x.load_balancer_backend_info().is_none());
5127 /// assert!(x.storage_bucket().is_none());
5128 /// assert!(x.serverless_neg().is_none());
5129 /// assert!(x.ngfw_packet_inspection().is_none());
5130 /// assert!(x.dms_private_connection().is_none());
5131 /// ```
5132 pub fn set_ip_masquerading_skipped<
5133 T: std::convert::Into<std::boxed::Box<crate::model::IpMasqueradingSkippedInfo>>,
5134 >(
5135 mut self,
5136 v: T,
5137 ) -> Self {
5138 self.step_info = std::option::Option::Some(
5139 crate::model::step::StepInfo::IpMasqueradingSkipped(v.into()),
5140 );
5141 self
5142 }
5143
5144 /// The value of [step_info][crate::model::Step::step_info]
5145 /// if it holds a `GkeNetworkPolicy`, `None` if the field is not set or
5146 /// holds a different branch.
5147 pub fn gke_network_policy(
5148 &self,
5149 ) -> std::option::Option<&std::boxed::Box<crate::model::GkeNetworkPolicyInfo>> {
5150 #[allow(unreachable_patterns)]
5151 self.step_info.as_ref().and_then(|v| match v {
5152 crate::model::step::StepInfo::GkeNetworkPolicy(v) => std::option::Option::Some(v),
5153 _ => std::option::Option::None,
5154 })
5155 }
5156
5157 /// Sets the value of [step_info][crate::model::Step::step_info]
5158 /// to hold a `GkeNetworkPolicy`.
5159 ///
5160 /// Note that all the setters affecting `step_info` are
5161 /// mutually exclusive.
5162 ///
5163 /// # Example
5164 /// ```ignore,no_run
5165 /// # use google_cloud_networkmanagement_v1::model::Step;
5166 /// use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
5167 /// let x = Step::new().set_gke_network_policy(GkeNetworkPolicyInfo::default()/* use setters */);
5168 /// assert!(x.gke_network_policy().is_some());
5169 /// assert!(x.instance().is_none());
5170 /// assert!(x.firewall().is_none());
5171 /// assert!(x.route().is_none());
5172 /// assert!(x.endpoint().is_none());
5173 /// assert!(x.google_service().is_none());
5174 /// assert!(x.forwarding_rule().is_none());
5175 /// assert!(x.hybrid_subnet().is_none());
5176 /// assert!(x.vpn_gateway().is_none());
5177 /// assert!(x.vpn_tunnel().is_none());
5178 /// assert!(x.interconnect_attachment().is_none());
5179 /// assert!(x.vpc_connector().is_none());
5180 /// assert!(x.direct_vpc_egress_connection().is_none());
5181 /// assert!(x.serverless_external_connection().is_none());
5182 /// assert!(x.deliver().is_none());
5183 /// assert!(x.forward().is_none());
5184 /// assert!(x.abort().is_none());
5185 /// assert!(x.drop().is_none());
5186 /// assert!(x.load_balancer().is_none());
5187 /// assert!(x.network().is_none());
5188 /// assert!(x.gke_master().is_none());
5189 /// assert!(x.gke_pod().is_none());
5190 /// assert!(x.ip_masquerading_skipped().is_none());
5191 /// assert!(x.gke_network_policy_skipped().is_none());
5192 /// assert!(x.cloud_sql_instance().is_none());
5193 /// assert!(x.redis_instance().is_none());
5194 /// assert!(x.redis_cluster().is_none());
5195 /// assert!(x.cloud_function().is_none());
5196 /// assert!(x.app_engine_version().is_none());
5197 /// assert!(x.cloud_run_revision().is_none());
5198 /// assert!(x.cloud_run_job().is_none());
5199 /// assert!(x.nat().is_none());
5200 /// assert!(x.proxy_connection().is_none());
5201 /// assert!(x.load_balancer_backend_info().is_none());
5202 /// assert!(x.storage_bucket().is_none());
5203 /// assert!(x.serverless_neg().is_none());
5204 /// assert!(x.ngfw_packet_inspection().is_none());
5205 /// assert!(x.dms_private_connection().is_none());
5206 /// ```
5207 pub fn set_gke_network_policy<
5208 T: std::convert::Into<std::boxed::Box<crate::model::GkeNetworkPolicyInfo>>,
5209 >(
5210 mut self,
5211 v: T,
5212 ) -> Self {
5213 self.step_info =
5214 std::option::Option::Some(crate::model::step::StepInfo::GkeNetworkPolicy(v.into()));
5215 self
5216 }
5217
5218 /// The value of [step_info][crate::model::Step::step_info]
5219 /// if it holds a `GkeNetworkPolicySkipped`, `None` if the field is not set or
5220 /// holds a different branch.
5221 pub fn gke_network_policy_skipped(
5222 &self,
5223 ) -> std::option::Option<&std::boxed::Box<crate::model::GkeNetworkPolicySkippedInfo>> {
5224 #[allow(unreachable_patterns)]
5225 self.step_info.as_ref().and_then(|v| match v {
5226 crate::model::step::StepInfo::GkeNetworkPolicySkipped(v) => {
5227 std::option::Option::Some(v)
5228 }
5229 _ => std::option::Option::None,
5230 })
5231 }
5232
5233 /// Sets the value of [step_info][crate::model::Step::step_info]
5234 /// to hold a `GkeNetworkPolicySkipped`.
5235 ///
5236 /// Note that all the setters affecting `step_info` are
5237 /// mutually exclusive.
5238 ///
5239 /// # Example
5240 /// ```ignore,no_run
5241 /// # use google_cloud_networkmanagement_v1::model::Step;
5242 /// use google_cloud_networkmanagement_v1::model::GkeNetworkPolicySkippedInfo;
5243 /// let x = Step::new().set_gke_network_policy_skipped(GkeNetworkPolicySkippedInfo::default()/* use setters */);
5244 /// assert!(x.gke_network_policy_skipped().is_some());
5245 /// assert!(x.instance().is_none());
5246 /// assert!(x.firewall().is_none());
5247 /// assert!(x.route().is_none());
5248 /// assert!(x.endpoint().is_none());
5249 /// assert!(x.google_service().is_none());
5250 /// assert!(x.forwarding_rule().is_none());
5251 /// assert!(x.hybrid_subnet().is_none());
5252 /// assert!(x.vpn_gateway().is_none());
5253 /// assert!(x.vpn_tunnel().is_none());
5254 /// assert!(x.interconnect_attachment().is_none());
5255 /// assert!(x.vpc_connector().is_none());
5256 /// assert!(x.direct_vpc_egress_connection().is_none());
5257 /// assert!(x.serverless_external_connection().is_none());
5258 /// assert!(x.deliver().is_none());
5259 /// assert!(x.forward().is_none());
5260 /// assert!(x.abort().is_none());
5261 /// assert!(x.drop().is_none());
5262 /// assert!(x.load_balancer().is_none());
5263 /// assert!(x.network().is_none());
5264 /// assert!(x.gke_master().is_none());
5265 /// assert!(x.gke_pod().is_none());
5266 /// assert!(x.ip_masquerading_skipped().is_none());
5267 /// assert!(x.gke_network_policy().is_none());
5268 /// assert!(x.cloud_sql_instance().is_none());
5269 /// assert!(x.redis_instance().is_none());
5270 /// assert!(x.redis_cluster().is_none());
5271 /// assert!(x.cloud_function().is_none());
5272 /// assert!(x.app_engine_version().is_none());
5273 /// assert!(x.cloud_run_revision().is_none());
5274 /// assert!(x.cloud_run_job().is_none());
5275 /// assert!(x.nat().is_none());
5276 /// assert!(x.proxy_connection().is_none());
5277 /// assert!(x.load_balancer_backend_info().is_none());
5278 /// assert!(x.storage_bucket().is_none());
5279 /// assert!(x.serverless_neg().is_none());
5280 /// assert!(x.ngfw_packet_inspection().is_none());
5281 /// assert!(x.dms_private_connection().is_none());
5282 /// ```
5283 pub fn set_gke_network_policy_skipped<
5284 T: std::convert::Into<std::boxed::Box<crate::model::GkeNetworkPolicySkippedInfo>>,
5285 >(
5286 mut self,
5287 v: T,
5288 ) -> Self {
5289 self.step_info = std::option::Option::Some(
5290 crate::model::step::StepInfo::GkeNetworkPolicySkipped(v.into()),
5291 );
5292 self
5293 }
5294
5295 /// The value of [step_info][crate::model::Step::step_info]
5296 /// if it holds a `CloudSqlInstance`, `None` if the field is not set or
5297 /// holds a different branch.
5298 pub fn cloud_sql_instance(
5299 &self,
5300 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudSQLInstanceInfo>> {
5301 #[allow(unreachable_patterns)]
5302 self.step_info.as_ref().and_then(|v| match v {
5303 crate::model::step::StepInfo::CloudSqlInstance(v) => std::option::Option::Some(v),
5304 _ => std::option::Option::None,
5305 })
5306 }
5307
5308 /// Sets the value of [step_info][crate::model::Step::step_info]
5309 /// to hold a `CloudSqlInstance`.
5310 ///
5311 /// Note that all the setters affecting `step_info` are
5312 /// mutually exclusive.
5313 ///
5314 /// # Example
5315 /// ```ignore,no_run
5316 /// # use google_cloud_networkmanagement_v1::model::Step;
5317 /// use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
5318 /// let x = Step::new().set_cloud_sql_instance(CloudSQLInstanceInfo::default()/* use setters */);
5319 /// assert!(x.cloud_sql_instance().is_some());
5320 /// assert!(x.instance().is_none());
5321 /// assert!(x.firewall().is_none());
5322 /// assert!(x.route().is_none());
5323 /// assert!(x.endpoint().is_none());
5324 /// assert!(x.google_service().is_none());
5325 /// assert!(x.forwarding_rule().is_none());
5326 /// assert!(x.hybrid_subnet().is_none());
5327 /// assert!(x.vpn_gateway().is_none());
5328 /// assert!(x.vpn_tunnel().is_none());
5329 /// assert!(x.interconnect_attachment().is_none());
5330 /// assert!(x.vpc_connector().is_none());
5331 /// assert!(x.direct_vpc_egress_connection().is_none());
5332 /// assert!(x.serverless_external_connection().is_none());
5333 /// assert!(x.deliver().is_none());
5334 /// assert!(x.forward().is_none());
5335 /// assert!(x.abort().is_none());
5336 /// assert!(x.drop().is_none());
5337 /// assert!(x.load_balancer().is_none());
5338 /// assert!(x.network().is_none());
5339 /// assert!(x.gke_master().is_none());
5340 /// assert!(x.gke_pod().is_none());
5341 /// assert!(x.ip_masquerading_skipped().is_none());
5342 /// assert!(x.gke_network_policy().is_none());
5343 /// assert!(x.gke_network_policy_skipped().is_none());
5344 /// assert!(x.redis_instance().is_none());
5345 /// assert!(x.redis_cluster().is_none());
5346 /// assert!(x.cloud_function().is_none());
5347 /// assert!(x.app_engine_version().is_none());
5348 /// assert!(x.cloud_run_revision().is_none());
5349 /// assert!(x.cloud_run_job().is_none());
5350 /// assert!(x.nat().is_none());
5351 /// assert!(x.proxy_connection().is_none());
5352 /// assert!(x.load_balancer_backend_info().is_none());
5353 /// assert!(x.storage_bucket().is_none());
5354 /// assert!(x.serverless_neg().is_none());
5355 /// assert!(x.ngfw_packet_inspection().is_none());
5356 /// assert!(x.dms_private_connection().is_none());
5357 /// ```
5358 pub fn set_cloud_sql_instance<
5359 T: std::convert::Into<std::boxed::Box<crate::model::CloudSQLInstanceInfo>>,
5360 >(
5361 mut self,
5362 v: T,
5363 ) -> Self {
5364 self.step_info =
5365 std::option::Option::Some(crate::model::step::StepInfo::CloudSqlInstance(v.into()));
5366 self
5367 }
5368
5369 /// The value of [step_info][crate::model::Step::step_info]
5370 /// if it holds a `RedisInstance`, `None` if the field is not set or
5371 /// holds a different branch.
5372 pub fn redis_instance(
5373 &self,
5374 ) -> std::option::Option<&std::boxed::Box<crate::model::RedisInstanceInfo>> {
5375 #[allow(unreachable_patterns)]
5376 self.step_info.as_ref().and_then(|v| match v {
5377 crate::model::step::StepInfo::RedisInstance(v) => std::option::Option::Some(v),
5378 _ => std::option::Option::None,
5379 })
5380 }
5381
5382 /// Sets the value of [step_info][crate::model::Step::step_info]
5383 /// to hold a `RedisInstance`.
5384 ///
5385 /// Note that all the setters affecting `step_info` are
5386 /// mutually exclusive.
5387 ///
5388 /// # Example
5389 /// ```ignore,no_run
5390 /// # use google_cloud_networkmanagement_v1::model::Step;
5391 /// use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
5392 /// let x = Step::new().set_redis_instance(RedisInstanceInfo::default()/* use setters */);
5393 /// assert!(x.redis_instance().is_some());
5394 /// assert!(x.instance().is_none());
5395 /// assert!(x.firewall().is_none());
5396 /// assert!(x.route().is_none());
5397 /// assert!(x.endpoint().is_none());
5398 /// assert!(x.google_service().is_none());
5399 /// assert!(x.forwarding_rule().is_none());
5400 /// assert!(x.hybrid_subnet().is_none());
5401 /// assert!(x.vpn_gateway().is_none());
5402 /// assert!(x.vpn_tunnel().is_none());
5403 /// assert!(x.interconnect_attachment().is_none());
5404 /// assert!(x.vpc_connector().is_none());
5405 /// assert!(x.direct_vpc_egress_connection().is_none());
5406 /// assert!(x.serverless_external_connection().is_none());
5407 /// assert!(x.deliver().is_none());
5408 /// assert!(x.forward().is_none());
5409 /// assert!(x.abort().is_none());
5410 /// assert!(x.drop().is_none());
5411 /// assert!(x.load_balancer().is_none());
5412 /// assert!(x.network().is_none());
5413 /// assert!(x.gke_master().is_none());
5414 /// assert!(x.gke_pod().is_none());
5415 /// assert!(x.ip_masquerading_skipped().is_none());
5416 /// assert!(x.gke_network_policy().is_none());
5417 /// assert!(x.gke_network_policy_skipped().is_none());
5418 /// assert!(x.cloud_sql_instance().is_none());
5419 /// assert!(x.redis_cluster().is_none());
5420 /// assert!(x.cloud_function().is_none());
5421 /// assert!(x.app_engine_version().is_none());
5422 /// assert!(x.cloud_run_revision().is_none());
5423 /// assert!(x.cloud_run_job().is_none());
5424 /// assert!(x.nat().is_none());
5425 /// assert!(x.proxy_connection().is_none());
5426 /// assert!(x.load_balancer_backend_info().is_none());
5427 /// assert!(x.storage_bucket().is_none());
5428 /// assert!(x.serverless_neg().is_none());
5429 /// assert!(x.ngfw_packet_inspection().is_none());
5430 /// assert!(x.dms_private_connection().is_none());
5431 /// ```
5432 pub fn set_redis_instance<
5433 T: std::convert::Into<std::boxed::Box<crate::model::RedisInstanceInfo>>,
5434 >(
5435 mut self,
5436 v: T,
5437 ) -> Self {
5438 self.step_info =
5439 std::option::Option::Some(crate::model::step::StepInfo::RedisInstance(v.into()));
5440 self
5441 }
5442
5443 /// The value of [step_info][crate::model::Step::step_info]
5444 /// if it holds a `RedisCluster`, `None` if the field is not set or
5445 /// holds a different branch.
5446 pub fn redis_cluster(
5447 &self,
5448 ) -> std::option::Option<&std::boxed::Box<crate::model::RedisClusterInfo>> {
5449 #[allow(unreachable_patterns)]
5450 self.step_info.as_ref().and_then(|v| match v {
5451 crate::model::step::StepInfo::RedisCluster(v) => std::option::Option::Some(v),
5452 _ => std::option::Option::None,
5453 })
5454 }
5455
5456 /// Sets the value of [step_info][crate::model::Step::step_info]
5457 /// to hold a `RedisCluster`.
5458 ///
5459 /// Note that all the setters affecting `step_info` are
5460 /// mutually exclusive.
5461 ///
5462 /// # Example
5463 /// ```ignore,no_run
5464 /// # use google_cloud_networkmanagement_v1::model::Step;
5465 /// use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
5466 /// let x = Step::new().set_redis_cluster(RedisClusterInfo::default()/* use setters */);
5467 /// assert!(x.redis_cluster().is_some());
5468 /// assert!(x.instance().is_none());
5469 /// assert!(x.firewall().is_none());
5470 /// assert!(x.route().is_none());
5471 /// assert!(x.endpoint().is_none());
5472 /// assert!(x.google_service().is_none());
5473 /// assert!(x.forwarding_rule().is_none());
5474 /// assert!(x.hybrid_subnet().is_none());
5475 /// assert!(x.vpn_gateway().is_none());
5476 /// assert!(x.vpn_tunnel().is_none());
5477 /// assert!(x.interconnect_attachment().is_none());
5478 /// assert!(x.vpc_connector().is_none());
5479 /// assert!(x.direct_vpc_egress_connection().is_none());
5480 /// assert!(x.serverless_external_connection().is_none());
5481 /// assert!(x.deliver().is_none());
5482 /// assert!(x.forward().is_none());
5483 /// assert!(x.abort().is_none());
5484 /// assert!(x.drop().is_none());
5485 /// assert!(x.load_balancer().is_none());
5486 /// assert!(x.network().is_none());
5487 /// assert!(x.gke_master().is_none());
5488 /// assert!(x.gke_pod().is_none());
5489 /// assert!(x.ip_masquerading_skipped().is_none());
5490 /// assert!(x.gke_network_policy().is_none());
5491 /// assert!(x.gke_network_policy_skipped().is_none());
5492 /// assert!(x.cloud_sql_instance().is_none());
5493 /// assert!(x.redis_instance().is_none());
5494 /// assert!(x.cloud_function().is_none());
5495 /// assert!(x.app_engine_version().is_none());
5496 /// assert!(x.cloud_run_revision().is_none());
5497 /// assert!(x.cloud_run_job().is_none());
5498 /// assert!(x.nat().is_none());
5499 /// assert!(x.proxy_connection().is_none());
5500 /// assert!(x.load_balancer_backend_info().is_none());
5501 /// assert!(x.storage_bucket().is_none());
5502 /// assert!(x.serverless_neg().is_none());
5503 /// assert!(x.ngfw_packet_inspection().is_none());
5504 /// assert!(x.dms_private_connection().is_none());
5505 /// ```
5506 pub fn set_redis_cluster<
5507 T: std::convert::Into<std::boxed::Box<crate::model::RedisClusterInfo>>,
5508 >(
5509 mut self,
5510 v: T,
5511 ) -> Self {
5512 self.step_info =
5513 std::option::Option::Some(crate::model::step::StepInfo::RedisCluster(v.into()));
5514 self
5515 }
5516
5517 /// The value of [step_info][crate::model::Step::step_info]
5518 /// if it holds a `CloudFunction`, `None` if the field is not set or
5519 /// holds a different branch.
5520 pub fn cloud_function(
5521 &self,
5522 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudFunctionInfo>> {
5523 #[allow(unreachable_patterns)]
5524 self.step_info.as_ref().and_then(|v| match v {
5525 crate::model::step::StepInfo::CloudFunction(v) => std::option::Option::Some(v),
5526 _ => std::option::Option::None,
5527 })
5528 }
5529
5530 /// Sets the value of [step_info][crate::model::Step::step_info]
5531 /// to hold a `CloudFunction`.
5532 ///
5533 /// Note that all the setters affecting `step_info` are
5534 /// mutually exclusive.
5535 ///
5536 /// # Example
5537 /// ```ignore,no_run
5538 /// # use google_cloud_networkmanagement_v1::model::Step;
5539 /// use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
5540 /// let x = Step::new().set_cloud_function(CloudFunctionInfo::default()/* use setters */);
5541 /// assert!(x.cloud_function().is_some());
5542 /// assert!(x.instance().is_none());
5543 /// assert!(x.firewall().is_none());
5544 /// assert!(x.route().is_none());
5545 /// assert!(x.endpoint().is_none());
5546 /// assert!(x.google_service().is_none());
5547 /// assert!(x.forwarding_rule().is_none());
5548 /// assert!(x.hybrid_subnet().is_none());
5549 /// assert!(x.vpn_gateway().is_none());
5550 /// assert!(x.vpn_tunnel().is_none());
5551 /// assert!(x.interconnect_attachment().is_none());
5552 /// assert!(x.vpc_connector().is_none());
5553 /// assert!(x.direct_vpc_egress_connection().is_none());
5554 /// assert!(x.serverless_external_connection().is_none());
5555 /// assert!(x.deliver().is_none());
5556 /// assert!(x.forward().is_none());
5557 /// assert!(x.abort().is_none());
5558 /// assert!(x.drop().is_none());
5559 /// assert!(x.load_balancer().is_none());
5560 /// assert!(x.network().is_none());
5561 /// assert!(x.gke_master().is_none());
5562 /// assert!(x.gke_pod().is_none());
5563 /// assert!(x.ip_masquerading_skipped().is_none());
5564 /// assert!(x.gke_network_policy().is_none());
5565 /// assert!(x.gke_network_policy_skipped().is_none());
5566 /// assert!(x.cloud_sql_instance().is_none());
5567 /// assert!(x.redis_instance().is_none());
5568 /// assert!(x.redis_cluster().is_none());
5569 /// assert!(x.app_engine_version().is_none());
5570 /// assert!(x.cloud_run_revision().is_none());
5571 /// assert!(x.cloud_run_job().is_none());
5572 /// assert!(x.nat().is_none());
5573 /// assert!(x.proxy_connection().is_none());
5574 /// assert!(x.load_balancer_backend_info().is_none());
5575 /// assert!(x.storage_bucket().is_none());
5576 /// assert!(x.serverless_neg().is_none());
5577 /// assert!(x.ngfw_packet_inspection().is_none());
5578 /// assert!(x.dms_private_connection().is_none());
5579 /// ```
5580 pub fn set_cloud_function<
5581 T: std::convert::Into<std::boxed::Box<crate::model::CloudFunctionInfo>>,
5582 >(
5583 mut self,
5584 v: T,
5585 ) -> Self {
5586 self.step_info =
5587 std::option::Option::Some(crate::model::step::StepInfo::CloudFunction(v.into()));
5588 self
5589 }
5590
5591 /// The value of [step_info][crate::model::Step::step_info]
5592 /// if it holds a `AppEngineVersion`, `None` if the field is not set or
5593 /// holds a different branch.
5594 pub fn app_engine_version(
5595 &self,
5596 ) -> std::option::Option<&std::boxed::Box<crate::model::AppEngineVersionInfo>> {
5597 #[allow(unreachable_patterns)]
5598 self.step_info.as_ref().and_then(|v| match v {
5599 crate::model::step::StepInfo::AppEngineVersion(v) => std::option::Option::Some(v),
5600 _ => std::option::Option::None,
5601 })
5602 }
5603
5604 /// Sets the value of [step_info][crate::model::Step::step_info]
5605 /// to hold a `AppEngineVersion`.
5606 ///
5607 /// Note that all the setters affecting `step_info` are
5608 /// mutually exclusive.
5609 ///
5610 /// # Example
5611 /// ```ignore,no_run
5612 /// # use google_cloud_networkmanagement_v1::model::Step;
5613 /// use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
5614 /// let x = Step::new().set_app_engine_version(AppEngineVersionInfo::default()/* use setters */);
5615 /// assert!(x.app_engine_version().is_some());
5616 /// assert!(x.instance().is_none());
5617 /// assert!(x.firewall().is_none());
5618 /// assert!(x.route().is_none());
5619 /// assert!(x.endpoint().is_none());
5620 /// assert!(x.google_service().is_none());
5621 /// assert!(x.forwarding_rule().is_none());
5622 /// assert!(x.hybrid_subnet().is_none());
5623 /// assert!(x.vpn_gateway().is_none());
5624 /// assert!(x.vpn_tunnel().is_none());
5625 /// assert!(x.interconnect_attachment().is_none());
5626 /// assert!(x.vpc_connector().is_none());
5627 /// assert!(x.direct_vpc_egress_connection().is_none());
5628 /// assert!(x.serverless_external_connection().is_none());
5629 /// assert!(x.deliver().is_none());
5630 /// assert!(x.forward().is_none());
5631 /// assert!(x.abort().is_none());
5632 /// assert!(x.drop().is_none());
5633 /// assert!(x.load_balancer().is_none());
5634 /// assert!(x.network().is_none());
5635 /// assert!(x.gke_master().is_none());
5636 /// assert!(x.gke_pod().is_none());
5637 /// assert!(x.ip_masquerading_skipped().is_none());
5638 /// assert!(x.gke_network_policy().is_none());
5639 /// assert!(x.gke_network_policy_skipped().is_none());
5640 /// assert!(x.cloud_sql_instance().is_none());
5641 /// assert!(x.redis_instance().is_none());
5642 /// assert!(x.redis_cluster().is_none());
5643 /// assert!(x.cloud_function().is_none());
5644 /// assert!(x.cloud_run_revision().is_none());
5645 /// assert!(x.cloud_run_job().is_none());
5646 /// assert!(x.nat().is_none());
5647 /// assert!(x.proxy_connection().is_none());
5648 /// assert!(x.load_balancer_backend_info().is_none());
5649 /// assert!(x.storage_bucket().is_none());
5650 /// assert!(x.serverless_neg().is_none());
5651 /// assert!(x.ngfw_packet_inspection().is_none());
5652 /// assert!(x.dms_private_connection().is_none());
5653 /// ```
5654 pub fn set_app_engine_version<
5655 T: std::convert::Into<std::boxed::Box<crate::model::AppEngineVersionInfo>>,
5656 >(
5657 mut self,
5658 v: T,
5659 ) -> Self {
5660 self.step_info =
5661 std::option::Option::Some(crate::model::step::StepInfo::AppEngineVersion(v.into()));
5662 self
5663 }
5664
5665 /// The value of [step_info][crate::model::Step::step_info]
5666 /// if it holds a `CloudRunRevision`, `None` if the field is not set or
5667 /// holds a different branch.
5668 pub fn cloud_run_revision(
5669 &self,
5670 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunRevisionInfo>> {
5671 #[allow(unreachable_patterns)]
5672 self.step_info.as_ref().and_then(|v| match v {
5673 crate::model::step::StepInfo::CloudRunRevision(v) => std::option::Option::Some(v),
5674 _ => std::option::Option::None,
5675 })
5676 }
5677
5678 /// Sets the value of [step_info][crate::model::Step::step_info]
5679 /// to hold a `CloudRunRevision`.
5680 ///
5681 /// Note that all the setters affecting `step_info` are
5682 /// mutually exclusive.
5683 ///
5684 /// # Example
5685 /// ```ignore,no_run
5686 /// # use google_cloud_networkmanagement_v1::model::Step;
5687 /// use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
5688 /// let x = Step::new().set_cloud_run_revision(CloudRunRevisionInfo::default()/* use setters */);
5689 /// assert!(x.cloud_run_revision().is_some());
5690 /// assert!(x.instance().is_none());
5691 /// assert!(x.firewall().is_none());
5692 /// assert!(x.route().is_none());
5693 /// assert!(x.endpoint().is_none());
5694 /// assert!(x.google_service().is_none());
5695 /// assert!(x.forwarding_rule().is_none());
5696 /// assert!(x.hybrid_subnet().is_none());
5697 /// assert!(x.vpn_gateway().is_none());
5698 /// assert!(x.vpn_tunnel().is_none());
5699 /// assert!(x.interconnect_attachment().is_none());
5700 /// assert!(x.vpc_connector().is_none());
5701 /// assert!(x.direct_vpc_egress_connection().is_none());
5702 /// assert!(x.serverless_external_connection().is_none());
5703 /// assert!(x.deliver().is_none());
5704 /// assert!(x.forward().is_none());
5705 /// assert!(x.abort().is_none());
5706 /// assert!(x.drop().is_none());
5707 /// assert!(x.load_balancer().is_none());
5708 /// assert!(x.network().is_none());
5709 /// assert!(x.gke_master().is_none());
5710 /// assert!(x.gke_pod().is_none());
5711 /// assert!(x.ip_masquerading_skipped().is_none());
5712 /// assert!(x.gke_network_policy().is_none());
5713 /// assert!(x.gke_network_policy_skipped().is_none());
5714 /// assert!(x.cloud_sql_instance().is_none());
5715 /// assert!(x.redis_instance().is_none());
5716 /// assert!(x.redis_cluster().is_none());
5717 /// assert!(x.cloud_function().is_none());
5718 /// assert!(x.app_engine_version().is_none());
5719 /// assert!(x.cloud_run_job().is_none());
5720 /// assert!(x.nat().is_none());
5721 /// assert!(x.proxy_connection().is_none());
5722 /// assert!(x.load_balancer_backend_info().is_none());
5723 /// assert!(x.storage_bucket().is_none());
5724 /// assert!(x.serverless_neg().is_none());
5725 /// assert!(x.ngfw_packet_inspection().is_none());
5726 /// assert!(x.dms_private_connection().is_none());
5727 /// ```
5728 pub fn set_cloud_run_revision<
5729 T: std::convert::Into<std::boxed::Box<crate::model::CloudRunRevisionInfo>>,
5730 >(
5731 mut self,
5732 v: T,
5733 ) -> Self {
5734 self.step_info =
5735 std::option::Option::Some(crate::model::step::StepInfo::CloudRunRevision(v.into()));
5736 self
5737 }
5738
5739 /// The value of [step_info][crate::model::Step::step_info]
5740 /// if it holds a `CloudRunJob`, `None` if the field is not set or
5741 /// holds a different branch.
5742 pub fn cloud_run_job(
5743 &self,
5744 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunJobInfo>> {
5745 #[allow(unreachable_patterns)]
5746 self.step_info.as_ref().and_then(|v| match v {
5747 crate::model::step::StepInfo::CloudRunJob(v) => std::option::Option::Some(v),
5748 _ => std::option::Option::None,
5749 })
5750 }
5751
5752 /// Sets the value of [step_info][crate::model::Step::step_info]
5753 /// to hold a `CloudRunJob`.
5754 ///
5755 /// Note that all the setters affecting `step_info` are
5756 /// mutually exclusive.
5757 ///
5758 /// # Example
5759 /// ```ignore,no_run
5760 /// # use google_cloud_networkmanagement_v1::model::Step;
5761 /// use google_cloud_networkmanagement_v1::model::CloudRunJobInfo;
5762 /// let x = Step::new().set_cloud_run_job(CloudRunJobInfo::default()/* use setters */);
5763 /// assert!(x.cloud_run_job().is_some());
5764 /// assert!(x.instance().is_none());
5765 /// assert!(x.firewall().is_none());
5766 /// assert!(x.route().is_none());
5767 /// assert!(x.endpoint().is_none());
5768 /// assert!(x.google_service().is_none());
5769 /// assert!(x.forwarding_rule().is_none());
5770 /// assert!(x.hybrid_subnet().is_none());
5771 /// assert!(x.vpn_gateway().is_none());
5772 /// assert!(x.vpn_tunnel().is_none());
5773 /// assert!(x.interconnect_attachment().is_none());
5774 /// assert!(x.vpc_connector().is_none());
5775 /// assert!(x.direct_vpc_egress_connection().is_none());
5776 /// assert!(x.serverless_external_connection().is_none());
5777 /// assert!(x.deliver().is_none());
5778 /// assert!(x.forward().is_none());
5779 /// assert!(x.abort().is_none());
5780 /// assert!(x.drop().is_none());
5781 /// assert!(x.load_balancer().is_none());
5782 /// assert!(x.network().is_none());
5783 /// assert!(x.gke_master().is_none());
5784 /// assert!(x.gke_pod().is_none());
5785 /// assert!(x.ip_masquerading_skipped().is_none());
5786 /// assert!(x.gke_network_policy().is_none());
5787 /// assert!(x.gke_network_policy_skipped().is_none());
5788 /// assert!(x.cloud_sql_instance().is_none());
5789 /// assert!(x.redis_instance().is_none());
5790 /// assert!(x.redis_cluster().is_none());
5791 /// assert!(x.cloud_function().is_none());
5792 /// assert!(x.app_engine_version().is_none());
5793 /// assert!(x.cloud_run_revision().is_none());
5794 /// assert!(x.nat().is_none());
5795 /// assert!(x.proxy_connection().is_none());
5796 /// assert!(x.load_balancer_backend_info().is_none());
5797 /// assert!(x.storage_bucket().is_none());
5798 /// assert!(x.serverless_neg().is_none());
5799 /// assert!(x.ngfw_packet_inspection().is_none());
5800 /// assert!(x.dms_private_connection().is_none());
5801 /// ```
5802 pub fn set_cloud_run_job<
5803 T: std::convert::Into<std::boxed::Box<crate::model::CloudRunJobInfo>>,
5804 >(
5805 mut self,
5806 v: T,
5807 ) -> Self {
5808 self.step_info =
5809 std::option::Option::Some(crate::model::step::StepInfo::CloudRunJob(v.into()));
5810 self
5811 }
5812
5813 /// The value of [step_info][crate::model::Step::step_info]
5814 /// if it holds a `Nat`, `None` if the field is not set or
5815 /// holds a different branch.
5816 pub fn nat(&self) -> std::option::Option<&std::boxed::Box<crate::model::NatInfo>> {
5817 #[allow(unreachable_patterns)]
5818 self.step_info.as_ref().and_then(|v| match v {
5819 crate::model::step::StepInfo::Nat(v) => std::option::Option::Some(v),
5820 _ => std::option::Option::None,
5821 })
5822 }
5823
5824 /// Sets the value of [step_info][crate::model::Step::step_info]
5825 /// to hold a `Nat`.
5826 ///
5827 /// Note that all the setters affecting `step_info` are
5828 /// mutually exclusive.
5829 ///
5830 /// # Example
5831 /// ```ignore,no_run
5832 /// # use google_cloud_networkmanagement_v1::model::Step;
5833 /// use google_cloud_networkmanagement_v1::model::NatInfo;
5834 /// let x = Step::new().set_nat(NatInfo::default()/* use setters */);
5835 /// assert!(x.nat().is_some());
5836 /// assert!(x.instance().is_none());
5837 /// assert!(x.firewall().is_none());
5838 /// assert!(x.route().is_none());
5839 /// assert!(x.endpoint().is_none());
5840 /// assert!(x.google_service().is_none());
5841 /// assert!(x.forwarding_rule().is_none());
5842 /// assert!(x.hybrid_subnet().is_none());
5843 /// assert!(x.vpn_gateway().is_none());
5844 /// assert!(x.vpn_tunnel().is_none());
5845 /// assert!(x.interconnect_attachment().is_none());
5846 /// assert!(x.vpc_connector().is_none());
5847 /// assert!(x.direct_vpc_egress_connection().is_none());
5848 /// assert!(x.serverless_external_connection().is_none());
5849 /// assert!(x.deliver().is_none());
5850 /// assert!(x.forward().is_none());
5851 /// assert!(x.abort().is_none());
5852 /// assert!(x.drop().is_none());
5853 /// assert!(x.load_balancer().is_none());
5854 /// assert!(x.network().is_none());
5855 /// assert!(x.gke_master().is_none());
5856 /// assert!(x.gke_pod().is_none());
5857 /// assert!(x.ip_masquerading_skipped().is_none());
5858 /// assert!(x.gke_network_policy().is_none());
5859 /// assert!(x.gke_network_policy_skipped().is_none());
5860 /// assert!(x.cloud_sql_instance().is_none());
5861 /// assert!(x.redis_instance().is_none());
5862 /// assert!(x.redis_cluster().is_none());
5863 /// assert!(x.cloud_function().is_none());
5864 /// assert!(x.app_engine_version().is_none());
5865 /// assert!(x.cloud_run_revision().is_none());
5866 /// assert!(x.cloud_run_job().is_none());
5867 /// assert!(x.proxy_connection().is_none());
5868 /// assert!(x.load_balancer_backend_info().is_none());
5869 /// assert!(x.storage_bucket().is_none());
5870 /// assert!(x.serverless_neg().is_none());
5871 /// assert!(x.ngfw_packet_inspection().is_none());
5872 /// assert!(x.dms_private_connection().is_none());
5873 /// ```
5874 pub fn set_nat<T: std::convert::Into<std::boxed::Box<crate::model::NatInfo>>>(
5875 mut self,
5876 v: T,
5877 ) -> Self {
5878 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Nat(v.into()));
5879 self
5880 }
5881
5882 /// The value of [step_info][crate::model::Step::step_info]
5883 /// if it holds a `ProxyConnection`, `None` if the field is not set or
5884 /// holds a different branch.
5885 pub fn proxy_connection(
5886 &self,
5887 ) -> std::option::Option<&std::boxed::Box<crate::model::ProxyConnectionInfo>> {
5888 #[allow(unreachable_patterns)]
5889 self.step_info.as_ref().and_then(|v| match v {
5890 crate::model::step::StepInfo::ProxyConnection(v) => std::option::Option::Some(v),
5891 _ => std::option::Option::None,
5892 })
5893 }
5894
5895 /// Sets the value of [step_info][crate::model::Step::step_info]
5896 /// to hold a `ProxyConnection`.
5897 ///
5898 /// Note that all the setters affecting `step_info` are
5899 /// mutually exclusive.
5900 ///
5901 /// # Example
5902 /// ```ignore,no_run
5903 /// # use google_cloud_networkmanagement_v1::model::Step;
5904 /// use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
5905 /// let x = Step::new().set_proxy_connection(ProxyConnectionInfo::default()/* use setters */);
5906 /// assert!(x.proxy_connection().is_some());
5907 /// assert!(x.instance().is_none());
5908 /// assert!(x.firewall().is_none());
5909 /// assert!(x.route().is_none());
5910 /// assert!(x.endpoint().is_none());
5911 /// assert!(x.google_service().is_none());
5912 /// assert!(x.forwarding_rule().is_none());
5913 /// assert!(x.hybrid_subnet().is_none());
5914 /// assert!(x.vpn_gateway().is_none());
5915 /// assert!(x.vpn_tunnel().is_none());
5916 /// assert!(x.interconnect_attachment().is_none());
5917 /// assert!(x.vpc_connector().is_none());
5918 /// assert!(x.direct_vpc_egress_connection().is_none());
5919 /// assert!(x.serverless_external_connection().is_none());
5920 /// assert!(x.deliver().is_none());
5921 /// assert!(x.forward().is_none());
5922 /// assert!(x.abort().is_none());
5923 /// assert!(x.drop().is_none());
5924 /// assert!(x.load_balancer().is_none());
5925 /// assert!(x.network().is_none());
5926 /// assert!(x.gke_master().is_none());
5927 /// assert!(x.gke_pod().is_none());
5928 /// assert!(x.ip_masquerading_skipped().is_none());
5929 /// assert!(x.gke_network_policy().is_none());
5930 /// assert!(x.gke_network_policy_skipped().is_none());
5931 /// assert!(x.cloud_sql_instance().is_none());
5932 /// assert!(x.redis_instance().is_none());
5933 /// assert!(x.redis_cluster().is_none());
5934 /// assert!(x.cloud_function().is_none());
5935 /// assert!(x.app_engine_version().is_none());
5936 /// assert!(x.cloud_run_revision().is_none());
5937 /// assert!(x.cloud_run_job().is_none());
5938 /// assert!(x.nat().is_none());
5939 /// assert!(x.load_balancer_backend_info().is_none());
5940 /// assert!(x.storage_bucket().is_none());
5941 /// assert!(x.serverless_neg().is_none());
5942 /// assert!(x.ngfw_packet_inspection().is_none());
5943 /// assert!(x.dms_private_connection().is_none());
5944 /// ```
5945 pub fn set_proxy_connection<
5946 T: std::convert::Into<std::boxed::Box<crate::model::ProxyConnectionInfo>>,
5947 >(
5948 mut self,
5949 v: T,
5950 ) -> Self {
5951 self.step_info =
5952 std::option::Option::Some(crate::model::step::StepInfo::ProxyConnection(v.into()));
5953 self
5954 }
5955
5956 /// The value of [step_info][crate::model::Step::step_info]
5957 /// if it holds a `LoadBalancerBackendInfo`, `None` if the field is not set or
5958 /// holds a different branch.
5959 pub fn load_balancer_backend_info(
5960 &self,
5961 ) -> std::option::Option<&std::boxed::Box<crate::model::LoadBalancerBackendInfo>> {
5962 #[allow(unreachable_patterns)]
5963 self.step_info.as_ref().and_then(|v| match v {
5964 crate::model::step::StepInfo::LoadBalancerBackendInfo(v) => {
5965 std::option::Option::Some(v)
5966 }
5967 _ => std::option::Option::None,
5968 })
5969 }
5970
5971 /// Sets the value of [step_info][crate::model::Step::step_info]
5972 /// to hold a `LoadBalancerBackendInfo`.
5973 ///
5974 /// Note that all the setters affecting `step_info` are
5975 /// mutually exclusive.
5976 ///
5977 /// # Example
5978 /// ```ignore,no_run
5979 /// # use google_cloud_networkmanagement_v1::model::Step;
5980 /// use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
5981 /// let x = Step::new().set_load_balancer_backend_info(LoadBalancerBackendInfo::default()/* use setters */);
5982 /// assert!(x.load_balancer_backend_info().is_some());
5983 /// assert!(x.instance().is_none());
5984 /// assert!(x.firewall().is_none());
5985 /// assert!(x.route().is_none());
5986 /// assert!(x.endpoint().is_none());
5987 /// assert!(x.google_service().is_none());
5988 /// assert!(x.forwarding_rule().is_none());
5989 /// assert!(x.hybrid_subnet().is_none());
5990 /// assert!(x.vpn_gateway().is_none());
5991 /// assert!(x.vpn_tunnel().is_none());
5992 /// assert!(x.interconnect_attachment().is_none());
5993 /// assert!(x.vpc_connector().is_none());
5994 /// assert!(x.direct_vpc_egress_connection().is_none());
5995 /// assert!(x.serverless_external_connection().is_none());
5996 /// assert!(x.deliver().is_none());
5997 /// assert!(x.forward().is_none());
5998 /// assert!(x.abort().is_none());
5999 /// assert!(x.drop().is_none());
6000 /// assert!(x.load_balancer().is_none());
6001 /// assert!(x.network().is_none());
6002 /// assert!(x.gke_master().is_none());
6003 /// assert!(x.gke_pod().is_none());
6004 /// assert!(x.ip_masquerading_skipped().is_none());
6005 /// assert!(x.gke_network_policy().is_none());
6006 /// assert!(x.gke_network_policy_skipped().is_none());
6007 /// assert!(x.cloud_sql_instance().is_none());
6008 /// assert!(x.redis_instance().is_none());
6009 /// assert!(x.redis_cluster().is_none());
6010 /// assert!(x.cloud_function().is_none());
6011 /// assert!(x.app_engine_version().is_none());
6012 /// assert!(x.cloud_run_revision().is_none());
6013 /// assert!(x.cloud_run_job().is_none());
6014 /// assert!(x.nat().is_none());
6015 /// assert!(x.proxy_connection().is_none());
6016 /// assert!(x.storage_bucket().is_none());
6017 /// assert!(x.serverless_neg().is_none());
6018 /// assert!(x.ngfw_packet_inspection().is_none());
6019 /// assert!(x.dms_private_connection().is_none());
6020 /// ```
6021 pub fn set_load_balancer_backend_info<
6022 T: std::convert::Into<std::boxed::Box<crate::model::LoadBalancerBackendInfo>>,
6023 >(
6024 mut self,
6025 v: T,
6026 ) -> Self {
6027 self.step_info = std::option::Option::Some(
6028 crate::model::step::StepInfo::LoadBalancerBackendInfo(v.into()),
6029 );
6030 self
6031 }
6032
6033 /// The value of [step_info][crate::model::Step::step_info]
6034 /// if it holds a `StorageBucket`, `None` if the field is not set or
6035 /// holds a different branch.
6036 pub fn storage_bucket(
6037 &self,
6038 ) -> std::option::Option<&std::boxed::Box<crate::model::StorageBucketInfo>> {
6039 #[allow(unreachable_patterns)]
6040 self.step_info.as_ref().and_then(|v| match v {
6041 crate::model::step::StepInfo::StorageBucket(v) => std::option::Option::Some(v),
6042 _ => std::option::Option::None,
6043 })
6044 }
6045
6046 /// Sets the value of [step_info][crate::model::Step::step_info]
6047 /// to hold a `StorageBucket`.
6048 ///
6049 /// Note that all the setters affecting `step_info` are
6050 /// mutually exclusive.
6051 ///
6052 /// # Example
6053 /// ```ignore,no_run
6054 /// # use google_cloud_networkmanagement_v1::model::Step;
6055 /// use google_cloud_networkmanagement_v1::model::StorageBucketInfo;
6056 /// let x = Step::new().set_storage_bucket(StorageBucketInfo::default()/* use setters */);
6057 /// assert!(x.storage_bucket().is_some());
6058 /// assert!(x.instance().is_none());
6059 /// assert!(x.firewall().is_none());
6060 /// assert!(x.route().is_none());
6061 /// assert!(x.endpoint().is_none());
6062 /// assert!(x.google_service().is_none());
6063 /// assert!(x.forwarding_rule().is_none());
6064 /// assert!(x.hybrid_subnet().is_none());
6065 /// assert!(x.vpn_gateway().is_none());
6066 /// assert!(x.vpn_tunnel().is_none());
6067 /// assert!(x.interconnect_attachment().is_none());
6068 /// assert!(x.vpc_connector().is_none());
6069 /// assert!(x.direct_vpc_egress_connection().is_none());
6070 /// assert!(x.serverless_external_connection().is_none());
6071 /// assert!(x.deliver().is_none());
6072 /// assert!(x.forward().is_none());
6073 /// assert!(x.abort().is_none());
6074 /// assert!(x.drop().is_none());
6075 /// assert!(x.load_balancer().is_none());
6076 /// assert!(x.network().is_none());
6077 /// assert!(x.gke_master().is_none());
6078 /// assert!(x.gke_pod().is_none());
6079 /// assert!(x.ip_masquerading_skipped().is_none());
6080 /// assert!(x.gke_network_policy().is_none());
6081 /// assert!(x.gke_network_policy_skipped().is_none());
6082 /// assert!(x.cloud_sql_instance().is_none());
6083 /// assert!(x.redis_instance().is_none());
6084 /// assert!(x.redis_cluster().is_none());
6085 /// assert!(x.cloud_function().is_none());
6086 /// assert!(x.app_engine_version().is_none());
6087 /// assert!(x.cloud_run_revision().is_none());
6088 /// assert!(x.cloud_run_job().is_none());
6089 /// assert!(x.nat().is_none());
6090 /// assert!(x.proxy_connection().is_none());
6091 /// assert!(x.load_balancer_backend_info().is_none());
6092 /// assert!(x.serverless_neg().is_none());
6093 /// assert!(x.ngfw_packet_inspection().is_none());
6094 /// assert!(x.dms_private_connection().is_none());
6095 /// ```
6096 pub fn set_storage_bucket<
6097 T: std::convert::Into<std::boxed::Box<crate::model::StorageBucketInfo>>,
6098 >(
6099 mut self,
6100 v: T,
6101 ) -> Self {
6102 self.step_info =
6103 std::option::Option::Some(crate::model::step::StepInfo::StorageBucket(v.into()));
6104 self
6105 }
6106
6107 /// The value of [step_info][crate::model::Step::step_info]
6108 /// if it holds a `ServerlessNeg`, `None` if the field is not set or
6109 /// holds a different branch.
6110 pub fn serverless_neg(
6111 &self,
6112 ) -> std::option::Option<&std::boxed::Box<crate::model::ServerlessNegInfo>> {
6113 #[allow(unreachable_patterns)]
6114 self.step_info.as_ref().and_then(|v| match v {
6115 crate::model::step::StepInfo::ServerlessNeg(v) => std::option::Option::Some(v),
6116 _ => std::option::Option::None,
6117 })
6118 }
6119
6120 /// Sets the value of [step_info][crate::model::Step::step_info]
6121 /// to hold a `ServerlessNeg`.
6122 ///
6123 /// Note that all the setters affecting `step_info` are
6124 /// mutually exclusive.
6125 ///
6126 /// # Example
6127 /// ```ignore,no_run
6128 /// # use google_cloud_networkmanagement_v1::model::Step;
6129 /// use google_cloud_networkmanagement_v1::model::ServerlessNegInfo;
6130 /// let x = Step::new().set_serverless_neg(ServerlessNegInfo::default()/* use setters */);
6131 /// assert!(x.serverless_neg().is_some());
6132 /// assert!(x.instance().is_none());
6133 /// assert!(x.firewall().is_none());
6134 /// assert!(x.route().is_none());
6135 /// assert!(x.endpoint().is_none());
6136 /// assert!(x.google_service().is_none());
6137 /// assert!(x.forwarding_rule().is_none());
6138 /// assert!(x.hybrid_subnet().is_none());
6139 /// assert!(x.vpn_gateway().is_none());
6140 /// assert!(x.vpn_tunnel().is_none());
6141 /// assert!(x.interconnect_attachment().is_none());
6142 /// assert!(x.vpc_connector().is_none());
6143 /// assert!(x.direct_vpc_egress_connection().is_none());
6144 /// assert!(x.serverless_external_connection().is_none());
6145 /// assert!(x.deliver().is_none());
6146 /// assert!(x.forward().is_none());
6147 /// assert!(x.abort().is_none());
6148 /// assert!(x.drop().is_none());
6149 /// assert!(x.load_balancer().is_none());
6150 /// assert!(x.network().is_none());
6151 /// assert!(x.gke_master().is_none());
6152 /// assert!(x.gke_pod().is_none());
6153 /// assert!(x.ip_masquerading_skipped().is_none());
6154 /// assert!(x.gke_network_policy().is_none());
6155 /// assert!(x.gke_network_policy_skipped().is_none());
6156 /// assert!(x.cloud_sql_instance().is_none());
6157 /// assert!(x.redis_instance().is_none());
6158 /// assert!(x.redis_cluster().is_none());
6159 /// assert!(x.cloud_function().is_none());
6160 /// assert!(x.app_engine_version().is_none());
6161 /// assert!(x.cloud_run_revision().is_none());
6162 /// assert!(x.cloud_run_job().is_none());
6163 /// assert!(x.nat().is_none());
6164 /// assert!(x.proxy_connection().is_none());
6165 /// assert!(x.load_balancer_backend_info().is_none());
6166 /// assert!(x.storage_bucket().is_none());
6167 /// assert!(x.ngfw_packet_inspection().is_none());
6168 /// assert!(x.dms_private_connection().is_none());
6169 /// ```
6170 pub fn set_serverless_neg<
6171 T: std::convert::Into<std::boxed::Box<crate::model::ServerlessNegInfo>>,
6172 >(
6173 mut self,
6174 v: T,
6175 ) -> Self {
6176 self.step_info =
6177 std::option::Option::Some(crate::model::step::StepInfo::ServerlessNeg(v.into()));
6178 self
6179 }
6180
6181 /// The value of [step_info][crate::model::Step::step_info]
6182 /// if it holds a `NgfwPacketInspection`, `None` if the field is not set or
6183 /// holds a different branch.
6184 pub fn ngfw_packet_inspection(
6185 &self,
6186 ) -> std::option::Option<&std::boxed::Box<crate::model::NgfwPacketInspectionInfo>> {
6187 #[allow(unreachable_patterns)]
6188 self.step_info.as_ref().and_then(|v| match v {
6189 crate::model::step::StepInfo::NgfwPacketInspection(v) => std::option::Option::Some(v),
6190 _ => std::option::Option::None,
6191 })
6192 }
6193
6194 /// Sets the value of [step_info][crate::model::Step::step_info]
6195 /// to hold a `NgfwPacketInspection`.
6196 ///
6197 /// Note that all the setters affecting `step_info` are
6198 /// mutually exclusive.
6199 ///
6200 /// # Example
6201 /// ```ignore,no_run
6202 /// # use google_cloud_networkmanagement_v1::model::Step;
6203 /// use google_cloud_networkmanagement_v1::model::NgfwPacketInspectionInfo;
6204 /// let x = Step::new().set_ngfw_packet_inspection(NgfwPacketInspectionInfo::default()/* use setters */);
6205 /// assert!(x.ngfw_packet_inspection().is_some());
6206 /// assert!(x.instance().is_none());
6207 /// assert!(x.firewall().is_none());
6208 /// assert!(x.route().is_none());
6209 /// assert!(x.endpoint().is_none());
6210 /// assert!(x.google_service().is_none());
6211 /// assert!(x.forwarding_rule().is_none());
6212 /// assert!(x.hybrid_subnet().is_none());
6213 /// assert!(x.vpn_gateway().is_none());
6214 /// assert!(x.vpn_tunnel().is_none());
6215 /// assert!(x.interconnect_attachment().is_none());
6216 /// assert!(x.vpc_connector().is_none());
6217 /// assert!(x.direct_vpc_egress_connection().is_none());
6218 /// assert!(x.serverless_external_connection().is_none());
6219 /// assert!(x.deliver().is_none());
6220 /// assert!(x.forward().is_none());
6221 /// assert!(x.abort().is_none());
6222 /// assert!(x.drop().is_none());
6223 /// assert!(x.load_balancer().is_none());
6224 /// assert!(x.network().is_none());
6225 /// assert!(x.gke_master().is_none());
6226 /// assert!(x.gke_pod().is_none());
6227 /// assert!(x.ip_masquerading_skipped().is_none());
6228 /// assert!(x.gke_network_policy().is_none());
6229 /// assert!(x.gke_network_policy_skipped().is_none());
6230 /// assert!(x.cloud_sql_instance().is_none());
6231 /// assert!(x.redis_instance().is_none());
6232 /// assert!(x.redis_cluster().is_none());
6233 /// assert!(x.cloud_function().is_none());
6234 /// assert!(x.app_engine_version().is_none());
6235 /// assert!(x.cloud_run_revision().is_none());
6236 /// assert!(x.cloud_run_job().is_none());
6237 /// assert!(x.nat().is_none());
6238 /// assert!(x.proxy_connection().is_none());
6239 /// assert!(x.load_balancer_backend_info().is_none());
6240 /// assert!(x.storage_bucket().is_none());
6241 /// assert!(x.serverless_neg().is_none());
6242 /// assert!(x.dms_private_connection().is_none());
6243 /// ```
6244 pub fn set_ngfw_packet_inspection<
6245 T: std::convert::Into<std::boxed::Box<crate::model::NgfwPacketInspectionInfo>>,
6246 >(
6247 mut self,
6248 v: T,
6249 ) -> Self {
6250 self.step_info =
6251 std::option::Option::Some(crate::model::step::StepInfo::NgfwPacketInspection(v.into()));
6252 self
6253 }
6254
6255 /// The value of [step_info][crate::model::Step::step_info]
6256 /// if it holds a `DmsPrivateConnection`, `None` if the field is not set or
6257 /// holds a different branch.
6258 pub fn dms_private_connection(
6259 &self,
6260 ) -> std::option::Option<&std::boxed::Box<crate::model::PrivateConnectionInfo>> {
6261 #[allow(unreachable_patterns)]
6262 self.step_info.as_ref().and_then(|v| match v {
6263 crate::model::step::StepInfo::DmsPrivateConnection(v) => std::option::Option::Some(v),
6264 _ => std::option::Option::None,
6265 })
6266 }
6267
6268 /// Sets the value of [step_info][crate::model::Step::step_info]
6269 /// to hold a `DmsPrivateConnection`.
6270 ///
6271 /// Note that all the setters affecting `step_info` are
6272 /// mutually exclusive.
6273 ///
6274 /// # Example
6275 /// ```ignore,no_run
6276 /// # use google_cloud_networkmanagement_v1::model::Step;
6277 /// use google_cloud_networkmanagement_v1::model::PrivateConnectionInfo;
6278 /// let x = Step::new().set_dms_private_connection(PrivateConnectionInfo::default()/* use setters */);
6279 /// assert!(x.dms_private_connection().is_some());
6280 /// assert!(x.instance().is_none());
6281 /// assert!(x.firewall().is_none());
6282 /// assert!(x.route().is_none());
6283 /// assert!(x.endpoint().is_none());
6284 /// assert!(x.google_service().is_none());
6285 /// assert!(x.forwarding_rule().is_none());
6286 /// assert!(x.hybrid_subnet().is_none());
6287 /// assert!(x.vpn_gateway().is_none());
6288 /// assert!(x.vpn_tunnel().is_none());
6289 /// assert!(x.interconnect_attachment().is_none());
6290 /// assert!(x.vpc_connector().is_none());
6291 /// assert!(x.direct_vpc_egress_connection().is_none());
6292 /// assert!(x.serverless_external_connection().is_none());
6293 /// assert!(x.deliver().is_none());
6294 /// assert!(x.forward().is_none());
6295 /// assert!(x.abort().is_none());
6296 /// assert!(x.drop().is_none());
6297 /// assert!(x.load_balancer().is_none());
6298 /// assert!(x.network().is_none());
6299 /// assert!(x.gke_master().is_none());
6300 /// assert!(x.gke_pod().is_none());
6301 /// assert!(x.ip_masquerading_skipped().is_none());
6302 /// assert!(x.gke_network_policy().is_none());
6303 /// assert!(x.gke_network_policy_skipped().is_none());
6304 /// assert!(x.cloud_sql_instance().is_none());
6305 /// assert!(x.redis_instance().is_none());
6306 /// assert!(x.redis_cluster().is_none());
6307 /// assert!(x.cloud_function().is_none());
6308 /// assert!(x.app_engine_version().is_none());
6309 /// assert!(x.cloud_run_revision().is_none());
6310 /// assert!(x.cloud_run_job().is_none());
6311 /// assert!(x.nat().is_none());
6312 /// assert!(x.proxy_connection().is_none());
6313 /// assert!(x.load_balancer_backend_info().is_none());
6314 /// assert!(x.storage_bucket().is_none());
6315 /// assert!(x.serverless_neg().is_none());
6316 /// assert!(x.ngfw_packet_inspection().is_none());
6317 /// ```
6318 pub fn set_dms_private_connection<
6319 T: std::convert::Into<std::boxed::Box<crate::model::PrivateConnectionInfo>>,
6320 >(
6321 mut self,
6322 v: T,
6323 ) -> Self {
6324 self.step_info =
6325 std::option::Option::Some(crate::model::step::StepInfo::DmsPrivateConnection(v.into()));
6326 self
6327 }
6328}
6329
6330impl wkt::message::Message for Step {
6331 fn typename() -> &'static str {
6332 "type.googleapis.com/google.cloud.networkmanagement.v1.Step"
6333 }
6334}
6335
6336/// Defines additional types related to [Step].
6337pub mod step {
6338 #[allow(unused_imports)]
6339 use super::*;
6340
6341 /// Type of states that are defined in the network state machine.
6342 /// Each step in the packet trace is in a specific state.
6343 ///
6344 /// # Working with unknown values
6345 ///
6346 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6347 /// additional enum variants at any time. Adding new variants is not considered
6348 /// a breaking change. Applications should write their code in anticipation of:
6349 ///
6350 /// - New values appearing in future releases of the client library, **and**
6351 /// - New values received dynamically, without application changes.
6352 ///
6353 /// Please consult the [Working with enums] section in the user guide for some
6354 /// guidelines.
6355 ///
6356 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6357 #[derive(Clone, Debug, PartialEq)]
6358 #[non_exhaustive]
6359 pub enum State {
6360 /// Unspecified state.
6361 Unspecified,
6362 /// Initial state: packet originating from a Compute Engine instance.
6363 /// An InstanceInfo is populated with starting instance information.
6364 StartFromInstance,
6365 /// Initial state: packet originating from the internet.
6366 /// The endpoint information is populated.
6367 StartFromInternet,
6368 /// Initial state: packet originating from a Google service.
6369 /// The google_service information is populated.
6370 StartFromGoogleService,
6371 /// Initial state: packet originating from a VPC or on-premises network
6372 /// with internal source IP.
6373 /// If the source is a VPC network visible to the user, a NetworkInfo
6374 /// is populated with details of the network.
6375 StartFromPrivateNetwork,
6376 /// Initial state: packet originating from a Google Kubernetes Engine cluster
6377 /// master. A GKEMasterInfo is populated with starting instance information.
6378 StartFromGkeMaster,
6379 /// Initial state: packet originating from a Cloud SQL instance.
6380 /// A CloudSQLInstanceInfo is populated with starting instance information.
6381 StartFromCloudSqlInstance,
6382 /// Initial state: packet originating from a Google Kubernetes Engine Pod.
6383 /// A GkePodInfo is populated with starting Pod information.
6384 StartFromGkePod,
6385 /// Initial state: packet originating from a Redis instance.
6386 /// A RedisInstanceInfo is populated with starting instance information.
6387 StartFromRedisInstance,
6388 /// Initial state: packet originating from a Redis Cluster.
6389 /// A RedisClusterInfo is populated with starting Cluster information.
6390 StartFromRedisCluster,
6391 /// Initial state: packet originating from a Cloud Function.
6392 /// A CloudFunctionInfo is populated with starting function information.
6393 StartFromCloudFunction,
6394 /// Initial state: packet originating from an App Engine service version.
6395 /// An AppEngineVersionInfo is populated with starting version information.
6396 StartFromAppEngineVersion,
6397 /// Initial state: packet originating from a Cloud Run revision.
6398 /// A CloudRunRevisionInfo is populated with starting revision information.
6399 StartFromCloudRunRevision,
6400 /// Initial state: packet originating from a Cloud Run Job.
6401 /// A CloudRunJobInfo is populated with starting Job information.
6402 StartFromCloudRunJob,
6403 /// Initial state: packet originating from a Storage Bucket. Used only for
6404 /// return traces.
6405 /// The storage_bucket information is populated.
6406 StartFromStorageBucket,
6407 /// Initial state: packet originating from a published service that uses
6408 /// Private Service Connect. Used only for return traces.
6409 StartFromPscPublishedService,
6410 /// Initial state: packet originating from a serverless network endpoint
6411 /// group backend. Used only for return traces.
6412 /// The serverless_neg information is populated.
6413 StartFromServerlessNeg,
6414 /// Initial state: packet originating from a DMS Private Connection.
6415 StartFromDmsPrivateConnection,
6416 /// Config checking state: verify ingress firewall rule.
6417 ApplyIngressFirewallRule,
6418 /// Config checking state: verify egress firewall rule.
6419 ApplyEgressFirewallRule,
6420 /// Config checking state: verify route.
6421 ApplyRoute,
6422 /// Config checking state: match forwarding rule.
6423 ApplyForwardingRule,
6424 /// Config checking state: verify load balancer backend configuration.
6425 AnalyzeLoadBalancerBackend,
6426 /// Config checking state: packet sent or received under foreign IP
6427 /// address and allowed.
6428 SpoofingApproved,
6429 /// Forwarding state: arriving at a Compute Engine instance.
6430 ArriveAtInstance,
6431 /// Forwarding state: arriving at a Compute Engine internal load balancer.
6432 #[deprecated]
6433 ArriveAtInternalLoadBalancer,
6434 /// Forwarding state: arriving at a Compute Engine external load balancer.
6435 #[deprecated]
6436 ArriveAtExternalLoadBalancer,
6437 /// Forwarding state: arriving at a hybrid subnet. Appropriate routing
6438 /// configuration will be determined here.
6439 ArriveAtHybridSubnet,
6440 /// Forwarding state: arriving at a Cloud VPN gateway.
6441 ArriveAtVpnGateway,
6442 /// Forwarding state: arriving at a Cloud VPN tunnel.
6443 ArriveAtVpnTunnel,
6444 /// Forwarding state: arriving at an interconnect attachment.
6445 ArriveAtInterconnectAttachment,
6446 /// Forwarding state: arriving at a VPC connector.
6447 ArriveAtVpcConnector,
6448 /// Forwarding state: arriving at a GKE Pod.
6449 ArriveAtGkePod,
6450 /// Forwarding state: for packets originating from a serverless endpoint
6451 /// forwarded through Direct VPC egress.
6452 DirectVpcEgressConnection,
6453 /// Forwarding state: for packets originating from a serverless endpoint
6454 /// forwarded through public (external) connectivity.
6455 ServerlessExternalConnection,
6456 /// Forwarding state: Layer 7 packet inspection by the firewall endpoint
6457 /// based on the configured security profile group.
6458 NgfwPacketInspection,
6459 /// Transition state: packet header translated. The `nat` field is populated
6460 /// with the translation information.
6461 Nat,
6462 /// Transition state: GKE Pod IP masquerading is skipped. The
6463 /// `ip_masquerading_skipped` field is populated with the reason.
6464 SkipGkePodIpMasquerading,
6465 /// Transition state: GKE Ingress Network Policy is skipped. The
6466 /// `gke_network_policy_skipped` field is populated with the reason.
6467 SkipGkeIngressNetworkPolicy,
6468 /// Transition state: GKE Egress Network Policy is skipped. The
6469 /// `gke_network_policy_skipped` field is populated with the reason.
6470 SkipGkeEgressNetworkPolicy,
6471 /// Config checking state: verify ingress GKE network policy.
6472 ApplyIngressGkeNetworkPolicy,
6473 /// Config checking state: verify egress GKE network policy.
6474 ApplyEgressGkeNetworkPolicy,
6475 /// Transition state: original connection is terminated and a new proxied
6476 /// connection is initiated.
6477 ProxyConnection,
6478 /// Final state: packet could be delivered.
6479 Deliver,
6480 /// Final state: packet could be dropped.
6481 Drop,
6482 /// Final state: packet could be forwarded to a network with an unknown
6483 /// configuration.
6484 Forward,
6485 /// Final state: analysis is aborted.
6486 Abort,
6487 /// Special state: viewer of the test result does not have permission to
6488 /// see the configuration in this step.
6489 ViewerPermissionMissing,
6490 /// If set, the enum was initialized with an unknown value.
6491 ///
6492 /// Applications can examine the value using [State::value] or
6493 /// [State::name].
6494 UnknownValue(state::UnknownValue),
6495 }
6496
6497 #[doc(hidden)]
6498 pub mod state {
6499 #[allow(unused_imports)]
6500 use super::*;
6501 #[derive(Clone, Debug, PartialEq)]
6502 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6503 }
6504
6505 impl State {
6506 /// Gets the enum value.
6507 ///
6508 /// Returns `None` if the enum contains an unknown value deserialized from
6509 /// the string representation of enums.
6510 pub fn value(&self) -> std::option::Option<i32> {
6511 match self {
6512 Self::Unspecified => std::option::Option::Some(0),
6513 Self::StartFromInstance => std::option::Option::Some(1),
6514 Self::StartFromInternet => std::option::Option::Some(2),
6515 Self::StartFromGoogleService => std::option::Option::Some(27),
6516 Self::StartFromPrivateNetwork => std::option::Option::Some(3),
6517 Self::StartFromGkeMaster => std::option::Option::Some(21),
6518 Self::StartFromCloudSqlInstance => std::option::Option::Some(22),
6519 Self::StartFromGkePod => std::option::Option::Some(39),
6520 Self::StartFromRedisInstance => std::option::Option::Some(32),
6521 Self::StartFromRedisCluster => std::option::Option::Some(33),
6522 Self::StartFromCloudFunction => std::option::Option::Some(23),
6523 Self::StartFromAppEngineVersion => std::option::Option::Some(25),
6524 Self::StartFromCloudRunRevision => std::option::Option::Some(26),
6525 Self::StartFromCloudRunJob => std::option::Option::Some(50),
6526 Self::StartFromStorageBucket => std::option::Option::Some(29),
6527 Self::StartFromPscPublishedService => std::option::Option::Some(30),
6528 Self::StartFromServerlessNeg => std::option::Option::Some(31),
6529 Self::StartFromDmsPrivateConnection => std::option::Option::Some(48),
6530 Self::ApplyIngressFirewallRule => std::option::Option::Some(4),
6531 Self::ApplyEgressFirewallRule => std::option::Option::Some(5),
6532 Self::ApplyRoute => std::option::Option::Some(6),
6533 Self::ApplyForwardingRule => std::option::Option::Some(7),
6534 Self::AnalyzeLoadBalancerBackend => std::option::Option::Some(28),
6535 Self::SpoofingApproved => std::option::Option::Some(8),
6536 Self::ArriveAtInstance => std::option::Option::Some(9),
6537 Self::ArriveAtInternalLoadBalancer => std::option::Option::Some(10),
6538 Self::ArriveAtExternalLoadBalancer => std::option::Option::Some(11),
6539 Self::ArriveAtHybridSubnet => std::option::Option::Some(38),
6540 Self::ArriveAtVpnGateway => std::option::Option::Some(12),
6541 Self::ArriveAtVpnTunnel => std::option::Option::Some(13),
6542 Self::ArriveAtInterconnectAttachment => std::option::Option::Some(37),
6543 Self::ArriveAtVpcConnector => std::option::Option::Some(24),
6544 Self::ArriveAtGkePod => std::option::Option::Some(44),
6545 Self::DirectVpcEgressConnection => std::option::Option::Some(35),
6546 Self::ServerlessExternalConnection => std::option::Option::Some(36),
6547 Self::NgfwPacketInspection => std::option::Option::Some(47),
6548 Self::Nat => std::option::Option::Some(14),
6549 Self::SkipGkePodIpMasquerading => std::option::Option::Some(40),
6550 Self::SkipGkeIngressNetworkPolicy => std::option::Option::Some(41),
6551 Self::SkipGkeEgressNetworkPolicy => std::option::Option::Some(42),
6552 Self::ApplyIngressGkeNetworkPolicy => std::option::Option::Some(45),
6553 Self::ApplyEgressGkeNetworkPolicy => std::option::Option::Some(46),
6554 Self::ProxyConnection => std::option::Option::Some(15),
6555 Self::Deliver => std::option::Option::Some(16),
6556 Self::Drop => std::option::Option::Some(17),
6557 Self::Forward => std::option::Option::Some(18),
6558 Self::Abort => std::option::Option::Some(19),
6559 Self::ViewerPermissionMissing => std::option::Option::Some(20),
6560 Self::UnknownValue(u) => u.0.value(),
6561 }
6562 }
6563
6564 /// Gets the enum value as a string.
6565 ///
6566 /// Returns `None` if the enum contains an unknown value deserialized from
6567 /// the integer representation of enums.
6568 pub fn name(&self) -> std::option::Option<&str> {
6569 match self {
6570 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6571 Self::StartFromInstance => std::option::Option::Some("START_FROM_INSTANCE"),
6572 Self::StartFromInternet => std::option::Option::Some("START_FROM_INTERNET"),
6573 Self::StartFromGoogleService => {
6574 std::option::Option::Some("START_FROM_GOOGLE_SERVICE")
6575 }
6576 Self::StartFromPrivateNetwork => {
6577 std::option::Option::Some("START_FROM_PRIVATE_NETWORK")
6578 }
6579 Self::StartFromGkeMaster => std::option::Option::Some("START_FROM_GKE_MASTER"),
6580 Self::StartFromCloudSqlInstance => {
6581 std::option::Option::Some("START_FROM_CLOUD_SQL_INSTANCE")
6582 }
6583 Self::StartFromGkePod => std::option::Option::Some("START_FROM_GKE_POD"),
6584 Self::StartFromRedisInstance => {
6585 std::option::Option::Some("START_FROM_REDIS_INSTANCE")
6586 }
6587 Self::StartFromRedisCluster => {
6588 std::option::Option::Some("START_FROM_REDIS_CLUSTER")
6589 }
6590 Self::StartFromCloudFunction => {
6591 std::option::Option::Some("START_FROM_CLOUD_FUNCTION")
6592 }
6593 Self::StartFromAppEngineVersion => {
6594 std::option::Option::Some("START_FROM_APP_ENGINE_VERSION")
6595 }
6596 Self::StartFromCloudRunRevision => {
6597 std::option::Option::Some("START_FROM_CLOUD_RUN_REVISION")
6598 }
6599 Self::StartFromCloudRunJob => std::option::Option::Some("START_FROM_CLOUD_RUN_JOB"),
6600 Self::StartFromStorageBucket => {
6601 std::option::Option::Some("START_FROM_STORAGE_BUCKET")
6602 }
6603 Self::StartFromPscPublishedService => {
6604 std::option::Option::Some("START_FROM_PSC_PUBLISHED_SERVICE")
6605 }
6606 Self::StartFromServerlessNeg => {
6607 std::option::Option::Some("START_FROM_SERVERLESS_NEG")
6608 }
6609 Self::StartFromDmsPrivateConnection => {
6610 std::option::Option::Some("START_FROM_DMS_PRIVATE_CONNECTION")
6611 }
6612 Self::ApplyIngressFirewallRule => {
6613 std::option::Option::Some("APPLY_INGRESS_FIREWALL_RULE")
6614 }
6615 Self::ApplyEgressFirewallRule => {
6616 std::option::Option::Some("APPLY_EGRESS_FIREWALL_RULE")
6617 }
6618 Self::ApplyRoute => std::option::Option::Some("APPLY_ROUTE"),
6619 Self::ApplyForwardingRule => std::option::Option::Some("APPLY_FORWARDING_RULE"),
6620 Self::AnalyzeLoadBalancerBackend => {
6621 std::option::Option::Some("ANALYZE_LOAD_BALANCER_BACKEND")
6622 }
6623 Self::SpoofingApproved => std::option::Option::Some("SPOOFING_APPROVED"),
6624 Self::ArriveAtInstance => std::option::Option::Some("ARRIVE_AT_INSTANCE"),
6625 Self::ArriveAtInternalLoadBalancer => {
6626 std::option::Option::Some("ARRIVE_AT_INTERNAL_LOAD_BALANCER")
6627 }
6628 Self::ArriveAtExternalLoadBalancer => {
6629 std::option::Option::Some("ARRIVE_AT_EXTERNAL_LOAD_BALANCER")
6630 }
6631 Self::ArriveAtHybridSubnet => std::option::Option::Some("ARRIVE_AT_HYBRID_SUBNET"),
6632 Self::ArriveAtVpnGateway => std::option::Option::Some("ARRIVE_AT_VPN_GATEWAY"),
6633 Self::ArriveAtVpnTunnel => std::option::Option::Some("ARRIVE_AT_VPN_TUNNEL"),
6634 Self::ArriveAtInterconnectAttachment => {
6635 std::option::Option::Some("ARRIVE_AT_INTERCONNECT_ATTACHMENT")
6636 }
6637 Self::ArriveAtVpcConnector => std::option::Option::Some("ARRIVE_AT_VPC_CONNECTOR"),
6638 Self::ArriveAtGkePod => std::option::Option::Some("ARRIVE_AT_GKE_POD"),
6639 Self::DirectVpcEgressConnection => {
6640 std::option::Option::Some("DIRECT_VPC_EGRESS_CONNECTION")
6641 }
6642 Self::ServerlessExternalConnection => {
6643 std::option::Option::Some("SERVERLESS_EXTERNAL_CONNECTION")
6644 }
6645 Self::NgfwPacketInspection => std::option::Option::Some("NGFW_PACKET_INSPECTION"),
6646 Self::Nat => std::option::Option::Some("NAT"),
6647 Self::SkipGkePodIpMasquerading => {
6648 std::option::Option::Some("SKIP_GKE_POD_IP_MASQUERADING")
6649 }
6650 Self::SkipGkeIngressNetworkPolicy => {
6651 std::option::Option::Some("SKIP_GKE_INGRESS_NETWORK_POLICY")
6652 }
6653 Self::SkipGkeEgressNetworkPolicy => {
6654 std::option::Option::Some("SKIP_GKE_EGRESS_NETWORK_POLICY")
6655 }
6656 Self::ApplyIngressGkeNetworkPolicy => {
6657 std::option::Option::Some("APPLY_INGRESS_GKE_NETWORK_POLICY")
6658 }
6659 Self::ApplyEgressGkeNetworkPolicy => {
6660 std::option::Option::Some("APPLY_EGRESS_GKE_NETWORK_POLICY")
6661 }
6662 Self::ProxyConnection => std::option::Option::Some("PROXY_CONNECTION"),
6663 Self::Deliver => std::option::Option::Some("DELIVER"),
6664 Self::Drop => std::option::Option::Some("DROP"),
6665 Self::Forward => std::option::Option::Some("FORWARD"),
6666 Self::Abort => std::option::Option::Some("ABORT"),
6667 Self::ViewerPermissionMissing => {
6668 std::option::Option::Some("VIEWER_PERMISSION_MISSING")
6669 }
6670 Self::UnknownValue(u) => u.0.name(),
6671 }
6672 }
6673 }
6674
6675 impl std::default::Default for State {
6676 fn default() -> Self {
6677 use std::convert::From;
6678 Self::from(0)
6679 }
6680 }
6681
6682 impl std::fmt::Display for State {
6683 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6684 wkt::internal::display_enum(f, self.name(), self.value())
6685 }
6686 }
6687
6688 impl std::convert::From<i32> for State {
6689 fn from(value: i32) -> Self {
6690 match value {
6691 0 => Self::Unspecified,
6692 1 => Self::StartFromInstance,
6693 2 => Self::StartFromInternet,
6694 3 => Self::StartFromPrivateNetwork,
6695 4 => Self::ApplyIngressFirewallRule,
6696 5 => Self::ApplyEgressFirewallRule,
6697 6 => Self::ApplyRoute,
6698 7 => Self::ApplyForwardingRule,
6699 8 => Self::SpoofingApproved,
6700 9 => Self::ArriveAtInstance,
6701 10 => Self::ArriveAtInternalLoadBalancer,
6702 11 => Self::ArriveAtExternalLoadBalancer,
6703 12 => Self::ArriveAtVpnGateway,
6704 13 => Self::ArriveAtVpnTunnel,
6705 14 => Self::Nat,
6706 15 => Self::ProxyConnection,
6707 16 => Self::Deliver,
6708 17 => Self::Drop,
6709 18 => Self::Forward,
6710 19 => Self::Abort,
6711 20 => Self::ViewerPermissionMissing,
6712 21 => Self::StartFromGkeMaster,
6713 22 => Self::StartFromCloudSqlInstance,
6714 23 => Self::StartFromCloudFunction,
6715 24 => Self::ArriveAtVpcConnector,
6716 25 => Self::StartFromAppEngineVersion,
6717 26 => Self::StartFromCloudRunRevision,
6718 27 => Self::StartFromGoogleService,
6719 28 => Self::AnalyzeLoadBalancerBackend,
6720 29 => Self::StartFromStorageBucket,
6721 30 => Self::StartFromPscPublishedService,
6722 31 => Self::StartFromServerlessNeg,
6723 32 => Self::StartFromRedisInstance,
6724 33 => Self::StartFromRedisCluster,
6725 35 => Self::DirectVpcEgressConnection,
6726 36 => Self::ServerlessExternalConnection,
6727 37 => Self::ArriveAtInterconnectAttachment,
6728 38 => Self::ArriveAtHybridSubnet,
6729 39 => Self::StartFromGkePod,
6730 40 => Self::SkipGkePodIpMasquerading,
6731 41 => Self::SkipGkeIngressNetworkPolicy,
6732 42 => Self::SkipGkeEgressNetworkPolicy,
6733 44 => Self::ArriveAtGkePod,
6734 45 => Self::ApplyIngressGkeNetworkPolicy,
6735 46 => Self::ApplyEgressGkeNetworkPolicy,
6736 47 => Self::NgfwPacketInspection,
6737 48 => Self::StartFromDmsPrivateConnection,
6738 50 => Self::StartFromCloudRunJob,
6739 _ => Self::UnknownValue(state::UnknownValue(
6740 wkt::internal::UnknownEnumValue::Integer(value),
6741 )),
6742 }
6743 }
6744 }
6745
6746 impl std::convert::From<&str> for State {
6747 fn from(value: &str) -> Self {
6748 use std::string::ToString;
6749 match value {
6750 "STATE_UNSPECIFIED" => Self::Unspecified,
6751 "START_FROM_INSTANCE" => Self::StartFromInstance,
6752 "START_FROM_INTERNET" => Self::StartFromInternet,
6753 "START_FROM_GOOGLE_SERVICE" => Self::StartFromGoogleService,
6754 "START_FROM_PRIVATE_NETWORK" => Self::StartFromPrivateNetwork,
6755 "START_FROM_GKE_MASTER" => Self::StartFromGkeMaster,
6756 "START_FROM_CLOUD_SQL_INSTANCE" => Self::StartFromCloudSqlInstance,
6757 "START_FROM_GKE_POD" => Self::StartFromGkePod,
6758 "START_FROM_REDIS_INSTANCE" => Self::StartFromRedisInstance,
6759 "START_FROM_REDIS_CLUSTER" => Self::StartFromRedisCluster,
6760 "START_FROM_CLOUD_FUNCTION" => Self::StartFromCloudFunction,
6761 "START_FROM_APP_ENGINE_VERSION" => Self::StartFromAppEngineVersion,
6762 "START_FROM_CLOUD_RUN_REVISION" => Self::StartFromCloudRunRevision,
6763 "START_FROM_CLOUD_RUN_JOB" => Self::StartFromCloudRunJob,
6764 "START_FROM_STORAGE_BUCKET" => Self::StartFromStorageBucket,
6765 "START_FROM_PSC_PUBLISHED_SERVICE" => Self::StartFromPscPublishedService,
6766 "START_FROM_SERVERLESS_NEG" => Self::StartFromServerlessNeg,
6767 "START_FROM_DMS_PRIVATE_CONNECTION" => Self::StartFromDmsPrivateConnection,
6768 "APPLY_INGRESS_FIREWALL_RULE" => Self::ApplyIngressFirewallRule,
6769 "APPLY_EGRESS_FIREWALL_RULE" => Self::ApplyEgressFirewallRule,
6770 "APPLY_ROUTE" => Self::ApplyRoute,
6771 "APPLY_FORWARDING_RULE" => Self::ApplyForwardingRule,
6772 "ANALYZE_LOAD_BALANCER_BACKEND" => Self::AnalyzeLoadBalancerBackend,
6773 "SPOOFING_APPROVED" => Self::SpoofingApproved,
6774 "ARRIVE_AT_INSTANCE" => Self::ArriveAtInstance,
6775 "ARRIVE_AT_INTERNAL_LOAD_BALANCER" => Self::ArriveAtInternalLoadBalancer,
6776 "ARRIVE_AT_EXTERNAL_LOAD_BALANCER" => Self::ArriveAtExternalLoadBalancer,
6777 "ARRIVE_AT_HYBRID_SUBNET" => Self::ArriveAtHybridSubnet,
6778 "ARRIVE_AT_VPN_GATEWAY" => Self::ArriveAtVpnGateway,
6779 "ARRIVE_AT_VPN_TUNNEL" => Self::ArriveAtVpnTunnel,
6780 "ARRIVE_AT_INTERCONNECT_ATTACHMENT" => Self::ArriveAtInterconnectAttachment,
6781 "ARRIVE_AT_VPC_CONNECTOR" => Self::ArriveAtVpcConnector,
6782 "ARRIVE_AT_GKE_POD" => Self::ArriveAtGkePod,
6783 "DIRECT_VPC_EGRESS_CONNECTION" => Self::DirectVpcEgressConnection,
6784 "SERVERLESS_EXTERNAL_CONNECTION" => Self::ServerlessExternalConnection,
6785 "NGFW_PACKET_INSPECTION" => Self::NgfwPacketInspection,
6786 "NAT" => Self::Nat,
6787 "SKIP_GKE_POD_IP_MASQUERADING" => Self::SkipGkePodIpMasquerading,
6788 "SKIP_GKE_INGRESS_NETWORK_POLICY" => Self::SkipGkeIngressNetworkPolicy,
6789 "SKIP_GKE_EGRESS_NETWORK_POLICY" => Self::SkipGkeEgressNetworkPolicy,
6790 "APPLY_INGRESS_GKE_NETWORK_POLICY" => Self::ApplyIngressGkeNetworkPolicy,
6791 "APPLY_EGRESS_GKE_NETWORK_POLICY" => Self::ApplyEgressGkeNetworkPolicy,
6792 "PROXY_CONNECTION" => Self::ProxyConnection,
6793 "DELIVER" => Self::Deliver,
6794 "DROP" => Self::Drop,
6795 "FORWARD" => Self::Forward,
6796 "ABORT" => Self::Abort,
6797 "VIEWER_PERMISSION_MISSING" => Self::ViewerPermissionMissing,
6798 _ => Self::UnknownValue(state::UnknownValue(
6799 wkt::internal::UnknownEnumValue::String(value.to_string()),
6800 )),
6801 }
6802 }
6803 }
6804
6805 impl serde::ser::Serialize for State {
6806 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6807 where
6808 S: serde::Serializer,
6809 {
6810 match self {
6811 Self::Unspecified => serializer.serialize_i32(0),
6812 Self::StartFromInstance => serializer.serialize_i32(1),
6813 Self::StartFromInternet => serializer.serialize_i32(2),
6814 Self::StartFromGoogleService => serializer.serialize_i32(27),
6815 Self::StartFromPrivateNetwork => serializer.serialize_i32(3),
6816 Self::StartFromGkeMaster => serializer.serialize_i32(21),
6817 Self::StartFromCloudSqlInstance => serializer.serialize_i32(22),
6818 Self::StartFromGkePod => serializer.serialize_i32(39),
6819 Self::StartFromRedisInstance => serializer.serialize_i32(32),
6820 Self::StartFromRedisCluster => serializer.serialize_i32(33),
6821 Self::StartFromCloudFunction => serializer.serialize_i32(23),
6822 Self::StartFromAppEngineVersion => serializer.serialize_i32(25),
6823 Self::StartFromCloudRunRevision => serializer.serialize_i32(26),
6824 Self::StartFromCloudRunJob => serializer.serialize_i32(50),
6825 Self::StartFromStorageBucket => serializer.serialize_i32(29),
6826 Self::StartFromPscPublishedService => serializer.serialize_i32(30),
6827 Self::StartFromServerlessNeg => serializer.serialize_i32(31),
6828 Self::StartFromDmsPrivateConnection => serializer.serialize_i32(48),
6829 Self::ApplyIngressFirewallRule => serializer.serialize_i32(4),
6830 Self::ApplyEgressFirewallRule => serializer.serialize_i32(5),
6831 Self::ApplyRoute => serializer.serialize_i32(6),
6832 Self::ApplyForwardingRule => serializer.serialize_i32(7),
6833 Self::AnalyzeLoadBalancerBackend => serializer.serialize_i32(28),
6834 Self::SpoofingApproved => serializer.serialize_i32(8),
6835 Self::ArriveAtInstance => serializer.serialize_i32(9),
6836 Self::ArriveAtInternalLoadBalancer => serializer.serialize_i32(10),
6837 Self::ArriveAtExternalLoadBalancer => serializer.serialize_i32(11),
6838 Self::ArriveAtHybridSubnet => serializer.serialize_i32(38),
6839 Self::ArriveAtVpnGateway => serializer.serialize_i32(12),
6840 Self::ArriveAtVpnTunnel => serializer.serialize_i32(13),
6841 Self::ArriveAtInterconnectAttachment => serializer.serialize_i32(37),
6842 Self::ArriveAtVpcConnector => serializer.serialize_i32(24),
6843 Self::ArriveAtGkePod => serializer.serialize_i32(44),
6844 Self::DirectVpcEgressConnection => serializer.serialize_i32(35),
6845 Self::ServerlessExternalConnection => serializer.serialize_i32(36),
6846 Self::NgfwPacketInspection => serializer.serialize_i32(47),
6847 Self::Nat => serializer.serialize_i32(14),
6848 Self::SkipGkePodIpMasquerading => serializer.serialize_i32(40),
6849 Self::SkipGkeIngressNetworkPolicy => serializer.serialize_i32(41),
6850 Self::SkipGkeEgressNetworkPolicy => serializer.serialize_i32(42),
6851 Self::ApplyIngressGkeNetworkPolicy => serializer.serialize_i32(45),
6852 Self::ApplyEgressGkeNetworkPolicy => serializer.serialize_i32(46),
6853 Self::ProxyConnection => serializer.serialize_i32(15),
6854 Self::Deliver => serializer.serialize_i32(16),
6855 Self::Drop => serializer.serialize_i32(17),
6856 Self::Forward => serializer.serialize_i32(18),
6857 Self::Abort => serializer.serialize_i32(19),
6858 Self::ViewerPermissionMissing => serializer.serialize_i32(20),
6859 Self::UnknownValue(u) => u.0.serialize(serializer),
6860 }
6861 }
6862 }
6863
6864 impl<'de> serde::de::Deserialize<'de> for State {
6865 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6866 where
6867 D: serde::Deserializer<'de>,
6868 {
6869 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6870 ".google.cloud.networkmanagement.v1.Step.State",
6871 ))
6872 }
6873 }
6874
6875 /// Configuration or metadata associated with each step.
6876 /// The configuration is filtered based on viewer's permission. If a viewer
6877 /// has no permission to view the configuration in this step, for non-final
6878 /// states a special state is populated (VIEWER_PERMISSION_MISSING), and for
6879 /// final state the configuration is cleared.
6880 #[derive(Clone, Debug, PartialEq)]
6881 #[non_exhaustive]
6882 pub enum StepInfo {
6883 /// Display information of a Compute Engine instance.
6884 Instance(std::boxed::Box<crate::model::InstanceInfo>),
6885 /// Display information of a Compute Engine firewall rule.
6886 Firewall(std::boxed::Box<crate::model::FirewallInfo>),
6887 /// Display information of a Compute Engine route.
6888 Route(std::boxed::Box<crate::model::RouteInfo>),
6889 /// Display information of the source and destination under analysis.
6890 /// The endpoint information in an intermediate state may differ with the
6891 /// initial input, as it might be modified by state like NAT,
6892 /// or Connection Proxy.
6893 Endpoint(std::boxed::Box<crate::model::EndpointInfo>),
6894 /// Display information of a Google service
6895 GoogleService(std::boxed::Box<crate::model::GoogleServiceInfo>),
6896 /// Display information of a Compute Engine forwarding rule.
6897 ForwardingRule(std::boxed::Box<crate::model::ForwardingRuleInfo>),
6898 /// Display information of a hybrid subnet.
6899 HybridSubnet(std::boxed::Box<crate::model::HybridSubnetInfo>),
6900 /// Display information of a Compute Engine VPN gateway.
6901 VpnGateway(std::boxed::Box<crate::model::VpnGatewayInfo>),
6902 /// Display information of a Compute Engine VPN tunnel.
6903 VpnTunnel(std::boxed::Box<crate::model::VpnTunnelInfo>),
6904 /// Display information of an interconnect attachment.
6905 InterconnectAttachment(std::boxed::Box<crate::model::InterconnectAttachmentInfo>),
6906 /// Display information of a VPC connector.
6907 VpcConnector(std::boxed::Box<crate::model::VpcConnectorInfo>),
6908 /// Display information of a serverless direct VPC egress connection.
6909 DirectVpcEgressConnection(std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>),
6910 /// Display information of a serverless public (external) connection.
6911 ServerlessExternalConnection(
6912 std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>,
6913 ),
6914 /// Display information of the final state "deliver" and reason.
6915 Deliver(std::boxed::Box<crate::model::DeliverInfo>),
6916 /// Display information of the final state "forward" and reason.
6917 Forward(std::boxed::Box<crate::model::ForwardInfo>),
6918 /// Display information of the final state "abort" and reason.
6919 Abort(std::boxed::Box<crate::model::AbortInfo>),
6920 /// Display information of the final state "drop" and reason.
6921 Drop(std::boxed::Box<crate::model::DropInfo>),
6922 /// Display information of the load balancers. Deprecated in favor of the
6923 /// `load_balancer_backend_info` field, not used in new tests.
6924 #[deprecated]
6925 LoadBalancer(std::boxed::Box<crate::model::LoadBalancerInfo>),
6926 /// Display information of a Google Cloud network.
6927 Network(std::boxed::Box<crate::model::NetworkInfo>),
6928 /// Display information of a Google Kubernetes Engine cluster master.
6929 GkeMaster(std::boxed::Box<crate::model::GKEMasterInfo>),
6930 /// Display information of a Google Kubernetes Engine Pod.
6931 GkePod(std::boxed::Box<crate::model::GkePodInfo>),
6932 /// Display information of the reason why GKE Pod IP masquerading was
6933 /// skipped.
6934 IpMasqueradingSkipped(std::boxed::Box<crate::model::IpMasqueradingSkippedInfo>),
6935 /// Display information of a GKE Network Policy.
6936 GkeNetworkPolicy(std::boxed::Box<crate::model::GkeNetworkPolicyInfo>),
6937 /// Display information of the reason why GKE Network Policy evaluation was
6938 /// skipped.
6939 GkeNetworkPolicySkipped(std::boxed::Box<crate::model::GkeNetworkPolicySkippedInfo>),
6940 /// Display information of a Cloud SQL instance.
6941 CloudSqlInstance(std::boxed::Box<crate::model::CloudSQLInstanceInfo>),
6942 /// Display information of a Redis Instance.
6943 RedisInstance(std::boxed::Box<crate::model::RedisInstanceInfo>),
6944 /// Display information of a Redis Cluster.
6945 RedisCluster(std::boxed::Box<crate::model::RedisClusterInfo>),
6946 /// Display information of a Cloud Function.
6947 CloudFunction(std::boxed::Box<crate::model::CloudFunctionInfo>),
6948 /// Display information of an App Engine service version.
6949 AppEngineVersion(std::boxed::Box<crate::model::AppEngineVersionInfo>),
6950 /// Display information of a Cloud Run revision.
6951 CloudRunRevision(std::boxed::Box<crate::model::CloudRunRevisionInfo>),
6952 /// Display information of a Cloud Run job.
6953 CloudRunJob(std::boxed::Box<crate::model::CloudRunJobInfo>),
6954 /// Display information of a NAT.
6955 Nat(std::boxed::Box<crate::model::NatInfo>),
6956 /// Display information of a ProxyConnection.
6957 ProxyConnection(std::boxed::Box<crate::model::ProxyConnectionInfo>),
6958 /// Display information of a specific load balancer backend.
6959 LoadBalancerBackendInfo(std::boxed::Box<crate::model::LoadBalancerBackendInfo>),
6960 /// Display information of a Storage Bucket. Used only for return traces.
6961 StorageBucket(std::boxed::Box<crate::model::StorageBucketInfo>),
6962 /// Display information of a Serverless network endpoint group backend. Used
6963 /// only for return traces.
6964 ServerlessNeg(std::boxed::Box<crate::model::ServerlessNegInfo>),
6965 /// Display information of a layer 7 packet inspection by the firewall.
6966 NgfwPacketInspection(std::boxed::Box<crate::model::NgfwPacketInspectionInfo>),
6967 /// Display information of a DMS Private Connection.
6968 DmsPrivateConnection(std::boxed::Box<crate::model::PrivateConnectionInfo>),
6969 }
6970}
6971
6972/// For display only. Metadata associated with a Compute Engine instance.
6973#[derive(Clone, Default, PartialEq)]
6974#[non_exhaustive]
6975pub struct InstanceInfo {
6976 /// Name of a Compute Engine instance.
6977 pub display_name: std::string::String,
6978
6979 /// URI of a Compute Engine instance.
6980 pub uri: std::string::String,
6981
6982 /// Name of the network interface of a Compute Engine instance.
6983 pub interface: std::string::String,
6984
6985 /// URI of a Compute Engine network.
6986 pub network_uri: std::string::String,
6987
6988 /// Internal IP address of the network interface.
6989 pub internal_ip: std::string::String,
6990
6991 /// External IP address of the network interface.
6992 pub external_ip: std::string::String,
6993
6994 /// Network tags configured on the instance.
6995 pub network_tags: std::vec::Vec<std::string::String>,
6996
6997 /// Service account authorized for the instance.
6998 #[deprecated]
6999 pub service_account: std::string::String,
7000
7001 /// URI of the PSC network attachment the NIC is attached to (if relevant).
7002 pub psc_network_attachment_uri: std::string::String,
7003
7004 /// Indicates whether the Compute Engine instance is running.
7005 /// Deprecated: use the `status` field instead.
7006 #[deprecated]
7007 pub running: bool,
7008
7009 /// The status of the instance.
7010 pub status: crate::model::instance_info::Status,
7011
7012 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7013}
7014
7015impl InstanceInfo {
7016 /// Creates a new default instance.
7017 pub fn new() -> Self {
7018 std::default::Default::default()
7019 }
7020
7021 /// Sets the value of [display_name][crate::model::InstanceInfo::display_name].
7022 ///
7023 /// # Example
7024 /// ```ignore,no_run
7025 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
7026 /// let x = InstanceInfo::new().set_display_name("example");
7027 /// ```
7028 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7029 self.display_name = v.into();
7030 self
7031 }
7032
7033 /// Sets the value of [uri][crate::model::InstanceInfo::uri].
7034 ///
7035 /// # Example
7036 /// ```ignore,no_run
7037 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
7038 /// let x = InstanceInfo::new().set_uri("example");
7039 /// ```
7040 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7041 self.uri = v.into();
7042 self
7043 }
7044
7045 /// Sets the value of [interface][crate::model::InstanceInfo::interface].
7046 ///
7047 /// # Example
7048 /// ```ignore,no_run
7049 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
7050 /// let x = InstanceInfo::new().set_interface("example");
7051 /// ```
7052 pub fn set_interface<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7053 self.interface = v.into();
7054 self
7055 }
7056
7057 /// Sets the value of [network_uri][crate::model::InstanceInfo::network_uri].
7058 ///
7059 /// # Example
7060 /// ```ignore,no_run
7061 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
7062 /// let x = InstanceInfo::new().set_network_uri("example");
7063 /// ```
7064 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7065 self.network_uri = v.into();
7066 self
7067 }
7068
7069 /// Sets the value of [internal_ip][crate::model::InstanceInfo::internal_ip].
7070 ///
7071 /// # Example
7072 /// ```ignore,no_run
7073 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
7074 /// let x = InstanceInfo::new().set_internal_ip("example");
7075 /// ```
7076 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7077 self.internal_ip = v.into();
7078 self
7079 }
7080
7081 /// Sets the value of [external_ip][crate::model::InstanceInfo::external_ip].
7082 ///
7083 /// # Example
7084 /// ```ignore,no_run
7085 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
7086 /// let x = InstanceInfo::new().set_external_ip("example");
7087 /// ```
7088 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7089 self.external_ip = v.into();
7090 self
7091 }
7092
7093 /// Sets the value of [network_tags][crate::model::InstanceInfo::network_tags].
7094 ///
7095 /// # Example
7096 /// ```ignore,no_run
7097 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
7098 /// let x = InstanceInfo::new().set_network_tags(["a", "b", "c"]);
7099 /// ```
7100 pub fn set_network_tags<T, V>(mut self, v: T) -> Self
7101 where
7102 T: std::iter::IntoIterator<Item = V>,
7103 V: std::convert::Into<std::string::String>,
7104 {
7105 use std::iter::Iterator;
7106 self.network_tags = v.into_iter().map(|i| i.into()).collect();
7107 self
7108 }
7109
7110 /// Sets the value of [service_account][crate::model::InstanceInfo::service_account].
7111 ///
7112 /// # Example
7113 /// ```ignore,no_run
7114 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
7115 /// let x = InstanceInfo::new().set_service_account("example");
7116 /// ```
7117 #[deprecated]
7118 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7119 self.service_account = v.into();
7120 self
7121 }
7122
7123 /// Sets the value of [psc_network_attachment_uri][crate::model::InstanceInfo::psc_network_attachment_uri].
7124 ///
7125 /// # Example
7126 /// ```ignore,no_run
7127 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
7128 /// let x = InstanceInfo::new().set_psc_network_attachment_uri("example");
7129 /// ```
7130 pub fn set_psc_network_attachment_uri<T: std::convert::Into<std::string::String>>(
7131 mut self,
7132 v: T,
7133 ) -> Self {
7134 self.psc_network_attachment_uri = v.into();
7135 self
7136 }
7137
7138 /// Sets the value of [running][crate::model::InstanceInfo::running].
7139 ///
7140 /// # Example
7141 /// ```ignore,no_run
7142 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
7143 /// let x = InstanceInfo::new().set_running(true);
7144 /// ```
7145 #[deprecated]
7146 pub fn set_running<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7147 self.running = v.into();
7148 self
7149 }
7150
7151 /// Sets the value of [status][crate::model::InstanceInfo::status].
7152 ///
7153 /// # Example
7154 /// ```ignore,no_run
7155 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
7156 /// use google_cloud_networkmanagement_v1::model::instance_info::Status;
7157 /// let x0 = InstanceInfo::new().set_status(Status::Running);
7158 /// let x1 = InstanceInfo::new().set_status(Status::NotRunning);
7159 /// ```
7160 pub fn set_status<T: std::convert::Into<crate::model::instance_info::Status>>(
7161 mut self,
7162 v: T,
7163 ) -> Self {
7164 self.status = v.into();
7165 self
7166 }
7167}
7168
7169impl wkt::message::Message for InstanceInfo {
7170 fn typename() -> &'static str {
7171 "type.googleapis.com/google.cloud.networkmanagement.v1.InstanceInfo"
7172 }
7173}
7174
7175/// Defines additional types related to [InstanceInfo].
7176pub mod instance_info {
7177 #[allow(unused_imports)]
7178 use super::*;
7179
7180 /// The status of the instance. We treat all states other than "RUNNING" as
7181 /// not running.
7182 ///
7183 /// # Working with unknown values
7184 ///
7185 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7186 /// additional enum variants at any time. Adding new variants is not considered
7187 /// a breaking change. Applications should write their code in anticipation of:
7188 ///
7189 /// - New values appearing in future releases of the client library, **and**
7190 /// - New values received dynamically, without application changes.
7191 ///
7192 /// Please consult the [Working with enums] section in the user guide for some
7193 /// guidelines.
7194 ///
7195 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7196 #[derive(Clone, Debug, PartialEq)]
7197 #[non_exhaustive]
7198 pub enum Status {
7199 /// Default unspecified value.
7200 Unspecified,
7201 /// The instance is running.
7202 Running,
7203 /// The instance has any status other than "RUNNING".
7204 NotRunning,
7205 /// If set, the enum was initialized with an unknown value.
7206 ///
7207 /// Applications can examine the value using [Status::value] or
7208 /// [Status::name].
7209 UnknownValue(status::UnknownValue),
7210 }
7211
7212 #[doc(hidden)]
7213 pub mod status {
7214 #[allow(unused_imports)]
7215 use super::*;
7216 #[derive(Clone, Debug, PartialEq)]
7217 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7218 }
7219
7220 impl Status {
7221 /// Gets the enum value.
7222 ///
7223 /// Returns `None` if the enum contains an unknown value deserialized from
7224 /// the string representation of enums.
7225 pub fn value(&self) -> std::option::Option<i32> {
7226 match self {
7227 Self::Unspecified => std::option::Option::Some(0),
7228 Self::Running => std::option::Option::Some(1),
7229 Self::NotRunning => std::option::Option::Some(2),
7230 Self::UnknownValue(u) => u.0.value(),
7231 }
7232 }
7233
7234 /// Gets the enum value as a string.
7235 ///
7236 /// Returns `None` if the enum contains an unknown value deserialized from
7237 /// the integer representation of enums.
7238 pub fn name(&self) -> std::option::Option<&str> {
7239 match self {
7240 Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
7241 Self::Running => std::option::Option::Some("RUNNING"),
7242 Self::NotRunning => std::option::Option::Some("NOT_RUNNING"),
7243 Self::UnknownValue(u) => u.0.name(),
7244 }
7245 }
7246 }
7247
7248 impl std::default::Default for Status {
7249 fn default() -> Self {
7250 use std::convert::From;
7251 Self::from(0)
7252 }
7253 }
7254
7255 impl std::fmt::Display for Status {
7256 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7257 wkt::internal::display_enum(f, self.name(), self.value())
7258 }
7259 }
7260
7261 impl std::convert::From<i32> for Status {
7262 fn from(value: i32) -> Self {
7263 match value {
7264 0 => Self::Unspecified,
7265 1 => Self::Running,
7266 2 => Self::NotRunning,
7267 _ => Self::UnknownValue(status::UnknownValue(
7268 wkt::internal::UnknownEnumValue::Integer(value),
7269 )),
7270 }
7271 }
7272 }
7273
7274 impl std::convert::From<&str> for Status {
7275 fn from(value: &str) -> Self {
7276 use std::string::ToString;
7277 match value {
7278 "STATUS_UNSPECIFIED" => Self::Unspecified,
7279 "RUNNING" => Self::Running,
7280 "NOT_RUNNING" => Self::NotRunning,
7281 _ => Self::UnknownValue(status::UnknownValue(
7282 wkt::internal::UnknownEnumValue::String(value.to_string()),
7283 )),
7284 }
7285 }
7286 }
7287
7288 impl serde::ser::Serialize for Status {
7289 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7290 where
7291 S: serde::Serializer,
7292 {
7293 match self {
7294 Self::Unspecified => serializer.serialize_i32(0),
7295 Self::Running => serializer.serialize_i32(1),
7296 Self::NotRunning => serializer.serialize_i32(2),
7297 Self::UnknownValue(u) => u.0.serialize(serializer),
7298 }
7299 }
7300 }
7301
7302 impl<'de> serde::de::Deserialize<'de> for Status {
7303 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7304 where
7305 D: serde::Deserializer<'de>,
7306 {
7307 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
7308 ".google.cloud.networkmanagement.v1.InstanceInfo.Status",
7309 ))
7310 }
7311 }
7312}
7313
7314/// For display only. Metadata associated with a Compute Engine network.
7315#[derive(Clone, Default, PartialEq)]
7316#[non_exhaustive]
7317pub struct NetworkInfo {
7318 /// Name of a Compute Engine network.
7319 pub display_name: std::string::String,
7320
7321 /// URI of a Compute Engine network.
7322 pub uri: std::string::String,
7323
7324 /// URI of the subnet matching the source IP address of the test.
7325 pub matched_subnet_uri: std::string::String,
7326
7327 /// The IP range of the subnet matching the source IP address of the test.
7328 pub matched_ip_range: std::string::String,
7329
7330 /// The region of the subnet matching the source IP address of the test.
7331 pub region: std::string::String,
7332
7333 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7334}
7335
7336impl NetworkInfo {
7337 /// Creates a new default instance.
7338 pub fn new() -> Self {
7339 std::default::Default::default()
7340 }
7341
7342 /// Sets the value of [display_name][crate::model::NetworkInfo::display_name].
7343 ///
7344 /// # Example
7345 /// ```ignore,no_run
7346 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7347 /// let x = NetworkInfo::new().set_display_name("example");
7348 /// ```
7349 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7350 self.display_name = v.into();
7351 self
7352 }
7353
7354 /// Sets the value of [uri][crate::model::NetworkInfo::uri].
7355 ///
7356 /// # Example
7357 /// ```ignore,no_run
7358 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7359 /// let x = NetworkInfo::new().set_uri("example");
7360 /// ```
7361 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7362 self.uri = v.into();
7363 self
7364 }
7365
7366 /// Sets the value of [matched_subnet_uri][crate::model::NetworkInfo::matched_subnet_uri].
7367 ///
7368 /// # Example
7369 /// ```ignore,no_run
7370 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7371 /// let x = NetworkInfo::new().set_matched_subnet_uri("example");
7372 /// ```
7373 pub fn set_matched_subnet_uri<T: std::convert::Into<std::string::String>>(
7374 mut self,
7375 v: T,
7376 ) -> Self {
7377 self.matched_subnet_uri = v.into();
7378 self
7379 }
7380
7381 /// Sets the value of [matched_ip_range][crate::model::NetworkInfo::matched_ip_range].
7382 ///
7383 /// # Example
7384 /// ```ignore,no_run
7385 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7386 /// let x = NetworkInfo::new().set_matched_ip_range("example");
7387 /// ```
7388 pub fn set_matched_ip_range<T: std::convert::Into<std::string::String>>(
7389 mut self,
7390 v: T,
7391 ) -> Self {
7392 self.matched_ip_range = v.into();
7393 self
7394 }
7395
7396 /// Sets the value of [region][crate::model::NetworkInfo::region].
7397 ///
7398 /// # Example
7399 /// ```ignore,no_run
7400 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
7401 /// let x = NetworkInfo::new().set_region("example");
7402 /// ```
7403 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7404 self.region = v.into();
7405 self
7406 }
7407}
7408
7409impl wkt::message::Message for NetworkInfo {
7410 fn typename() -> &'static str {
7411 "type.googleapis.com/google.cloud.networkmanagement.v1.NetworkInfo"
7412 }
7413}
7414
7415/// For display only. Metadata associated with a VPC firewall rule, an implied
7416/// VPC firewall rule, or a firewall policy rule.
7417#[derive(Clone, Default, PartialEq)]
7418#[non_exhaustive]
7419pub struct FirewallInfo {
7420 /// The display name of the firewall rule. This field might be empty for
7421 /// firewall policy rules.
7422 pub display_name: std::string::String,
7423
7424 /// The URI of the firewall rule. This field is not applicable to implied
7425 /// VPC firewall rules.
7426 pub uri: std::string::String,
7427
7428 /// Possible values: INGRESS, EGRESS
7429 pub direction: std::string::String,
7430
7431 /// Possible values: ALLOW, DENY, APPLY_SECURITY_PROFILE_GROUP
7432 pub action: std::string::String,
7433
7434 /// The priority of the firewall rule.
7435 pub priority: i32,
7436
7437 /// The URI of the VPC network that the firewall rule is associated with.
7438 /// This field is not applicable to hierarchical firewall policy rules.
7439 pub network_uri: std::string::String,
7440
7441 /// The target tags defined by the VPC firewall rule. This field is not
7442 /// applicable to firewall policy rules.
7443 pub target_tags: std::vec::Vec<std::string::String>,
7444
7445 /// The target service accounts specified by the firewall rule.
7446 pub target_service_accounts: std::vec::Vec<std::string::String>,
7447
7448 /// The name of the firewall policy that this rule is associated with.
7449 /// This field is not applicable to VPC firewall rules and implied VPC firewall
7450 /// rules.
7451 pub policy: std::string::String,
7452
7453 /// The URI of the firewall policy that this rule is associated with.
7454 /// This field is not applicable to VPC firewall rules and implied VPC firewall
7455 /// rules.
7456 pub policy_uri: std::string::String,
7457
7458 /// The firewall rule's type.
7459 pub firewall_rule_type: crate::model::firewall_info::FirewallRuleType,
7460
7461 /// The priority of the firewall policy that this rule is associated with.
7462 /// This field is not applicable to VPC firewall rules and implied VPC firewall
7463 /// rules.
7464 pub policy_priority: i32,
7465
7466 /// Target type of the firewall rule.
7467 pub target_type: crate::model::firewall_info::TargetType,
7468
7469 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7470}
7471
7472impl FirewallInfo {
7473 /// Creates a new default instance.
7474 pub fn new() -> Self {
7475 std::default::Default::default()
7476 }
7477
7478 /// Sets the value of [display_name][crate::model::FirewallInfo::display_name].
7479 ///
7480 /// # Example
7481 /// ```ignore,no_run
7482 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7483 /// let x = FirewallInfo::new().set_display_name("example");
7484 /// ```
7485 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7486 self.display_name = v.into();
7487 self
7488 }
7489
7490 /// Sets the value of [uri][crate::model::FirewallInfo::uri].
7491 ///
7492 /// # Example
7493 /// ```ignore,no_run
7494 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7495 /// let x = FirewallInfo::new().set_uri("example");
7496 /// ```
7497 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7498 self.uri = v.into();
7499 self
7500 }
7501
7502 /// Sets the value of [direction][crate::model::FirewallInfo::direction].
7503 ///
7504 /// # Example
7505 /// ```ignore,no_run
7506 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7507 /// let x = FirewallInfo::new().set_direction("example");
7508 /// ```
7509 pub fn set_direction<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7510 self.direction = v.into();
7511 self
7512 }
7513
7514 /// Sets the value of [action][crate::model::FirewallInfo::action].
7515 ///
7516 /// # Example
7517 /// ```ignore,no_run
7518 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7519 /// let x = FirewallInfo::new().set_action("example");
7520 /// ```
7521 pub fn set_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7522 self.action = v.into();
7523 self
7524 }
7525
7526 /// Sets the value of [priority][crate::model::FirewallInfo::priority].
7527 ///
7528 /// # Example
7529 /// ```ignore,no_run
7530 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7531 /// let x = FirewallInfo::new().set_priority(42);
7532 /// ```
7533 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7534 self.priority = v.into();
7535 self
7536 }
7537
7538 /// Sets the value of [network_uri][crate::model::FirewallInfo::network_uri].
7539 ///
7540 /// # Example
7541 /// ```ignore,no_run
7542 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7543 /// let x = FirewallInfo::new().set_network_uri("example");
7544 /// ```
7545 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7546 self.network_uri = v.into();
7547 self
7548 }
7549
7550 /// Sets the value of [target_tags][crate::model::FirewallInfo::target_tags].
7551 ///
7552 /// # Example
7553 /// ```ignore,no_run
7554 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7555 /// let x = FirewallInfo::new().set_target_tags(["a", "b", "c"]);
7556 /// ```
7557 pub fn set_target_tags<T, V>(mut self, v: T) -> Self
7558 where
7559 T: std::iter::IntoIterator<Item = V>,
7560 V: std::convert::Into<std::string::String>,
7561 {
7562 use std::iter::Iterator;
7563 self.target_tags = v.into_iter().map(|i| i.into()).collect();
7564 self
7565 }
7566
7567 /// Sets the value of [target_service_accounts][crate::model::FirewallInfo::target_service_accounts].
7568 ///
7569 /// # Example
7570 /// ```ignore,no_run
7571 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7572 /// let x = FirewallInfo::new().set_target_service_accounts(["a", "b", "c"]);
7573 /// ```
7574 pub fn set_target_service_accounts<T, V>(mut self, v: T) -> Self
7575 where
7576 T: std::iter::IntoIterator<Item = V>,
7577 V: std::convert::Into<std::string::String>,
7578 {
7579 use std::iter::Iterator;
7580 self.target_service_accounts = v.into_iter().map(|i| i.into()).collect();
7581 self
7582 }
7583
7584 /// Sets the value of [policy][crate::model::FirewallInfo::policy].
7585 ///
7586 /// # Example
7587 /// ```ignore,no_run
7588 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7589 /// let x = FirewallInfo::new().set_policy("example");
7590 /// ```
7591 pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7592 self.policy = v.into();
7593 self
7594 }
7595
7596 /// Sets the value of [policy_uri][crate::model::FirewallInfo::policy_uri].
7597 ///
7598 /// # Example
7599 /// ```ignore,no_run
7600 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7601 /// let x = FirewallInfo::new().set_policy_uri("example");
7602 /// ```
7603 pub fn set_policy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7604 self.policy_uri = v.into();
7605 self
7606 }
7607
7608 /// Sets the value of [firewall_rule_type][crate::model::FirewallInfo::firewall_rule_type].
7609 ///
7610 /// # Example
7611 /// ```ignore,no_run
7612 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7613 /// use google_cloud_networkmanagement_v1::model::firewall_info::FirewallRuleType;
7614 /// let x0 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::HierarchicalFirewallPolicyRule);
7615 /// let x1 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::VpcFirewallRule);
7616 /// let x2 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::ImpliedVpcFirewallRule);
7617 /// ```
7618 pub fn set_firewall_rule_type<
7619 T: std::convert::Into<crate::model::firewall_info::FirewallRuleType>,
7620 >(
7621 mut self,
7622 v: T,
7623 ) -> Self {
7624 self.firewall_rule_type = v.into();
7625 self
7626 }
7627
7628 /// Sets the value of [policy_priority][crate::model::FirewallInfo::policy_priority].
7629 ///
7630 /// # Example
7631 /// ```ignore,no_run
7632 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7633 /// let x = FirewallInfo::new().set_policy_priority(42);
7634 /// ```
7635 pub fn set_policy_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7636 self.policy_priority = v.into();
7637 self
7638 }
7639
7640 /// Sets the value of [target_type][crate::model::FirewallInfo::target_type].
7641 ///
7642 /// # Example
7643 /// ```ignore,no_run
7644 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
7645 /// use google_cloud_networkmanagement_v1::model::firewall_info::TargetType;
7646 /// let x0 = FirewallInfo::new().set_target_type(TargetType::Instances);
7647 /// let x1 = FirewallInfo::new().set_target_type(TargetType::InternalManagedLb);
7648 /// ```
7649 pub fn set_target_type<T: std::convert::Into<crate::model::firewall_info::TargetType>>(
7650 mut self,
7651 v: T,
7652 ) -> Self {
7653 self.target_type = v.into();
7654 self
7655 }
7656}
7657
7658impl wkt::message::Message for FirewallInfo {
7659 fn typename() -> &'static str {
7660 "type.googleapis.com/google.cloud.networkmanagement.v1.FirewallInfo"
7661 }
7662}
7663
7664/// Defines additional types related to [FirewallInfo].
7665pub mod firewall_info {
7666 #[allow(unused_imports)]
7667 use super::*;
7668
7669 /// The firewall rule's type.
7670 ///
7671 /// # Working with unknown values
7672 ///
7673 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7674 /// additional enum variants at any time. Adding new variants is not considered
7675 /// a breaking change. Applications should write their code in anticipation of:
7676 ///
7677 /// - New values appearing in future releases of the client library, **and**
7678 /// - New values received dynamically, without application changes.
7679 ///
7680 /// Please consult the [Working with enums] section in the user guide for some
7681 /// guidelines.
7682 ///
7683 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7684 #[derive(Clone, Debug, PartialEq)]
7685 #[non_exhaustive]
7686 pub enum FirewallRuleType {
7687 /// Unspecified type.
7688 Unspecified,
7689 /// Hierarchical firewall policy rule. For details, see
7690 /// [Hierarchical firewall policies
7691 /// overview](https://cloud.google.com/vpc/docs/firewall-policies).
7692 HierarchicalFirewallPolicyRule,
7693 /// VPC firewall rule. For details, see
7694 /// [VPC firewall rules
7695 /// overview](https://cloud.google.com/vpc/docs/firewalls).
7696 VpcFirewallRule,
7697 /// Implied VPC firewall rule. For details, see
7698 /// [Implied
7699 /// rules](https://cloud.google.com/vpc/docs/firewalls#default_firewall_rules).
7700 ImpliedVpcFirewallRule,
7701 /// Implicit firewall rules that are managed by serverless VPC access to
7702 /// allow ingress access. They are not visible in the Google Cloud console.
7703 /// For details, see [VPC connector's implicit
7704 /// rules](https://cloud.google.com/functions/docs/networking/connecting-vpc#restrict-access).
7705 ServerlessVpcAccessManagedFirewallRule,
7706 /// User-defined global network firewall policy rule.
7707 /// For details, see [Network firewall
7708 /// policies](https://cloud.google.com/vpc/docs/network-firewall-policies).
7709 NetworkFirewallPolicyRule,
7710 /// User-defined regional network firewall policy rule.
7711 /// For details, see [Regional network firewall
7712 /// policies](https://cloud.google.com/firewall/docs/regional-firewall-policies).
7713 NetworkRegionalFirewallPolicyRule,
7714 /// System-defined global network firewall policy rule.
7715 SystemNetworkFirewallPolicyRule,
7716 /// System-defined regional network firewall policy rule.
7717 SystemRegionalNetworkFirewallPolicyRule,
7718 /// Firewall policy rule containing attributes not yet supported in
7719 /// Connectivity tests. Firewall analysis is skipped if such a rule can
7720 /// potentially be matched. Please see the [list of unsupported
7721 /// configurations](https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/concepts/overview#unsupported-configs).
7722 UnsupportedFirewallPolicyRule,
7723 /// Tracking state for response traffic created when request traffic goes
7724 /// through allow firewall rule.
7725 /// For details, see [firewall rules
7726 /// specifications](https://cloud.google.com/firewall/docs/firewalls#specifications)
7727 TrackingState,
7728 /// Firewall analysis was skipped due to executing Connectivity Test in the
7729 /// BypassFirewallChecks mode
7730 AnalysisSkipped,
7731 /// If set, the enum was initialized with an unknown value.
7732 ///
7733 /// Applications can examine the value using [FirewallRuleType::value] or
7734 /// [FirewallRuleType::name].
7735 UnknownValue(firewall_rule_type::UnknownValue),
7736 }
7737
7738 #[doc(hidden)]
7739 pub mod firewall_rule_type {
7740 #[allow(unused_imports)]
7741 use super::*;
7742 #[derive(Clone, Debug, PartialEq)]
7743 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7744 }
7745
7746 impl FirewallRuleType {
7747 /// Gets the enum value.
7748 ///
7749 /// Returns `None` if the enum contains an unknown value deserialized from
7750 /// the string representation of enums.
7751 pub fn value(&self) -> std::option::Option<i32> {
7752 match self {
7753 Self::Unspecified => std::option::Option::Some(0),
7754 Self::HierarchicalFirewallPolicyRule => std::option::Option::Some(1),
7755 Self::VpcFirewallRule => std::option::Option::Some(2),
7756 Self::ImpliedVpcFirewallRule => std::option::Option::Some(3),
7757 Self::ServerlessVpcAccessManagedFirewallRule => std::option::Option::Some(4),
7758 Self::NetworkFirewallPolicyRule => std::option::Option::Some(5),
7759 Self::NetworkRegionalFirewallPolicyRule => std::option::Option::Some(6),
7760 Self::SystemNetworkFirewallPolicyRule => std::option::Option::Some(7),
7761 Self::SystemRegionalNetworkFirewallPolicyRule => std::option::Option::Some(8),
7762 Self::UnsupportedFirewallPolicyRule => std::option::Option::Some(100),
7763 Self::TrackingState => std::option::Option::Some(101),
7764 Self::AnalysisSkipped => std::option::Option::Some(102),
7765 Self::UnknownValue(u) => u.0.value(),
7766 }
7767 }
7768
7769 /// Gets the enum value as a string.
7770 ///
7771 /// Returns `None` if the enum contains an unknown value deserialized from
7772 /// the integer representation of enums.
7773 pub fn name(&self) -> std::option::Option<&str> {
7774 match self {
7775 Self::Unspecified => std::option::Option::Some("FIREWALL_RULE_TYPE_UNSPECIFIED"),
7776 Self::HierarchicalFirewallPolicyRule => {
7777 std::option::Option::Some("HIERARCHICAL_FIREWALL_POLICY_RULE")
7778 }
7779 Self::VpcFirewallRule => std::option::Option::Some("VPC_FIREWALL_RULE"),
7780 Self::ImpliedVpcFirewallRule => {
7781 std::option::Option::Some("IMPLIED_VPC_FIREWALL_RULE")
7782 }
7783 Self::ServerlessVpcAccessManagedFirewallRule => {
7784 std::option::Option::Some("SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE")
7785 }
7786 Self::NetworkFirewallPolicyRule => {
7787 std::option::Option::Some("NETWORK_FIREWALL_POLICY_RULE")
7788 }
7789 Self::NetworkRegionalFirewallPolicyRule => {
7790 std::option::Option::Some("NETWORK_REGIONAL_FIREWALL_POLICY_RULE")
7791 }
7792 Self::SystemNetworkFirewallPolicyRule => {
7793 std::option::Option::Some("SYSTEM_NETWORK_FIREWALL_POLICY_RULE")
7794 }
7795 Self::SystemRegionalNetworkFirewallPolicyRule => {
7796 std::option::Option::Some("SYSTEM_REGIONAL_NETWORK_FIREWALL_POLICY_RULE")
7797 }
7798 Self::UnsupportedFirewallPolicyRule => {
7799 std::option::Option::Some("UNSUPPORTED_FIREWALL_POLICY_RULE")
7800 }
7801 Self::TrackingState => std::option::Option::Some("TRACKING_STATE"),
7802 Self::AnalysisSkipped => std::option::Option::Some("ANALYSIS_SKIPPED"),
7803 Self::UnknownValue(u) => u.0.name(),
7804 }
7805 }
7806 }
7807
7808 impl std::default::Default for FirewallRuleType {
7809 fn default() -> Self {
7810 use std::convert::From;
7811 Self::from(0)
7812 }
7813 }
7814
7815 impl std::fmt::Display for FirewallRuleType {
7816 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7817 wkt::internal::display_enum(f, self.name(), self.value())
7818 }
7819 }
7820
7821 impl std::convert::From<i32> for FirewallRuleType {
7822 fn from(value: i32) -> Self {
7823 match value {
7824 0 => Self::Unspecified,
7825 1 => Self::HierarchicalFirewallPolicyRule,
7826 2 => Self::VpcFirewallRule,
7827 3 => Self::ImpliedVpcFirewallRule,
7828 4 => Self::ServerlessVpcAccessManagedFirewallRule,
7829 5 => Self::NetworkFirewallPolicyRule,
7830 6 => Self::NetworkRegionalFirewallPolicyRule,
7831 7 => Self::SystemNetworkFirewallPolicyRule,
7832 8 => Self::SystemRegionalNetworkFirewallPolicyRule,
7833 100 => Self::UnsupportedFirewallPolicyRule,
7834 101 => Self::TrackingState,
7835 102 => Self::AnalysisSkipped,
7836 _ => Self::UnknownValue(firewall_rule_type::UnknownValue(
7837 wkt::internal::UnknownEnumValue::Integer(value),
7838 )),
7839 }
7840 }
7841 }
7842
7843 impl std::convert::From<&str> for FirewallRuleType {
7844 fn from(value: &str) -> Self {
7845 use std::string::ToString;
7846 match value {
7847 "FIREWALL_RULE_TYPE_UNSPECIFIED" => Self::Unspecified,
7848 "HIERARCHICAL_FIREWALL_POLICY_RULE" => Self::HierarchicalFirewallPolicyRule,
7849 "VPC_FIREWALL_RULE" => Self::VpcFirewallRule,
7850 "IMPLIED_VPC_FIREWALL_RULE" => Self::ImpliedVpcFirewallRule,
7851 "SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE" => {
7852 Self::ServerlessVpcAccessManagedFirewallRule
7853 }
7854 "NETWORK_FIREWALL_POLICY_RULE" => Self::NetworkFirewallPolicyRule,
7855 "NETWORK_REGIONAL_FIREWALL_POLICY_RULE" => Self::NetworkRegionalFirewallPolicyRule,
7856 "SYSTEM_NETWORK_FIREWALL_POLICY_RULE" => Self::SystemNetworkFirewallPolicyRule,
7857 "SYSTEM_REGIONAL_NETWORK_FIREWALL_POLICY_RULE" => {
7858 Self::SystemRegionalNetworkFirewallPolicyRule
7859 }
7860 "UNSUPPORTED_FIREWALL_POLICY_RULE" => Self::UnsupportedFirewallPolicyRule,
7861 "TRACKING_STATE" => Self::TrackingState,
7862 "ANALYSIS_SKIPPED" => Self::AnalysisSkipped,
7863 _ => Self::UnknownValue(firewall_rule_type::UnknownValue(
7864 wkt::internal::UnknownEnumValue::String(value.to_string()),
7865 )),
7866 }
7867 }
7868 }
7869
7870 impl serde::ser::Serialize for FirewallRuleType {
7871 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7872 where
7873 S: serde::Serializer,
7874 {
7875 match self {
7876 Self::Unspecified => serializer.serialize_i32(0),
7877 Self::HierarchicalFirewallPolicyRule => serializer.serialize_i32(1),
7878 Self::VpcFirewallRule => serializer.serialize_i32(2),
7879 Self::ImpliedVpcFirewallRule => serializer.serialize_i32(3),
7880 Self::ServerlessVpcAccessManagedFirewallRule => serializer.serialize_i32(4),
7881 Self::NetworkFirewallPolicyRule => serializer.serialize_i32(5),
7882 Self::NetworkRegionalFirewallPolicyRule => serializer.serialize_i32(6),
7883 Self::SystemNetworkFirewallPolicyRule => serializer.serialize_i32(7),
7884 Self::SystemRegionalNetworkFirewallPolicyRule => serializer.serialize_i32(8),
7885 Self::UnsupportedFirewallPolicyRule => serializer.serialize_i32(100),
7886 Self::TrackingState => serializer.serialize_i32(101),
7887 Self::AnalysisSkipped => serializer.serialize_i32(102),
7888 Self::UnknownValue(u) => u.0.serialize(serializer),
7889 }
7890 }
7891 }
7892
7893 impl<'de> serde::de::Deserialize<'de> for FirewallRuleType {
7894 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7895 where
7896 D: serde::Deserializer<'de>,
7897 {
7898 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FirewallRuleType>::new(
7899 ".google.cloud.networkmanagement.v1.FirewallInfo.FirewallRuleType",
7900 ))
7901 }
7902 }
7903
7904 /// Target type of the firewall rule.
7905 ///
7906 /// # Working with unknown values
7907 ///
7908 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7909 /// additional enum variants at any time. Adding new variants is not considered
7910 /// a breaking change. Applications should write their code in anticipation of:
7911 ///
7912 /// - New values appearing in future releases of the client library, **and**
7913 /// - New values received dynamically, without application changes.
7914 ///
7915 /// Please consult the [Working with enums] section in the user guide for some
7916 /// guidelines.
7917 ///
7918 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7919 #[derive(Clone, Debug, PartialEq)]
7920 #[non_exhaustive]
7921 pub enum TargetType {
7922 /// Target type is not specified. In this case we treat the rule as applying
7923 /// to INSTANCES target type.
7924 Unspecified,
7925 /// Firewall rule applies to instances.
7926 Instances,
7927 /// Firewall rule applies to internal managed load balancers.
7928 InternalManagedLb,
7929 /// If set, the enum was initialized with an unknown value.
7930 ///
7931 /// Applications can examine the value using [TargetType::value] or
7932 /// [TargetType::name].
7933 UnknownValue(target_type::UnknownValue),
7934 }
7935
7936 #[doc(hidden)]
7937 pub mod target_type {
7938 #[allow(unused_imports)]
7939 use super::*;
7940 #[derive(Clone, Debug, PartialEq)]
7941 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7942 }
7943
7944 impl TargetType {
7945 /// Gets the enum value.
7946 ///
7947 /// Returns `None` if the enum contains an unknown value deserialized from
7948 /// the string representation of enums.
7949 pub fn value(&self) -> std::option::Option<i32> {
7950 match self {
7951 Self::Unspecified => std::option::Option::Some(0),
7952 Self::Instances => std::option::Option::Some(1),
7953 Self::InternalManagedLb => std::option::Option::Some(2),
7954 Self::UnknownValue(u) => u.0.value(),
7955 }
7956 }
7957
7958 /// Gets the enum value as a string.
7959 ///
7960 /// Returns `None` if the enum contains an unknown value deserialized from
7961 /// the integer representation of enums.
7962 pub fn name(&self) -> std::option::Option<&str> {
7963 match self {
7964 Self::Unspecified => std::option::Option::Some("TARGET_TYPE_UNSPECIFIED"),
7965 Self::Instances => std::option::Option::Some("INSTANCES"),
7966 Self::InternalManagedLb => std::option::Option::Some("INTERNAL_MANAGED_LB"),
7967 Self::UnknownValue(u) => u.0.name(),
7968 }
7969 }
7970 }
7971
7972 impl std::default::Default for TargetType {
7973 fn default() -> Self {
7974 use std::convert::From;
7975 Self::from(0)
7976 }
7977 }
7978
7979 impl std::fmt::Display for TargetType {
7980 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7981 wkt::internal::display_enum(f, self.name(), self.value())
7982 }
7983 }
7984
7985 impl std::convert::From<i32> for TargetType {
7986 fn from(value: i32) -> Self {
7987 match value {
7988 0 => Self::Unspecified,
7989 1 => Self::Instances,
7990 2 => Self::InternalManagedLb,
7991 _ => Self::UnknownValue(target_type::UnknownValue(
7992 wkt::internal::UnknownEnumValue::Integer(value),
7993 )),
7994 }
7995 }
7996 }
7997
7998 impl std::convert::From<&str> for TargetType {
7999 fn from(value: &str) -> Self {
8000 use std::string::ToString;
8001 match value {
8002 "TARGET_TYPE_UNSPECIFIED" => Self::Unspecified,
8003 "INSTANCES" => Self::Instances,
8004 "INTERNAL_MANAGED_LB" => Self::InternalManagedLb,
8005 _ => Self::UnknownValue(target_type::UnknownValue(
8006 wkt::internal::UnknownEnumValue::String(value.to_string()),
8007 )),
8008 }
8009 }
8010 }
8011
8012 impl serde::ser::Serialize for TargetType {
8013 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8014 where
8015 S: serde::Serializer,
8016 {
8017 match self {
8018 Self::Unspecified => serializer.serialize_i32(0),
8019 Self::Instances => serializer.serialize_i32(1),
8020 Self::InternalManagedLb => serializer.serialize_i32(2),
8021 Self::UnknownValue(u) => u.0.serialize(serializer),
8022 }
8023 }
8024 }
8025
8026 impl<'de> serde::de::Deserialize<'de> for TargetType {
8027 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8028 where
8029 D: serde::Deserializer<'de>,
8030 {
8031 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetType>::new(
8032 ".google.cloud.networkmanagement.v1.FirewallInfo.TargetType",
8033 ))
8034 }
8035 }
8036}
8037
8038/// For display only. Metadata associated with a Compute Engine route.
8039#[derive(Clone, Default, PartialEq)]
8040#[non_exhaustive]
8041pub struct RouteInfo {
8042 /// Type of route.
8043 pub route_type: crate::model::route_info::RouteType,
8044
8045 /// Type of next hop.
8046 pub next_hop_type: crate::model::route_info::NextHopType,
8047
8048 /// Indicates where route is applicable. Deprecated, routes with NCC_HUB scope
8049 /// are not included in the trace in new tests.
8050 #[deprecated]
8051 pub route_scope: crate::model::route_info::RouteScope,
8052
8053 /// Name of a route.
8054 pub display_name: std::string::String,
8055
8056 /// URI of a route. SUBNET, STATIC, PEERING_SUBNET (only for peering network)
8057 /// and POLICY_BASED routes only.
8058 pub uri: std::string::String,
8059
8060 /// Region of the route. DYNAMIC, PEERING_DYNAMIC, POLICY_BASED and ADVERTISED
8061 /// routes only. If set for POLICY_BASED route, this is a region of VLAN
8062 /// attachments for Cloud Interconnect the route applies to. If set to "all"
8063 /// for POLICY_BASED route, the route applies to VLAN attachments of Cloud
8064 /// Interconnect in all regions.
8065 pub region: std::string::String,
8066
8067 /// Destination IP range of the route.
8068 pub dest_ip_range: std::string::String,
8069
8070 /// String type of the next hop of the route (for example, "VPN tunnel").
8071 /// Deprecated in favor of the next_hop_type and next_hop_uri fields, not used
8072 /// in new tests.
8073 #[deprecated]
8074 pub next_hop: std::string::String,
8075
8076 /// URI of a VPC network where route is located.
8077 pub network_uri: std::string::String,
8078
8079 /// Priority of the route.
8080 pub priority: i32,
8081
8082 /// Instance tags of the route.
8083 pub instance_tags: std::vec::Vec<std::string::String>,
8084
8085 /// Source IP address range of the route. POLICY_BASED routes only.
8086 pub src_ip_range: std::string::String,
8087
8088 /// Destination port ranges of the route. POLICY_BASED routes only.
8089 pub dest_port_ranges: std::vec::Vec<std::string::String>,
8090
8091 /// Source port ranges of the route. POLICY_BASED routes only.
8092 pub src_port_ranges: std::vec::Vec<std::string::String>,
8093
8094 /// Protocols of the route. POLICY_BASED routes only.
8095 pub protocols: std::vec::Vec<std::string::String>,
8096
8097 /// URI of the NCC Hub the route is advertised by. PEERING_SUBNET and
8098 /// PEERING_DYNAMIC routes that are advertised by NCC Hub only.
8099 pub ncc_hub_uri: std::option::Option<std::string::String>,
8100
8101 /// URI of the destination NCC Spoke. PEERING_SUBNET and PEERING_DYNAMIC routes
8102 /// that are advertised by NCC Hub only.
8103 pub ncc_spoke_uri: std::option::Option<std::string::String>,
8104
8105 /// For ADVERTISED dynamic routes, the URI of the Cloud Router that advertised
8106 /// the corresponding IP prefix.
8107 pub advertised_route_source_router_uri: std::option::Option<std::string::String>,
8108
8109 /// For ADVERTISED routes, the URI of their next hop, i.e. the URI of the
8110 /// hybrid endpoint (VPN tunnel, Interconnect attachment, NCC router appliance)
8111 /// the advertised prefix is advertised through, or URI of the source peered
8112 /// network. Deprecated in favor of the next_hop_uri field, not used in new
8113 /// tests.
8114 #[deprecated]
8115 pub advertised_route_next_hop_uri: std::option::Option<std::string::String>,
8116
8117 /// URI of the next hop resource.
8118 pub next_hop_uri: std::string::String,
8119
8120 /// URI of a VPC network where the next hop resource is located.
8121 pub next_hop_network_uri: std::string::String,
8122
8123 /// For PEERING_SUBNET and PEERING_STATIC routes, the URI of the originating
8124 /// SUBNET/STATIC route.
8125 pub originating_route_uri: std::string::String,
8126
8127 /// For PEERING_SUBNET, PEERING_STATIC and PEERING_DYNAMIC routes, the name of
8128 /// the originating SUBNET/STATIC/DYNAMIC route.
8129 pub originating_route_display_name: std::string::String,
8130
8131 /// For PEERING_SUBNET and PEERING_DYNAMIC routes that are advertised by NCC
8132 /// Hub, the URI of the corresponding route in NCC Hub's routing table.
8133 pub ncc_hub_route_uri: std::string::String,
8134
8135 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8136}
8137
8138impl RouteInfo {
8139 /// Creates a new default instance.
8140 pub fn new() -> Self {
8141 std::default::Default::default()
8142 }
8143
8144 /// Sets the value of [route_type][crate::model::RouteInfo::route_type].
8145 ///
8146 /// # Example
8147 /// ```ignore,no_run
8148 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8149 /// use google_cloud_networkmanagement_v1::model::route_info::RouteType;
8150 /// let x0 = RouteInfo::new().set_route_type(RouteType::Subnet);
8151 /// let x1 = RouteInfo::new().set_route_type(RouteType::Static);
8152 /// let x2 = RouteInfo::new().set_route_type(RouteType::Dynamic);
8153 /// ```
8154 pub fn set_route_type<T: std::convert::Into<crate::model::route_info::RouteType>>(
8155 mut self,
8156 v: T,
8157 ) -> Self {
8158 self.route_type = v.into();
8159 self
8160 }
8161
8162 /// Sets the value of [next_hop_type][crate::model::RouteInfo::next_hop_type].
8163 ///
8164 /// # Example
8165 /// ```ignore,no_run
8166 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8167 /// use google_cloud_networkmanagement_v1::model::route_info::NextHopType;
8168 /// let x0 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopIp);
8169 /// let x1 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopInstance);
8170 /// let x2 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopNetwork);
8171 /// ```
8172 pub fn set_next_hop_type<T: std::convert::Into<crate::model::route_info::NextHopType>>(
8173 mut self,
8174 v: T,
8175 ) -> Self {
8176 self.next_hop_type = v.into();
8177 self
8178 }
8179
8180 /// Sets the value of [route_scope][crate::model::RouteInfo::route_scope].
8181 ///
8182 /// # Example
8183 /// ```ignore,no_run
8184 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8185 /// use google_cloud_networkmanagement_v1::model::route_info::RouteScope;
8186 /// let x0 = RouteInfo::new().set_route_scope(RouteScope::Network);
8187 /// let x1 = RouteInfo::new().set_route_scope(RouteScope::NccHub);
8188 /// ```
8189 #[deprecated]
8190 pub fn set_route_scope<T: std::convert::Into<crate::model::route_info::RouteScope>>(
8191 mut self,
8192 v: T,
8193 ) -> Self {
8194 self.route_scope = v.into();
8195 self
8196 }
8197
8198 /// Sets the value of [display_name][crate::model::RouteInfo::display_name].
8199 ///
8200 /// # Example
8201 /// ```ignore,no_run
8202 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8203 /// let x = RouteInfo::new().set_display_name("example");
8204 /// ```
8205 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8206 self.display_name = v.into();
8207 self
8208 }
8209
8210 /// Sets the value of [uri][crate::model::RouteInfo::uri].
8211 ///
8212 /// # Example
8213 /// ```ignore,no_run
8214 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8215 /// let x = RouteInfo::new().set_uri("example");
8216 /// ```
8217 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8218 self.uri = v.into();
8219 self
8220 }
8221
8222 /// Sets the value of [region][crate::model::RouteInfo::region].
8223 ///
8224 /// # Example
8225 /// ```ignore,no_run
8226 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8227 /// let x = RouteInfo::new().set_region("example");
8228 /// ```
8229 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8230 self.region = v.into();
8231 self
8232 }
8233
8234 /// Sets the value of [dest_ip_range][crate::model::RouteInfo::dest_ip_range].
8235 ///
8236 /// # Example
8237 /// ```ignore,no_run
8238 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8239 /// let x = RouteInfo::new().set_dest_ip_range("example");
8240 /// ```
8241 pub fn set_dest_ip_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8242 self.dest_ip_range = v.into();
8243 self
8244 }
8245
8246 /// Sets the value of [next_hop][crate::model::RouteInfo::next_hop].
8247 ///
8248 /// # Example
8249 /// ```ignore,no_run
8250 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8251 /// let x = RouteInfo::new().set_next_hop("example");
8252 /// ```
8253 #[deprecated]
8254 pub fn set_next_hop<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8255 self.next_hop = v.into();
8256 self
8257 }
8258
8259 /// Sets the value of [network_uri][crate::model::RouteInfo::network_uri].
8260 ///
8261 /// # Example
8262 /// ```ignore,no_run
8263 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8264 /// let x = RouteInfo::new().set_network_uri("example");
8265 /// ```
8266 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8267 self.network_uri = v.into();
8268 self
8269 }
8270
8271 /// Sets the value of [priority][crate::model::RouteInfo::priority].
8272 ///
8273 /// # Example
8274 /// ```ignore,no_run
8275 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8276 /// let x = RouteInfo::new().set_priority(42);
8277 /// ```
8278 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8279 self.priority = v.into();
8280 self
8281 }
8282
8283 /// Sets the value of [instance_tags][crate::model::RouteInfo::instance_tags].
8284 ///
8285 /// # Example
8286 /// ```ignore,no_run
8287 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8288 /// let x = RouteInfo::new().set_instance_tags(["a", "b", "c"]);
8289 /// ```
8290 pub fn set_instance_tags<T, V>(mut self, v: T) -> Self
8291 where
8292 T: std::iter::IntoIterator<Item = V>,
8293 V: std::convert::Into<std::string::String>,
8294 {
8295 use std::iter::Iterator;
8296 self.instance_tags = v.into_iter().map(|i| i.into()).collect();
8297 self
8298 }
8299
8300 /// Sets the value of [src_ip_range][crate::model::RouteInfo::src_ip_range].
8301 ///
8302 /// # Example
8303 /// ```ignore,no_run
8304 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8305 /// let x = RouteInfo::new().set_src_ip_range("example");
8306 /// ```
8307 pub fn set_src_ip_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8308 self.src_ip_range = v.into();
8309 self
8310 }
8311
8312 /// Sets the value of [dest_port_ranges][crate::model::RouteInfo::dest_port_ranges].
8313 ///
8314 /// # Example
8315 /// ```ignore,no_run
8316 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8317 /// let x = RouteInfo::new().set_dest_port_ranges(["a", "b", "c"]);
8318 /// ```
8319 pub fn set_dest_port_ranges<T, V>(mut self, v: T) -> Self
8320 where
8321 T: std::iter::IntoIterator<Item = V>,
8322 V: std::convert::Into<std::string::String>,
8323 {
8324 use std::iter::Iterator;
8325 self.dest_port_ranges = v.into_iter().map(|i| i.into()).collect();
8326 self
8327 }
8328
8329 /// Sets the value of [src_port_ranges][crate::model::RouteInfo::src_port_ranges].
8330 ///
8331 /// # Example
8332 /// ```ignore,no_run
8333 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8334 /// let x = RouteInfo::new().set_src_port_ranges(["a", "b", "c"]);
8335 /// ```
8336 pub fn set_src_port_ranges<T, V>(mut self, v: T) -> Self
8337 where
8338 T: std::iter::IntoIterator<Item = V>,
8339 V: std::convert::Into<std::string::String>,
8340 {
8341 use std::iter::Iterator;
8342 self.src_port_ranges = v.into_iter().map(|i| i.into()).collect();
8343 self
8344 }
8345
8346 /// Sets the value of [protocols][crate::model::RouteInfo::protocols].
8347 ///
8348 /// # Example
8349 /// ```ignore,no_run
8350 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8351 /// let x = RouteInfo::new().set_protocols(["a", "b", "c"]);
8352 /// ```
8353 pub fn set_protocols<T, V>(mut self, v: T) -> Self
8354 where
8355 T: std::iter::IntoIterator<Item = V>,
8356 V: std::convert::Into<std::string::String>,
8357 {
8358 use std::iter::Iterator;
8359 self.protocols = v.into_iter().map(|i| i.into()).collect();
8360 self
8361 }
8362
8363 /// Sets the value of [ncc_hub_uri][crate::model::RouteInfo::ncc_hub_uri].
8364 ///
8365 /// # Example
8366 /// ```ignore,no_run
8367 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8368 /// let x = RouteInfo::new().set_ncc_hub_uri("example");
8369 /// ```
8370 pub fn set_ncc_hub_uri<T>(mut self, v: T) -> Self
8371 where
8372 T: std::convert::Into<std::string::String>,
8373 {
8374 self.ncc_hub_uri = std::option::Option::Some(v.into());
8375 self
8376 }
8377
8378 /// Sets or clears the value of [ncc_hub_uri][crate::model::RouteInfo::ncc_hub_uri].
8379 ///
8380 /// # Example
8381 /// ```ignore,no_run
8382 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8383 /// let x = RouteInfo::new().set_or_clear_ncc_hub_uri(Some("example"));
8384 /// let x = RouteInfo::new().set_or_clear_ncc_hub_uri(None::<String>);
8385 /// ```
8386 pub fn set_or_clear_ncc_hub_uri<T>(mut self, v: std::option::Option<T>) -> Self
8387 where
8388 T: std::convert::Into<std::string::String>,
8389 {
8390 self.ncc_hub_uri = v.map(|x| x.into());
8391 self
8392 }
8393
8394 /// Sets the value of [ncc_spoke_uri][crate::model::RouteInfo::ncc_spoke_uri].
8395 ///
8396 /// # Example
8397 /// ```ignore,no_run
8398 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8399 /// let x = RouteInfo::new().set_ncc_spoke_uri("example");
8400 /// ```
8401 pub fn set_ncc_spoke_uri<T>(mut self, v: T) -> Self
8402 where
8403 T: std::convert::Into<std::string::String>,
8404 {
8405 self.ncc_spoke_uri = std::option::Option::Some(v.into());
8406 self
8407 }
8408
8409 /// Sets or clears the value of [ncc_spoke_uri][crate::model::RouteInfo::ncc_spoke_uri].
8410 ///
8411 /// # Example
8412 /// ```ignore,no_run
8413 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8414 /// let x = RouteInfo::new().set_or_clear_ncc_spoke_uri(Some("example"));
8415 /// let x = RouteInfo::new().set_or_clear_ncc_spoke_uri(None::<String>);
8416 /// ```
8417 pub fn set_or_clear_ncc_spoke_uri<T>(mut self, v: std::option::Option<T>) -> Self
8418 where
8419 T: std::convert::Into<std::string::String>,
8420 {
8421 self.ncc_spoke_uri = v.map(|x| x.into());
8422 self
8423 }
8424
8425 /// Sets the value of [advertised_route_source_router_uri][crate::model::RouteInfo::advertised_route_source_router_uri].
8426 ///
8427 /// # Example
8428 /// ```ignore,no_run
8429 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8430 /// let x = RouteInfo::new().set_advertised_route_source_router_uri("example");
8431 /// ```
8432 pub fn set_advertised_route_source_router_uri<T>(mut self, v: T) -> Self
8433 where
8434 T: std::convert::Into<std::string::String>,
8435 {
8436 self.advertised_route_source_router_uri = std::option::Option::Some(v.into());
8437 self
8438 }
8439
8440 /// Sets or clears the value of [advertised_route_source_router_uri][crate::model::RouteInfo::advertised_route_source_router_uri].
8441 ///
8442 /// # Example
8443 /// ```ignore,no_run
8444 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8445 /// let x = RouteInfo::new().set_or_clear_advertised_route_source_router_uri(Some("example"));
8446 /// let x = RouteInfo::new().set_or_clear_advertised_route_source_router_uri(None::<String>);
8447 /// ```
8448 pub fn set_or_clear_advertised_route_source_router_uri<T>(
8449 mut self,
8450 v: std::option::Option<T>,
8451 ) -> Self
8452 where
8453 T: std::convert::Into<std::string::String>,
8454 {
8455 self.advertised_route_source_router_uri = v.map(|x| x.into());
8456 self
8457 }
8458
8459 /// Sets the value of [advertised_route_next_hop_uri][crate::model::RouteInfo::advertised_route_next_hop_uri].
8460 ///
8461 /// # Example
8462 /// ```ignore,no_run
8463 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8464 /// let x = RouteInfo::new().set_advertised_route_next_hop_uri("example");
8465 /// ```
8466 #[deprecated]
8467 pub fn set_advertised_route_next_hop_uri<T>(mut self, v: T) -> Self
8468 where
8469 T: std::convert::Into<std::string::String>,
8470 {
8471 self.advertised_route_next_hop_uri = std::option::Option::Some(v.into());
8472 self
8473 }
8474
8475 /// Sets or clears the value of [advertised_route_next_hop_uri][crate::model::RouteInfo::advertised_route_next_hop_uri].
8476 ///
8477 /// # Example
8478 /// ```ignore,no_run
8479 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8480 /// let x = RouteInfo::new().set_or_clear_advertised_route_next_hop_uri(Some("example"));
8481 /// let x = RouteInfo::new().set_or_clear_advertised_route_next_hop_uri(None::<String>);
8482 /// ```
8483 #[deprecated]
8484 pub fn set_or_clear_advertised_route_next_hop_uri<T>(
8485 mut self,
8486 v: std::option::Option<T>,
8487 ) -> Self
8488 where
8489 T: std::convert::Into<std::string::String>,
8490 {
8491 self.advertised_route_next_hop_uri = v.map(|x| x.into());
8492 self
8493 }
8494
8495 /// Sets the value of [next_hop_uri][crate::model::RouteInfo::next_hop_uri].
8496 ///
8497 /// # Example
8498 /// ```ignore,no_run
8499 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8500 /// let x = RouteInfo::new().set_next_hop_uri("example");
8501 /// ```
8502 pub fn set_next_hop_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8503 self.next_hop_uri = v.into();
8504 self
8505 }
8506
8507 /// Sets the value of [next_hop_network_uri][crate::model::RouteInfo::next_hop_network_uri].
8508 ///
8509 /// # Example
8510 /// ```ignore,no_run
8511 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8512 /// let x = RouteInfo::new().set_next_hop_network_uri("example");
8513 /// ```
8514 pub fn set_next_hop_network_uri<T: std::convert::Into<std::string::String>>(
8515 mut self,
8516 v: T,
8517 ) -> Self {
8518 self.next_hop_network_uri = v.into();
8519 self
8520 }
8521
8522 /// Sets the value of [originating_route_uri][crate::model::RouteInfo::originating_route_uri].
8523 ///
8524 /// # Example
8525 /// ```ignore,no_run
8526 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8527 /// let x = RouteInfo::new().set_originating_route_uri("example");
8528 /// ```
8529 pub fn set_originating_route_uri<T: std::convert::Into<std::string::String>>(
8530 mut self,
8531 v: T,
8532 ) -> Self {
8533 self.originating_route_uri = v.into();
8534 self
8535 }
8536
8537 /// Sets the value of [originating_route_display_name][crate::model::RouteInfo::originating_route_display_name].
8538 ///
8539 /// # Example
8540 /// ```ignore,no_run
8541 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8542 /// let x = RouteInfo::new().set_originating_route_display_name("example");
8543 /// ```
8544 pub fn set_originating_route_display_name<T: std::convert::Into<std::string::String>>(
8545 mut self,
8546 v: T,
8547 ) -> Self {
8548 self.originating_route_display_name = v.into();
8549 self
8550 }
8551
8552 /// Sets the value of [ncc_hub_route_uri][crate::model::RouteInfo::ncc_hub_route_uri].
8553 ///
8554 /// # Example
8555 /// ```ignore,no_run
8556 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
8557 /// let x = RouteInfo::new().set_ncc_hub_route_uri("example");
8558 /// ```
8559 pub fn set_ncc_hub_route_uri<T: std::convert::Into<std::string::String>>(
8560 mut self,
8561 v: T,
8562 ) -> Self {
8563 self.ncc_hub_route_uri = v.into();
8564 self
8565 }
8566}
8567
8568impl wkt::message::Message for RouteInfo {
8569 fn typename() -> &'static str {
8570 "type.googleapis.com/google.cloud.networkmanagement.v1.RouteInfo"
8571 }
8572}
8573
8574/// Defines additional types related to [RouteInfo].
8575pub mod route_info {
8576 #[allow(unused_imports)]
8577 use super::*;
8578
8579 /// Type of route:
8580 ///
8581 /// # Working with unknown values
8582 ///
8583 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8584 /// additional enum variants at any time. Adding new variants is not considered
8585 /// a breaking change. Applications should write their code in anticipation of:
8586 ///
8587 /// - New values appearing in future releases of the client library, **and**
8588 /// - New values received dynamically, without application changes.
8589 ///
8590 /// Please consult the [Working with enums] section in the user guide for some
8591 /// guidelines.
8592 ///
8593 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8594 #[derive(Clone, Debug, PartialEq)]
8595 #[non_exhaustive]
8596 pub enum RouteType {
8597 /// Unspecified type. Default value.
8598 Unspecified,
8599 /// Route is a subnet route automatically created by the system.
8600 Subnet,
8601 /// Static route created by the user, including the default route to the
8602 /// internet.
8603 Static,
8604 /// Dynamic route exchanged between BGP peers.
8605 Dynamic,
8606 /// A subnet route received from peering network or NCC Hub.
8607 PeeringSubnet,
8608 /// A static route received from peering network.
8609 PeeringStatic,
8610 /// A dynamic route received from peering network or NCC Hub.
8611 PeeringDynamic,
8612 /// Policy based route.
8613 PolicyBased,
8614 /// Advertised route. Synthetic route which is used to transition from the
8615 /// StartFromPrivateNetwork state in Connectivity tests.
8616 Advertised,
8617 /// If set, the enum was initialized with an unknown value.
8618 ///
8619 /// Applications can examine the value using [RouteType::value] or
8620 /// [RouteType::name].
8621 UnknownValue(route_type::UnknownValue),
8622 }
8623
8624 #[doc(hidden)]
8625 pub mod route_type {
8626 #[allow(unused_imports)]
8627 use super::*;
8628 #[derive(Clone, Debug, PartialEq)]
8629 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8630 }
8631
8632 impl RouteType {
8633 /// Gets the enum value.
8634 ///
8635 /// Returns `None` if the enum contains an unknown value deserialized from
8636 /// the string representation of enums.
8637 pub fn value(&self) -> std::option::Option<i32> {
8638 match self {
8639 Self::Unspecified => std::option::Option::Some(0),
8640 Self::Subnet => std::option::Option::Some(1),
8641 Self::Static => std::option::Option::Some(2),
8642 Self::Dynamic => std::option::Option::Some(3),
8643 Self::PeeringSubnet => std::option::Option::Some(4),
8644 Self::PeeringStatic => std::option::Option::Some(5),
8645 Self::PeeringDynamic => std::option::Option::Some(6),
8646 Self::PolicyBased => std::option::Option::Some(7),
8647 Self::Advertised => std::option::Option::Some(101),
8648 Self::UnknownValue(u) => u.0.value(),
8649 }
8650 }
8651
8652 /// Gets the enum value as a string.
8653 ///
8654 /// Returns `None` if the enum contains an unknown value deserialized from
8655 /// the integer representation of enums.
8656 pub fn name(&self) -> std::option::Option<&str> {
8657 match self {
8658 Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
8659 Self::Subnet => std::option::Option::Some("SUBNET"),
8660 Self::Static => std::option::Option::Some("STATIC"),
8661 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
8662 Self::PeeringSubnet => std::option::Option::Some("PEERING_SUBNET"),
8663 Self::PeeringStatic => std::option::Option::Some("PEERING_STATIC"),
8664 Self::PeeringDynamic => std::option::Option::Some("PEERING_DYNAMIC"),
8665 Self::PolicyBased => std::option::Option::Some("POLICY_BASED"),
8666 Self::Advertised => std::option::Option::Some("ADVERTISED"),
8667 Self::UnknownValue(u) => u.0.name(),
8668 }
8669 }
8670 }
8671
8672 impl std::default::Default for RouteType {
8673 fn default() -> Self {
8674 use std::convert::From;
8675 Self::from(0)
8676 }
8677 }
8678
8679 impl std::fmt::Display for RouteType {
8680 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8681 wkt::internal::display_enum(f, self.name(), self.value())
8682 }
8683 }
8684
8685 impl std::convert::From<i32> for RouteType {
8686 fn from(value: i32) -> Self {
8687 match value {
8688 0 => Self::Unspecified,
8689 1 => Self::Subnet,
8690 2 => Self::Static,
8691 3 => Self::Dynamic,
8692 4 => Self::PeeringSubnet,
8693 5 => Self::PeeringStatic,
8694 6 => Self::PeeringDynamic,
8695 7 => Self::PolicyBased,
8696 101 => Self::Advertised,
8697 _ => Self::UnknownValue(route_type::UnknownValue(
8698 wkt::internal::UnknownEnumValue::Integer(value),
8699 )),
8700 }
8701 }
8702 }
8703
8704 impl std::convert::From<&str> for RouteType {
8705 fn from(value: &str) -> Self {
8706 use std::string::ToString;
8707 match value {
8708 "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
8709 "SUBNET" => Self::Subnet,
8710 "STATIC" => Self::Static,
8711 "DYNAMIC" => Self::Dynamic,
8712 "PEERING_SUBNET" => Self::PeeringSubnet,
8713 "PEERING_STATIC" => Self::PeeringStatic,
8714 "PEERING_DYNAMIC" => Self::PeeringDynamic,
8715 "POLICY_BASED" => Self::PolicyBased,
8716 "ADVERTISED" => Self::Advertised,
8717 _ => Self::UnknownValue(route_type::UnknownValue(
8718 wkt::internal::UnknownEnumValue::String(value.to_string()),
8719 )),
8720 }
8721 }
8722 }
8723
8724 impl serde::ser::Serialize for RouteType {
8725 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8726 where
8727 S: serde::Serializer,
8728 {
8729 match self {
8730 Self::Unspecified => serializer.serialize_i32(0),
8731 Self::Subnet => serializer.serialize_i32(1),
8732 Self::Static => serializer.serialize_i32(2),
8733 Self::Dynamic => serializer.serialize_i32(3),
8734 Self::PeeringSubnet => serializer.serialize_i32(4),
8735 Self::PeeringStatic => serializer.serialize_i32(5),
8736 Self::PeeringDynamic => serializer.serialize_i32(6),
8737 Self::PolicyBased => serializer.serialize_i32(7),
8738 Self::Advertised => serializer.serialize_i32(101),
8739 Self::UnknownValue(u) => u.0.serialize(serializer),
8740 }
8741 }
8742 }
8743
8744 impl<'de> serde::de::Deserialize<'de> for RouteType {
8745 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8746 where
8747 D: serde::Deserializer<'de>,
8748 {
8749 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
8750 ".google.cloud.networkmanagement.v1.RouteInfo.RouteType",
8751 ))
8752 }
8753 }
8754
8755 /// Type of next hop:
8756 ///
8757 /// # Working with unknown values
8758 ///
8759 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8760 /// additional enum variants at any time. Adding new variants is not considered
8761 /// a breaking change. Applications should write their code in anticipation of:
8762 ///
8763 /// - New values appearing in future releases of the client library, **and**
8764 /// - New values received dynamically, without application changes.
8765 ///
8766 /// Please consult the [Working with enums] section in the user guide for some
8767 /// guidelines.
8768 ///
8769 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8770 #[derive(Clone, Debug, PartialEq)]
8771 #[non_exhaustive]
8772 pub enum NextHopType {
8773 /// Unspecified type. Default value.
8774 Unspecified,
8775 /// Next hop is an IP address.
8776 NextHopIp,
8777 /// Next hop is a Compute Engine instance.
8778 NextHopInstance,
8779 /// Next hop is a VPC network gateway.
8780 NextHopNetwork,
8781 /// Next hop is a peering VPC. This scenario only happens when the user
8782 /// doesn't have permissions to the project where the next hop resource is
8783 /// located.
8784 NextHopPeering,
8785 /// Next hop is an interconnect.
8786 NextHopInterconnect,
8787 /// Next hop is a VPN tunnel.
8788 NextHopVpnTunnel,
8789 /// Next hop is a VPN gateway. This scenario only happens when tracing
8790 /// connectivity from an on-premises network to Google Cloud through a VPN.
8791 /// The analysis simulates a packet departing from the on-premises network
8792 /// through a VPN tunnel and arriving at a Cloud VPN gateway.
8793 NextHopVpnGateway,
8794 /// Next hop is an internet gateway.
8795 NextHopInternetGateway,
8796 /// Next hop is blackhole; that is, the next hop either does not exist or is
8797 /// unusable.
8798 NextHopBlackhole,
8799 /// Next hop is the forwarding rule of an Internal Load Balancer.
8800 NextHopIlb,
8801 /// Next hop is a
8802 /// [router appliance
8803 /// instance](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/ra-overview).
8804 NextHopRouterAppliance,
8805 /// Next hop is an NCC hub. This scenario only happens when the user doesn't
8806 /// have permissions to the project where the next hop resource is located.
8807 NextHopNccHub,
8808 /// Next hop is Secure Web Proxy Gateway.
8809 SecureWebProxyGateway,
8810 /// If set, the enum was initialized with an unknown value.
8811 ///
8812 /// Applications can examine the value using [NextHopType::value] or
8813 /// [NextHopType::name].
8814 UnknownValue(next_hop_type::UnknownValue),
8815 }
8816
8817 #[doc(hidden)]
8818 pub mod next_hop_type {
8819 #[allow(unused_imports)]
8820 use super::*;
8821 #[derive(Clone, Debug, PartialEq)]
8822 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8823 }
8824
8825 impl NextHopType {
8826 /// Gets the enum value.
8827 ///
8828 /// Returns `None` if the enum contains an unknown value deserialized from
8829 /// the string representation of enums.
8830 pub fn value(&self) -> std::option::Option<i32> {
8831 match self {
8832 Self::Unspecified => std::option::Option::Some(0),
8833 Self::NextHopIp => std::option::Option::Some(1),
8834 Self::NextHopInstance => std::option::Option::Some(2),
8835 Self::NextHopNetwork => std::option::Option::Some(3),
8836 Self::NextHopPeering => std::option::Option::Some(4),
8837 Self::NextHopInterconnect => std::option::Option::Some(5),
8838 Self::NextHopVpnTunnel => std::option::Option::Some(6),
8839 Self::NextHopVpnGateway => std::option::Option::Some(7),
8840 Self::NextHopInternetGateway => std::option::Option::Some(8),
8841 Self::NextHopBlackhole => std::option::Option::Some(9),
8842 Self::NextHopIlb => std::option::Option::Some(10),
8843 Self::NextHopRouterAppliance => std::option::Option::Some(11),
8844 Self::NextHopNccHub => std::option::Option::Some(12),
8845 Self::SecureWebProxyGateway => std::option::Option::Some(13),
8846 Self::UnknownValue(u) => u.0.value(),
8847 }
8848 }
8849
8850 /// Gets the enum value as a string.
8851 ///
8852 /// Returns `None` if the enum contains an unknown value deserialized from
8853 /// the integer representation of enums.
8854 pub fn name(&self) -> std::option::Option<&str> {
8855 match self {
8856 Self::Unspecified => std::option::Option::Some("NEXT_HOP_TYPE_UNSPECIFIED"),
8857 Self::NextHopIp => std::option::Option::Some("NEXT_HOP_IP"),
8858 Self::NextHopInstance => std::option::Option::Some("NEXT_HOP_INSTANCE"),
8859 Self::NextHopNetwork => std::option::Option::Some("NEXT_HOP_NETWORK"),
8860 Self::NextHopPeering => std::option::Option::Some("NEXT_HOP_PEERING"),
8861 Self::NextHopInterconnect => std::option::Option::Some("NEXT_HOP_INTERCONNECT"),
8862 Self::NextHopVpnTunnel => std::option::Option::Some("NEXT_HOP_VPN_TUNNEL"),
8863 Self::NextHopVpnGateway => std::option::Option::Some("NEXT_HOP_VPN_GATEWAY"),
8864 Self::NextHopInternetGateway => {
8865 std::option::Option::Some("NEXT_HOP_INTERNET_GATEWAY")
8866 }
8867 Self::NextHopBlackhole => std::option::Option::Some("NEXT_HOP_BLACKHOLE"),
8868 Self::NextHopIlb => std::option::Option::Some("NEXT_HOP_ILB"),
8869 Self::NextHopRouterAppliance => {
8870 std::option::Option::Some("NEXT_HOP_ROUTER_APPLIANCE")
8871 }
8872 Self::NextHopNccHub => std::option::Option::Some("NEXT_HOP_NCC_HUB"),
8873 Self::SecureWebProxyGateway => {
8874 std::option::Option::Some("SECURE_WEB_PROXY_GATEWAY")
8875 }
8876 Self::UnknownValue(u) => u.0.name(),
8877 }
8878 }
8879 }
8880
8881 impl std::default::Default for NextHopType {
8882 fn default() -> Self {
8883 use std::convert::From;
8884 Self::from(0)
8885 }
8886 }
8887
8888 impl std::fmt::Display for NextHopType {
8889 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8890 wkt::internal::display_enum(f, self.name(), self.value())
8891 }
8892 }
8893
8894 impl std::convert::From<i32> for NextHopType {
8895 fn from(value: i32) -> Self {
8896 match value {
8897 0 => Self::Unspecified,
8898 1 => Self::NextHopIp,
8899 2 => Self::NextHopInstance,
8900 3 => Self::NextHopNetwork,
8901 4 => Self::NextHopPeering,
8902 5 => Self::NextHopInterconnect,
8903 6 => Self::NextHopVpnTunnel,
8904 7 => Self::NextHopVpnGateway,
8905 8 => Self::NextHopInternetGateway,
8906 9 => Self::NextHopBlackhole,
8907 10 => Self::NextHopIlb,
8908 11 => Self::NextHopRouterAppliance,
8909 12 => Self::NextHopNccHub,
8910 13 => Self::SecureWebProxyGateway,
8911 _ => Self::UnknownValue(next_hop_type::UnknownValue(
8912 wkt::internal::UnknownEnumValue::Integer(value),
8913 )),
8914 }
8915 }
8916 }
8917
8918 impl std::convert::From<&str> for NextHopType {
8919 fn from(value: &str) -> Self {
8920 use std::string::ToString;
8921 match value {
8922 "NEXT_HOP_TYPE_UNSPECIFIED" => Self::Unspecified,
8923 "NEXT_HOP_IP" => Self::NextHopIp,
8924 "NEXT_HOP_INSTANCE" => Self::NextHopInstance,
8925 "NEXT_HOP_NETWORK" => Self::NextHopNetwork,
8926 "NEXT_HOP_PEERING" => Self::NextHopPeering,
8927 "NEXT_HOP_INTERCONNECT" => Self::NextHopInterconnect,
8928 "NEXT_HOP_VPN_TUNNEL" => Self::NextHopVpnTunnel,
8929 "NEXT_HOP_VPN_GATEWAY" => Self::NextHopVpnGateway,
8930 "NEXT_HOP_INTERNET_GATEWAY" => Self::NextHopInternetGateway,
8931 "NEXT_HOP_BLACKHOLE" => Self::NextHopBlackhole,
8932 "NEXT_HOP_ILB" => Self::NextHopIlb,
8933 "NEXT_HOP_ROUTER_APPLIANCE" => Self::NextHopRouterAppliance,
8934 "NEXT_HOP_NCC_HUB" => Self::NextHopNccHub,
8935 "SECURE_WEB_PROXY_GATEWAY" => Self::SecureWebProxyGateway,
8936 _ => Self::UnknownValue(next_hop_type::UnknownValue(
8937 wkt::internal::UnknownEnumValue::String(value.to_string()),
8938 )),
8939 }
8940 }
8941 }
8942
8943 impl serde::ser::Serialize for NextHopType {
8944 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8945 where
8946 S: serde::Serializer,
8947 {
8948 match self {
8949 Self::Unspecified => serializer.serialize_i32(0),
8950 Self::NextHopIp => serializer.serialize_i32(1),
8951 Self::NextHopInstance => serializer.serialize_i32(2),
8952 Self::NextHopNetwork => serializer.serialize_i32(3),
8953 Self::NextHopPeering => serializer.serialize_i32(4),
8954 Self::NextHopInterconnect => serializer.serialize_i32(5),
8955 Self::NextHopVpnTunnel => serializer.serialize_i32(6),
8956 Self::NextHopVpnGateway => serializer.serialize_i32(7),
8957 Self::NextHopInternetGateway => serializer.serialize_i32(8),
8958 Self::NextHopBlackhole => serializer.serialize_i32(9),
8959 Self::NextHopIlb => serializer.serialize_i32(10),
8960 Self::NextHopRouterAppliance => serializer.serialize_i32(11),
8961 Self::NextHopNccHub => serializer.serialize_i32(12),
8962 Self::SecureWebProxyGateway => serializer.serialize_i32(13),
8963 Self::UnknownValue(u) => u.0.serialize(serializer),
8964 }
8965 }
8966 }
8967
8968 impl<'de> serde::de::Deserialize<'de> for NextHopType {
8969 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8970 where
8971 D: serde::Deserializer<'de>,
8972 {
8973 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NextHopType>::new(
8974 ".google.cloud.networkmanagement.v1.RouteInfo.NextHopType",
8975 ))
8976 }
8977 }
8978
8979 /// Indicates where routes are applicable.
8980 ///
8981 /// # Working with unknown values
8982 ///
8983 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8984 /// additional enum variants at any time. Adding new variants is not considered
8985 /// a breaking change. Applications should write their code in anticipation of:
8986 ///
8987 /// - New values appearing in future releases of the client library, **and**
8988 /// - New values received dynamically, without application changes.
8989 ///
8990 /// Please consult the [Working with enums] section in the user guide for some
8991 /// guidelines.
8992 ///
8993 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8994 #[derive(Clone, Debug, PartialEq)]
8995 #[non_exhaustive]
8996 pub enum RouteScope {
8997 /// Unspecified scope. Default value.
8998 Unspecified,
8999 /// Route is applicable to packets in Network.
9000 Network,
9001 /// Route is applicable to packets using NCC Hub's routing table.
9002 NccHub,
9003 /// If set, the enum was initialized with an unknown value.
9004 ///
9005 /// Applications can examine the value using [RouteScope::value] or
9006 /// [RouteScope::name].
9007 UnknownValue(route_scope::UnknownValue),
9008 }
9009
9010 #[doc(hidden)]
9011 pub mod route_scope {
9012 #[allow(unused_imports)]
9013 use super::*;
9014 #[derive(Clone, Debug, PartialEq)]
9015 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9016 }
9017
9018 impl RouteScope {
9019 /// Gets the enum value.
9020 ///
9021 /// Returns `None` if the enum contains an unknown value deserialized from
9022 /// the string representation of enums.
9023 pub fn value(&self) -> std::option::Option<i32> {
9024 match self {
9025 Self::Unspecified => std::option::Option::Some(0),
9026 Self::Network => std::option::Option::Some(1),
9027 Self::NccHub => std::option::Option::Some(2),
9028 Self::UnknownValue(u) => u.0.value(),
9029 }
9030 }
9031
9032 /// Gets the enum value as a string.
9033 ///
9034 /// Returns `None` if the enum contains an unknown value deserialized from
9035 /// the integer representation of enums.
9036 pub fn name(&self) -> std::option::Option<&str> {
9037 match self {
9038 Self::Unspecified => std::option::Option::Some("ROUTE_SCOPE_UNSPECIFIED"),
9039 Self::Network => std::option::Option::Some("NETWORK"),
9040 Self::NccHub => std::option::Option::Some("NCC_HUB"),
9041 Self::UnknownValue(u) => u.0.name(),
9042 }
9043 }
9044 }
9045
9046 impl std::default::Default for RouteScope {
9047 fn default() -> Self {
9048 use std::convert::From;
9049 Self::from(0)
9050 }
9051 }
9052
9053 impl std::fmt::Display for RouteScope {
9054 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9055 wkt::internal::display_enum(f, self.name(), self.value())
9056 }
9057 }
9058
9059 impl std::convert::From<i32> for RouteScope {
9060 fn from(value: i32) -> Self {
9061 match value {
9062 0 => Self::Unspecified,
9063 1 => Self::Network,
9064 2 => Self::NccHub,
9065 _ => Self::UnknownValue(route_scope::UnknownValue(
9066 wkt::internal::UnknownEnumValue::Integer(value),
9067 )),
9068 }
9069 }
9070 }
9071
9072 impl std::convert::From<&str> for RouteScope {
9073 fn from(value: &str) -> Self {
9074 use std::string::ToString;
9075 match value {
9076 "ROUTE_SCOPE_UNSPECIFIED" => Self::Unspecified,
9077 "NETWORK" => Self::Network,
9078 "NCC_HUB" => Self::NccHub,
9079 _ => Self::UnknownValue(route_scope::UnknownValue(
9080 wkt::internal::UnknownEnumValue::String(value.to_string()),
9081 )),
9082 }
9083 }
9084 }
9085
9086 impl serde::ser::Serialize for RouteScope {
9087 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9088 where
9089 S: serde::Serializer,
9090 {
9091 match self {
9092 Self::Unspecified => serializer.serialize_i32(0),
9093 Self::Network => serializer.serialize_i32(1),
9094 Self::NccHub => serializer.serialize_i32(2),
9095 Self::UnknownValue(u) => u.0.serialize(serializer),
9096 }
9097 }
9098 }
9099
9100 impl<'de> serde::de::Deserialize<'de> for RouteScope {
9101 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9102 where
9103 D: serde::Deserializer<'de>,
9104 {
9105 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteScope>::new(
9106 ".google.cloud.networkmanagement.v1.RouteInfo.RouteScope",
9107 ))
9108 }
9109 }
9110}
9111
9112/// For display only. Details of a Google Service sending packets to a
9113/// VPC network. Although the source IP might be a publicly routable address,
9114/// some Google Services use special routes within Google production
9115/// infrastructure to reach Compute Engine Instances.
9116/// <https://cloud.google.com/vpc/docs/routes#special_return_paths>
9117#[derive(Clone, Default, PartialEq)]
9118#[non_exhaustive]
9119pub struct GoogleServiceInfo {
9120 /// Source IP address.
9121 pub source_ip: std::string::String,
9122
9123 /// Recognized type of a Google Service.
9124 pub google_service_type: crate::model::google_service_info::GoogleServiceType,
9125
9126 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9127}
9128
9129impl GoogleServiceInfo {
9130 /// Creates a new default instance.
9131 pub fn new() -> Self {
9132 std::default::Default::default()
9133 }
9134
9135 /// Sets the value of [source_ip][crate::model::GoogleServiceInfo::source_ip].
9136 ///
9137 /// # Example
9138 /// ```ignore,no_run
9139 /// # use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
9140 /// let x = GoogleServiceInfo::new().set_source_ip("example");
9141 /// ```
9142 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9143 self.source_ip = v.into();
9144 self
9145 }
9146
9147 /// Sets the value of [google_service_type][crate::model::GoogleServiceInfo::google_service_type].
9148 ///
9149 /// # Example
9150 /// ```ignore,no_run
9151 /// # use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
9152 /// use google_cloud_networkmanagement_v1::model::google_service_info::GoogleServiceType;
9153 /// let x0 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::Iap);
9154 /// let x1 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::GfeProxyOrHealthCheckProber);
9155 /// let x2 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::CloudDns);
9156 /// ```
9157 pub fn set_google_service_type<
9158 T: std::convert::Into<crate::model::google_service_info::GoogleServiceType>,
9159 >(
9160 mut self,
9161 v: T,
9162 ) -> Self {
9163 self.google_service_type = v.into();
9164 self
9165 }
9166}
9167
9168impl wkt::message::Message for GoogleServiceInfo {
9169 fn typename() -> &'static str {
9170 "type.googleapis.com/google.cloud.networkmanagement.v1.GoogleServiceInfo"
9171 }
9172}
9173
9174/// Defines additional types related to [GoogleServiceInfo].
9175pub mod google_service_info {
9176 #[allow(unused_imports)]
9177 use super::*;
9178
9179 /// Recognized type of a Google Service.
9180 ///
9181 /// # Working with unknown values
9182 ///
9183 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9184 /// additional enum variants at any time. Adding new variants is not considered
9185 /// a breaking change. Applications should write their code in anticipation of:
9186 ///
9187 /// - New values appearing in future releases of the client library, **and**
9188 /// - New values received dynamically, without application changes.
9189 ///
9190 /// Please consult the [Working with enums] section in the user guide for some
9191 /// guidelines.
9192 ///
9193 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9194 #[derive(Clone, Debug, PartialEq)]
9195 #[non_exhaustive]
9196 pub enum GoogleServiceType {
9197 /// Unspecified Google Service.
9198 Unspecified,
9199 /// Identity aware proxy.
9200 /// <https://cloud.google.com/iap/docs/using-tcp-forwarding>
9201 Iap,
9202 /// One of two services sharing IP ranges:
9203 ///
9204 /// * Load Balancer proxy
9205 /// * Centralized Health Check prober
9206 /// <https://cloud.google.com/load-balancing/docs/firewall-rules>
9207 GfeProxyOrHealthCheckProber,
9208 /// Connectivity from Cloud DNS to forwarding targets or alternate name
9209 /// servers that use private routing.
9210 /// <https://cloud.google.com/dns/docs/zones/forwarding-zones#firewall-rules>
9211 /// <https://cloud.google.com/dns/docs/policies#firewall-rules>
9212 CloudDns,
9213 /// private.googleapis.com and restricted.googleapis.com
9214 GoogleApi,
9215 /// Google API via Private Service Connect.
9216 /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
9217 GoogleApiPsc,
9218 /// Google API via VPC Service Controls.
9219 /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
9220 GoogleApiVpcSc,
9221 /// Google API via Serverless VPC Access.
9222 /// <https://cloud.google.com/vpc/docs/serverless-vpc-access>
9223 ServerlessVpcAccess,
9224 /// If set, the enum was initialized with an unknown value.
9225 ///
9226 /// Applications can examine the value using [GoogleServiceType::value] or
9227 /// [GoogleServiceType::name].
9228 UnknownValue(google_service_type::UnknownValue),
9229 }
9230
9231 #[doc(hidden)]
9232 pub mod google_service_type {
9233 #[allow(unused_imports)]
9234 use super::*;
9235 #[derive(Clone, Debug, PartialEq)]
9236 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9237 }
9238
9239 impl GoogleServiceType {
9240 /// Gets the enum value.
9241 ///
9242 /// Returns `None` if the enum contains an unknown value deserialized from
9243 /// the string representation of enums.
9244 pub fn value(&self) -> std::option::Option<i32> {
9245 match self {
9246 Self::Unspecified => std::option::Option::Some(0),
9247 Self::Iap => std::option::Option::Some(1),
9248 Self::GfeProxyOrHealthCheckProber => std::option::Option::Some(2),
9249 Self::CloudDns => std::option::Option::Some(3),
9250 Self::GoogleApi => std::option::Option::Some(4),
9251 Self::GoogleApiPsc => std::option::Option::Some(5),
9252 Self::GoogleApiVpcSc => std::option::Option::Some(6),
9253 Self::ServerlessVpcAccess => std::option::Option::Some(7),
9254 Self::UnknownValue(u) => u.0.value(),
9255 }
9256 }
9257
9258 /// Gets the enum value as a string.
9259 ///
9260 /// Returns `None` if the enum contains an unknown value deserialized from
9261 /// the integer representation of enums.
9262 pub fn name(&self) -> std::option::Option<&str> {
9263 match self {
9264 Self::Unspecified => std::option::Option::Some("GOOGLE_SERVICE_TYPE_UNSPECIFIED"),
9265 Self::Iap => std::option::Option::Some("IAP"),
9266 Self::GfeProxyOrHealthCheckProber => {
9267 std::option::Option::Some("GFE_PROXY_OR_HEALTH_CHECK_PROBER")
9268 }
9269 Self::CloudDns => std::option::Option::Some("CLOUD_DNS"),
9270 Self::GoogleApi => std::option::Option::Some("GOOGLE_API"),
9271 Self::GoogleApiPsc => std::option::Option::Some("GOOGLE_API_PSC"),
9272 Self::GoogleApiVpcSc => std::option::Option::Some("GOOGLE_API_VPC_SC"),
9273 Self::ServerlessVpcAccess => std::option::Option::Some("SERVERLESS_VPC_ACCESS"),
9274 Self::UnknownValue(u) => u.0.name(),
9275 }
9276 }
9277 }
9278
9279 impl std::default::Default for GoogleServiceType {
9280 fn default() -> Self {
9281 use std::convert::From;
9282 Self::from(0)
9283 }
9284 }
9285
9286 impl std::fmt::Display for GoogleServiceType {
9287 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9288 wkt::internal::display_enum(f, self.name(), self.value())
9289 }
9290 }
9291
9292 impl std::convert::From<i32> for GoogleServiceType {
9293 fn from(value: i32) -> Self {
9294 match value {
9295 0 => Self::Unspecified,
9296 1 => Self::Iap,
9297 2 => Self::GfeProxyOrHealthCheckProber,
9298 3 => Self::CloudDns,
9299 4 => Self::GoogleApi,
9300 5 => Self::GoogleApiPsc,
9301 6 => Self::GoogleApiVpcSc,
9302 7 => Self::ServerlessVpcAccess,
9303 _ => Self::UnknownValue(google_service_type::UnknownValue(
9304 wkt::internal::UnknownEnumValue::Integer(value),
9305 )),
9306 }
9307 }
9308 }
9309
9310 impl std::convert::From<&str> for GoogleServiceType {
9311 fn from(value: &str) -> Self {
9312 use std::string::ToString;
9313 match value {
9314 "GOOGLE_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
9315 "IAP" => Self::Iap,
9316 "GFE_PROXY_OR_HEALTH_CHECK_PROBER" => Self::GfeProxyOrHealthCheckProber,
9317 "CLOUD_DNS" => Self::CloudDns,
9318 "GOOGLE_API" => Self::GoogleApi,
9319 "GOOGLE_API_PSC" => Self::GoogleApiPsc,
9320 "GOOGLE_API_VPC_SC" => Self::GoogleApiVpcSc,
9321 "SERVERLESS_VPC_ACCESS" => Self::ServerlessVpcAccess,
9322 _ => Self::UnknownValue(google_service_type::UnknownValue(
9323 wkt::internal::UnknownEnumValue::String(value.to_string()),
9324 )),
9325 }
9326 }
9327 }
9328
9329 impl serde::ser::Serialize for GoogleServiceType {
9330 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9331 where
9332 S: serde::Serializer,
9333 {
9334 match self {
9335 Self::Unspecified => serializer.serialize_i32(0),
9336 Self::Iap => serializer.serialize_i32(1),
9337 Self::GfeProxyOrHealthCheckProber => serializer.serialize_i32(2),
9338 Self::CloudDns => serializer.serialize_i32(3),
9339 Self::GoogleApi => serializer.serialize_i32(4),
9340 Self::GoogleApiPsc => serializer.serialize_i32(5),
9341 Self::GoogleApiVpcSc => serializer.serialize_i32(6),
9342 Self::ServerlessVpcAccess => serializer.serialize_i32(7),
9343 Self::UnknownValue(u) => u.0.serialize(serializer),
9344 }
9345 }
9346 }
9347
9348 impl<'de> serde::de::Deserialize<'de> for GoogleServiceType {
9349 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9350 where
9351 D: serde::Deserializer<'de>,
9352 {
9353 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GoogleServiceType>::new(
9354 ".google.cloud.networkmanagement.v1.GoogleServiceInfo.GoogleServiceType",
9355 ))
9356 }
9357 }
9358}
9359
9360/// For display only. Metadata associated with a Compute Engine forwarding rule.
9361#[derive(Clone, Default, PartialEq)]
9362#[non_exhaustive]
9363pub struct ForwardingRuleInfo {
9364 /// Name of the forwarding rule.
9365 pub display_name: std::string::String,
9366
9367 /// URI of the forwarding rule.
9368 pub uri: std::string::String,
9369
9370 /// Protocol defined in the forwarding rule that matches the packet.
9371 pub matched_protocol: std::string::String,
9372
9373 /// Port range defined in the forwarding rule that matches the packet.
9374 pub matched_port_range: std::string::String,
9375
9376 /// VIP of the forwarding rule.
9377 pub vip: std::string::String,
9378
9379 /// Target type of the forwarding rule.
9380 pub target: std::string::String,
9381
9382 /// Network URI.
9383 pub network_uri: std::string::String,
9384
9385 /// Region of the forwarding rule. Set only for regional forwarding rules.
9386 pub region: std::string::String,
9387
9388 /// Name of the load balancer the forwarding rule belongs to. Empty for
9389 /// forwarding rules not related to load balancers (like PSC forwarding rules).
9390 pub load_balancer_name: std::string::String,
9391
9392 /// URI of the PSC service attachment this forwarding rule targets (if
9393 /// applicable).
9394 pub psc_service_attachment_uri: std::string::String,
9395
9396 /// PSC Google API target this forwarding rule targets (if applicable).
9397 pub psc_google_api_target: std::string::String,
9398
9399 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9400}
9401
9402impl ForwardingRuleInfo {
9403 /// Creates a new default instance.
9404 pub fn new() -> Self {
9405 std::default::Default::default()
9406 }
9407
9408 /// Sets the value of [display_name][crate::model::ForwardingRuleInfo::display_name].
9409 ///
9410 /// # Example
9411 /// ```ignore,no_run
9412 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9413 /// let x = ForwardingRuleInfo::new().set_display_name("example");
9414 /// ```
9415 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9416 self.display_name = v.into();
9417 self
9418 }
9419
9420 /// Sets the value of [uri][crate::model::ForwardingRuleInfo::uri].
9421 ///
9422 /// # Example
9423 /// ```ignore,no_run
9424 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9425 /// let x = ForwardingRuleInfo::new().set_uri("example");
9426 /// ```
9427 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9428 self.uri = v.into();
9429 self
9430 }
9431
9432 /// Sets the value of [matched_protocol][crate::model::ForwardingRuleInfo::matched_protocol].
9433 ///
9434 /// # Example
9435 /// ```ignore,no_run
9436 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9437 /// let x = ForwardingRuleInfo::new().set_matched_protocol("example");
9438 /// ```
9439 pub fn set_matched_protocol<T: std::convert::Into<std::string::String>>(
9440 mut self,
9441 v: T,
9442 ) -> Self {
9443 self.matched_protocol = v.into();
9444 self
9445 }
9446
9447 /// Sets the value of [matched_port_range][crate::model::ForwardingRuleInfo::matched_port_range].
9448 ///
9449 /// # Example
9450 /// ```ignore,no_run
9451 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9452 /// let x = ForwardingRuleInfo::new().set_matched_port_range("example");
9453 /// ```
9454 pub fn set_matched_port_range<T: std::convert::Into<std::string::String>>(
9455 mut self,
9456 v: T,
9457 ) -> Self {
9458 self.matched_port_range = v.into();
9459 self
9460 }
9461
9462 /// Sets the value of [vip][crate::model::ForwardingRuleInfo::vip].
9463 ///
9464 /// # Example
9465 /// ```ignore,no_run
9466 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9467 /// let x = ForwardingRuleInfo::new().set_vip("example");
9468 /// ```
9469 pub fn set_vip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9470 self.vip = v.into();
9471 self
9472 }
9473
9474 /// Sets the value of [target][crate::model::ForwardingRuleInfo::target].
9475 ///
9476 /// # Example
9477 /// ```ignore,no_run
9478 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9479 /// let x = ForwardingRuleInfo::new().set_target("example");
9480 /// ```
9481 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9482 self.target = v.into();
9483 self
9484 }
9485
9486 /// Sets the value of [network_uri][crate::model::ForwardingRuleInfo::network_uri].
9487 ///
9488 /// # Example
9489 /// ```ignore,no_run
9490 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9491 /// let x = ForwardingRuleInfo::new().set_network_uri("example");
9492 /// ```
9493 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9494 self.network_uri = v.into();
9495 self
9496 }
9497
9498 /// Sets the value of [region][crate::model::ForwardingRuleInfo::region].
9499 ///
9500 /// # Example
9501 /// ```ignore,no_run
9502 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9503 /// let x = ForwardingRuleInfo::new().set_region("example");
9504 /// ```
9505 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9506 self.region = v.into();
9507 self
9508 }
9509
9510 /// Sets the value of [load_balancer_name][crate::model::ForwardingRuleInfo::load_balancer_name].
9511 ///
9512 /// # Example
9513 /// ```ignore,no_run
9514 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9515 /// let x = ForwardingRuleInfo::new().set_load_balancer_name("example");
9516 /// ```
9517 pub fn set_load_balancer_name<T: std::convert::Into<std::string::String>>(
9518 mut self,
9519 v: T,
9520 ) -> Self {
9521 self.load_balancer_name = v.into();
9522 self
9523 }
9524
9525 /// Sets the value of [psc_service_attachment_uri][crate::model::ForwardingRuleInfo::psc_service_attachment_uri].
9526 ///
9527 /// # Example
9528 /// ```ignore,no_run
9529 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9530 /// let x = ForwardingRuleInfo::new().set_psc_service_attachment_uri("example");
9531 /// ```
9532 pub fn set_psc_service_attachment_uri<T: std::convert::Into<std::string::String>>(
9533 mut self,
9534 v: T,
9535 ) -> Self {
9536 self.psc_service_attachment_uri = v.into();
9537 self
9538 }
9539
9540 /// Sets the value of [psc_google_api_target][crate::model::ForwardingRuleInfo::psc_google_api_target].
9541 ///
9542 /// # Example
9543 /// ```ignore,no_run
9544 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
9545 /// let x = ForwardingRuleInfo::new().set_psc_google_api_target("example");
9546 /// ```
9547 pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
9548 mut self,
9549 v: T,
9550 ) -> Self {
9551 self.psc_google_api_target = v.into();
9552 self
9553 }
9554}
9555
9556impl wkt::message::Message for ForwardingRuleInfo {
9557 fn typename() -> &'static str {
9558 "type.googleapis.com/google.cloud.networkmanagement.v1.ForwardingRuleInfo"
9559 }
9560}
9561
9562/// For display only. Metadata associated with a load balancer.
9563#[derive(Clone, Default, PartialEq)]
9564#[non_exhaustive]
9565pub struct LoadBalancerInfo {
9566 /// Type of the load balancer.
9567 pub load_balancer_type: crate::model::load_balancer_info::LoadBalancerType,
9568
9569 /// URI of the health check for the load balancer. Deprecated and no longer
9570 /// populated as different load balancer backends might have different health
9571 /// checks.
9572 #[deprecated]
9573 pub health_check_uri: std::string::String,
9574
9575 /// Information for the loadbalancer backends.
9576 pub backends: std::vec::Vec<crate::model::LoadBalancerBackend>,
9577
9578 /// Type of load balancer's backend configuration.
9579 pub backend_type: crate::model::load_balancer_info::BackendType,
9580
9581 /// Backend configuration URI.
9582 pub backend_uri: std::string::String,
9583
9584 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9585}
9586
9587impl LoadBalancerInfo {
9588 /// Creates a new default instance.
9589 pub fn new() -> Self {
9590 std::default::Default::default()
9591 }
9592
9593 /// Sets the value of [load_balancer_type][crate::model::LoadBalancerInfo::load_balancer_type].
9594 ///
9595 /// # Example
9596 /// ```ignore,no_run
9597 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9598 /// use google_cloud_networkmanagement_v1::model::load_balancer_info::LoadBalancerType;
9599 /// let x0 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::InternalTcpUdp);
9600 /// let x1 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::NetworkTcpUdp);
9601 /// let x2 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::HttpProxy);
9602 /// ```
9603 pub fn set_load_balancer_type<
9604 T: std::convert::Into<crate::model::load_balancer_info::LoadBalancerType>,
9605 >(
9606 mut self,
9607 v: T,
9608 ) -> Self {
9609 self.load_balancer_type = v.into();
9610 self
9611 }
9612
9613 /// Sets the value of [health_check_uri][crate::model::LoadBalancerInfo::health_check_uri].
9614 ///
9615 /// # Example
9616 /// ```ignore,no_run
9617 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9618 /// let x = LoadBalancerInfo::new().set_health_check_uri("example");
9619 /// ```
9620 #[deprecated]
9621 pub fn set_health_check_uri<T: std::convert::Into<std::string::String>>(
9622 mut self,
9623 v: T,
9624 ) -> Self {
9625 self.health_check_uri = v.into();
9626 self
9627 }
9628
9629 /// Sets the value of [backends][crate::model::LoadBalancerInfo::backends].
9630 ///
9631 /// # Example
9632 /// ```ignore,no_run
9633 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9634 /// use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9635 /// let x = LoadBalancerInfo::new()
9636 /// .set_backends([
9637 /// LoadBalancerBackend::default()/* use setters */,
9638 /// LoadBalancerBackend::default()/* use (different) setters */,
9639 /// ]);
9640 /// ```
9641 pub fn set_backends<T, V>(mut self, v: T) -> Self
9642 where
9643 T: std::iter::IntoIterator<Item = V>,
9644 V: std::convert::Into<crate::model::LoadBalancerBackend>,
9645 {
9646 use std::iter::Iterator;
9647 self.backends = v.into_iter().map(|i| i.into()).collect();
9648 self
9649 }
9650
9651 /// Sets the value of [backend_type][crate::model::LoadBalancerInfo::backend_type].
9652 ///
9653 /// # Example
9654 /// ```ignore,no_run
9655 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9656 /// use google_cloud_networkmanagement_v1::model::load_balancer_info::BackendType;
9657 /// let x0 = LoadBalancerInfo::new().set_backend_type(BackendType::BackendService);
9658 /// let x1 = LoadBalancerInfo::new().set_backend_type(BackendType::TargetPool);
9659 /// let x2 = LoadBalancerInfo::new().set_backend_type(BackendType::TargetInstance);
9660 /// ```
9661 pub fn set_backend_type<
9662 T: std::convert::Into<crate::model::load_balancer_info::BackendType>,
9663 >(
9664 mut self,
9665 v: T,
9666 ) -> Self {
9667 self.backend_type = v.into();
9668 self
9669 }
9670
9671 /// Sets the value of [backend_uri][crate::model::LoadBalancerInfo::backend_uri].
9672 ///
9673 /// # Example
9674 /// ```ignore,no_run
9675 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
9676 /// let x = LoadBalancerInfo::new().set_backend_uri("example");
9677 /// ```
9678 pub fn set_backend_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9679 self.backend_uri = v.into();
9680 self
9681 }
9682}
9683
9684impl wkt::message::Message for LoadBalancerInfo {
9685 fn typename() -> &'static str {
9686 "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerInfo"
9687 }
9688}
9689
9690/// Defines additional types related to [LoadBalancerInfo].
9691pub mod load_balancer_info {
9692 #[allow(unused_imports)]
9693 use super::*;
9694
9695 /// The type definition for a load balancer:
9696 ///
9697 /// # Working with unknown values
9698 ///
9699 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9700 /// additional enum variants at any time. Adding new variants is not considered
9701 /// a breaking change. Applications should write their code in anticipation of:
9702 ///
9703 /// - New values appearing in future releases of the client library, **and**
9704 /// - New values received dynamically, without application changes.
9705 ///
9706 /// Please consult the [Working with enums] section in the user guide for some
9707 /// guidelines.
9708 ///
9709 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9710 #[derive(Clone, Debug, PartialEq)]
9711 #[non_exhaustive]
9712 pub enum LoadBalancerType {
9713 /// Type is unspecified.
9714 Unspecified,
9715 /// Internal TCP/UDP load balancer.
9716 InternalTcpUdp,
9717 /// Network TCP/UDP load balancer.
9718 NetworkTcpUdp,
9719 /// HTTP(S) proxy load balancer.
9720 HttpProxy,
9721 /// TCP proxy load balancer.
9722 TcpProxy,
9723 /// SSL proxy load balancer.
9724 SslProxy,
9725 /// If set, the enum was initialized with an unknown value.
9726 ///
9727 /// Applications can examine the value using [LoadBalancerType::value] or
9728 /// [LoadBalancerType::name].
9729 UnknownValue(load_balancer_type::UnknownValue),
9730 }
9731
9732 #[doc(hidden)]
9733 pub mod load_balancer_type {
9734 #[allow(unused_imports)]
9735 use super::*;
9736 #[derive(Clone, Debug, PartialEq)]
9737 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9738 }
9739
9740 impl LoadBalancerType {
9741 /// Gets the enum value.
9742 ///
9743 /// Returns `None` if the enum contains an unknown value deserialized from
9744 /// the string representation of enums.
9745 pub fn value(&self) -> std::option::Option<i32> {
9746 match self {
9747 Self::Unspecified => std::option::Option::Some(0),
9748 Self::InternalTcpUdp => std::option::Option::Some(1),
9749 Self::NetworkTcpUdp => std::option::Option::Some(2),
9750 Self::HttpProxy => std::option::Option::Some(3),
9751 Self::TcpProxy => std::option::Option::Some(4),
9752 Self::SslProxy => std::option::Option::Some(5),
9753 Self::UnknownValue(u) => u.0.value(),
9754 }
9755 }
9756
9757 /// Gets the enum value as a string.
9758 ///
9759 /// Returns `None` if the enum contains an unknown value deserialized from
9760 /// the integer representation of enums.
9761 pub fn name(&self) -> std::option::Option<&str> {
9762 match self {
9763 Self::Unspecified => std::option::Option::Some("LOAD_BALANCER_TYPE_UNSPECIFIED"),
9764 Self::InternalTcpUdp => std::option::Option::Some("INTERNAL_TCP_UDP"),
9765 Self::NetworkTcpUdp => std::option::Option::Some("NETWORK_TCP_UDP"),
9766 Self::HttpProxy => std::option::Option::Some("HTTP_PROXY"),
9767 Self::TcpProxy => std::option::Option::Some("TCP_PROXY"),
9768 Self::SslProxy => std::option::Option::Some("SSL_PROXY"),
9769 Self::UnknownValue(u) => u.0.name(),
9770 }
9771 }
9772 }
9773
9774 impl std::default::Default for LoadBalancerType {
9775 fn default() -> Self {
9776 use std::convert::From;
9777 Self::from(0)
9778 }
9779 }
9780
9781 impl std::fmt::Display for LoadBalancerType {
9782 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9783 wkt::internal::display_enum(f, self.name(), self.value())
9784 }
9785 }
9786
9787 impl std::convert::From<i32> for LoadBalancerType {
9788 fn from(value: i32) -> Self {
9789 match value {
9790 0 => Self::Unspecified,
9791 1 => Self::InternalTcpUdp,
9792 2 => Self::NetworkTcpUdp,
9793 3 => Self::HttpProxy,
9794 4 => Self::TcpProxy,
9795 5 => Self::SslProxy,
9796 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
9797 wkt::internal::UnknownEnumValue::Integer(value),
9798 )),
9799 }
9800 }
9801 }
9802
9803 impl std::convert::From<&str> for LoadBalancerType {
9804 fn from(value: &str) -> Self {
9805 use std::string::ToString;
9806 match value {
9807 "LOAD_BALANCER_TYPE_UNSPECIFIED" => Self::Unspecified,
9808 "INTERNAL_TCP_UDP" => Self::InternalTcpUdp,
9809 "NETWORK_TCP_UDP" => Self::NetworkTcpUdp,
9810 "HTTP_PROXY" => Self::HttpProxy,
9811 "TCP_PROXY" => Self::TcpProxy,
9812 "SSL_PROXY" => Self::SslProxy,
9813 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
9814 wkt::internal::UnknownEnumValue::String(value.to_string()),
9815 )),
9816 }
9817 }
9818 }
9819
9820 impl serde::ser::Serialize for LoadBalancerType {
9821 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9822 where
9823 S: serde::Serializer,
9824 {
9825 match self {
9826 Self::Unspecified => serializer.serialize_i32(0),
9827 Self::InternalTcpUdp => serializer.serialize_i32(1),
9828 Self::NetworkTcpUdp => serializer.serialize_i32(2),
9829 Self::HttpProxy => serializer.serialize_i32(3),
9830 Self::TcpProxy => serializer.serialize_i32(4),
9831 Self::SslProxy => serializer.serialize_i32(5),
9832 Self::UnknownValue(u) => u.0.serialize(serializer),
9833 }
9834 }
9835 }
9836
9837 impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
9838 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9839 where
9840 D: serde::Deserializer<'de>,
9841 {
9842 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
9843 ".google.cloud.networkmanagement.v1.LoadBalancerInfo.LoadBalancerType",
9844 ))
9845 }
9846 }
9847
9848 /// The type definition for a load balancer backend configuration:
9849 ///
9850 /// # Working with unknown values
9851 ///
9852 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9853 /// additional enum variants at any time. Adding new variants is not considered
9854 /// a breaking change. Applications should write their code in anticipation of:
9855 ///
9856 /// - New values appearing in future releases of the client library, **and**
9857 /// - New values received dynamically, without application changes.
9858 ///
9859 /// Please consult the [Working with enums] section in the user guide for some
9860 /// guidelines.
9861 ///
9862 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9863 #[derive(Clone, Debug, PartialEq)]
9864 #[non_exhaustive]
9865 pub enum BackendType {
9866 /// Type is unspecified.
9867 Unspecified,
9868 /// Backend Service as the load balancer's backend.
9869 BackendService,
9870 /// Target Pool as the load balancer's backend.
9871 TargetPool,
9872 /// Target Instance as the load balancer's backend.
9873 TargetInstance,
9874 /// If set, the enum was initialized with an unknown value.
9875 ///
9876 /// Applications can examine the value using [BackendType::value] or
9877 /// [BackendType::name].
9878 UnknownValue(backend_type::UnknownValue),
9879 }
9880
9881 #[doc(hidden)]
9882 pub mod backend_type {
9883 #[allow(unused_imports)]
9884 use super::*;
9885 #[derive(Clone, Debug, PartialEq)]
9886 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9887 }
9888
9889 impl BackendType {
9890 /// Gets the enum value.
9891 ///
9892 /// Returns `None` if the enum contains an unknown value deserialized from
9893 /// the string representation of enums.
9894 pub fn value(&self) -> std::option::Option<i32> {
9895 match self {
9896 Self::Unspecified => std::option::Option::Some(0),
9897 Self::BackendService => std::option::Option::Some(1),
9898 Self::TargetPool => std::option::Option::Some(2),
9899 Self::TargetInstance => std::option::Option::Some(3),
9900 Self::UnknownValue(u) => u.0.value(),
9901 }
9902 }
9903
9904 /// Gets the enum value as a string.
9905 ///
9906 /// Returns `None` if the enum contains an unknown value deserialized from
9907 /// the integer representation of enums.
9908 pub fn name(&self) -> std::option::Option<&str> {
9909 match self {
9910 Self::Unspecified => std::option::Option::Some("BACKEND_TYPE_UNSPECIFIED"),
9911 Self::BackendService => std::option::Option::Some("BACKEND_SERVICE"),
9912 Self::TargetPool => std::option::Option::Some("TARGET_POOL"),
9913 Self::TargetInstance => std::option::Option::Some("TARGET_INSTANCE"),
9914 Self::UnknownValue(u) => u.0.name(),
9915 }
9916 }
9917 }
9918
9919 impl std::default::Default for BackendType {
9920 fn default() -> Self {
9921 use std::convert::From;
9922 Self::from(0)
9923 }
9924 }
9925
9926 impl std::fmt::Display for BackendType {
9927 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9928 wkt::internal::display_enum(f, self.name(), self.value())
9929 }
9930 }
9931
9932 impl std::convert::From<i32> for BackendType {
9933 fn from(value: i32) -> Self {
9934 match value {
9935 0 => Self::Unspecified,
9936 1 => Self::BackendService,
9937 2 => Self::TargetPool,
9938 3 => Self::TargetInstance,
9939 _ => Self::UnknownValue(backend_type::UnknownValue(
9940 wkt::internal::UnknownEnumValue::Integer(value),
9941 )),
9942 }
9943 }
9944 }
9945
9946 impl std::convert::From<&str> for BackendType {
9947 fn from(value: &str) -> Self {
9948 use std::string::ToString;
9949 match value {
9950 "BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
9951 "BACKEND_SERVICE" => Self::BackendService,
9952 "TARGET_POOL" => Self::TargetPool,
9953 "TARGET_INSTANCE" => Self::TargetInstance,
9954 _ => Self::UnknownValue(backend_type::UnknownValue(
9955 wkt::internal::UnknownEnumValue::String(value.to_string()),
9956 )),
9957 }
9958 }
9959 }
9960
9961 impl serde::ser::Serialize for BackendType {
9962 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9963 where
9964 S: serde::Serializer,
9965 {
9966 match self {
9967 Self::Unspecified => serializer.serialize_i32(0),
9968 Self::BackendService => serializer.serialize_i32(1),
9969 Self::TargetPool => serializer.serialize_i32(2),
9970 Self::TargetInstance => serializer.serialize_i32(3),
9971 Self::UnknownValue(u) => u.0.serialize(serializer),
9972 }
9973 }
9974 }
9975
9976 impl<'de> serde::de::Deserialize<'de> for BackendType {
9977 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9978 where
9979 D: serde::Deserializer<'de>,
9980 {
9981 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackendType>::new(
9982 ".google.cloud.networkmanagement.v1.LoadBalancerInfo.BackendType",
9983 ))
9984 }
9985 }
9986}
9987
9988/// For display only. Metadata associated with a specific load balancer backend.
9989#[derive(Clone, Default, PartialEq)]
9990#[non_exhaustive]
9991pub struct LoadBalancerBackend {
9992 /// Name of a Compute Engine instance or network endpoint.
9993 pub display_name: std::string::String,
9994
9995 /// URI of a Compute Engine instance or network endpoint.
9996 pub uri: std::string::String,
9997
9998 /// State of the health check firewall configuration.
9999 pub health_check_firewall_state: crate::model::load_balancer_backend::HealthCheckFirewallState,
10000
10001 /// A list of firewall rule URIs allowing probes from health check IP ranges.
10002 pub health_check_allowing_firewall_rules: std::vec::Vec<std::string::String>,
10003
10004 /// A list of firewall rule URIs blocking probes from health check IP ranges.
10005 pub health_check_blocking_firewall_rules: std::vec::Vec<std::string::String>,
10006
10007 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10008}
10009
10010impl LoadBalancerBackend {
10011 /// Creates a new default instance.
10012 pub fn new() -> Self {
10013 std::default::Default::default()
10014 }
10015
10016 /// Sets the value of [display_name][crate::model::LoadBalancerBackend::display_name].
10017 ///
10018 /// # Example
10019 /// ```ignore,no_run
10020 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
10021 /// let x = LoadBalancerBackend::new().set_display_name("example");
10022 /// ```
10023 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10024 self.display_name = v.into();
10025 self
10026 }
10027
10028 /// Sets the value of [uri][crate::model::LoadBalancerBackend::uri].
10029 ///
10030 /// # Example
10031 /// ```ignore,no_run
10032 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
10033 /// let x = LoadBalancerBackend::new().set_uri("example");
10034 /// ```
10035 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10036 self.uri = v.into();
10037 self
10038 }
10039
10040 /// Sets the value of [health_check_firewall_state][crate::model::LoadBalancerBackend::health_check_firewall_state].
10041 ///
10042 /// # Example
10043 /// ```ignore,no_run
10044 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
10045 /// use google_cloud_networkmanagement_v1::model::load_balancer_backend::HealthCheckFirewallState;
10046 /// let x0 = LoadBalancerBackend::new().set_health_check_firewall_state(HealthCheckFirewallState::Configured);
10047 /// let x1 = LoadBalancerBackend::new().set_health_check_firewall_state(HealthCheckFirewallState::Misconfigured);
10048 /// ```
10049 pub fn set_health_check_firewall_state<
10050 T: std::convert::Into<crate::model::load_balancer_backend::HealthCheckFirewallState>,
10051 >(
10052 mut self,
10053 v: T,
10054 ) -> Self {
10055 self.health_check_firewall_state = v.into();
10056 self
10057 }
10058
10059 /// Sets the value of [health_check_allowing_firewall_rules][crate::model::LoadBalancerBackend::health_check_allowing_firewall_rules].
10060 ///
10061 /// # Example
10062 /// ```ignore,no_run
10063 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
10064 /// let x = LoadBalancerBackend::new().set_health_check_allowing_firewall_rules(["a", "b", "c"]);
10065 /// ```
10066 pub fn set_health_check_allowing_firewall_rules<T, V>(mut self, v: T) -> Self
10067 where
10068 T: std::iter::IntoIterator<Item = V>,
10069 V: std::convert::Into<std::string::String>,
10070 {
10071 use std::iter::Iterator;
10072 self.health_check_allowing_firewall_rules = v.into_iter().map(|i| i.into()).collect();
10073 self
10074 }
10075
10076 /// Sets the value of [health_check_blocking_firewall_rules][crate::model::LoadBalancerBackend::health_check_blocking_firewall_rules].
10077 ///
10078 /// # Example
10079 /// ```ignore,no_run
10080 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
10081 /// let x = LoadBalancerBackend::new().set_health_check_blocking_firewall_rules(["a", "b", "c"]);
10082 /// ```
10083 pub fn set_health_check_blocking_firewall_rules<T, V>(mut self, v: T) -> Self
10084 where
10085 T: std::iter::IntoIterator<Item = V>,
10086 V: std::convert::Into<std::string::String>,
10087 {
10088 use std::iter::Iterator;
10089 self.health_check_blocking_firewall_rules = v.into_iter().map(|i| i.into()).collect();
10090 self
10091 }
10092}
10093
10094impl wkt::message::Message for LoadBalancerBackend {
10095 fn typename() -> &'static str {
10096 "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerBackend"
10097 }
10098}
10099
10100/// Defines additional types related to [LoadBalancerBackend].
10101pub mod load_balancer_backend {
10102 #[allow(unused_imports)]
10103 use super::*;
10104
10105 /// State of a health check firewall configuration:
10106 ///
10107 /// # Working with unknown values
10108 ///
10109 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10110 /// additional enum variants at any time. Adding new variants is not considered
10111 /// a breaking change. Applications should write their code in anticipation of:
10112 ///
10113 /// - New values appearing in future releases of the client library, **and**
10114 /// - New values received dynamically, without application changes.
10115 ///
10116 /// Please consult the [Working with enums] section in the user guide for some
10117 /// guidelines.
10118 ///
10119 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10120 #[derive(Clone, Debug, PartialEq)]
10121 #[non_exhaustive]
10122 pub enum HealthCheckFirewallState {
10123 /// State is unspecified. Default state if not populated.
10124 Unspecified,
10125 /// There are configured firewall rules to allow health check probes to the
10126 /// backend.
10127 Configured,
10128 /// There are firewall rules configured to allow partial health check ranges
10129 /// or block all health check ranges.
10130 /// If a health check probe is sent from denied IP ranges,
10131 /// the health check to the backend will fail. Then, the backend will be
10132 /// marked unhealthy and will not receive traffic sent to the load balancer.
10133 Misconfigured,
10134 /// If set, the enum was initialized with an unknown value.
10135 ///
10136 /// Applications can examine the value using [HealthCheckFirewallState::value] or
10137 /// [HealthCheckFirewallState::name].
10138 UnknownValue(health_check_firewall_state::UnknownValue),
10139 }
10140
10141 #[doc(hidden)]
10142 pub mod health_check_firewall_state {
10143 #[allow(unused_imports)]
10144 use super::*;
10145 #[derive(Clone, Debug, PartialEq)]
10146 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10147 }
10148
10149 impl HealthCheckFirewallState {
10150 /// Gets the enum value.
10151 ///
10152 /// Returns `None` if the enum contains an unknown value deserialized from
10153 /// the string representation of enums.
10154 pub fn value(&self) -> std::option::Option<i32> {
10155 match self {
10156 Self::Unspecified => std::option::Option::Some(0),
10157 Self::Configured => std::option::Option::Some(1),
10158 Self::Misconfigured => std::option::Option::Some(2),
10159 Self::UnknownValue(u) => u.0.value(),
10160 }
10161 }
10162
10163 /// Gets the enum value as a string.
10164 ///
10165 /// Returns `None` if the enum contains an unknown value deserialized from
10166 /// the integer representation of enums.
10167 pub fn name(&self) -> std::option::Option<&str> {
10168 match self {
10169 Self::Unspecified => {
10170 std::option::Option::Some("HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED")
10171 }
10172 Self::Configured => std::option::Option::Some("CONFIGURED"),
10173 Self::Misconfigured => std::option::Option::Some("MISCONFIGURED"),
10174 Self::UnknownValue(u) => u.0.name(),
10175 }
10176 }
10177 }
10178
10179 impl std::default::Default for HealthCheckFirewallState {
10180 fn default() -> Self {
10181 use std::convert::From;
10182 Self::from(0)
10183 }
10184 }
10185
10186 impl std::fmt::Display for HealthCheckFirewallState {
10187 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10188 wkt::internal::display_enum(f, self.name(), self.value())
10189 }
10190 }
10191
10192 impl std::convert::From<i32> for HealthCheckFirewallState {
10193 fn from(value: i32) -> Self {
10194 match value {
10195 0 => Self::Unspecified,
10196 1 => Self::Configured,
10197 2 => Self::Misconfigured,
10198 _ => Self::UnknownValue(health_check_firewall_state::UnknownValue(
10199 wkt::internal::UnknownEnumValue::Integer(value),
10200 )),
10201 }
10202 }
10203 }
10204
10205 impl std::convert::From<&str> for HealthCheckFirewallState {
10206 fn from(value: &str) -> Self {
10207 use std::string::ToString;
10208 match value {
10209 "HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED" => Self::Unspecified,
10210 "CONFIGURED" => Self::Configured,
10211 "MISCONFIGURED" => Self::Misconfigured,
10212 _ => Self::UnknownValue(health_check_firewall_state::UnknownValue(
10213 wkt::internal::UnknownEnumValue::String(value.to_string()),
10214 )),
10215 }
10216 }
10217 }
10218
10219 impl serde::ser::Serialize for HealthCheckFirewallState {
10220 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10221 where
10222 S: serde::Serializer,
10223 {
10224 match self {
10225 Self::Unspecified => serializer.serialize_i32(0),
10226 Self::Configured => serializer.serialize_i32(1),
10227 Self::Misconfigured => serializer.serialize_i32(2),
10228 Self::UnknownValue(u) => u.0.serialize(serializer),
10229 }
10230 }
10231 }
10232
10233 impl<'de> serde::de::Deserialize<'de> for HealthCheckFirewallState {
10234 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10235 where
10236 D: serde::Deserializer<'de>,
10237 {
10238 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HealthCheckFirewallState>::new(
10239 ".google.cloud.networkmanagement.v1.LoadBalancerBackend.HealthCheckFirewallState"))
10240 }
10241 }
10242}
10243
10244/// For display only. Metadata associated with a hybrid subnet.
10245#[derive(Clone, Default, PartialEq)]
10246#[non_exhaustive]
10247pub struct HybridSubnetInfo {
10248 /// Name of a hybrid subnet.
10249 pub display_name: std::string::String,
10250
10251 /// URI of a hybrid subnet.
10252 pub uri: std::string::String,
10253
10254 /// Name of a Google Cloud region where the hybrid subnet is configured.
10255 pub region: std::string::String,
10256
10257 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10258}
10259
10260impl HybridSubnetInfo {
10261 /// Creates a new default instance.
10262 pub fn new() -> Self {
10263 std::default::Default::default()
10264 }
10265
10266 /// Sets the value of [display_name][crate::model::HybridSubnetInfo::display_name].
10267 ///
10268 /// # Example
10269 /// ```ignore,no_run
10270 /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
10271 /// let x = HybridSubnetInfo::new().set_display_name("example");
10272 /// ```
10273 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10274 self.display_name = v.into();
10275 self
10276 }
10277
10278 /// Sets the value of [uri][crate::model::HybridSubnetInfo::uri].
10279 ///
10280 /// # Example
10281 /// ```ignore,no_run
10282 /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
10283 /// let x = HybridSubnetInfo::new().set_uri("example");
10284 /// ```
10285 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10286 self.uri = v.into();
10287 self
10288 }
10289
10290 /// Sets the value of [region][crate::model::HybridSubnetInfo::region].
10291 ///
10292 /// # Example
10293 /// ```ignore,no_run
10294 /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
10295 /// let x = HybridSubnetInfo::new().set_region("example");
10296 /// ```
10297 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10298 self.region = v.into();
10299 self
10300 }
10301}
10302
10303impl wkt::message::Message for HybridSubnetInfo {
10304 fn typename() -> &'static str {
10305 "type.googleapis.com/google.cloud.networkmanagement.v1.HybridSubnetInfo"
10306 }
10307}
10308
10309/// For display only. Metadata associated with a Compute Engine VPN gateway.
10310#[derive(Clone, Default, PartialEq)]
10311#[non_exhaustive]
10312pub struct VpnGatewayInfo {
10313 /// Name of a VPN gateway.
10314 pub display_name: std::string::String,
10315
10316 /// URI of a VPN gateway.
10317 pub uri: std::string::String,
10318
10319 /// URI of a Compute Engine network where the VPN gateway is configured.
10320 pub network_uri: std::string::String,
10321
10322 /// IP address of the VPN gateway.
10323 pub ip_address: std::string::String,
10324
10325 /// A VPN tunnel that is associated with this VPN gateway.
10326 /// There may be multiple VPN tunnels configured on a VPN gateway, and only
10327 /// the one relevant to the test is displayed.
10328 pub vpn_tunnel_uri: std::string::String,
10329
10330 /// Name of a Google Cloud region where this VPN gateway is configured.
10331 pub region: std::string::String,
10332
10333 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10334}
10335
10336impl VpnGatewayInfo {
10337 /// Creates a new default instance.
10338 pub fn new() -> Self {
10339 std::default::Default::default()
10340 }
10341
10342 /// Sets the value of [display_name][crate::model::VpnGatewayInfo::display_name].
10343 ///
10344 /// # Example
10345 /// ```ignore,no_run
10346 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10347 /// let x = VpnGatewayInfo::new().set_display_name("example");
10348 /// ```
10349 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10350 self.display_name = v.into();
10351 self
10352 }
10353
10354 /// Sets the value of [uri][crate::model::VpnGatewayInfo::uri].
10355 ///
10356 /// # Example
10357 /// ```ignore,no_run
10358 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10359 /// let x = VpnGatewayInfo::new().set_uri("example");
10360 /// ```
10361 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10362 self.uri = v.into();
10363 self
10364 }
10365
10366 /// Sets the value of [network_uri][crate::model::VpnGatewayInfo::network_uri].
10367 ///
10368 /// # Example
10369 /// ```ignore,no_run
10370 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10371 /// let x = VpnGatewayInfo::new().set_network_uri("example");
10372 /// ```
10373 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10374 self.network_uri = v.into();
10375 self
10376 }
10377
10378 /// Sets the value of [ip_address][crate::model::VpnGatewayInfo::ip_address].
10379 ///
10380 /// # Example
10381 /// ```ignore,no_run
10382 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10383 /// let x = VpnGatewayInfo::new().set_ip_address("example");
10384 /// ```
10385 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10386 self.ip_address = v.into();
10387 self
10388 }
10389
10390 /// Sets the value of [vpn_tunnel_uri][crate::model::VpnGatewayInfo::vpn_tunnel_uri].
10391 ///
10392 /// # Example
10393 /// ```ignore,no_run
10394 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10395 /// let x = VpnGatewayInfo::new().set_vpn_tunnel_uri("example");
10396 /// ```
10397 pub fn set_vpn_tunnel_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10398 self.vpn_tunnel_uri = v.into();
10399 self
10400 }
10401
10402 /// Sets the value of [region][crate::model::VpnGatewayInfo::region].
10403 ///
10404 /// # Example
10405 /// ```ignore,no_run
10406 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
10407 /// let x = VpnGatewayInfo::new().set_region("example");
10408 /// ```
10409 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10410 self.region = v.into();
10411 self
10412 }
10413}
10414
10415impl wkt::message::Message for VpnGatewayInfo {
10416 fn typename() -> &'static str {
10417 "type.googleapis.com/google.cloud.networkmanagement.v1.VpnGatewayInfo"
10418 }
10419}
10420
10421/// For display only. Metadata associated with a Compute Engine VPN tunnel.
10422#[derive(Clone, Default, PartialEq)]
10423#[non_exhaustive]
10424pub struct VpnTunnelInfo {
10425 /// Name of a VPN tunnel.
10426 pub display_name: std::string::String,
10427
10428 /// URI of a VPN tunnel.
10429 pub uri: std::string::String,
10430
10431 /// URI of the VPN gateway at local end of the tunnel.
10432 pub source_gateway: std::string::String,
10433
10434 /// URI of a VPN gateway at remote end of the tunnel.
10435 pub remote_gateway: std::string::String,
10436
10437 /// Remote VPN gateway's IP address.
10438 pub remote_gateway_ip: std::string::String,
10439
10440 /// Local VPN gateway's IP address.
10441 pub source_gateway_ip: std::string::String,
10442
10443 /// URI of a Compute Engine network where the VPN tunnel is configured.
10444 pub network_uri: std::string::String,
10445
10446 /// Name of a Google Cloud region where this VPN tunnel is configured.
10447 pub region: std::string::String,
10448
10449 /// Type of the routing policy.
10450 pub routing_type: crate::model::vpn_tunnel_info::RoutingType,
10451
10452 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10453}
10454
10455impl VpnTunnelInfo {
10456 /// Creates a new default instance.
10457 pub fn new() -> Self {
10458 std::default::Default::default()
10459 }
10460
10461 /// Sets the value of [display_name][crate::model::VpnTunnelInfo::display_name].
10462 ///
10463 /// # Example
10464 /// ```ignore,no_run
10465 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10466 /// let x = VpnTunnelInfo::new().set_display_name("example");
10467 /// ```
10468 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10469 self.display_name = v.into();
10470 self
10471 }
10472
10473 /// Sets the value of [uri][crate::model::VpnTunnelInfo::uri].
10474 ///
10475 /// # Example
10476 /// ```ignore,no_run
10477 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10478 /// let x = VpnTunnelInfo::new().set_uri("example");
10479 /// ```
10480 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10481 self.uri = v.into();
10482 self
10483 }
10484
10485 /// Sets the value of [source_gateway][crate::model::VpnTunnelInfo::source_gateway].
10486 ///
10487 /// # Example
10488 /// ```ignore,no_run
10489 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10490 /// let x = VpnTunnelInfo::new().set_source_gateway("example");
10491 /// ```
10492 pub fn set_source_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10493 self.source_gateway = v.into();
10494 self
10495 }
10496
10497 /// Sets the value of [remote_gateway][crate::model::VpnTunnelInfo::remote_gateway].
10498 ///
10499 /// # Example
10500 /// ```ignore,no_run
10501 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10502 /// let x = VpnTunnelInfo::new().set_remote_gateway("example");
10503 /// ```
10504 pub fn set_remote_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10505 self.remote_gateway = v.into();
10506 self
10507 }
10508
10509 /// Sets the value of [remote_gateway_ip][crate::model::VpnTunnelInfo::remote_gateway_ip].
10510 ///
10511 /// # Example
10512 /// ```ignore,no_run
10513 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10514 /// let x = VpnTunnelInfo::new().set_remote_gateway_ip("example");
10515 /// ```
10516 pub fn set_remote_gateway_ip<T: std::convert::Into<std::string::String>>(
10517 mut self,
10518 v: T,
10519 ) -> Self {
10520 self.remote_gateway_ip = v.into();
10521 self
10522 }
10523
10524 /// Sets the value of [source_gateway_ip][crate::model::VpnTunnelInfo::source_gateway_ip].
10525 ///
10526 /// # Example
10527 /// ```ignore,no_run
10528 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10529 /// let x = VpnTunnelInfo::new().set_source_gateway_ip("example");
10530 /// ```
10531 pub fn set_source_gateway_ip<T: std::convert::Into<std::string::String>>(
10532 mut self,
10533 v: T,
10534 ) -> Self {
10535 self.source_gateway_ip = v.into();
10536 self
10537 }
10538
10539 /// Sets the value of [network_uri][crate::model::VpnTunnelInfo::network_uri].
10540 ///
10541 /// # Example
10542 /// ```ignore,no_run
10543 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10544 /// let x = VpnTunnelInfo::new().set_network_uri("example");
10545 /// ```
10546 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10547 self.network_uri = v.into();
10548 self
10549 }
10550
10551 /// Sets the value of [region][crate::model::VpnTunnelInfo::region].
10552 ///
10553 /// # Example
10554 /// ```ignore,no_run
10555 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10556 /// let x = VpnTunnelInfo::new().set_region("example");
10557 /// ```
10558 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10559 self.region = v.into();
10560 self
10561 }
10562
10563 /// Sets the value of [routing_type][crate::model::VpnTunnelInfo::routing_type].
10564 ///
10565 /// # Example
10566 /// ```ignore,no_run
10567 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
10568 /// use google_cloud_networkmanagement_v1::model::vpn_tunnel_info::RoutingType;
10569 /// let x0 = VpnTunnelInfo::new().set_routing_type(RoutingType::RouteBased);
10570 /// let x1 = VpnTunnelInfo::new().set_routing_type(RoutingType::PolicyBased);
10571 /// let x2 = VpnTunnelInfo::new().set_routing_type(RoutingType::Dynamic);
10572 /// ```
10573 pub fn set_routing_type<T: std::convert::Into<crate::model::vpn_tunnel_info::RoutingType>>(
10574 mut self,
10575 v: T,
10576 ) -> Self {
10577 self.routing_type = v.into();
10578 self
10579 }
10580}
10581
10582impl wkt::message::Message for VpnTunnelInfo {
10583 fn typename() -> &'static str {
10584 "type.googleapis.com/google.cloud.networkmanagement.v1.VpnTunnelInfo"
10585 }
10586}
10587
10588/// Defines additional types related to [VpnTunnelInfo].
10589pub mod vpn_tunnel_info {
10590 #[allow(unused_imports)]
10591 use super::*;
10592
10593 /// Types of VPN routing policy. For details, refer to [Networks and Tunnel
10594 /// routing](https://cloud.google.com/network-connectivity/docs/vpn/concepts/choosing-networks-routing/).
10595 ///
10596 /// # Working with unknown values
10597 ///
10598 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10599 /// additional enum variants at any time. Adding new variants is not considered
10600 /// a breaking change. Applications should write their code in anticipation of:
10601 ///
10602 /// - New values appearing in future releases of the client library, **and**
10603 /// - New values received dynamically, without application changes.
10604 ///
10605 /// Please consult the [Working with enums] section in the user guide for some
10606 /// guidelines.
10607 ///
10608 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10609 #[derive(Clone, Debug, PartialEq)]
10610 #[non_exhaustive]
10611 pub enum RoutingType {
10612 /// Unspecified type. Default value.
10613 Unspecified,
10614 /// Route based VPN.
10615 RouteBased,
10616 /// Policy based routing.
10617 PolicyBased,
10618 /// Dynamic (BGP) routing.
10619 Dynamic,
10620 /// If set, the enum was initialized with an unknown value.
10621 ///
10622 /// Applications can examine the value using [RoutingType::value] or
10623 /// [RoutingType::name].
10624 UnknownValue(routing_type::UnknownValue),
10625 }
10626
10627 #[doc(hidden)]
10628 pub mod routing_type {
10629 #[allow(unused_imports)]
10630 use super::*;
10631 #[derive(Clone, Debug, PartialEq)]
10632 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10633 }
10634
10635 impl RoutingType {
10636 /// Gets the enum value.
10637 ///
10638 /// Returns `None` if the enum contains an unknown value deserialized from
10639 /// the string representation of enums.
10640 pub fn value(&self) -> std::option::Option<i32> {
10641 match self {
10642 Self::Unspecified => std::option::Option::Some(0),
10643 Self::RouteBased => std::option::Option::Some(1),
10644 Self::PolicyBased => std::option::Option::Some(2),
10645 Self::Dynamic => std::option::Option::Some(3),
10646 Self::UnknownValue(u) => u.0.value(),
10647 }
10648 }
10649
10650 /// Gets the enum value as a string.
10651 ///
10652 /// Returns `None` if the enum contains an unknown value deserialized from
10653 /// the integer representation of enums.
10654 pub fn name(&self) -> std::option::Option<&str> {
10655 match self {
10656 Self::Unspecified => std::option::Option::Some("ROUTING_TYPE_UNSPECIFIED"),
10657 Self::RouteBased => std::option::Option::Some("ROUTE_BASED"),
10658 Self::PolicyBased => std::option::Option::Some("POLICY_BASED"),
10659 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
10660 Self::UnknownValue(u) => u.0.name(),
10661 }
10662 }
10663 }
10664
10665 impl std::default::Default for RoutingType {
10666 fn default() -> Self {
10667 use std::convert::From;
10668 Self::from(0)
10669 }
10670 }
10671
10672 impl std::fmt::Display for RoutingType {
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 RoutingType {
10679 fn from(value: i32) -> Self {
10680 match value {
10681 0 => Self::Unspecified,
10682 1 => Self::RouteBased,
10683 2 => Self::PolicyBased,
10684 3 => Self::Dynamic,
10685 _ => Self::UnknownValue(routing_type::UnknownValue(
10686 wkt::internal::UnknownEnumValue::Integer(value),
10687 )),
10688 }
10689 }
10690 }
10691
10692 impl std::convert::From<&str> for RoutingType {
10693 fn from(value: &str) -> Self {
10694 use std::string::ToString;
10695 match value {
10696 "ROUTING_TYPE_UNSPECIFIED" => Self::Unspecified,
10697 "ROUTE_BASED" => Self::RouteBased,
10698 "POLICY_BASED" => Self::PolicyBased,
10699 "DYNAMIC" => Self::Dynamic,
10700 _ => Self::UnknownValue(routing_type::UnknownValue(
10701 wkt::internal::UnknownEnumValue::String(value.to_string()),
10702 )),
10703 }
10704 }
10705 }
10706
10707 impl serde::ser::Serialize for RoutingType {
10708 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10709 where
10710 S: serde::Serializer,
10711 {
10712 match self {
10713 Self::Unspecified => serializer.serialize_i32(0),
10714 Self::RouteBased => serializer.serialize_i32(1),
10715 Self::PolicyBased => serializer.serialize_i32(2),
10716 Self::Dynamic => serializer.serialize_i32(3),
10717 Self::UnknownValue(u) => u.0.serialize(serializer),
10718 }
10719 }
10720 }
10721
10722 impl<'de> serde::de::Deserialize<'de> for RoutingType {
10723 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10724 where
10725 D: serde::Deserializer<'de>,
10726 {
10727 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutingType>::new(
10728 ".google.cloud.networkmanagement.v1.VpnTunnelInfo.RoutingType",
10729 ))
10730 }
10731 }
10732}
10733
10734/// For display only. Metadata associated with an Interconnect attachment.
10735#[derive(Clone, Default, PartialEq)]
10736#[non_exhaustive]
10737pub struct InterconnectAttachmentInfo {
10738 /// Name of an Interconnect attachment.
10739 pub display_name: std::string::String,
10740
10741 /// URI of an Interconnect attachment.
10742 pub uri: std::string::String,
10743
10744 /// URI of the Interconnect where the Interconnect attachment is
10745 /// configured.
10746 pub interconnect_uri: std::string::String,
10747
10748 /// Name of a Google Cloud region where the Interconnect attachment is
10749 /// configured.
10750 pub region: std::string::String,
10751
10752 /// URI of the Cloud Router to be used for dynamic routing.
10753 pub cloud_router_uri: std::string::String,
10754
10755 /// The type of interconnect attachment this is.
10756 pub r#type: crate::model::interconnect_attachment_info::Type,
10757
10758 /// Appliance IP address that was matched for L2_DEDICATED attachments.
10759 pub l2_attachment_matched_ip_address: std::string::String,
10760
10761 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10762}
10763
10764impl InterconnectAttachmentInfo {
10765 /// Creates a new default instance.
10766 pub fn new() -> Self {
10767 std::default::Default::default()
10768 }
10769
10770 /// Sets the value of [display_name][crate::model::InterconnectAttachmentInfo::display_name].
10771 ///
10772 /// # Example
10773 /// ```ignore,no_run
10774 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10775 /// let x = InterconnectAttachmentInfo::new().set_display_name("example");
10776 /// ```
10777 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10778 self.display_name = v.into();
10779 self
10780 }
10781
10782 /// Sets the value of [uri][crate::model::InterconnectAttachmentInfo::uri].
10783 ///
10784 /// # Example
10785 /// ```ignore,no_run
10786 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10787 /// let x = InterconnectAttachmentInfo::new().set_uri("example");
10788 /// ```
10789 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10790 self.uri = v.into();
10791 self
10792 }
10793
10794 /// Sets the value of [interconnect_uri][crate::model::InterconnectAttachmentInfo::interconnect_uri].
10795 ///
10796 /// # Example
10797 /// ```ignore,no_run
10798 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10799 /// let x = InterconnectAttachmentInfo::new().set_interconnect_uri("example");
10800 /// ```
10801 pub fn set_interconnect_uri<T: std::convert::Into<std::string::String>>(
10802 mut self,
10803 v: T,
10804 ) -> Self {
10805 self.interconnect_uri = v.into();
10806 self
10807 }
10808
10809 /// Sets the value of [region][crate::model::InterconnectAttachmentInfo::region].
10810 ///
10811 /// # Example
10812 /// ```ignore,no_run
10813 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10814 /// let x = InterconnectAttachmentInfo::new().set_region("example");
10815 /// ```
10816 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10817 self.region = v.into();
10818 self
10819 }
10820
10821 /// Sets the value of [cloud_router_uri][crate::model::InterconnectAttachmentInfo::cloud_router_uri].
10822 ///
10823 /// # Example
10824 /// ```ignore,no_run
10825 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10826 /// let x = InterconnectAttachmentInfo::new().set_cloud_router_uri("example");
10827 /// ```
10828 pub fn set_cloud_router_uri<T: std::convert::Into<std::string::String>>(
10829 mut self,
10830 v: T,
10831 ) -> Self {
10832 self.cloud_router_uri = v.into();
10833 self
10834 }
10835
10836 /// Sets the value of [r#type][crate::model::InterconnectAttachmentInfo::type].
10837 ///
10838 /// # Example
10839 /// ```ignore,no_run
10840 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10841 /// use google_cloud_networkmanagement_v1::model::interconnect_attachment_info::Type;
10842 /// let x0 = InterconnectAttachmentInfo::new().set_type(Type::Dedicated);
10843 /// let x1 = InterconnectAttachmentInfo::new().set_type(Type::Partner);
10844 /// let x2 = InterconnectAttachmentInfo::new().set_type(Type::PartnerProvider);
10845 /// ```
10846 pub fn set_type<T: std::convert::Into<crate::model::interconnect_attachment_info::Type>>(
10847 mut self,
10848 v: T,
10849 ) -> Self {
10850 self.r#type = v.into();
10851 self
10852 }
10853
10854 /// Sets the value of [l2_attachment_matched_ip_address][crate::model::InterconnectAttachmentInfo::l2_attachment_matched_ip_address].
10855 ///
10856 /// # Example
10857 /// ```ignore,no_run
10858 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
10859 /// let x = InterconnectAttachmentInfo::new().set_l2_attachment_matched_ip_address("example");
10860 /// ```
10861 pub fn set_l2_attachment_matched_ip_address<T: std::convert::Into<std::string::String>>(
10862 mut self,
10863 v: T,
10864 ) -> Self {
10865 self.l2_attachment_matched_ip_address = v.into();
10866 self
10867 }
10868}
10869
10870impl wkt::message::Message for InterconnectAttachmentInfo {
10871 fn typename() -> &'static str {
10872 "type.googleapis.com/google.cloud.networkmanagement.v1.InterconnectAttachmentInfo"
10873 }
10874}
10875
10876/// Defines additional types related to [InterconnectAttachmentInfo].
10877pub mod interconnect_attachment_info {
10878 #[allow(unused_imports)]
10879 use super::*;
10880
10881 /// What type of interconnect attachment this is.
10882 ///
10883 /// # Working with unknown values
10884 ///
10885 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10886 /// additional enum variants at any time. Adding new variants is not considered
10887 /// a breaking change. Applications should write their code in anticipation of:
10888 ///
10889 /// - New values appearing in future releases of the client library, **and**
10890 /// - New values received dynamically, without application changes.
10891 ///
10892 /// Please consult the [Working with enums] section in the user guide for some
10893 /// guidelines.
10894 ///
10895 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10896 #[derive(Clone, Debug, PartialEq)]
10897 #[non_exhaustive]
10898 pub enum Type {
10899 /// Unspecified type.
10900 Unspecified,
10901 /// Attachment to a dedicated interconnect.
10902 Dedicated,
10903 /// Attachment to a partner interconnect, created by the customer.
10904 Partner,
10905 /// Attachment to a partner interconnect, created by the partner.
10906 PartnerProvider,
10907 /// Attachment to a L2 interconnect, created by the customer.
10908 L2Dedicated,
10909 /// If set, the enum was initialized with an unknown value.
10910 ///
10911 /// Applications can examine the value using [Type::value] or
10912 /// [Type::name].
10913 UnknownValue(r#type::UnknownValue),
10914 }
10915
10916 #[doc(hidden)]
10917 pub mod r#type {
10918 #[allow(unused_imports)]
10919 use super::*;
10920 #[derive(Clone, Debug, PartialEq)]
10921 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10922 }
10923
10924 impl Type {
10925 /// Gets the enum value.
10926 ///
10927 /// Returns `None` if the enum contains an unknown value deserialized from
10928 /// the string representation of enums.
10929 pub fn value(&self) -> std::option::Option<i32> {
10930 match self {
10931 Self::Unspecified => std::option::Option::Some(0),
10932 Self::Dedicated => std::option::Option::Some(1),
10933 Self::Partner => std::option::Option::Some(2),
10934 Self::PartnerProvider => std::option::Option::Some(3),
10935 Self::L2Dedicated => std::option::Option::Some(4),
10936 Self::UnknownValue(u) => u.0.value(),
10937 }
10938 }
10939
10940 /// Gets the enum value as a string.
10941 ///
10942 /// Returns `None` if the enum contains an unknown value deserialized from
10943 /// the integer representation of enums.
10944 pub fn name(&self) -> std::option::Option<&str> {
10945 match self {
10946 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
10947 Self::Dedicated => std::option::Option::Some("DEDICATED"),
10948 Self::Partner => std::option::Option::Some("PARTNER"),
10949 Self::PartnerProvider => std::option::Option::Some("PARTNER_PROVIDER"),
10950 Self::L2Dedicated => std::option::Option::Some("L2_DEDICATED"),
10951 Self::UnknownValue(u) => u.0.name(),
10952 }
10953 }
10954 }
10955
10956 impl std::default::Default for Type {
10957 fn default() -> Self {
10958 use std::convert::From;
10959 Self::from(0)
10960 }
10961 }
10962
10963 impl std::fmt::Display for Type {
10964 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10965 wkt::internal::display_enum(f, self.name(), self.value())
10966 }
10967 }
10968
10969 impl std::convert::From<i32> for Type {
10970 fn from(value: i32) -> Self {
10971 match value {
10972 0 => Self::Unspecified,
10973 1 => Self::Dedicated,
10974 2 => Self::Partner,
10975 3 => Self::PartnerProvider,
10976 4 => Self::L2Dedicated,
10977 _ => Self::UnknownValue(r#type::UnknownValue(
10978 wkt::internal::UnknownEnumValue::Integer(value),
10979 )),
10980 }
10981 }
10982 }
10983
10984 impl std::convert::From<&str> for Type {
10985 fn from(value: &str) -> Self {
10986 use std::string::ToString;
10987 match value {
10988 "TYPE_UNSPECIFIED" => Self::Unspecified,
10989 "DEDICATED" => Self::Dedicated,
10990 "PARTNER" => Self::Partner,
10991 "PARTNER_PROVIDER" => Self::PartnerProvider,
10992 "L2_DEDICATED" => Self::L2Dedicated,
10993 _ => Self::UnknownValue(r#type::UnknownValue(
10994 wkt::internal::UnknownEnumValue::String(value.to_string()),
10995 )),
10996 }
10997 }
10998 }
10999
11000 impl serde::ser::Serialize for Type {
11001 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11002 where
11003 S: serde::Serializer,
11004 {
11005 match self {
11006 Self::Unspecified => serializer.serialize_i32(0),
11007 Self::Dedicated => serializer.serialize_i32(1),
11008 Self::Partner => serializer.serialize_i32(2),
11009 Self::PartnerProvider => serializer.serialize_i32(3),
11010 Self::L2Dedicated => serializer.serialize_i32(4),
11011 Self::UnknownValue(u) => u.0.serialize(serializer),
11012 }
11013 }
11014 }
11015
11016 impl<'de> serde::de::Deserialize<'de> for Type {
11017 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11018 where
11019 D: serde::Deserializer<'de>,
11020 {
11021 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
11022 ".google.cloud.networkmanagement.v1.InterconnectAttachmentInfo.Type",
11023 ))
11024 }
11025 }
11026}
11027
11028/// For display only. The specification of the endpoints for the test.
11029/// EndpointInfo is derived from source and destination Endpoint and validated
11030/// by the backend data plane model.
11031#[derive(Clone, Default, PartialEq)]
11032#[non_exhaustive]
11033pub struct EndpointInfo {
11034 /// Source IP address.
11035 pub source_ip: std::string::String,
11036
11037 /// Destination IP address.
11038 pub destination_ip: std::string::String,
11039
11040 /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
11041 pub protocol: std::string::String,
11042
11043 /// Source port. Only valid when protocol is TCP or UDP.
11044 pub source_port: i32,
11045
11046 /// Destination port. Only valid when protocol is TCP or UDP.
11047 pub destination_port: i32,
11048
11049 /// URI of the network where this packet originates from.
11050 pub source_network_uri: std::string::String,
11051
11052 /// URI of the network where this packet is sent to.
11053 pub destination_network_uri: std::string::String,
11054
11055 /// URI of the source telemetry agent this packet originates from.
11056 pub source_agent_uri: std::string::String,
11057
11058 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11059}
11060
11061impl EndpointInfo {
11062 /// Creates a new default instance.
11063 pub fn new() -> Self {
11064 std::default::Default::default()
11065 }
11066
11067 /// Sets the value of [source_ip][crate::model::EndpointInfo::source_ip].
11068 ///
11069 /// # Example
11070 /// ```ignore,no_run
11071 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
11072 /// let x = EndpointInfo::new().set_source_ip("example");
11073 /// ```
11074 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11075 self.source_ip = v.into();
11076 self
11077 }
11078
11079 /// Sets the value of [destination_ip][crate::model::EndpointInfo::destination_ip].
11080 ///
11081 /// # Example
11082 /// ```ignore,no_run
11083 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
11084 /// let x = EndpointInfo::new().set_destination_ip("example");
11085 /// ```
11086 pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11087 self.destination_ip = v.into();
11088 self
11089 }
11090
11091 /// Sets the value of [protocol][crate::model::EndpointInfo::protocol].
11092 ///
11093 /// # Example
11094 /// ```ignore,no_run
11095 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
11096 /// let x = EndpointInfo::new().set_protocol("example");
11097 /// ```
11098 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11099 self.protocol = v.into();
11100 self
11101 }
11102
11103 /// Sets the value of [source_port][crate::model::EndpointInfo::source_port].
11104 ///
11105 /// # Example
11106 /// ```ignore,no_run
11107 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
11108 /// let x = EndpointInfo::new().set_source_port(42);
11109 /// ```
11110 pub fn set_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11111 self.source_port = v.into();
11112 self
11113 }
11114
11115 /// Sets the value of [destination_port][crate::model::EndpointInfo::destination_port].
11116 ///
11117 /// # Example
11118 /// ```ignore,no_run
11119 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
11120 /// let x = EndpointInfo::new().set_destination_port(42);
11121 /// ```
11122 pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11123 self.destination_port = v.into();
11124 self
11125 }
11126
11127 /// Sets the value of [source_network_uri][crate::model::EndpointInfo::source_network_uri].
11128 ///
11129 /// # Example
11130 /// ```ignore,no_run
11131 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
11132 /// let x = EndpointInfo::new().set_source_network_uri("example");
11133 /// ```
11134 pub fn set_source_network_uri<T: std::convert::Into<std::string::String>>(
11135 mut self,
11136 v: T,
11137 ) -> Self {
11138 self.source_network_uri = v.into();
11139 self
11140 }
11141
11142 /// Sets the value of [destination_network_uri][crate::model::EndpointInfo::destination_network_uri].
11143 ///
11144 /// # Example
11145 /// ```ignore,no_run
11146 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
11147 /// let x = EndpointInfo::new().set_destination_network_uri("example");
11148 /// ```
11149 pub fn set_destination_network_uri<T: std::convert::Into<std::string::String>>(
11150 mut self,
11151 v: T,
11152 ) -> Self {
11153 self.destination_network_uri = v.into();
11154 self
11155 }
11156
11157 /// Sets the value of [source_agent_uri][crate::model::EndpointInfo::source_agent_uri].
11158 ///
11159 /// # Example
11160 /// ```ignore,no_run
11161 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
11162 /// let x = EndpointInfo::new().set_source_agent_uri("example");
11163 /// ```
11164 pub fn set_source_agent_uri<T: std::convert::Into<std::string::String>>(
11165 mut self,
11166 v: T,
11167 ) -> Self {
11168 self.source_agent_uri = v.into();
11169 self
11170 }
11171}
11172
11173impl wkt::message::Message for EndpointInfo {
11174 fn typename() -> &'static str {
11175 "type.googleapis.com/google.cloud.networkmanagement.v1.EndpointInfo"
11176 }
11177}
11178
11179/// Details of the final state "deliver" and associated resource.
11180#[derive(Clone, Default, PartialEq)]
11181#[non_exhaustive]
11182pub struct DeliverInfo {
11183 /// Target type where the packet is delivered to.
11184 pub target: crate::model::deliver_info::Target,
11185
11186 /// URI of the resource that the packet is delivered to.
11187 pub resource_uri: std::string::String,
11188
11189 /// IP address of the target (if applicable).
11190 pub ip_address: std::string::String,
11191
11192 /// Name of the Cloud Storage Bucket the packet is delivered to (if
11193 /// applicable).
11194 pub storage_bucket: std::string::String,
11195
11196 /// PSC Google API target the packet is delivered to (if applicable).
11197 pub psc_google_api_target: std::string::String,
11198
11199 /// Recognized type of a Google Service the packet is delivered to (if
11200 /// applicable).
11201 pub google_service_type: crate::model::deliver_info::GoogleServiceType,
11202
11203 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11204}
11205
11206impl DeliverInfo {
11207 /// Creates a new default instance.
11208 pub fn new() -> Self {
11209 std::default::Default::default()
11210 }
11211
11212 /// Sets the value of [target][crate::model::DeliverInfo::target].
11213 ///
11214 /// # Example
11215 /// ```ignore,no_run
11216 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
11217 /// use google_cloud_networkmanagement_v1::model::deliver_info::Target;
11218 /// let x0 = DeliverInfo::new().set_target(Target::Instance);
11219 /// let x1 = DeliverInfo::new().set_target(Target::Internet);
11220 /// let x2 = DeliverInfo::new().set_target(Target::GoogleApi);
11221 /// ```
11222 pub fn set_target<T: std::convert::Into<crate::model::deliver_info::Target>>(
11223 mut self,
11224 v: T,
11225 ) -> Self {
11226 self.target = v.into();
11227 self
11228 }
11229
11230 /// Sets the value of [resource_uri][crate::model::DeliverInfo::resource_uri].
11231 ///
11232 /// # Example
11233 /// ```ignore,no_run
11234 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
11235 /// let x = DeliverInfo::new().set_resource_uri("example");
11236 /// ```
11237 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11238 self.resource_uri = v.into();
11239 self
11240 }
11241
11242 /// Sets the value of [ip_address][crate::model::DeliverInfo::ip_address].
11243 ///
11244 /// # Example
11245 /// ```ignore,no_run
11246 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
11247 /// let x = DeliverInfo::new().set_ip_address("example");
11248 /// ```
11249 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11250 self.ip_address = v.into();
11251 self
11252 }
11253
11254 /// Sets the value of [storage_bucket][crate::model::DeliverInfo::storage_bucket].
11255 ///
11256 /// # Example
11257 /// ```ignore,no_run
11258 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
11259 /// let x = DeliverInfo::new().set_storage_bucket("example");
11260 /// ```
11261 pub fn set_storage_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11262 self.storage_bucket = v.into();
11263 self
11264 }
11265
11266 /// Sets the value of [psc_google_api_target][crate::model::DeliverInfo::psc_google_api_target].
11267 ///
11268 /// # Example
11269 /// ```ignore,no_run
11270 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
11271 /// let x = DeliverInfo::new().set_psc_google_api_target("example");
11272 /// ```
11273 pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
11274 mut self,
11275 v: T,
11276 ) -> Self {
11277 self.psc_google_api_target = v.into();
11278 self
11279 }
11280
11281 /// Sets the value of [google_service_type][crate::model::DeliverInfo::google_service_type].
11282 ///
11283 /// # Example
11284 /// ```ignore,no_run
11285 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
11286 /// use google_cloud_networkmanagement_v1::model::deliver_info::GoogleServiceType;
11287 /// let x0 = DeliverInfo::new().set_google_service_type(GoogleServiceType::Iap);
11288 /// let x1 = DeliverInfo::new().set_google_service_type(GoogleServiceType::GfeProxyOrHealthCheckProber);
11289 /// let x2 = DeliverInfo::new().set_google_service_type(GoogleServiceType::CloudDns);
11290 /// ```
11291 pub fn set_google_service_type<
11292 T: std::convert::Into<crate::model::deliver_info::GoogleServiceType>,
11293 >(
11294 mut self,
11295 v: T,
11296 ) -> Self {
11297 self.google_service_type = v.into();
11298 self
11299 }
11300}
11301
11302impl wkt::message::Message for DeliverInfo {
11303 fn typename() -> &'static str {
11304 "type.googleapis.com/google.cloud.networkmanagement.v1.DeliverInfo"
11305 }
11306}
11307
11308/// Defines additional types related to [DeliverInfo].
11309pub mod deliver_info {
11310 #[allow(unused_imports)]
11311 use super::*;
11312
11313 /// Deliver target types:
11314 ///
11315 /// # Working with unknown values
11316 ///
11317 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11318 /// additional enum variants at any time. Adding new variants is not considered
11319 /// a breaking change. Applications should write their code in anticipation of:
11320 ///
11321 /// - New values appearing in future releases of the client library, **and**
11322 /// - New values received dynamically, without application changes.
11323 ///
11324 /// Please consult the [Working with enums] section in the user guide for some
11325 /// guidelines.
11326 ///
11327 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11328 #[derive(Clone, Debug, PartialEq)]
11329 #[non_exhaustive]
11330 pub enum Target {
11331 /// Target not specified.
11332 Unspecified,
11333 /// Target is a Compute Engine instance.
11334 Instance,
11335 /// Target is the internet.
11336 Internet,
11337 /// Target is a Google API.
11338 GoogleApi,
11339 /// Target is a Google Kubernetes Engine cluster master.
11340 GkeMaster,
11341 /// Target is a Cloud SQL instance.
11342 CloudSqlInstance,
11343 /// Target is a published service that uses [Private Service
11344 /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
11345 PscPublishedService,
11346 /// Target is Google APIs that use [Private Service
11347 /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-apis).
11348 PscGoogleApi,
11349 /// Target is a VPC-SC that uses [Private Service
11350 /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-apis).
11351 PscVpcSc,
11352 /// Target is a serverless network endpoint group.
11353 ServerlessNeg,
11354 /// Target is a Cloud Storage bucket.
11355 StorageBucket,
11356 /// Target is a private network. Used only for return traces.
11357 PrivateNetwork,
11358 /// Target is a Cloud Function. Used only for return traces.
11359 CloudFunction,
11360 /// Target is a App Engine service version. Used only for return traces.
11361 AppEngineVersion,
11362 /// Target is a Cloud Run revision. Used only for return traces.
11363 CloudRunRevision,
11364 /// Target is a Google-managed service. Used only for return traces.
11365 GoogleManagedService,
11366 /// Target is a Redis Instance.
11367 RedisInstance,
11368 /// Target is a Redis Cluster.
11369 RedisCluster,
11370 /// Target is a GKE Pod.
11371 GkePod,
11372 /// Target is a Cloud Run Job. Used only for return traces.
11373 CloudRunJob,
11374 /// Target is a DMS Private Connection. Used only for return traces.
11375 DmsPrivateConnection,
11376 /// If set, the enum was initialized with an unknown value.
11377 ///
11378 /// Applications can examine the value using [Target::value] or
11379 /// [Target::name].
11380 UnknownValue(target::UnknownValue),
11381 }
11382
11383 #[doc(hidden)]
11384 pub mod target {
11385 #[allow(unused_imports)]
11386 use super::*;
11387 #[derive(Clone, Debug, PartialEq)]
11388 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11389 }
11390
11391 impl Target {
11392 /// Gets the enum value.
11393 ///
11394 /// Returns `None` if the enum contains an unknown value deserialized from
11395 /// the string representation of enums.
11396 pub fn value(&self) -> std::option::Option<i32> {
11397 match self {
11398 Self::Unspecified => std::option::Option::Some(0),
11399 Self::Instance => std::option::Option::Some(1),
11400 Self::Internet => std::option::Option::Some(2),
11401 Self::GoogleApi => std::option::Option::Some(3),
11402 Self::GkeMaster => std::option::Option::Some(4),
11403 Self::CloudSqlInstance => std::option::Option::Some(5),
11404 Self::PscPublishedService => std::option::Option::Some(6),
11405 Self::PscGoogleApi => std::option::Option::Some(7),
11406 Self::PscVpcSc => std::option::Option::Some(8),
11407 Self::ServerlessNeg => std::option::Option::Some(9),
11408 Self::StorageBucket => std::option::Option::Some(10),
11409 Self::PrivateNetwork => std::option::Option::Some(11),
11410 Self::CloudFunction => std::option::Option::Some(12),
11411 Self::AppEngineVersion => std::option::Option::Some(13),
11412 Self::CloudRunRevision => std::option::Option::Some(14),
11413 Self::GoogleManagedService => std::option::Option::Some(15),
11414 Self::RedisInstance => std::option::Option::Some(16),
11415 Self::RedisCluster => std::option::Option::Some(17),
11416 Self::GkePod => std::option::Option::Some(19),
11417 Self::CloudRunJob => std::option::Option::Some(20),
11418 Self::DmsPrivateConnection => std::option::Option::Some(21),
11419 Self::UnknownValue(u) => u.0.value(),
11420 }
11421 }
11422
11423 /// Gets the enum value as a string.
11424 ///
11425 /// Returns `None` if the enum contains an unknown value deserialized from
11426 /// the integer representation of enums.
11427 pub fn name(&self) -> std::option::Option<&str> {
11428 match self {
11429 Self::Unspecified => std::option::Option::Some("TARGET_UNSPECIFIED"),
11430 Self::Instance => std::option::Option::Some("INSTANCE"),
11431 Self::Internet => std::option::Option::Some("INTERNET"),
11432 Self::GoogleApi => std::option::Option::Some("GOOGLE_API"),
11433 Self::GkeMaster => std::option::Option::Some("GKE_MASTER"),
11434 Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
11435 Self::PscPublishedService => std::option::Option::Some("PSC_PUBLISHED_SERVICE"),
11436 Self::PscGoogleApi => std::option::Option::Some("PSC_GOOGLE_API"),
11437 Self::PscVpcSc => std::option::Option::Some("PSC_VPC_SC"),
11438 Self::ServerlessNeg => std::option::Option::Some("SERVERLESS_NEG"),
11439 Self::StorageBucket => std::option::Option::Some("STORAGE_BUCKET"),
11440 Self::PrivateNetwork => std::option::Option::Some("PRIVATE_NETWORK"),
11441 Self::CloudFunction => std::option::Option::Some("CLOUD_FUNCTION"),
11442 Self::AppEngineVersion => std::option::Option::Some("APP_ENGINE_VERSION"),
11443 Self::CloudRunRevision => std::option::Option::Some("CLOUD_RUN_REVISION"),
11444 Self::GoogleManagedService => std::option::Option::Some("GOOGLE_MANAGED_SERVICE"),
11445 Self::RedisInstance => std::option::Option::Some("REDIS_INSTANCE"),
11446 Self::RedisCluster => std::option::Option::Some("REDIS_CLUSTER"),
11447 Self::GkePod => std::option::Option::Some("GKE_POD"),
11448 Self::CloudRunJob => std::option::Option::Some("CLOUD_RUN_JOB"),
11449 Self::DmsPrivateConnection => std::option::Option::Some("DMS_PRIVATE_CONNECTION"),
11450 Self::UnknownValue(u) => u.0.name(),
11451 }
11452 }
11453 }
11454
11455 impl std::default::Default for Target {
11456 fn default() -> Self {
11457 use std::convert::From;
11458 Self::from(0)
11459 }
11460 }
11461
11462 impl std::fmt::Display for Target {
11463 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11464 wkt::internal::display_enum(f, self.name(), self.value())
11465 }
11466 }
11467
11468 impl std::convert::From<i32> for Target {
11469 fn from(value: i32) -> Self {
11470 match value {
11471 0 => Self::Unspecified,
11472 1 => Self::Instance,
11473 2 => Self::Internet,
11474 3 => Self::GoogleApi,
11475 4 => Self::GkeMaster,
11476 5 => Self::CloudSqlInstance,
11477 6 => Self::PscPublishedService,
11478 7 => Self::PscGoogleApi,
11479 8 => Self::PscVpcSc,
11480 9 => Self::ServerlessNeg,
11481 10 => Self::StorageBucket,
11482 11 => Self::PrivateNetwork,
11483 12 => Self::CloudFunction,
11484 13 => Self::AppEngineVersion,
11485 14 => Self::CloudRunRevision,
11486 15 => Self::GoogleManagedService,
11487 16 => Self::RedisInstance,
11488 17 => Self::RedisCluster,
11489 19 => Self::GkePod,
11490 20 => Self::CloudRunJob,
11491 21 => Self::DmsPrivateConnection,
11492 _ => Self::UnknownValue(target::UnknownValue(
11493 wkt::internal::UnknownEnumValue::Integer(value),
11494 )),
11495 }
11496 }
11497 }
11498
11499 impl std::convert::From<&str> for Target {
11500 fn from(value: &str) -> Self {
11501 use std::string::ToString;
11502 match value {
11503 "TARGET_UNSPECIFIED" => Self::Unspecified,
11504 "INSTANCE" => Self::Instance,
11505 "INTERNET" => Self::Internet,
11506 "GOOGLE_API" => Self::GoogleApi,
11507 "GKE_MASTER" => Self::GkeMaster,
11508 "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
11509 "PSC_PUBLISHED_SERVICE" => Self::PscPublishedService,
11510 "PSC_GOOGLE_API" => Self::PscGoogleApi,
11511 "PSC_VPC_SC" => Self::PscVpcSc,
11512 "SERVERLESS_NEG" => Self::ServerlessNeg,
11513 "STORAGE_BUCKET" => Self::StorageBucket,
11514 "PRIVATE_NETWORK" => Self::PrivateNetwork,
11515 "CLOUD_FUNCTION" => Self::CloudFunction,
11516 "APP_ENGINE_VERSION" => Self::AppEngineVersion,
11517 "CLOUD_RUN_REVISION" => Self::CloudRunRevision,
11518 "GOOGLE_MANAGED_SERVICE" => Self::GoogleManagedService,
11519 "REDIS_INSTANCE" => Self::RedisInstance,
11520 "REDIS_CLUSTER" => Self::RedisCluster,
11521 "GKE_POD" => Self::GkePod,
11522 "CLOUD_RUN_JOB" => Self::CloudRunJob,
11523 "DMS_PRIVATE_CONNECTION" => Self::DmsPrivateConnection,
11524 _ => Self::UnknownValue(target::UnknownValue(
11525 wkt::internal::UnknownEnumValue::String(value.to_string()),
11526 )),
11527 }
11528 }
11529 }
11530
11531 impl serde::ser::Serialize for Target {
11532 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11533 where
11534 S: serde::Serializer,
11535 {
11536 match self {
11537 Self::Unspecified => serializer.serialize_i32(0),
11538 Self::Instance => serializer.serialize_i32(1),
11539 Self::Internet => serializer.serialize_i32(2),
11540 Self::GoogleApi => serializer.serialize_i32(3),
11541 Self::GkeMaster => serializer.serialize_i32(4),
11542 Self::CloudSqlInstance => serializer.serialize_i32(5),
11543 Self::PscPublishedService => serializer.serialize_i32(6),
11544 Self::PscGoogleApi => serializer.serialize_i32(7),
11545 Self::PscVpcSc => serializer.serialize_i32(8),
11546 Self::ServerlessNeg => serializer.serialize_i32(9),
11547 Self::StorageBucket => serializer.serialize_i32(10),
11548 Self::PrivateNetwork => serializer.serialize_i32(11),
11549 Self::CloudFunction => serializer.serialize_i32(12),
11550 Self::AppEngineVersion => serializer.serialize_i32(13),
11551 Self::CloudRunRevision => serializer.serialize_i32(14),
11552 Self::GoogleManagedService => serializer.serialize_i32(15),
11553 Self::RedisInstance => serializer.serialize_i32(16),
11554 Self::RedisCluster => serializer.serialize_i32(17),
11555 Self::GkePod => serializer.serialize_i32(19),
11556 Self::CloudRunJob => serializer.serialize_i32(20),
11557 Self::DmsPrivateConnection => serializer.serialize_i32(21),
11558 Self::UnknownValue(u) => u.0.serialize(serializer),
11559 }
11560 }
11561 }
11562
11563 impl<'de> serde::de::Deserialize<'de> for Target {
11564 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11565 where
11566 D: serde::Deserializer<'de>,
11567 {
11568 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Target>::new(
11569 ".google.cloud.networkmanagement.v1.DeliverInfo.Target",
11570 ))
11571 }
11572 }
11573
11574 /// Recognized type of a Google Service.
11575 ///
11576 /// # Working with unknown values
11577 ///
11578 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11579 /// additional enum variants at any time. Adding new variants is not considered
11580 /// a breaking change. Applications should write their code in anticipation of:
11581 ///
11582 /// - New values appearing in future releases of the client library, **and**
11583 /// - New values received dynamically, without application changes.
11584 ///
11585 /// Please consult the [Working with enums] section in the user guide for some
11586 /// guidelines.
11587 ///
11588 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11589 #[derive(Clone, Debug, PartialEq)]
11590 #[non_exhaustive]
11591 pub enum GoogleServiceType {
11592 /// Unspecified Google Service.
11593 Unspecified,
11594 /// Identity aware proxy.
11595 /// <https://cloud.google.com/iap/docs/using-tcp-forwarding>
11596 Iap,
11597 /// One of two services sharing IP ranges:
11598 ///
11599 /// * Load Balancer proxy
11600 /// * Centralized Health Check prober
11601 /// <https://cloud.google.com/load-balancing/docs/firewall-rules>
11602 GfeProxyOrHealthCheckProber,
11603 /// Connectivity from Cloud DNS to forwarding targets or alternate name
11604 /// servers that use private routing.
11605 /// <https://cloud.google.com/dns/docs/zones/forwarding-zones#firewall-rules>
11606 /// <https://cloud.google.com/dns/docs/policies#firewall-rules>
11607 CloudDns,
11608 /// private.googleapis.com and restricted.googleapis.com
11609 PrivateGoogleAccess,
11610 /// Google API via Private Service Connect.
11611 /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
11612 /// Google API via Serverless VPC Access.
11613 /// <https://cloud.google.com/vpc/docs/serverless-vpc-access>
11614 ServerlessVpcAccess,
11615 /// If set, the enum was initialized with an unknown value.
11616 ///
11617 /// Applications can examine the value using [GoogleServiceType::value] or
11618 /// [GoogleServiceType::name].
11619 UnknownValue(google_service_type::UnknownValue),
11620 }
11621
11622 #[doc(hidden)]
11623 pub mod google_service_type {
11624 #[allow(unused_imports)]
11625 use super::*;
11626 #[derive(Clone, Debug, PartialEq)]
11627 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11628 }
11629
11630 impl GoogleServiceType {
11631 /// Gets the enum value.
11632 ///
11633 /// Returns `None` if the enum contains an unknown value deserialized from
11634 /// the string representation of enums.
11635 pub fn value(&self) -> std::option::Option<i32> {
11636 match self {
11637 Self::Unspecified => std::option::Option::Some(0),
11638 Self::Iap => std::option::Option::Some(1),
11639 Self::GfeProxyOrHealthCheckProber => std::option::Option::Some(2),
11640 Self::CloudDns => std::option::Option::Some(3),
11641 Self::PrivateGoogleAccess => std::option::Option::Some(4),
11642 Self::ServerlessVpcAccess => std::option::Option::Some(5),
11643 Self::UnknownValue(u) => u.0.value(),
11644 }
11645 }
11646
11647 /// Gets the enum value as a string.
11648 ///
11649 /// Returns `None` if the enum contains an unknown value deserialized from
11650 /// the integer representation of enums.
11651 pub fn name(&self) -> std::option::Option<&str> {
11652 match self {
11653 Self::Unspecified => std::option::Option::Some("GOOGLE_SERVICE_TYPE_UNSPECIFIED"),
11654 Self::Iap => std::option::Option::Some("IAP"),
11655 Self::GfeProxyOrHealthCheckProber => {
11656 std::option::Option::Some("GFE_PROXY_OR_HEALTH_CHECK_PROBER")
11657 }
11658 Self::CloudDns => std::option::Option::Some("CLOUD_DNS"),
11659 Self::PrivateGoogleAccess => std::option::Option::Some("PRIVATE_GOOGLE_ACCESS"),
11660 Self::ServerlessVpcAccess => std::option::Option::Some("SERVERLESS_VPC_ACCESS"),
11661 Self::UnknownValue(u) => u.0.name(),
11662 }
11663 }
11664 }
11665
11666 impl std::default::Default for GoogleServiceType {
11667 fn default() -> Self {
11668 use std::convert::From;
11669 Self::from(0)
11670 }
11671 }
11672
11673 impl std::fmt::Display for GoogleServiceType {
11674 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11675 wkt::internal::display_enum(f, self.name(), self.value())
11676 }
11677 }
11678
11679 impl std::convert::From<i32> for GoogleServiceType {
11680 fn from(value: i32) -> Self {
11681 match value {
11682 0 => Self::Unspecified,
11683 1 => Self::Iap,
11684 2 => Self::GfeProxyOrHealthCheckProber,
11685 3 => Self::CloudDns,
11686 4 => Self::PrivateGoogleAccess,
11687 5 => Self::ServerlessVpcAccess,
11688 _ => Self::UnknownValue(google_service_type::UnknownValue(
11689 wkt::internal::UnknownEnumValue::Integer(value),
11690 )),
11691 }
11692 }
11693 }
11694
11695 impl std::convert::From<&str> for GoogleServiceType {
11696 fn from(value: &str) -> Self {
11697 use std::string::ToString;
11698 match value {
11699 "GOOGLE_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
11700 "IAP" => Self::Iap,
11701 "GFE_PROXY_OR_HEALTH_CHECK_PROBER" => Self::GfeProxyOrHealthCheckProber,
11702 "CLOUD_DNS" => Self::CloudDns,
11703 "PRIVATE_GOOGLE_ACCESS" => Self::PrivateGoogleAccess,
11704 "SERVERLESS_VPC_ACCESS" => Self::ServerlessVpcAccess,
11705 _ => Self::UnknownValue(google_service_type::UnknownValue(
11706 wkt::internal::UnknownEnumValue::String(value.to_string()),
11707 )),
11708 }
11709 }
11710 }
11711
11712 impl serde::ser::Serialize for GoogleServiceType {
11713 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11714 where
11715 S: serde::Serializer,
11716 {
11717 match self {
11718 Self::Unspecified => serializer.serialize_i32(0),
11719 Self::Iap => serializer.serialize_i32(1),
11720 Self::GfeProxyOrHealthCheckProber => serializer.serialize_i32(2),
11721 Self::CloudDns => serializer.serialize_i32(3),
11722 Self::PrivateGoogleAccess => serializer.serialize_i32(4),
11723 Self::ServerlessVpcAccess => serializer.serialize_i32(5),
11724 Self::UnknownValue(u) => u.0.serialize(serializer),
11725 }
11726 }
11727 }
11728
11729 impl<'de> serde::de::Deserialize<'de> for GoogleServiceType {
11730 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11731 where
11732 D: serde::Deserializer<'de>,
11733 {
11734 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GoogleServiceType>::new(
11735 ".google.cloud.networkmanagement.v1.DeliverInfo.GoogleServiceType",
11736 ))
11737 }
11738 }
11739}
11740
11741/// Details of the final state "forward" and associated resource.
11742#[derive(Clone, Default, PartialEq)]
11743#[non_exhaustive]
11744pub struct ForwardInfo {
11745 /// Target type where this packet is forwarded to.
11746 pub target: crate::model::forward_info::Target,
11747
11748 /// URI of the resource that the packet is forwarded to.
11749 pub resource_uri: std::string::String,
11750
11751 /// IP address of the target (if applicable).
11752 pub ip_address: std::string::String,
11753
11754 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11755}
11756
11757impl ForwardInfo {
11758 /// Creates a new default instance.
11759 pub fn new() -> Self {
11760 std::default::Default::default()
11761 }
11762
11763 /// Sets the value of [target][crate::model::ForwardInfo::target].
11764 ///
11765 /// # Example
11766 /// ```ignore,no_run
11767 /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
11768 /// use google_cloud_networkmanagement_v1::model::forward_info::Target;
11769 /// let x0 = ForwardInfo::new().set_target(Target::PeeringVpc);
11770 /// let x1 = ForwardInfo::new().set_target(Target::VpnGateway);
11771 /// let x2 = ForwardInfo::new().set_target(Target::Interconnect);
11772 /// ```
11773 pub fn set_target<T: std::convert::Into<crate::model::forward_info::Target>>(
11774 mut self,
11775 v: T,
11776 ) -> Self {
11777 self.target = v.into();
11778 self
11779 }
11780
11781 /// Sets the value of [resource_uri][crate::model::ForwardInfo::resource_uri].
11782 ///
11783 /// # Example
11784 /// ```ignore,no_run
11785 /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
11786 /// let x = ForwardInfo::new().set_resource_uri("example");
11787 /// ```
11788 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11789 self.resource_uri = v.into();
11790 self
11791 }
11792
11793 /// Sets the value of [ip_address][crate::model::ForwardInfo::ip_address].
11794 ///
11795 /// # Example
11796 /// ```ignore,no_run
11797 /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
11798 /// let x = ForwardInfo::new().set_ip_address("example");
11799 /// ```
11800 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11801 self.ip_address = v.into();
11802 self
11803 }
11804}
11805
11806impl wkt::message::Message for ForwardInfo {
11807 fn typename() -> &'static str {
11808 "type.googleapis.com/google.cloud.networkmanagement.v1.ForwardInfo"
11809 }
11810}
11811
11812/// Defines additional types related to [ForwardInfo].
11813pub mod forward_info {
11814 #[allow(unused_imports)]
11815 use super::*;
11816
11817 /// Forward target types.
11818 ///
11819 /// # Working with unknown values
11820 ///
11821 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11822 /// additional enum variants at any time. Adding new variants is not considered
11823 /// a breaking change. Applications should write their code in anticipation of:
11824 ///
11825 /// - New values appearing in future releases of the client library, **and**
11826 /// - New values received dynamically, without application changes.
11827 ///
11828 /// Please consult the [Working with enums] section in the user guide for some
11829 /// guidelines.
11830 ///
11831 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11832 #[derive(Clone, Debug, PartialEq)]
11833 #[non_exhaustive]
11834 pub enum Target {
11835 /// Target not specified.
11836 Unspecified,
11837 /// Forwarded to a VPC peering network.
11838 PeeringVpc,
11839 /// Forwarded to a Cloud VPN gateway.
11840 VpnGateway,
11841 /// Forwarded to a Cloud Interconnect connection.
11842 Interconnect,
11843 /// Forwarded to a Google Kubernetes Engine Container cluster master.
11844 #[deprecated]
11845 GkeMaster,
11846 /// Forwarded to the next hop of a custom route imported from a peering VPC.
11847 ImportedCustomRouteNextHop,
11848 /// Forwarded to a Cloud SQL instance.
11849 #[deprecated]
11850 CloudSqlInstance,
11851 /// Forwarded to a VPC network in another project.
11852 AnotherProject,
11853 /// Forwarded to an NCC Hub.
11854 NccHub,
11855 /// Forwarded to a router appliance.
11856 RouterAppliance,
11857 /// Forwarded to a Secure Web Proxy Gateway.
11858 SecureWebProxyGateway,
11859 /// If set, the enum was initialized with an unknown value.
11860 ///
11861 /// Applications can examine the value using [Target::value] or
11862 /// [Target::name].
11863 UnknownValue(target::UnknownValue),
11864 }
11865
11866 #[doc(hidden)]
11867 pub mod target {
11868 #[allow(unused_imports)]
11869 use super::*;
11870 #[derive(Clone, Debug, PartialEq)]
11871 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11872 }
11873
11874 impl Target {
11875 /// Gets the enum value.
11876 ///
11877 /// Returns `None` if the enum contains an unknown value deserialized from
11878 /// the string representation of enums.
11879 pub fn value(&self) -> std::option::Option<i32> {
11880 match self {
11881 Self::Unspecified => std::option::Option::Some(0),
11882 Self::PeeringVpc => std::option::Option::Some(1),
11883 Self::VpnGateway => std::option::Option::Some(2),
11884 Self::Interconnect => std::option::Option::Some(3),
11885 Self::GkeMaster => std::option::Option::Some(4),
11886 Self::ImportedCustomRouteNextHop => std::option::Option::Some(5),
11887 Self::CloudSqlInstance => std::option::Option::Some(6),
11888 Self::AnotherProject => std::option::Option::Some(7),
11889 Self::NccHub => std::option::Option::Some(8),
11890 Self::RouterAppliance => std::option::Option::Some(9),
11891 Self::SecureWebProxyGateway => std::option::Option::Some(10),
11892 Self::UnknownValue(u) => u.0.value(),
11893 }
11894 }
11895
11896 /// Gets the enum value as a string.
11897 ///
11898 /// Returns `None` if the enum contains an unknown value deserialized from
11899 /// the integer representation of enums.
11900 pub fn name(&self) -> std::option::Option<&str> {
11901 match self {
11902 Self::Unspecified => std::option::Option::Some("TARGET_UNSPECIFIED"),
11903 Self::PeeringVpc => std::option::Option::Some("PEERING_VPC"),
11904 Self::VpnGateway => std::option::Option::Some("VPN_GATEWAY"),
11905 Self::Interconnect => std::option::Option::Some("INTERCONNECT"),
11906 Self::GkeMaster => std::option::Option::Some("GKE_MASTER"),
11907 Self::ImportedCustomRouteNextHop => {
11908 std::option::Option::Some("IMPORTED_CUSTOM_ROUTE_NEXT_HOP")
11909 }
11910 Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
11911 Self::AnotherProject => std::option::Option::Some("ANOTHER_PROJECT"),
11912 Self::NccHub => std::option::Option::Some("NCC_HUB"),
11913 Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
11914 Self::SecureWebProxyGateway => {
11915 std::option::Option::Some("SECURE_WEB_PROXY_GATEWAY")
11916 }
11917 Self::UnknownValue(u) => u.0.name(),
11918 }
11919 }
11920 }
11921
11922 impl std::default::Default for Target {
11923 fn default() -> Self {
11924 use std::convert::From;
11925 Self::from(0)
11926 }
11927 }
11928
11929 impl std::fmt::Display for Target {
11930 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11931 wkt::internal::display_enum(f, self.name(), self.value())
11932 }
11933 }
11934
11935 impl std::convert::From<i32> for Target {
11936 fn from(value: i32) -> Self {
11937 match value {
11938 0 => Self::Unspecified,
11939 1 => Self::PeeringVpc,
11940 2 => Self::VpnGateway,
11941 3 => Self::Interconnect,
11942 4 => Self::GkeMaster,
11943 5 => Self::ImportedCustomRouteNextHop,
11944 6 => Self::CloudSqlInstance,
11945 7 => Self::AnotherProject,
11946 8 => Self::NccHub,
11947 9 => Self::RouterAppliance,
11948 10 => Self::SecureWebProxyGateway,
11949 _ => Self::UnknownValue(target::UnknownValue(
11950 wkt::internal::UnknownEnumValue::Integer(value),
11951 )),
11952 }
11953 }
11954 }
11955
11956 impl std::convert::From<&str> for Target {
11957 fn from(value: &str) -> Self {
11958 use std::string::ToString;
11959 match value {
11960 "TARGET_UNSPECIFIED" => Self::Unspecified,
11961 "PEERING_VPC" => Self::PeeringVpc,
11962 "VPN_GATEWAY" => Self::VpnGateway,
11963 "INTERCONNECT" => Self::Interconnect,
11964 "GKE_MASTER" => Self::GkeMaster,
11965 "IMPORTED_CUSTOM_ROUTE_NEXT_HOP" => Self::ImportedCustomRouteNextHop,
11966 "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
11967 "ANOTHER_PROJECT" => Self::AnotherProject,
11968 "NCC_HUB" => Self::NccHub,
11969 "ROUTER_APPLIANCE" => Self::RouterAppliance,
11970 "SECURE_WEB_PROXY_GATEWAY" => Self::SecureWebProxyGateway,
11971 _ => Self::UnknownValue(target::UnknownValue(
11972 wkt::internal::UnknownEnumValue::String(value.to_string()),
11973 )),
11974 }
11975 }
11976 }
11977
11978 impl serde::ser::Serialize for Target {
11979 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11980 where
11981 S: serde::Serializer,
11982 {
11983 match self {
11984 Self::Unspecified => serializer.serialize_i32(0),
11985 Self::PeeringVpc => serializer.serialize_i32(1),
11986 Self::VpnGateway => serializer.serialize_i32(2),
11987 Self::Interconnect => serializer.serialize_i32(3),
11988 Self::GkeMaster => serializer.serialize_i32(4),
11989 Self::ImportedCustomRouteNextHop => serializer.serialize_i32(5),
11990 Self::CloudSqlInstance => serializer.serialize_i32(6),
11991 Self::AnotherProject => serializer.serialize_i32(7),
11992 Self::NccHub => serializer.serialize_i32(8),
11993 Self::RouterAppliance => serializer.serialize_i32(9),
11994 Self::SecureWebProxyGateway => serializer.serialize_i32(10),
11995 Self::UnknownValue(u) => u.0.serialize(serializer),
11996 }
11997 }
11998 }
11999
12000 impl<'de> serde::de::Deserialize<'de> for Target {
12001 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12002 where
12003 D: serde::Deserializer<'de>,
12004 {
12005 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Target>::new(
12006 ".google.cloud.networkmanagement.v1.ForwardInfo.Target",
12007 ))
12008 }
12009 }
12010}
12011
12012/// Details of the final state "abort" and associated resource.
12013#[derive(Clone, Default, PartialEq)]
12014#[non_exhaustive]
12015pub struct AbortInfo {
12016 /// Causes that the analysis is aborted.
12017 pub cause: crate::model::abort_info::Cause,
12018
12019 /// URI of the resource that caused the abort.
12020 pub resource_uri: std::string::String,
12021
12022 /// IP address that caused the abort.
12023 pub ip_address: std::string::String,
12024
12025 /// List of project IDs the user specified in the request but lacks access to.
12026 /// In this case, analysis is aborted with the PERMISSION_DENIED cause.
12027 pub projects_missing_permission: std::vec::Vec<std::string::String>,
12028
12029 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12030}
12031
12032impl AbortInfo {
12033 /// Creates a new default instance.
12034 pub fn new() -> Self {
12035 std::default::Default::default()
12036 }
12037
12038 /// Sets the value of [cause][crate::model::AbortInfo::cause].
12039 ///
12040 /// # Example
12041 /// ```ignore,no_run
12042 /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
12043 /// use google_cloud_networkmanagement_v1::model::abort_info::Cause;
12044 /// let x0 = AbortInfo::new().set_cause(Cause::UnknownIp);
12045 /// let x1 = AbortInfo::new().set_cause(Cause::GoogleManagedServiceUnknownIp);
12046 /// let x2 = AbortInfo::new().set_cause(Cause::SourceIpAddressNotInSourceNetwork);
12047 /// ```
12048 pub fn set_cause<T: std::convert::Into<crate::model::abort_info::Cause>>(
12049 mut self,
12050 v: T,
12051 ) -> Self {
12052 self.cause = v.into();
12053 self
12054 }
12055
12056 /// Sets the value of [resource_uri][crate::model::AbortInfo::resource_uri].
12057 ///
12058 /// # Example
12059 /// ```ignore,no_run
12060 /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
12061 /// let x = AbortInfo::new().set_resource_uri("example");
12062 /// ```
12063 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12064 self.resource_uri = v.into();
12065 self
12066 }
12067
12068 /// Sets the value of [ip_address][crate::model::AbortInfo::ip_address].
12069 ///
12070 /// # Example
12071 /// ```ignore,no_run
12072 /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
12073 /// let x = AbortInfo::new().set_ip_address("example");
12074 /// ```
12075 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12076 self.ip_address = v.into();
12077 self
12078 }
12079
12080 /// Sets the value of [projects_missing_permission][crate::model::AbortInfo::projects_missing_permission].
12081 ///
12082 /// # Example
12083 /// ```ignore,no_run
12084 /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
12085 /// let x = AbortInfo::new().set_projects_missing_permission(["a", "b", "c"]);
12086 /// ```
12087 pub fn set_projects_missing_permission<T, V>(mut self, v: T) -> Self
12088 where
12089 T: std::iter::IntoIterator<Item = V>,
12090 V: std::convert::Into<std::string::String>,
12091 {
12092 use std::iter::Iterator;
12093 self.projects_missing_permission = v.into_iter().map(|i| i.into()).collect();
12094 self
12095 }
12096}
12097
12098impl wkt::message::Message for AbortInfo {
12099 fn typename() -> &'static str {
12100 "type.googleapis.com/google.cloud.networkmanagement.v1.AbortInfo"
12101 }
12102}
12103
12104/// Defines additional types related to [AbortInfo].
12105pub mod abort_info {
12106 #[allow(unused_imports)]
12107 use super::*;
12108
12109 /// Abort cause types:
12110 ///
12111 /// # Working with unknown values
12112 ///
12113 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12114 /// additional enum variants at any time. Adding new variants is not considered
12115 /// a breaking change. Applications should write their code in anticipation of:
12116 ///
12117 /// - New values appearing in future releases of the client library, **and**
12118 /// - New values received dynamically, without application changes.
12119 ///
12120 /// Please consult the [Working with enums] section in the user guide for some
12121 /// guidelines.
12122 ///
12123 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12124 #[derive(Clone, Debug, PartialEq)]
12125 #[non_exhaustive]
12126 pub enum Cause {
12127 /// Cause is unspecified.
12128 Unspecified,
12129 /// Aborted due to unknown network. Deprecated, not used in the new tests.
12130 #[deprecated]
12131 UnknownNetwork,
12132 /// Aborted because no project information can be derived from the test
12133 /// input. Deprecated, not used in the new tests.
12134 #[deprecated]
12135 UnknownProject,
12136 /// Aborted because traffic is sent from a public IP to an instance without
12137 /// an external IP. Deprecated, not used in the new tests.
12138 #[deprecated]
12139 NoExternalIp,
12140 /// Aborted because none of the traces matches destination information
12141 /// specified in the input test request. Deprecated, not used in the new
12142 /// tests.
12143 #[deprecated]
12144 UnintendedDestination,
12145 /// Aborted because the source endpoint could not be found. Deprecated, not
12146 /// used in the new tests.
12147 #[deprecated]
12148 SourceEndpointNotFound,
12149 /// Aborted because the source network does not match the source endpoint.
12150 /// Deprecated, not used in the new tests.
12151 #[deprecated]
12152 MismatchedSourceNetwork,
12153 /// Aborted because the destination endpoint could not be found. Deprecated,
12154 /// not used in the new tests.
12155 #[deprecated]
12156 DestinationEndpointNotFound,
12157 /// Aborted because the destination network does not match the destination
12158 /// endpoint. Deprecated, not used in the new tests.
12159 #[deprecated]
12160 MismatchedDestinationNetwork,
12161 /// Aborted because no endpoint with the packet's destination IP address is
12162 /// found.
12163 UnknownIp,
12164 /// Aborted because no endpoint with the packet's destination IP is found in
12165 /// the Google-managed project.
12166 GoogleManagedServiceUnknownIp,
12167 /// Aborted because the source IP address doesn't belong to any of the
12168 /// subnets of the source VPC network.
12169 SourceIpAddressNotInSourceNetwork,
12170 /// Aborted because user lacks permission to access all or part of the
12171 /// network configurations required to run the test.
12172 PermissionDenied,
12173 /// Aborted because user lacks permission to access Cloud NAT configs
12174 /// required to run the test.
12175 PermissionDeniedNoCloudNatConfigs,
12176 /// Aborted because user lacks permission to access Network endpoint group
12177 /// endpoint configs required to run the test.
12178 PermissionDeniedNoNegEndpointConfigs,
12179 /// Aborted because user lacks permission to access Cloud Router configs
12180 /// required to run the test.
12181 PermissionDeniedNoCloudRouterConfigs,
12182 /// Aborted because no valid source or destination endpoint can be derived
12183 /// from the test request.
12184 NoSourceLocation,
12185 /// Aborted because the source IP address is not contained within the subnet
12186 /// ranges of the provided VPC network.
12187 NoSourceGcpNetworkLocation,
12188 /// Aborted because the source IP address is not contained within the
12189 /// destination ranges of the routes towards non-GCP networks in the provided
12190 /// VPC network.
12191 NoSourceNonGcpNetworkLocation,
12192 /// Aborted because the source IP address can't be resolved as an Internet
12193 /// IP address.
12194 NoSourceInternetLocation,
12195 /// Aborted because the source or destination endpoint specified in
12196 /// the request is invalid. Some examples:
12197 ///
12198 /// - The request might contain malformed resource URI, project ID, or IP
12199 /// address.
12200 /// - The request might contain inconsistent information (for example, the
12201 /// request might include both the instance and the network, but the instance
12202 /// might not have a NIC in that network).
12203 InvalidArgument,
12204 /// Aborted because the number of steps in the trace exceeds a certain
12205 /// limit. It might be caused by a routing loop.
12206 TraceTooLong,
12207 /// Aborted due to internal server error.
12208 InternalError,
12209 /// Aborted because the test scenario is not supported.
12210 Unsupported,
12211 /// Aborted because the source and destination resources have no common IP
12212 /// version.
12213 MismatchedIpVersion,
12214 /// Aborted because the connection between the control plane and the node of
12215 /// the source cluster is initiated by the node and managed by the
12216 /// Konnectivity proxy.
12217 GkeKonnectivityProxyUnsupported,
12218 /// Aborted because expected resource configuration was missing.
12219 ResourceConfigNotFound,
12220 /// Aborted because expected VM instance configuration was missing.
12221 VmInstanceConfigNotFound,
12222 /// Aborted because expected network configuration was missing.
12223 NetworkConfigNotFound,
12224 /// Aborted because expected firewall configuration was missing.
12225 FirewallConfigNotFound,
12226 /// Aborted because expected route configuration was missing.
12227 RouteConfigNotFound,
12228 /// Aborted because PSC endpoint selection for the Google-managed service
12229 /// is ambiguous (several PSC endpoints satisfy test input).
12230 GoogleManagedServiceAmbiguousPscEndpoint,
12231 /// Aborted because endpoint selection for the Google-managed service is
12232 /// ambiguous (several endpoints satisfy test input).
12233 GoogleManagedServiceAmbiguousEndpoint,
12234 /// Aborted because tests with a PSC-based Cloud SQL instance as a source are
12235 /// not supported.
12236 SourcePscCloudSqlUnsupported,
12237 /// Aborted because tests with the external database as a source are not
12238 /// supported. In such replication scenarios, the connection is initiated by
12239 /// the Cloud SQL replica instance.
12240 SourceExternalCloudSqlUnsupported,
12241 /// Aborted because tests with a Redis Cluster as a source are not supported.
12242 SourceRedisClusterUnsupported,
12243 /// Aborted because tests with a Redis Instance as a source are not
12244 /// supported.
12245 SourceRedisInstanceUnsupported,
12246 /// Aborted because tests with a forwarding rule as a source are not
12247 /// supported.
12248 SourceForwardingRuleUnsupported,
12249 /// Aborted because one of the endpoints is a non-routable IP address
12250 /// (loopback, link-local, etc).
12251 NonRoutableIpAddress,
12252 /// Aborted due to an unknown issue in the Google-managed project.
12253 UnknownIssueInGoogleManagedProject,
12254 /// Aborted due to an unsupported configuration of the Google-managed
12255 /// project.
12256 UnsupportedGoogleManagedProjectConfig,
12257 /// Aborted because the source endpoint is a Cloud Run revision with direct
12258 /// VPC access enabled, but there are no reserved serverless IP ranges.
12259 NoServerlessIpRanges,
12260 /// Aborted because the used protocol is not supported for the used IP
12261 /// version.
12262 IpVersionProtocolMismatch,
12263 /// Aborted because selected GKE Pod endpoint location is unknown. This is
12264 /// often the case for "Pending" Pods, which don't have assigned IP addresses
12265 /// yet.
12266 GkePodUnknownEndpointLocation,
12267 /// If set, the enum was initialized with an unknown value.
12268 ///
12269 /// Applications can examine the value using [Cause::value] or
12270 /// [Cause::name].
12271 UnknownValue(cause::UnknownValue),
12272 }
12273
12274 #[doc(hidden)]
12275 pub mod cause {
12276 #[allow(unused_imports)]
12277 use super::*;
12278 #[derive(Clone, Debug, PartialEq)]
12279 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12280 }
12281
12282 impl Cause {
12283 /// Gets the enum value.
12284 ///
12285 /// Returns `None` if the enum contains an unknown value deserialized from
12286 /// the string representation of enums.
12287 pub fn value(&self) -> std::option::Option<i32> {
12288 match self {
12289 Self::Unspecified => std::option::Option::Some(0),
12290 Self::UnknownNetwork => std::option::Option::Some(1),
12291 Self::UnknownProject => std::option::Option::Some(3),
12292 Self::NoExternalIp => std::option::Option::Some(7),
12293 Self::UnintendedDestination => std::option::Option::Some(8),
12294 Self::SourceEndpointNotFound => std::option::Option::Some(11),
12295 Self::MismatchedSourceNetwork => std::option::Option::Some(12),
12296 Self::DestinationEndpointNotFound => std::option::Option::Some(13),
12297 Self::MismatchedDestinationNetwork => std::option::Option::Some(14),
12298 Self::UnknownIp => std::option::Option::Some(2),
12299 Self::GoogleManagedServiceUnknownIp => std::option::Option::Some(32),
12300 Self::SourceIpAddressNotInSourceNetwork => std::option::Option::Some(23),
12301 Self::PermissionDenied => std::option::Option::Some(4),
12302 Self::PermissionDeniedNoCloudNatConfigs => std::option::Option::Some(28),
12303 Self::PermissionDeniedNoNegEndpointConfigs => std::option::Option::Some(29),
12304 Self::PermissionDeniedNoCloudRouterConfigs => std::option::Option::Some(36),
12305 Self::NoSourceLocation => std::option::Option::Some(5),
12306 Self::NoSourceGcpNetworkLocation => std::option::Option::Some(42),
12307 Self::NoSourceNonGcpNetworkLocation => std::option::Option::Some(43),
12308 Self::NoSourceInternetLocation => std::option::Option::Some(44),
12309 Self::InvalidArgument => std::option::Option::Some(6),
12310 Self::TraceTooLong => std::option::Option::Some(9),
12311 Self::InternalError => std::option::Option::Some(10),
12312 Self::Unsupported => std::option::Option::Some(15),
12313 Self::MismatchedIpVersion => std::option::Option::Some(16),
12314 Self::GkeKonnectivityProxyUnsupported => std::option::Option::Some(17),
12315 Self::ResourceConfigNotFound => std::option::Option::Some(18),
12316 Self::VmInstanceConfigNotFound => std::option::Option::Some(24),
12317 Self::NetworkConfigNotFound => std::option::Option::Some(25),
12318 Self::FirewallConfigNotFound => std::option::Option::Some(26),
12319 Self::RouteConfigNotFound => std::option::Option::Some(27),
12320 Self::GoogleManagedServiceAmbiguousPscEndpoint => std::option::Option::Some(19),
12321 Self::GoogleManagedServiceAmbiguousEndpoint => std::option::Option::Some(39),
12322 Self::SourcePscCloudSqlUnsupported => std::option::Option::Some(20),
12323 Self::SourceExternalCloudSqlUnsupported => std::option::Option::Some(45),
12324 Self::SourceRedisClusterUnsupported => std::option::Option::Some(34),
12325 Self::SourceRedisInstanceUnsupported => std::option::Option::Some(35),
12326 Self::SourceForwardingRuleUnsupported => std::option::Option::Some(21),
12327 Self::NonRoutableIpAddress => std::option::Option::Some(22),
12328 Self::UnknownIssueInGoogleManagedProject => std::option::Option::Some(30),
12329 Self::UnsupportedGoogleManagedProjectConfig => std::option::Option::Some(31),
12330 Self::NoServerlessIpRanges => std::option::Option::Some(37),
12331 Self::IpVersionProtocolMismatch => std::option::Option::Some(40),
12332 Self::GkePodUnknownEndpointLocation => std::option::Option::Some(41),
12333 Self::UnknownValue(u) => u.0.value(),
12334 }
12335 }
12336
12337 /// Gets the enum value as a string.
12338 ///
12339 /// Returns `None` if the enum contains an unknown value deserialized from
12340 /// the integer representation of enums.
12341 pub fn name(&self) -> std::option::Option<&str> {
12342 match self {
12343 Self::Unspecified => std::option::Option::Some("CAUSE_UNSPECIFIED"),
12344 Self::UnknownNetwork => std::option::Option::Some("UNKNOWN_NETWORK"),
12345 Self::UnknownProject => std::option::Option::Some("UNKNOWN_PROJECT"),
12346 Self::NoExternalIp => std::option::Option::Some("NO_EXTERNAL_IP"),
12347 Self::UnintendedDestination => std::option::Option::Some("UNINTENDED_DESTINATION"),
12348 Self::SourceEndpointNotFound => {
12349 std::option::Option::Some("SOURCE_ENDPOINT_NOT_FOUND")
12350 }
12351 Self::MismatchedSourceNetwork => {
12352 std::option::Option::Some("MISMATCHED_SOURCE_NETWORK")
12353 }
12354 Self::DestinationEndpointNotFound => {
12355 std::option::Option::Some("DESTINATION_ENDPOINT_NOT_FOUND")
12356 }
12357 Self::MismatchedDestinationNetwork => {
12358 std::option::Option::Some("MISMATCHED_DESTINATION_NETWORK")
12359 }
12360 Self::UnknownIp => std::option::Option::Some("UNKNOWN_IP"),
12361 Self::GoogleManagedServiceUnknownIp => {
12362 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_UNKNOWN_IP")
12363 }
12364 Self::SourceIpAddressNotInSourceNetwork => {
12365 std::option::Option::Some("SOURCE_IP_ADDRESS_NOT_IN_SOURCE_NETWORK")
12366 }
12367 Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
12368 Self::PermissionDeniedNoCloudNatConfigs => {
12369 std::option::Option::Some("PERMISSION_DENIED_NO_CLOUD_NAT_CONFIGS")
12370 }
12371 Self::PermissionDeniedNoNegEndpointConfigs => {
12372 std::option::Option::Some("PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS")
12373 }
12374 Self::PermissionDeniedNoCloudRouterConfigs => {
12375 std::option::Option::Some("PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS")
12376 }
12377 Self::NoSourceLocation => std::option::Option::Some("NO_SOURCE_LOCATION"),
12378 Self::NoSourceGcpNetworkLocation => {
12379 std::option::Option::Some("NO_SOURCE_GCP_NETWORK_LOCATION")
12380 }
12381 Self::NoSourceNonGcpNetworkLocation => {
12382 std::option::Option::Some("NO_SOURCE_NON_GCP_NETWORK_LOCATION")
12383 }
12384 Self::NoSourceInternetLocation => {
12385 std::option::Option::Some("NO_SOURCE_INTERNET_LOCATION")
12386 }
12387 Self::InvalidArgument => std::option::Option::Some("INVALID_ARGUMENT"),
12388 Self::TraceTooLong => std::option::Option::Some("TRACE_TOO_LONG"),
12389 Self::InternalError => std::option::Option::Some("INTERNAL_ERROR"),
12390 Self::Unsupported => std::option::Option::Some("UNSUPPORTED"),
12391 Self::MismatchedIpVersion => std::option::Option::Some("MISMATCHED_IP_VERSION"),
12392 Self::GkeKonnectivityProxyUnsupported => {
12393 std::option::Option::Some("GKE_KONNECTIVITY_PROXY_UNSUPPORTED")
12394 }
12395 Self::ResourceConfigNotFound => {
12396 std::option::Option::Some("RESOURCE_CONFIG_NOT_FOUND")
12397 }
12398 Self::VmInstanceConfigNotFound => {
12399 std::option::Option::Some("VM_INSTANCE_CONFIG_NOT_FOUND")
12400 }
12401 Self::NetworkConfigNotFound => {
12402 std::option::Option::Some("NETWORK_CONFIG_NOT_FOUND")
12403 }
12404 Self::FirewallConfigNotFound => {
12405 std::option::Option::Some("FIREWALL_CONFIG_NOT_FOUND")
12406 }
12407 Self::RouteConfigNotFound => std::option::Option::Some("ROUTE_CONFIG_NOT_FOUND"),
12408 Self::GoogleManagedServiceAmbiguousPscEndpoint => {
12409 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT")
12410 }
12411 Self::GoogleManagedServiceAmbiguousEndpoint => {
12412 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT")
12413 }
12414 Self::SourcePscCloudSqlUnsupported => {
12415 std::option::Option::Some("SOURCE_PSC_CLOUD_SQL_UNSUPPORTED")
12416 }
12417 Self::SourceExternalCloudSqlUnsupported => {
12418 std::option::Option::Some("SOURCE_EXTERNAL_CLOUD_SQL_UNSUPPORTED")
12419 }
12420 Self::SourceRedisClusterUnsupported => {
12421 std::option::Option::Some("SOURCE_REDIS_CLUSTER_UNSUPPORTED")
12422 }
12423 Self::SourceRedisInstanceUnsupported => {
12424 std::option::Option::Some("SOURCE_REDIS_INSTANCE_UNSUPPORTED")
12425 }
12426 Self::SourceForwardingRuleUnsupported => {
12427 std::option::Option::Some("SOURCE_FORWARDING_RULE_UNSUPPORTED")
12428 }
12429 Self::NonRoutableIpAddress => std::option::Option::Some("NON_ROUTABLE_IP_ADDRESS"),
12430 Self::UnknownIssueInGoogleManagedProject => {
12431 std::option::Option::Some("UNKNOWN_ISSUE_IN_GOOGLE_MANAGED_PROJECT")
12432 }
12433 Self::UnsupportedGoogleManagedProjectConfig => {
12434 std::option::Option::Some("UNSUPPORTED_GOOGLE_MANAGED_PROJECT_CONFIG")
12435 }
12436 Self::NoServerlessIpRanges => std::option::Option::Some("NO_SERVERLESS_IP_RANGES"),
12437 Self::IpVersionProtocolMismatch => {
12438 std::option::Option::Some("IP_VERSION_PROTOCOL_MISMATCH")
12439 }
12440 Self::GkePodUnknownEndpointLocation => {
12441 std::option::Option::Some("GKE_POD_UNKNOWN_ENDPOINT_LOCATION")
12442 }
12443 Self::UnknownValue(u) => u.0.name(),
12444 }
12445 }
12446 }
12447
12448 impl std::default::Default for Cause {
12449 fn default() -> Self {
12450 use std::convert::From;
12451 Self::from(0)
12452 }
12453 }
12454
12455 impl std::fmt::Display for Cause {
12456 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12457 wkt::internal::display_enum(f, self.name(), self.value())
12458 }
12459 }
12460
12461 impl std::convert::From<i32> for Cause {
12462 fn from(value: i32) -> Self {
12463 match value {
12464 0 => Self::Unspecified,
12465 1 => Self::UnknownNetwork,
12466 2 => Self::UnknownIp,
12467 3 => Self::UnknownProject,
12468 4 => Self::PermissionDenied,
12469 5 => Self::NoSourceLocation,
12470 6 => Self::InvalidArgument,
12471 7 => Self::NoExternalIp,
12472 8 => Self::UnintendedDestination,
12473 9 => Self::TraceTooLong,
12474 10 => Self::InternalError,
12475 11 => Self::SourceEndpointNotFound,
12476 12 => Self::MismatchedSourceNetwork,
12477 13 => Self::DestinationEndpointNotFound,
12478 14 => Self::MismatchedDestinationNetwork,
12479 15 => Self::Unsupported,
12480 16 => Self::MismatchedIpVersion,
12481 17 => Self::GkeKonnectivityProxyUnsupported,
12482 18 => Self::ResourceConfigNotFound,
12483 19 => Self::GoogleManagedServiceAmbiguousPscEndpoint,
12484 20 => Self::SourcePscCloudSqlUnsupported,
12485 21 => Self::SourceForwardingRuleUnsupported,
12486 22 => Self::NonRoutableIpAddress,
12487 23 => Self::SourceIpAddressNotInSourceNetwork,
12488 24 => Self::VmInstanceConfigNotFound,
12489 25 => Self::NetworkConfigNotFound,
12490 26 => Self::FirewallConfigNotFound,
12491 27 => Self::RouteConfigNotFound,
12492 28 => Self::PermissionDeniedNoCloudNatConfigs,
12493 29 => Self::PermissionDeniedNoNegEndpointConfigs,
12494 30 => Self::UnknownIssueInGoogleManagedProject,
12495 31 => Self::UnsupportedGoogleManagedProjectConfig,
12496 32 => Self::GoogleManagedServiceUnknownIp,
12497 34 => Self::SourceRedisClusterUnsupported,
12498 35 => Self::SourceRedisInstanceUnsupported,
12499 36 => Self::PermissionDeniedNoCloudRouterConfigs,
12500 37 => Self::NoServerlessIpRanges,
12501 39 => Self::GoogleManagedServiceAmbiguousEndpoint,
12502 40 => Self::IpVersionProtocolMismatch,
12503 41 => Self::GkePodUnknownEndpointLocation,
12504 42 => Self::NoSourceGcpNetworkLocation,
12505 43 => Self::NoSourceNonGcpNetworkLocation,
12506 44 => Self::NoSourceInternetLocation,
12507 45 => Self::SourceExternalCloudSqlUnsupported,
12508 _ => Self::UnknownValue(cause::UnknownValue(
12509 wkt::internal::UnknownEnumValue::Integer(value),
12510 )),
12511 }
12512 }
12513 }
12514
12515 impl std::convert::From<&str> for Cause {
12516 fn from(value: &str) -> Self {
12517 use std::string::ToString;
12518 match value {
12519 "CAUSE_UNSPECIFIED" => Self::Unspecified,
12520 "UNKNOWN_NETWORK" => Self::UnknownNetwork,
12521 "UNKNOWN_PROJECT" => Self::UnknownProject,
12522 "NO_EXTERNAL_IP" => Self::NoExternalIp,
12523 "UNINTENDED_DESTINATION" => Self::UnintendedDestination,
12524 "SOURCE_ENDPOINT_NOT_FOUND" => Self::SourceEndpointNotFound,
12525 "MISMATCHED_SOURCE_NETWORK" => Self::MismatchedSourceNetwork,
12526 "DESTINATION_ENDPOINT_NOT_FOUND" => Self::DestinationEndpointNotFound,
12527 "MISMATCHED_DESTINATION_NETWORK" => Self::MismatchedDestinationNetwork,
12528 "UNKNOWN_IP" => Self::UnknownIp,
12529 "GOOGLE_MANAGED_SERVICE_UNKNOWN_IP" => Self::GoogleManagedServiceUnknownIp,
12530 "SOURCE_IP_ADDRESS_NOT_IN_SOURCE_NETWORK" => {
12531 Self::SourceIpAddressNotInSourceNetwork
12532 }
12533 "PERMISSION_DENIED" => Self::PermissionDenied,
12534 "PERMISSION_DENIED_NO_CLOUD_NAT_CONFIGS" => Self::PermissionDeniedNoCloudNatConfigs,
12535 "PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS" => {
12536 Self::PermissionDeniedNoNegEndpointConfigs
12537 }
12538 "PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS" => {
12539 Self::PermissionDeniedNoCloudRouterConfigs
12540 }
12541 "NO_SOURCE_LOCATION" => Self::NoSourceLocation,
12542 "NO_SOURCE_GCP_NETWORK_LOCATION" => Self::NoSourceGcpNetworkLocation,
12543 "NO_SOURCE_NON_GCP_NETWORK_LOCATION" => Self::NoSourceNonGcpNetworkLocation,
12544 "NO_SOURCE_INTERNET_LOCATION" => Self::NoSourceInternetLocation,
12545 "INVALID_ARGUMENT" => Self::InvalidArgument,
12546 "TRACE_TOO_LONG" => Self::TraceTooLong,
12547 "INTERNAL_ERROR" => Self::InternalError,
12548 "UNSUPPORTED" => Self::Unsupported,
12549 "MISMATCHED_IP_VERSION" => Self::MismatchedIpVersion,
12550 "GKE_KONNECTIVITY_PROXY_UNSUPPORTED" => Self::GkeKonnectivityProxyUnsupported,
12551 "RESOURCE_CONFIG_NOT_FOUND" => Self::ResourceConfigNotFound,
12552 "VM_INSTANCE_CONFIG_NOT_FOUND" => Self::VmInstanceConfigNotFound,
12553 "NETWORK_CONFIG_NOT_FOUND" => Self::NetworkConfigNotFound,
12554 "FIREWALL_CONFIG_NOT_FOUND" => Self::FirewallConfigNotFound,
12555 "ROUTE_CONFIG_NOT_FOUND" => Self::RouteConfigNotFound,
12556 "GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT" => {
12557 Self::GoogleManagedServiceAmbiguousPscEndpoint
12558 }
12559 "GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT" => {
12560 Self::GoogleManagedServiceAmbiguousEndpoint
12561 }
12562 "SOURCE_PSC_CLOUD_SQL_UNSUPPORTED" => Self::SourcePscCloudSqlUnsupported,
12563 "SOURCE_EXTERNAL_CLOUD_SQL_UNSUPPORTED" => Self::SourceExternalCloudSqlUnsupported,
12564 "SOURCE_REDIS_CLUSTER_UNSUPPORTED" => Self::SourceRedisClusterUnsupported,
12565 "SOURCE_REDIS_INSTANCE_UNSUPPORTED" => Self::SourceRedisInstanceUnsupported,
12566 "SOURCE_FORWARDING_RULE_UNSUPPORTED" => Self::SourceForwardingRuleUnsupported,
12567 "NON_ROUTABLE_IP_ADDRESS" => Self::NonRoutableIpAddress,
12568 "UNKNOWN_ISSUE_IN_GOOGLE_MANAGED_PROJECT" => {
12569 Self::UnknownIssueInGoogleManagedProject
12570 }
12571 "UNSUPPORTED_GOOGLE_MANAGED_PROJECT_CONFIG" => {
12572 Self::UnsupportedGoogleManagedProjectConfig
12573 }
12574 "NO_SERVERLESS_IP_RANGES" => Self::NoServerlessIpRanges,
12575 "IP_VERSION_PROTOCOL_MISMATCH" => Self::IpVersionProtocolMismatch,
12576 "GKE_POD_UNKNOWN_ENDPOINT_LOCATION" => Self::GkePodUnknownEndpointLocation,
12577 _ => Self::UnknownValue(cause::UnknownValue(
12578 wkt::internal::UnknownEnumValue::String(value.to_string()),
12579 )),
12580 }
12581 }
12582 }
12583
12584 impl serde::ser::Serialize for Cause {
12585 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12586 where
12587 S: serde::Serializer,
12588 {
12589 match self {
12590 Self::Unspecified => serializer.serialize_i32(0),
12591 Self::UnknownNetwork => serializer.serialize_i32(1),
12592 Self::UnknownProject => serializer.serialize_i32(3),
12593 Self::NoExternalIp => serializer.serialize_i32(7),
12594 Self::UnintendedDestination => serializer.serialize_i32(8),
12595 Self::SourceEndpointNotFound => serializer.serialize_i32(11),
12596 Self::MismatchedSourceNetwork => serializer.serialize_i32(12),
12597 Self::DestinationEndpointNotFound => serializer.serialize_i32(13),
12598 Self::MismatchedDestinationNetwork => serializer.serialize_i32(14),
12599 Self::UnknownIp => serializer.serialize_i32(2),
12600 Self::GoogleManagedServiceUnknownIp => serializer.serialize_i32(32),
12601 Self::SourceIpAddressNotInSourceNetwork => serializer.serialize_i32(23),
12602 Self::PermissionDenied => serializer.serialize_i32(4),
12603 Self::PermissionDeniedNoCloudNatConfigs => serializer.serialize_i32(28),
12604 Self::PermissionDeniedNoNegEndpointConfigs => serializer.serialize_i32(29),
12605 Self::PermissionDeniedNoCloudRouterConfigs => serializer.serialize_i32(36),
12606 Self::NoSourceLocation => serializer.serialize_i32(5),
12607 Self::NoSourceGcpNetworkLocation => serializer.serialize_i32(42),
12608 Self::NoSourceNonGcpNetworkLocation => serializer.serialize_i32(43),
12609 Self::NoSourceInternetLocation => serializer.serialize_i32(44),
12610 Self::InvalidArgument => serializer.serialize_i32(6),
12611 Self::TraceTooLong => serializer.serialize_i32(9),
12612 Self::InternalError => serializer.serialize_i32(10),
12613 Self::Unsupported => serializer.serialize_i32(15),
12614 Self::MismatchedIpVersion => serializer.serialize_i32(16),
12615 Self::GkeKonnectivityProxyUnsupported => serializer.serialize_i32(17),
12616 Self::ResourceConfigNotFound => serializer.serialize_i32(18),
12617 Self::VmInstanceConfigNotFound => serializer.serialize_i32(24),
12618 Self::NetworkConfigNotFound => serializer.serialize_i32(25),
12619 Self::FirewallConfigNotFound => serializer.serialize_i32(26),
12620 Self::RouteConfigNotFound => serializer.serialize_i32(27),
12621 Self::GoogleManagedServiceAmbiguousPscEndpoint => serializer.serialize_i32(19),
12622 Self::GoogleManagedServiceAmbiguousEndpoint => serializer.serialize_i32(39),
12623 Self::SourcePscCloudSqlUnsupported => serializer.serialize_i32(20),
12624 Self::SourceExternalCloudSqlUnsupported => serializer.serialize_i32(45),
12625 Self::SourceRedisClusterUnsupported => serializer.serialize_i32(34),
12626 Self::SourceRedisInstanceUnsupported => serializer.serialize_i32(35),
12627 Self::SourceForwardingRuleUnsupported => serializer.serialize_i32(21),
12628 Self::NonRoutableIpAddress => serializer.serialize_i32(22),
12629 Self::UnknownIssueInGoogleManagedProject => serializer.serialize_i32(30),
12630 Self::UnsupportedGoogleManagedProjectConfig => serializer.serialize_i32(31),
12631 Self::NoServerlessIpRanges => serializer.serialize_i32(37),
12632 Self::IpVersionProtocolMismatch => serializer.serialize_i32(40),
12633 Self::GkePodUnknownEndpointLocation => serializer.serialize_i32(41),
12634 Self::UnknownValue(u) => u.0.serialize(serializer),
12635 }
12636 }
12637 }
12638
12639 impl<'de> serde::de::Deserialize<'de> for Cause {
12640 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12641 where
12642 D: serde::Deserializer<'de>,
12643 {
12644 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Cause>::new(
12645 ".google.cloud.networkmanagement.v1.AbortInfo.Cause",
12646 ))
12647 }
12648 }
12649}
12650
12651/// Details of the final state "drop" and associated resource.
12652#[derive(Clone, Default, PartialEq)]
12653#[non_exhaustive]
12654pub struct DropInfo {
12655 /// Cause that the packet is dropped.
12656 pub cause: crate::model::drop_info::Cause,
12657
12658 /// URI of the resource that caused the drop.
12659 pub resource_uri: std::string::String,
12660
12661 /// Source IP address of the dropped packet (if relevant).
12662 pub source_ip: std::string::String,
12663
12664 /// Destination IP address of the dropped packet (if relevant).
12665 pub destination_ip: std::string::String,
12666
12667 /// Region of the dropped packet (if relevant).
12668 pub region: std::string::String,
12669
12670 /// Geolocation (region code) of the source IP address (if relevant).
12671 pub source_geolocation_code: std::string::String,
12672
12673 /// Geolocation (region code) of the destination IP address (if relevant).
12674 pub destination_geolocation_code: std::string::String,
12675
12676 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12677}
12678
12679impl DropInfo {
12680 /// Creates a new default instance.
12681 pub fn new() -> Self {
12682 std::default::Default::default()
12683 }
12684
12685 /// Sets the value of [cause][crate::model::DropInfo::cause].
12686 ///
12687 /// # Example
12688 /// ```ignore,no_run
12689 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12690 /// use google_cloud_networkmanagement_v1::model::drop_info::Cause;
12691 /// let x0 = DropInfo::new().set_cause(Cause::UnknownExternalAddress);
12692 /// let x1 = DropInfo::new().set_cause(Cause::ForeignIpDisallowed);
12693 /// let x2 = DropInfo::new().set_cause(Cause::FirewallRule);
12694 /// ```
12695 pub fn set_cause<T: std::convert::Into<crate::model::drop_info::Cause>>(
12696 mut self,
12697 v: T,
12698 ) -> Self {
12699 self.cause = v.into();
12700 self
12701 }
12702
12703 /// Sets the value of [resource_uri][crate::model::DropInfo::resource_uri].
12704 ///
12705 /// # Example
12706 /// ```ignore,no_run
12707 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12708 /// let x = DropInfo::new().set_resource_uri("example");
12709 /// ```
12710 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12711 self.resource_uri = v.into();
12712 self
12713 }
12714
12715 /// Sets the value of [source_ip][crate::model::DropInfo::source_ip].
12716 ///
12717 /// # Example
12718 /// ```ignore,no_run
12719 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12720 /// let x = DropInfo::new().set_source_ip("example");
12721 /// ```
12722 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12723 self.source_ip = v.into();
12724 self
12725 }
12726
12727 /// Sets the value of [destination_ip][crate::model::DropInfo::destination_ip].
12728 ///
12729 /// # Example
12730 /// ```ignore,no_run
12731 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12732 /// let x = DropInfo::new().set_destination_ip("example");
12733 /// ```
12734 pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12735 self.destination_ip = v.into();
12736 self
12737 }
12738
12739 /// Sets the value of [region][crate::model::DropInfo::region].
12740 ///
12741 /// # Example
12742 /// ```ignore,no_run
12743 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12744 /// let x = DropInfo::new().set_region("example");
12745 /// ```
12746 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12747 self.region = v.into();
12748 self
12749 }
12750
12751 /// Sets the value of [source_geolocation_code][crate::model::DropInfo::source_geolocation_code].
12752 ///
12753 /// # Example
12754 /// ```ignore,no_run
12755 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12756 /// let x = DropInfo::new().set_source_geolocation_code("example");
12757 /// ```
12758 pub fn set_source_geolocation_code<T: std::convert::Into<std::string::String>>(
12759 mut self,
12760 v: T,
12761 ) -> Self {
12762 self.source_geolocation_code = v.into();
12763 self
12764 }
12765
12766 /// Sets the value of [destination_geolocation_code][crate::model::DropInfo::destination_geolocation_code].
12767 ///
12768 /// # Example
12769 /// ```ignore,no_run
12770 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
12771 /// let x = DropInfo::new().set_destination_geolocation_code("example");
12772 /// ```
12773 pub fn set_destination_geolocation_code<T: std::convert::Into<std::string::String>>(
12774 mut self,
12775 v: T,
12776 ) -> Self {
12777 self.destination_geolocation_code = v.into();
12778 self
12779 }
12780}
12781
12782impl wkt::message::Message for DropInfo {
12783 fn typename() -> &'static str {
12784 "type.googleapis.com/google.cloud.networkmanagement.v1.DropInfo"
12785 }
12786}
12787
12788/// Defines additional types related to [DropInfo].
12789pub mod drop_info {
12790 #[allow(unused_imports)]
12791 use super::*;
12792
12793 /// Drop cause types:
12794 ///
12795 /// # Working with unknown values
12796 ///
12797 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12798 /// additional enum variants at any time. Adding new variants is not considered
12799 /// a breaking change. Applications should write their code in anticipation of:
12800 ///
12801 /// - New values appearing in future releases of the client library, **and**
12802 /// - New values received dynamically, without application changes.
12803 ///
12804 /// Please consult the [Working with enums] section in the user guide for some
12805 /// guidelines.
12806 ///
12807 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12808 #[derive(Clone, Debug, PartialEq)]
12809 #[non_exhaustive]
12810 pub enum Cause {
12811 /// Cause is unspecified.
12812 Unspecified,
12813 /// Destination external address cannot be resolved to a known target. If
12814 /// the address is used in a Google Cloud project, provide the project ID
12815 /// as test input.
12816 UnknownExternalAddress,
12817 /// A Compute Engine instance can only send or receive a packet with a
12818 /// foreign IP address if ip_forward is enabled.
12819 ForeignIpDisallowed,
12820 /// Dropped due to a firewall rule, unless allowed due to connection
12821 /// tracking.
12822 FirewallRule,
12823 /// Dropped due to no matching routes.
12824 NoRoute,
12825 /// Dropped due to invalid route. Route's next hop is a blackhole.
12826 RouteBlackhole,
12827 /// Packet is sent to a wrong (unintended) network. Example: you trace a
12828 /// packet from VM1:Network1 to VM2:Network2, however, the route configured
12829 /// in Network1 sends the packet destined for VM2's IP address to Network3.
12830 RouteWrongNetwork,
12831 /// Route's next hop IP address cannot be resolved to a GCP resource.
12832 RouteNextHopIpAddressNotResolved,
12833 /// Route's next hop resource is not found.
12834 RouteNextHopResourceNotFound,
12835 /// Route's next hop instance doesn't have a NIC in the route's network.
12836 RouteNextHopInstanceWrongNetwork,
12837 /// Route's next hop IP address is not a primary IP address of the next hop
12838 /// instance.
12839 RouteNextHopInstanceNonPrimaryIp,
12840 /// Route's next hop forwarding rule doesn't match next hop IP address.
12841 RouteNextHopForwardingRuleIpMismatch,
12842 /// Route's next hop VPN tunnel is down (does not have valid IKE SAs).
12843 RouteNextHopVpnTunnelNotEstablished,
12844 /// Route's next hop forwarding rule type is invalid (it's not a forwarding
12845 /// rule of the internal passthrough load balancer).
12846 RouteNextHopForwardingRuleTypeInvalid,
12847 /// Packet is sent from the Internet to the private IPv6 address.
12848 NoRouteFromInternetToPrivateIpv6Address,
12849 /// Packet is sent from the Internet to the private IPv4 address.
12850 NoRouteFromInternetToPrivateIpv4Address,
12851 /// Packet is sent from the external IPv6 source address of an instance to
12852 /// the private IPv6 address of an instance.
12853 NoRouteFromExternalIpv6SourceToPrivateIpv6Address,
12854 /// The packet does not match a policy-based VPN tunnel local selector.
12855 VpnTunnelLocalSelectorMismatch,
12856 /// The packet does not match a policy-based VPN tunnel remote selector.
12857 VpnTunnelRemoteSelectorMismatch,
12858 /// Packet with internal destination address sent to the internet gateway.
12859 PrivateTrafficToInternet,
12860 /// Endpoint with only an internal IP address tries to access Google API and
12861 /// services, but Private Google Access is not enabled in the subnet or is
12862 /// not applicable.
12863 PrivateGoogleAccessDisallowed,
12864 /// Source endpoint tries to access Google API and services through the VPN
12865 /// tunnel to another network, but Private Google Access needs to be enabled
12866 /// in the source endpoint network.
12867 PrivateGoogleAccessViaVpnTunnelUnsupported,
12868 /// Endpoint with only an internal IP address tries to access external hosts,
12869 /// but there is no matching Cloud NAT gateway in the subnet.
12870 NoExternalAddress,
12871 /// Destination internal address cannot be resolved to a known target. If
12872 /// this is a shared VPC scenario, verify if the service project ID is
12873 /// provided as test input. Otherwise, verify if the IP address is being
12874 /// used in the project.
12875 UnknownInternalAddress,
12876 /// Forwarding rule's protocol and ports do not match the packet header.
12877 ForwardingRuleMismatch,
12878 /// Forwarding rule does not have backends configured.
12879 ForwardingRuleNoInstances,
12880 /// Firewalls block the health check probes to the backends and cause
12881 /// the backends to be unavailable for traffic from the load balancer.
12882 /// For more details, see [Health check firewall
12883 /// rules](https://cloud.google.com/load-balancing/docs/health-checks#firewall_rules).
12884 FirewallBlockingLoadBalancerBackendHealthCheck,
12885 /// Matching ingress firewall rules by network tags for packets sent via
12886 /// serverless VPC direct egress is unsupported. Behavior is undefined.
12887 /// <https://cloud.google.com/run/docs/configuring/vpc-direct-vpc#limitations>
12888 IngressFirewallTagsUnsupportedByDirectVpcEgress,
12889 /// Packet is sent from or to a Compute Engine instance that is not in a
12890 /// running state.
12891 InstanceNotRunning,
12892 /// Packet sent from or to a GKE cluster that is not in running state.
12893 GkeClusterNotRunning,
12894 /// Packet sent from or to a GKE Pod that is not in running state.
12895 GkePodNotRunning,
12896 /// Packet sent from or to a Cloud SQL instance that is not in running state.
12897 CloudSqlInstanceNotRunning,
12898 /// Packet sent from or to a Redis Instance that is not in running state.
12899 RedisInstanceNotRunning,
12900 /// Packet sent from or to a Redis Cluster that is not in running state.
12901 RedisClusterNotRunning,
12902 /// The type of traffic is blocked and the user cannot configure a firewall
12903 /// rule to enable it. See [Always blocked
12904 /// traffic](https://cloud.google.com/vpc/docs/firewalls#blockedtraffic) for
12905 /// more details.
12906 TrafficTypeBlocked,
12907 /// Access to Google Kubernetes Engine cluster master's endpoint is not
12908 /// authorized. See [Access to the cluster
12909 /// endpoints](https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#access_to_the_cluster_endpoints)
12910 /// for more details.
12911 GkeMasterUnauthorizedAccess,
12912 /// Access to the Cloud SQL instance endpoint is not authorized.
12913 /// See [Authorizing with authorized
12914 /// networks](https://cloud.google.com/sql/docs/mysql/authorize-networks) for
12915 /// more details.
12916 CloudSqlInstanceUnauthorizedAccess,
12917 /// Packet was dropped inside Google Kubernetes Engine Service.
12918 DroppedInsideGkeService,
12919 /// Packet was dropped inside Cloud SQL Service.
12920 DroppedInsideCloudSqlService,
12921 /// Packet was dropped inside DMS Private Connection.
12922 DroppedInsideDmsPrivateConnection,
12923 /// Packet was dropped because there is no peering between the originating
12924 /// network and the Google Managed Services Network.
12925 GoogleManagedServiceNoPeering,
12926 /// Packet was dropped because the Google-managed service uses Private
12927 /// Service Connect (PSC), but the PSC endpoint is not found in the project.
12928 GoogleManagedServiceNoPscEndpoint,
12929 /// Packet was dropped because the GKE cluster uses Private Service Connect
12930 /// (PSC), but the PSC endpoint is not found in the project.
12931 GkePscEndpointMissing,
12932 /// Packet was dropped because the Cloud SQL instance has neither a private
12933 /// nor a public IP address.
12934 CloudSqlInstanceNoIpAddress,
12935 /// Packet was dropped because a GKE cluster private endpoint is
12936 /// unreachable from a region different from the cluster's region.
12937 GkeControlPlaneRegionMismatch,
12938 /// Packet sent from a public GKE cluster control plane to a private
12939 /// IP address.
12940 PublicGkeControlPlaneToPrivateDestination,
12941 /// Packet was dropped because there is no route from a GKE cluster
12942 /// control plane to a destination network.
12943 GkeControlPlaneNoRoute,
12944 /// Packet sent from a Cloud SQL instance to an external IP address is not
12945 /// allowed. The Cloud SQL instance is not configured to send packets to
12946 /// external IP addresses.
12947 CloudSqlInstanceNotConfiguredForExternalTraffic,
12948 /// Packet sent from a Cloud SQL instance with only a public IP address to a
12949 /// private IP address.
12950 PublicCloudSqlInstanceToPrivateDestination,
12951 /// Packet was dropped because there is no route from a Cloud SQL
12952 /// instance to a destination network.
12953 CloudSqlInstanceNoRoute,
12954 /// Packet was dropped because the Cloud SQL instance requires all
12955 /// connections to use Cloud SQL connectors and to target the Cloud SQL proxy
12956 /// port (3307).
12957 CloudSqlConnectorRequired,
12958 /// Packet could be dropped because the Cloud Function is not in an active
12959 /// status.
12960 CloudFunctionNotActive,
12961 /// Packet could be dropped because no VPC connector is set.
12962 VpcConnectorNotSet,
12963 /// Packet could be dropped because the VPC connector is not in a running
12964 /// state.
12965 VpcConnectorNotRunning,
12966 /// Packet could be dropped because the traffic from the serverless service
12967 /// to the VPC connector is not allowed.
12968 VpcConnectorServerlessTrafficBlocked,
12969 /// Packet could be dropped because the health check traffic to the VPC
12970 /// connector is not allowed.
12971 VpcConnectorHealthCheckTrafficBlocked,
12972 /// Packet could be dropped because it was sent from a different region
12973 /// to a regional forwarding without global access.
12974 ForwardingRuleRegionMismatch,
12975 /// The Private Service Connect endpoint is in a project that is not approved
12976 /// to connect to the service.
12977 PscConnectionNotAccepted,
12978 /// The packet is sent to the Private Service Connect endpoint over the
12979 /// peering, but [it's not
12980 /// supported](https://cloud.google.com/vpc/docs/configure-private-service-connect-services#on-premises).
12981 PscEndpointAccessedFromPeeredNetwork,
12982 /// The packet is sent to the Private Service Connect backend (network
12983 /// endpoint group), but the producer PSC forwarding rule does not have
12984 /// global access enabled.
12985 PscNegProducerEndpointNoGlobalAccess,
12986 /// The packet is sent to the Private Service Connect backend (network
12987 /// endpoint group), but the producer PSC forwarding rule has multiple ports
12988 /// specified.
12989 PscNegProducerForwardingRuleMultiplePorts,
12990 /// The packet is sent to the Private Service Connect backend (network
12991 /// endpoint group) targeting a Cloud SQL service attachment, but this
12992 /// configuration is not supported.
12993 CloudSqlPscNegUnsupported,
12994 /// No NAT subnets are defined for the PSC service attachment.
12995 NoNatSubnetsForPscServiceAttachment,
12996 /// PSC endpoint is accessed via NCC, but PSC transitivity configuration is
12997 /// not yet propagated.
12998 PscTransitivityNotPropagated,
12999 /// The packet sent from the hybrid NEG proxy matches a non-dynamic route,
13000 /// but such a configuration is not supported.
13001 HybridNegNonDynamicRouteMatched,
13002 /// The packet sent from the hybrid NEG proxy matches a dynamic route with a
13003 /// next hop in a different region, but such a configuration is not
13004 /// supported.
13005 HybridNegNonLocalDynamicRouteMatched,
13006 /// Packet sent from a Cloud Run revision that is not ready.
13007 CloudRunRevisionNotReady,
13008 /// Packet sent from a Cloud Run job that is not ready.
13009 CloudRunJobNotReady,
13010 /// Packet was dropped inside Private Service Connect service producer.
13011 DroppedInsidePscServiceProducer,
13012 /// Packet sent to a load balancer, which requires a proxy-only subnet and
13013 /// the subnet is not found.
13014 LoadBalancerHasNoProxySubnet,
13015 /// Packet sent to Cloud Nat without active NAT IPs.
13016 CloudNatNoAddresses,
13017 /// Packet is stuck in a routing loop.
13018 RoutingLoop,
13019 /// Packet is dropped inside a Google-managed service due to being delivered
13020 /// in return trace to an endpoint that doesn't match the endpoint the packet
13021 /// was sent from in forward trace. Used only for return traces.
13022 DroppedInsideGoogleManagedService,
13023 /// Packet is dropped due to a load balancer backend instance not having a
13024 /// network interface in the network expected by the load balancer.
13025 LoadBalancerBackendInvalidNetwork,
13026 /// Packet is dropped due to a backend service named port not being defined
13027 /// on the instance group level.
13028 BackendServiceNamedPortNotDefined,
13029 /// Packet is dropped due to a destination IP range being part of a Private
13030 /// NAT IP range.
13031 DestinationIsPrivateNatIpRange,
13032 /// Generic drop cause for a packet being dropped inside a Redis Instance
13033 /// service project.
13034 DroppedInsideRedisInstanceService,
13035 /// Packet is dropped due to an unsupported port being used to connect to a
13036 /// Redis Instance. Port 6379 should be used to connect to a Redis Instance.
13037 RedisInstanceUnsupportedPort,
13038 /// Packet is dropped due to connecting from PUPI address to a PSA based
13039 /// Redis Instance.
13040 RedisInstanceConnectingFromPupiAddress,
13041 /// Packet is dropped due to no route to the destination network.
13042 RedisInstanceNoRouteToDestinationNetwork,
13043 /// Redis Instance does not have an external IP address.
13044 RedisInstanceNoExternalIp,
13045 /// Packet is dropped due to an unsupported protocol being used to connect to
13046 /// a Redis Instance. Only TCP connections are accepted by a Redis Instance.
13047 RedisInstanceUnsupportedProtocol,
13048 /// Generic drop cause for a packet being dropped inside a Redis Cluster
13049 /// service project.
13050 DroppedInsideRedisClusterService,
13051 /// Packet is dropped due to an unsupported port being used to connect to a
13052 /// Redis Cluster. Ports 6379 and 11000 to 13047 should be used to connect to
13053 /// a Redis Cluster.
13054 RedisClusterUnsupportedPort,
13055 /// Redis Cluster does not have an external IP address.
13056 RedisClusterNoExternalIp,
13057 /// Packet is dropped due to an unsupported protocol being used to connect to
13058 /// a Redis Cluster. Only TCP connections are accepted by a Redis Cluster.
13059 RedisClusterUnsupportedProtocol,
13060 /// Packet from the non-GCP (on-prem) or unknown GCP network is dropped due
13061 /// to the destination IP address not belonging to any IP prefix advertised
13062 /// via BGP by the Cloud Router.
13063 NoAdvertisedRouteToGcpDestination,
13064 /// Packet from the non-GCP (on-prem) or unknown GCP network is dropped due
13065 /// to the destination IP address not belonging to any IP prefix included to
13066 /// the local traffic selector of the VPN tunnel.
13067 NoTrafficSelectorToGcpDestination,
13068 /// Packet from the unknown peered network is dropped due to no known route
13069 /// from the source network to the destination IP address.
13070 NoKnownRouteFromPeeredNetworkToDestination,
13071 /// Sending packets processed by the Private NAT Gateways to the Private
13072 /// Service Connect endpoints is not supported.
13073 PrivateNatToPscEndpointUnsupported,
13074 /// Packet is sent to the PSC port mapping service, but its destination port
13075 /// does not match any port mapping rules.
13076 PscPortMappingPortMismatch,
13077 /// Sending packets directly to the PSC port mapping service without going
13078 /// through the PSC connection is not supported.
13079 PscPortMappingWithoutPscConnectionUnsupported,
13080 /// Packet with destination IP address within the reserved NAT64 range is
13081 /// dropped due to matching a route of an unsupported type.
13082 UnsupportedRouteMatchedForNat64Destination,
13083 /// Packet could be dropped because hybrid endpoint like a VPN gateway or
13084 /// Interconnect is not allowed to send traffic to the Internet.
13085 TrafficFromHybridEndpointToInternetDisallowed,
13086 /// Packet with destination IP address within the reserved NAT64 range is
13087 /// dropped due to no matching NAT gateway in the subnet.
13088 NoMatchingNat64Gateway,
13089 /// Packet is dropped due to matching a Private NAT64 gateway with no rules
13090 /// for source IPv6 addresses.
13091 NoConfiguredPrivateNat64Rule,
13092 /// Packet is dropped due to being sent to a backend of a passthrough load
13093 /// balancer that doesn't use the same IP version as the frontend.
13094 LoadBalancerBackendIpVersionMismatch,
13095 /// Packet from the unknown NCC network is dropped due to no known route
13096 /// from the source network to the destination IP address.
13097 NoKnownRouteFromNccNetworkToDestination,
13098 /// Packet is dropped by Cloud NAT due to using an unsupported protocol.
13099 CloudNatProtocolUnsupported,
13100 /// Packet is dropped due to using an unsupported protocol (any other than
13101 /// UDP) for L2 Interconnect.
13102 L2InterconnectUnsupportedProtocol,
13103 /// Packet is dropped due to using an unsupported port (any other than
13104 /// 6081) for L2 Interconnect.
13105 L2InterconnectUnsupportedPort,
13106 /// Packet is dropped due to destination IP not matching the appliance
13107 /// mapping IPs configured on the L2 Interconnect attachment.
13108 L2InterconnectDestinationIpMismatch,
13109 /// Packet could be dropped because it matches a route associated with an NCC
13110 /// spoke in the hybrid subnet context, but such a configuration is not
13111 /// supported.
13112 NccRouteWithinHybridSubnetUnsupported,
13113 /// Packet is dropped because the region of the hybrid subnet is different
13114 /// from the region of the next hop of the route matched within this hybrid
13115 /// subnet.
13116 HybridSubnetRegionMismatch,
13117 /// Packet is dropped because no matching route was found in the hybrid
13118 /// subnet.
13119 HybridSubnetNoRoute,
13120 /// Packet is dropped by GKE Network Policy.
13121 GkeNetworkPolicy,
13122 /// Packet is dropped because there is no valid matching route from the
13123 /// network of the Google-managed service to the destination.
13124 NoValidRouteFromGoogleManagedNetworkToDestination,
13125 /// Packet is dropped due to no running instance found for private
13126 /// connection.
13127 PrivateConnectionNoRunningInstance,
13128 /// If set, the enum was initialized with an unknown value.
13129 ///
13130 /// Applications can examine the value using [Cause::value] or
13131 /// [Cause::name].
13132 UnknownValue(cause::UnknownValue),
13133 }
13134
13135 #[doc(hidden)]
13136 pub mod cause {
13137 #[allow(unused_imports)]
13138 use super::*;
13139 #[derive(Clone, Debug, PartialEq)]
13140 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13141 }
13142
13143 impl Cause {
13144 /// Gets the enum value.
13145 ///
13146 /// Returns `None` if the enum contains an unknown value deserialized from
13147 /// the string representation of enums.
13148 pub fn value(&self) -> std::option::Option<i32> {
13149 match self {
13150 Self::Unspecified => std::option::Option::Some(0),
13151 Self::UnknownExternalAddress => std::option::Option::Some(1),
13152 Self::ForeignIpDisallowed => std::option::Option::Some(2),
13153 Self::FirewallRule => std::option::Option::Some(3),
13154 Self::NoRoute => std::option::Option::Some(4),
13155 Self::RouteBlackhole => std::option::Option::Some(5),
13156 Self::RouteWrongNetwork => std::option::Option::Some(6),
13157 Self::RouteNextHopIpAddressNotResolved => std::option::Option::Some(42),
13158 Self::RouteNextHopResourceNotFound => std::option::Option::Some(43),
13159 Self::RouteNextHopInstanceWrongNetwork => std::option::Option::Some(49),
13160 Self::RouteNextHopInstanceNonPrimaryIp => std::option::Option::Some(50),
13161 Self::RouteNextHopForwardingRuleIpMismatch => std::option::Option::Some(51),
13162 Self::RouteNextHopVpnTunnelNotEstablished => std::option::Option::Some(52),
13163 Self::RouteNextHopForwardingRuleTypeInvalid => std::option::Option::Some(53),
13164 Self::NoRouteFromInternetToPrivateIpv6Address => std::option::Option::Some(44),
13165 Self::NoRouteFromInternetToPrivateIpv4Address => std::option::Option::Some(109),
13166 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
13167 std::option::Option::Some(98)
13168 }
13169 Self::VpnTunnelLocalSelectorMismatch => std::option::Option::Some(45),
13170 Self::VpnTunnelRemoteSelectorMismatch => std::option::Option::Some(46),
13171 Self::PrivateTrafficToInternet => std::option::Option::Some(7),
13172 Self::PrivateGoogleAccessDisallowed => std::option::Option::Some(8),
13173 Self::PrivateGoogleAccessViaVpnTunnelUnsupported => std::option::Option::Some(47),
13174 Self::NoExternalAddress => std::option::Option::Some(9),
13175 Self::UnknownInternalAddress => std::option::Option::Some(10),
13176 Self::ForwardingRuleMismatch => std::option::Option::Some(11),
13177 Self::ForwardingRuleNoInstances => std::option::Option::Some(12),
13178 Self::FirewallBlockingLoadBalancerBackendHealthCheck => {
13179 std::option::Option::Some(13)
13180 }
13181 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => {
13182 std::option::Option::Some(85)
13183 }
13184 Self::InstanceNotRunning => std::option::Option::Some(14),
13185 Self::GkeClusterNotRunning => std::option::Option::Some(27),
13186 Self::GkePodNotRunning => std::option::Option::Some(103),
13187 Self::CloudSqlInstanceNotRunning => std::option::Option::Some(28),
13188 Self::RedisInstanceNotRunning => std::option::Option::Some(68),
13189 Self::RedisClusterNotRunning => std::option::Option::Some(69),
13190 Self::TrafficTypeBlocked => std::option::Option::Some(15),
13191 Self::GkeMasterUnauthorizedAccess => std::option::Option::Some(16),
13192 Self::CloudSqlInstanceUnauthorizedAccess => std::option::Option::Some(17),
13193 Self::DroppedInsideGkeService => std::option::Option::Some(18),
13194 Self::DroppedInsideCloudSqlService => std::option::Option::Some(19),
13195 Self::DroppedInsideDmsPrivateConnection => std::option::Option::Some(114),
13196 Self::GoogleManagedServiceNoPeering => std::option::Option::Some(20),
13197 Self::GoogleManagedServiceNoPscEndpoint => std::option::Option::Some(38),
13198 Self::GkePscEndpointMissing => std::option::Option::Some(36),
13199 Self::CloudSqlInstanceNoIpAddress => std::option::Option::Some(21),
13200 Self::GkeControlPlaneRegionMismatch => std::option::Option::Some(30),
13201 Self::PublicGkeControlPlaneToPrivateDestination => std::option::Option::Some(31),
13202 Self::GkeControlPlaneNoRoute => std::option::Option::Some(32),
13203 Self::CloudSqlInstanceNotConfiguredForExternalTraffic => {
13204 std::option::Option::Some(33)
13205 }
13206 Self::PublicCloudSqlInstanceToPrivateDestination => std::option::Option::Some(34),
13207 Self::CloudSqlInstanceNoRoute => std::option::Option::Some(35),
13208 Self::CloudSqlConnectorRequired => std::option::Option::Some(63),
13209 Self::CloudFunctionNotActive => std::option::Option::Some(22),
13210 Self::VpcConnectorNotSet => std::option::Option::Some(23),
13211 Self::VpcConnectorNotRunning => std::option::Option::Some(24),
13212 Self::VpcConnectorServerlessTrafficBlocked => std::option::Option::Some(60),
13213 Self::VpcConnectorHealthCheckTrafficBlocked => std::option::Option::Some(61),
13214 Self::ForwardingRuleRegionMismatch => std::option::Option::Some(25),
13215 Self::PscConnectionNotAccepted => std::option::Option::Some(26),
13216 Self::PscEndpointAccessedFromPeeredNetwork => std::option::Option::Some(41),
13217 Self::PscNegProducerEndpointNoGlobalAccess => std::option::Option::Some(48),
13218 Self::PscNegProducerForwardingRuleMultiplePorts => std::option::Option::Some(54),
13219 Self::CloudSqlPscNegUnsupported => std::option::Option::Some(58),
13220 Self::NoNatSubnetsForPscServiceAttachment => std::option::Option::Some(57),
13221 Self::PscTransitivityNotPropagated => std::option::Option::Some(64),
13222 Self::HybridNegNonDynamicRouteMatched => std::option::Option::Some(55),
13223 Self::HybridNegNonLocalDynamicRouteMatched => std::option::Option::Some(56),
13224 Self::CloudRunRevisionNotReady => std::option::Option::Some(29),
13225 Self::CloudRunJobNotReady => std::option::Option::Some(113),
13226 Self::DroppedInsidePscServiceProducer => std::option::Option::Some(37),
13227 Self::LoadBalancerHasNoProxySubnet => std::option::Option::Some(39),
13228 Self::CloudNatNoAddresses => std::option::Option::Some(40),
13229 Self::RoutingLoop => std::option::Option::Some(59),
13230 Self::DroppedInsideGoogleManagedService => std::option::Option::Some(62),
13231 Self::LoadBalancerBackendInvalidNetwork => std::option::Option::Some(65),
13232 Self::BackendServiceNamedPortNotDefined => std::option::Option::Some(66),
13233 Self::DestinationIsPrivateNatIpRange => std::option::Option::Some(67),
13234 Self::DroppedInsideRedisInstanceService => std::option::Option::Some(70),
13235 Self::RedisInstanceUnsupportedPort => std::option::Option::Some(71),
13236 Self::RedisInstanceConnectingFromPupiAddress => std::option::Option::Some(72),
13237 Self::RedisInstanceNoRouteToDestinationNetwork => std::option::Option::Some(73),
13238 Self::RedisInstanceNoExternalIp => std::option::Option::Some(74),
13239 Self::RedisInstanceUnsupportedProtocol => std::option::Option::Some(78),
13240 Self::DroppedInsideRedisClusterService => std::option::Option::Some(75),
13241 Self::RedisClusterUnsupportedPort => std::option::Option::Some(76),
13242 Self::RedisClusterNoExternalIp => std::option::Option::Some(77),
13243 Self::RedisClusterUnsupportedProtocol => std::option::Option::Some(79),
13244 Self::NoAdvertisedRouteToGcpDestination => std::option::Option::Some(80),
13245 Self::NoTrafficSelectorToGcpDestination => std::option::Option::Some(81),
13246 Self::NoKnownRouteFromPeeredNetworkToDestination => std::option::Option::Some(82),
13247 Self::PrivateNatToPscEndpointUnsupported => std::option::Option::Some(83),
13248 Self::PscPortMappingPortMismatch => std::option::Option::Some(86),
13249 Self::PscPortMappingWithoutPscConnectionUnsupported => {
13250 std::option::Option::Some(87)
13251 }
13252 Self::UnsupportedRouteMatchedForNat64Destination => std::option::Option::Some(88),
13253 Self::TrafficFromHybridEndpointToInternetDisallowed => {
13254 std::option::Option::Some(89)
13255 }
13256 Self::NoMatchingNat64Gateway => std::option::Option::Some(90),
13257 Self::NoConfiguredPrivateNat64Rule => std::option::Option::Some(107),
13258 Self::LoadBalancerBackendIpVersionMismatch => std::option::Option::Some(96),
13259 Self::NoKnownRouteFromNccNetworkToDestination => std::option::Option::Some(97),
13260 Self::CloudNatProtocolUnsupported => std::option::Option::Some(99),
13261 Self::L2InterconnectUnsupportedProtocol => std::option::Option::Some(100),
13262 Self::L2InterconnectUnsupportedPort => std::option::Option::Some(101),
13263 Self::L2InterconnectDestinationIpMismatch => std::option::Option::Some(102),
13264 Self::NccRouteWithinHybridSubnetUnsupported => std::option::Option::Some(104),
13265 Self::HybridSubnetRegionMismatch => std::option::Option::Some(105),
13266 Self::HybridSubnetNoRoute => std::option::Option::Some(106),
13267 Self::GkeNetworkPolicy => std::option::Option::Some(108),
13268 Self::NoValidRouteFromGoogleManagedNetworkToDestination => {
13269 std::option::Option::Some(110)
13270 }
13271 Self::PrivateConnectionNoRunningInstance => std::option::Option::Some(111),
13272 Self::UnknownValue(u) => u.0.value(),
13273 }
13274 }
13275
13276 /// Gets the enum value as a string.
13277 ///
13278 /// Returns `None` if the enum contains an unknown value deserialized from
13279 /// the integer representation of enums.
13280 pub fn name(&self) -> std::option::Option<&str> {
13281 match self {
13282 Self::Unspecified => std::option::Option::Some("CAUSE_UNSPECIFIED"),
13283 Self::UnknownExternalAddress => {
13284 std::option::Option::Some("UNKNOWN_EXTERNAL_ADDRESS")
13285 }
13286 Self::ForeignIpDisallowed => std::option::Option::Some("FOREIGN_IP_DISALLOWED"),
13287 Self::FirewallRule => std::option::Option::Some("FIREWALL_RULE"),
13288 Self::NoRoute => std::option::Option::Some("NO_ROUTE"),
13289 Self::RouteBlackhole => std::option::Option::Some("ROUTE_BLACKHOLE"),
13290 Self::RouteWrongNetwork => std::option::Option::Some("ROUTE_WRONG_NETWORK"),
13291 Self::RouteNextHopIpAddressNotResolved => {
13292 std::option::Option::Some("ROUTE_NEXT_HOP_IP_ADDRESS_NOT_RESOLVED")
13293 }
13294 Self::RouteNextHopResourceNotFound => {
13295 std::option::Option::Some("ROUTE_NEXT_HOP_RESOURCE_NOT_FOUND")
13296 }
13297 Self::RouteNextHopInstanceWrongNetwork => {
13298 std::option::Option::Some("ROUTE_NEXT_HOP_INSTANCE_WRONG_NETWORK")
13299 }
13300 Self::RouteNextHopInstanceNonPrimaryIp => {
13301 std::option::Option::Some("ROUTE_NEXT_HOP_INSTANCE_NON_PRIMARY_IP")
13302 }
13303 Self::RouteNextHopForwardingRuleIpMismatch => {
13304 std::option::Option::Some("ROUTE_NEXT_HOP_FORWARDING_RULE_IP_MISMATCH")
13305 }
13306 Self::RouteNextHopVpnTunnelNotEstablished => {
13307 std::option::Option::Some("ROUTE_NEXT_HOP_VPN_TUNNEL_NOT_ESTABLISHED")
13308 }
13309 Self::RouteNextHopForwardingRuleTypeInvalid => {
13310 std::option::Option::Some("ROUTE_NEXT_HOP_FORWARDING_RULE_TYPE_INVALID")
13311 }
13312 Self::NoRouteFromInternetToPrivateIpv6Address => {
13313 std::option::Option::Some("NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV6_ADDRESS")
13314 }
13315 Self::NoRouteFromInternetToPrivateIpv4Address => {
13316 std::option::Option::Some("NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV4_ADDRESS")
13317 }
13318 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
13319 std::option::Option::Some(
13320 "NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS",
13321 )
13322 }
13323 Self::VpnTunnelLocalSelectorMismatch => {
13324 std::option::Option::Some("VPN_TUNNEL_LOCAL_SELECTOR_MISMATCH")
13325 }
13326 Self::VpnTunnelRemoteSelectorMismatch => {
13327 std::option::Option::Some("VPN_TUNNEL_REMOTE_SELECTOR_MISMATCH")
13328 }
13329 Self::PrivateTrafficToInternet => {
13330 std::option::Option::Some("PRIVATE_TRAFFIC_TO_INTERNET")
13331 }
13332 Self::PrivateGoogleAccessDisallowed => {
13333 std::option::Option::Some("PRIVATE_GOOGLE_ACCESS_DISALLOWED")
13334 }
13335 Self::PrivateGoogleAccessViaVpnTunnelUnsupported => {
13336 std::option::Option::Some("PRIVATE_GOOGLE_ACCESS_VIA_VPN_TUNNEL_UNSUPPORTED")
13337 }
13338 Self::NoExternalAddress => std::option::Option::Some("NO_EXTERNAL_ADDRESS"),
13339 Self::UnknownInternalAddress => {
13340 std::option::Option::Some("UNKNOWN_INTERNAL_ADDRESS")
13341 }
13342 Self::ForwardingRuleMismatch => {
13343 std::option::Option::Some("FORWARDING_RULE_MISMATCH")
13344 }
13345 Self::ForwardingRuleNoInstances => {
13346 std::option::Option::Some("FORWARDING_RULE_NO_INSTANCES")
13347 }
13348 Self::FirewallBlockingLoadBalancerBackendHealthCheck => std::option::Option::Some(
13349 "FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK",
13350 ),
13351 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => std::option::Option::Some(
13352 "INGRESS_FIREWALL_TAGS_UNSUPPORTED_BY_DIRECT_VPC_EGRESS",
13353 ),
13354 Self::InstanceNotRunning => std::option::Option::Some("INSTANCE_NOT_RUNNING"),
13355 Self::GkeClusterNotRunning => std::option::Option::Some("GKE_CLUSTER_NOT_RUNNING"),
13356 Self::GkePodNotRunning => std::option::Option::Some("GKE_POD_NOT_RUNNING"),
13357 Self::CloudSqlInstanceNotRunning => {
13358 std::option::Option::Some("CLOUD_SQL_INSTANCE_NOT_RUNNING")
13359 }
13360 Self::RedisInstanceNotRunning => {
13361 std::option::Option::Some("REDIS_INSTANCE_NOT_RUNNING")
13362 }
13363 Self::RedisClusterNotRunning => {
13364 std::option::Option::Some("REDIS_CLUSTER_NOT_RUNNING")
13365 }
13366 Self::TrafficTypeBlocked => std::option::Option::Some("TRAFFIC_TYPE_BLOCKED"),
13367 Self::GkeMasterUnauthorizedAccess => {
13368 std::option::Option::Some("GKE_MASTER_UNAUTHORIZED_ACCESS")
13369 }
13370 Self::CloudSqlInstanceUnauthorizedAccess => {
13371 std::option::Option::Some("CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS")
13372 }
13373 Self::DroppedInsideGkeService => {
13374 std::option::Option::Some("DROPPED_INSIDE_GKE_SERVICE")
13375 }
13376 Self::DroppedInsideCloudSqlService => {
13377 std::option::Option::Some("DROPPED_INSIDE_CLOUD_SQL_SERVICE")
13378 }
13379 Self::DroppedInsideDmsPrivateConnection => {
13380 std::option::Option::Some("DROPPED_INSIDE_DMS_PRIVATE_CONNECTION")
13381 }
13382 Self::GoogleManagedServiceNoPeering => {
13383 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_NO_PEERING")
13384 }
13385 Self::GoogleManagedServiceNoPscEndpoint => {
13386 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_NO_PSC_ENDPOINT")
13387 }
13388 Self::GkePscEndpointMissing => {
13389 std::option::Option::Some("GKE_PSC_ENDPOINT_MISSING")
13390 }
13391 Self::CloudSqlInstanceNoIpAddress => {
13392 std::option::Option::Some("CLOUD_SQL_INSTANCE_NO_IP_ADDRESS")
13393 }
13394 Self::GkeControlPlaneRegionMismatch => {
13395 std::option::Option::Some("GKE_CONTROL_PLANE_REGION_MISMATCH")
13396 }
13397 Self::PublicGkeControlPlaneToPrivateDestination => {
13398 std::option::Option::Some("PUBLIC_GKE_CONTROL_PLANE_TO_PRIVATE_DESTINATION")
13399 }
13400 Self::GkeControlPlaneNoRoute => {
13401 std::option::Option::Some("GKE_CONTROL_PLANE_NO_ROUTE")
13402 }
13403 Self::CloudSqlInstanceNotConfiguredForExternalTraffic => std::option::Option::Some(
13404 "CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC",
13405 ),
13406 Self::PublicCloudSqlInstanceToPrivateDestination => {
13407 std::option::Option::Some("PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION")
13408 }
13409 Self::CloudSqlInstanceNoRoute => {
13410 std::option::Option::Some("CLOUD_SQL_INSTANCE_NO_ROUTE")
13411 }
13412 Self::CloudSqlConnectorRequired => {
13413 std::option::Option::Some("CLOUD_SQL_CONNECTOR_REQUIRED")
13414 }
13415 Self::CloudFunctionNotActive => {
13416 std::option::Option::Some("CLOUD_FUNCTION_NOT_ACTIVE")
13417 }
13418 Self::VpcConnectorNotSet => std::option::Option::Some("VPC_CONNECTOR_NOT_SET"),
13419 Self::VpcConnectorNotRunning => {
13420 std::option::Option::Some("VPC_CONNECTOR_NOT_RUNNING")
13421 }
13422 Self::VpcConnectorServerlessTrafficBlocked => {
13423 std::option::Option::Some("VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED")
13424 }
13425 Self::VpcConnectorHealthCheckTrafficBlocked => {
13426 std::option::Option::Some("VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED")
13427 }
13428 Self::ForwardingRuleRegionMismatch => {
13429 std::option::Option::Some("FORWARDING_RULE_REGION_MISMATCH")
13430 }
13431 Self::PscConnectionNotAccepted => {
13432 std::option::Option::Some("PSC_CONNECTION_NOT_ACCEPTED")
13433 }
13434 Self::PscEndpointAccessedFromPeeredNetwork => {
13435 std::option::Option::Some("PSC_ENDPOINT_ACCESSED_FROM_PEERED_NETWORK")
13436 }
13437 Self::PscNegProducerEndpointNoGlobalAccess => {
13438 std::option::Option::Some("PSC_NEG_PRODUCER_ENDPOINT_NO_GLOBAL_ACCESS")
13439 }
13440 Self::PscNegProducerForwardingRuleMultiplePorts => {
13441 std::option::Option::Some("PSC_NEG_PRODUCER_FORWARDING_RULE_MULTIPLE_PORTS")
13442 }
13443 Self::CloudSqlPscNegUnsupported => {
13444 std::option::Option::Some("CLOUD_SQL_PSC_NEG_UNSUPPORTED")
13445 }
13446 Self::NoNatSubnetsForPscServiceAttachment => {
13447 std::option::Option::Some("NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT")
13448 }
13449 Self::PscTransitivityNotPropagated => {
13450 std::option::Option::Some("PSC_TRANSITIVITY_NOT_PROPAGATED")
13451 }
13452 Self::HybridNegNonDynamicRouteMatched => {
13453 std::option::Option::Some("HYBRID_NEG_NON_DYNAMIC_ROUTE_MATCHED")
13454 }
13455 Self::HybridNegNonLocalDynamicRouteMatched => {
13456 std::option::Option::Some("HYBRID_NEG_NON_LOCAL_DYNAMIC_ROUTE_MATCHED")
13457 }
13458 Self::CloudRunRevisionNotReady => {
13459 std::option::Option::Some("CLOUD_RUN_REVISION_NOT_READY")
13460 }
13461 Self::CloudRunJobNotReady => std::option::Option::Some("CLOUD_RUN_JOB_NOT_READY"),
13462 Self::DroppedInsidePscServiceProducer => {
13463 std::option::Option::Some("DROPPED_INSIDE_PSC_SERVICE_PRODUCER")
13464 }
13465 Self::LoadBalancerHasNoProxySubnet => {
13466 std::option::Option::Some("LOAD_BALANCER_HAS_NO_PROXY_SUBNET")
13467 }
13468 Self::CloudNatNoAddresses => std::option::Option::Some("CLOUD_NAT_NO_ADDRESSES"),
13469 Self::RoutingLoop => std::option::Option::Some("ROUTING_LOOP"),
13470 Self::DroppedInsideGoogleManagedService => {
13471 std::option::Option::Some("DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE")
13472 }
13473 Self::LoadBalancerBackendInvalidNetwork => {
13474 std::option::Option::Some("LOAD_BALANCER_BACKEND_INVALID_NETWORK")
13475 }
13476 Self::BackendServiceNamedPortNotDefined => {
13477 std::option::Option::Some("BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED")
13478 }
13479 Self::DestinationIsPrivateNatIpRange => {
13480 std::option::Option::Some("DESTINATION_IS_PRIVATE_NAT_IP_RANGE")
13481 }
13482 Self::DroppedInsideRedisInstanceService => {
13483 std::option::Option::Some("DROPPED_INSIDE_REDIS_INSTANCE_SERVICE")
13484 }
13485 Self::RedisInstanceUnsupportedPort => {
13486 std::option::Option::Some("REDIS_INSTANCE_UNSUPPORTED_PORT")
13487 }
13488 Self::RedisInstanceConnectingFromPupiAddress => {
13489 std::option::Option::Some("REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS")
13490 }
13491 Self::RedisInstanceNoRouteToDestinationNetwork => {
13492 std::option::Option::Some("REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK")
13493 }
13494 Self::RedisInstanceNoExternalIp => {
13495 std::option::Option::Some("REDIS_INSTANCE_NO_EXTERNAL_IP")
13496 }
13497 Self::RedisInstanceUnsupportedProtocol => {
13498 std::option::Option::Some("REDIS_INSTANCE_UNSUPPORTED_PROTOCOL")
13499 }
13500 Self::DroppedInsideRedisClusterService => {
13501 std::option::Option::Some("DROPPED_INSIDE_REDIS_CLUSTER_SERVICE")
13502 }
13503 Self::RedisClusterUnsupportedPort => {
13504 std::option::Option::Some("REDIS_CLUSTER_UNSUPPORTED_PORT")
13505 }
13506 Self::RedisClusterNoExternalIp => {
13507 std::option::Option::Some("REDIS_CLUSTER_NO_EXTERNAL_IP")
13508 }
13509 Self::RedisClusterUnsupportedProtocol => {
13510 std::option::Option::Some("REDIS_CLUSTER_UNSUPPORTED_PROTOCOL")
13511 }
13512 Self::NoAdvertisedRouteToGcpDestination => {
13513 std::option::Option::Some("NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION")
13514 }
13515 Self::NoTrafficSelectorToGcpDestination => {
13516 std::option::Option::Some("NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION")
13517 }
13518 Self::NoKnownRouteFromPeeredNetworkToDestination => {
13519 std::option::Option::Some("NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION")
13520 }
13521 Self::PrivateNatToPscEndpointUnsupported => {
13522 std::option::Option::Some("PRIVATE_NAT_TO_PSC_ENDPOINT_UNSUPPORTED")
13523 }
13524 Self::PscPortMappingPortMismatch => {
13525 std::option::Option::Some("PSC_PORT_MAPPING_PORT_MISMATCH")
13526 }
13527 Self::PscPortMappingWithoutPscConnectionUnsupported => {
13528 std::option::Option::Some("PSC_PORT_MAPPING_WITHOUT_PSC_CONNECTION_UNSUPPORTED")
13529 }
13530 Self::UnsupportedRouteMatchedForNat64Destination => {
13531 std::option::Option::Some("UNSUPPORTED_ROUTE_MATCHED_FOR_NAT64_DESTINATION")
13532 }
13533 Self::TrafficFromHybridEndpointToInternetDisallowed => {
13534 std::option::Option::Some("TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED")
13535 }
13536 Self::NoMatchingNat64Gateway => {
13537 std::option::Option::Some("NO_MATCHING_NAT64_GATEWAY")
13538 }
13539 Self::NoConfiguredPrivateNat64Rule => {
13540 std::option::Option::Some("NO_CONFIGURED_PRIVATE_NAT64_RULE")
13541 }
13542 Self::LoadBalancerBackendIpVersionMismatch => {
13543 std::option::Option::Some("LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH")
13544 }
13545 Self::NoKnownRouteFromNccNetworkToDestination => {
13546 std::option::Option::Some("NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION")
13547 }
13548 Self::CloudNatProtocolUnsupported => {
13549 std::option::Option::Some("CLOUD_NAT_PROTOCOL_UNSUPPORTED")
13550 }
13551 Self::L2InterconnectUnsupportedProtocol => {
13552 std::option::Option::Some("L2_INTERCONNECT_UNSUPPORTED_PROTOCOL")
13553 }
13554 Self::L2InterconnectUnsupportedPort => {
13555 std::option::Option::Some("L2_INTERCONNECT_UNSUPPORTED_PORT")
13556 }
13557 Self::L2InterconnectDestinationIpMismatch => {
13558 std::option::Option::Some("L2_INTERCONNECT_DESTINATION_IP_MISMATCH")
13559 }
13560 Self::NccRouteWithinHybridSubnetUnsupported => {
13561 std::option::Option::Some("NCC_ROUTE_WITHIN_HYBRID_SUBNET_UNSUPPORTED")
13562 }
13563 Self::HybridSubnetRegionMismatch => {
13564 std::option::Option::Some("HYBRID_SUBNET_REGION_MISMATCH")
13565 }
13566 Self::HybridSubnetNoRoute => std::option::Option::Some("HYBRID_SUBNET_NO_ROUTE"),
13567 Self::GkeNetworkPolicy => std::option::Option::Some("GKE_NETWORK_POLICY"),
13568 Self::NoValidRouteFromGoogleManagedNetworkToDestination => {
13569 std::option::Option::Some(
13570 "NO_VALID_ROUTE_FROM_GOOGLE_MANAGED_NETWORK_TO_DESTINATION",
13571 )
13572 }
13573 Self::PrivateConnectionNoRunningInstance => {
13574 std::option::Option::Some("PRIVATE_CONNECTION_NO_RUNNING_INSTANCE")
13575 }
13576 Self::UnknownValue(u) => u.0.name(),
13577 }
13578 }
13579 }
13580
13581 impl std::default::Default for Cause {
13582 fn default() -> Self {
13583 use std::convert::From;
13584 Self::from(0)
13585 }
13586 }
13587
13588 impl std::fmt::Display for Cause {
13589 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13590 wkt::internal::display_enum(f, self.name(), self.value())
13591 }
13592 }
13593
13594 impl std::convert::From<i32> for Cause {
13595 fn from(value: i32) -> Self {
13596 match value {
13597 0 => Self::Unspecified,
13598 1 => Self::UnknownExternalAddress,
13599 2 => Self::ForeignIpDisallowed,
13600 3 => Self::FirewallRule,
13601 4 => Self::NoRoute,
13602 5 => Self::RouteBlackhole,
13603 6 => Self::RouteWrongNetwork,
13604 7 => Self::PrivateTrafficToInternet,
13605 8 => Self::PrivateGoogleAccessDisallowed,
13606 9 => Self::NoExternalAddress,
13607 10 => Self::UnknownInternalAddress,
13608 11 => Self::ForwardingRuleMismatch,
13609 12 => Self::ForwardingRuleNoInstances,
13610 13 => Self::FirewallBlockingLoadBalancerBackendHealthCheck,
13611 14 => Self::InstanceNotRunning,
13612 15 => Self::TrafficTypeBlocked,
13613 16 => Self::GkeMasterUnauthorizedAccess,
13614 17 => Self::CloudSqlInstanceUnauthorizedAccess,
13615 18 => Self::DroppedInsideGkeService,
13616 19 => Self::DroppedInsideCloudSqlService,
13617 20 => Self::GoogleManagedServiceNoPeering,
13618 21 => Self::CloudSqlInstanceNoIpAddress,
13619 22 => Self::CloudFunctionNotActive,
13620 23 => Self::VpcConnectorNotSet,
13621 24 => Self::VpcConnectorNotRunning,
13622 25 => Self::ForwardingRuleRegionMismatch,
13623 26 => Self::PscConnectionNotAccepted,
13624 27 => Self::GkeClusterNotRunning,
13625 28 => Self::CloudSqlInstanceNotRunning,
13626 29 => Self::CloudRunRevisionNotReady,
13627 30 => Self::GkeControlPlaneRegionMismatch,
13628 31 => Self::PublicGkeControlPlaneToPrivateDestination,
13629 32 => Self::GkeControlPlaneNoRoute,
13630 33 => Self::CloudSqlInstanceNotConfiguredForExternalTraffic,
13631 34 => Self::PublicCloudSqlInstanceToPrivateDestination,
13632 35 => Self::CloudSqlInstanceNoRoute,
13633 36 => Self::GkePscEndpointMissing,
13634 37 => Self::DroppedInsidePscServiceProducer,
13635 38 => Self::GoogleManagedServiceNoPscEndpoint,
13636 39 => Self::LoadBalancerHasNoProxySubnet,
13637 40 => Self::CloudNatNoAddresses,
13638 41 => Self::PscEndpointAccessedFromPeeredNetwork,
13639 42 => Self::RouteNextHopIpAddressNotResolved,
13640 43 => Self::RouteNextHopResourceNotFound,
13641 44 => Self::NoRouteFromInternetToPrivateIpv6Address,
13642 45 => Self::VpnTunnelLocalSelectorMismatch,
13643 46 => Self::VpnTunnelRemoteSelectorMismatch,
13644 47 => Self::PrivateGoogleAccessViaVpnTunnelUnsupported,
13645 48 => Self::PscNegProducerEndpointNoGlobalAccess,
13646 49 => Self::RouteNextHopInstanceWrongNetwork,
13647 50 => Self::RouteNextHopInstanceNonPrimaryIp,
13648 51 => Self::RouteNextHopForwardingRuleIpMismatch,
13649 52 => Self::RouteNextHopVpnTunnelNotEstablished,
13650 53 => Self::RouteNextHopForwardingRuleTypeInvalid,
13651 54 => Self::PscNegProducerForwardingRuleMultiplePorts,
13652 55 => Self::HybridNegNonDynamicRouteMatched,
13653 56 => Self::HybridNegNonLocalDynamicRouteMatched,
13654 57 => Self::NoNatSubnetsForPscServiceAttachment,
13655 58 => Self::CloudSqlPscNegUnsupported,
13656 59 => Self::RoutingLoop,
13657 60 => Self::VpcConnectorServerlessTrafficBlocked,
13658 61 => Self::VpcConnectorHealthCheckTrafficBlocked,
13659 62 => Self::DroppedInsideGoogleManagedService,
13660 63 => Self::CloudSqlConnectorRequired,
13661 64 => Self::PscTransitivityNotPropagated,
13662 65 => Self::LoadBalancerBackendInvalidNetwork,
13663 66 => Self::BackendServiceNamedPortNotDefined,
13664 67 => Self::DestinationIsPrivateNatIpRange,
13665 68 => Self::RedisInstanceNotRunning,
13666 69 => Self::RedisClusterNotRunning,
13667 70 => Self::DroppedInsideRedisInstanceService,
13668 71 => Self::RedisInstanceUnsupportedPort,
13669 72 => Self::RedisInstanceConnectingFromPupiAddress,
13670 73 => Self::RedisInstanceNoRouteToDestinationNetwork,
13671 74 => Self::RedisInstanceNoExternalIp,
13672 75 => Self::DroppedInsideRedisClusterService,
13673 76 => Self::RedisClusterUnsupportedPort,
13674 77 => Self::RedisClusterNoExternalIp,
13675 78 => Self::RedisInstanceUnsupportedProtocol,
13676 79 => Self::RedisClusterUnsupportedProtocol,
13677 80 => Self::NoAdvertisedRouteToGcpDestination,
13678 81 => Self::NoTrafficSelectorToGcpDestination,
13679 82 => Self::NoKnownRouteFromPeeredNetworkToDestination,
13680 83 => Self::PrivateNatToPscEndpointUnsupported,
13681 85 => Self::IngressFirewallTagsUnsupportedByDirectVpcEgress,
13682 86 => Self::PscPortMappingPortMismatch,
13683 87 => Self::PscPortMappingWithoutPscConnectionUnsupported,
13684 88 => Self::UnsupportedRouteMatchedForNat64Destination,
13685 89 => Self::TrafficFromHybridEndpointToInternetDisallowed,
13686 90 => Self::NoMatchingNat64Gateway,
13687 96 => Self::LoadBalancerBackendIpVersionMismatch,
13688 97 => Self::NoKnownRouteFromNccNetworkToDestination,
13689 98 => Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address,
13690 99 => Self::CloudNatProtocolUnsupported,
13691 100 => Self::L2InterconnectUnsupportedProtocol,
13692 101 => Self::L2InterconnectUnsupportedPort,
13693 102 => Self::L2InterconnectDestinationIpMismatch,
13694 103 => Self::GkePodNotRunning,
13695 104 => Self::NccRouteWithinHybridSubnetUnsupported,
13696 105 => Self::HybridSubnetRegionMismatch,
13697 106 => Self::HybridSubnetNoRoute,
13698 107 => Self::NoConfiguredPrivateNat64Rule,
13699 108 => Self::GkeNetworkPolicy,
13700 109 => Self::NoRouteFromInternetToPrivateIpv4Address,
13701 110 => Self::NoValidRouteFromGoogleManagedNetworkToDestination,
13702 111 => Self::PrivateConnectionNoRunningInstance,
13703 113 => Self::CloudRunJobNotReady,
13704 114 => Self::DroppedInsideDmsPrivateConnection,
13705 _ => Self::UnknownValue(cause::UnknownValue(
13706 wkt::internal::UnknownEnumValue::Integer(value),
13707 )),
13708 }
13709 }
13710 }
13711
13712 impl std::convert::From<&str> for Cause {
13713 fn from(value: &str) -> Self {
13714 use std::string::ToString;
13715 match value {
13716 "CAUSE_UNSPECIFIED" => Self::Unspecified,
13717 "UNKNOWN_EXTERNAL_ADDRESS" => Self::UnknownExternalAddress,
13718 "FOREIGN_IP_DISALLOWED" => Self::ForeignIpDisallowed,
13719 "FIREWALL_RULE" => Self::FirewallRule,
13720 "NO_ROUTE" => Self::NoRoute,
13721 "ROUTE_BLACKHOLE" => Self::RouteBlackhole,
13722 "ROUTE_WRONG_NETWORK" => Self::RouteWrongNetwork,
13723 "ROUTE_NEXT_HOP_IP_ADDRESS_NOT_RESOLVED" => Self::RouteNextHopIpAddressNotResolved,
13724 "ROUTE_NEXT_HOP_RESOURCE_NOT_FOUND" => Self::RouteNextHopResourceNotFound,
13725 "ROUTE_NEXT_HOP_INSTANCE_WRONG_NETWORK" => Self::RouteNextHopInstanceWrongNetwork,
13726 "ROUTE_NEXT_HOP_INSTANCE_NON_PRIMARY_IP" => Self::RouteNextHopInstanceNonPrimaryIp,
13727 "ROUTE_NEXT_HOP_FORWARDING_RULE_IP_MISMATCH" => {
13728 Self::RouteNextHopForwardingRuleIpMismatch
13729 }
13730 "ROUTE_NEXT_HOP_VPN_TUNNEL_NOT_ESTABLISHED" => {
13731 Self::RouteNextHopVpnTunnelNotEstablished
13732 }
13733 "ROUTE_NEXT_HOP_FORWARDING_RULE_TYPE_INVALID" => {
13734 Self::RouteNextHopForwardingRuleTypeInvalid
13735 }
13736 "NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV6_ADDRESS" => {
13737 Self::NoRouteFromInternetToPrivateIpv6Address
13738 }
13739 "NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV4_ADDRESS" => {
13740 Self::NoRouteFromInternetToPrivateIpv4Address
13741 }
13742 "NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS" => {
13743 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address
13744 }
13745 "VPN_TUNNEL_LOCAL_SELECTOR_MISMATCH" => Self::VpnTunnelLocalSelectorMismatch,
13746 "VPN_TUNNEL_REMOTE_SELECTOR_MISMATCH" => Self::VpnTunnelRemoteSelectorMismatch,
13747 "PRIVATE_TRAFFIC_TO_INTERNET" => Self::PrivateTrafficToInternet,
13748 "PRIVATE_GOOGLE_ACCESS_DISALLOWED" => Self::PrivateGoogleAccessDisallowed,
13749 "PRIVATE_GOOGLE_ACCESS_VIA_VPN_TUNNEL_UNSUPPORTED" => {
13750 Self::PrivateGoogleAccessViaVpnTunnelUnsupported
13751 }
13752 "NO_EXTERNAL_ADDRESS" => Self::NoExternalAddress,
13753 "UNKNOWN_INTERNAL_ADDRESS" => Self::UnknownInternalAddress,
13754 "FORWARDING_RULE_MISMATCH" => Self::ForwardingRuleMismatch,
13755 "FORWARDING_RULE_NO_INSTANCES" => Self::ForwardingRuleNoInstances,
13756 "FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK" => {
13757 Self::FirewallBlockingLoadBalancerBackendHealthCheck
13758 }
13759 "INGRESS_FIREWALL_TAGS_UNSUPPORTED_BY_DIRECT_VPC_EGRESS" => {
13760 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress
13761 }
13762 "INSTANCE_NOT_RUNNING" => Self::InstanceNotRunning,
13763 "GKE_CLUSTER_NOT_RUNNING" => Self::GkeClusterNotRunning,
13764 "GKE_POD_NOT_RUNNING" => Self::GkePodNotRunning,
13765 "CLOUD_SQL_INSTANCE_NOT_RUNNING" => Self::CloudSqlInstanceNotRunning,
13766 "REDIS_INSTANCE_NOT_RUNNING" => Self::RedisInstanceNotRunning,
13767 "REDIS_CLUSTER_NOT_RUNNING" => Self::RedisClusterNotRunning,
13768 "TRAFFIC_TYPE_BLOCKED" => Self::TrafficTypeBlocked,
13769 "GKE_MASTER_UNAUTHORIZED_ACCESS" => Self::GkeMasterUnauthorizedAccess,
13770 "CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS" => {
13771 Self::CloudSqlInstanceUnauthorizedAccess
13772 }
13773 "DROPPED_INSIDE_GKE_SERVICE" => Self::DroppedInsideGkeService,
13774 "DROPPED_INSIDE_CLOUD_SQL_SERVICE" => Self::DroppedInsideCloudSqlService,
13775 "DROPPED_INSIDE_DMS_PRIVATE_CONNECTION" => Self::DroppedInsideDmsPrivateConnection,
13776 "GOOGLE_MANAGED_SERVICE_NO_PEERING" => Self::GoogleManagedServiceNoPeering,
13777 "GOOGLE_MANAGED_SERVICE_NO_PSC_ENDPOINT" => Self::GoogleManagedServiceNoPscEndpoint,
13778 "GKE_PSC_ENDPOINT_MISSING" => Self::GkePscEndpointMissing,
13779 "CLOUD_SQL_INSTANCE_NO_IP_ADDRESS" => Self::CloudSqlInstanceNoIpAddress,
13780 "GKE_CONTROL_PLANE_REGION_MISMATCH" => Self::GkeControlPlaneRegionMismatch,
13781 "PUBLIC_GKE_CONTROL_PLANE_TO_PRIVATE_DESTINATION" => {
13782 Self::PublicGkeControlPlaneToPrivateDestination
13783 }
13784 "GKE_CONTROL_PLANE_NO_ROUTE" => Self::GkeControlPlaneNoRoute,
13785 "CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC" => {
13786 Self::CloudSqlInstanceNotConfiguredForExternalTraffic
13787 }
13788 "PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION" => {
13789 Self::PublicCloudSqlInstanceToPrivateDestination
13790 }
13791 "CLOUD_SQL_INSTANCE_NO_ROUTE" => Self::CloudSqlInstanceNoRoute,
13792 "CLOUD_SQL_CONNECTOR_REQUIRED" => Self::CloudSqlConnectorRequired,
13793 "CLOUD_FUNCTION_NOT_ACTIVE" => Self::CloudFunctionNotActive,
13794 "VPC_CONNECTOR_NOT_SET" => Self::VpcConnectorNotSet,
13795 "VPC_CONNECTOR_NOT_RUNNING" => Self::VpcConnectorNotRunning,
13796 "VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED" => {
13797 Self::VpcConnectorServerlessTrafficBlocked
13798 }
13799 "VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED" => {
13800 Self::VpcConnectorHealthCheckTrafficBlocked
13801 }
13802 "FORWARDING_RULE_REGION_MISMATCH" => Self::ForwardingRuleRegionMismatch,
13803 "PSC_CONNECTION_NOT_ACCEPTED" => Self::PscConnectionNotAccepted,
13804 "PSC_ENDPOINT_ACCESSED_FROM_PEERED_NETWORK" => {
13805 Self::PscEndpointAccessedFromPeeredNetwork
13806 }
13807 "PSC_NEG_PRODUCER_ENDPOINT_NO_GLOBAL_ACCESS" => {
13808 Self::PscNegProducerEndpointNoGlobalAccess
13809 }
13810 "PSC_NEG_PRODUCER_FORWARDING_RULE_MULTIPLE_PORTS" => {
13811 Self::PscNegProducerForwardingRuleMultiplePorts
13812 }
13813 "CLOUD_SQL_PSC_NEG_UNSUPPORTED" => Self::CloudSqlPscNegUnsupported,
13814 "NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT" => {
13815 Self::NoNatSubnetsForPscServiceAttachment
13816 }
13817 "PSC_TRANSITIVITY_NOT_PROPAGATED" => Self::PscTransitivityNotPropagated,
13818 "HYBRID_NEG_NON_DYNAMIC_ROUTE_MATCHED" => Self::HybridNegNonDynamicRouteMatched,
13819 "HYBRID_NEG_NON_LOCAL_DYNAMIC_ROUTE_MATCHED" => {
13820 Self::HybridNegNonLocalDynamicRouteMatched
13821 }
13822 "CLOUD_RUN_REVISION_NOT_READY" => Self::CloudRunRevisionNotReady,
13823 "CLOUD_RUN_JOB_NOT_READY" => Self::CloudRunJobNotReady,
13824 "DROPPED_INSIDE_PSC_SERVICE_PRODUCER" => Self::DroppedInsidePscServiceProducer,
13825 "LOAD_BALANCER_HAS_NO_PROXY_SUBNET" => Self::LoadBalancerHasNoProxySubnet,
13826 "CLOUD_NAT_NO_ADDRESSES" => Self::CloudNatNoAddresses,
13827 "ROUTING_LOOP" => Self::RoutingLoop,
13828 "DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE" => Self::DroppedInsideGoogleManagedService,
13829 "LOAD_BALANCER_BACKEND_INVALID_NETWORK" => Self::LoadBalancerBackendInvalidNetwork,
13830 "BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED" => Self::BackendServiceNamedPortNotDefined,
13831 "DESTINATION_IS_PRIVATE_NAT_IP_RANGE" => Self::DestinationIsPrivateNatIpRange,
13832 "DROPPED_INSIDE_REDIS_INSTANCE_SERVICE" => Self::DroppedInsideRedisInstanceService,
13833 "REDIS_INSTANCE_UNSUPPORTED_PORT" => Self::RedisInstanceUnsupportedPort,
13834 "REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS" => {
13835 Self::RedisInstanceConnectingFromPupiAddress
13836 }
13837 "REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK" => {
13838 Self::RedisInstanceNoRouteToDestinationNetwork
13839 }
13840 "REDIS_INSTANCE_NO_EXTERNAL_IP" => Self::RedisInstanceNoExternalIp,
13841 "REDIS_INSTANCE_UNSUPPORTED_PROTOCOL" => Self::RedisInstanceUnsupportedProtocol,
13842 "DROPPED_INSIDE_REDIS_CLUSTER_SERVICE" => Self::DroppedInsideRedisClusterService,
13843 "REDIS_CLUSTER_UNSUPPORTED_PORT" => Self::RedisClusterUnsupportedPort,
13844 "REDIS_CLUSTER_NO_EXTERNAL_IP" => Self::RedisClusterNoExternalIp,
13845 "REDIS_CLUSTER_UNSUPPORTED_PROTOCOL" => Self::RedisClusterUnsupportedProtocol,
13846 "NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION" => Self::NoAdvertisedRouteToGcpDestination,
13847 "NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION" => Self::NoTrafficSelectorToGcpDestination,
13848 "NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION" => {
13849 Self::NoKnownRouteFromPeeredNetworkToDestination
13850 }
13851 "PRIVATE_NAT_TO_PSC_ENDPOINT_UNSUPPORTED" => {
13852 Self::PrivateNatToPscEndpointUnsupported
13853 }
13854 "PSC_PORT_MAPPING_PORT_MISMATCH" => Self::PscPortMappingPortMismatch,
13855 "PSC_PORT_MAPPING_WITHOUT_PSC_CONNECTION_UNSUPPORTED" => {
13856 Self::PscPortMappingWithoutPscConnectionUnsupported
13857 }
13858 "UNSUPPORTED_ROUTE_MATCHED_FOR_NAT64_DESTINATION" => {
13859 Self::UnsupportedRouteMatchedForNat64Destination
13860 }
13861 "TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED" => {
13862 Self::TrafficFromHybridEndpointToInternetDisallowed
13863 }
13864 "NO_MATCHING_NAT64_GATEWAY" => Self::NoMatchingNat64Gateway,
13865 "NO_CONFIGURED_PRIVATE_NAT64_RULE" => Self::NoConfiguredPrivateNat64Rule,
13866 "LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH" => {
13867 Self::LoadBalancerBackendIpVersionMismatch
13868 }
13869 "NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION" => {
13870 Self::NoKnownRouteFromNccNetworkToDestination
13871 }
13872 "CLOUD_NAT_PROTOCOL_UNSUPPORTED" => Self::CloudNatProtocolUnsupported,
13873 "L2_INTERCONNECT_UNSUPPORTED_PROTOCOL" => Self::L2InterconnectUnsupportedProtocol,
13874 "L2_INTERCONNECT_UNSUPPORTED_PORT" => Self::L2InterconnectUnsupportedPort,
13875 "L2_INTERCONNECT_DESTINATION_IP_MISMATCH" => {
13876 Self::L2InterconnectDestinationIpMismatch
13877 }
13878 "NCC_ROUTE_WITHIN_HYBRID_SUBNET_UNSUPPORTED" => {
13879 Self::NccRouteWithinHybridSubnetUnsupported
13880 }
13881 "HYBRID_SUBNET_REGION_MISMATCH" => Self::HybridSubnetRegionMismatch,
13882 "HYBRID_SUBNET_NO_ROUTE" => Self::HybridSubnetNoRoute,
13883 "GKE_NETWORK_POLICY" => Self::GkeNetworkPolicy,
13884 "NO_VALID_ROUTE_FROM_GOOGLE_MANAGED_NETWORK_TO_DESTINATION" => {
13885 Self::NoValidRouteFromGoogleManagedNetworkToDestination
13886 }
13887 "PRIVATE_CONNECTION_NO_RUNNING_INSTANCE" => {
13888 Self::PrivateConnectionNoRunningInstance
13889 }
13890 _ => Self::UnknownValue(cause::UnknownValue(
13891 wkt::internal::UnknownEnumValue::String(value.to_string()),
13892 )),
13893 }
13894 }
13895 }
13896
13897 impl serde::ser::Serialize for Cause {
13898 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13899 where
13900 S: serde::Serializer,
13901 {
13902 match self {
13903 Self::Unspecified => serializer.serialize_i32(0),
13904 Self::UnknownExternalAddress => serializer.serialize_i32(1),
13905 Self::ForeignIpDisallowed => serializer.serialize_i32(2),
13906 Self::FirewallRule => serializer.serialize_i32(3),
13907 Self::NoRoute => serializer.serialize_i32(4),
13908 Self::RouteBlackhole => serializer.serialize_i32(5),
13909 Self::RouteWrongNetwork => serializer.serialize_i32(6),
13910 Self::RouteNextHopIpAddressNotResolved => serializer.serialize_i32(42),
13911 Self::RouteNextHopResourceNotFound => serializer.serialize_i32(43),
13912 Self::RouteNextHopInstanceWrongNetwork => serializer.serialize_i32(49),
13913 Self::RouteNextHopInstanceNonPrimaryIp => serializer.serialize_i32(50),
13914 Self::RouteNextHopForwardingRuleIpMismatch => serializer.serialize_i32(51),
13915 Self::RouteNextHopVpnTunnelNotEstablished => serializer.serialize_i32(52),
13916 Self::RouteNextHopForwardingRuleTypeInvalid => serializer.serialize_i32(53),
13917 Self::NoRouteFromInternetToPrivateIpv6Address => serializer.serialize_i32(44),
13918 Self::NoRouteFromInternetToPrivateIpv4Address => serializer.serialize_i32(109),
13919 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
13920 serializer.serialize_i32(98)
13921 }
13922 Self::VpnTunnelLocalSelectorMismatch => serializer.serialize_i32(45),
13923 Self::VpnTunnelRemoteSelectorMismatch => serializer.serialize_i32(46),
13924 Self::PrivateTrafficToInternet => serializer.serialize_i32(7),
13925 Self::PrivateGoogleAccessDisallowed => serializer.serialize_i32(8),
13926 Self::PrivateGoogleAccessViaVpnTunnelUnsupported => serializer.serialize_i32(47),
13927 Self::NoExternalAddress => serializer.serialize_i32(9),
13928 Self::UnknownInternalAddress => serializer.serialize_i32(10),
13929 Self::ForwardingRuleMismatch => serializer.serialize_i32(11),
13930 Self::ForwardingRuleNoInstances => serializer.serialize_i32(12),
13931 Self::FirewallBlockingLoadBalancerBackendHealthCheck => {
13932 serializer.serialize_i32(13)
13933 }
13934 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => {
13935 serializer.serialize_i32(85)
13936 }
13937 Self::InstanceNotRunning => serializer.serialize_i32(14),
13938 Self::GkeClusterNotRunning => serializer.serialize_i32(27),
13939 Self::GkePodNotRunning => serializer.serialize_i32(103),
13940 Self::CloudSqlInstanceNotRunning => serializer.serialize_i32(28),
13941 Self::RedisInstanceNotRunning => serializer.serialize_i32(68),
13942 Self::RedisClusterNotRunning => serializer.serialize_i32(69),
13943 Self::TrafficTypeBlocked => serializer.serialize_i32(15),
13944 Self::GkeMasterUnauthorizedAccess => serializer.serialize_i32(16),
13945 Self::CloudSqlInstanceUnauthorizedAccess => serializer.serialize_i32(17),
13946 Self::DroppedInsideGkeService => serializer.serialize_i32(18),
13947 Self::DroppedInsideCloudSqlService => serializer.serialize_i32(19),
13948 Self::DroppedInsideDmsPrivateConnection => serializer.serialize_i32(114),
13949 Self::GoogleManagedServiceNoPeering => serializer.serialize_i32(20),
13950 Self::GoogleManagedServiceNoPscEndpoint => serializer.serialize_i32(38),
13951 Self::GkePscEndpointMissing => serializer.serialize_i32(36),
13952 Self::CloudSqlInstanceNoIpAddress => serializer.serialize_i32(21),
13953 Self::GkeControlPlaneRegionMismatch => serializer.serialize_i32(30),
13954 Self::PublicGkeControlPlaneToPrivateDestination => serializer.serialize_i32(31),
13955 Self::GkeControlPlaneNoRoute => serializer.serialize_i32(32),
13956 Self::CloudSqlInstanceNotConfiguredForExternalTraffic => {
13957 serializer.serialize_i32(33)
13958 }
13959 Self::PublicCloudSqlInstanceToPrivateDestination => serializer.serialize_i32(34),
13960 Self::CloudSqlInstanceNoRoute => serializer.serialize_i32(35),
13961 Self::CloudSqlConnectorRequired => serializer.serialize_i32(63),
13962 Self::CloudFunctionNotActive => serializer.serialize_i32(22),
13963 Self::VpcConnectorNotSet => serializer.serialize_i32(23),
13964 Self::VpcConnectorNotRunning => serializer.serialize_i32(24),
13965 Self::VpcConnectorServerlessTrafficBlocked => serializer.serialize_i32(60),
13966 Self::VpcConnectorHealthCheckTrafficBlocked => serializer.serialize_i32(61),
13967 Self::ForwardingRuleRegionMismatch => serializer.serialize_i32(25),
13968 Self::PscConnectionNotAccepted => serializer.serialize_i32(26),
13969 Self::PscEndpointAccessedFromPeeredNetwork => serializer.serialize_i32(41),
13970 Self::PscNegProducerEndpointNoGlobalAccess => serializer.serialize_i32(48),
13971 Self::PscNegProducerForwardingRuleMultiplePorts => serializer.serialize_i32(54),
13972 Self::CloudSqlPscNegUnsupported => serializer.serialize_i32(58),
13973 Self::NoNatSubnetsForPscServiceAttachment => serializer.serialize_i32(57),
13974 Self::PscTransitivityNotPropagated => serializer.serialize_i32(64),
13975 Self::HybridNegNonDynamicRouteMatched => serializer.serialize_i32(55),
13976 Self::HybridNegNonLocalDynamicRouteMatched => serializer.serialize_i32(56),
13977 Self::CloudRunRevisionNotReady => serializer.serialize_i32(29),
13978 Self::CloudRunJobNotReady => serializer.serialize_i32(113),
13979 Self::DroppedInsidePscServiceProducer => serializer.serialize_i32(37),
13980 Self::LoadBalancerHasNoProxySubnet => serializer.serialize_i32(39),
13981 Self::CloudNatNoAddresses => serializer.serialize_i32(40),
13982 Self::RoutingLoop => serializer.serialize_i32(59),
13983 Self::DroppedInsideGoogleManagedService => serializer.serialize_i32(62),
13984 Self::LoadBalancerBackendInvalidNetwork => serializer.serialize_i32(65),
13985 Self::BackendServiceNamedPortNotDefined => serializer.serialize_i32(66),
13986 Self::DestinationIsPrivateNatIpRange => serializer.serialize_i32(67),
13987 Self::DroppedInsideRedisInstanceService => serializer.serialize_i32(70),
13988 Self::RedisInstanceUnsupportedPort => serializer.serialize_i32(71),
13989 Self::RedisInstanceConnectingFromPupiAddress => serializer.serialize_i32(72),
13990 Self::RedisInstanceNoRouteToDestinationNetwork => serializer.serialize_i32(73),
13991 Self::RedisInstanceNoExternalIp => serializer.serialize_i32(74),
13992 Self::RedisInstanceUnsupportedProtocol => serializer.serialize_i32(78),
13993 Self::DroppedInsideRedisClusterService => serializer.serialize_i32(75),
13994 Self::RedisClusterUnsupportedPort => serializer.serialize_i32(76),
13995 Self::RedisClusterNoExternalIp => serializer.serialize_i32(77),
13996 Self::RedisClusterUnsupportedProtocol => serializer.serialize_i32(79),
13997 Self::NoAdvertisedRouteToGcpDestination => serializer.serialize_i32(80),
13998 Self::NoTrafficSelectorToGcpDestination => serializer.serialize_i32(81),
13999 Self::NoKnownRouteFromPeeredNetworkToDestination => serializer.serialize_i32(82),
14000 Self::PrivateNatToPscEndpointUnsupported => serializer.serialize_i32(83),
14001 Self::PscPortMappingPortMismatch => serializer.serialize_i32(86),
14002 Self::PscPortMappingWithoutPscConnectionUnsupported => serializer.serialize_i32(87),
14003 Self::UnsupportedRouteMatchedForNat64Destination => serializer.serialize_i32(88),
14004 Self::TrafficFromHybridEndpointToInternetDisallowed => serializer.serialize_i32(89),
14005 Self::NoMatchingNat64Gateway => serializer.serialize_i32(90),
14006 Self::NoConfiguredPrivateNat64Rule => serializer.serialize_i32(107),
14007 Self::LoadBalancerBackendIpVersionMismatch => serializer.serialize_i32(96),
14008 Self::NoKnownRouteFromNccNetworkToDestination => serializer.serialize_i32(97),
14009 Self::CloudNatProtocolUnsupported => serializer.serialize_i32(99),
14010 Self::L2InterconnectUnsupportedProtocol => serializer.serialize_i32(100),
14011 Self::L2InterconnectUnsupportedPort => serializer.serialize_i32(101),
14012 Self::L2InterconnectDestinationIpMismatch => serializer.serialize_i32(102),
14013 Self::NccRouteWithinHybridSubnetUnsupported => serializer.serialize_i32(104),
14014 Self::HybridSubnetRegionMismatch => serializer.serialize_i32(105),
14015 Self::HybridSubnetNoRoute => serializer.serialize_i32(106),
14016 Self::GkeNetworkPolicy => serializer.serialize_i32(108),
14017 Self::NoValidRouteFromGoogleManagedNetworkToDestination => {
14018 serializer.serialize_i32(110)
14019 }
14020 Self::PrivateConnectionNoRunningInstance => serializer.serialize_i32(111),
14021 Self::UnknownValue(u) => u.0.serialize(serializer),
14022 }
14023 }
14024 }
14025
14026 impl<'de> serde::de::Deserialize<'de> for Cause {
14027 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14028 where
14029 D: serde::Deserializer<'de>,
14030 {
14031 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Cause>::new(
14032 ".google.cloud.networkmanagement.v1.DropInfo.Cause",
14033 ))
14034 }
14035 }
14036}
14037
14038/// For display only. Metadata associated with a Google Kubernetes Engine (GKE)
14039/// cluster master.
14040#[derive(Clone, Default, PartialEq)]
14041#[non_exhaustive]
14042pub struct GKEMasterInfo {
14043 /// URI of a GKE cluster.
14044 pub cluster_uri: std::string::String,
14045
14046 /// URI of a GKE cluster network.
14047 pub cluster_network_uri: std::string::String,
14048
14049 /// Internal IP address of a GKE cluster control plane.
14050 pub internal_ip: std::string::String,
14051
14052 /// External IP address of a GKE cluster control plane.
14053 pub external_ip: std::string::String,
14054
14055 /// DNS endpoint of a GKE cluster control plane.
14056 pub dns_endpoint: std::string::String,
14057
14058 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14059}
14060
14061impl GKEMasterInfo {
14062 /// Creates a new default instance.
14063 pub fn new() -> Self {
14064 std::default::Default::default()
14065 }
14066
14067 /// Sets the value of [cluster_uri][crate::model::GKEMasterInfo::cluster_uri].
14068 ///
14069 /// # Example
14070 /// ```ignore,no_run
14071 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
14072 /// let x = GKEMasterInfo::new().set_cluster_uri("example");
14073 /// ```
14074 pub fn set_cluster_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14075 self.cluster_uri = v.into();
14076 self
14077 }
14078
14079 /// Sets the value of [cluster_network_uri][crate::model::GKEMasterInfo::cluster_network_uri].
14080 ///
14081 /// # Example
14082 /// ```ignore,no_run
14083 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
14084 /// let x = GKEMasterInfo::new().set_cluster_network_uri("example");
14085 /// ```
14086 pub fn set_cluster_network_uri<T: std::convert::Into<std::string::String>>(
14087 mut self,
14088 v: T,
14089 ) -> Self {
14090 self.cluster_network_uri = v.into();
14091 self
14092 }
14093
14094 /// Sets the value of [internal_ip][crate::model::GKEMasterInfo::internal_ip].
14095 ///
14096 /// # Example
14097 /// ```ignore,no_run
14098 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
14099 /// let x = GKEMasterInfo::new().set_internal_ip("example");
14100 /// ```
14101 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14102 self.internal_ip = v.into();
14103 self
14104 }
14105
14106 /// Sets the value of [external_ip][crate::model::GKEMasterInfo::external_ip].
14107 ///
14108 /// # Example
14109 /// ```ignore,no_run
14110 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
14111 /// let x = GKEMasterInfo::new().set_external_ip("example");
14112 /// ```
14113 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14114 self.external_ip = v.into();
14115 self
14116 }
14117
14118 /// Sets the value of [dns_endpoint][crate::model::GKEMasterInfo::dns_endpoint].
14119 ///
14120 /// # Example
14121 /// ```ignore,no_run
14122 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
14123 /// let x = GKEMasterInfo::new().set_dns_endpoint("example");
14124 /// ```
14125 pub fn set_dns_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14126 self.dns_endpoint = v.into();
14127 self
14128 }
14129}
14130
14131impl wkt::message::Message for GKEMasterInfo {
14132 fn typename() -> &'static str {
14133 "type.googleapis.com/google.cloud.networkmanagement.v1.GKEMasterInfo"
14134 }
14135}
14136
14137/// For display only. Metadata associated with a Google Kubernetes Engine (GKE)
14138/// Pod.
14139#[derive(Clone, Default, PartialEq)]
14140#[non_exhaustive]
14141pub struct GkePodInfo {
14142 /// URI of a GKE Pod.
14143 /// For Pods in regional Clusters, the URI format is:
14144 /// `projects/{project}/locations/{location}/clusters/{cluster}/k8s/namespaces/{namespace}/pods/{pod}`
14145 /// For Pods in zonal Clusters, the URI format is:
14146 /// `projects/{project}/zones/{zone}/clusters/{cluster}/k8s/namespaces/{namespace}/pods/{pod}`
14147 pub pod_uri: std::string::String,
14148
14149 /// IP address of a GKE Pod. If the Pod is dual-stack, this is the IP address
14150 /// relevant to the trace.
14151 pub ip_address: std::string::String,
14152
14153 /// URI of the network containing the GKE Pod.
14154 pub network_uri: std::string::String,
14155
14156 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14157}
14158
14159impl GkePodInfo {
14160 /// Creates a new default instance.
14161 pub fn new() -> Self {
14162 std::default::Default::default()
14163 }
14164
14165 /// Sets the value of [pod_uri][crate::model::GkePodInfo::pod_uri].
14166 ///
14167 /// # Example
14168 /// ```ignore,no_run
14169 /// # use google_cloud_networkmanagement_v1::model::GkePodInfo;
14170 /// let x = GkePodInfo::new().set_pod_uri("example");
14171 /// ```
14172 pub fn set_pod_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14173 self.pod_uri = v.into();
14174 self
14175 }
14176
14177 /// Sets the value of [ip_address][crate::model::GkePodInfo::ip_address].
14178 ///
14179 /// # Example
14180 /// ```ignore,no_run
14181 /// # use google_cloud_networkmanagement_v1::model::GkePodInfo;
14182 /// let x = GkePodInfo::new().set_ip_address("example");
14183 /// ```
14184 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14185 self.ip_address = v.into();
14186 self
14187 }
14188
14189 /// Sets the value of [network_uri][crate::model::GkePodInfo::network_uri].
14190 ///
14191 /// # Example
14192 /// ```ignore,no_run
14193 /// # use google_cloud_networkmanagement_v1::model::GkePodInfo;
14194 /// let x = GkePodInfo::new().set_network_uri("example");
14195 /// ```
14196 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14197 self.network_uri = v.into();
14198 self
14199 }
14200}
14201
14202impl wkt::message::Message for GkePodInfo {
14203 fn typename() -> &'static str {
14204 "type.googleapis.com/google.cloud.networkmanagement.v1.GkePodInfo"
14205 }
14206}
14207
14208/// For display only. Contains information about why IP masquerading was skipped
14209/// for the packet.
14210#[derive(Clone, Default, PartialEq)]
14211#[non_exhaustive]
14212pub struct IpMasqueradingSkippedInfo {
14213 /// Reason why IP masquerading was not applied.
14214 pub reason: crate::model::ip_masquerading_skipped_info::Reason,
14215
14216 /// The matched non-masquerade IP range. Only set if reason is
14217 /// DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE or
14218 /// DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE.
14219 pub non_masquerade_range: std::string::String,
14220
14221 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14222}
14223
14224impl IpMasqueradingSkippedInfo {
14225 /// Creates a new default instance.
14226 pub fn new() -> Self {
14227 std::default::Default::default()
14228 }
14229
14230 /// Sets the value of [reason][crate::model::IpMasqueradingSkippedInfo::reason].
14231 ///
14232 /// # Example
14233 /// ```ignore,no_run
14234 /// # use google_cloud_networkmanagement_v1::model::IpMasqueradingSkippedInfo;
14235 /// use google_cloud_networkmanagement_v1::model::ip_masquerading_skipped_info::Reason;
14236 /// let x0 = IpMasqueradingSkippedInfo::new().set_reason(Reason::DestinationIpInConfiguredNonMasqueradeRange);
14237 /// let x1 = IpMasqueradingSkippedInfo::new().set_reason(Reason::DestinationIpInDefaultNonMasqueradeRange);
14238 /// let x2 = IpMasqueradingSkippedInfo::new().set_reason(Reason::DestinationOnSameNode);
14239 /// ```
14240 pub fn set_reason<T: std::convert::Into<crate::model::ip_masquerading_skipped_info::Reason>>(
14241 mut self,
14242 v: T,
14243 ) -> Self {
14244 self.reason = v.into();
14245 self
14246 }
14247
14248 /// Sets the value of [non_masquerade_range][crate::model::IpMasqueradingSkippedInfo::non_masquerade_range].
14249 ///
14250 /// # Example
14251 /// ```ignore,no_run
14252 /// # use google_cloud_networkmanagement_v1::model::IpMasqueradingSkippedInfo;
14253 /// let x = IpMasqueradingSkippedInfo::new().set_non_masquerade_range("example");
14254 /// ```
14255 pub fn set_non_masquerade_range<T: std::convert::Into<std::string::String>>(
14256 mut self,
14257 v: T,
14258 ) -> Self {
14259 self.non_masquerade_range = v.into();
14260 self
14261 }
14262}
14263
14264impl wkt::message::Message for IpMasqueradingSkippedInfo {
14265 fn typename() -> &'static str {
14266 "type.googleapis.com/google.cloud.networkmanagement.v1.IpMasqueradingSkippedInfo"
14267 }
14268}
14269
14270/// Defines additional types related to [IpMasqueradingSkippedInfo].
14271pub mod ip_masquerading_skipped_info {
14272 #[allow(unused_imports)]
14273 use super::*;
14274
14275 /// Reason why IP masquerading was skipped.
14276 ///
14277 /// # Working with unknown values
14278 ///
14279 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14280 /// additional enum variants at any time. Adding new variants is not considered
14281 /// a breaking change. Applications should write their code in anticipation of:
14282 ///
14283 /// - New values appearing in future releases of the client library, **and**
14284 /// - New values received dynamically, without application changes.
14285 ///
14286 /// Please consult the [Working with enums] section in the user guide for some
14287 /// guidelines.
14288 ///
14289 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14290 #[derive(Clone, Debug, PartialEq)]
14291 #[non_exhaustive]
14292 pub enum Reason {
14293 /// Unused default value.
14294 Unspecified,
14295 /// Masquerading not applied because destination IP is in one of configured
14296 /// non-masquerade ranges.
14297 DestinationIpInConfiguredNonMasqueradeRange,
14298 /// Masquerading not applied because destination IP is in one of default
14299 /// non-masquerade ranges.
14300 DestinationIpInDefaultNonMasqueradeRange,
14301 /// Masquerading not applied because destination is on the same Node.
14302 DestinationOnSameNode,
14303 /// Masquerading not applied because ip-masq-agent doesn't exist and default
14304 /// SNAT is disabled.
14305 DefaultSnatDisabled,
14306 /// Masquerading not applied because the packet's IP version is IPv6.
14307 NoMasqueradingForIpv6,
14308 /// Masquerading not applied because the source Pod uses the host Node's
14309 /// network namespace, including the Node's IP address.
14310 PodUsesNodeNetworkNamespace,
14311 /// Masquerading not applied because the packet is a return packet.
14312 NoMasqueradingForReturnPacket,
14313 /// If set, the enum was initialized with an unknown value.
14314 ///
14315 /// Applications can examine the value using [Reason::value] or
14316 /// [Reason::name].
14317 UnknownValue(reason::UnknownValue),
14318 }
14319
14320 #[doc(hidden)]
14321 pub mod reason {
14322 #[allow(unused_imports)]
14323 use super::*;
14324 #[derive(Clone, Debug, PartialEq)]
14325 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14326 }
14327
14328 impl Reason {
14329 /// Gets the enum value.
14330 ///
14331 /// Returns `None` if the enum contains an unknown value deserialized from
14332 /// the string representation of enums.
14333 pub fn value(&self) -> std::option::Option<i32> {
14334 match self {
14335 Self::Unspecified => std::option::Option::Some(0),
14336 Self::DestinationIpInConfiguredNonMasqueradeRange => std::option::Option::Some(1),
14337 Self::DestinationIpInDefaultNonMasqueradeRange => std::option::Option::Some(2),
14338 Self::DestinationOnSameNode => std::option::Option::Some(3),
14339 Self::DefaultSnatDisabled => std::option::Option::Some(4),
14340 Self::NoMasqueradingForIpv6 => std::option::Option::Some(5),
14341 Self::PodUsesNodeNetworkNamespace => std::option::Option::Some(6),
14342 Self::NoMasqueradingForReturnPacket => std::option::Option::Some(7),
14343 Self::UnknownValue(u) => u.0.value(),
14344 }
14345 }
14346
14347 /// Gets the enum value as a string.
14348 ///
14349 /// Returns `None` if the enum contains an unknown value deserialized from
14350 /// the integer representation of enums.
14351 pub fn name(&self) -> std::option::Option<&str> {
14352 match self {
14353 Self::Unspecified => std::option::Option::Some("REASON_UNSPECIFIED"),
14354 Self::DestinationIpInConfiguredNonMasqueradeRange => {
14355 std::option::Option::Some("DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE")
14356 }
14357 Self::DestinationIpInDefaultNonMasqueradeRange => {
14358 std::option::Option::Some("DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE")
14359 }
14360 Self::DestinationOnSameNode => {
14361 std::option::Option::Some("DESTINATION_ON_SAME_NODE")
14362 }
14363 Self::DefaultSnatDisabled => std::option::Option::Some("DEFAULT_SNAT_DISABLED"),
14364 Self::NoMasqueradingForIpv6 => {
14365 std::option::Option::Some("NO_MASQUERADING_FOR_IPV6")
14366 }
14367 Self::PodUsesNodeNetworkNamespace => {
14368 std::option::Option::Some("POD_USES_NODE_NETWORK_NAMESPACE")
14369 }
14370 Self::NoMasqueradingForReturnPacket => {
14371 std::option::Option::Some("NO_MASQUERADING_FOR_RETURN_PACKET")
14372 }
14373 Self::UnknownValue(u) => u.0.name(),
14374 }
14375 }
14376 }
14377
14378 impl std::default::Default for Reason {
14379 fn default() -> Self {
14380 use std::convert::From;
14381 Self::from(0)
14382 }
14383 }
14384
14385 impl std::fmt::Display for Reason {
14386 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14387 wkt::internal::display_enum(f, self.name(), self.value())
14388 }
14389 }
14390
14391 impl std::convert::From<i32> for Reason {
14392 fn from(value: i32) -> Self {
14393 match value {
14394 0 => Self::Unspecified,
14395 1 => Self::DestinationIpInConfiguredNonMasqueradeRange,
14396 2 => Self::DestinationIpInDefaultNonMasqueradeRange,
14397 3 => Self::DestinationOnSameNode,
14398 4 => Self::DefaultSnatDisabled,
14399 5 => Self::NoMasqueradingForIpv6,
14400 6 => Self::PodUsesNodeNetworkNamespace,
14401 7 => Self::NoMasqueradingForReturnPacket,
14402 _ => Self::UnknownValue(reason::UnknownValue(
14403 wkt::internal::UnknownEnumValue::Integer(value),
14404 )),
14405 }
14406 }
14407 }
14408
14409 impl std::convert::From<&str> for Reason {
14410 fn from(value: &str) -> Self {
14411 use std::string::ToString;
14412 match value {
14413 "REASON_UNSPECIFIED" => Self::Unspecified,
14414 "DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE" => {
14415 Self::DestinationIpInConfiguredNonMasqueradeRange
14416 }
14417 "DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE" => {
14418 Self::DestinationIpInDefaultNonMasqueradeRange
14419 }
14420 "DESTINATION_ON_SAME_NODE" => Self::DestinationOnSameNode,
14421 "DEFAULT_SNAT_DISABLED" => Self::DefaultSnatDisabled,
14422 "NO_MASQUERADING_FOR_IPV6" => Self::NoMasqueradingForIpv6,
14423 "POD_USES_NODE_NETWORK_NAMESPACE" => Self::PodUsesNodeNetworkNamespace,
14424 "NO_MASQUERADING_FOR_RETURN_PACKET" => Self::NoMasqueradingForReturnPacket,
14425 _ => Self::UnknownValue(reason::UnknownValue(
14426 wkt::internal::UnknownEnumValue::String(value.to_string()),
14427 )),
14428 }
14429 }
14430 }
14431
14432 impl serde::ser::Serialize for Reason {
14433 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14434 where
14435 S: serde::Serializer,
14436 {
14437 match self {
14438 Self::Unspecified => serializer.serialize_i32(0),
14439 Self::DestinationIpInConfiguredNonMasqueradeRange => serializer.serialize_i32(1),
14440 Self::DestinationIpInDefaultNonMasqueradeRange => serializer.serialize_i32(2),
14441 Self::DestinationOnSameNode => serializer.serialize_i32(3),
14442 Self::DefaultSnatDisabled => serializer.serialize_i32(4),
14443 Self::NoMasqueradingForIpv6 => serializer.serialize_i32(5),
14444 Self::PodUsesNodeNetworkNamespace => serializer.serialize_i32(6),
14445 Self::NoMasqueradingForReturnPacket => serializer.serialize_i32(7),
14446 Self::UnknownValue(u) => u.0.serialize(serializer),
14447 }
14448 }
14449 }
14450
14451 impl<'de> serde::de::Deserialize<'de> for Reason {
14452 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14453 where
14454 D: serde::Deserializer<'de>,
14455 {
14456 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Reason>::new(
14457 ".google.cloud.networkmanagement.v1.IpMasqueradingSkippedInfo.Reason",
14458 ))
14459 }
14460 }
14461}
14462
14463/// For display only. Metadata associated with a GKE Network Policy.
14464#[derive(Clone, Default, PartialEq)]
14465#[non_exhaustive]
14466pub struct GkeNetworkPolicyInfo {
14467 /// The name of the Network Policy.
14468 pub display_name: std::string::String,
14469
14470 /// The URI of the Network Policy.
14471 /// Format for a Network Policy in a zonal cluster:
14472 /// `projects/<project_id>/zones/<zone>/clusters/<cluster>/k8s/namespaces/<namespace>/networking.k8s.io/networkpolicies/<networkpolicy>`
14473 /// Format for a Network Policy in a regional cluster:
14474 /// `projects/<project_id>/locations/<location>/clusters/<cluster>/k8s/namespaces/<namespace>/networking.k8s.io/networkpolicies/<networkpolicy>`
14475 pub uri: std::string::String,
14476
14477 /// Possible values: INGRESS, EGRESS
14478 pub direction: std::string::String,
14479
14480 /// Possible values: ALLOW, DENY
14481 pub action: std::string::String,
14482
14483 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14484}
14485
14486impl GkeNetworkPolicyInfo {
14487 /// Creates a new default instance.
14488 pub fn new() -> Self {
14489 std::default::Default::default()
14490 }
14491
14492 /// Sets the value of [display_name][crate::model::GkeNetworkPolicyInfo::display_name].
14493 ///
14494 /// # Example
14495 /// ```ignore,no_run
14496 /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
14497 /// let x = GkeNetworkPolicyInfo::new().set_display_name("example");
14498 /// ```
14499 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14500 self.display_name = v.into();
14501 self
14502 }
14503
14504 /// Sets the value of [uri][crate::model::GkeNetworkPolicyInfo::uri].
14505 ///
14506 /// # Example
14507 /// ```ignore,no_run
14508 /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
14509 /// let x = GkeNetworkPolicyInfo::new().set_uri("example");
14510 /// ```
14511 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14512 self.uri = v.into();
14513 self
14514 }
14515
14516 /// Sets the value of [direction][crate::model::GkeNetworkPolicyInfo::direction].
14517 ///
14518 /// # Example
14519 /// ```ignore,no_run
14520 /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
14521 /// let x = GkeNetworkPolicyInfo::new().set_direction("example");
14522 /// ```
14523 pub fn set_direction<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14524 self.direction = v.into();
14525 self
14526 }
14527
14528 /// Sets the value of [action][crate::model::GkeNetworkPolicyInfo::action].
14529 ///
14530 /// # Example
14531 /// ```ignore,no_run
14532 /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicyInfo;
14533 /// let x = GkeNetworkPolicyInfo::new().set_action("example");
14534 /// ```
14535 pub fn set_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14536 self.action = v.into();
14537 self
14538 }
14539}
14540
14541impl wkt::message::Message for GkeNetworkPolicyInfo {
14542 fn typename() -> &'static str {
14543 "type.googleapis.com/google.cloud.networkmanagement.v1.GkeNetworkPolicyInfo"
14544 }
14545}
14546
14547/// For display only. Contains information about why GKE Network Policy
14548/// evaluation was skipped.
14549#[derive(Clone, Default, PartialEq)]
14550#[non_exhaustive]
14551pub struct GkeNetworkPolicySkippedInfo {
14552 /// Reason why Network Policy evaluation was skipped.
14553 pub reason: crate::model::gke_network_policy_skipped_info::Reason,
14554
14555 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14556}
14557
14558impl GkeNetworkPolicySkippedInfo {
14559 /// Creates a new default instance.
14560 pub fn new() -> Self {
14561 std::default::Default::default()
14562 }
14563
14564 /// Sets the value of [reason][crate::model::GkeNetworkPolicySkippedInfo::reason].
14565 ///
14566 /// # Example
14567 /// ```ignore,no_run
14568 /// # use google_cloud_networkmanagement_v1::model::GkeNetworkPolicySkippedInfo;
14569 /// use google_cloud_networkmanagement_v1::model::gke_network_policy_skipped_info::Reason;
14570 /// let x0 = GkeNetworkPolicySkippedInfo::new().set_reason(Reason::NetworkPolicyDisabled);
14571 /// let x1 = GkeNetworkPolicySkippedInfo::new().set_reason(Reason::IngressSourceOnSameNode);
14572 /// let x2 = GkeNetworkPolicySkippedInfo::new().set_reason(Reason::EgressFromNodeNetworkNamespacePod);
14573 /// ```
14574 pub fn set_reason<
14575 T: std::convert::Into<crate::model::gke_network_policy_skipped_info::Reason>,
14576 >(
14577 mut self,
14578 v: T,
14579 ) -> Self {
14580 self.reason = v.into();
14581 self
14582 }
14583}
14584
14585impl wkt::message::Message for GkeNetworkPolicySkippedInfo {
14586 fn typename() -> &'static str {
14587 "type.googleapis.com/google.cloud.networkmanagement.v1.GkeNetworkPolicySkippedInfo"
14588 }
14589}
14590
14591/// Defines additional types related to [GkeNetworkPolicySkippedInfo].
14592pub mod gke_network_policy_skipped_info {
14593 #[allow(unused_imports)]
14594 use super::*;
14595
14596 /// Enum for [Reason].
14597 ///
14598 /// # Working with unknown values
14599 ///
14600 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14601 /// additional enum variants at any time. Adding new variants is not considered
14602 /// a breaking change. Applications should write their code in anticipation of:
14603 ///
14604 /// - New values appearing in future releases of the client library, **and**
14605 /// - New values received dynamically, without application changes.
14606 ///
14607 /// Please consult the [Working with enums] section in the user guide for some
14608 /// guidelines.
14609 ///
14610 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14611 #[derive(Clone, Debug, PartialEq)]
14612 #[non_exhaustive]
14613 pub enum Reason {
14614 /// Unused default value.
14615 Unspecified,
14616 /// Network Policy is disabled on the cluster.
14617 NetworkPolicyDisabled,
14618 /// Ingress traffic to a Pod from a source on the same Node is always
14619 /// allowed.
14620 IngressSourceOnSameNode,
14621 /// Egress traffic from a Pod that uses the Node's network namespace is not
14622 /// subject to Network Policy.
14623 EgressFromNodeNetworkNamespacePod,
14624 /// Network Policy is not applied to response traffic. This is because GKE
14625 /// Network Policy evaluation is stateful in both GKE Dataplane V2 (eBPF) and
14626 /// legacy (iptables) implementations.
14627 NetworkPolicyNotAppliedToResponseTraffic,
14628 /// Network Policy evaluation is currently not supported for clusters with
14629 /// FQDN Network Policies enabled.
14630 NetworkPolicyAnalysisUnsupported,
14631 /// If set, the enum was initialized with an unknown value.
14632 ///
14633 /// Applications can examine the value using [Reason::value] or
14634 /// [Reason::name].
14635 UnknownValue(reason::UnknownValue),
14636 }
14637
14638 #[doc(hidden)]
14639 pub mod reason {
14640 #[allow(unused_imports)]
14641 use super::*;
14642 #[derive(Clone, Debug, PartialEq)]
14643 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14644 }
14645
14646 impl Reason {
14647 /// Gets the enum value.
14648 ///
14649 /// Returns `None` if the enum contains an unknown value deserialized from
14650 /// the string representation of enums.
14651 pub fn value(&self) -> std::option::Option<i32> {
14652 match self {
14653 Self::Unspecified => std::option::Option::Some(0),
14654 Self::NetworkPolicyDisabled => std::option::Option::Some(1),
14655 Self::IngressSourceOnSameNode => std::option::Option::Some(2),
14656 Self::EgressFromNodeNetworkNamespacePod => std::option::Option::Some(3),
14657 Self::NetworkPolicyNotAppliedToResponseTraffic => std::option::Option::Some(4),
14658 Self::NetworkPolicyAnalysisUnsupported => std::option::Option::Some(100),
14659 Self::UnknownValue(u) => u.0.value(),
14660 }
14661 }
14662
14663 /// Gets the enum value as a string.
14664 ///
14665 /// Returns `None` if the enum contains an unknown value deserialized from
14666 /// the integer representation of enums.
14667 pub fn name(&self) -> std::option::Option<&str> {
14668 match self {
14669 Self::Unspecified => std::option::Option::Some("REASON_UNSPECIFIED"),
14670 Self::NetworkPolicyDisabled => std::option::Option::Some("NETWORK_POLICY_DISABLED"),
14671 Self::IngressSourceOnSameNode => {
14672 std::option::Option::Some("INGRESS_SOURCE_ON_SAME_NODE")
14673 }
14674 Self::EgressFromNodeNetworkNamespacePod => {
14675 std::option::Option::Some("EGRESS_FROM_NODE_NETWORK_NAMESPACE_POD")
14676 }
14677 Self::NetworkPolicyNotAppliedToResponseTraffic => {
14678 std::option::Option::Some("NETWORK_POLICY_NOT_APPLIED_TO_RESPONSE_TRAFFIC")
14679 }
14680 Self::NetworkPolicyAnalysisUnsupported => {
14681 std::option::Option::Some("NETWORK_POLICY_ANALYSIS_UNSUPPORTED")
14682 }
14683 Self::UnknownValue(u) => u.0.name(),
14684 }
14685 }
14686 }
14687
14688 impl std::default::Default for Reason {
14689 fn default() -> Self {
14690 use std::convert::From;
14691 Self::from(0)
14692 }
14693 }
14694
14695 impl std::fmt::Display for Reason {
14696 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14697 wkt::internal::display_enum(f, self.name(), self.value())
14698 }
14699 }
14700
14701 impl std::convert::From<i32> for Reason {
14702 fn from(value: i32) -> Self {
14703 match value {
14704 0 => Self::Unspecified,
14705 1 => Self::NetworkPolicyDisabled,
14706 2 => Self::IngressSourceOnSameNode,
14707 3 => Self::EgressFromNodeNetworkNamespacePod,
14708 4 => Self::NetworkPolicyNotAppliedToResponseTraffic,
14709 100 => Self::NetworkPolicyAnalysisUnsupported,
14710 _ => Self::UnknownValue(reason::UnknownValue(
14711 wkt::internal::UnknownEnumValue::Integer(value),
14712 )),
14713 }
14714 }
14715 }
14716
14717 impl std::convert::From<&str> for Reason {
14718 fn from(value: &str) -> Self {
14719 use std::string::ToString;
14720 match value {
14721 "REASON_UNSPECIFIED" => Self::Unspecified,
14722 "NETWORK_POLICY_DISABLED" => Self::NetworkPolicyDisabled,
14723 "INGRESS_SOURCE_ON_SAME_NODE" => Self::IngressSourceOnSameNode,
14724 "EGRESS_FROM_NODE_NETWORK_NAMESPACE_POD" => Self::EgressFromNodeNetworkNamespacePod,
14725 "NETWORK_POLICY_NOT_APPLIED_TO_RESPONSE_TRAFFIC" => {
14726 Self::NetworkPolicyNotAppliedToResponseTraffic
14727 }
14728 "NETWORK_POLICY_ANALYSIS_UNSUPPORTED" => Self::NetworkPolicyAnalysisUnsupported,
14729 _ => Self::UnknownValue(reason::UnknownValue(
14730 wkt::internal::UnknownEnumValue::String(value.to_string()),
14731 )),
14732 }
14733 }
14734 }
14735
14736 impl serde::ser::Serialize for Reason {
14737 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14738 where
14739 S: serde::Serializer,
14740 {
14741 match self {
14742 Self::Unspecified => serializer.serialize_i32(0),
14743 Self::NetworkPolicyDisabled => serializer.serialize_i32(1),
14744 Self::IngressSourceOnSameNode => serializer.serialize_i32(2),
14745 Self::EgressFromNodeNetworkNamespacePod => serializer.serialize_i32(3),
14746 Self::NetworkPolicyNotAppliedToResponseTraffic => serializer.serialize_i32(4),
14747 Self::NetworkPolicyAnalysisUnsupported => serializer.serialize_i32(100),
14748 Self::UnknownValue(u) => u.0.serialize(serializer),
14749 }
14750 }
14751 }
14752
14753 impl<'de> serde::de::Deserialize<'de> for Reason {
14754 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14755 where
14756 D: serde::Deserializer<'de>,
14757 {
14758 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Reason>::new(
14759 ".google.cloud.networkmanagement.v1.GkeNetworkPolicySkippedInfo.Reason",
14760 ))
14761 }
14762 }
14763}
14764
14765/// For display only. Metadata associated with a Cloud SQL instance.
14766#[derive(Clone, Default, PartialEq)]
14767#[non_exhaustive]
14768pub struct CloudSQLInstanceInfo {
14769 /// Name of a Cloud SQL instance.
14770 pub display_name: std::string::String,
14771
14772 /// URI of a Cloud SQL instance.
14773 pub uri: std::string::String,
14774
14775 /// URI of a Cloud SQL instance network or empty string if the instance does
14776 /// not have one.
14777 pub network_uri: std::string::String,
14778
14779 /// Internal IP address of a Cloud SQL instance.
14780 pub internal_ip: std::string::String,
14781
14782 /// External IP address of a Cloud SQL instance.
14783 pub external_ip: std::string::String,
14784
14785 /// Region in which the Cloud SQL instance is running.
14786 pub region: std::string::String,
14787
14788 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14789}
14790
14791impl CloudSQLInstanceInfo {
14792 /// Creates a new default instance.
14793 pub fn new() -> Self {
14794 std::default::Default::default()
14795 }
14796
14797 /// Sets the value of [display_name][crate::model::CloudSQLInstanceInfo::display_name].
14798 ///
14799 /// # Example
14800 /// ```ignore,no_run
14801 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14802 /// let x = CloudSQLInstanceInfo::new().set_display_name("example");
14803 /// ```
14804 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14805 self.display_name = v.into();
14806 self
14807 }
14808
14809 /// Sets the value of [uri][crate::model::CloudSQLInstanceInfo::uri].
14810 ///
14811 /// # Example
14812 /// ```ignore,no_run
14813 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14814 /// let x = CloudSQLInstanceInfo::new().set_uri("example");
14815 /// ```
14816 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14817 self.uri = v.into();
14818 self
14819 }
14820
14821 /// Sets the value of [network_uri][crate::model::CloudSQLInstanceInfo::network_uri].
14822 ///
14823 /// # Example
14824 /// ```ignore,no_run
14825 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14826 /// let x = CloudSQLInstanceInfo::new().set_network_uri("example");
14827 /// ```
14828 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14829 self.network_uri = v.into();
14830 self
14831 }
14832
14833 /// Sets the value of [internal_ip][crate::model::CloudSQLInstanceInfo::internal_ip].
14834 ///
14835 /// # Example
14836 /// ```ignore,no_run
14837 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14838 /// let x = CloudSQLInstanceInfo::new().set_internal_ip("example");
14839 /// ```
14840 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14841 self.internal_ip = v.into();
14842 self
14843 }
14844
14845 /// Sets the value of [external_ip][crate::model::CloudSQLInstanceInfo::external_ip].
14846 ///
14847 /// # Example
14848 /// ```ignore,no_run
14849 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14850 /// let x = CloudSQLInstanceInfo::new().set_external_ip("example");
14851 /// ```
14852 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14853 self.external_ip = v.into();
14854 self
14855 }
14856
14857 /// Sets the value of [region][crate::model::CloudSQLInstanceInfo::region].
14858 ///
14859 /// # Example
14860 /// ```ignore,no_run
14861 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
14862 /// let x = CloudSQLInstanceInfo::new().set_region("example");
14863 /// ```
14864 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14865 self.region = v.into();
14866 self
14867 }
14868}
14869
14870impl wkt::message::Message for CloudSQLInstanceInfo {
14871 fn typename() -> &'static str {
14872 "type.googleapis.com/google.cloud.networkmanagement.v1.CloudSQLInstanceInfo"
14873 }
14874}
14875
14876/// For display only. Metadata associated with a Cloud Redis Instance.
14877#[derive(Clone, Default, PartialEq)]
14878#[non_exhaustive]
14879pub struct RedisInstanceInfo {
14880 /// Name of a Cloud Redis Instance.
14881 pub display_name: std::string::String,
14882
14883 /// URI of a Cloud Redis Instance.
14884 pub uri: std::string::String,
14885
14886 /// URI of a Cloud Redis Instance network.
14887 pub network_uri: std::string::String,
14888
14889 /// Primary endpoint IP address of a Cloud Redis Instance.
14890 pub primary_endpoint_ip: std::string::String,
14891
14892 /// Read endpoint IP address of a Cloud Redis Instance (if applicable).
14893 pub read_endpoint_ip: std::string::String,
14894
14895 /// Region in which the Cloud Redis Instance is defined.
14896 pub region: std::string::String,
14897
14898 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14899}
14900
14901impl RedisInstanceInfo {
14902 /// Creates a new default instance.
14903 pub fn new() -> Self {
14904 std::default::Default::default()
14905 }
14906
14907 /// Sets the value of [display_name][crate::model::RedisInstanceInfo::display_name].
14908 ///
14909 /// # Example
14910 /// ```ignore,no_run
14911 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14912 /// let x = RedisInstanceInfo::new().set_display_name("example");
14913 /// ```
14914 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14915 self.display_name = v.into();
14916 self
14917 }
14918
14919 /// Sets the value of [uri][crate::model::RedisInstanceInfo::uri].
14920 ///
14921 /// # Example
14922 /// ```ignore,no_run
14923 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14924 /// let x = RedisInstanceInfo::new().set_uri("example");
14925 /// ```
14926 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14927 self.uri = v.into();
14928 self
14929 }
14930
14931 /// Sets the value of [network_uri][crate::model::RedisInstanceInfo::network_uri].
14932 ///
14933 /// # Example
14934 /// ```ignore,no_run
14935 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14936 /// let x = RedisInstanceInfo::new().set_network_uri("example");
14937 /// ```
14938 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14939 self.network_uri = v.into();
14940 self
14941 }
14942
14943 /// Sets the value of [primary_endpoint_ip][crate::model::RedisInstanceInfo::primary_endpoint_ip].
14944 ///
14945 /// # Example
14946 /// ```ignore,no_run
14947 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14948 /// let x = RedisInstanceInfo::new().set_primary_endpoint_ip("example");
14949 /// ```
14950 pub fn set_primary_endpoint_ip<T: std::convert::Into<std::string::String>>(
14951 mut self,
14952 v: T,
14953 ) -> Self {
14954 self.primary_endpoint_ip = v.into();
14955 self
14956 }
14957
14958 /// Sets the value of [read_endpoint_ip][crate::model::RedisInstanceInfo::read_endpoint_ip].
14959 ///
14960 /// # Example
14961 /// ```ignore,no_run
14962 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14963 /// let x = RedisInstanceInfo::new().set_read_endpoint_ip("example");
14964 /// ```
14965 pub fn set_read_endpoint_ip<T: std::convert::Into<std::string::String>>(
14966 mut self,
14967 v: T,
14968 ) -> Self {
14969 self.read_endpoint_ip = v.into();
14970 self
14971 }
14972
14973 /// Sets the value of [region][crate::model::RedisInstanceInfo::region].
14974 ///
14975 /// # Example
14976 /// ```ignore,no_run
14977 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
14978 /// let x = RedisInstanceInfo::new().set_region("example");
14979 /// ```
14980 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14981 self.region = v.into();
14982 self
14983 }
14984}
14985
14986impl wkt::message::Message for RedisInstanceInfo {
14987 fn typename() -> &'static str {
14988 "type.googleapis.com/google.cloud.networkmanagement.v1.RedisInstanceInfo"
14989 }
14990}
14991
14992/// For display only. Metadata associated with a Redis Cluster.
14993#[derive(Clone, Default, PartialEq)]
14994#[non_exhaustive]
14995pub struct RedisClusterInfo {
14996 /// Name of a Redis Cluster.
14997 pub display_name: std::string::String,
14998
14999 /// URI of a Redis Cluster in format
15000 /// "projects/{project_id}/locations/{location}/clusters/{cluster_id}"
15001 pub uri: std::string::String,
15002
15003 /// URI of the network containing the Redis Cluster endpoints in format
15004 /// "projects/{project_id}/global/networks/{network_id}".
15005 pub network_uri: std::string::String,
15006
15007 /// Discovery endpoint IP address of a Redis Cluster.
15008 pub discovery_endpoint_ip_address: std::string::String,
15009
15010 /// Secondary endpoint IP address of a Redis Cluster.
15011 pub secondary_endpoint_ip_address: std::string::String,
15012
15013 /// Name of the region in which the Redis Cluster is defined. For example,
15014 /// "us-central1".
15015 pub location: std::string::String,
15016
15017 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15018}
15019
15020impl RedisClusterInfo {
15021 /// Creates a new default instance.
15022 pub fn new() -> Self {
15023 std::default::Default::default()
15024 }
15025
15026 /// Sets the value of [display_name][crate::model::RedisClusterInfo::display_name].
15027 ///
15028 /// # Example
15029 /// ```ignore,no_run
15030 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
15031 /// let x = RedisClusterInfo::new().set_display_name("example");
15032 /// ```
15033 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15034 self.display_name = v.into();
15035 self
15036 }
15037
15038 /// Sets the value of [uri][crate::model::RedisClusterInfo::uri].
15039 ///
15040 /// # Example
15041 /// ```ignore,no_run
15042 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
15043 /// let x = RedisClusterInfo::new().set_uri("example");
15044 /// ```
15045 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15046 self.uri = v.into();
15047 self
15048 }
15049
15050 /// Sets the value of [network_uri][crate::model::RedisClusterInfo::network_uri].
15051 ///
15052 /// # Example
15053 /// ```ignore,no_run
15054 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
15055 /// let x = RedisClusterInfo::new().set_network_uri("example");
15056 /// ```
15057 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15058 self.network_uri = v.into();
15059 self
15060 }
15061
15062 /// Sets the value of [discovery_endpoint_ip_address][crate::model::RedisClusterInfo::discovery_endpoint_ip_address].
15063 ///
15064 /// # Example
15065 /// ```ignore,no_run
15066 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
15067 /// let x = RedisClusterInfo::new().set_discovery_endpoint_ip_address("example");
15068 /// ```
15069 pub fn set_discovery_endpoint_ip_address<T: std::convert::Into<std::string::String>>(
15070 mut self,
15071 v: T,
15072 ) -> Self {
15073 self.discovery_endpoint_ip_address = v.into();
15074 self
15075 }
15076
15077 /// Sets the value of [secondary_endpoint_ip_address][crate::model::RedisClusterInfo::secondary_endpoint_ip_address].
15078 ///
15079 /// # Example
15080 /// ```ignore,no_run
15081 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
15082 /// let x = RedisClusterInfo::new().set_secondary_endpoint_ip_address("example");
15083 /// ```
15084 pub fn set_secondary_endpoint_ip_address<T: std::convert::Into<std::string::String>>(
15085 mut self,
15086 v: T,
15087 ) -> Self {
15088 self.secondary_endpoint_ip_address = v.into();
15089 self
15090 }
15091
15092 /// Sets the value of [location][crate::model::RedisClusterInfo::location].
15093 ///
15094 /// # Example
15095 /// ```ignore,no_run
15096 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
15097 /// let x = RedisClusterInfo::new().set_location("example");
15098 /// ```
15099 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15100 self.location = v.into();
15101 self
15102 }
15103}
15104
15105impl wkt::message::Message for RedisClusterInfo {
15106 fn typename() -> &'static str {
15107 "type.googleapis.com/google.cloud.networkmanagement.v1.RedisClusterInfo"
15108 }
15109}
15110
15111/// For display only. Metadata associated with a Cloud Function.
15112#[derive(Clone, Default, PartialEq)]
15113#[non_exhaustive]
15114pub struct CloudFunctionInfo {
15115 /// Name of a Cloud Function.
15116 pub display_name: std::string::String,
15117
15118 /// URI of a Cloud Function.
15119 pub uri: std::string::String,
15120
15121 /// Location in which the Cloud Function is deployed.
15122 pub location: std::string::String,
15123
15124 /// Latest successfully deployed version id of the Cloud Function.
15125 pub version_id: i64,
15126
15127 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15128}
15129
15130impl CloudFunctionInfo {
15131 /// Creates a new default instance.
15132 pub fn new() -> Self {
15133 std::default::Default::default()
15134 }
15135
15136 /// Sets the value of [display_name][crate::model::CloudFunctionInfo::display_name].
15137 ///
15138 /// # Example
15139 /// ```ignore,no_run
15140 /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
15141 /// let x = CloudFunctionInfo::new().set_display_name("example");
15142 /// ```
15143 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15144 self.display_name = v.into();
15145 self
15146 }
15147
15148 /// Sets the value of [uri][crate::model::CloudFunctionInfo::uri].
15149 ///
15150 /// # Example
15151 /// ```ignore,no_run
15152 /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
15153 /// let x = CloudFunctionInfo::new().set_uri("example");
15154 /// ```
15155 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15156 self.uri = v.into();
15157 self
15158 }
15159
15160 /// Sets the value of [location][crate::model::CloudFunctionInfo::location].
15161 ///
15162 /// # Example
15163 /// ```ignore,no_run
15164 /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
15165 /// let x = CloudFunctionInfo::new().set_location("example");
15166 /// ```
15167 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15168 self.location = v.into();
15169 self
15170 }
15171
15172 /// Sets the value of [version_id][crate::model::CloudFunctionInfo::version_id].
15173 ///
15174 /// # Example
15175 /// ```ignore,no_run
15176 /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
15177 /// let x = CloudFunctionInfo::new().set_version_id(42);
15178 /// ```
15179 pub fn set_version_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15180 self.version_id = v.into();
15181 self
15182 }
15183}
15184
15185impl wkt::message::Message for CloudFunctionInfo {
15186 fn typename() -> &'static str {
15187 "type.googleapis.com/google.cloud.networkmanagement.v1.CloudFunctionInfo"
15188 }
15189}
15190
15191/// For display only. Metadata associated with a Cloud Run revision.
15192#[derive(Clone, Default, PartialEq)]
15193#[non_exhaustive]
15194pub struct CloudRunRevisionInfo {
15195 /// Name of a Cloud Run revision.
15196 pub display_name: std::string::String,
15197
15198 /// URI of a Cloud Run revision.
15199 pub uri: std::string::String,
15200
15201 /// Location in which this revision is deployed.
15202 pub location: std::string::String,
15203
15204 /// URI of Cloud Run service this revision belongs to.
15205 pub service_uri: std::string::String,
15206
15207 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15208}
15209
15210impl CloudRunRevisionInfo {
15211 /// Creates a new default instance.
15212 pub fn new() -> Self {
15213 std::default::Default::default()
15214 }
15215
15216 /// Sets the value of [display_name][crate::model::CloudRunRevisionInfo::display_name].
15217 ///
15218 /// # Example
15219 /// ```ignore,no_run
15220 /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
15221 /// let x = CloudRunRevisionInfo::new().set_display_name("example");
15222 /// ```
15223 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15224 self.display_name = v.into();
15225 self
15226 }
15227
15228 /// Sets the value of [uri][crate::model::CloudRunRevisionInfo::uri].
15229 ///
15230 /// # Example
15231 /// ```ignore,no_run
15232 /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
15233 /// let x = CloudRunRevisionInfo::new().set_uri("example");
15234 /// ```
15235 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15236 self.uri = v.into();
15237 self
15238 }
15239
15240 /// Sets the value of [location][crate::model::CloudRunRevisionInfo::location].
15241 ///
15242 /// # Example
15243 /// ```ignore,no_run
15244 /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
15245 /// let x = CloudRunRevisionInfo::new().set_location("example");
15246 /// ```
15247 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15248 self.location = v.into();
15249 self
15250 }
15251
15252 /// Sets the value of [service_uri][crate::model::CloudRunRevisionInfo::service_uri].
15253 ///
15254 /// # Example
15255 /// ```ignore,no_run
15256 /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
15257 /// let x = CloudRunRevisionInfo::new().set_service_uri("example");
15258 /// ```
15259 pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15260 self.service_uri = v.into();
15261 self
15262 }
15263}
15264
15265impl wkt::message::Message for CloudRunRevisionInfo {
15266 fn typename() -> &'static str {
15267 "type.googleapis.com/google.cloud.networkmanagement.v1.CloudRunRevisionInfo"
15268 }
15269}
15270
15271/// For display only. Metadata associated with a Cloud Run job.
15272#[derive(Clone, Default, PartialEq)]
15273#[non_exhaustive]
15274pub struct CloudRunJobInfo {
15275 /// Name of a Cloud Run job.
15276 pub display_name: std::string::String,
15277
15278 /// URI of a Cloud Run job.
15279 pub uri: std::string::String,
15280
15281 /// Location in which this job is deployed.
15282 pub location: std::string::String,
15283
15284 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15285}
15286
15287impl CloudRunJobInfo {
15288 /// Creates a new default instance.
15289 pub fn new() -> Self {
15290 std::default::Default::default()
15291 }
15292
15293 /// Sets the value of [display_name][crate::model::CloudRunJobInfo::display_name].
15294 ///
15295 /// # Example
15296 /// ```ignore,no_run
15297 /// # use google_cloud_networkmanagement_v1::model::CloudRunJobInfo;
15298 /// let x = CloudRunJobInfo::new().set_display_name("example");
15299 /// ```
15300 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15301 self.display_name = v.into();
15302 self
15303 }
15304
15305 /// Sets the value of [uri][crate::model::CloudRunJobInfo::uri].
15306 ///
15307 /// # Example
15308 /// ```ignore,no_run
15309 /// # use google_cloud_networkmanagement_v1::model::CloudRunJobInfo;
15310 /// let x = CloudRunJobInfo::new().set_uri("example");
15311 /// ```
15312 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15313 self.uri = v.into();
15314 self
15315 }
15316
15317 /// Sets the value of [location][crate::model::CloudRunJobInfo::location].
15318 ///
15319 /// # Example
15320 /// ```ignore,no_run
15321 /// # use google_cloud_networkmanagement_v1::model::CloudRunJobInfo;
15322 /// let x = CloudRunJobInfo::new().set_location("example");
15323 /// ```
15324 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15325 self.location = v.into();
15326 self
15327 }
15328}
15329
15330impl wkt::message::Message for CloudRunJobInfo {
15331 fn typename() -> &'static str {
15332 "type.googleapis.com/google.cloud.networkmanagement.v1.CloudRunJobInfo"
15333 }
15334}
15335
15336/// For display only. Metadata associated with an App Engine version.
15337#[derive(Clone, Default, PartialEq)]
15338#[non_exhaustive]
15339pub struct AppEngineVersionInfo {
15340 /// Name of an App Engine version.
15341 pub display_name: std::string::String,
15342
15343 /// URI of an App Engine version.
15344 pub uri: std::string::String,
15345
15346 /// Runtime of the App Engine version.
15347 pub runtime: std::string::String,
15348
15349 /// App Engine execution environment for a version.
15350 pub environment: std::string::String,
15351
15352 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15353}
15354
15355impl AppEngineVersionInfo {
15356 /// Creates a new default instance.
15357 pub fn new() -> Self {
15358 std::default::Default::default()
15359 }
15360
15361 /// Sets the value of [display_name][crate::model::AppEngineVersionInfo::display_name].
15362 ///
15363 /// # Example
15364 /// ```ignore,no_run
15365 /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
15366 /// let x = AppEngineVersionInfo::new().set_display_name("example");
15367 /// ```
15368 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15369 self.display_name = v.into();
15370 self
15371 }
15372
15373 /// Sets the value of [uri][crate::model::AppEngineVersionInfo::uri].
15374 ///
15375 /// # Example
15376 /// ```ignore,no_run
15377 /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
15378 /// let x = AppEngineVersionInfo::new().set_uri("example");
15379 /// ```
15380 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15381 self.uri = v.into();
15382 self
15383 }
15384
15385 /// Sets the value of [runtime][crate::model::AppEngineVersionInfo::runtime].
15386 ///
15387 /// # Example
15388 /// ```ignore,no_run
15389 /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
15390 /// let x = AppEngineVersionInfo::new().set_runtime("example");
15391 /// ```
15392 pub fn set_runtime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15393 self.runtime = v.into();
15394 self
15395 }
15396
15397 /// Sets the value of [environment][crate::model::AppEngineVersionInfo::environment].
15398 ///
15399 /// # Example
15400 /// ```ignore,no_run
15401 /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
15402 /// let x = AppEngineVersionInfo::new().set_environment("example");
15403 /// ```
15404 pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15405 self.environment = v.into();
15406 self
15407 }
15408}
15409
15410impl wkt::message::Message for AppEngineVersionInfo {
15411 fn typename() -> &'static str {
15412 "type.googleapis.com/google.cloud.networkmanagement.v1.AppEngineVersionInfo"
15413 }
15414}
15415
15416/// For display only. Metadata associated with a VPC connector.
15417#[derive(Clone, Default, PartialEq)]
15418#[non_exhaustive]
15419pub struct VpcConnectorInfo {
15420 /// Name of a VPC connector.
15421 pub display_name: std::string::String,
15422
15423 /// URI of a VPC connector.
15424 pub uri: std::string::String,
15425
15426 /// Location in which the VPC connector is deployed.
15427 pub location: std::string::String,
15428
15429 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15430}
15431
15432impl VpcConnectorInfo {
15433 /// Creates a new default instance.
15434 pub fn new() -> Self {
15435 std::default::Default::default()
15436 }
15437
15438 /// Sets the value of [display_name][crate::model::VpcConnectorInfo::display_name].
15439 ///
15440 /// # Example
15441 /// ```ignore,no_run
15442 /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
15443 /// let x = VpcConnectorInfo::new().set_display_name("example");
15444 /// ```
15445 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15446 self.display_name = v.into();
15447 self
15448 }
15449
15450 /// Sets the value of [uri][crate::model::VpcConnectorInfo::uri].
15451 ///
15452 /// # Example
15453 /// ```ignore,no_run
15454 /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
15455 /// let x = VpcConnectorInfo::new().set_uri("example");
15456 /// ```
15457 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15458 self.uri = v.into();
15459 self
15460 }
15461
15462 /// Sets the value of [location][crate::model::VpcConnectorInfo::location].
15463 ///
15464 /// # Example
15465 /// ```ignore,no_run
15466 /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
15467 /// let x = VpcConnectorInfo::new().set_location("example");
15468 /// ```
15469 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15470 self.location = v.into();
15471 self
15472 }
15473}
15474
15475impl wkt::message::Message for VpcConnectorInfo {
15476 fn typename() -> &'static str {
15477 "type.googleapis.com/google.cloud.networkmanagement.v1.VpcConnectorInfo"
15478 }
15479}
15480
15481/// For display only. Metadata associated with a serverless direct VPC egress
15482/// connection.
15483#[derive(Clone, Default, PartialEq)]
15484#[non_exhaustive]
15485pub struct DirectVpcEgressConnectionInfo {
15486 /// URI of direct access network.
15487 pub network_uri: std::string::String,
15488
15489 /// URI of direct access subnetwork.
15490 pub subnetwork_uri: std::string::String,
15491
15492 /// Selected IP range.
15493 pub selected_ip_range: std::string::String,
15494
15495 /// Selected starting IP address, from the selected IP range.
15496 pub selected_ip_address: std::string::String,
15497
15498 /// Region in which the Direct VPC egress is deployed.
15499 pub region: std::string::String,
15500
15501 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15502}
15503
15504impl DirectVpcEgressConnectionInfo {
15505 /// Creates a new default instance.
15506 pub fn new() -> Self {
15507 std::default::Default::default()
15508 }
15509
15510 /// Sets the value of [network_uri][crate::model::DirectVpcEgressConnectionInfo::network_uri].
15511 ///
15512 /// # Example
15513 /// ```ignore,no_run
15514 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15515 /// let x = DirectVpcEgressConnectionInfo::new().set_network_uri("example");
15516 /// ```
15517 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15518 self.network_uri = v.into();
15519 self
15520 }
15521
15522 /// Sets the value of [subnetwork_uri][crate::model::DirectVpcEgressConnectionInfo::subnetwork_uri].
15523 ///
15524 /// # Example
15525 /// ```ignore,no_run
15526 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15527 /// let x = DirectVpcEgressConnectionInfo::new().set_subnetwork_uri("example");
15528 /// ```
15529 pub fn set_subnetwork_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15530 self.subnetwork_uri = v.into();
15531 self
15532 }
15533
15534 /// Sets the value of [selected_ip_range][crate::model::DirectVpcEgressConnectionInfo::selected_ip_range].
15535 ///
15536 /// # Example
15537 /// ```ignore,no_run
15538 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15539 /// let x = DirectVpcEgressConnectionInfo::new().set_selected_ip_range("example");
15540 /// ```
15541 pub fn set_selected_ip_range<T: std::convert::Into<std::string::String>>(
15542 mut self,
15543 v: T,
15544 ) -> Self {
15545 self.selected_ip_range = v.into();
15546 self
15547 }
15548
15549 /// Sets the value of [selected_ip_address][crate::model::DirectVpcEgressConnectionInfo::selected_ip_address].
15550 ///
15551 /// # Example
15552 /// ```ignore,no_run
15553 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15554 /// let x = DirectVpcEgressConnectionInfo::new().set_selected_ip_address("example");
15555 /// ```
15556 pub fn set_selected_ip_address<T: std::convert::Into<std::string::String>>(
15557 mut self,
15558 v: T,
15559 ) -> Self {
15560 self.selected_ip_address = v.into();
15561 self
15562 }
15563
15564 /// Sets the value of [region][crate::model::DirectVpcEgressConnectionInfo::region].
15565 ///
15566 /// # Example
15567 /// ```ignore,no_run
15568 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
15569 /// let x = DirectVpcEgressConnectionInfo::new().set_region("example");
15570 /// ```
15571 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15572 self.region = v.into();
15573 self
15574 }
15575}
15576
15577impl wkt::message::Message for DirectVpcEgressConnectionInfo {
15578 fn typename() -> &'static str {
15579 "type.googleapis.com/google.cloud.networkmanagement.v1.DirectVpcEgressConnectionInfo"
15580 }
15581}
15582
15583/// For display only. Metadata associated with a serverless public connection.
15584#[derive(Clone, Default, PartialEq)]
15585#[non_exhaustive]
15586pub struct ServerlessExternalConnectionInfo {
15587 /// Selected starting IP address, from the Google dynamic address pool.
15588 pub selected_ip_address: std::string::String,
15589
15590 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15591}
15592
15593impl ServerlessExternalConnectionInfo {
15594 /// Creates a new default instance.
15595 pub fn new() -> Self {
15596 std::default::Default::default()
15597 }
15598
15599 /// Sets the value of [selected_ip_address][crate::model::ServerlessExternalConnectionInfo::selected_ip_address].
15600 ///
15601 /// # Example
15602 /// ```ignore,no_run
15603 /// # use google_cloud_networkmanagement_v1::model::ServerlessExternalConnectionInfo;
15604 /// let x = ServerlessExternalConnectionInfo::new().set_selected_ip_address("example");
15605 /// ```
15606 pub fn set_selected_ip_address<T: std::convert::Into<std::string::String>>(
15607 mut self,
15608 v: T,
15609 ) -> Self {
15610 self.selected_ip_address = v.into();
15611 self
15612 }
15613}
15614
15615impl wkt::message::Message for ServerlessExternalConnectionInfo {
15616 fn typename() -> &'static str {
15617 "type.googleapis.com/google.cloud.networkmanagement.v1.ServerlessExternalConnectionInfo"
15618 }
15619}
15620
15621/// For display only. Metadata associated with NAT.
15622#[derive(Clone, Default, PartialEq)]
15623#[non_exhaustive]
15624pub struct NatInfo {
15625 /// Type of NAT.
15626 pub r#type: crate::model::nat_info::Type,
15627
15628 /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
15629 pub protocol: std::string::String,
15630
15631 /// URI of the network where NAT translation takes place.
15632 pub network_uri: std::string::String,
15633
15634 /// Source IP address before NAT translation.
15635 pub old_source_ip: std::string::String,
15636
15637 /// Source IP address after NAT translation.
15638 pub new_source_ip: std::string::String,
15639
15640 /// Destination IP address before NAT translation.
15641 pub old_destination_ip: std::string::String,
15642
15643 /// Destination IP address after NAT translation.
15644 pub new_destination_ip: std::string::String,
15645
15646 /// Source port before NAT translation. Only valid when protocol is TCP or UDP.
15647 pub old_source_port: i32,
15648
15649 /// Source port after NAT translation. Only valid when protocol is TCP or UDP.
15650 pub new_source_port: i32,
15651
15652 /// Destination port before NAT translation. Only valid when protocol is TCP or
15653 /// UDP.
15654 pub old_destination_port: i32,
15655
15656 /// Destination port after NAT translation. Only valid when protocol is TCP or
15657 /// UDP.
15658 pub new_destination_port: i32,
15659
15660 /// Uri of the Cloud Router. Only valid when type is CLOUD_NAT.
15661 pub router_uri: std::string::String,
15662
15663 /// The name of Cloud NAT Gateway. Only valid when type is CLOUD_NAT.
15664 pub nat_gateway_name: std::string::String,
15665
15666 /// Type of Cloud NAT gateway. Only valid when `type` is CLOUD_NAT.
15667 pub cloud_nat_gateway_type: crate::model::nat_info::CloudNatGatewayType,
15668
15669 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15670}
15671
15672impl NatInfo {
15673 /// Creates a new default instance.
15674 pub fn new() -> Self {
15675 std::default::Default::default()
15676 }
15677
15678 /// Sets the value of [r#type][crate::model::NatInfo::type].
15679 ///
15680 /// # Example
15681 /// ```ignore,no_run
15682 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15683 /// use google_cloud_networkmanagement_v1::model::nat_info::Type;
15684 /// let x0 = NatInfo::new().set_type(Type::InternalToExternal);
15685 /// let x1 = NatInfo::new().set_type(Type::ExternalToInternal);
15686 /// let x2 = NatInfo::new().set_type(Type::CloudNat);
15687 /// ```
15688 pub fn set_type<T: std::convert::Into<crate::model::nat_info::Type>>(mut self, v: T) -> Self {
15689 self.r#type = v.into();
15690 self
15691 }
15692
15693 /// Sets the value of [protocol][crate::model::NatInfo::protocol].
15694 ///
15695 /// # Example
15696 /// ```ignore,no_run
15697 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15698 /// let x = NatInfo::new().set_protocol("example");
15699 /// ```
15700 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15701 self.protocol = v.into();
15702 self
15703 }
15704
15705 /// Sets the value of [network_uri][crate::model::NatInfo::network_uri].
15706 ///
15707 /// # Example
15708 /// ```ignore,no_run
15709 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15710 /// let x = NatInfo::new().set_network_uri("example");
15711 /// ```
15712 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15713 self.network_uri = v.into();
15714 self
15715 }
15716
15717 /// Sets the value of [old_source_ip][crate::model::NatInfo::old_source_ip].
15718 ///
15719 /// # Example
15720 /// ```ignore,no_run
15721 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15722 /// let x = NatInfo::new().set_old_source_ip("example");
15723 /// ```
15724 pub fn set_old_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15725 self.old_source_ip = v.into();
15726 self
15727 }
15728
15729 /// Sets the value of [new_source_ip][crate::model::NatInfo::new_source_ip].
15730 ///
15731 /// # Example
15732 /// ```ignore,no_run
15733 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15734 /// let x = NatInfo::new().set_new_source_ip("example");
15735 /// ```
15736 pub fn set_new_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15737 self.new_source_ip = v.into();
15738 self
15739 }
15740
15741 /// Sets the value of [old_destination_ip][crate::model::NatInfo::old_destination_ip].
15742 ///
15743 /// # Example
15744 /// ```ignore,no_run
15745 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15746 /// let x = NatInfo::new().set_old_destination_ip("example");
15747 /// ```
15748 pub fn set_old_destination_ip<T: std::convert::Into<std::string::String>>(
15749 mut self,
15750 v: T,
15751 ) -> Self {
15752 self.old_destination_ip = v.into();
15753 self
15754 }
15755
15756 /// Sets the value of [new_destination_ip][crate::model::NatInfo::new_destination_ip].
15757 ///
15758 /// # Example
15759 /// ```ignore,no_run
15760 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15761 /// let x = NatInfo::new().set_new_destination_ip("example");
15762 /// ```
15763 pub fn set_new_destination_ip<T: std::convert::Into<std::string::String>>(
15764 mut self,
15765 v: T,
15766 ) -> Self {
15767 self.new_destination_ip = v.into();
15768 self
15769 }
15770
15771 /// Sets the value of [old_source_port][crate::model::NatInfo::old_source_port].
15772 ///
15773 /// # Example
15774 /// ```ignore,no_run
15775 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15776 /// let x = NatInfo::new().set_old_source_port(42);
15777 /// ```
15778 pub fn set_old_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15779 self.old_source_port = v.into();
15780 self
15781 }
15782
15783 /// Sets the value of [new_source_port][crate::model::NatInfo::new_source_port].
15784 ///
15785 /// # Example
15786 /// ```ignore,no_run
15787 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15788 /// let x = NatInfo::new().set_new_source_port(42);
15789 /// ```
15790 pub fn set_new_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15791 self.new_source_port = v.into();
15792 self
15793 }
15794
15795 /// Sets the value of [old_destination_port][crate::model::NatInfo::old_destination_port].
15796 ///
15797 /// # Example
15798 /// ```ignore,no_run
15799 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15800 /// let x = NatInfo::new().set_old_destination_port(42);
15801 /// ```
15802 pub fn set_old_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15803 self.old_destination_port = v.into();
15804 self
15805 }
15806
15807 /// Sets the value of [new_destination_port][crate::model::NatInfo::new_destination_port].
15808 ///
15809 /// # Example
15810 /// ```ignore,no_run
15811 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15812 /// let x = NatInfo::new().set_new_destination_port(42);
15813 /// ```
15814 pub fn set_new_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15815 self.new_destination_port = v.into();
15816 self
15817 }
15818
15819 /// Sets the value of [router_uri][crate::model::NatInfo::router_uri].
15820 ///
15821 /// # Example
15822 /// ```ignore,no_run
15823 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15824 /// let x = NatInfo::new().set_router_uri("example");
15825 /// ```
15826 pub fn set_router_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15827 self.router_uri = v.into();
15828 self
15829 }
15830
15831 /// Sets the value of [nat_gateway_name][crate::model::NatInfo::nat_gateway_name].
15832 ///
15833 /// # Example
15834 /// ```ignore,no_run
15835 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15836 /// let x = NatInfo::new().set_nat_gateway_name("example");
15837 /// ```
15838 pub fn set_nat_gateway_name<T: std::convert::Into<std::string::String>>(
15839 mut self,
15840 v: T,
15841 ) -> Self {
15842 self.nat_gateway_name = v.into();
15843 self
15844 }
15845
15846 /// Sets the value of [cloud_nat_gateway_type][crate::model::NatInfo::cloud_nat_gateway_type].
15847 ///
15848 /// # Example
15849 /// ```ignore,no_run
15850 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
15851 /// use google_cloud_networkmanagement_v1::model::nat_info::CloudNatGatewayType;
15852 /// let x0 = NatInfo::new().set_cloud_nat_gateway_type(CloudNatGatewayType::PublicNat44);
15853 /// let x1 = NatInfo::new().set_cloud_nat_gateway_type(CloudNatGatewayType::PublicNat64);
15854 /// let x2 = NatInfo::new().set_cloud_nat_gateway_type(CloudNatGatewayType::PrivateNatNcc);
15855 /// ```
15856 pub fn set_cloud_nat_gateway_type<
15857 T: std::convert::Into<crate::model::nat_info::CloudNatGatewayType>,
15858 >(
15859 mut self,
15860 v: T,
15861 ) -> Self {
15862 self.cloud_nat_gateway_type = v.into();
15863 self
15864 }
15865}
15866
15867impl wkt::message::Message for NatInfo {
15868 fn typename() -> &'static str {
15869 "type.googleapis.com/google.cloud.networkmanagement.v1.NatInfo"
15870 }
15871}
15872
15873/// Defines additional types related to [NatInfo].
15874pub mod nat_info {
15875 #[allow(unused_imports)]
15876 use super::*;
15877
15878 /// Types of NAT.
15879 ///
15880 /// # Working with unknown values
15881 ///
15882 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15883 /// additional enum variants at any time. Adding new variants is not considered
15884 /// a breaking change. Applications should write their code in anticipation of:
15885 ///
15886 /// - New values appearing in future releases of the client library, **and**
15887 /// - New values received dynamically, without application changes.
15888 ///
15889 /// Please consult the [Working with enums] section in the user guide for some
15890 /// guidelines.
15891 ///
15892 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15893 #[derive(Clone, Debug, PartialEq)]
15894 #[non_exhaustive]
15895 pub enum Type {
15896 /// Type is unspecified.
15897 Unspecified,
15898 /// From Compute Engine instance's internal address to external address.
15899 InternalToExternal,
15900 /// From Compute Engine instance's external address to internal address.
15901 ExternalToInternal,
15902 /// Cloud NAT Gateway.
15903 CloudNat,
15904 /// Private service connect NAT.
15905 PrivateServiceConnect,
15906 /// GKE Pod IP address masquerading.
15907 GkePodIpMasquerading,
15908 /// If set, the enum was initialized with an unknown value.
15909 ///
15910 /// Applications can examine the value using [Type::value] or
15911 /// [Type::name].
15912 UnknownValue(r#type::UnknownValue),
15913 }
15914
15915 #[doc(hidden)]
15916 pub mod r#type {
15917 #[allow(unused_imports)]
15918 use super::*;
15919 #[derive(Clone, Debug, PartialEq)]
15920 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15921 }
15922
15923 impl Type {
15924 /// Gets the enum value.
15925 ///
15926 /// Returns `None` if the enum contains an unknown value deserialized from
15927 /// the string representation of enums.
15928 pub fn value(&self) -> std::option::Option<i32> {
15929 match self {
15930 Self::Unspecified => std::option::Option::Some(0),
15931 Self::InternalToExternal => std::option::Option::Some(1),
15932 Self::ExternalToInternal => std::option::Option::Some(2),
15933 Self::CloudNat => std::option::Option::Some(3),
15934 Self::PrivateServiceConnect => std::option::Option::Some(4),
15935 Self::GkePodIpMasquerading => std::option::Option::Some(5),
15936 Self::UnknownValue(u) => u.0.value(),
15937 }
15938 }
15939
15940 /// Gets the enum value as a string.
15941 ///
15942 /// Returns `None` if the enum contains an unknown value deserialized from
15943 /// the integer representation of enums.
15944 pub fn name(&self) -> std::option::Option<&str> {
15945 match self {
15946 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
15947 Self::InternalToExternal => std::option::Option::Some("INTERNAL_TO_EXTERNAL"),
15948 Self::ExternalToInternal => std::option::Option::Some("EXTERNAL_TO_INTERNAL"),
15949 Self::CloudNat => std::option::Option::Some("CLOUD_NAT"),
15950 Self::PrivateServiceConnect => std::option::Option::Some("PRIVATE_SERVICE_CONNECT"),
15951 Self::GkePodIpMasquerading => std::option::Option::Some("GKE_POD_IP_MASQUERADING"),
15952 Self::UnknownValue(u) => u.0.name(),
15953 }
15954 }
15955 }
15956
15957 impl std::default::Default for Type {
15958 fn default() -> Self {
15959 use std::convert::From;
15960 Self::from(0)
15961 }
15962 }
15963
15964 impl std::fmt::Display for Type {
15965 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15966 wkt::internal::display_enum(f, self.name(), self.value())
15967 }
15968 }
15969
15970 impl std::convert::From<i32> for Type {
15971 fn from(value: i32) -> Self {
15972 match value {
15973 0 => Self::Unspecified,
15974 1 => Self::InternalToExternal,
15975 2 => Self::ExternalToInternal,
15976 3 => Self::CloudNat,
15977 4 => Self::PrivateServiceConnect,
15978 5 => Self::GkePodIpMasquerading,
15979 _ => Self::UnknownValue(r#type::UnknownValue(
15980 wkt::internal::UnknownEnumValue::Integer(value),
15981 )),
15982 }
15983 }
15984 }
15985
15986 impl std::convert::From<&str> for Type {
15987 fn from(value: &str) -> Self {
15988 use std::string::ToString;
15989 match value {
15990 "TYPE_UNSPECIFIED" => Self::Unspecified,
15991 "INTERNAL_TO_EXTERNAL" => Self::InternalToExternal,
15992 "EXTERNAL_TO_INTERNAL" => Self::ExternalToInternal,
15993 "CLOUD_NAT" => Self::CloudNat,
15994 "PRIVATE_SERVICE_CONNECT" => Self::PrivateServiceConnect,
15995 "GKE_POD_IP_MASQUERADING" => Self::GkePodIpMasquerading,
15996 _ => Self::UnknownValue(r#type::UnknownValue(
15997 wkt::internal::UnknownEnumValue::String(value.to_string()),
15998 )),
15999 }
16000 }
16001 }
16002
16003 impl serde::ser::Serialize for Type {
16004 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16005 where
16006 S: serde::Serializer,
16007 {
16008 match self {
16009 Self::Unspecified => serializer.serialize_i32(0),
16010 Self::InternalToExternal => serializer.serialize_i32(1),
16011 Self::ExternalToInternal => serializer.serialize_i32(2),
16012 Self::CloudNat => serializer.serialize_i32(3),
16013 Self::PrivateServiceConnect => serializer.serialize_i32(4),
16014 Self::GkePodIpMasquerading => serializer.serialize_i32(5),
16015 Self::UnknownValue(u) => u.0.serialize(serializer),
16016 }
16017 }
16018 }
16019
16020 impl<'de> serde::de::Deserialize<'de> for Type {
16021 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16022 where
16023 D: serde::Deserializer<'de>,
16024 {
16025 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
16026 ".google.cloud.networkmanagement.v1.NatInfo.Type",
16027 ))
16028 }
16029 }
16030
16031 /// Types of Cloud NAT gateway.
16032 ///
16033 /// # Working with unknown values
16034 ///
16035 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16036 /// additional enum variants at any time. Adding new variants is not considered
16037 /// a breaking change. Applications should write their code in anticipation of:
16038 ///
16039 /// - New values appearing in future releases of the client library, **and**
16040 /// - New values received dynamically, without application changes.
16041 ///
16042 /// Please consult the [Working with enums] section in the user guide for some
16043 /// guidelines.
16044 ///
16045 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16046 #[derive(Clone, Debug, PartialEq)]
16047 #[non_exhaustive]
16048 pub enum CloudNatGatewayType {
16049 /// Type is unspecified.
16050 Unspecified,
16051 /// Public NAT gateway.
16052 PublicNat44,
16053 /// Public NAT64 gateway.
16054 PublicNat64,
16055 /// Private NAT gateway for NCC.
16056 PrivateNatNcc,
16057 /// Private NAT gateway for hybrid connectivity.
16058 PrivateNatHybrid,
16059 /// Private NAT64 gateway.
16060 PrivateNat64,
16061 /// If set, the enum was initialized with an unknown value.
16062 ///
16063 /// Applications can examine the value using [CloudNatGatewayType::value] or
16064 /// [CloudNatGatewayType::name].
16065 UnknownValue(cloud_nat_gateway_type::UnknownValue),
16066 }
16067
16068 #[doc(hidden)]
16069 pub mod cloud_nat_gateway_type {
16070 #[allow(unused_imports)]
16071 use super::*;
16072 #[derive(Clone, Debug, PartialEq)]
16073 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16074 }
16075
16076 impl CloudNatGatewayType {
16077 /// Gets the enum value.
16078 ///
16079 /// Returns `None` if the enum contains an unknown value deserialized from
16080 /// the string representation of enums.
16081 pub fn value(&self) -> std::option::Option<i32> {
16082 match self {
16083 Self::Unspecified => std::option::Option::Some(0),
16084 Self::PublicNat44 => std::option::Option::Some(1),
16085 Self::PublicNat64 => std::option::Option::Some(2),
16086 Self::PrivateNatNcc => std::option::Option::Some(3),
16087 Self::PrivateNatHybrid => std::option::Option::Some(4),
16088 Self::PrivateNat64 => std::option::Option::Some(5),
16089 Self::UnknownValue(u) => u.0.value(),
16090 }
16091 }
16092
16093 /// Gets the enum value as a string.
16094 ///
16095 /// Returns `None` if the enum contains an unknown value deserialized from
16096 /// the integer representation of enums.
16097 pub fn name(&self) -> std::option::Option<&str> {
16098 match self {
16099 Self::Unspecified => {
16100 std::option::Option::Some("CLOUD_NAT_GATEWAY_TYPE_UNSPECIFIED")
16101 }
16102 Self::PublicNat44 => std::option::Option::Some("PUBLIC_NAT44"),
16103 Self::PublicNat64 => std::option::Option::Some("PUBLIC_NAT64"),
16104 Self::PrivateNatNcc => std::option::Option::Some("PRIVATE_NAT_NCC"),
16105 Self::PrivateNatHybrid => std::option::Option::Some("PRIVATE_NAT_HYBRID"),
16106 Self::PrivateNat64 => std::option::Option::Some("PRIVATE_NAT64"),
16107 Self::UnknownValue(u) => u.0.name(),
16108 }
16109 }
16110 }
16111
16112 impl std::default::Default for CloudNatGatewayType {
16113 fn default() -> Self {
16114 use std::convert::From;
16115 Self::from(0)
16116 }
16117 }
16118
16119 impl std::fmt::Display for CloudNatGatewayType {
16120 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16121 wkt::internal::display_enum(f, self.name(), self.value())
16122 }
16123 }
16124
16125 impl std::convert::From<i32> for CloudNatGatewayType {
16126 fn from(value: i32) -> Self {
16127 match value {
16128 0 => Self::Unspecified,
16129 1 => Self::PublicNat44,
16130 2 => Self::PublicNat64,
16131 3 => Self::PrivateNatNcc,
16132 4 => Self::PrivateNatHybrid,
16133 5 => Self::PrivateNat64,
16134 _ => Self::UnknownValue(cloud_nat_gateway_type::UnknownValue(
16135 wkt::internal::UnknownEnumValue::Integer(value),
16136 )),
16137 }
16138 }
16139 }
16140
16141 impl std::convert::From<&str> for CloudNatGatewayType {
16142 fn from(value: &str) -> Self {
16143 use std::string::ToString;
16144 match value {
16145 "CLOUD_NAT_GATEWAY_TYPE_UNSPECIFIED" => Self::Unspecified,
16146 "PUBLIC_NAT44" => Self::PublicNat44,
16147 "PUBLIC_NAT64" => Self::PublicNat64,
16148 "PRIVATE_NAT_NCC" => Self::PrivateNatNcc,
16149 "PRIVATE_NAT_HYBRID" => Self::PrivateNatHybrid,
16150 "PRIVATE_NAT64" => Self::PrivateNat64,
16151 _ => Self::UnknownValue(cloud_nat_gateway_type::UnknownValue(
16152 wkt::internal::UnknownEnumValue::String(value.to_string()),
16153 )),
16154 }
16155 }
16156 }
16157
16158 impl serde::ser::Serialize for CloudNatGatewayType {
16159 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16160 where
16161 S: serde::Serializer,
16162 {
16163 match self {
16164 Self::Unspecified => serializer.serialize_i32(0),
16165 Self::PublicNat44 => serializer.serialize_i32(1),
16166 Self::PublicNat64 => serializer.serialize_i32(2),
16167 Self::PrivateNatNcc => serializer.serialize_i32(3),
16168 Self::PrivateNatHybrid => serializer.serialize_i32(4),
16169 Self::PrivateNat64 => serializer.serialize_i32(5),
16170 Self::UnknownValue(u) => u.0.serialize(serializer),
16171 }
16172 }
16173 }
16174
16175 impl<'de> serde::de::Deserialize<'de> for CloudNatGatewayType {
16176 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16177 where
16178 D: serde::Deserializer<'de>,
16179 {
16180 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudNatGatewayType>::new(
16181 ".google.cloud.networkmanagement.v1.NatInfo.CloudNatGatewayType",
16182 ))
16183 }
16184 }
16185}
16186
16187/// For display only. Metadata associated with ProxyConnection.
16188#[derive(Clone, Default, PartialEq)]
16189#[non_exhaustive]
16190pub struct ProxyConnectionInfo {
16191 /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
16192 pub protocol: std::string::String,
16193
16194 /// Source IP address of an original connection.
16195 pub old_source_ip: std::string::String,
16196
16197 /// Source IP address of a new connection.
16198 pub new_source_ip: std::string::String,
16199
16200 /// Destination IP address of an original connection
16201 pub old_destination_ip: std::string::String,
16202
16203 /// Destination IP address of a new connection.
16204 pub new_destination_ip: std::string::String,
16205
16206 /// Source port of an original connection. Only valid when protocol is TCP or
16207 /// UDP.
16208 pub old_source_port: i32,
16209
16210 /// Source port of a new connection. Only valid when protocol is TCP or UDP.
16211 pub new_source_port: i32,
16212
16213 /// Destination port of an original connection. Only valid when protocol is TCP
16214 /// or UDP.
16215 pub old_destination_port: i32,
16216
16217 /// Destination port of a new connection. Only valid when protocol is TCP or
16218 /// UDP.
16219 pub new_destination_port: i32,
16220
16221 /// Uri of proxy subnet.
16222 pub subnet_uri: std::string::String,
16223
16224 /// URI of the network where connection is proxied.
16225 pub network_uri: std::string::String,
16226
16227 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16228}
16229
16230impl ProxyConnectionInfo {
16231 /// Creates a new default instance.
16232 pub fn new() -> Self {
16233 std::default::Default::default()
16234 }
16235
16236 /// Sets the value of [protocol][crate::model::ProxyConnectionInfo::protocol].
16237 ///
16238 /// # Example
16239 /// ```ignore,no_run
16240 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
16241 /// let x = ProxyConnectionInfo::new().set_protocol("example");
16242 /// ```
16243 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16244 self.protocol = v.into();
16245 self
16246 }
16247
16248 /// Sets the value of [old_source_ip][crate::model::ProxyConnectionInfo::old_source_ip].
16249 ///
16250 /// # Example
16251 /// ```ignore,no_run
16252 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
16253 /// let x = ProxyConnectionInfo::new().set_old_source_ip("example");
16254 /// ```
16255 pub fn set_old_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16256 self.old_source_ip = v.into();
16257 self
16258 }
16259
16260 /// Sets the value of [new_source_ip][crate::model::ProxyConnectionInfo::new_source_ip].
16261 ///
16262 /// # Example
16263 /// ```ignore,no_run
16264 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
16265 /// let x = ProxyConnectionInfo::new().set_new_source_ip("example");
16266 /// ```
16267 pub fn set_new_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16268 self.new_source_ip = v.into();
16269 self
16270 }
16271
16272 /// Sets the value of [old_destination_ip][crate::model::ProxyConnectionInfo::old_destination_ip].
16273 ///
16274 /// # Example
16275 /// ```ignore,no_run
16276 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
16277 /// let x = ProxyConnectionInfo::new().set_old_destination_ip("example");
16278 /// ```
16279 pub fn set_old_destination_ip<T: std::convert::Into<std::string::String>>(
16280 mut self,
16281 v: T,
16282 ) -> Self {
16283 self.old_destination_ip = v.into();
16284 self
16285 }
16286
16287 /// Sets the value of [new_destination_ip][crate::model::ProxyConnectionInfo::new_destination_ip].
16288 ///
16289 /// # Example
16290 /// ```ignore,no_run
16291 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
16292 /// let x = ProxyConnectionInfo::new().set_new_destination_ip("example");
16293 /// ```
16294 pub fn set_new_destination_ip<T: std::convert::Into<std::string::String>>(
16295 mut self,
16296 v: T,
16297 ) -> Self {
16298 self.new_destination_ip = v.into();
16299 self
16300 }
16301
16302 /// Sets the value of [old_source_port][crate::model::ProxyConnectionInfo::old_source_port].
16303 ///
16304 /// # Example
16305 /// ```ignore,no_run
16306 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
16307 /// let x = ProxyConnectionInfo::new().set_old_source_port(42);
16308 /// ```
16309 pub fn set_old_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16310 self.old_source_port = v.into();
16311 self
16312 }
16313
16314 /// Sets the value of [new_source_port][crate::model::ProxyConnectionInfo::new_source_port].
16315 ///
16316 /// # Example
16317 /// ```ignore,no_run
16318 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
16319 /// let x = ProxyConnectionInfo::new().set_new_source_port(42);
16320 /// ```
16321 pub fn set_new_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16322 self.new_source_port = v.into();
16323 self
16324 }
16325
16326 /// Sets the value of [old_destination_port][crate::model::ProxyConnectionInfo::old_destination_port].
16327 ///
16328 /// # Example
16329 /// ```ignore,no_run
16330 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
16331 /// let x = ProxyConnectionInfo::new().set_old_destination_port(42);
16332 /// ```
16333 pub fn set_old_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16334 self.old_destination_port = v.into();
16335 self
16336 }
16337
16338 /// Sets the value of [new_destination_port][crate::model::ProxyConnectionInfo::new_destination_port].
16339 ///
16340 /// # Example
16341 /// ```ignore,no_run
16342 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
16343 /// let x = ProxyConnectionInfo::new().set_new_destination_port(42);
16344 /// ```
16345 pub fn set_new_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16346 self.new_destination_port = v.into();
16347 self
16348 }
16349
16350 /// Sets the value of [subnet_uri][crate::model::ProxyConnectionInfo::subnet_uri].
16351 ///
16352 /// # Example
16353 /// ```ignore,no_run
16354 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
16355 /// let x = ProxyConnectionInfo::new().set_subnet_uri("example");
16356 /// ```
16357 pub fn set_subnet_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16358 self.subnet_uri = v.into();
16359 self
16360 }
16361
16362 /// Sets the value of [network_uri][crate::model::ProxyConnectionInfo::network_uri].
16363 ///
16364 /// # Example
16365 /// ```ignore,no_run
16366 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
16367 /// let x = ProxyConnectionInfo::new().set_network_uri("example");
16368 /// ```
16369 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16370 self.network_uri = v.into();
16371 self
16372 }
16373}
16374
16375impl wkt::message::Message for ProxyConnectionInfo {
16376 fn typename() -> &'static str {
16377 "type.googleapis.com/google.cloud.networkmanagement.v1.ProxyConnectionInfo"
16378 }
16379}
16380
16381/// For display only. Metadata associated with the load balancer backend.
16382#[derive(Clone, Default, PartialEq)]
16383#[non_exhaustive]
16384pub struct LoadBalancerBackendInfo {
16385 /// Display name of the backend. For example, it might be an instance name for
16386 /// the instance group backends, or an IP address and port for zonal network
16387 /// endpoint group backends.
16388 pub name: std::string::String,
16389
16390 /// URI of the backend instance (if applicable). Populated for instance group
16391 /// backends, and zonal NEG backends.
16392 pub instance_uri: std::string::String,
16393
16394 /// URI of the backend service this backend belongs to (if applicable).
16395 pub backend_service_uri: std::string::String,
16396
16397 /// URI of the instance group this backend belongs to (if applicable).
16398 pub instance_group_uri: std::string::String,
16399
16400 /// URI of the network endpoint group this backend belongs to (if applicable).
16401 pub network_endpoint_group_uri: std::string::String,
16402
16403 /// URI of the backend bucket this backend targets (if applicable).
16404 pub backend_bucket_uri: std::string::String,
16405
16406 /// URI of the PSC service attachment this PSC NEG backend targets (if
16407 /// applicable).
16408 pub psc_service_attachment_uri: std::string::String,
16409
16410 /// PSC Google API target this PSC NEG backend targets (if applicable).
16411 pub psc_google_api_target: std::string::String,
16412
16413 /// URI of the health check attached to this backend (if applicable).
16414 pub health_check_uri: std::string::String,
16415
16416 /// Output only. Health check firewalls configuration state for the backend.
16417 /// This is a result of the static firewall analysis (verifying that health
16418 /// check traffic from required IP ranges to the backend is allowed or not).
16419 /// The backend might still be unhealthy even if these firewalls are
16420 /// configured. Please refer to the documentation for more information:
16421 /// <https://cloud.google.com/load-balancing/docs/firewall-rules>
16422 pub health_check_firewalls_config_state:
16423 crate::model::load_balancer_backend_info::HealthCheckFirewallsConfigState,
16424
16425 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16426}
16427
16428impl LoadBalancerBackendInfo {
16429 /// Creates a new default instance.
16430 pub fn new() -> Self {
16431 std::default::Default::default()
16432 }
16433
16434 /// Sets the value of [name][crate::model::LoadBalancerBackendInfo::name].
16435 ///
16436 /// # Example
16437 /// ```ignore,no_run
16438 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16439 /// let x = LoadBalancerBackendInfo::new().set_name("example");
16440 /// ```
16441 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16442 self.name = v.into();
16443 self
16444 }
16445
16446 /// Sets the value of [instance_uri][crate::model::LoadBalancerBackendInfo::instance_uri].
16447 ///
16448 /// # Example
16449 /// ```ignore,no_run
16450 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16451 /// let x = LoadBalancerBackendInfo::new().set_instance_uri("example");
16452 /// ```
16453 pub fn set_instance_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16454 self.instance_uri = v.into();
16455 self
16456 }
16457
16458 /// Sets the value of [backend_service_uri][crate::model::LoadBalancerBackendInfo::backend_service_uri].
16459 ///
16460 /// # Example
16461 /// ```ignore,no_run
16462 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16463 /// let x = LoadBalancerBackendInfo::new().set_backend_service_uri("example");
16464 /// ```
16465 pub fn set_backend_service_uri<T: std::convert::Into<std::string::String>>(
16466 mut self,
16467 v: T,
16468 ) -> Self {
16469 self.backend_service_uri = v.into();
16470 self
16471 }
16472
16473 /// Sets the value of [instance_group_uri][crate::model::LoadBalancerBackendInfo::instance_group_uri].
16474 ///
16475 /// # Example
16476 /// ```ignore,no_run
16477 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16478 /// let x = LoadBalancerBackendInfo::new().set_instance_group_uri("example");
16479 /// ```
16480 pub fn set_instance_group_uri<T: std::convert::Into<std::string::String>>(
16481 mut self,
16482 v: T,
16483 ) -> Self {
16484 self.instance_group_uri = v.into();
16485 self
16486 }
16487
16488 /// Sets the value of [network_endpoint_group_uri][crate::model::LoadBalancerBackendInfo::network_endpoint_group_uri].
16489 ///
16490 /// # Example
16491 /// ```ignore,no_run
16492 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16493 /// let x = LoadBalancerBackendInfo::new().set_network_endpoint_group_uri("example");
16494 /// ```
16495 pub fn set_network_endpoint_group_uri<T: std::convert::Into<std::string::String>>(
16496 mut self,
16497 v: T,
16498 ) -> Self {
16499 self.network_endpoint_group_uri = v.into();
16500 self
16501 }
16502
16503 /// Sets the value of [backend_bucket_uri][crate::model::LoadBalancerBackendInfo::backend_bucket_uri].
16504 ///
16505 /// # Example
16506 /// ```ignore,no_run
16507 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16508 /// let x = LoadBalancerBackendInfo::new().set_backend_bucket_uri("example");
16509 /// ```
16510 pub fn set_backend_bucket_uri<T: std::convert::Into<std::string::String>>(
16511 mut self,
16512 v: T,
16513 ) -> Self {
16514 self.backend_bucket_uri = v.into();
16515 self
16516 }
16517
16518 /// Sets the value of [psc_service_attachment_uri][crate::model::LoadBalancerBackendInfo::psc_service_attachment_uri].
16519 ///
16520 /// # Example
16521 /// ```ignore,no_run
16522 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16523 /// let x = LoadBalancerBackendInfo::new().set_psc_service_attachment_uri("example");
16524 /// ```
16525 pub fn set_psc_service_attachment_uri<T: std::convert::Into<std::string::String>>(
16526 mut self,
16527 v: T,
16528 ) -> Self {
16529 self.psc_service_attachment_uri = v.into();
16530 self
16531 }
16532
16533 /// Sets the value of [psc_google_api_target][crate::model::LoadBalancerBackendInfo::psc_google_api_target].
16534 ///
16535 /// # Example
16536 /// ```ignore,no_run
16537 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16538 /// let x = LoadBalancerBackendInfo::new().set_psc_google_api_target("example");
16539 /// ```
16540 pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
16541 mut self,
16542 v: T,
16543 ) -> Self {
16544 self.psc_google_api_target = v.into();
16545 self
16546 }
16547
16548 /// Sets the value of [health_check_uri][crate::model::LoadBalancerBackendInfo::health_check_uri].
16549 ///
16550 /// # Example
16551 /// ```ignore,no_run
16552 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16553 /// let x = LoadBalancerBackendInfo::new().set_health_check_uri("example");
16554 /// ```
16555 pub fn set_health_check_uri<T: std::convert::Into<std::string::String>>(
16556 mut self,
16557 v: T,
16558 ) -> Self {
16559 self.health_check_uri = v.into();
16560 self
16561 }
16562
16563 /// Sets the value of [health_check_firewalls_config_state][crate::model::LoadBalancerBackendInfo::health_check_firewalls_config_state].
16564 ///
16565 /// # Example
16566 /// ```ignore,no_run
16567 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
16568 /// use google_cloud_networkmanagement_v1::model::load_balancer_backend_info::HealthCheckFirewallsConfigState;
16569 /// let x0 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsConfigured);
16570 /// let x1 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsPartiallyConfigured);
16571 /// let x2 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsNotConfigured);
16572 /// ```
16573 pub fn set_health_check_firewalls_config_state<
16574 T: std::convert::Into<
16575 crate::model::load_balancer_backend_info::HealthCheckFirewallsConfigState,
16576 >,
16577 >(
16578 mut self,
16579 v: T,
16580 ) -> Self {
16581 self.health_check_firewalls_config_state = v.into();
16582 self
16583 }
16584}
16585
16586impl wkt::message::Message for LoadBalancerBackendInfo {
16587 fn typename() -> &'static str {
16588 "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerBackendInfo"
16589 }
16590}
16591
16592/// Defines additional types related to [LoadBalancerBackendInfo].
16593pub mod load_balancer_backend_info {
16594 #[allow(unused_imports)]
16595 use super::*;
16596
16597 /// Health check firewalls configuration state enum.
16598 ///
16599 /// # Working with unknown values
16600 ///
16601 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16602 /// additional enum variants at any time. Adding new variants is not considered
16603 /// a breaking change. Applications should write their code in anticipation of:
16604 ///
16605 /// - New values appearing in future releases of the client library, **and**
16606 /// - New values received dynamically, without application changes.
16607 ///
16608 /// Please consult the [Working with enums] section in the user guide for some
16609 /// guidelines.
16610 ///
16611 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16612 #[derive(Clone, Debug, PartialEq)]
16613 #[non_exhaustive]
16614 pub enum HealthCheckFirewallsConfigState {
16615 /// Configuration state unspecified. It usually means that the backend has
16616 /// no health check attached, or there was an unexpected configuration error
16617 /// preventing Connectivity tests from verifying health check configuration.
16618 Unspecified,
16619 /// Firewall rules (policies) allowing health check traffic from all required
16620 /// IP ranges to the backend are configured.
16621 FirewallsConfigured,
16622 /// Firewall rules (policies) allow health check traffic only from a part of
16623 /// required IP ranges.
16624 FirewallsPartiallyConfigured,
16625 /// Firewall rules (policies) deny health check traffic from all required
16626 /// IP ranges to the backend.
16627 FirewallsNotConfigured,
16628 /// The network contains firewall rules of unsupported types, so Connectivity
16629 /// tests were not able to verify health check configuration status. Please
16630 /// refer to the documentation for the list of unsupported configurations:
16631 /// <https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/concepts/overview#unsupported-configs>
16632 FirewallsUnsupported,
16633 /// If set, the enum was initialized with an unknown value.
16634 ///
16635 /// Applications can examine the value using [HealthCheckFirewallsConfigState::value] or
16636 /// [HealthCheckFirewallsConfigState::name].
16637 UnknownValue(health_check_firewalls_config_state::UnknownValue),
16638 }
16639
16640 #[doc(hidden)]
16641 pub mod health_check_firewalls_config_state {
16642 #[allow(unused_imports)]
16643 use super::*;
16644 #[derive(Clone, Debug, PartialEq)]
16645 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16646 }
16647
16648 impl HealthCheckFirewallsConfigState {
16649 /// Gets the enum value.
16650 ///
16651 /// Returns `None` if the enum contains an unknown value deserialized from
16652 /// the string representation of enums.
16653 pub fn value(&self) -> std::option::Option<i32> {
16654 match self {
16655 Self::Unspecified => std::option::Option::Some(0),
16656 Self::FirewallsConfigured => std::option::Option::Some(1),
16657 Self::FirewallsPartiallyConfigured => std::option::Option::Some(2),
16658 Self::FirewallsNotConfigured => std::option::Option::Some(3),
16659 Self::FirewallsUnsupported => std::option::Option::Some(4),
16660 Self::UnknownValue(u) => u.0.value(),
16661 }
16662 }
16663
16664 /// Gets the enum value as a string.
16665 ///
16666 /// Returns `None` if the enum contains an unknown value deserialized from
16667 /// the integer representation of enums.
16668 pub fn name(&self) -> std::option::Option<&str> {
16669 match self {
16670 Self::Unspecified => {
16671 std::option::Option::Some("HEALTH_CHECK_FIREWALLS_CONFIG_STATE_UNSPECIFIED")
16672 }
16673 Self::FirewallsConfigured => std::option::Option::Some("FIREWALLS_CONFIGURED"),
16674 Self::FirewallsPartiallyConfigured => {
16675 std::option::Option::Some("FIREWALLS_PARTIALLY_CONFIGURED")
16676 }
16677 Self::FirewallsNotConfigured => {
16678 std::option::Option::Some("FIREWALLS_NOT_CONFIGURED")
16679 }
16680 Self::FirewallsUnsupported => std::option::Option::Some("FIREWALLS_UNSUPPORTED"),
16681 Self::UnknownValue(u) => u.0.name(),
16682 }
16683 }
16684 }
16685
16686 impl std::default::Default for HealthCheckFirewallsConfigState {
16687 fn default() -> Self {
16688 use std::convert::From;
16689 Self::from(0)
16690 }
16691 }
16692
16693 impl std::fmt::Display for HealthCheckFirewallsConfigState {
16694 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16695 wkt::internal::display_enum(f, self.name(), self.value())
16696 }
16697 }
16698
16699 impl std::convert::From<i32> for HealthCheckFirewallsConfigState {
16700 fn from(value: i32) -> Self {
16701 match value {
16702 0 => Self::Unspecified,
16703 1 => Self::FirewallsConfigured,
16704 2 => Self::FirewallsPartiallyConfigured,
16705 3 => Self::FirewallsNotConfigured,
16706 4 => Self::FirewallsUnsupported,
16707 _ => Self::UnknownValue(health_check_firewalls_config_state::UnknownValue(
16708 wkt::internal::UnknownEnumValue::Integer(value),
16709 )),
16710 }
16711 }
16712 }
16713
16714 impl std::convert::From<&str> for HealthCheckFirewallsConfigState {
16715 fn from(value: &str) -> Self {
16716 use std::string::ToString;
16717 match value {
16718 "HEALTH_CHECK_FIREWALLS_CONFIG_STATE_UNSPECIFIED" => Self::Unspecified,
16719 "FIREWALLS_CONFIGURED" => Self::FirewallsConfigured,
16720 "FIREWALLS_PARTIALLY_CONFIGURED" => Self::FirewallsPartiallyConfigured,
16721 "FIREWALLS_NOT_CONFIGURED" => Self::FirewallsNotConfigured,
16722 "FIREWALLS_UNSUPPORTED" => Self::FirewallsUnsupported,
16723 _ => Self::UnknownValue(health_check_firewalls_config_state::UnknownValue(
16724 wkt::internal::UnknownEnumValue::String(value.to_string()),
16725 )),
16726 }
16727 }
16728 }
16729
16730 impl serde::ser::Serialize for HealthCheckFirewallsConfigState {
16731 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16732 where
16733 S: serde::Serializer,
16734 {
16735 match self {
16736 Self::Unspecified => serializer.serialize_i32(0),
16737 Self::FirewallsConfigured => serializer.serialize_i32(1),
16738 Self::FirewallsPartiallyConfigured => serializer.serialize_i32(2),
16739 Self::FirewallsNotConfigured => serializer.serialize_i32(3),
16740 Self::FirewallsUnsupported => serializer.serialize_i32(4),
16741 Self::UnknownValue(u) => u.0.serialize(serializer),
16742 }
16743 }
16744 }
16745
16746 impl<'de> serde::de::Deserialize<'de> for HealthCheckFirewallsConfigState {
16747 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16748 where
16749 D: serde::Deserializer<'de>,
16750 {
16751 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HealthCheckFirewallsConfigState>::new(
16752 ".google.cloud.networkmanagement.v1.LoadBalancerBackendInfo.HealthCheckFirewallsConfigState"))
16753 }
16754 }
16755}
16756
16757/// For display only. Metadata associated with Storage Bucket.
16758#[derive(Clone, Default, PartialEq)]
16759#[non_exhaustive]
16760pub struct StorageBucketInfo {
16761 /// Cloud Storage Bucket name.
16762 pub bucket: std::string::String,
16763
16764 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16765}
16766
16767impl StorageBucketInfo {
16768 /// Creates a new default instance.
16769 pub fn new() -> Self {
16770 std::default::Default::default()
16771 }
16772
16773 /// Sets the value of [bucket][crate::model::StorageBucketInfo::bucket].
16774 ///
16775 /// # Example
16776 /// ```ignore,no_run
16777 /// # use google_cloud_networkmanagement_v1::model::StorageBucketInfo;
16778 /// let x = StorageBucketInfo::new().set_bucket("example");
16779 /// ```
16780 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16781 self.bucket = v.into();
16782 self
16783 }
16784}
16785
16786impl wkt::message::Message for StorageBucketInfo {
16787 fn typename() -> &'static str {
16788 "type.googleapis.com/google.cloud.networkmanagement.v1.StorageBucketInfo"
16789 }
16790}
16791
16792/// For display only. Metadata associated with the serverless network endpoint
16793/// group backend.
16794#[derive(Clone, Default, PartialEq)]
16795#[non_exhaustive]
16796pub struct ServerlessNegInfo {
16797 /// URI of the serverless network endpoint group.
16798 pub neg_uri: std::string::String,
16799
16800 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16801}
16802
16803impl ServerlessNegInfo {
16804 /// Creates a new default instance.
16805 pub fn new() -> Self {
16806 std::default::Default::default()
16807 }
16808
16809 /// Sets the value of [neg_uri][crate::model::ServerlessNegInfo::neg_uri].
16810 ///
16811 /// # Example
16812 /// ```ignore,no_run
16813 /// # use google_cloud_networkmanagement_v1::model::ServerlessNegInfo;
16814 /// let x = ServerlessNegInfo::new().set_neg_uri("example");
16815 /// ```
16816 pub fn set_neg_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16817 self.neg_uri = v.into();
16818 self
16819 }
16820}
16821
16822impl wkt::message::Message for ServerlessNegInfo {
16823 fn typename() -> &'static str {
16824 "type.googleapis.com/google.cloud.networkmanagement.v1.ServerlessNegInfo"
16825 }
16826}
16827
16828/// For display only. Metadata associated with a layer 7 packet inspection by the
16829/// firewall.
16830#[derive(Clone, Default, PartialEq)]
16831#[non_exhaustive]
16832pub struct NgfwPacketInspectionInfo {
16833 /// URI of the security profile group associated with this firewall packet
16834 /// inspection.
16835 pub security_profile_group_uri: std::string::String,
16836
16837 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16838}
16839
16840impl NgfwPacketInspectionInfo {
16841 /// Creates a new default instance.
16842 pub fn new() -> Self {
16843 std::default::Default::default()
16844 }
16845
16846 /// Sets the value of [security_profile_group_uri][crate::model::NgfwPacketInspectionInfo::security_profile_group_uri].
16847 ///
16848 /// # Example
16849 /// ```ignore,no_run
16850 /// # use google_cloud_networkmanagement_v1::model::NgfwPacketInspectionInfo;
16851 /// let x = NgfwPacketInspectionInfo::new().set_security_profile_group_uri("example");
16852 /// ```
16853 pub fn set_security_profile_group_uri<T: std::convert::Into<std::string::String>>(
16854 mut self,
16855 v: T,
16856 ) -> Self {
16857 self.security_profile_group_uri = v.into();
16858 self
16859 }
16860}
16861
16862impl wkt::message::Message for NgfwPacketInspectionInfo {
16863 fn typename() -> &'static str {
16864 "type.googleapis.com/google.cloud.networkmanagement.v1.NgfwPacketInspectionInfo"
16865 }
16866}
16867
16868/// For display only. Metadata associated with a Private Connection.
16869#[derive(Clone, Default, PartialEq)]
16870#[non_exhaustive]
16871pub struct PrivateConnectionInfo {
16872 /// URI of the Private Connection in format
16873 /// "projects/{project_id}/locations/{location}/privateConnections/{private_connection_id}"
16874 pub uri: std::string::String,
16875
16876 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16877}
16878
16879impl PrivateConnectionInfo {
16880 /// Creates a new default instance.
16881 pub fn new() -> Self {
16882 std::default::Default::default()
16883 }
16884
16885 /// Sets the value of [uri][crate::model::PrivateConnectionInfo::uri].
16886 ///
16887 /// # Example
16888 /// ```ignore,no_run
16889 /// # use google_cloud_networkmanagement_v1::model::PrivateConnectionInfo;
16890 /// let x = PrivateConnectionInfo::new().set_uri("example");
16891 /// ```
16892 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16893 self.uri = v.into();
16894 self
16895 }
16896}
16897
16898impl wkt::message::Message for PrivateConnectionInfo {
16899 fn typename() -> &'static str {
16900 "type.googleapis.com/google.cloud.networkmanagement.v1.PrivateConnectionInfo"
16901 }
16902}
16903
16904/// Request for the `ListVpcFlowLogsConfigs` method.
16905#[derive(Clone, Default, PartialEq)]
16906#[non_exhaustive]
16907pub struct ListVpcFlowLogsConfigsRequest {
16908 /// Required. The parent resource of the VpcFlowLogsConfig,
16909 /// in one of the following formats:
16910 ///
16911 /// - For project-level resources: `projects/{project_id}/locations/global`
16912 ///
16913 /// - For organization-level resources:
16914 /// `organizations/{organization_id}/locations/global`
16915 ///
16916 pub parent: std::string::String,
16917
16918 /// Optional. Number of `VpcFlowLogsConfigs` to return.
16919 pub page_size: i32,
16920
16921 /// Optional. Page token from an earlier query, as returned in
16922 /// `next_page_token`.
16923 pub page_token: std::string::String,
16924
16925 /// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
16926 /// A filter expression must use the supported [CEL logic operators]
16927 /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
16928 pub filter: std::string::String,
16929
16930 /// Optional. Field to use to sort the list.
16931 pub order_by: std::string::String,
16932
16933 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16934}
16935
16936impl ListVpcFlowLogsConfigsRequest {
16937 /// Creates a new default instance.
16938 pub fn new() -> Self {
16939 std::default::Default::default()
16940 }
16941
16942 /// Sets the value of [parent][crate::model::ListVpcFlowLogsConfigsRequest::parent].
16943 ///
16944 /// # Example
16945 /// ```ignore,no_run
16946 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16947 /// # let project_id = "project_id";
16948 /// # let location_id = "location_id";
16949 /// let x = ListVpcFlowLogsConfigsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
16950 /// ```
16951 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16952 self.parent = v.into();
16953 self
16954 }
16955
16956 /// Sets the value of [page_size][crate::model::ListVpcFlowLogsConfigsRequest::page_size].
16957 ///
16958 /// # Example
16959 /// ```ignore,no_run
16960 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16961 /// let x = ListVpcFlowLogsConfigsRequest::new().set_page_size(42);
16962 /// ```
16963 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16964 self.page_size = v.into();
16965 self
16966 }
16967
16968 /// Sets the value of [page_token][crate::model::ListVpcFlowLogsConfigsRequest::page_token].
16969 ///
16970 /// # Example
16971 /// ```ignore,no_run
16972 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16973 /// let x = ListVpcFlowLogsConfigsRequest::new().set_page_token("example");
16974 /// ```
16975 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16976 self.page_token = v.into();
16977 self
16978 }
16979
16980 /// Sets the value of [filter][crate::model::ListVpcFlowLogsConfigsRequest::filter].
16981 ///
16982 /// # Example
16983 /// ```ignore,no_run
16984 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16985 /// let x = ListVpcFlowLogsConfigsRequest::new().set_filter("example");
16986 /// ```
16987 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16988 self.filter = v.into();
16989 self
16990 }
16991
16992 /// Sets the value of [order_by][crate::model::ListVpcFlowLogsConfigsRequest::order_by].
16993 ///
16994 /// # Example
16995 /// ```ignore,no_run
16996 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
16997 /// let x = ListVpcFlowLogsConfigsRequest::new().set_order_by("example");
16998 /// ```
16999 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17000 self.order_by = v.into();
17001 self
17002 }
17003}
17004
17005impl wkt::message::Message for ListVpcFlowLogsConfigsRequest {
17006 fn typename() -> &'static str {
17007 "type.googleapis.com/google.cloud.networkmanagement.v1.ListVpcFlowLogsConfigsRequest"
17008 }
17009}
17010
17011/// Response for the `ListVpcFlowLogsConfigs` method.
17012#[derive(Clone, Default, PartialEq)]
17013#[non_exhaustive]
17014pub struct ListVpcFlowLogsConfigsResponse {
17015 /// List of VPC Flow Log configurations.
17016 pub vpc_flow_logs_configs: std::vec::Vec<crate::model::VpcFlowLogsConfig>,
17017
17018 /// Page token to fetch the next set of configurations.
17019 pub next_page_token: std::string::String,
17020
17021 /// Locations that could not be reached (when querying all locations with `-`).
17022 pub unreachable: std::vec::Vec<std::string::String>,
17023
17024 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17025}
17026
17027impl ListVpcFlowLogsConfigsResponse {
17028 /// Creates a new default instance.
17029 pub fn new() -> Self {
17030 std::default::Default::default()
17031 }
17032
17033 /// Sets the value of [vpc_flow_logs_configs][crate::model::ListVpcFlowLogsConfigsResponse::vpc_flow_logs_configs].
17034 ///
17035 /// # Example
17036 /// ```ignore,no_run
17037 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
17038 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17039 /// let x = ListVpcFlowLogsConfigsResponse::new()
17040 /// .set_vpc_flow_logs_configs([
17041 /// VpcFlowLogsConfig::default()/* use setters */,
17042 /// VpcFlowLogsConfig::default()/* use (different) setters */,
17043 /// ]);
17044 /// ```
17045 pub fn set_vpc_flow_logs_configs<T, V>(mut self, v: T) -> Self
17046 where
17047 T: std::iter::IntoIterator<Item = V>,
17048 V: std::convert::Into<crate::model::VpcFlowLogsConfig>,
17049 {
17050 use std::iter::Iterator;
17051 self.vpc_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
17052 self
17053 }
17054
17055 /// Sets the value of [next_page_token][crate::model::ListVpcFlowLogsConfigsResponse::next_page_token].
17056 ///
17057 /// # Example
17058 /// ```ignore,no_run
17059 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
17060 /// let x = ListVpcFlowLogsConfigsResponse::new().set_next_page_token("example");
17061 /// ```
17062 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17063 self.next_page_token = v.into();
17064 self
17065 }
17066
17067 /// Sets the value of [unreachable][crate::model::ListVpcFlowLogsConfigsResponse::unreachable].
17068 ///
17069 /// # Example
17070 /// ```ignore,no_run
17071 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
17072 /// let x = ListVpcFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
17073 /// ```
17074 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17075 where
17076 T: std::iter::IntoIterator<Item = V>,
17077 V: std::convert::Into<std::string::String>,
17078 {
17079 use std::iter::Iterator;
17080 self.unreachable = v.into_iter().map(|i| i.into()).collect();
17081 self
17082 }
17083}
17084
17085impl wkt::message::Message for ListVpcFlowLogsConfigsResponse {
17086 fn typename() -> &'static str {
17087 "type.googleapis.com/google.cloud.networkmanagement.v1.ListVpcFlowLogsConfigsResponse"
17088 }
17089}
17090
17091#[doc(hidden)]
17092impl google_cloud_gax::paginator::internal::PageableResponse for ListVpcFlowLogsConfigsResponse {
17093 type PageItem = crate::model::VpcFlowLogsConfig;
17094
17095 fn items(self) -> std::vec::Vec<Self::PageItem> {
17096 self.vpc_flow_logs_configs
17097 }
17098
17099 fn next_page_token(&self) -> std::string::String {
17100 use std::clone::Clone;
17101 self.next_page_token.clone()
17102 }
17103}
17104
17105/// Request for the `GetVpcFlowLogsConfig` method.
17106#[derive(Clone, Default, PartialEq)]
17107#[non_exhaustive]
17108pub struct GetVpcFlowLogsConfigRequest {
17109 /// Required. The resource name of the VpcFlowLogsConfig,
17110 /// in one of the following formats:
17111 ///
17112 /// - For project-level resources:
17113 /// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
17114 ///
17115 /// - For organization-level resources:
17116 /// `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
17117 ///
17118 pub name: std::string::String,
17119
17120 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17121}
17122
17123impl GetVpcFlowLogsConfigRequest {
17124 /// Creates a new default instance.
17125 pub fn new() -> Self {
17126 std::default::Default::default()
17127 }
17128
17129 /// Sets the value of [name][crate::model::GetVpcFlowLogsConfigRequest::name].
17130 ///
17131 /// # Example
17132 /// ```ignore,no_run
17133 /// # use google_cloud_networkmanagement_v1::model::GetVpcFlowLogsConfigRequest;
17134 /// # let project_id = "project_id";
17135 /// # let location_id = "location_id";
17136 /// # let vpc_flow_logs_config_id = "vpc_flow_logs_config_id";
17137 /// let x = GetVpcFlowLogsConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}"));
17138 /// ```
17139 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17140 self.name = v.into();
17141 self
17142 }
17143}
17144
17145impl wkt::message::Message for GetVpcFlowLogsConfigRequest {
17146 fn typename() -> &'static str {
17147 "type.googleapis.com/google.cloud.networkmanagement.v1.GetVpcFlowLogsConfigRequest"
17148 }
17149}
17150
17151/// Request for the `CreateVpcFlowLogsConfig` method.
17152#[derive(Clone, Default, PartialEq)]
17153#[non_exhaustive]
17154pub struct CreateVpcFlowLogsConfigRequest {
17155 /// Required. The parent resource of the VpcFlowLogsConfig to create,
17156 /// in one of the following formats:
17157 ///
17158 /// - For project-level resources: `projects/{project_id}/locations/global`
17159 ///
17160 /// - For organization-level resources:
17161 /// `organizations/{organization_id}/locations/global`
17162 ///
17163 pub parent: std::string::String,
17164
17165 /// Required. ID of the `VpcFlowLogsConfig`.
17166 pub vpc_flow_logs_config_id: std::string::String,
17167
17168 /// Required. A `VpcFlowLogsConfig` resource
17169 pub vpc_flow_logs_config: std::option::Option<crate::model::VpcFlowLogsConfig>,
17170
17171 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17172}
17173
17174impl CreateVpcFlowLogsConfigRequest {
17175 /// Creates a new default instance.
17176 pub fn new() -> Self {
17177 std::default::Default::default()
17178 }
17179
17180 /// Sets the value of [parent][crate::model::CreateVpcFlowLogsConfigRequest::parent].
17181 ///
17182 /// # Example
17183 /// ```ignore,no_run
17184 /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
17185 /// # let project_id = "project_id";
17186 /// # let location_id = "location_id";
17187 /// let x = CreateVpcFlowLogsConfigRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
17188 /// ```
17189 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17190 self.parent = v.into();
17191 self
17192 }
17193
17194 /// Sets the value of [vpc_flow_logs_config_id][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config_id].
17195 ///
17196 /// # Example
17197 /// ```ignore,no_run
17198 /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
17199 /// # let project_id = "project_id";
17200 /// # let location_id = "location_id";
17201 /// # let vpc_flow_logs_config_id = "vpc_flow_logs_config_id";
17202 /// let x = CreateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config_id(format!("projects/{project_id}/locations/{location_id}/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}"));
17203 /// ```
17204 pub fn set_vpc_flow_logs_config_id<T: std::convert::Into<std::string::String>>(
17205 mut self,
17206 v: T,
17207 ) -> Self {
17208 self.vpc_flow_logs_config_id = v.into();
17209 self
17210 }
17211
17212 /// Sets the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
17213 ///
17214 /// # Example
17215 /// ```ignore,no_run
17216 /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
17217 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17218 /// let x = CreateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config(VpcFlowLogsConfig::default()/* use setters */);
17219 /// ```
17220 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
17221 where
17222 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
17223 {
17224 self.vpc_flow_logs_config = std::option::Option::Some(v.into());
17225 self
17226 }
17227
17228 /// Sets or clears the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
17229 ///
17230 /// # Example
17231 /// ```ignore,no_run
17232 /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
17233 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17234 /// let x = CreateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(Some(VpcFlowLogsConfig::default()/* use setters */));
17235 /// let x = CreateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(None::<VpcFlowLogsConfig>);
17236 /// ```
17237 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
17238 where
17239 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
17240 {
17241 self.vpc_flow_logs_config = v.map(|x| x.into());
17242 self
17243 }
17244}
17245
17246impl wkt::message::Message for CreateVpcFlowLogsConfigRequest {
17247 fn typename() -> &'static str {
17248 "type.googleapis.com/google.cloud.networkmanagement.v1.CreateVpcFlowLogsConfigRequest"
17249 }
17250}
17251
17252/// Request for the `UpdateVpcFlowLogsConfig` method.
17253#[derive(Clone, Default, PartialEq)]
17254#[non_exhaustive]
17255pub struct UpdateVpcFlowLogsConfigRequest {
17256 /// Required. Mask of fields to update. At least one path must be supplied in
17257 /// this field.
17258 /// For example, to change the state of the configuration to ENABLED, specify
17259 /// `update_mask` = `"state"`, and the `vpc_flow_logs_config` would be:
17260 /// `vpc_flow_logs_config = {
17261 /// name =
17262 /// "projects/my-project/locations/global/vpcFlowLogsConfigs/my-config"
17263 /// state = "ENABLED" }`
17264 pub update_mask: std::option::Option<wkt::FieldMask>,
17265
17266 /// Required. Only fields specified in update_mask are updated.
17267 pub vpc_flow_logs_config: std::option::Option<crate::model::VpcFlowLogsConfig>,
17268
17269 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17270}
17271
17272impl UpdateVpcFlowLogsConfigRequest {
17273 /// Creates a new default instance.
17274 pub fn new() -> Self {
17275 std::default::Default::default()
17276 }
17277
17278 /// Sets the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
17279 ///
17280 /// # Example
17281 /// ```ignore,no_run
17282 /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
17283 /// use wkt::FieldMask;
17284 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
17285 /// ```
17286 pub fn set_update_mask<T>(mut self, v: T) -> Self
17287 where
17288 T: std::convert::Into<wkt::FieldMask>,
17289 {
17290 self.update_mask = std::option::Option::Some(v.into());
17291 self
17292 }
17293
17294 /// Sets or clears the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
17295 ///
17296 /// # Example
17297 /// ```ignore,no_run
17298 /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
17299 /// use wkt::FieldMask;
17300 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
17301 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
17302 /// ```
17303 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17304 where
17305 T: std::convert::Into<wkt::FieldMask>,
17306 {
17307 self.update_mask = v.map(|x| x.into());
17308 self
17309 }
17310
17311 /// Sets the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
17312 ///
17313 /// # Example
17314 /// ```ignore,no_run
17315 /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
17316 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17317 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config(VpcFlowLogsConfig::default()/* use setters */);
17318 /// ```
17319 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
17320 where
17321 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
17322 {
17323 self.vpc_flow_logs_config = std::option::Option::Some(v.into());
17324 self
17325 }
17326
17327 /// Sets or clears the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
17328 ///
17329 /// # Example
17330 /// ```ignore,no_run
17331 /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
17332 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17333 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(Some(VpcFlowLogsConfig::default()/* use setters */));
17334 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(None::<VpcFlowLogsConfig>);
17335 /// ```
17336 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
17337 where
17338 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
17339 {
17340 self.vpc_flow_logs_config = v.map(|x| x.into());
17341 self
17342 }
17343}
17344
17345impl wkt::message::Message for UpdateVpcFlowLogsConfigRequest {
17346 fn typename() -> &'static str {
17347 "type.googleapis.com/google.cloud.networkmanagement.v1.UpdateVpcFlowLogsConfigRequest"
17348 }
17349}
17350
17351/// Request for the `DeleteVpcFlowLogsConfig` method.
17352#[derive(Clone, Default, PartialEq)]
17353#[non_exhaustive]
17354pub struct DeleteVpcFlowLogsConfigRequest {
17355 /// Required. The resource name of the VpcFlowLogsConfig,
17356 /// in one of the following formats:
17357 ///
17358 /// - For a project-level resource:
17359 /// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
17360 ///
17361 /// - For an organization-level resource:
17362 /// `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
17363 ///
17364 pub name: std::string::String,
17365
17366 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17367}
17368
17369impl DeleteVpcFlowLogsConfigRequest {
17370 /// Creates a new default instance.
17371 pub fn new() -> Self {
17372 std::default::Default::default()
17373 }
17374
17375 /// Sets the value of [name][crate::model::DeleteVpcFlowLogsConfigRequest::name].
17376 ///
17377 /// # Example
17378 /// ```ignore,no_run
17379 /// # use google_cloud_networkmanagement_v1::model::DeleteVpcFlowLogsConfigRequest;
17380 /// # let project_id = "project_id";
17381 /// # let location_id = "location_id";
17382 /// # let vpc_flow_logs_config_id = "vpc_flow_logs_config_id";
17383 /// let x = DeleteVpcFlowLogsConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}"));
17384 /// ```
17385 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17386 self.name = v.into();
17387 self
17388 }
17389}
17390
17391impl wkt::message::Message for DeleteVpcFlowLogsConfigRequest {
17392 fn typename() -> &'static str {
17393 "type.googleapis.com/google.cloud.networkmanagement.v1.DeleteVpcFlowLogsConfigRequest"
17394 }
17395}
17396
17397/// Request for the `QueryOrgVpcFlowLogsConfigs` method.
17398#[derive(Clone, Default, PartialEq)]
17399#[non_exhaustive]
17400pub struct QueryOrgVpcFlowLogsConfigsRequest {
17401 /// Required. The parent resource of the VpcFlowLogsConfig, specified in
17402 /// the following format: `projects/{project_id}/locations/global`
17403 pub parent: std::string::String,
17404
17405 /// Optional. Number of `VpcFlowLogsConfigs` to return.
17406 pub page_size: i32,
17407
17408 /// Optional. Page token from an earlier query, as returned in
17409 /// `next_page_token`.
17410 pub page_token: std::string::String,
17411
17412 /// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
17413 /// A filter expression must use the supported [CEL logic operators]
17414 /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
17415 pub filter: std::string::String,
17416
17417 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17418}
17419
17420impl QueryOrgVpcFlowLogsConfigsRequest {
17421 /// Creates a new default instance.
17422 pub fn new() -> Self {
17423 std::default::Default::default()
17424 }
17425
17426 /// Sets the value of [parent][crate::model::QueryOrgVpcFlowLogsConfigsRequest::parent].
17427 ///
17428 /// # Example
17429 /// ```ignore,no_run
17430 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
17431 /// # let project_id = "project_id";
17432 /// # let location_id = "location_id";
17433 /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
17434 /// ```
17435 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17436 self.parent = v.into();
17437 self
17438 }
17439
17440 /// Sets the value of [page_size][crate::model::QueryOrgVpcFlowLogsConfigsRequest::page_size].
17441 ///
17442 /// # Example
17443 /// ```ignore,no_run
17444 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
17445 /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_page_size(42);
17446 /// ```
17447 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17448 self.page_size = v.into();
17449 self
17450 }
17451
17452 /// Sets the value of [page_token][crate::model::QueryOrgVpcFlowLogsConfigsRequest::page_token].
17453 ///
17454 /// # Example
17455 /// ```ignore,no_run
17456 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
17457 /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_page_token("example");
17458 /// ```
17459 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17460 self.page_token = v.into();
17461 self
17462 }
17463
17464 /// Sets the value of [filter][crate::model::QueryOrgVpcFlowLogsConfigsRequest::filter].
17465 ///
17466 /// # Example
17467 /// ```ignore,no_run
17468 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
17469 /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_filter("example");
17470 /// ```
17471 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17472 self.filter = v.into();
17473 self
17474 }
17475}
17476
17477impl wkt::message::Message for QueryOrgVpcFlowLogsConfigsRequest {
17478 fn typename() -> &'static str {
17479 "type.googleapis.com/google.cloud.networkmanagement.v1.QueryOrgVpcFlowLogsConfigsRequest"
17480 }
17481}
17482
17483/// Response for the `QueryVpcFlowLogsConfigs` method.
17484#[derive(Clone, Default, PartialEq)]
17485#[non_exhaustive]
17486pub struct QueryOrgVpcFlowLogsConfigsResponse {
17487 /// List of VPC Flow Log configurations.
17488 pub vpc_flow_logs_configs: std::vec::Vec<crate::model::VpcFlowLogsConfig>,
17489
17490 /// Page token to fetch the next set of configurations.
17491 pub next_page_token: std::string::String,
17492
17493 /// Locations that could not be reached (when querying all locations with `-`).
17494 pub unreachable: std::vec::Vec<std::string::String>,
17495
17496 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17497}
17498
17499impl QueryOrgVpcFlowLogsConfigsResponse {
17500 /// Creates a new default instance.
17501 pub fn new() -> Self {
17502 std::default::Default::default()
17503 }
17504
17505 /// Sets the value of [vpc_flow_logs_configs][crate::model::QueryOrgVpcFlowLogsConfigsResponse::vpc_flow_logs_configs].
17506 ///
17507 /// # Example
17508 /// ```ignore,no_run
17509 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
17510 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17511 /// let x = QueryOrgVpcFlowLogsConfigsResponse::new()
17512 /// .set_vpc_flow_logs_configs([
17513 /// VpcFlowLogsConfig::default()/* use setters */,
17514 /// VpcFlowLogsConfig::default()/* use (different) setters */,
17515 /// ]);
17516 /// ```
17517 pub fn set_vpc_flow_logs_configs<T, V>(mut self, v: T) -> Self
17518 where
17519 T: std::iter::IntoIterator<Item = V>,
17520 V: std::convert::Into<crate::model::VpcFlowLogsConfig>,
17521 {
17522 use std::iter::Iterator;
17523 self.vpc_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
17524 self
17525 }
17526
17527 /// Sets the value of [next_page_token][crate::model::QueryOrgVpcFlowLogsConfigsResponse::next_page_token].
17528 ///
17529 /// # Example
17530 /// ```ignore,no_run
17531 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
17532 /// let x = QueryOrgVpcFlowLogsConfigsResponse::new().set_next_page_token("example");
17533 /// ```
17534 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17535 self.next_page_token = v.into();
17536 self
17537 }
17538
17539 /// Sets the value of [unreachable][crate::model::QueryOrgVpcFlowLogsConfigsResponse::unreachable].
17540 ///
17541 /// # Example
17542 /// ```ignore,no_run
17543 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
17544 /// let x = QueryOrgVpcFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
17545 /// ```
17546 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17547 where
17548 T: std::iter::IntoIterator<Item = V>,
17549 V: std::convert::Into<std::string::String>,
17550 {
17551 use std::iter::Iterator;
17552 self.unreachable = v.into_iter().map(|i| i.into()).collect();
17553 self
17554 }
17555}
17556
17557impl wkt::message::Message for QueryOrgVpcFlowLogsConfigsResponse {
17558 fn typename() -> &'static str {
17559 "type.googleapis.com/google.cloud.networkmanagement.v1.QueryOrgVpcFlowLogsConfigsResponse"
17560 }
17561}
17562
17563#[doc(hidden)]
17564impl google_cloud_gax::paginator::internal::PageableResponse
17565 for QueryOrgVpcFlowLogsConfigsResponse
17566{
17567 type PageItem = crate::model::VpcFlowLogsConfig;
17568
17569 fn items(self) -> std::vec::Vec<Self::PageItem> {
17570 self.vpc_flow_logs_configs
17571 }
17572
17573 fn next_page_token(&self) -> std::string::String {
17574 use std::clone::Clone;
17575 self.next_page_token.clone()
17576 }
17577}
17578
17579/// Request for the `ShowEffectiveFlowLogsConfigs` method.
17580#[derive(Clone, Default, PartialEq)]
17581#[non_exhaustive]
17582pub struct ShowEffectiveFlowLogsConfigsRequest {
17583 /// Required. The parent resource of the VpcFlowLogsConfig, specified in
17584 /// the following format: `projects/{project_id}/locations/global`
17585 pub parent: std::string::String,
17586
17587 /// Required. The resource to get the effective VPC Flow Logs configuration
17588 /// for. The resource must belong to the same project as the parent. The
17589 /// resource must be a network, subnetwork, interconnect attachment, VPN
17590 /// tunnel, or a project.
17591 pub resource: std::string::String,
17592
17593 /// Optional. Number of `EffectiveVpcFlowLogsConfigs` to return. Default is 30.
17594 pub page_size: i32,
17595
17596 /// Optional. Page token from an earlier query, as returned in
17597 /// `next_page_token`.
17598 pub page_token: std::string::String,
17599
17600 /// Optional. Lists the `EffectiveVpcFlowLogsConfigs` that match the filter
17601 /// expression. A filter expression must use the supported [CEL logic
17602 /// operators]
17603 /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
17604 pub filter: std::string::String,
17605
17606 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17607}
17608
17609impl ShowEffectiveFlowLogsConfigsRequest {
17610 /// Creates a new default instance.
17611 pub fn new() -> Self {
17612 std::default::Default::default()
17613 }
17614
17615 /// Sets the value of [parent][crate::model::ShowEffectiveFlowLogsConfigsRequest::parent].
17616 ///
17617 /// # Example
17618 /// ```ignore,no_run
17619 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17620 /// # let project_id = "project_id";
17621 /// # let location_id = "location_id";
17622 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
17623 /// ```
17624 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17625 self.parent = v.into();
17626 self
17627 }
17628
17629 /// Sets the value of [resource][crate::model::ShowEffectiveFlowLogsConfigsRequest::resource].
17630 ///
17631 /// # Example
17632 /// ```ignore,no_run
17633 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17634 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_resource("example");
17635 /// ```
17636 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17637 self.resource = v.into();
17638 self
17639 }
17640
17641 /// Sets the value of [page_size][crate::model::ShowEffectiveFlowLogsConfigsRequest::page_size].
17642 ///
17643 /// # Example
17644 /// ```ignore,no_run
17645 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17646 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_page_size(42);
17647 /// ```
17648 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17649 self.page_size = v.into();
17650 self
17651 }
17652
17653 /// Sets the value of [page_token][crate::model::ShowEffectiveFlowLogsConfigsRequest::page_token].
17654 ///
17655 /// # Example
17656 /// ```ignore,no_run
17657 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17658 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_page_token("example");
17659 /// ```
17660 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17661 self.page_token = v.into();
17662 self
17663 }
17664
17665 /// Sets the value of [filter][crate::model::ShowEffectiveFlowLogsConfigsRequest::filter].
17666 ///
17667 /// # Example
17668 /// ```ignore,no_run
17669 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
17670 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_filter("example");
17671 /// ```
17672 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17673 self.filter = v.into();
17674 self
17675 }
17676}
17677
17678impl wkt::message::Message for ShowEffectiveFlowLogsConfigsRequest {
17679 fn typename() -> &'static str {
17680 "type.googleapis.com/google.cloud.networkmanagement.v1.ShowEffectiveFlowLogsConfigsRequest"
17681 }
17682}
17683
17684/// Response for the `ShowEffectiveFlowLogsConfigs` method.
17685#[derive(Clone, Default, PartialEq)]
17686#[non_exhaustive]
17687pub struct ShowEffectiveFlowLogsConfigsResponse {
17688 /// List of Effective Vpc Flow Logs configurations.
17689 pub effective_flow_logs_configs: std::vec::Vec<crate::model::EffectiveVpcFlowLogsConfig>,
17690
17691 /// Page token to fetch the next set of configurations.
17692 pub next_page_token: std::string::String,
17693
17694 /// Locations that could not be reached (when querying all locations with `-`).
17695 pub unreachable: std::vec::Vec<std::string::String>,
17696
17697 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17698}
17699
17700impl ShowEffectiveFlowLogsConfigsResponse {
17701 /// Creates a new default instance.
17702 pub fn new() -> Self {
17703 std::default::Default::default()
17704 }
17705
17706 /// Sets the value of [effective_flow_logs_configs][crate::model::ShowEffectiveFlowLogsConfigsResponse::effective_flow_logs_configs].
17707 ///
17708 /// # Example
17709 /// ```ignore,no_run
17710 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
17711 /// use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17712 /// let x = ShowEffectiveFlowLogsConfigsResponse::new()
17713 /// .set_effective_flow_logs_configs([
17714 /// EffectiveVpcFlowLogsConfig::default()/* use setters */,
17715 /// EffectiveVpcFlowLogsConfig::default()/* use (different) setters */,
17716 /// ]);
17717 /// ```
17718 pub fn set_effective_flow_logs_configs<T, V>(mut self, v: T) -> Self
17719 where
17720 T: std::iter::IntoIterator<Item = V>,
17721 V: std::convert::Into<crate::model::EffectiveVpcFlowLogsConfig>,
17722 {
17723 use std::iter::Iterator;
17724 self.effective_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
17725 self
17726 }
17727
17728 /// Sets the value of [next_page_token][crate::model::ShowEffectiveFlowLogsConfigsResponse::next_page_token].
17729 ///
17730 /// # Example
17731 /// ```ignore,no_run
17732 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
17733 /// let x = ShowEffectiveFlowLogsConfigsResponse::new().set_next_page_token("example");
17734 /// ```
17735 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17736 self.next_page_token = v.into();
17737 self
17738 }
17739
17740 /// Sets the value of [unreachable][crate::model::ShowEffectiveFlowLogsConfigsResponse::unreachable].
17741 ///
17742 /// # Example
17743 /// ```ignore,no_run
17744 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
17745 /// let x = ShowEffectiveFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
17746 /// ```
17747 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17748 where
17749 T: std::iter::IntoIterator<Item = V>,
17750 V: std::convert::Into<std::string::String>,
17751 {
17752 use std::iter::Iterator;
17753 self.unreachable = v.into_iter().map(|i| i.into()).collect();
17754 self
17755 }
17756}
17757
17758impl wkt::message::Message for ShowEffectiveFlowLogsConfigsResponse {
17759 fn typename() -> &'static str {
17760 "type.googleapis.com/google.cloud.networkmanagement.v1.ShowEffectiveFlowLogsConfigsResponse"
17761 }
17762}
17763
17764#[doc(hidden)]
17765impl google_cloud_gax::paginator::internal::PageableResponse
17766 for ShowEffectiveFlowLogsConfigsResponse
17767{
17768 type PageItem = crate::model::EffectiveVpcFlowLogsConfig;
17769
17770 fn items(self) -> std::vec::Vec<Self::PageItem> {
17771 self.effective_flow_logs_configs
17772 }
17773
17774 fn next_page_token(&self) -> std::string::String {
17775 use std::clone::Clone;
17776 self.next_page_token.clone()
17777 }
17778}
17779
17780/// A configuration to generate VPC Flow Logs.
17781#[derive(Clone, Default, PartialEq)]
17782#[non_exhaustive]
17783pub struct VpcFlowLogsConfig {
17784 /// Identifier. Unique name of the configuration. The name can have one of the
17785 /// following forms:
17786 ///
17787 /// - For project-level configurations:
17788 /// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
17789 ///
17790 /// - For organization-level configurations:
17791 /// `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
17792 ///
17793 pub name: std::string::String,
17794
17795 /// Optional. The user-supplied description of the VPC Flow Logs configuration.
17796 /// Maximum of 512 characters.
17797 pub description: std::option::Option<std::string::String>,
17798
17799 /// Optional. The state of the VPC Flow Log configuration. Default value is
17800 /// ENABLED. When creating a new configuration, it must be enabled. Setting
17801 /// state=DISABLED will pause the log generation for this config.
17802 pub state: std::option::Option<crate::model::vpc_flow_logs_config::State>,
17803
17804 /// Optional. The aggregation interval for the logs. Default value is
17805 /// INTERVAL_5_SEC.
17806 pub aggregation_interval:
17807 std::option::Option<crate::model::vpc_flow_logs_config::AggregationInterval>,
17808
17809 /// Optional. The value of the field must be in (0, 1]. The sampling rate of
17810 /// VPC Flow Logs where 1.0 means all collected logs are reported. Setting the
17811 /// sampling rate to 0.0 is not allowed. If you want to disable VPC Flow Logs,
17812 /// use the state field instead. Default value is 1.0.
17813 pub flow_sampling: std::option::Option<f32>,
17814
17815 /// Optional. Configures whether all, none or a subset of metadata fields
17816 /// should be added to the reported VPC flow logs. Default value is
17817 /// INCLUDE_ALL_METADATA.
17818 pub metadata: std::option::Option<crate::model::vpc_flow_logs_config::Metadata>,
17819
17820 /// Optional. Custom metadata fields to include in the reported VPC flow logs.
17821 /// Can only be specified if "metadata" was set to CUSTOM_METADATA.
17822 pub metadata_fields: std::vec::Vec<std::string::String>,
17823
17824 /// Optional. Export filter used to define which VPC Flow Logs should be
17825 /// logged.
17826 pub filter_expr: std::option::Option<std::string::String>,
17827
17828 /// Optional. Determines whether to include cross project annotations in the
17829 /// logs. This field is available only for organization configurations. If not
17830 /// specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
17831 pub cross_project_metadata:
17832 std::option::Option<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
17833
17834 /// Output only. Describes the state of the configured target resource for
17835 /// diagnostic purposes.
17836 pub target_resource_state:
17837 std::option::Option<crate::model::vpc_flow_logs_config::TargetResourceState>,
17838
17839 /// Optional. Resource labels to represent user-provided metadata.
17840 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
17841
17842 /// Output only. The time the config was created.
17843 pub create_time: std::option::Option<wkt::Timestamp>,
17844
17845 /// Output only. The time the config was updated.
17846 pub update_time: std::option::Option<wkt::Timestamp>,
17847
17848 /// Reference to the resource of the config scope. That is, the scope from
17849 /// which traffic is logged. The target resource must belong to the same
17850 /// project as the configuration.
17851 /// This field is not supported for organization level configurations.
17852 pub target_resource: std::option::Option<crate::model::vpc_flow_logs_config::TargetResource>,
17853
17854 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17855}
17856
17857impl VpcFlowLogsConfig {
17858 /// Creates a new default instance.
17859 pub fn new() -> Self {
17860 std::default::Default::default()
17861 }
17862
17863 /// Sets the value of [name][crate::model::VpcFlowLogsConfig::name].
17864 ///
17865 /// # Example
17866 /// ```ignore,no_run
17867 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17868 /// # let project_id = "project_id";
17869 /// # let location_id = "location_id";
17870 /// # let vpc_flow_logs_config_id = "vpc_flow_logs_config_id";
17871 /// let x = VpcFlowLogsConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}"));
17872 /// ```
17873 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17874 self.name = v.into();
17875 self
17876 }
17877
17878 /// Sets the value of [description][crate::model::VpcFlowLogsConfig::description].
17879 ///
17880 /// # Example
17881 /// ```ignore,no_run
17882 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17883 /// let x = VpcFlowLogsConfig::new().set_description("example");
17884 /// ```
17885 pub fn set_description<T>(mut self, v: T) -> Self
17886 where
17887 T: std::convert::Into<std::string::String>,
17888 {
17889 self.description = std::option::Option::Some(v.into());
17890 self
17891 }
17892
17893 /// Sets or clears the value of [description][crate::model::VpcFlowLogsConfig::description].
17894 ///
17895 /// # Example
17896 /// ```ignore,no_run
17897 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17898 /// let x = VpcFlowLogsConfig::new().set_or_clear_description(Some("example"));
17899 /// let x = VpcFlowLogsConfig::new().set_or_clear_description(None::<String>);
17900 /// ```
17901 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
17902 where
17903 T: std::convert::Into<std::string::String>,
17904 {
17905 self.description = v.map(|x| x.into());
17906 self
17907 }
17908
17909 /// Sets the value of [state][crate::model::VpcFlowLogsConfig::state].
17910 ///
17911 /// # Example
17912 /// ```ignore,no_run
17913 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17914 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
17915 /// let x0 = VpcFlowLogsConfig::new().set_state(State::Enabled);
17916 /// let x1 = VpcFlowLogsConfig::new().set_state(State::Disabled);
17917 /// ```
17918 pub fn set_state<T>(mut self, v: T) -> Self
17919 where
17920 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
17921 {
17922 self.state = std::option::Option::Some(v.into());
17923 self
17924 }
17925
17926 /// Sets or clears the value of [state][crate::model::VpcFlowLogsConfig::state].
17927 ///
17928 /// # Example
17929 /// ```ignore,no_run
17930 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17931 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
17932 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_state(Some(State::Enabled));
17933 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_state(Some(State::Disabled));
17934 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_state(None::<State>);
17935 /// ```
17936 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
17937 where
17938 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
17939 {
17940 self.state = v.map(|x| x.into());
17941 self
17942 }
17943
17944 /// Sets the value of [aggregation_interval][crate::model::VpcFlowLogsConfig::aggregation_interval].
17945 ///
17946 /// # Example
17947 /// ```ignore,no_run
17948 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17949 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
17950 /// let x0 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval5Sec);
17951 /// let x1 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval30Sec);
17952 /// let x2 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval1Min);
17953 /// ```
17954 pub fn set_aggregation_interval<T>(mut self, v: T) -> Self
17955 where
17956 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
17957 {
17958 self.aggregation_interval = std::option::Option::Some(v.into());
17959 self
17960 }
17961
17962 /// Sets or clears the value of [aggregation_interval][crate::model::VpcFlowLogsConfig::aggregation_interval].
17963 ///
17964 /// # Example
17965 /// ```ignore,no_run
17966 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17967 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
17968 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval5Sec));
17969 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval30Sec));
17970 /// let x2 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval1Min));
17971 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(None::<AggregationInterval>);
17972 /// ```
17973 pub fn set_or_clear_aggregation_interval<T>(mut self, v: std::option::Option<T>) -> Self
17974 where
17975 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
17976 {
17977 self.aggregation_interval = v.map(|x| x.into());
17978 self
17979 }
17980
17981 /// Sets the value of [flow_sampling][crate::model::VpcFlowLogsConfig::flow_sampling].
17982 ///
17983 /// # Example
17984 /// ```ignore,no_run
17985 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
17986 /// let x = VpcFlowLogsConfig::new().set_flow_sampling(42.0);
17987 /// ```
17988 pub fn set_flow_sampling<T>(mut self, v: T) -> Self
17989 where
17990 T: std::convert::Into<f32>,
17991 {
17992 self.flow_sampling = std::option::Option::Some(v.into());
17993 self
17994 }
17995
17996 /// Sets or clears the value of [flow_sampling][crate::model::VpcFlowLogsConfig::flow_sampling].
17997 ///
17998 /// # Example
17999 /// ```ignore,no_run
18000 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18001 /// let x = VpcFlowLogsConfig::new().set_or_clear_flow_sampling(Some(42.0));
18002 /// let x = VpcFlowLogsConfig::new().set_or_clear_flow_sampling(None::<f32>);
18003 /// ```
18004 pub fn set_or_clear_flow_sampling<T>(mut self, v: std::option::Option<T>) -> Self
18005 where
18006 T: std::convert::Into<f32>,
18007 {
18008 self.flow_sampling = v.map(|x| x.into());
18009 self
18010 }
18011
18012 /// Sets the value of [metadata][crate::model::VpcFlowLogsConfig::metadata].
18013 ///
18014 /// # Example
18015 /// ```ignore,no_run
18016 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18017 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
18018 /// let x0 = VpcFlowLogsConfig::new().set_metadata(Metadata::IncludeAllMetadata);
18019 /// let x1 = VpcFlowLogsConfig::new().set_metadata(Metadata::ExcludeAllMetadata);
18020 /// let x2 = VpcFlowLogsConfig::new().set_metadata(Metadata::CustomMetadata);
18021 /// ```
18022 pub fn set_metadata<T>(mut self, v: T) -> Self
18023 where
18024 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
18025 {
18026 self.metadata = std::option::Option::Some(v.into());
18027 self
18028 }
18029
18030 /// Sets or clears the value of [metadata][crate::model::VpcFlowLogsConfig::metadata].
18031 ///
18032 /// # Example
18033 /// ```ignore,no_run
18034 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18035 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
18036 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::IncludeAllMetadata));
18037 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::ExcludeAllMetadata));
18038 /// let x2 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::CustomMetadata));
18039 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_metadata(None::<Metadata>);
18040 /// ```
18041 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
18042 where
18043 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
18044 {
18045 self.metadata = v.map(|x| x.into());
18046 self
18047 }
18048
18049 /// Sets the value of [metadata_fields][crate::model::VpcFlowLogsConfig::metadata_fields].
18050 ///
18051 /// # Example
18052 /// ```ignore,no_run
18053 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18054 /// let x = VpcFlowLogsConfig::new().set_metadata_fields(["a", "b", "c"]);
18055 /// ```
18056 pub fn set_metadata_fields<T, V>(mut self, v: T) -> Self
18057 where
18058 T: std::iter::IntoIterator<Item = V>,
18059 V: std::convert::Into<std::string::String>,
18060 {
18061 use std::iter::Iterator;
18062 self.metadata_fields = v.into_iter().map(|i| i.into()).collect();
18063 self
18064 }
18065
18066 /// Sets the value of [filter_expr][crate::model::VpcFlowLogsConfig::filter_expr].
18067 ///
18068 /// # Example
18069 /// ```ignore,no_run
18070 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18071 /// let x = VpcFlowLogsConfig::new().set_filter_expr("example");
18072 /// ```
18073 pub fn set_filter_expr<T>(mut self, v: T) -> Self
18074 where
18075 T: std::convert::Into<std::string::String>,
18076 {
18077 self.filter_expr = std::option::Option::Some(v.into());
18078 self
18079 }
18080
18081 /// Sets or clears the value of [filter_expr][crate::model::VpcFlowLogsConfig::filter_expr].
18082 ///
18083 /// # Example
18084 /// ```ignore,no_run
18085 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18086 /// let x = VpcFlowLogsConfig::new().set_or_clear_filter_expr(Some("example"));
18087 /// let x = VpcFlowLogsConfig::new().set_or_clear_filter_expr(None::<String>);
18088 /// ```
18089 pub fn set_or_clear_filter_expr<T>(mut self, v: std::option::Option<T>) -> Self
18090 where
18091 T: std::convert::Into<std::string::String>,
18092 {
18093 self.filter_expr = v.map(|x| x.into());
18094 self
18095 }
18096
18097 /// Sets the value of [cross_project_metadata][crate::model::VpcFlowLogsConfig::cross_project_metadata].
18098 ///
18099 /// # Example
18100 /// ```ignore,no_run
18101 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18102 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
18103 /// let x0 = VpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Enabled);
18104 /// let x1 = VpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Disabled);
18105 /// ```
18106 pub fn set_cross_project_metadata<T>(mut self, v: T) -> Self
18107 where
18108 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
18109 {
18110 self.cross_project_metadata = std::option::Option::Some(v.into());
18111 self
18112 }
18113
18114 /// Sets or clears the value of [cross_project_metadata][crate::model::VpcFlowLogsConfig::cross_project_metadata].
18115 ///
18116 /// # Example
18117 /// ```ignore,no_run
18118 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18119 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
18120 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Enabled));
18121 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Disabled));
18122 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(None::<CrossProjectMetadata>);
18123 /// ```
18124 pub fn set_or_clear_cross_project_metadata<T>(mut self, v: std::option::Option<T>) -> Self
18125 where
18126 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
18127 {
18128 self.cross_project_metadata = v.map(|x| x.into());
18129 self
18130 }
18131
18132 /// Sets the value of [target_resource_state][crate::model::VpcFlowLogsConfig::target_resource_state].
18133 ///
18134 /// # Example
18135 /// ```ignore,no_run
18136 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18137 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResourceState;
18138 /// let x0 = VpcFlowLogsConfig::new().set_target_resource_state(TargetResourceState::TargetResourceExists);
18139 /// let x1 = VpcFlowLogsConfig::new().set_target_resource_state(TargetResourceState::TargetResourceDoesNotExist);
18140 /// ```
18141 pub fn set_target_resource_state<T>(mut self, v: T) -> Self
18142 where
18143 T: std::convert::Into<crate::model::vpc_flow_logs_config::TargetResourceState>,
18144 {
18145 self.target_resource_state = std::option::Option::Some(v.into());
18146 self
18147 }
18148
18149 /// Sets or clears the value of [target_resource_state][crate::model::VpcFlowLogsConfig::target_resource_state].
18150 ///
18151 /// # Example
18152 /// ```ignore,no_run
18153 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18154 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResourceState;
18155 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(Some(TargetResourceState::TargetResourceExists));
18156 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(Some(TargetResourceState::TargetResourceDoesNotExist));
18157 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(None::<TargetResourceState>);
18158 /// ```
18159 pub fn set_or_clear_target_resource_state<T>(mut self, v: std::option::Option<T>) -> Self
18160 where
18161 T: std::convert::Into<crate::model::vpc_flow_logs_config::TargetResourceState>,
18162 {
18163 self.target_resource_state = v.map(|x| x.into());
18164 self
18165 }
18166
18167 /// Sets the value of [labels][crate::model::VpcFlowLogsConfig::labels].
18168 ///
18169 /// # Example
18170 /// ```ignore,no_run
18171 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18172 /// let x = VpcFlowLogsConfig::new().set_labels([
18173 /// ("key0", "abc"),
18174 /// ("key1", "xyz"),
18175 /// ]);
18176 /// ```
18177 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
18178 where
18179 T: std::iter::IntoIterator<Item = (K, V)>,
18180 K: std::convert::Into<std::string::String>,
18181 V: std::convert::Into<std::string::String>,
18182 {
18183 use std::iter::Iterator;
18184 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18185 self
18186 }
18187
18188 /// Sets the value of [create_time][crate::model::VpcFlowLogsConfig::create_time].
18189 ///
18190 /// # Example
18191 /// ```ignore,no_run
18192 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18193 /// use wkt::Timestamp;
18194 /// let x = VpcFlowLogsConfig::new().set_create_time(Timestamp::default()/* use setters */);
18195 /// ```
18196 pub fn set_create_time<T>(mut self, v: T) -> Self
18197 where
18198 T: std::convert::Into<wkt::Timestamp>,
18199 {
18200 self.create_time = std::option::Option::Some(v.into());
18201 self
18202 }
18203
18204 /// Sets or clears the value of [create_time][crate::model::VpcFlowLogsConfig::create_time].
18205 ///
18206 /// # Example
18207 /// ```ignore,no_run
18208 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18209 /// use wkt::Timestamp;
18210 /// let x = VpcFlowLogsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
18211 /// let x = VpcFlowLogsConfig::new().set_or_clear_create_time(None::<Timestamp>);
18212 /// ```
18213 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18214 where
18215 T: std::convert::Into<wkt::Timestamp>,
18216 {
18217 self.create_time = v.map(|x| x.into());
18218 self
18219 }
18220
18221 /// Sets the value of [update_time][crate::model::VpcFlowLogsConfig::update_time].
18222 ///
18223 /// # Example
18224 /// ```ignore,no_run
18225 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18226 /// use wkt::Timestamp;
18227 /// let x = VpcFlowLogsConfig::new().set_update_time(Timestamp::default()/* use setters */);
18228 /// ```
18229 pub fn set_update_time<T>(mut self, v: T) -> Self
18230 where
18231 T: std::convert::Into<wkt::Timestamp>,
18232 {
18233 self.update_time = std::option::Option::Some(v.into());
18234 self
18235 }
18236
18237 /// Sets or clears the value of [update_time][crate::model::VpcFlowLogsConfig::update_time].
18238 ///
18239 /// # Example
18240 /// ```ignore,no_run
18241 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18242 /// use wkt::Timestamp;
18243 /// let x = VpcFlowLogsConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
18244 /// let x = VpcFlowLogsConfig::new().set_or_clear_update_time(None::<Timestamp>);
18245 /// ```
18246 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
18247 where
18248 T: std::convert::Into<wkt::Timestamp>,
18249 {
18250 self.update_time = v.map(|x| x.into());
18251 self
18252 }
18253
18254 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource].
18255 ///
18256 /// Note that all the setters affecting `target_resource` are mutually
18257 /// exclusive.
18258 ///
18259 /// # Example
18260 /// ```ignore,no_run
18261 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18262 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResource;
18263 /// let x = VpcFlowLogsConfig::new().set_target_resource(Some(TargetResource::Network("example".to_string())));
18264 /// ```
18265 pub fn set_target_resource<
18266 T: std::convert::Into<std::option::Option<crate::model::vpc_flow_logs_config::TargetResource>>,
18267 >(
18268 mut self,
18269 v: T,
18270 ) -> Self {
18271 self.target_resource = v.into();
18272 self
18273 }
18274
18275 /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
18276 /// if it holds a `Network`, `None` if the field is not set or
18277 /// holds a different branch.
18278 pub fn network(&self) -> std::option::Option<&std::string::String> {
18279 #[allow(unreachable_patterns)]
18280 self.target_resource.as_ref().and_then(|v| match v {
18281 crate::model::vpc_flow_logs_config::TargetResource::Network(v) => {
18282 std::option::Option::Some(v)
18283 }
18284 _ => std::option::Option::None,
18285 })
18286 }
18287
18288 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
18289 /// to hold a `Network`.
18290 ///
18291 /// Note that all the setters affecting `target_resource` are
18292 /// mutually exclusive.
18293 ///
18294 /// # Example
18295 /// ```ignore,no_run
18296 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18297 /// let x = VpcFlowLogsConfig::new().set_network("example");
18298 /// assert!(x.network().is_some());
18299 /// assert!(x.subnet().is_none());
18300 /// assert!(x.interconnect_attachment().is_none());
18301 /// assert!(x.vpn_tunnel().is_none());
18302 /// ```
18303 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18304 self.target_resource = std::option::Option::Some(
18305 crate::model::vpc_flow_logs_config::TargetResource::Network(v.into()),
18306 );
18307 self
18308 }
18309
18310 /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
18311 /// if it holds a `Subnet`, `None` if the field is not set or
18312 /// holds a different branch.
18313 pub fn subnet(&self) -> std::option::Option<&std::string::String> {
18314 #[allow(unreachable_patterns)]
18315 self.target_resource.as_ref().and_then(|v| match v {
18316 crate::model::vpc_flow_logs_config::TargetResource::Subnet(v) => {
18317 std::option::Option::Some(v)
18318 }
18319 _ => std::option::Option::None,
18320 })
18321 }
18322
18323 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
18324 /// to hold a `Subnet`.
18325 ///
18326 /// Note that all the setters affecting `target_resource` are
18327 /// mutually exclusive.
18328 ///
18329 /// # Example
18330 /// ```ignore,no_run
18331 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18332 /// let x = VpcFlowLogsConfig::new().set_subnet("example");
18333 /// assert!(x.subnet().is_some());
18334 /// assert!(x.network().is_none());
18335 /// assert!(x.interconnect_attachment().is_none());
18336 /// assert!(x.vpn_tunnel().is_none());
18337 /// ```
18338 pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18339 self.target_resource = std::option::Option::Some(
18340 crate::model::vpc_flow_logs_config::TargetResource::Subnet(v.into()),
18341 );
18342 self
18343 }
18344
18345 /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
18346 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
18347 /// holds a different branch.
18348 pub fn interconnect_attachment(&self) -> std::option::Option<&std::string::String> {
18349 #[allow(unreachable_patterns)]
18350 self.target_resource.as_ref().and_then(|v| match v {
18351 crate::model::vpc_flow_logs_config::TargetResource::InterconnectAttachment(v) => {
18352 std::option::Option::Some(v)
18353 }
18354 _ => std::option::Option::None,
18355 })
18356 }
18357
18358 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
18359 /// to hold a `InterconnectAttachment`.
18360 ///
18361 /// Note that all the setters affecting `target_resource` are
18362 /// mutually exclusive.
18363 ///
18364 /// # Example
18365 /// ```ignore,no_run
18366 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18367 /// let x = VpcFlowLogsConfig::new().set_interconnect_attachment("example");
18368 /// assert!(x.interconnect_attachment().is_some());
18369 /// assert!(x.network().is_none());
18370 /// assert!(x.subnet().is_none());
18371 /// assert!(x.vpn_tunnel().is_none());
18372 /// ```
18373 pub fn set_interconnect_attachment<T: std::convert::Into<std::string::String>>(
18374 mut self,
18375 v: T,
18376 ) -> Self {
18377 self.target_resource = std::option::Option::Some(
18378 crate::model::vpc_flow_logs_config::TargetResource::InterconnectAttachment(v.into()),
18379 );
18380 self
18381 }
18382
18383 /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
18384 /// if it holds a `VpnTunnel`, `None` if the field is not set or
18385 /// holds a different branch.
18386 pub fn vpn_tunnel(&self) -> std::option::Option<&std::string::String> {
18387 #[allow(unreachable_patterns)]
18388 self.target_resource.as_ref().and_then(|v| match v {
18389 crate::model::vpc_flow_logs_config::TargetResource::VpnTunnel(v) => {
18390 std::option::Option::Some(v)
18391 }
18392 _ => std::option::Option::None,
18393 })
18394 }
18395
18396 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
18397 /// to hold a `VpnTunnel`.
18398 ///
18399 /// Note that all the setters affecting `target_resource` are
18400 /// mutually exclusive.
18401 ///
18402 /// # Example
18403 /// ```ignore,no_run
18404 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
18405 /// let x = VpcFlowLogsConfig::new().set_vpn_tunnel("example");
18406 /// assert!(x.vpn_tunnel().is_some());
18407 /// assert!(x.network().is_none());
18408 /// assert!(x.subnet().is_none());
18409 /// assert!(x.interconnect_attachment().is_none());
18410 /// ```
18411 pub fn set_vpn_tunnel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18412 self.target_resource = std::option::Option::Some(
18413 crate::model::vpc_flow_logs_config::TargetResource::VpnTunnel(v.into()),
18414 );
18415 self
18416 }
18417}
18418
18419impl wkt::message::Message for VpcFlowLogsConfig {
18420 fn typename() -> &'static str {
18421 "type.googleapis.com/google.cloud.networkmanagement.v1.VpcFlowLogsConfig"
18422 }
18423}
18424
18425/// Defines additional types related to [VpcFlowLogsConfig].
18426pub mod vpc_flow_logs_config {
18427 #[allow(unused_imports)]
18428 use super::*;
18429
18430 /// Determines whether this configuration will be generating logs.
18431 ///
18432 /// # Working with unknown values
18433 ///
18434 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18435 /// additional enum variants at any time. Adding new variants is not considered
18436 /// a breaking change. Applications should write their code in anticipation of:
18437 ///
18438 /// - New values appearing in future releases of the client library, **and**
18439 /// - New values received dynamically, without application changes.
18440 ///
18441 /// Please consult the [Working with enums] section in the user guide for some
18442 /// guidelines.
18443 ///
18444 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18445 #[derive(Clone, Debug, PartialEq)]
18446 #[non_exhaustive]
18447 pub enum State {
18448 /// If not specified, will default to ENABLED.
18449 Unspecified,
18450 /// When ENABLED, this configuration will generate logs.
18451 Enabled,
18452 /// When DISABLED, this configuration will not generate logs.
18453 Disabled,
18454 /// If set, the enum was initialized with an unknown value.
18455 ///
18456 /// Applications can examine the value using [State::value] or
18457 /// [State::name].
18458 UnknownValue(state::UnknownValue),
18459 }
18460
18461 #[doc(hidden)]
18462 pub mod state {
18463 #[allow(unused_imports)]
18464 use super::*;
18465 #[derive(Clone, Debug, PartialEq)]
18466 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18467 }
18468
18469 impl State {
18470 /// Gets the enum value.
18471 ///
18472 /// Returns `None` if the enum contains an unknown value deserialized from
18473 /// the string representation of enums.
18474 pub fn value(&self) -> std::option::Option<i32> {
18475 match self {
18476 Self::Unspecified => std::option::Option::Some(0),
18477 Self::Enabled => std::option::Option::Some(1),
18478 Self::Disabled => std::option::Option::Some(2),
18479 Self::UnknownValue(u) => u.0.value(),
18480 }
18481 }
18482
18483 /// Gets the enum value as a string.
18484 ///
18485 /// Returns `None` if the enum contains an unknown value deserialized from
18486 /// the integer representation of enums.
18487 pub fn name(&self) -> std::option::Option<&str> {
18488 match self {
18489 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18490 Self::Enabled => std::option::Option::Some("ENABLED"),
18491 Self::Disabled => std::option::Option::Some("DISABLED"),
18492 Self::UnknownValue(u) => u.0.name(),
18493 }
18494 }
18495 }
18496
18497 impl std::default::Default for State {
18498 fn default() -> Self {
18499 use std::convert::From;
18500 Self::from(0)
18501 }
18502 }
18503
18504 impl std::fmt::Display for State {
18505 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18506 wkt::internal::display_enum(f, self.name(), self.value())
18507 }
18508 }
18509
18510 impl std::convert::From<i32> for State {
18511 fn from(value: i32) -> Self {
18512 match value {
18513 0 => Self::Unspecified,
18514 1 => Self::Enabled,
18515 2 => Self::Disabled,
18516 _ => Self::UnknownValue(state::UnknownValue(
18517 wkt::internal::UnknownEnumValue::Integer(value),
18518 )),
18519 }
18520 }
18521 }
18522
18523 impl std::convert::From<&str> for State {
18524 fn from(value: &str) -> Self {
18525 use std::string::ToString;
18526 match value {
18527 "STATE_UNSPECIFIED" => Self::Unspecified,
18528 "ENABLED" => Self::Enabled,
18529 "DISABLED" => Self::Disabled,
18530 _ => Self::UnknownValue(state::UnknownValue(
18531 wkt::internal::UnknownEnumValue::String(value.to_string()),
18532 )),
18533 }
18534 }
18535 }
18536
18537 impl serde::ser::Serialize for State {
18538 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18539 where
18540 S: serde::Serializer,
18541 {
18542 match self {
18543 Self::Unspecified => serializer.serialize_i32(0),
18544 Self::Enabled => serializer.serialize_i32(1),
18545 Self::Disabled => serializer.serialize_i32(2),
18546 Self::UnknownValue(u) => u.0.serialize(serializer),
18547 }
18548 }
18549 }
18550
18551 impl<'de> serde::de::Deserialize<'de> for State {
18552 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18553 where
18554 D: serde::Deserializer<'de>,
18555 {
18556 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18557 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.State",
18558 ))
18559 }
18560 }
18561
18562 /// Toggles the aggregation interval for collecting flow logs by 5-tuple.
18563 ///
18564 /// # Working with unknown values
18565 ///
18566 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18567 /// additional enum variants at any time. Adding new variants is not considered
18568 /// a breaking change. Applications should write their code in anticipation of:
18569 ///
18570 /// - New values appearing in future releases of the client library, **and**
18571 /// - New values received dynamically, without application changes.
18572 ///
18573 /// Please consult the [Working with enums] section in the user guide for some
18574 /// guidelines.
18575 ///
18576 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18577 #[derive(Clone, Debug, PartialEq)]
18578 #[non_exhaustive]
18579 pub enum AggregationInterval {
18580 /// If not specified, will default to INTERVAL_5_SEC.
18581 Unspecified,
18582 /// Aggregate logs in 5s intervals.
18583 Interval5Sec,
18584 /// Aggregate logs in 30s intervals.
18585 Interval30Sec,
18586 /// Aggregate logs in 1m intervals.
18587 Interval1Min,
18588 /// Aggregate logs in 5m intervals.
18589 Interval5Min,
18590 /// Aggregate logs in 10m intervals.
18591 Interval10Min,
18592 /// Aggregate logs in 15m intervals.
18593 Interval15Min,
18594 /// If set, the enum was initialized with an unknown value.
18595 ///
18596 /// Applications can examine the value using [AggregationInterval::value] or
18597 /// [AggregationInterval::name].
18598 UnknownValue(aggregation_interval::UnknownValue),
18599 }
18600
18601 #[doc(hidden)]
18602 pub mod aggregation_interval {
18603 #[allow(unused_imports)]
18604 use super::*;
18605 #[derive(Clone, Debug, PartialEq)]
18606 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18607 }
18608
18609 impl AggregationInterval {
18610 /// Gets the enum value.
18611 ///
18612 /// Returns `None` if the enum contains an unknown value deserialized from
18613 /// the string representation of enums.
18614 pub fn value(&self) -> std::option::Option<i32> {
18615 match self {
18616 Self::Unspecified => std::option::Option::Some(0),
18617 Self::Interval5Sec => std::option::Option::Some(1),
18618 Self::Interval30Sec => std::option::Option::Some(2),
18619 Self::Interval1Min => std::option::Option::Some(3),
18620 Self::Interval5Min => std::option::Option::Some(4),
18621 Self::Interval10Min => std::option::Option::Some(5),
18622 Self::Interval15Min => std::option::Option::Some(6),
18623 Self::UnknownValue(u) => u.0.value(),
18624 }
18625 }
18626
18627 /// Gets the enum value as a string.
18628 ///
18629 /// Returns `None` if the enum contains an unknown value deserialized from
18630 /// the integer representation of enums.
18631 pub fn name(&self) -> std::option::Option<&str> {
18632 match self {
18633 Self::Unspecified => std::option::Option::Some("AGGREGATION_INTERVAL_UNSPECIFIED"),
18634 Self::Interval5Sec => std::option::Option::Some("INTERVAL_5_SEC"),
18635 Self::Interval30Sec => std::option::Option::Some("INTERVAL_30_SEC"),
18636 Self::Interval1Min => std::option::Option::Some("INTERVAL_1_MIN"),
18637 Self::Interval5Min => std::option::Option::Some("INTERVAL_5_MIN"),
18638 Self::Interval10Min => std::option::Option::Some("INTERVAL_10_MIN"),
18639 Self::Interval15Min => std::option::Option::Some("INTERVAL_15_MIN"),
18640 Self::UnknownValue(u) => u.0.name(),
18641 }
18642 }
18643 }
18644
18645 impl std::default::Default for AggregationInterval {
18646 fn default() -> Self {
18647 use std::convert::From;
18648 Self::from(0)
18649 }
18650 }
18651
18652 impl std::fmt::Display for AggregationInterval {
18653 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18654 wkt::internal::display_enum(f, self.name(), self.value())
18655 }
18656 }
18657
18658 impl std::convert::From<i32> for AggregationInterval {
18659 fn from(value: i32) -> Self {
18660 match value {
18661 0 => Self::Unspecified,
18662 1 => Self::Interval5Sec,
18663 2 => Self::Interval30Sec,
18664 3 => Self::Interval1Min,
18665 4 => Self::Interval5Min,
18666 5 => Self::Interval10Min,
18667 6 => Self::Interval15Min,
18668 _ => Self::UnknownValue(aggregation_interval::UnknownValue(
18669 wkt::internal::UnknownEnumValue::Integer(value),
18670 )),
18671 }
18672 }
18673 }
18674
18675 impl std::convert::From<&str> for AggregationInterval {
18676 fn from(value: &str) -> Self {
18677 use std::string::ToString;
18678 match value {
18679 "AGGREGATION_INTERVAL_UNSPECIFIED" => Self::Unspecified,
18680 "INTERVAL_5_SEC" => Self::Interval5Sec,
18681 "INTERVAL_30_SEC" => Self::Interval30Sec,
18682 "INTERVAL_1_MIN" => Self::Interval1Min,
18683 "INTERVAL_5_MIN" => Self::Interval5Min,
18684 "INTERVAL_10_MIN" => Self::Interval10Min,
18685 "INTERVAL_15_MIN" => Self::Interval15Min,
18686 _ => Self::UnknownValue(aggregation_interval::UnknownValue(
18687 wkt::internal::UnknownEnumValue::String(value.to_string()),
18688 )),
18689 }
18690 }
18691 }
18692
18693 impl serde::ser::Serialize for AggregationInterval {
18694 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18695 where
18696 S: serde::Serializer,
18697 {
18698 match self {
18699 Self::Unspecified => serializer.serialize_i32(0),
18700 Self::Interval5Sec => serializer.serialize_i32(1),
18701 Self::Interval30Sec => serializer.serialize_i32(2),
18702 Self::Interval1Min => serializer.serialize_i32(3),
18703 Self::Interval5Min => serializer.serialize_i32(4),
18704 Self::Interval10Min => serializer.serialize_i32(5),
18705 Self::Interval15Min => serializer.serialize_i32(6),
18706 Self::UnknownValue(u) => u.0.serialize(serializer),
18707 }
18708 }
18709 }
18710
18711 impl<'de> serde::de::Deserialize<'de> for AggregationInterval {
18712 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18713 where
18714 D: serde::Deserializer<'de>,
18715 {
18716 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AggregationInterval>::new(
18717 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.AggregationInterval",
18718 ))
18719 }
18720 }
18721
18722 /// Configures which log fields would be included.
18723 ///
18724 /// # Working with unknown values
18725 ///
18726 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18727 /// additional enum variants at any time. Adding new variants is not considered
18728 /// a breaking change. Applications should write their code in anticipation of:
18729 ///
18730 /// - New values appearing in future releases of the client library, **and**
18731 /// - New values received dynamically, without application changes.
18732 ///
18733 /// Please consult the [Working with enums] section in the user guide for some
18734 /// guidelines.
18735 ///
18736 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18737 #[derive(Clone, Debug, PartialEq)]
18738 #[non_exhaustive]
18739 pub enum Metadata {
18740 /// If not specified, will default to INCLUDE_ALL_METADATA.
18741 Unspecified,
18742 /// Include all metadata fields.
18743 IncludeAllMetadata,
18744 /// Exclude all metadata fields.
18745 ExcludeAllMetadata,
18746 /// Include only custom fields (specified in metadata_fields).
18747 CustomMetadata,
18748 /// If set, the enum was initialized with an unknown value.
18749 ///
18750 /// Applications can examine the value using [Metadata::value] or
18751 /// [Metadata::name].
18752 UnknownValue(metadata::UnknownValue),
18753 }
18754
18755 #[doc(hidden)]
18756 pub mod metadata {
18757 #[allow(unused_imports)]
18758 use super::*;
18759 #[derive(Clone, Debug, PartialEq)]
18760 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18761 }
18762
18763 impl Metadata {
18764 /// Gets the enum value.
18765 ///
18766 /// Returns `None` if the enum contains an unknown value deserialized from
18767 /// the string representation of enums.
18768 pub fn value(&self) -> std::option::Option<i32> {
18769 match self {
18770 Self::Unspecified => std::option::Option::Some(0),
18771 Self::IncludeAllMetadata => std::option::Option::Some(1),
18772 Self::ExcludeAllMetadata => std::option::Option::Some(2),
18773 Self::CustomMetadata => std::option::Option::Some(3),
18774 Self::UnknownValue(u) => u.0.value(),
18775 }
18776 }
18777
18778 /// Gets the enum value as a string.
18779 ///
18780 /// Returns `None` if the enum contains an unknown value deserialized from
18781 /// the integer representation of enums.
18782 pub fn name(&self) -> std::option::Option<&str> {
18783 match self {
18784 Self::Unspecified => std::option::Option::Some("METADATA_UNSPECIFIED"),
18785 Self::IncludeAllMetadata => std::option::Option::Some("INCLUDE_ALL_METADATA"),
18786 Self::ExcludeAllMetadata => std::option::Option::Some("EXCLUDE_ALL_METADATA"),
18787 Self::CustomMetadata => std::option::Option::Some("CUSTOM_METADATA"),
18788 Self::UnknownValue(u) => u.0.name(),
18789 }
18790 }
18791 }
18792
18793 impl std::default::Default for Metadata {
18794 fn default() -> Self {
18795 use std::convert::From;
18796 Self::from(0)
18797 }
18798 }
18799
18800 impl std::fmt::Display for Metadata {
18801 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18802 wkt::internal::display_enum(f, self.name(), self.value())
18803 }
18804 }
18805
18806 impl std::convert::From<i32> for Metadata {
18807 fn from(value: i32) -> Self {
18808 match value {
18809 0 => Self::Unspecified,
18810 1 => Self::IncludeAllMetadata,
18811 2 => Self::ExcludeAllMetadata,
18812 3 => Self::CustomMetadata,
18813 _ => Self::UnknownValue(metadata::UnknownValue(
18814 wkt::internal::UnknownEnumValue::Integer(value),
18815 )),
18816 }
18817 }
18818 }
18819
18820 impl std::convert::From<&str> for Metadata {
18821 fn from(value: &str) -> Self {
18822 use std::string::ToString;
18823 match value {
18824 "METADATA_UNSPECIFIED" => Self::Unspecified,
18825 "INCLUDE_ALL_METADATA" => Self::IncludeAllMetadata,
18826 "EXCLUDE_ALL_METADATA" => Self::ExcludeAllMetadata,
18827 "CUSTOM_METADATA" => Self::CustomMetadata,
18828 _ => Self::UnknownValue(metadata::UnknownValue(
18829 wkt::internal::UnknownEnumValue::String(value.to_string()),
18830 )),
18831 }
18832 }
18833 }
18834
18835 impl serde::ser::Serialize for Metadata {
18836 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18837 where
18838 S: serde::Serializer,
18839 {
18840 match self {
18841 Self::Unspecified => serializer.serialize_i32(0),
18842 Self::IncludeAllMetadata => serializer.serialize_i32(1),
18843 Self::ExcludeAllMetadata => serializer.serialize_i32(2),
18844 Self::CustomMetadata => serializer.serialize_i32(3),
18845 Self::UnknownValue(u) => u.0.serialize(serializer),
18846 }
18847 }
18848 }
18849
18850 impl<'de> serde::de::Deserialize<'de> for Metadata {
18851 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18852 where
18853 D: serde::Deserializer<'de>,
18854 {
18855 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Metadata>::new(
18856 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.Metadata",
18857 ))
18858 }
18859 }
18860
18861 /// Determines whether to include cross project annotations in the logs.
18862 /// Project configurations will always have CROSS_PROJECT_METADATA_DISABLED.
18863 ///
18864 /// # Working with unknown values
18865 ///
18866 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18867 /// additional enum variants at any time. Adding new variants is not considered
18868 /// a breaking change. Applications should write their code in anticipation of:
18869 ///
18870 /// - New values appearing in future releases of the client library, **and**
18871 /// - New values received dynamically, without application changes.
18872 ///
18873 /// Please consult the [Working with enums] section in the user guide for some
18874 /// guidelines.
18875 ///
18876 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18877 #[derive(Clone, Debug, PartialEq)]
18878 #[non_exhaustive]
18879 pub enum CrossProjectMetadata {
18880 /// If not specified, the default is CROSS_PROJECT_METADATA_ENABLED.
18881 Unspecified,
18882 /// When CROSS_PROJECT_METADATA_ENABLED, metadata from other projects will be
18883 /// included in the logs.
18884 Enabled,
18885 /// When CROSS_PROJECT_METADATA_DISABLED, metadata from other projects will
18886 /// not be included in the logs.
18887 Disabled,
18888 /// If set, the enum was initialized with an unknown value.
18889 ///
18890 /// Applications can examine the value using [CrossProjectMetadata::value] or
18891 /// [CrossProjectMetadata::name].
18892 UnknownValue(cross_project_metadata::UnknownValue),
18893 }
18894
18895 #[doc(hidden)]
18896 pub mod cross_project_metadata {
18897 #[allow(unused_imports)]
18898 use super::*;
18899 #[derive(Clone, Debug, PartialEq)]
18900 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18901 }
18902
18903 impl CrossProjectMetadata {
18904 /// Gets the enum value.
18905 ///
18906 /// Returns `None` if the enum contains an unknown value deserialized from
18907 /// the string representation of enums.
18908 pub fn value(&self) -> std::option::Option<i32> {
18909 match self {
18910 Self::Unspecified => std::option::Option::Some(0),
18911 Self::Enabled => std::option::Option::Some(1),
18912 Self::Disabled => std::option::Option::Some(2),
18913 Self::UnknownValue(u) => u.0.value(),
18914 }
18915 }
18916
18917 /// Gets the enum value as a string.
18918 ///
18919 /// Returns `None` if the enum contains an unknown value deserialized from
18920 /// the integer representation of enums.
18921 pub fn name(&self) -> std::option::Option<&str> {
18922 match self {
18923 Self::Unspecified => {
18924 std::option::Option::Some("CROSS_PROJECT_METADATA_UNSPECIFIED")
18925 }
18926 Self::Enabled => std::option::Option::Some("CROSS_PROJECT_METADATA_ENABLED"),
18927 Self::Disabled => std::option::Option::Some("CROSS_PROJECT_METADATA_DISABLED"),
18928 Self::UnknownValue(u) => u.0.name(),
18929 }
18930 }
18931 }
18932
18933 impl std::default::Default for CrossProjectMetadata {
18934 fn default() -> Self {
18935 use std::convert::From;
18936 Self::from(0)
18937 }
18938 }
18939
18940 impl std::fmt::Display for CrossProjectMetadata {
18941 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18942 wkt::internal::display_enum(f, self.name(), self.value())
18943 }
18944 }
18945
18946 impl std::convert::From<i32> for CrossProjectMetadata {
18947 fn from(value: i32) -> Self {
18948 match value {
18949 0 => Self::Unspecified,
18950 1 => Self::Enabled,
18951 2 => Self::Disabled,
18952 _ => Self::UnknownValue(cross_project_metadata::UnknownValue(
18953 wkt::internal::UnknownEnumValue::Integer(value),
18954 )),
18955 }
18956 }
18957 }
18958
18959 impl std::convert::From<&str> for CrossProjectMetadata {
18960 fn from(value: &str) -> Self {
18961 use std::string::ToString;
18962 match value {
18963 "CROSS_PROJECT_METADATA_UNSPECIFIED" => Self::Unspecified,
18964 "CROSS_PROJECT_METADATA_ENABLED" => Self::Enabled,
18965 "CROSS_PROJECT_METADATA_DISABLED" => Self::Disabled,
18966 _ => Self::UnknownValue(cross_project_metadata::UnknownValue(
18967 wkt::internal::UnknownEnumValue::String(value.to_string()),
18968 )),
18969 }
18970 }
18971 }
18972
18973 impl serde::ser::Serialize for CrossProjectMetadata {
18974 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18975 where
18976 S: serde::Serializer,
18977 {
18978 match self {
18979 Self::Unspecified => serializer.serialize_i32(0),
18980 Self::Enabled => serializer.serialize_i32(1),
18981 Self::Disabled => serializer.serialize_i32(2),
18982 Self::UnknownValue(u) => u.0.serialize(serializer),
18983 }
18984 }
18985 }
18986
18987 impl<'de> serde::de::Deserialize<'de> for CrossProjectMetadata {
18988 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18989 where
18990 D: serde::Deserializer<'de>,
18991 {
18992 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CrossProjectMetadata>::new(
18993 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.CrossProjectMetadata",
18994 ))
18995 }
18996 }
18997
18998 /// Output only. Indicates whether the target resource exists, for diagnostic
18999 /// purposes.
19000 ///
19001 /// # Working with unknown values
19002 ///
19003 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19004 /// additional enum variants at any time. Adding new variants is not considered
19005 /// a breaking change. Applications should write their code in anticipation of:
19006 ///
19007 /// - New values appearing in future releases of the client library, **and**
19008 /// - New values received dynamically, without application changes.
19009 ///
19010 /// Please consult the [Working with enums] section in the user guide for some
19011 /// guidelines.
19012 ///
19013 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19014 #[derive(Clone, Debug, PartialEq)]
19015 #[non_exhaustive]
19016 pub enum TargetResourceState {
19017 /// Unspecified target resource state.
19018 Unspecified,
19019 /// Indicates that the target resource exists.
19020 TargetResourceExists,
19021 /// Indicates that the target resource does not exist.
19022 TargetResourceDoesNotExist,
19023 /// If set, the enum was initialized with an unknown value.
19024 ///
19025 /// Applications can examine the value using [TargetResourceState::value] or
19026 /// [TargetResourceState::name].
19027 UnknownValue(target_resource_state::UnknownValue),
19028 }
19029
19030 #[doc(hidden)]
19031 pub mod target_resource_state {
19032 #[allow(unused_imports)]
19033 use super::*;
19034 #[derive(Clone, Debug, PartialEq)]
19035 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19036 }
19037
19038 impl TargetResourceState {
19039 /// Gets the enum value.
19040 ///
19041 /// Returns `None` if the enum contains an unknown value deserialized from
19042 /// the string representation of enums.
19043 pub fn value(&self) -> std::option::Option<i32> {
19044 match self {
19045 Self::Unspecified => std::option::Option::Some(0),
19046 Self::TargetResourceExists => std::option::Option::Some(1),
19047 Self::TargetResourceDoesNotExist => std::option::Option::Some(2),
19048 Self::UnknownValue(u) => u.0.value(),
19049 }
19050 }
19051
19052 /// Gets the enum value as a string.
19053 ///
19054 /// Returns `None` if the enum contains an unknown value deserialized from
19055 /// the integer representation of enums.
19056 pub fn name(&self) -> std::option::Option<&str> {
19057 match self {
19058 Self::Unspecified => std::option::Option::Some("TARGET_RESOURCE_STATE_UNSPECIFIED"),
19059 Self::TargetResourceExists => std::option::Option::Some("TARGET_RESOURCE_EXISTS"),
19060 Self::TargetResourceDoesNotExist => {
19061 std::option::Option::Some("TARGET_RESOURCE_DOES_NOT_EXIST")
19062 }
19063 Self::UnknownValue(u) => u.0.name(),
19064 }
19065 }
19066 }
19067
19068 impl std::default::Default for TargetResourceState {
19069 fn default() -> Self {
19070 use std::convert::From;
19071 Self::from(0)
19072 }
19073 }
19074
19075 impl std::fmt::Display for TargetResourceState {
19076 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19077 wkt::internal::display_enum(f, self.name(), self.value())
19078 }
19079 }
19080
19081 impl std::convert::From<i32> for TargetResourceState {
19082 fn from(value: i32) -> Self {
19083 match value {
19084 0 => Self::Unspecified,
19085 1 => Self::TargetResourceExists,
19086 2 => Self::TargetResourceDoesNotExist,
19087 _ => Self::UnknownValue(target_resource_state::UnknownValue(
19088 wkt::internal::UnknownEnumValue::Integer(value),
19089 )),
19090 }
19091 }
19092 }
19093
19094 impl std::convert::From<&str> for TargetResourceState {
19095 fn from(value: &str) -> Self {
19096 use std::string::ToString;
19097 match value {
19098 "TARGET_RESOURCE_STATE_UNSPECIFIED" => Self::Unspecified,
19099 "TARGET_RESOURCE_EXISTS" => Self::TargetResourceExists,
19100 "TARGET_RESOURCE_DOES_NOT_EXIST" => Self::TargetResourceDoesNotExist,
19101 _ => Self::UnknownValue(target_resource_state::UnknownValue(
19102 wkt::internal::UnknownEnumValue::String(value.to_string()),
19103 )),
19104 }
19105 }
19106 }
19107
19108 impl serde::ser::Serialize for TargetResourceState {
19109 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19110 where
19111 S: serde::Serializer,
19112 {
19113 match self {
19114 Self::Unspecified => serializer.serialize_i32(0),
19115 Self::TargetResourceExists => serializer.serialize_i32(1),
19116 Self::TargetResourceDoesNotExist => serializer.serialize_i32(2),
19117 Self::UnknownValue(u) => u.0.serialize(serializer),
19118 }
19119 }
19120 }
19121
19122 impl<'de> serde::de::Deserialize<'de> for TargetResourceState {
19123 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19124 where
19125 D: serde::Deserializer<'de>,
19126 {
19127 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetResourceState>::new(
19128 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.TargetResourceState",
19129 ))
19130 }
19131 }
19132
19133 /// Reference to the resource of the config scope. That is, the scope from
19134 /// which traffic is logged. The target resource must belong to the same
19135 /// project as the configuration.
19136 /// This field is not supported for organization level configurations.
19137 #[derive(Clone, Debug, PartialEq)]
19138 #[non_exhaustive]
19139 pub enum TargetResource {
19140 /// Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
19141 /// within the network.
19142 /// Format: projects/{project_id}/global/networks/{name}
19143 Network(std::string::String),
19144 /// Traffic will be logged from VMs within the subnetwork.
19145 /// Format: projects/{project_id}/regions/{region}/subnetworks/{name}
19146 Subnet(std::string::String),
19147 /// Traffic will be logged from the Interconnect Attachment.
19148 /// Format:
19149 /// projects/{project_id}/regions/{region}/interconnectAttachments/{name}
19150 InterconnectAttachment(std::string::String),
19151 /// Traffic will be logged from the VPN Tunnel.
19152 /// Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
19153 VpnTunnel(std::string::String),
19154 }
19155}
19156
19157/// A configuration to generate a response for GetEffectiveVpcFlowLogsConfig
19158/// request.
19159#[derive(Clone, Default, PartialEq)]
19160#[non_exhaustive]
19161pub struct EffectiveVpcFlowLogsConfig {
19162 /// Unique name of the configuration. The name can have one of the following
19163 /// forms:
19164 ///
19165 /// - For project-level configurations:
19166 /// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
19167 ///
19168 /// - For organization-level configurations:
19169 /// `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
19170 ///
19171 /// - For a Compute config, the name will be the path of the subnet:
19172 /// `projects/{project_id}/regions/{region}/subnetworks/{subnet_id}`
19173 ///
19174 pub name: std::string::String,
19175
19176 /// The state of the VPC Flow Log configuration. Default value is ENABLED.
19177 /// When creating a new configuration, it must be enabled.
19178 /// Setting state=DISABLED will pause the log generation for this config.
19179 pub state: std::option::Option<crate::model::vpc_flow_logs_config::State>,
19180
19181 /// The aggregation interval for the logs. Default value is INTERVAL_5_SEC.
19182 pub aggregation_interval:
19183 std::option::Option<crate::model::vpc_flow_logs_config::AggregationInterval>,
19184
19185 /// The value of the field must be in (0, 1]. The sampling rate of VPC Flow
19186 /// Logs where 1.0 means all collected logs are reported.
19187 /// Setting the sampling rate to 0.0 is not allowed. If you want to disable VPC
19188 /// Flow Logs, use the state field instead.
19189 /// Default value is 1.0.
19190 pub flow_sampling: std::option::Option<f32>,
19191
19192 /// Configures whether all, none or a subset of metadata fields should be
19193 /// added to the reported VPC flow logs.
19194 /// Default value is INCLUDE_ALL_METADATA.
19195 pub metadata: std::option::Option<crate::model::vpc_flow_logs_config::Metadata>,
19196
19197 /// Custom metadata fields to include in the reported VPC flow logs.
19198 /// Can only be specified if "metadata" was set to CUSTOM_METADATA.
19199 pub metadata_fields: std::vec::Vec<std::string::String>,
19200
19201 /// Export filter used to define which VPC Flow Logs should be logged.
19202 pub filter_expr: std::option::Option<std::string::String>,
19203
19204 /// Determines whether to include cross project annotations in the logs.
19205 /// This field is available only for organization configurations. If not
19206 /// specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
19207 pub cross_project_metadata:
19208 std::option::Option<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
19209
19210 /// Specifies the scope of the config (e.g., SUBNET, NETWORK, ORGANIZATION..).
19211 pub scope: std::option::Option<crate::model::effective_vpc_flow_logs_config::Scope>,
19212
19213 /// Reference to the resource of the config scope. That is, the scope from
19214 /// which traffic is logged. The target resource must belong to the same
19215 /// project as the configuration.
19216 /// This field is not supported for organization level configurations.
19217 pub target_resource:
19218 std::option::Option<crate::model::effective_vpc_flow_logs_config::TargetResource>,
19219
19220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19221}
19222
19223impl EffectiveVpcFlowLogsConfig {
19224 /// Creates a new default instance.
19225 pub fn new() -> Self {
19226 std::default::Default::default()
19227 }
19228
19229 /// Sets the value of [name][crate::model::EffectiveVpcFlowLogsConfig::name].
19230 ///
19231 /// # Example
19232 /// ```ignore,no_run
19233 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19234 /// let x = EffectiveVpcFlowLogsConfig::new().set_name("example");
19235 /// ```
19236 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19237 self.name = v.into();
19238 self
19239 }
19240
19241 /// Sets the value of [state][crate::model::EffectiveVpcFlowLogsConfig::state].
19242 ///
19243 /// # Example
19244 /// ```ignore,no_run
19245 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19246 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
19247 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_state(State::Enabled);
19248 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_state(State::Disabled);
19249 /// ```
19250 pub fn set_state<T>(mut self, v: T) -> Self
19251 where
19252 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
19253 {
19254 self.state = std::option::Option::Some(v.into());
19255 self
19256 }
19257
19258 /// Sets or clears the value of [state][crate::model::EffectiveVpcFlowLogsConfig::state].
19259 ///
19260 /// # Example
19261 /// ```ignore,no_run
19262 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19263 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
19264 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(Some(State::Enabled));
19265 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(Some(State::Disabled));
19266 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(None::<State>);
19267 /// ```
19268 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
19269 where
19270 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
19271 {
19272 self.state = v.map(|x| x.into());
19273 self
19274 }
19275
19276 /// Sets the value of [aggregation_interval][crate::model::EffectiveVpcFlowLogsConfig::aggregation_interval].
19277 ///
19278 /// # Example
19279 /// ```ignore,no_run
19280 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19281 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
19282 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval5Sec);
19283 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval30Sec);
19284 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval1Min);
19285 /// ```
19286 pub fn set_aggregation_interval<T>(mut self, v: T) -> Self
19287 where
19288 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
19289 {
19290 self.aggregation_interval = std::option::Option::Some(v.into());
19291 self
19292 }
19293
19294 /// Sets or clears the value of [aggregation_interval][crate::model::EffectiveVpcFlowLogsConfig::aggregation_interval].
19295 ///
19296 /// # Example
19297 /// ```ignore,no_run
19298 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19299 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
19300 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval5Sec));
19301 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval30Sec));
19302 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval1Min));
19303 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(None::<AggregationInterval>);
19304 /// ```
19305 pub fn set_or_clear_aggregation_interval<T>(mut self, v: std::option::Option<T>) -> Self
19306 where
19307 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
19308 {
19309 self.aggregation_interval = v.map(|x| x.into());
19310 self
19311 }
19312
19313 /// Sets the value of [flow_sampling][crate::model::EffectiveVpcFlowLogsConfig::flow_sampling].
19314 ///
19315 /// # Example
19316 /// ```ignore,no_run
19317 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19318 /// let x = EffectiveVpcFlowLogsConfig::new().set_flow_sampling(42.0);
19319 /// ```
19320 pub fn set_flow_sampling<T>(mut self, v: T) -> Self
19321 where
19322 T: std::convert::Into<f32>,
19323 {
19324 self.flow_sampling = std::option::Option::Some(v.into());
19325 self
19326 }
19327
19328 /// Sets or clears the value of [flow_sampling][crate::model::EffectiveVpcFlowLogsConfig::flow_sampling].
19329 ///
19330 /// # Example
19331 /// ```ignore,no_run
19332 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19333 /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_flow_sampling(Some(42.0));
19334 /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_flow_sampling(None::<f32>);
19335 /// ```
19336 pub fn set_or_clear_flow_sampling<T>(mut self, v: std::option::Option<T>) -> Self
19337 where
19338 T: std::convert::Into<f32>,
19339 {
19340 self.flow_sampling = v.map(|x| x.into());
19341 self
19342 }
19343
19344 /// Sets the value of [metadata][crate::model::EffectiveVpcFlowLogsConfig::metadata].
19345 ///
19346 /// # Example
19347 /// ```ignore,no_run
19348 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19349 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
19350 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::IncludeAllMetadata);
19351 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::ExcludeAllMetadata);
19352 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::CustomMetadata);
19353 /// ```
19354 pub fn set_metadata<T>(mut self, v: T) -> Self
19355 where
19356 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
19357 {
19358 self.metadata = std::option::Option::Some(v.into());
19359 self
19360 }
19361
19362 /// Sets or clears the value of [metadata][crate::model::EffectiveVpcFlowLogsConfig::metadata].
19363 ///
19364 /// # Example
19365 /// ```ignore,no_run
19366 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19367 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
19368 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::IncludeAllMetadata));
19369 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::ExcludeAllMetadata));
19370 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::CustomMetadata));
19371 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(None::<Metadata>);
19372 /// ```
19373 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
19374 where
19375 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
19376 {
19377 self.metadata = v.map(|x| x.into());
19378 self
19379 }
19380
19381 /// Sets the value of [metadata_fields][crate::model::EffectiveVpcFlowLogsConfig::metadata_fields].
19382 ///
19383 /// # Example
19384 /// ```ignore,no_run
19385 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19386 /// let x = EffectiveVpcFlowLogsConfig::new().set_metadata_fields(["a", "b", "c"]);
19387 /// ```
19388 pub fn set_metadata_fields<T, V>(mut self, v: T) -> Self
19389 where
19390 T: std::iter::IntoIterator<Item = V>,
19391 V: std::convert::Into<std::string::String>,
19392 {
19393 use std::iter::Iterator;
19394 self.metadata_fields = v.into_iter().map(|i| i.into()).collect();
19395 self
19396 }
19397
19398 /// Sets the value of [filter_expr][crate::model::EffectiveVpcFlowLogsConfig::filter_expr].
19399 ///
19400 /// # Example
19401 /// ```ignore,no_run
19402 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19403 /// let x = EffectiveVpcFlowLogsConfig::new().set_filter_expr("example");
19404 /// ```
19405 pub fn set_filter_expr<T>(mut self, v: T) -> Self
19406 where
19407 T: std::convert::Into<std::string::String>,
19408 {
19409 self.filter_expr = std::option::Option::Some(v.into());
19410 self
19411 }
19412
19413 /// Sets or clears the value of [filter_expr][crate::model::EffectiveVpcFlowLogsConfig::filter_expr].
19414 ///
19415 /// # Example
19416 /// ```ignore,no_run
19417 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19418 /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_filter_expr(Some("example"));
19419 /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_filter_expr(None::<String>);
19420 /// ```
19421 pub fn set_or_clear_filter_expr<T>(mut self, v: std::option::Option<T>) -> Self
19422 where
19423 T: std::convert::Into<std::string::String>,
19424 {
19425 self.filter_expr = v.map(|x| x.into());
19426 self
19427 }
19428
19429 /// Sets the value of [cross_project_metadata][crate::model::EffectiveVpcFlowLogsConfig::cross_project_metadata].
19430 ///
19431 /// # Example
19432 /// ```ignore,no_run
19433 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19434 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
19435 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Enabled);
19436 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Disabled);
19437 /// ```
19438 pub fn set_cross_project_metadata<T>(mut self, v: T) -> Self
19439 where
19440 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
19441 {
19442 self.cross_project_metadata = std::option::Option::Some(v.into());
19443 self
19444 }
19445
19446 /// Sets or clears the value of [cross_project_metadata][crate::model::EffectiveVpcFlowLogsConfig::cross_project_metadata].
19447 ///
19448 /// # Example
19449 /// ```ignore,no_run
19450 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19451 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
19452 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Enabled));
19453 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Disabled));
19454 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(None::<CrossProjectMetadata>);
19455 /// ```
19456 pub fn set_or_clear_cross_project_metadata<T>(mut self, v: std::option::Option<T>) -> Self
19457 where
19458 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
19459 {
19460 self.cross_project_metadata = v.map(|x| x.into());
19461 self
19462 }
19463
19464 /// Sets the value of [scope][crate::model::EffectiveVpcFlowLogsConfig::scope].
19465 ///
19466 /// # Example
19467 /// ```ignore,no_run
19468 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19469 /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::Scope;
19470 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::Subnet);
19471 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::ComputeApiSubnet);
19472 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::Network);
19473 /// ```
19474 pub fn set_scope<T>(mut self, v: T) -> Self
19475 where
19476 T: std::convert::Into<crate::model::effective_vpc_flow_logs_config::Scope>,
19477 {
19478 self.scope = std::option::Option::Some(v.into());
19479 self
19480 }
19481
19482 /// Sets or clears the value of [scope][crate::model::EffectiveVpcFlowLogsConfig::scope].
19483 ///
19484 /// # Example
19485 /// ```ignore,no_run
19486 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19487 /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::Scope;
19488 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::Subnet));
19489 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::ComputeApiSubnet));
19490 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::Network));
19491 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(None::<Scope>);
19492 /// ```
19493 pub fn set_or_clear_scope<T>(mut self, v: std::option::Option<T>) -> Self
19494 where
19495 T: std::convert::Into<crate::model::effective_vpc_flow_logs_config::Scope>,
19496 {
19497 self.scope = v.map(|x| x.into());
19498 self
19499 }
19500
19501 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource].
19502 ///
19503 /// Note that all the setters affecting `target_resource` are mutually
19504 /// exclusive.
19505 ///
19506 /// # Example
19507 /// ```ignore,no_run
19508 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19509 /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::TargetResource;
19510 /// let x = EffectiveVpcFlowLogsConfig::new().set_target_resource(Some(TargetResource::Network("example".to_string())));
19511 /// ```
19512 pub fn set_target_resource<
19513 T: std::convert::Into<
19514 std::option::Option<crate::model::effective_vpc_flow_logs_config::TargetResource>,
19515 >,
19516 >(
19517 mut self,
19518 v: T,
19519 ) -> Self {
19520 self.target_resource = v.into();
19521 self
19522 }
19523
19524 /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19525 /// if it holds a `Network`, `None` if the field is not set or
19526 /// holds a different branch.
19527 pub fn network(&self) -> std::option::Option<&std::string::String> {
19528 #[allow(unreachable_patterns)]
19529 self.target_resource.as_ref().and_then(|v| match v {
19530 crate::model::effective_vpc_flow_logs_config::TargetResource::Network(v) => {
19531 std::option::Option::Some(v)
19532 }
19533 _ => std::option::Option::None,
19534 })
19535 }
19536
19537 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19538 /// to hold a `Network`.
19539 ///
19540 /// Note that all the setters affecting `target_resource` are
19541 /// mutually exclusive.
19542 ///
19543 /// # Example
19544 /// ```ignore,no_run
19545 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19546 /// let x = EffectiveVpcFlowLogsConfig::new().set_network("example");
19547 /// assert!(x.network().is_some());
19548 /// assert!(x.subnet().is_none());
19549 /// assert!(x.interconnect_attachment().is_none());
19550 /// assert!(x.vpn_tunnel().is_none());
19551 /// ```
19552 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19553 self.target_resource = std::option::Option::Some(
19554 crate::model::effective_vpc_flow_logs_config::TargetResource::Network(v.into()),
19555 );
19556 self
19557 }
19558
19559 /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19560 /// if it holds a `Subnet`, `None` if the field is not set or
19561 /// holds a different branch.
19562 pub fn subnet(&self) -> std::option::Option<&std::string::String> {
19563 #[allow(unreachable_patterns)]
19564 self.target_resource.as_ref().and_then(|v| match v {
19565 crate::model::effective_vpc_flow_logs_config::TargetResource::Subnet(v) => {
19566 std::option::Option::Some(v)
19567 }
19568 _ => std::option::Option::None,
19569 })
19570 }
19571
19572 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19573 /// to hold a `Subnet`.
19574 ///
19575 /// Note that all the setters affecting `target_resource` are
19576 /// mutually exclusive.
19577 ///
19578 /// # Example
19579 /// ```ignore,no_run
19580 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19581 /// let x = EffectiveVpcFlowLogsConfig::new().set_subnet("example");
19582 /// assert!(x.subnet().is_some());
19583 /// assert!(x.network().is_none());
19584 /// assert!(x.interconnect_attachment().is_none());
19585 /// assert!(x.vpn_tunnel().is_none());
19586 /// ```
19587 pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19588 self.target_resource = std::option::Option::Some(
19589 crate::model::effective_vpc_flow_logs_config::TargetResource::Subnet(v.into()),
19590 );
19591 self
19592 }
19593
19594 /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19595 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
19596 /// holds a different branch.
19597 pub fn interconnect_attachment(&self) -> std::option::Option<&std::string::String> {
19598 #[allow(unreachable_patterns)]
19599 self.target_resource.as_ref().and_then(|v| match v {
19600 crate::model::effective_vpc_flow_logs_config::TargetResource::InterconnectAttachment(v) => std::option::Option::Some(v),
19601 _ => std::option::Option::None,
19602 })
19603 }
19604
19605 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19606 /// to hold a `InterconnectAttachment`.
19607 ///
19608 /// Note that all the setters affecting `target_resource` are
19609 /// mutually exclusive.
19610 ///
19611 /// # Example
19612 /// ```ignore,no_run
19613 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19614 /// let x = EffectiveVpcFlowLogsConfig::new().set_interconnect_attachment("example");
19615 /// assert!(x.interconnect_attachment().is_some());
19616 /// assert!(x.network().is_none());
19617 /// assert!(x.subnet().is_none());
19618 /// assert!(x.vpn_tunnel().is_none());
19619 /// ```
19620 pub fn set_interconnect_attachment<T: std::convert::Into<std::string::String>>(
19621 mut self,
19622 v: T,
19623 ) -> Self {
19624 self.target_resource = std::option::Option::Some(
19625 crate::model::effective_vpc_flow_logs_config::TargetResource::InterconnectAttachment(
19626 v.into(),
19627 ),
19628 );
19629 self
19630 }
19631
19632 /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19633 /// if it holds a `VpnTunnel`, `None` if the field is not set or
19634 /// holds a different branch.
19635 pub fn vpn_tunnel(&self) -> std::option::Option<&std::string::String> {
19636 #[allow(unreachable_patterns)]
19637 self.target_resource.as_ref().and_then(|v| match v {
19638 crate::model::effective_vpc_flow_logs_config::TargetResource::VpnTunnel(v) => {
19639 std::option::Option::Some(v)
19640 }
19641 _ => std::option::Option::None,
19642 })
19643 }
19644
19645 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
19646 /// to hold a `VpnTunnel`.
19647 ///
19648 /// Note that all the setters affecting `target_resource` are
19649 /// mutually exclusive.
19650 ///
19651 /// # Example
19652 /// ```ignore,no_run
19653 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
19654 /// let x = EffectiveVpcFlowLogsConfig::new().set_vpn_tunnel("example");
19655 /// assert!(x.vpn_tunnel().is_some());
19656 /// assert!(x.network().is_none());
19657 /// assert!(x.subnet().is_none());
19658 /// assert!(x.interconnect_attachment().is_none());
19659 /// ```
19660 pub fn set_vpn_tunnel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19661 self.target_resource = std::option::Option::Some(
19662 crate::model::effective_vpc_flow_logs_config::TargetResource::VpnTunnel(v.into()),
19663 );
19664 self
19665 }
19666}
19667
19668impl wkt::message::Message for EffectiveVpcFlowLogsConfig {
19669 fn typename() -> &'static str {
19670 "type.googleapis.com/google.cloud.networkmanagement.v1.EffectiveVpcFlowLogsConfig"
19671 }
19672}
19673
19674/// Defines additional types related to [EffectiveVpcFlowLogsConfig].
19675pub mod effective_vpc_flow_logs_config {
19676 #[allow(unused_imports)]
19677 use super::*;
19678
19679 /// The scope for this flow log configuration.
19680 ///
19681 /// # Working with unknown values
19682 ///
19683 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19684 /// additional enum variants at any time. Adding new variants is not considered
19685 /// a breaking change. Applications should write their code in anticipation of:
19686 ///
19687 /// - New values appearing in future releases of the client library, **and**
19688 /// - New values received dynamically, without application changes.
19689 ///
19690 /// Please consult the [Working with enums] section in the user guide for some
19691 /// guidelines.
19692 ///
19693 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19694 #[derive(Clone, Debug, PartialEq)]
19695 #[non_exhaustive]
19696 pub enum Scope {
19697 /// Scope is unspecified.
19698 Unspecified,
19699 /// Target resource is a subnet (Network Management API).
19700 Subnet,
19701 /// Target resource is a subnet, and the config originates from the Compute
19702 /// API.
19703 ComputeApiSubnet,
19704 /// Target resource is a network.
19705 Network,
19706 /// Target resource is a VPN tunnel.
19707 VpnTunnel,
19708 /// Target resource is an interconnect attachment.
19709 InterconnectAttachment,
19710 /// Configuration applies to an entire organization.
19711 Organization,
19712 /// If set, the enum was initialized with an unknown value.
19713 ///
19714 /// Applications can examine the value using [Scope::value] or
19715 /// [Scope::name].
19716 UnknownValue(scope::UnknownValue),
19717 }
19718
19719 #[doc(hidden)]
19720 pub mod scope {
19721 #[allow(unused_imports)]
19722 use super::*;
19723 #[derive(Clone, Debug, PartialEq)]
19724 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19725 }
19726
19727 impl Scope {
19728 /// Gets the enum value.
19729 ///
19730 /// Returns `None` if the enum contains an unknown value deserialized from
19731 /// the string representation of enums.
19732 pub fn value(&self) -> std::option::Option<i32> {
19733 match self {
19734 Self::Unspecified => std::option::Option::Some(0),
19735 Self::Subnet => std::option::Option::Some(1),
19736 Self::ComputeApiSubnet => std::option::Option::Some(2),
19737 Self::Network => std::option::Option::Some(3),
19738 Self::VpnTunnel => std::option::Option::Some(4),
19739 Self::InterconnectAttachment => std::option::Option::Some(5),
19740 Self::Organization => std::option::Option::Some(6),
19741 Self::UnknownValue(u) => u.0.value(),
19742 }
19743 }
19744
19745 /// Gets the enum value as a string.
19746 ///
19747 /// Returns `None` if the enum contains an unknown value deserialized from
19748 /// the integer representation of enums.
19749 pub fn name(&self) -> std::option::Option<&str> {
19750 match self {
19751 Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
19752 Self::Subnet => std::option::Option::Some("SUBNET"),
19753 Self::ComputeApiSubnet => std::option::Option::Some("COMPUTE_API_SUBNET"),
19754 Self::Network => std::option::Option::Some("NETWORK"),
19755 Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
19756 Self::InterconnectAttachment => {
19757 std::option::Option::Some("INTERCONNECT_ATTACHMENT")
19758 }
19759 Self::Organization => std::option::Option::Some("ORGANIZATION"),
19760 Self::UnknownValue(u) => u.0.name(),
19761 }
19762 }
19763 }
19764
19765 impl std::default::Default for Scope {
19766 fn default() -> Self {
19767 use std::convert::From;
19768 Self::from(0)
19769 }
19770 }
19771
19772 impl std::fmt::Display for Scope {
19773 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19774 wkt::internal::display_enum(f, self.name(), self.value())
19775 }
19776 }
19777
19778 impl std::convert::From<i32> for Scope {
19779 fn from(value: i32) -> Self {
19780 match value {
19781 0 => Self::Unspecified,
19782 1 => Self::Subnet,
19783 2 => Self::ComputeApiSubnet,
19784 3 => Self::Network,
19785 4 => Self::VpnTunnel,
19786 5 => Self::InterconnectAttachment,
19787 6 => Self::Organization,
19788 _ => Self::UnknownValue(scope::UnknownValue(
19789 wkt::internal::UnknownEnumValue::Integer(value),
19790 )),
19791 }
19792 }
19793 }
19794
19795 impl std::convert::From<&str> for Scope {
19796 fn from(value: &str) -> Self {
19797 use std::string::ToString;
19798 match value {
19799 "SCOPE_UNSPECIFIED" => Self::Unspecified,
19800 "SUBNET" => Self::Subnet,
19801 "COMPUTE_API_SUBNET" => Self::ComputeApiSubnet,
19802 "NETWORK" => Self::Network,
19803 "VPN_TUNNEL" => Self::VpnTunnel,
19804 "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
19805 "ORGANIZATION" => Self::Organization,
19806 _ => Self::UnknownValue(scope::UnknownValue(
19807 wkt::internal::UnknownEnumValue::String(value.to_string()),
19808 )),
19809 }
19810 }
19811 }
19812
19813 impl serde::ser::Serialize for Scope {
19814 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19815 where
19816 S: serde::Serializer,
19817 {
19818 match self {
19819 Self::Unspecified => serializer.serialize_i32(0),
19820 Self::Subnet => serializer.serialize_i32(1),
19821 Self::ComputeApiSubnet => serializer.serialize_i32(2),
19822 Self::Network => serializer.serialize_i32(3),
19823 Self::VpnTunnel => serializer.serialize_i32(4),
19824 Self::InterconnectAttachment => serializer.serialize_i32(5),
19825 Self::Organization => serializer.serialize_i32(6),
19826 Self::UnknownValue(u) => u.0.serialize(serializer),
19827 }
19828 }
19829 }
19830
19831 impl<'de> serde::de::Deserialize<'de> for Scope {
19832 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19833 where
19834 D: serde::Deserializer<'de>,
19835 {
19836 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
19837 ".google.cloud.networkmanagement.v1.EffectiveVpcFlowLogsConfig.Scope",
19838 ))
19839 }
19840 }
19841
19842 /// Reference to the resource of the config scope. That is, the scope from
19843 /// which traffic is logged. The target resource must belong to the same
19844 /// project as the configuration.
19845 /// This field is not supported for organization level configurations.
19846 #[derive(Clone, Debug, PartialEq)]
19847 #[non_exhaustive]
19848 pub enum TargetResource {
19849 /// Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
19850 /// within the network.
19851 /// Format: projects/{project_id}/global/networks/{name}
19852 Network(std::string::String),
19853 /// Traffic will be logged from VMs within the subnetwork.
19854 /// Format: projects/{project_id}/regions/{region}/subnetworks/{name}
19855 Subnet(std::string::String),
19856 /// Traffic will be logged from the Interconnect Attachment.
19857 /// Format:
19858 /// projects/{project_id}/regions/{region}/interconnectAttachments/{name}
19859 InterconnectAttachment(std::string::String),
19860 /// Traffic will be logged from the VPN Tunnel.
19861 /// Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
19862 VpnTunnel(std::string::String),
19863 }
19864}
19865
19866/// Type of a load balancer. For more information, see [Summary of Google Cloud
19867/// load
19868/// balancers](https://cloud.google.com/load-balancing/docs/load-balancing-overview#summary-of-google-cloud-load-balancers).
19869///
19870/// # Working with unknown values
19871///
19872/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19873/// additional enum variants at any time. Adding new variants is not considered
19874/// a breaking change. Applications should write their code in anticipation of:
19875///
19876/// - New values appearing in future releases of the client library, **and**
19877/// - New values received dynamically, without application changes.
19878///
19879/// Please consult the [Working with enums] section in the user guide for some
19880/// guidelines.
19881///
19882/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19883#[derive(Clone, Debug, PartialEq)]
19884#[non_exhaustive]
19885pub enum LoadBalancerType {
19886 /// Forwarding rule points to a different target than a load balancer or a
19887 /// load balancer type is unknown.
19888 Unspecified,
19889 /// Global external HTTP(S) load balancer.
19890 HttpsAdvancedLoadBalancer,
19891 /// Global external HTTP(S) load balancer (classic)
19892 HttpsLoadBalancer,
19893 /// Regional external HTTP(S) load balancer.
19894 RegionalHttpsLoadBalancer,
19895 /// Internal HTTP(S) load balancer.
19896 InternalHttpsLoadBalancer,
19897 /// External SSL proxy load balancer.
19898 SslProxyLoadBalancer,
19899 /// External TCP proxy load balancer.
19900 TcpProxyLoadBalancer,
19901 /// Internal regional TCP proxy load balancer.
19902 InternalTcpProxyLoadBalancer,
19903 /// External TCP/UDP Network load balancer.
19904 NetworkLoadBalancer,
19905 /// Target-pool based external TCP/UDP Network load balancer.
19906 LegacyNetworkLoadBalancer,
19907 /// Internal TCP/UDP load balancer.
19908 TcpUdpInternalLoadBalancer,
19909 /// If set, the enum was initialized with an unknown value.
19910 ///
19911 /// Applications can examine the value using [LoadBalancerType::value] or
19912 /// [LoadBalancerType::name].
19913 UnknownValue(load_balancer_type::UnknownValue),
19914}
19915
19916#[doc(hidden)]
19917pub mod load_balancer_type {
19918 #[allow(unused_imports)]
19919 use super::*;
19920 #[derive(Clone, Debug, PartialEq)]
19921 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19922}
19923
19924impl LoadBalancerType {
19925 /// Gets the enum value.
19926 ///
19927 /// Returns `None` if the enum contains an unknown value deserialized from
19928 /// the string representation of enums.
19929 pub fn value(&self) -> std::option::Option<i32> {
19930 match self {
19931 Self::Unspecified => std::option::Option::Some(0),
19932 Self::HttpsAdvancedLoadBalancer => std::option::Option::Some(1),
19933 Self::HttpsLoadBalancer => std::option::Option::Some(2),
19934 Self::RegionalHttpsLoadBalancer => std::option::Option::Some(3),
19935 Self::InternalHttpsLoadBalancer => std::option::Option::Some(4),
19936 Self::SslProxyLoadBalancer => std::option::Option::Some(5),
19937 Self::TcpProxyLoadBalancer => std::option::Option::Some(6),
19938 Self::InternalTcpProxyLoadBalancer => std::option::Option::Some(7),
19939 Self::NetworkLoadBalancer => std::option::Option::Some(8),
19940 Self::LegacyNetworkLoadBalancer => std::option::Option::Some(9),
19941 Self::TcpUdpInternalLoadBalancer => std::option::Option::Some(10),
19942 Self::UnknownValue(u) => u.0.value(),
19943 }
19944 }
19945
19946 /// Gets the enum value as a string.
19947 ///
19948 /// Returns `None` if the enum contains an unknown value deserialized from
19949 /// the integer representation of enums.
19950 pub fn name(&self) -> std::option::Option<&str> {
19951 match self {
19952 Self::Unspecified => std::option::Option::Some("LOAD_BALANCER_TYPE_UNSPECIFIED"),
19953 Self::HttpsAdvancedLoadBalancer => {
19954 std::option::Option::Some("HTTPS_ADVANCED_LOAD_BALANCER")
19955 }
19956 Self::HttpsLoadBalancer => std::option::Option::Some("HTTPS_LOAD_BALANCER"),
19957 Self::RegionalHttpsLoadBalancer => {
19958 std::option::Option::Some("REGIONAL_HTTPS_LOAD_BALANCER")
19959 }
19960 Self::InternalHttpsLoadBalancer => {
19961 std::option::Option::Some("INTERNAL_HTTPS_LOAD_BALANCER")
19962 }
19963 Self::SslProxyLoadBalancer => std::option::Option::Some("SSL_PROXY_LOAD_BALANCER"),
19964 Self::TcpProxyLoadBalancer => std::option::Option::Some("TCP_PROXY_LOAD_BALANCER"),
19965 Self::InternalTcpProxyLoadBalancer => {
19966 std::option::Option::Some("INTERNAL_TCP_PROXY_LOAD_BALANCER")
19967 }
19968 Self::NetworkLoadBalancer => std::option::Option::Some("NETWORK_LOAD_BALANCER"),
19969 Self::LegacyNetworkLoadBalancer => {
19970 std::option::Option::Some("LEGACY_NETWORK_LOAD_BALANCER")
19971 }
19972 Self::TcpUdpInternalLoadBalancer => {
19973 std::option::Option::Some("TCP_UDP_INTERNAL_LOAD_BALANCER")
19974 }
19975 Self::UnknownValue(u) => u.0.name(),
19976 }
19977 }
19978}
19979
19980impl std::default::Default for LoadBalancerType {
19981 fn default() -> Self {
19982 use std::convert::From;
19983 Self::from(0)
19984 }
19985}
19986
19987impl std::fmt::Display for LoadBalancerType {
19988 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19989 wkt::internal::display_enum(f, self.name(), self.value())
19990 }
19991}
19992
19993impl std::convert::From<i32> for LoadBalancerType {
19994 fn from(value: i32) -> Self {
19995 match value {
19996 0 => Self::Unspecified,
19997 1 => Self::HttpsAdvancedLoadBalancer,
19998 2 => Self::HttpsLoadBalancer,
19999 3 => Self::RegionalHttpsLoadBalancer,
20000 4 => Self::InternalHttpsLoadBalancer,
20001 5 => Self::SslProxyLoadBalancer,
20002 6 => Self::TcpProxyLoadBalancer,
20003 7 => Self::InternalTcpProxyLoadBalancer,
20004 8 => Self::NetworkLoadBalancer,
20005 9 => Self::LegacyNetworkLoadBalancer,
20006 10 => Self::TcpUdpInternalLoadBalancer,
20007 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
20008 wkt::internal::UnknownEnumValue::Integer(value),
20009 )),
20010 }
20011 }
20012}
20013
20014impl std::convert::From<&str> for LoadBalancerType {
20015 fn from(value: &str) -> Self {
20016 use std::string::ToString;
20017 match value {
20018 "LOAD_BALANCER_TYPE_UNSPECIFIED" => Self::Unspecified,
20019 "HTTPS_ADVANCED_LOAD_BALANCER" => Self::HttpsAdvancedLoadBalancer,
20020 "HTTPS_LOAD_BALANCER" => Self::HttpsLoadBalancer,
20021 "REGIONAL_HTTPS_LOAD_BALANCER" => Self::RegionalHttpsLoadBalancer,
20022 "INTERNAL_HTTPS_LOAD_BALANCER" => Self::InternalHttpsLoadBalancer,
20023 "SSL_PROXY_LOAD_BALANCER" => Self::SslProxyLoadBalancer,
20024 "TCP_PROXY_LOAD_BALANCER" => Self::TcpProxyLoadBalancer,
20025 "INTERNAL_TCP_PROXY_LOAD_BALANCER" => Self::InternalTcpProxyLoadBalancer,
20026 "NETWORK_LOAD_BALANCER" => Self::NetworkLoadBalancer,
20027 "LEGACY_NETWORK_LOAD_BALANCER" => Self::LegacyNetworkLoadBalancer,
20028 "TCP_UDP_INTERNAL_LOAD_BALANCER" => Self::TcpUdpInternalLoadBalancer,
20029 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
20030 wkt::internal::UnknownEnumValue::String(value.to_string()),
20031 )),
20032 }
20033 }
20034}
20035
20036impl serde::ser::Serialize for LoadBalancerType {
20037 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20038 where
20039 S: serde::Serializer,
20040 {
20041 match self {
20042 Self::Unspecified => serializer.serialize_i32(0),
20043 Self::HttpsAdvancedLoadBalancer => serializer.serialize_i32(1),
20044 Self::HttpsLoadBalancer => serializer.serialize_i32(2),
20045 Self::RegionalHttpsLoadBalancer => serializer.serialize_i32(3),
20046 Self::InternalHttpsLoadBalancer => serializer.serialize_i32(4),
20047 Self::SslProxyLoadBalancer => serializer.serialize_i32(5),
20048 Self::TcpProxyLoadBalancer => serializer.serialize_i32(6),
20049 Self::InternalTcpProxyLoadBalancer => serializer.serialize_i32(7),
20050 Self::NetworkLoadBalancer => serializer.serialize_i32(8),
20051 Self::LegacyNetworkLoadBalancer => serializer.serialize_i32(9),
20052 Self::TcpUdpInternalLoadBalancer => serializer.serialize_i32(10),
20053 Self::UnknownValue(u) => u.0.serialize(serializer),
20054 }
20055 }
20056}
20057
20058impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
20059 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20060 where
20061 D: serde::Deserializer<'de>,
20062 {
20063 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
20064 ".google.cloud.networkmanagement.v1.LoadBalancerType",
20065 ))
20066 }
20067}