google_cloud_networkmanagement_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate iam_v1;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate rpc;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// A Connectivity Test for a network reachability analysis.
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct ConnectivityTest {
46 /// Identifier. Unique name of the resource using the form:
47 /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
48 pub name: std::string::String,
49
50 /// The user-supplied description of the Connectivity Test.
51 /// Maximum of 512 characters.
52 pub description: std::string::String,
53
54 /// Required. Source specification of the Connectivity Test.
55 ///
56 /// You can use a combination of source IP address, URI of a supported
57 /// endpoint, project ID, or VPC network to identify the source location.
58 ///
59 /// Reachability analysis might proceed even if the source location is
60 /// ambiguous. However, the test result might include endpoints or use a source
61 /// that you don't intend to test.
62 pub source: std::option::Option<crate::model::Endpoint>,
63
64 /// Required. Destination specification of the Connectivity Test.
65 ///
66 /// You can use a combination of destination IP address, URI of a supported
67 /// endpoint, project ID, or VPC network to identify the destination location.
68 ///
69 /// Reachability analysis proceeds even if the destination location is
70 /// ambiguous. However, the test result might include endpoints or use a
71 /// destination that you don't intend to test.
72 pub destination: std::option::Option<crate::model::Endpoint>,
73
74 /// IP Protocol of the test. When not provided, "TCP" is assumed.
75 pub protocol: std::string::String,
76
77 /// Other projects that may be relevant for reachability analysis.
78 /// This is applicable to scenarios where a test can cross project boundaries.
79 pub related_projects: std::vec::Vec<std::string::String>,
80
81 /// Output only. The display name of a Connectivity Test.
82 pub display_name: std::string::String,
83
84 /// Resource labels to represent user-provided metadata.
85 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
86
87 /// Output only. The time the test was created.
88 pub create_time: std::option::Option<wkt::Timestamp>,
89
90 /// Output only. The time the test's configuration was updated.
91 pub update_time: std::option::Option<wkt::Timestamp>,
92
93 /// Output only. The reachability details of this test from the latest run.
94 /// The details are updated when creating a new test, updating an
95 /// existing test, or triggering a one-time rerun of an existing test.
96 pub reachability_details: std::option::Option<crate::model::ReachabilityDetails>,
97
98 /// Output only. The probing details of this test from the latest run, present
99 /// for applicable tests only. The details are updated when creating a new
100 /// test, updating an existing test, or triggering a one-time rerun of an
101 /// existing test.
102 pub probing_details: std::option::Option<crate::model::ProbingDetails>,
103
104 /// Whether run analysis for the return path from destination to source.
105 /// Default value is false.
106 pub round_trip: bool,
107
108 /// Output only. The reachability details of this test from the latest run for
109 /// the return path. The details are updated when creating a new test,
110 /// updating an existing test, or triggering a one-time rerun of an existing
111 /// test.
112 pub return_reachability_details: std::option::Option<crate::model::ReachabilityDetails>,
113
114 /// Whether the analysis should skip firewall checking. Default value is false.
115 pub bypass_firewall_checks: bool,
116
117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
118}
119
120impl ConnectivityTest {
121 pub fn new() -> Self {
122 std::default::Default::default()
123 }
124
125 /// Sets the value of [name][crate::model::ConnectivityTest::name].
126 ///
127 /// # Example
128 /// ```ignore,no_run
129 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
130 /// let x = ConnectivityTest::new().set_name("example");
131 /// ```
132 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
133 self.name = v.into();
134 self
135 }
136
137 /// Sets the value of [description][crate::model::ConnectivityTest::description].
138 ///
139 /// # Example
140 /// ```ignore,no_run
141 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
142 /// let x = ConnectivityTest::new().set_description("example");
143 /// ```
144 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
145 self.description = v.into();
146 self
147 }
148
149 /// Sets the value of [source][crate::model::ConnectivityTest::source].
150 ///
151 /// # Example
152 /// ```ignore,no_run
153 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
154 /// use google_cloud_networkmanagement_v1::model::Endpoint;
155 /// let x = ConnectivityTest::new().set_source(Endpoint::default()/* use setters */);
156 /// ```
157 pub fn set_source<T>(mut self, v: T) -> Self
158 where
159 T: std::convert::Into<crate::model::Endpoint>,
160 {
161 self.source = std::option::Option::Some(v.into());
162 self
163 }
164
165 /// Sets or clears the value of [source][crate::model::ConnectivityTest::source].
166 ///
167 /// # Example
168 /// ```ignore,no_run
169 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
170 /// use google_cloud_networkmanagement_v1::model::Endpoint;
171 /// let x = ConnectivityTest::new().set_or_clear_source(Some(Endpoint::default()/* use setters */));
172 /// let x = ConnectivityTest::new().set_or_clear_source(None::<Endpoint>);
173 /// ```
174 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
175 where
176 T: std::convert::Into<crate::model::Endpoint>,
177 {
178 self.source = v.map(|x| x.into());
179 self
180 }
181
182 /// Sets the value of [destination][crate::model::ConnectivityTest::destination].
183 ///
184 /// # Example
185 /// ```ignore,no_run
186 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
187 /// use google_cloud_networkmanagement_v1::model::Endpoint;
188 /// let x = ConnectivityTest::new().set_destination(Endpoint::default()/* use setters */);
189 /// ```
190 pub fn set_destination<T>(mut self, v: T) -> Self
191 where
192 T: std::convert::Into<crate::model::Endpoint>,
193 {
194 self.destination = std::option::Option::Some(v.into());
195 self
196 }
197
198 /// Sets or clears the value of [destination][crate::model::ConnectivityTest::destination].
199 ///
200 /// # Example
201 /// ```ignore,no_run
202 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
203 /// use google_cloud_networkmanagement_v1::model::Endpoint;
204 /// let x = ConnectivityTest::new().set_or_clear_destination(Some(Endpoint::default()/* use setters */));
205 /// let x = ConnectivityTest::new().set_or_clear_destination(None::<Endpoint>);
206 /// ```
207 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
208 where
209 T: std::convert::Into<crate::model::Endpoint>,
210 {
211 self.destination = v.map(|x| x.into());
212 self
213 }
214
215 /// Sets the value of [protocol][crate::model::ConnectivityTest::protocol].
216 ///
217 /// # Example
218 /// ```ignore,no_run
219 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
220 /// let x = ConnectivityTest::new().set_protocol("example");
221 /// ```
222 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
223 self.protocol = v.into();
224 self
225 }
226
227 /// Sets the value of [related_projects][crate::model::ConnectivityTest::related_projects].
228 ///
229 /// # Example
230 /// ```ignore,no_run
231 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
232 /// let x = ConnectivityTest::new().set_related_projects(["a", "b", "c"]);
233 /// ```
234 pub fn set_related_projects<T, V>(mut self, v: T) -> Self
235 where
236 T: std::iter::IntoIterator<Item = V>,
237 V: std::convert::Into<std::string::String>,
238 {
239 use std::iter::Iterator;
240 self.related_projects = v.into_iter().map(|i| i.into()).collect();
241 self
242 }
243
244 /// Sets the value of [display_name][crate::model::ConnectivityTest::display_name].
245 ///
246 /// # Example
247 /// ```ignore,no_run
248 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
249 /// let x = ConnectivityTest::new().set_display_name("example");
250 /// ```
251 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
252 self.display_name = v.into();
253 self
254 }
255
256 /// Sets the value of [labels][crate::model::ConnectivityTest::labels].
257 ///
258 /// # Example
259 /// ```ignore,no_run
260 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
261 /// let x = ConnectivityTest::new().set_labels([
262 /// ("key0", "abc"),
263 /// ("key1", "xyz"),
264 /// ]);
265 /// ```
266 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
267 where
268 T: std::iter::IntoIterator<Item = (K, V)>,
269 K: std::convert::Into<std::string::String>,
270 V: std::convert::Into<std::string::String>,
271 {
272 use std::iter::Iterator;
273 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
274 self
275 }
276
277 /// Sets the value of [create_time][crate::model::ConnectivityTest::create_time].
278 ///
279 /// # Example
280 /// ```ignore,no_run
281 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
282 /// use wkt::Timestamp;
283 /// let x = ConnectivityTest::new().set_create_time(Timestamp::default()/* use setters */);
284 /// ```
285 pub fn set_create_time<T>(mut self, v: T) -> Self
286 where
287 T: std::convert::Into<wkt::Timestamp>,
288 {
289 self.create_time = std::option::Option::Some(v.into());
290 self
291 }
292
293 /// Sets or clears the value of [create_time][crate::model::ConnectivityTest::create_time].
294 ///
295 /// # Example
296 /// ```ignore,no_run
297 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
298 /// use wkt::Timestamp;
299 /// let x = ConnectivityTest::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
300 /// let x = ConnectivityTest::new().set_or_clear_create_time(None::<Timestamp>);
301 /// ```
302 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
303 where
304 T: std::convert::Into<wkt::Timestamp>,
305 {
306 self.create_time = v.map(|x| x.into());
307 self
308 }
309
310 /// Sets the value of [update_time][crate::model::ConnectivityTest::update_time].
311 ///
312 /// # Example
313 /// ```ignore,no_run
314 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
315 /// use wkt::Timestamp;
316 /// let x = ConnectivityTest::new().set_update_time(Timestamp::default()/* use setters */);
317 /// ```
318 pub fn set_update_time<T>(mut self, v: T) -> Self
319 where
320 T: std::convert::Into<wkt::Timestamp>,
321 {
322 self.update_time = std::option::Option::Some(v.into());
323 self
324 }
325
326 /// Sets or clears the value of [update_time][crate::model::ConnectivityTest::update_time].
327 ///
328 /// # Example
329 /// ```ignore,no_run
330 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
331 /// use wkt::Timestamp;
332 /// let x = ConnectivityTest::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
333 /// let x = ConnectivityTest::new().set_or_clear_update_time(None::<Timestamp>);
334 /// ```
335 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
336 where
337 T: std::convert::Into<wkt::Timestamp>,
338 {
339 self.update_time = v.map(|x| x.into());
340 self
341 }
342
343 /// Sets the value of [reachability_details][crate::model::ConnectivityTest::reachability_details].
344 ///
345 /// # Example
346 /// ```ignore,no_run
347 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
348 /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
349 /// let x = ConnectivityTest::new().set_reachability_details(ReachabilityDetails::default()/* use setters */);
350 /// ```
351 pub fn set_reachability_details<T>(mut self, v: T) -> Self
352 where
353 T: std::convert::Into<crate::model::ReachabilityDetails>,
354 {
355 self.reachability_details = std::option::Option::Some(v.into());
356 self
357 }
358
359 /// Sets or clears the value of [reachability_details][crate::model::ConnectivityTest::reachability_details].
360 ///
361 /// # Example
362 /// ```ignore,no_run
363 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
364 /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
365 /// let x = ConnectivityTest::new().set_or_clear_reachability_details(Some(ReachabilityDetails::default()/* use setters */));
366 /// let x = ConnectivityTest::new().set_or_clear_reachability_details(None::<ReachabilityDetails>);
367 /// ```
368 pub fn set_or_clear_reachability_details<T>(mut self, v: std::option::Option<T>) -> Self
369 where
370 T: std::convert::Into<crate::model::ReachabilityDetails>,
371 {
372 self.reachability_details = v.map(|x| x.into());
373 self
374 }
375
376 /// Sets the value of [probing_details][crate::model::ConnectivityTest::probing_details].
377 ///
378 /// # Example
379 /// ```ignore,no_run
380 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
381 /// use google_cloud_networkmanagement_v1::model::ProbingDetails;
382 /// let x = ConnectivityTest::new().set_probing_details(ProbingDetails::default()/* use setters */);
383 /// ```
384 pub fn set_probing_details<T>(mut self, v: T) -> Self
385 where
386 T: std::convert::Into<crate::model::ProbingDetails>,
387 {
388 self.probing_details = std::option::Option::Some(v.into());
389 self
390 }
391
392 /// Sets or clears the value of [probing_details][crate::model::ConnectivityTest::probing_details].
393 ///
394 /// # Example
395 /// ```ignore,no_run
396 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
397 /// use google_cloud_networkmanagement_v1::model::ProbingDetails;
398 /// let x = ConnectivityTest::new().set_or_clear_probing_details(Some(ProbingDetails::default()/* use setters */));
399 /// let x = ConnectivityTest::new().set_or_clear_probing_details(None::<ProbingDetails>);
400 /// ```
401 pub fn set_or_clear_probing_details<T>(mut self, v: std::option::Option<T>) -> Self
402 where
403 T: std::convert::Into<crate::model::ProbingDetails>,
404 {
405 self.probing_details = v.map(|x| x.into());
406 self
407 }
408
409 /// Sets the value of [round_trip][crate::model::ConnectivityTest::round_trip].
410 ///
411 /// # Example
412 /// ```ignore,no_run
413 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
414 /// let x = ConnectivityTest::new().set_round_trip(true);
415 /// ```
416 pub fn set_round_trip<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
417 self.round_trip = v.into();
418 self
419 }
420
421 /// Sets the value of [return_reachability_details][crate::model::ConnectivityTest::return_reachability_details].
422 ///
423 /// # Example
424 /// ```ignore,no_run
425 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
426 /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
427 /// let x = ConnectivityTest::new().set_return_reachability_details(ReachabilityDetails::default()/* use setters */);
428 /// ```
429 pub fn set_return_reachability_details<T>(mut self, v: T) -> Self
430 where
431 T: std::convert::Into<crate::model::ReachabilityDetails>,
432 {
433 self.return_reachability_details = std::option::Option::Some(v.into());
434 self
435 }
436
437 /// Sets or clears the value of [return_reachability_details][crate::model::ConnectivityTest::return_reachability_details].
438 ///
439 /// # Example
440 /// ```ignore,no_run
441 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
442 /// use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
443 /// let x = ConnectivityTest::new().set_or_clear_return_reachability_details(Some(ReachabilityDetails::default()/* use setters */));
444 /// let x = ConnectivityTest::new().set_or_clear_return_reachability_details(None::<ReachabilityDetails>);
445 /// ```
446 pub fn set_or_clear_return_reachability_details<T>(mut self, v: std::option::Option<T>) -> Self
447 where
448 T: std::convert::Into<crate::model::ReachabilityDetails>,
449 {
450 self.return_reachability_details = v.map(|x| x.into());
451 self
452 }
453
454 /// Sets the value of [bypass_firewall_checks][crate::model::ConnectivityTest::bypass_firewall_checks].
455 ///
456 /// # Example
457 /// ```ignore,no_run
458 /// # use google_cloud_networkmanagement_v1::model::ConnectivityTest;
459 /// let x = ConnectivityTest::new().set_bypass_firewall_checks(true);
460 /// ```
461 pub fn set_bypass_firewall_checks<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
462 self.bypass_firewall_checks = v.into();
463 self
464 }
465}
466
467impl wkt::message::Message for ConnectivityTest {
468 fn typename() -> &'static str {
469 "type.googleapis.com/google.cloud.networkmanagement.v1.ConnectivityTest"
470 }
471}
472
473/// Source or destination of the Connectivity Test.
474#[derive(Clone, Default, PartialEq)]
475#[non_exhaustive]
476pub struct Endpoint {
477 /// The IP address of the endpoint, which can be an external or internal IP.
478 pub ip_address: std::string::String,
479
480 /// The IP protocol port of the endpoint.
481 /// Only applicable when protocol is TCP or UDP.
482 pub port: i32,
483
484 /// A Compute Engine instance URI.
485 pub instance: std::string::String,
486
487 /// A forwarding rule and its corresponding IP address represent the frontend
488 /// configuration of a Google Cloud load balancer. Forwarding rules are also
489 /// used for protocol forwarding, Private Service Connect and other network
490 /// services to provide forwarding information in the control plane. Applicable
491 /// only to destination endpoint. Format:
492 /// `projects/{project}/global/forwardingRules/{id}` or
493 /// `projects/{project}/regions/{region}/forwardingRules/{id}`
494 pub forwarding_rule: std::string::String,
495
496 /// Output only. Specifies the type of the target of the forwarding rule.
497 pub forwarding_rule_target: std::option::Option<crate::model::endpoint::ForwardingRuleTarget>,
498
499 /// Output only. ID of the load balancer the forwarding rule points to. Empty
500 /// for forwarding rules not related to load balancers.
501 pub load_balancer_id: std::option::Option<std::string::String>,
502
503 /// Output only. Type of the load balancer the forwarding rule points to.
504 pub load_balancer_type: std::option::Option<crate::model::LoadBalancerType>,
505
506 /// A cluster URI for [Google Kubernetes Engine cluster control
507 /// plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
508 pub gke_master_cluster: std::string::String,
509
510 /// DNS endpoint of [Google Kubernetes Engine cluster control
511 /// plane](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture).
512 /// Requires gke_master_cluster to be set, can't be used simultaneoulsly with
513 /// ip_address or network. Applicable only to destination endpoint.
514 pub fqdn: std::string::String,
515
516 /// A [Cloud SQL](https://cloud.google.com/sql) instance URI.
517 pub cloud_sql_instance: std::string::String,
518
519 /// A [Redis Instance](https://cloud.google.com/memorystore/docs/redis) URI.
520 /// Applicable only to destination endpoint.
521 pub redis_instance: std::string::String,
522
523 /// A [Redis Cluster](https://cloud.google.com/memorystore/docs/cluster) URI.
524 /// Applicable only to destination endpoint.
525 pub redis_cluster: std::string::String,
526
527 /// A [Cloud Function](https://cloud.google.com/functions). Applicable only to
528 /// source endpoint.
529 pub cloud_function: std::option::Option<crate::model::endpoint::CloudFunctionEndpoint>,
530
531 /// An [App Engine](https://cloud.google.com/appengine) [service
532 /// version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions).
533 /// Applicable only to source endpoint.
534 pub app_engine_version: std::option::Option<crate::model::endpoint::AppEngineVersionEndpoint>,
535
536 /// A [Cloud Run](https://cloud.google.com/run)
537 /// [revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get)
538 /// Applicable only to source endpoint.
539 pub cloud_run_revision: std::option::Option<crate::model::endpoint::CloudRunRevisionEndpoint>,
540
541 /// A VPC network URI.
542 pub network: std::string::String,
543
544 /// Type of the network where the endpoint is located.
545 /// Applicable only to source endpoint, as destination network type can be
546 /// inferred from the source.
547 pub network_type: crate::model::endpoint::NetworkType,
548
549 /// Project ID where the endpoint is located.
550 /// The project ID can be derived from the URI if you provide a endpoint or
551 /// network URI.
552 /// The following are two cases where you may need to provide the project ID:
553 ///
554 /// 1. Only the IP address is specified, and the IP address is within a Google
555 /// Cloud project.
556 /// 1. When you are using Shared VPC and the IP address that you provide is
557 /// from the service project. In this case, the network that the IP address
558 /// resides in is defined in the host project.
559 pub project_id: std::string::String,
560
561 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
562}
563
564impl Endpoint {
565 pub fn new() -> Self {
566 std::default::Default::default()
567 }
568
569 /// Sets the value of [ip_address][crate::model::Endpoint::ip_address].
570 ///
571 /// # Example
572 /// ```ignore,no_run
573 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
574 /// let x = Endpoint::new().set_ip_address("example");
575 /// ```
576 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
577 self.ip_address = v.into();
578 self
579 }
580
581 /// Sets the value of [port][crate::model::Endpoint::port].
582 ///
583 /// # Example
584 /// ```ignore,no_run
585 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
586 /// let x = Endpoint::new().set_port(42);
587 /// ```
588 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
589 self.port = v.into();
590 self
591 }
592
593 /// Sets the value of [instance][crate::model::Endpoint::instance].
594 ///
595 /// # Example
596 /// ```ignore,no_run
597 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
598 /// let x = Endpoint::new().set_instance("example");
599 /// ```
600 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
601 self.instance = v.into();
602 self
603 }
604
605 /// Sets the value of [forwarding_rule][crate::model::Endpoint::forwarding_rule].
606 ///
607 /// # Example
608 /// ```ignore,no_run
609 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
610 /// let x = Endpoint::new().set_forwarding_rule("example");
611 /// ```
612 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
613 self.forwarding_rule = v.into();
614 self
615 }
616
617 /// Sets the value of [forwarding_rule_target][crate::model::Endpoint::forwarding_rule_target].
618 ///
619 /// # Example
620 /// ```ignore,no_run
621 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
622 /// use google_cloud_networkmanagement_v1::model::endpoint::ForwardingRuleTarget;
623 /// let x0 = Endpoint::new().set_forwarding_rule_target(ForwardingRuleTarget::Instance);
624 /// let x1 = Endpoint::new().set_forwarding_rule_target(ForwardingRuleTarget::LoadBalancer);
625 /// let x2 = Endpoint::new().set_forwarding_rule_target(ForwardingRuleTarget::VpnGateway);
626 /// ```
627 pub fn set_forwarding_rule_target<T>(mut self, v: T) -> Self
628 where
629 T: std::convert::Into<crate::model::endpoint::ForwardingRuleTarget>,
630 {
631 self.forwarding_rule_target = std::option::Option::Some(v.into());
632 self
633 }
634
635 /// Sets or clears the value of [forwarding_rule_target][crate::model::Endpoint::forwarding_rule_target].
636 ///
637 /// # Example
638 /// ```ignore,no_run
639 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
640 /// use google_cloud_networkmanagement_v1::model::endpoint::ForwardingRuleTarget;
641 /// let x0 = Endpoint::new().set_or_clear_forwarding_rule_target(Some(ForwardingRuleTarget::Instance));
642 /// let x1 = Endpoint::new().set_or_clear_forwarding_rule_target(Some(ForwardingRuleTarget::LoadBalancer));
643 /// let x2 = Endpoint::new().set_or_clear_forwarding_rule_target(Some(ForwardingRuleTarget::VpnGateway));
644 /// let x_none = Endpoint::new().set_or_clear_forwarding_rule_target(None::<ForwardingRuleTarget>);
645 /// ```
646 pub fn set_or_clear_forwarding_rule_target<T>(mut self, v: std::option::Option<T>) -> Self
647 where
648 T: std::convert::Into<crate::model::endpoint::ForwardingRuleTarget>,
649 {
650 self.forwarding_rule_target = v.map(|x| x.into());
651 self
652 }
653
654 /// Sets the value of [load_balancer_id][crate::model::Endpoint::load_balancer_id].
655 ///
656 /// # Example
657 /// ```ignore,no_run
658 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
659 /// let x = Endpoint::new().set_load_balancer_id("example");
660 /// ```
661 pub fn set_load_balancer_id<T>(mut self, v: T) -> Self
662 where
663 T: std::convert::Into<std::string::String>,
664 {
665 self.load_balancer_id = std::option::Option::Some(v.into());
666 self
667 }
668
669 /// Sets or clears the value of [load_balancer_id][crate::model::Endpoint::load_balancer_id].
670 ///
671 /// # Example
672 /// ```ignore,no_run
673 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
674 /// let x = Endpoint::new().set_or_clear_load_balancer_id(Some("example"));
675 /// let x = Endpoint::new().set_or_clear_load_balancer_id(None::<String>);
676 /// ```
677 pub fn set_or_clear_load_balancer_id<T>(mut self, v: std::option::Option<T>) -> Self
678 where
679 T: std::convert::Into<std::string::String>,
680 {
681 self.load_balancer_id = v.map(|x| x.into());
682 self
683 }
684
685 /// Sets the value of [load_balancer_type][crate::model::Endpoint::load_balancer_type].
686 ///
687 /// # Example
688 /// ```ignore,no_run
689 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
690 /// use google_cloud_networkmanagement_v1::model::LoadBalancerType;
691 /// let x0 = Endpoint::new().set_load_balancer_type(LoadBalancerType::HttpsAdvancedLoadBalancer);
692 /// let x1 = Endpoint::new().set_load_balancer_type(LoadBalancerType::HttpsLoadBalancer);
693 /// let x2 = Endpoint::new().set_load_balancer_type(LoadBalancerType::RegionalHttpsLoadBalancer);
694 /// ```
695 pub fn set_load_balancer_type<T>(mut self, v: T) -> Self
696 where
697 T: std::convert::Into<crate::model::LoadBalancerType>,
698 {
699 self.load_balancer_type = std::option::Option::Some(v.into());
700 self
701 }
702
703 /// Sets or clears the value of [load_balancer_type][crate::model::Endpoint::load_balancer_type].
704 ///
705 /// # Example
706 /// ```ignore,no_run
707 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
708 /// use google_cloud_networkmanagement_v1::model::LoadBalancerType;
709 /// let x0 = Endpoint::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::HttpsAdvancedLoadBalancer));
710 /// let x1 = Endpoint::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::HttpsLoadBalancer));
711 /// let x2 = Endpoint::new().set_or_clear_load_balancer_type(Some(LoadBalancerType::RegionalHttpsLoadBalancer));
712 /// let x_none = Endpoint::new().set_or_clear_load_balancer_type(None::<LoadBalancerType>);
713 /// ```
714 pub fn set_or_clear_load_balancer_type<T>(mut self, v: std::option::Option<T>) -> Self
715 where
716 T: std::convert::Into<crate::model::LoadBalancerType>,
717 {
718 self.load_balancer_type = v.map(|x| x.into());
719 self
720 }
721
722 /// Sets the value of [gke_master_cluster][crate::model::Endpoint::gke_master_cluster].
723 ///
724 /// # Example
725 /// ```ignore,no_run
726 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
727 /// let x = Endpoint::new().set_gke_master_cluster("example");
728 /// ```
729 pub fn set_gke_master_cluster<T: std::convert::Into<std::string::String>>(
730 mut self,
731 v: T,
732 ) -> Self {
733 self.gke_master_cluster = v.into();
734 self
735 }
736
737 /// Sets the value of [fqdn][crate::model::Endpoint::fqdn].
738 ///
739 /// # Example
740 /// ```ignore,no_run
741 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
742 /// let x = Endpoint::new().set_fqdn("example");
743 /// ```
744 pub fn set_fqdn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
745 self.fqdn = v.into();
746 self
747 }
748
749 /// Sets the value of [cloud_sql_instance][crate::model::Endpoint::cloud_sql_instance].
750 ///
751 /// # Example
752 /// ```ignore,no_run
753 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
754 /// let x = Endpoint::new().set_cloud_sql_instance("example");
755 /// ```
756 pub fn set_cloud_sql_instance<T: std::convert::Into<std::string::String>>(
757 mut self,
758 v: T,
759 ) -> Self {
760 self.cloud_sql_instance = v.into();
761 self
762 }
763
764 /// Sets the value of [redis_instance][crate::model::Endpoint::redis_instance].
765 ///
766 /// # Example
767 /// ```ignore,no_run
768 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
769 /// let x = Endpoint::new().set_redis_instance("example");
770 /// ```
771 pub fn set_redis_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
772 self.redis_instance = v.into();
773 self
774 }
775
776 /// Sets the value of [redis_cluster][crate::model::Endpoint::redis_cluster].
777 ///
778 /// # Example
779 /// ```ignore,no_run
780 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
781 /// let x = Endpoint::new().set_redis_cluster("example");
782 /// ```
783 pub fn set_redis_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
784 self.redis_cluster = v.into();
785 self
786 }
787
788 /// Sets the value of [cloud_function][crate::model::Endpoint::cloud_function].
789 ///
790 /// # Example
791 /// ```ignore,no_run
792 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
793 /// use google_cloud_networkmanagement_v1::model::endpoint::CloudFunctionEndpoint;
794 /// let x = Endpoint::new().set_cloud_function(CloudFunctionEndpoint::default()/* use setters */);
795 /// ```
796 pub fn set_cloud_function<T>(mut self, v: T) -> Self
797 where
798 T: std::convert::Into<crate::model::endpoint::CloudFunctionEndpoint>,
799 {
800 self.cloud_function = std::option::Option::Some(v.into());
801 self
802 }
803
804 /// Sets or clears the value of [cloud_function][crate::model::Endpoint::cloud_function].
805 ///
806 /// # Example
807 /// ```ignore,no_run
808 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
809 /// use google_cloud_networkmanagement_v1::model::endpoint::CloudFunctionEndpoint;
810 /// let x = Endpoint::new().set_or_clear_cloud_function(Some(CloudFunctionEndpoint::default()/* use setters */));
811 /// let x = Endpoint::new().set_or_clear_cloud_function(None::<CloudFunctionEndpoint>);
812 /// ```
813 pub fn set_or_clear_cloud_function<T>(mut self, v: std::option::Option<T>) -> Self
814 where
815 T: std::convert::Into<crate::model::endpoint::CloudFunctionEndpoint>,
816 {
817 self.cloud_function = v.map(|x| x.into());
818 self
819 }
820
821 /// Sets the value of [app_engine_version][crate::model::Endpoint::app_engine_version].
822 ///
823 /// # Example
824 /// ```ignore,no_run
825 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
826 /// use google_cloud_networkmanagement_v1::model::endpoint::AppEngineVersionEndpoint;
827 /// let x = Endpoint::new().set_app_engine_version(AppEngineVersionEndpoint::default()/* use setters */);
828 /// ```
829 pub fn set_app_engine_version<T>(mut self, v: T) -> Self
830 where
831 T: std::convert::Into<crate::model::endpoint::AppEngineVersionEndpoint>,
832 {
833 self.app_engine_version = std::option::Option::Some(v.into());
834 self
835 }
836
837 /// Sets or clears the value of [app_engine_version][crate::model::Endpoint::app_engine_version].
838 ///
839 /// # Example
840 /// ```ignore,no_run
841 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
842 /// use google_cloud_networkmanagement_v1::model::endpoint::AppEngineVersionEndpoint;
843 /// let x = Endpoint::new().set_or_clear_app_engine_version(Some(AppEngineVersionEndpoint::default()/* use setters */));
844 /// let x = Endpoint::new().set_or_clear_app_engine_version(None::<AppEngineVersionEndpoint>);
845 /// ```
846 pub fn set_or_clear_app_engine_version<T>(mut self, v: std::option::Option<T>) -> Self
847 where
848 T: std::convert::Into<crate::model::endpoint::AppEngineVersionEndpoint>,
849 {
850 self.app_engine_version = v.map(|x| x.into());
851 self
852 }
853
854 /// Sets the value of [cloud_run_revision][crate::model::Endpoint::cloud_run_revision].
855 ///
856 /// # Example
857 /// ```ignore,no_run
858 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
859 /// use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
860 /// let x = Endpoint::new().set_cloud_run_revision(CloudRunRevisionEndpoint::default()/* use setters */);
861 /// ```
862 pub fn set_cloud_run_revision<T>(mut self, v: T) -> Self
863 where
864 T: std::convert::Into<crate::model::endpoint::CloudRunRevisionEndpoint>,
865 {
866 self.cloud_run_revision = std::option::Option::Some(v.into());
867 self
868 }
869
870 /// Sets or clears the value of [cloud_run_revision][crate::model::Endpoint::cloud_run_revision].
871 ///
872 /// # Example
873 /// ```ignore,no_run
874 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
875 /// use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
876 /// let x = Endpoint::new().set_or_clear_cloud_run_revision(Some(CloudRunRevisionEndpoint::default()/* use setters */));
877 /// let x = Endpoint::new().set_or_clear_cloud_run_revision(None::<CloudRunRevisionEndpoint>);
878 /// ```
879 pub fn set_or_clear_cloud_run_revision<T>(mut self, v: std::option::Option<T>) -> Self
880 where
881 T: std::convert::Into<crate::model::endpoint::CloudRunRevisionEndpoint>,
882 {
883 self.cloud_run_revision = v.map(|x| x.into());
884 self
885 }
886
887 /// Sets the value of [network][crate::model::Endpoint::network].
888 ///
889 /// # Example
890 /// ```ignore,no_run
891 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
892 /// let x = Endpoint::new().set_network("example");
893 /// ```
894 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
895 self.network = v.into();
896 self
897 }
898
899 /// Sets the value of [network_type][crate::model::Endpoint::network_type].
900 ///
901 /// # Example
902 /// ```ignore,no_run
903 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
904 /// use google_cloud_networkmanagement_v1::model::endpoint::NetworkType;
905 /// let x0 = Endpoint::new().set_network_type(NetworkType::GcpNetwork);
906 /// let x1 = Endpoint::new().set_network_type(NetworkType::NonGcpNetwork);
907 /// ```
908 pub fn set_network_type<T: std::convert::Into<crate::model::endpoint::NetworkType>>(
909 mut self,
910 v: T,
911 ) -> Self {
912 self.network_type = v.into();
913 self
914 }
915
916 /// Sets the value of [project_id][crate::model::Endpoint::project_id].
917 ///
918 /// # Example
919 /// ```ignore,no_run
920 /// # use google_cloud_networkmanagement_v1::model::Endpoint;
921 /// let x = Endpoint::new().set_project_id("example");
922 /// ```
923 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
924 self.project_id = v.into();
925 self
926 }
927}
928
929impl wkt::message::Message for Endpoint {
930 fn typename() -> &'static str {
931 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint"
932 }
933}
934
935/// Defines additional types related to [Endpoint].
936pub mod endpoint {
937 #[allow(unused_imports)]
938 use super::*;
939
940 /// Wrapper for Cloud Function attributes.
941 #[derive(Clone, Default, PartialEq)]
942 #[non_exhaustive]
943 pub struct CloudFunctionEndpoint {
944 /// A [Cloud Function](https://cloud.google.com/functions) name.
945 pub uri: std::string::String,
946
947 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
948 }
949
950 impl CloudFunctionEndpoint {
951 pub fn new() -> Self {
952 std::default::Default::default()
953 }
954
955 /// Sets the value of [uri][crate::model::endpoint::CloudFunctionEndpoint::uri].
956 ///
957 /// # Example
958 /// ```ignore,no_run
959 /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudFunctionEndpoint;
960 /// let x = CloudFunctionEndpoint::new().set_uri("example");
961 /// ```
962 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
963 self.uri = v.into();
964 self
965 }
966 }
967
968 impl wkt::message::Message for CloudFunctionEndpoint {
969 fn typename() -> &'static str {
970 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.CloudFunctionEndpoint"
971 }
972 }
973
974 /// Wrapper for the App Engine service version attributes.
975 #[derive(Clone, Default, PartialEq)]
976 #[non_exhaustive]
977 pub struct AppEngineVersionEndpoint {
978 /// An [App Engine](https://cloud.google.com/appengine) [service
979 /// version](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions)
980 /// name.
981 pub uri: std::string::String,
982
983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
984 }
985
986 impl AppEngineVersionEndpoint {
987 pub fn new() -> Self {
988 std::default::Default::default()
989 }
990
991 /// Sets the value of [uri][crate::model::endpoint::AppEngineVersionEndpoint::uri].
992 ///
993 /// # Example
994 /// ```ignore,no_run
995 /// # use google_cloud_networkmanagement_v1::model::endpoint::AppEngineVersionEndpoint;
996 /// let x = AppEngineVersionEndpoint::new().set_uri("example");
997 /// ```
998 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
999 self.uri = v.into();
1000 self
1001 }
1002 }
1003
1004 impl wkt::message::Message for AppEngineVersionEndpoint {
1005 fn typename() -> &'static str {
1006 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.AppEngineVersionEndpoint"
1007 }
1008 }
1009
1010 /// Wrapper for Cloud Run revision attributes.
1011 #[derive(Clone, Default, PartialEq)]
1012 #[non_exhaustive]
1013 pub struct CloudRunRevisionEndpoint {
1014 /// A [Cloud Run](https://cloud.google.com/run)
1015 /// [revision](https://cloud.google.com/run/docs/reference/rest/v1/namespaces.revisions/get)
1016 /// URI. The format is:
1017 /// projects/{project}/locations/{location}/revisions/{revision}
1018 pub uri: std::string::String,
1019
1020 /// Output only. The URI of the Cloud Run service that the revision belongs
1021 /// to. The format is:
1022 /// projects/{project}/locations/{location}/services/{service}
1023 pub service_uri: std::string::String,
1024
1025 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1026 }
1027
1028 impl CloudRunRevisionEndpoint {
1029 pub fn new() -> Self {
1030 std::default::Default::default()
1031 }
1032
1033 /// Sets the value of [uri][crate::model::endpoint::CloudRunRevisionEndpoint::uri].
1034 ///
1035 /// # Example
1036 /// ```ignore,no_run
1037 /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
1038 /// let x = CloudRunRevisionEndpoint::new().set_uri("example");
1039 /// ```
1040 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1041 self.uri = v.into();
1042 self
1043 }
1044
1045 /// Sets the value of [service_uri][crate::model::endpoint::CloudRunRevisionEndpoint::service_uri].
1046 ///
1047 /// # Example
1048 /// ```ignore,no_run
1049 /// # use google_cloud_networkmanagement_v1::model::endpoint::CloudRunRevisionEndpoint;
1050 /// let x = CloudRunRevisionEndpoint::new().set_service_uri("example");
1051 /// ```
1052 pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1053 self.service_uri = v.into();
1054 self
1055 }
1056 }
1057
1058 impl wkt::message::Message for CloudRunRevisionEndpoint {
1059 fn typename() -> &'static str {
1060 "type.googleapis.com/google.cloud.networkmanagement.v1.Endpoint.CloudRunRevisionEndpoint"
1061 }
1062 }
1063
1064 /// The type definition of an endpoint's network. Use one of the
1065 /// following choices:
1066 ///
1067 /// # Working with unknown values
1068 ///
1069 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1070 /// additional enum variants at any time. Adding new variants is not considered
1071 /// a breaking change. Applications should write their code in anticipation of:
1072 ///
1073 /// - New values appearing in future releases of the client library, **and**
1074 /// - New values received dynamically, without application changes.
1075 ///
1076 /// Please consult the [Working with enums] section in the user guide for some
1077 /// guidelines.
1078 ///
1079 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1080 #[derive(Clone, Debug, PartialEq)]
1081 #[non_exhaustive]
1082 pub enum NetworkType {
1083 /// Default type if unspecified.
1084 Unspecified,
1085 /// A network hosted within Google Cloud.
1086 /// To receive more detailed output, specify the URI for the source or
1087 /// destination network.
1088 GcpNetwork,
1089 /// A network hosted outside of Google Cloud.
1090 /// This can be an on-premises network, an internet resource or a network
1091 /// hosted by another cloud provider.
1092 NonGcpNetwork,
1093 /// If set, the enum was initialized with an unknown value.
1094 ///
1095 /// Applications can examine the value using [NetworkType::value] or
1096 /// [NetworkType::name].
1097 UnknownValue(network_type::UnknownValue),
1098 }
1099
1100 #[doc(hidden)]
1101 pub mod network_type {
1102 #[allow(unused_imports)]
1103 use super::*;
1104 #[derive(Clone, Debug, PartialEq)]
1105 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1106 }
1107
1108 impl NetworkType {
1109 /// Gets the enum value.
1110 ///
1111 /// Returns `None` if the enum contains an unknown value deserialized from
1112 /// the string representation of enums.
1113 pub fn value(&self) -> std::option::Option<i32> {
1114 match self {
1115 Self::Unspecified => std::option::Option::Some(0),
1116 Self::GcpNetwork => std::option::Option::Some(1),
1117 Self::NonGcpNetwork => std::option::Option::Some(2),
1118 Self::UnknownValue(u) => u.0.value(),
1119 }
1120 }
1121
1122 /// Gets the enum value as a string.
1123 ///
1124 /// Returns `None` if the enum contains an unknown value deserialized from
1125 /// the integer representation of enums.
1126 pub fn name(&self) -> std::option::Option<&str> {
1127 match self {
1128 Self::Unspecified => std::option::Option::Some("NETWORK_TYPE_UNSPECIFIED"),
1129 Self::GcpNetwork => std::option::Option::Some("GCP_NETWORK"),
1130 Self::NonGcpNetwork => std::option::Option::Some("NON_GCP_NETWORK"),
1131 Self::UnknownValue(u) => u.0.name(),
1132 }
1133 }
1134 }
1135
1136 impl std::default::Default for NetworkType {
1137 fn default() -> Self {
1138 use std::convert::From;
1139 Self::from(0)
1140 }
1141 }
1142
1143 impl std::fmt::Display for NetworkType {
1144 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1145 wkt::internal::display_enum(f, self.name(), self.value())
1146 }
1147 }
1148
1149 impl std::convert::From<i32> for NetworkType {
1150 fn from(value: i32) -> Self {
1151 match value {
1152 0 => Self::Unspecified,
1153 1 => Self::GcpNetwork,
1154 2 => Self::NonGcpNetwork,
1155 _ => Self::UnknownValue(network_type::UnknownValue(
1156 wkt::internal::UnknownEnumValue::Integer(value),
1157 )),
1158 }
1159 }
1160 }
1161
1162 impl std::convert::From<&str> for NetworkType {
1163 fn from(value: &str) -> Self {
1164 use std::string::ToString;
1165 match value {
1166 "NETWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
1167 "GCP_NETWORK" => Self::GcpNetwork,
1168 "NON_GCP_NETWORK" => Self::NonGcpNetwork,
1169 _ => Self::UnknownValue(network_type::UnknownValue(
1170 wkt::internal::UnknownEnumValue::String(value.to_string()),
1171 )),
1172 }
1173 }
1174 }
1175
1176 impl serde::ser::Serialize for NetworkType {
1177 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1178 where
1179 S: serde::Serializer,
1180 {
1181 match self {
1182 Self::Unspecified => serializer.serialize_i32(0),
1183 Self::GcpNetwork => serializer.serialize_i32(1),
1184 Self::NonGcpNetwork => serializer.serialize_i32(2),
1185 Self::UnknownValue(u) => u.0.serialize(serializer),
1186 }
1187 }
1188 }
1189
1190 impl<'de> serde::de::Deserialize<'de> for NetworkType {
1191 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1192 where
1193 D: serde::Deserializer<'de>,
1194 {
1195 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NetworkType>::new(
1196 ".google.cloud.networkmanagement.v1.Endpoint.NetworkType",
1197 ))
1198 }
1199 }
1200
1201 /// Type of the target of a forwarding rule.
1202 ///
1203 /// # Working with unknown values
1204 ///
1205 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1206 /// additional enum variants at any time. Adding new variants is not considered
1207 /// a breaking change. Applications should write their code in anticipation of:
1208 ///
1209 /// - New values appearing in future releases of the client library, **and**
1210 /// - New values received dynamically, without application changes.
1211 ///
1212 /// Please consult the [Working with enums] section in the user guide for some
1213 /// guidelines.
1214 ///
1215 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1216 #[derive(Clone, Debug, PartialEq)]
1217 #[non_exhaustive]
1218 pub enum ForwardingRuleTarget {
1219 /// Forwarding rule target is unknown.
1220 Unspecified,
1221 /// Compute Engine instance for protocol forwarding.
1222 Instance,
1223 /// Load Balancer. The specific type can be found from [load_balancer_type]
1224 /// [google.cloud.networkmanagement.v1.Endpoint.load_balancer_type].
1225 LoadBalancer,
1226 /// Classic Cloud VPN Gateway.
1227 VpnGateway,
1228 /// Forwarding Rule is a Private Service Connect endpoint.
1229 Psc,
1230 /// If set, the enum was initialized with an unknown value.
1231 ///
1232 /// Applications can examine the value using [ForwardingRuleTarget::value] or
1233 /// [ForwardingRuleTarget::name].
1234 UnknownValue(forwarding_rule_target::UnknownValue),
1235 }
1236
1237 #[doc(hidden)]
1238 pub mod forwarding_rule_target {
1239 #[allow(unused_imports)]
1240 use super::*;
1241 #[derive(Clone, Debug, PartialEq)]
1242 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1243 }
1244
1245 impl ForwardingRuleTarget {
1246 /// Gets the enum value.
1247 ///
1248 /// Returns `None` if the enum contains an unknown value deserialized from
1249 /// the string representation of enums.
1250 pub fn value(&self) -> std::option::Option<i32> {
1251 match self {
1252 Self::Unspecified => std::option::Option::Some(0),
1253 Self::Instance => std::option::Option::Some(1),
1254 Self::LoadBalancer => std::option::Option::Some(2),
1255 Self::VpnGateway => std::option::Option::Some(3),
1256 Self::Psc => std::option::Option::Some(4),
1257 Self::UnknownValue(u) => u.0.value(),
1258 }
1259 }
1260
1261 /// Gets the enum value as a string.
1262 ///
1263 /// Returns `None` if the enum contains an unknown value deserialized from
1264 /// the integer representation of enums.
1265 pub fn name(&self) -> std::option::Option<&str> {
1266 match self {
1267 Self::Unspecified => {
1268 std::option::Option::Some("FORWARDING_RULE_TARGET_UNSPECIFIED")
1269 }
1270 Self::Instance => std::option::Option::Some("INSTANCE"),
1271 Self::LoadBalancer => std::option::Option::Some("LOAD_BALANCER"),
1272 Self::VpnGateway => std::option::Option::Some("VPN_GATEWAY"),
1273 Self::Psc => std::option::Option::Some("PSC"),
1274 Self::UnknownValue(u) => u.0.name(),
1275 }
1276 }
1277 }
1278
1279 impl std::default::Default for ForwardingRuleTarget {
1280 fn default() -> Self {
1281 use std::convert::From;
1282 Self::from(0)
1283 }
1284 }
1285
1286 impl std::fmt::Display for ForwardingRuleTarget {
1287 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1288 wkt::internal::display_enum(f, self.name(), self.value())
1289 }
1290 }
1291
1292 impl std::convert::From<i32> for ForwardingRuleTarget {
1293 fn from(value: i32) -> Self {
1294 match value {
1295 0 => Self::Unspecified,
1296 1 => Self::Instance,
1297 2 => Self::LoadBalancer,
1298 3 => Self::VpnGateway,
1299 4 => Self::Psc,
1300 _ => Self::UnknownValue(forwarding_rule_target::UnknownValue(
1301 wkt::internal::UnknownEnumValue::Integer(value),
1302 )),
1303 }
1304 }
1305 }
1306
1307 impl std::convert::From<&str> for ForwardingRuleTarget {
1308 fn from(value: &str) -> Self {
1309 use std::string::ToString;
1310 match value {
1311 "FORWARDING_RULE_TARGET_UNSPECIFIED" => Self::Unspecified,
1312 "INSTANCE" => Self::Instance,
1313 "LOAD_BALANCER" => Self::LoadBalancer,
1314 "VPN_GATEWAY" => Self::VpnGateway,
1315 "PSC" => Self::Psc,
1316 _ => Self::UnknownValue(forwarding_rule_target::UnknownValue(
1317 wkt::internal::UnknownEnumValue::String(value.to_string()),
1318 )),
1319 }
1320 }
1321 }
1322
1323 impl serde::ser::Serialize for ForwardingRuleTarget {
1324 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1325 where
1326 S: serde::Serializer,
1327 {
1328 match self {
1329 Self::Unspecified => serializer.serialize_i32(0),
1330 Self::Instance => serializer.serialize_i32(1),
1331 Self::LoadBalancer => serializer.serialize_i32(2),
1332 Self::VpnGateway => serializer.serialize_i32(3),
1333 Self::Psc => serializer.serialize_i32(4),
1334 Self::UnknownValue(u) => u.0.serialize(serializer),
1335 }
1336 }
1337 }
1338
1339 impl<'de> serde::de::Deserialize<'de> for ForwardingRuleTarget {
1340 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1341 where
1342 D: serde::Deserializer<'de>,
1343 {
1344 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ForwardingRuleTarget>::new(
1345 ".google.cloud.networkmanagement.v1.Endpoint.ForwardingRuleTarget",
1346 ))
1347 }
1348 }
1349}
1350
1351/// Results of the configuration analysis from the last run of the test.
1352#[derive(Clone, Default, PartialEq)]
1353#[non_exhaustive]
1354pub struct ReachabilityDetails {
1355 /// The overall result of the test's configuration analysis.
1356 pub result: crate::model::reachability_details::Result,
1357
1358 /// The time of the configuration analysis.
1359 pub verify_time: std::option::Option<wkt::Timestamp>,
1360
1361 /// The details of a failure or a cancellation of reachability analysis.
1362 pub error: std::option::Option<rpc::model::Status>,
1363
1364 /// Result may contain a list of traces if a test has multiple possible
1365 /// paths in the network, such as when destination endpoint is a load balancer
1366 /// with multiple backends.
1367 pub traces: std::vec::Vec<crate::model::Trace>,
1368
1369 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1370}
1371
1372impl ReachabilityDetails {
1373 pub fn new() -> Self {
1374 std::default::Default::default()
1375 }
1376
1377 /// Sets the value of [result][crate::model::ReachabilityDetails::result].
1378 ///
1379 /// # Example
1380 /// ```ignore,no_run
1381 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1382 /// use google_cloud_networkmanagement_v1::model::reachability_details::Result;
1383 /// let x0 = ReachabilityDetails::new().set_result(Result::Reachable);
1384 /// let x1 = ReachabilityDetails::new().set_result(Result::Unreachable);
1385 /// let x2 = ReachabilityDetails::new().set_result(Result::Ambiguous);
1386 /// ```
1387 pub fn set_result<T: std::convert::Into<crate::model::reachability_details::Result>>(
1388 mut self,
1389 v: T,
1390 ) -> Self {
1391 self.result = v.into();
1392 self
1393 }
1394
1395 /// Sets the value of [verify_time][crate::model::ReachabilityDetails::verify_time].
1396 ///
1397 /// # Example
1398 /// ```ignore,no_run
1399 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1400 /// use wkt::Timestamp;
1401 /// let x = ReachabilityDetails::new().set_verify_time(Timestamp::default()/* use setters */);
1402 /// ```
1403 pub fn set_verify_time<T>(mut self, v: T) -> Self
1404 where
1405 T: std::convert::Into<wkt::Timestamp>,
1406 {
1407 self.verify_time = std::option::Option::Some(v.into());
1408 self
1409 }
1410
1411 /// Sets or clears the value of [verify_time][crate::model::ReachabilityDetails::verify_time].
1412 ///
1413 /// # Example
1414 /// ```ignore,no_run
1415 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1416 /// use wkt::Timestamp;
1417 /// let x = ReachabilityDetails::new().set_or_clear_verify_time(Some(Timestamp::default()/* use setters */));
1418 /// let x = ReachabilityDetails::new().set_or_clear_verify_time(None::<Timestamp>);
1419 /// ```
1420 pub fn set_or_clear_verify_time<T>(mut self, v: std::option::Option<T>) -> Self
1421 where
1422 T: std::convert::Into<wkt::Timestamp>,
1423 {
1424 self.verify_time = v.map(|x| x.into());
1425 self
1426 }
1427
1428 /// Sets the value of [error][crate::model::ReachabilityDetails::error].
1429 ///
1430 /// # Example
1431 /// ```ignore,no_run
1432 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1433 /// use rpc::model::Status;
1434 /// let x = ReachabilityDetails::new().set_error(Status::default()/* use setters */);
1435 /// ```
1436 pub fn set_error<T>(mut self, v: T) -> Self
1437 where
1438 T: std::convert::Into<rpc::model::Status>,
1439 {
1440 self.error = std::option::Option::Some(v.into());
1441 self
1442 }
1443
1444 /// Sets or clears the value of [error][crate::model::ReachabilityDetails::error].
1445 ///
1446 /// # Example
1447 /// ```ignore,no_run
1448 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1449 /// use rpc::model::Status;
1450 /// let x = ReachabilityDetails::new().set_or_clear_error(Some(Status::default()/* use setters */));
1451 /// let x = ReachabilityDetails::new().set_or_clear_error(None::<Status>);
1452 /// ```
1453 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1454 where
1455 T: std::convert::Into<rpc::model::Status>,
1456 {
1457 self.error = v.map(|x| x.into());
1458 self
1459 }
1460
1461 /// Sets the value of [traces][crate::model::ReachabilityDetails::traces].
1462 ///
1463 /// # Example
1464 /// ```ignore,no_run
1465 /// # use google_cloud_networkmanagement_v1::model::ReachabilityDetails;
1466 /// use google_cloud_networkmanagement_v1::model::Trace;
1467 /// let x = ReachabilityDetails::new()
1468 /// .set_traces([
1469 /// Trace::default()/* use setters */,
1470 /// Trace::default()/* use (different) setters */,
1471 /// ]);
1472 /// ```
1473 pub fn set_traces<T, V>(mut self, v: T) -> Self
1474 where
1475 T: std::iter::IntoIterator<Item = V>,
1476 V: std::convert::Into<crate::model::Trace>,
1477 {
1478 use std::iter::Iterator;
1479 self.traces = v.into_iter().map(|i| i.into()).collect();
1480 self
1481 }
1482}
1483
1484impl wkt::message::Message for ReachabilityDetails {
1485 fn typename() -> &'static str {
1486 "type.googleapis.com/google.cloud.networkmanagement.v1.ReachabilityDetails"
1487 }
1488}
1489
1490/// Defines additional types related to [ReachabilityDetails].
1491pub mod reachability_details {
1492 #[allow(unused_imports)]
1493 use super::*;
1494
1495 /// The overall result of the test's configuration analysis.
1496 ///
1497 /// # Working with unknown values
1498 ///
1499 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1500 /// additional enum variants at any time. Adding new variants is not considered
1501 /// a breaking change. Applications should write their code in anticipation of:
1502 ///
1503 /// - New values appearing in future releases of the client library, **and**
1504 /// - New values received dynamically, without application changes.
1505 ///
1506 /// Please consult the [Working with enums] section in the user guide for some
1507 /// guidelines.
1508 ///
1509 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1510 #[derive(Clone, Debug, PartialEq)]
1511 #[non_exhaustive]
1512 pub enum Result {
1513 /// No result was specified.
1514 Unspecified,
1515 /// Possible scenarios are:
1516 ///
1517 /// * The configuration analysis determined that a packet originating from
1518 /// the source is expected to reach the destination.
1519 /// * The analysis didn't complete because the user lacks permission for
1520 /// some of the resources in the trace. However, at the time the user's
1521 /// permission became insufficient, the trace had been successful so far.
1522 Reachable,
1523 /// A packet originating from the source is expected to be dropped before
1524 /// reaching the destination.
1525 Unreachable,
1526 /// The source and destination endpoints do not uniquely identify
1527 /// the test location in the network, and the reachability result contains
1528 /// multiple traces. For some traces, a packet could be delivered, and for
1529 /// others, it would not be. This result is also assigned to
1530 /// configuration analysis of return path if on its own it should be
1531 /// REACHABLE, but configuration analysis of forward path is AMBIGUOUS.
1532 Ambiguous,
1533 /// The configuration analysis did not complete. Possible reasons are:
1534 ///
1535 /// * A permissions error occurred--for example, the user might not have
1536 /// read permission for all of the resources named in the test.
1537 /// * An internal error occurred.
1538 /// * The analyzer received an invalid or unsupported argument or was unable
1539 /// to identify a known endpoint.
1540 Undetermined,
1541 /// If set, the enum was initialized with an unknown value.
1542 ///
1543 /// Applications can examine the value using [Result::value] or
1544 /// [Result::name].
1545 UnknownValue(result::UnknownValue),
1546 }
1547
1548 #[doc(hidden)]
1549 pub mod result {
1550 #[allow(unused_imports)]
1551 use super::*;
1552 #[derive(Clone, Debug, PartialEq)]
1553 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1554 }
1555
1556 impl Result {
1557 /// Gets the enum value.
1558 ///
1559 /// Returns `None` if the enum contains an unknown value deserialized from
1560 /// the string representation of enums.
1561 pub fn value(&self) -> std::option::Option<i32> {
1562 match self {
1563 Self::Unspecified => std::option::Option::Some(0),
1564 Self::Reachable => std::option::Option::Some(1),
1565 Self::Unreachable => std::option::Option::Some(2),
1566 Self::Ambiguous => std::option::Option::Some(4),
1567 Self::Undetermined => std::option::Option::Some(5),
1568 Self::UnknownValue(u) => u.0.value(),
1569 }
1570 }
1571
1572 /// Gets the enum value as a string.
1573 ///
1574 /// Returns `None` if the enum contains an unknown value deserialized from
1575 /// the integer representation of enums.
1576 pub fn name(&self) -> std::option::Option<&str> {
1577 match self {
1578 Self::Unspecified => std::option::Option::Some("RESULT_UNSPECIFIED"),
1579 Self::Reachable => std::option::Option::Some("REACHABLE"),
1580 Self::Unreachable => std::option::Option::Some("UNREACHABLE"),
1581 Self::Ambiguous => std::option::Option::Some("AMBIGUOUS"),
1582 Self::Undetermined => std::option::Option::Some("UNDETERMINED"),
1583 Self::UnknownValue(u) => u.0.name(),
1584 }
1585 }
1586 }
1587
1588 impl std::default::Default for Result {
1589 fn default() -> Self {
1590 use std::convert::From;
1591 Self::from(0)
1592 }
1593 }
1594
1595 impl std::fmt::Display for Result {
1596 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1597 wkt::internal::display_enum(f, self.name(), self.value())
1598 }
1599 }
1600
1601 impl std::convert::From<i32> for Result {
1602 fn from(value: i32) -> Self {
1603 match value {
1604 0 => Self::Unspecified,
1605 1 => Self::Reachable,
1606 2 => Self::Unreachable,
1607 4 => Self::Ambiguous,
1608 5 => Self::Undetermined,
1609 _ => Self::UnknownValue(result::UnknownValue(
1610 wkt::internal::UnknownEnumValue::Integer(value),
1611 )),
1612 }
1613 }
1614 }
1615
1616 impl std::convert::From<&str> for Result {
1617 fn from(value: &str) -> Self {
1618 use std::string::ToString;
1619 match value {
1620 "RESULT_UNSPECIFIED" => Self::Unspecified,
1621 "REACHABLE" => Self::Reachable,
1622 "UNREACHABLE" => Self::Unreachable,
1623 "AMBIGUOUS" => Self::Ambiguous,
1624 "UNDETERMINED" => Self::Undetermined,
1625 _ => Self::UnknownValue(result::UnknownValue(
1626 wkt::internal::UnknownEnumValue::String(value.to_string()),
1627 )),
1628 }
1629 }
1630 }
1631
1632 impl serde::ser::Serialize for Result {
1633 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1634 where
1635 S: serde::Serializer,
1636 {
1637 match self {
1638 Self::Unspecified => serializer.serialize_i32(0),
1639 Self::Reachable => serializer.serialize_i32(1),
1640 Self::Unreachable => serializer.serialize_i32(2),
1641 Self::Ambiguous => serializer.serialize_i32(4),
1642 Self::Undetermined => serializer.serialize_i32(5),
1643 Self::UnknownValue(u) => u.0.serialize(serializer),
1644 }
1645 }
1646 }
1647
1648 impl<'de> serde::de::Deserialize<'de> for Result {
1649 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1650 where
1651 D: serde::Deserializer<'de>,
1652 {
1653 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Result>::new(
1654 ".google.cloud.networkmanagement.v1.ReachabilityDetails.Result",
1655 ))
1656 }
1657 }
1658}
1659
1660/// Latency percentile rank and value.
1661#[derive(Clone, Default, PartialEq)]
1662#[non_exhaustive]
1663pub struct LatencyPercentile {
1664 /// Percentage of samples this data point applies to.
1665 pub percent: i32,
1666
1667 /// percent-th percentile of latency observed, in microseconds.
1668 /// Fraction of percent/100 of samples have latency lower or
1669 /// equal to the value of this field.
1670 pub latency_micros: i64,
1671
1672 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1673}
1674
1675impl LatencyPercentile {
1676 pub fn new() -> Self {
1677 std::default::Default::default()
1678 }
1679
1680 /// Sets the value of [percent][crate::model::LatencyPercentile::percent].
1681 ///
1682 /// # Example
1683 /// ```ignore,no_run
1684 /// # use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1685 /// let x = LatencyPercentile::new().set_percent(42);
1686 /// ```
1687 pub fn set_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1688 self.percent = v.into();
1689 self
1690 }
1691
1692 /// Sets the value of [latency_micros][crate::model::LatencyPercentile::latency_micros].
1693 ///
1694 /// # Example
1695 /// ```ignore,no_run
1696 /// # use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1697 /// let x = LatencyPercentile::new().set_latency_micros(42);
1698 /// ```
1699 pub fn set_latency_micros<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1700 self.latency_micros = v.into();
1701 self
1702 }
1703}
1704
1705impl wkt::message::Message for LatencyPercentile {
1706 fn typename() -> &'static str {
1707 "type.googleapis.com/google.cloud.networkmanagement.v1.LatencyPercentile"
1708 }
1709}
1710
1711/// Describes measured latency distribution.
1712#[derive(Clone, Default, PartialEq)]
1713#[non_exhaustive]
1714pub struct LatencyDistribution {
1715 /// Representative latency percentiles.
1716 pub latency_percentiles: std::vec::Vec<crate::model::LatencyPercentile>,
1717
1718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1719}
1720
1721impl LatencyDistribution {
1722 pub fn new() -> Self {
1723 std::default::Default::default()
1724 }
1725
1726 /// Sets the value of [latency_percentiles][crate::model::LatencyDistribution::latency_percentiles].
1727 ///
1728 /// # Example
1729 /// ```ignore,no_run
1730 /// # use google_cloud_networkmanagement_v1::model::LatencyDistribution;
1731 /// use google_cloud_networkmanagement_v1::model::LatencyPercentile;
1732 /// let x = LatencyDistribution::new()
1733 /// .set_latency_percentiles([
1734 /// LatencyPercentile::default()/* use setters */,
1735 /// LatencyPercentile::default()/* use (different) setters */,
1736 /// ]);
1737 /// ```
1738 pub fn set_latency_percentiles<T, V>(mut self, v: T) -> Self
1739 where
1740 T: std::iter::IntoIterator<Item = V>,
1741 V: std::convert::Into<crate::model::LatencyPercentile>,
1742 {
1743 use std::iter::Iterator;
1744 self.latency_percentiles = v.into_iter().map(|i| i.into()).collect();
1745 self
1746 }
1747}
1748
1749impl wkt::message::Message for LatencyDistribution {
1750 fn typename() -> &'static str {
1751 "type.googleapis.com/google.cloud.networkmanagement.v1.LatencyDistribution"
1752 }
1753}
1754
1755/// Results of active probing from the last run of the test.
1756#[derive(Clone, Default, PartialEq)]
1757#[non_exhaustive]
1758pub struct ProbingDetails {
1759 /// The overall result of active probing.
1760 pub result: crate::model::probing_details::ProbingResult,
1761
1762 /// The time that reachability was assessed through active probing.
1763 pub verify_time: std::option::Option<wkt::Timestamp>,
1764
1765 /// Details about an internal failure or the cancellation of active probing.
1766 pub error: std::option::Option<rpc::model::Status>,
1767
1768 /// The reason probing was aborted.
1769 pub abort_cause: crate::model::probing_details::ProbingAbortCause,
1770
1771 /// Number of probes sent.
1772 pub sent_probe_count: i32,
1773
1774 /// Number of probes that reached the destination.
1775 pub successful_probe_count: i32,
1776
1777 /// The source and destination endpoints derived from the test input and used
1778 /// for active probing.
1779 pub endpoint_info: std::option::Option<crate::model::EndpointInfo>,
1780
1781 /// Latency as measured by active probing in one direction:
1782 /// from the source to the destination endpoint.
1783 pub probing_latency: std::option::Option<crate::model::LatencyDistribution>,
1784
1785 /// The EdgeLocation from which a packet, destined to the internet, will egress
1786 /// the Google network.
1787 /// This will only be populated for a connectivity test which has an internet
1788 /// destination address.
1789 /// The absence of this field *must not* be used as an indication that the
1790 /// destination is part of the Google network.
1791 pub destination_egress_location:
1792 std::option::Option<crate::model::probing_details::EdgeLocation>,
1793
1794 /// Probing results for all edge devices.
1795 pub edge_responses: std::vec::Vec<crate::model::probing_details::SingleEdgeResponse>,
1796
1797 /// Whether all relevant edge devices were probed.
1798 pub probed_all_devices: bool,
1799
1800 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1801}
1802
1803impl ProbingDetails {
1804 pub fn new() -> Self {
1805 std::default::Default::default()
1806 }
1807
1808 /// Sets the value of [result][crate::model::ProbingDetails::result].
1809 ///
1810 /// # Example
1811 /// ```ignore,no_run
1812 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1813 /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingResult;
1814 /// let x0 = ProbingDetails::new().set_result(ProbingResult::Reachable);
1815 /// let x1 = ProbingDetails::new().set_result(ProbingResult::Unreachable);
1816 /// let x2 = ProbingDetails::new().set_result(ProbingResult::ReachabilityInconsistent);
1817 /// ```
1818 pub fn set_result<T: std::convert::Into<crate::model::probing_details::ProbingResult>>(
1819 mut self,
1820 v: T,
1821 ) -> Self {
1822 self.result = v.into();
1823 self
1824 }
1825
1826 /// Sets the value of [verify_time][crate::model::ProbingDetails::verify_time].
1827 ///
1828 /// # Example
1829 /// ```ignore,no_run
1830 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1831 /// use wkt::Timestamp;
1832 /// let x = ProbingDetails::new().set_verify_time(Timestamp::default()/* use setters */);
1833 /// ```
1834 pub fn set_verify_time<T>(mut self, v: T) -> Self
1835 where
1836 T: std::convert::Into<wkt::Timestamp>,
1837 {
1838 self.verify_time = std::option::Option::Some(v.into());
1839 self
1840 }
1841
1842 /// Sets or clears the value of [verify_time][crate::model::ProbingDetails::verify_time].
1843 ///
1844 /// # Example
1845 /// ```ignore,no_run
1846 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1847 /// use wkt::Timestamp;
1848 /// let x = ProbingDetails::new().set_or_clear_verify_time(Some(Timestamp::default()/* use setters */));
1849 /// let x = ProbingDetails::new().set_or_clear_verify_time(None::<Timestamp>);
1850 /// ```
1851 pub fn set_or_clear_verify_time<T>(mut self, v: std::option::Option<T>) -> Self
1852 where
1853 T: std::convert::Into<wkt::Timestamp>,
1854 {
1855 self.verify_time = v.map(|x| x.into());
1856 self
1857 }
1858
1859 /// Sets the value of [error][crate::model::ProbingDetails::error].
1860 ///
1861 /// # Example
1862 /// ```ignore,no_run
1863 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1864 /// use rpc::model::Status;
1865 /// let x = ProbingDetails::new().set_error(Status::default()/* use setters */);
1866 /// ```
1867 pub fn set_error<T>(mut self, v: T) -> Self
1868 where
1869 T: std::convert::Into<rpc::model::Status>,
1870 {
1871 self.error = std::option::Option::Some(v.into());
1872 self
1873 }
1874
1875 /// Sets or clears the value of [error][crate::model::ProbingDetails::error].
1876 ///
1877 /// # Example
1878 /// ```ignore,no_run
1879 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1880 /// use rpc::model::Status;
1881 /// let x = ProbingDetails::new().set_or_clear_error(Some(Status::default()/* use setters */));
1882 /// let x = ProbingDetails::new().set_or_clear_error(None::<Status>);
1883 /// ```
1884 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1885 where
1886 T: std::convert::Into<rpc::model::Status>,
1887 {
1888 self.error = v.map(|x| x.into());
1889 self
1890 }
1891
1892 /// Sets the value of [abort_cause][crate::model::ProbingDetails::abort_cause].
1893 ///
1894 /// # Example
1895 /// ```ignore,no_run
1896 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1897 /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingAbortCause;
1898 /// let x0 = ProbingDetails::new().set_abort_cause(ProbingAbortCause::PermissionDenied);
1899 /// let x1 = ProbingDetails::new().set_abort_cause(ProbingAbortCause::NoSourceLocation);
1900 /// ```
1901 pub fn set_abort_cause<
1902 T: std::convert::Into<crate::model::probing_details::ProbingAbortCause>,
1903 >(
1904 mut self,
1905 v: T,
1906 ) -> Self {
1907 self.abort_cause = v.into();
1908 self
1909 }
1910
1911 /// Sets the value of [sent_probe_count][crate::model::ProbingDetails::sent_probe_count].
1912 ///
1913 /// # Example
1914 /// ```ignore,no_run
1915 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1916 /// let x = ProbingDetails::new().set_sent_probe_count(42);
1917 /// ```
1918 pub fn set_sent_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1919 self.sent_probe_count = v.into();
1920 self
1921 }
1922
1923 /// Sets the value of [successful_probe_count][crate::model::ProbingDetails::successful_probe_count].
1924 ///
1925 /// # Example
1926 /// ```ignore,no_run
1927 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1928 /// let x = ProbingDetails::new().set_successful_probe_count(42);
1929 /// ```
1930 pub fn set_successful_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1931 self.successful_probe_count = v.into();
1932 self
1933 }
1934
1935 /// Sets the value of [endpoint_info][crate::model::ProbingDetails::endpoint_info].
1936 ///
1937 /// # Example
1938 /// ```ignore,no_run
1939 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1940 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
1941 /// let x = ProbingDetails::new().set_endpoint_info(EndpointInfo::default()/* use setters */);
1942 /// ```
1943 pub fn set_endpoint_info<T>(mut self, v: T) -> Self
1944 where
1945 T: std::convert::Into<crate::model::EndpointInfo>,
1946 {
1947 self.endpoint_info = std::option::Option::Some(v.into());
1948 self
1949 }
1950
1951 /// Sets or clears the value of [endpoint_info][crate::model::ProbingDetails::endpoint_info].
1952 ///
1953 /// # Example
1954 /// ```ignore,no_run
1955 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1956 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
1957 /// let x = ProbingDetails::new().set_or_clear_endpoint_info(Some(EndpointInfo::default()/* use setters */));
1958 /// let x = ProbingDetails::new().set_or_clear_endpoint_info(None::<EndpointInfo>);
1959 /// ```
1960 pub fn set_or_clear_endpoint_info<T>(mut self, v: std::option::Option<T>) -> Self
1961 where
1962 T: std::convert::Into<crate::model::EndpointInfo>,
1963 {
1964 self.endpoint_info = v.map(|x| x.into());
1965 self
1966 }
1967
1968 /// Sets the value of [probing_latency][crate::model::ProbingDetails::probing_latency].
1969 ///
1970 /// # Example
1971 /// ```ignore,no_run
1972 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1973 /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
1974 /// let x = ProbingDetails::new().set_probing_latency(LatencyDistribution::default()/* use setters */);
1975 /// ```
1976 pub fn set_probing_latency<T>(mut self, v: T) -> Self
1977 where
1978 T: std::convert::Into<crate::model::LatencyDistribution>,
1979 {
1980 self.probing_latency = std::option::Option::Some(v.into());
1981 self
1982 }
1983
1984 /// Sets or clears the value of [probing_latency][crate::model::ProbingDetails::probing_latency].
1985 ///
1986 /// # Example
1987 /// ```ignore,no_run
1988 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
1989 /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
1990 /// let x = ProbingDetails::new().set_or_clear_probing_latency(Some(LatencyDistribution::default()/* use setters */));
1991 /// let x = ProbingDetails::new().set_or_clear_probing_latency(None::<LatencyDistribution>);
1992 /// ```
1993 pub fn set_or_clear_probing_latency<T>(mut self, v: std::option::Option<T>) -> Self
1994 where
1995 T: std::convert::Into<crate::model::LatencyDistribution>,
1996 {
1997 self.probing_latency = v.map(|x| x.into());
1998 self
1999 }
2000
2001 /// Sets the value of [destination_egress_location][crate::model::ProbingDetails::destination_egress_location].
2002 ///
2003 /// # Example
2004 /// ```ignore,no_run
2005 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2006 /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2007 /// let x = ProbingDetails::new().set_destination_egress_location(EdgeLocation::default()/* use setters */);
2008 /// ```
2009 pub fn set_destination_egress_location<T>(mut self, v: T) -> Self
2010 where
2011 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2012 {
2013 self.destination_egress_location = std::option::Option::Some(v.into());
2014 self
2015 }
2016
2017 /// Sets or clears the value of [destination_egress_location][crate::model::ProbingDetails::destination_egress_location].
2018 ///
2019 /// # Example
2020 /// ```ignore,no_run
2021 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2022 /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2023 /// let x = ProbingDetails::new().set_or_clear_destination_egress_location(Some(EdgeLocation::default()/* use setters */));
2024 /// let x = ProbingDetails::new().set_or_clear_destination_egress_location(None::<EdgeLocation>);
2025 /// ```
2026 pub fn set_or_clear_destination_egress_location<T>(mut self, v: std::option::Option<T>) -> Self
2027 where
2028 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2029 {
2030 self.destination_egress_location = v.map(|x| x.into());
2031 self
2032 }
2033
2034 /// Sets the value of [edge_responses][crate::model::ProbingDetails::edge_responses].
2035 ///
2036 /// # Example
2037 /// ```ignore,no_run
2038 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2039 /// use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2040 /// let x = ProbingDetails::new()
2041 /// .set_edge_responses([
2042 /// SingleEdgeResponse::default()/* use setters */,
2043 /// SingleEdgeResponse::default()/* use (different) setters */,
2044 /// ]);
2045 /// ```
2046 pub fn set_edge_responses<T, V>(mut self, v: T) -> Self
2047 where
2048 T: std::iter::IntoIterator<Item = V>,
2049 V: std::convert::Into<crate::model::probing_details::SingleEdgeResponse>,
2050 {
2051 use std::iter::Iterator;
2052 self.edge_responses = v.into_iter().map(|i| i.into()).collect();
2053 self
2054 }
2055
2056 /// Sets the value of [probed_all_devices][crate::model::ProbingDetails::probed_all_devices].
2057 ///
2058 /// # Example
2059 /// ```ignore,no_run
2060 /// # use google_cloud_networkmanagement_v1::model::ProbingDetails;
2061 /// let x = ProbingDetails::new().set_probed_all_devices(true);
2062 /// ```
2063 pub fn set_probed_all_devices<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2064 self.probed_all_devices = v.into();
2065 self
2066 }
2067}
2068
2069impl wkt::message::Message for ProbingDetails {
2070 fn typename() -> &'static str {
2071 "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails"
2072 }
2073}
2074
2075/// Defines additional types related to [ProbingDetails].
2076pub mod probing_details {
2077 #[allow(unused_imports)]
2078 use super::*;
2079
2080 /// Representation of a network edge location as per
2081 /// <https://cloud.google.com/vpc/docs/edge-locations>.
2082 #[derive(Clone, Default, PartialEq)]
2083 #[non_exhaustive]
2084 pub struct EdgeLocation {
2085 /// Name of the metropolitan area.
2086 pub metropolitan_area: std::string::String,
2087
2088 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2089 }
2090
2091 impl EdgeLocation {
2092 pub fn new() -> Self {
2093 std::default::Default::default()
2094 }
2095
2096 /// Sets the value of [metropolitan_area][crate::model::probing_details::EdgeLocation::metropolitan_area].
2097 ///
2098 /// # Example
2099 /// ```ignore,no_run
2100 /// # use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2101 /// let x = EdgeLocation::new().set_metropolitan_area("example");
2102 /// ```
2103 pub fn set_metropolitan_area<T: std::convert::Into<std::string::String>>(
2104 mut self,
2105 v: T,
2106 ) -> Self {
2107 self.metropolitan_area = v.into();
2108 self
2109 }
2110 }
2111
2112 impl wkt::message::Message for EdgeLocation {
2113 fn typename() -> &'static str {
2114 "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails.EdgeLocation"
2115 }
2116 }
2117
2118 /// Probing results for a single edge device.
2119 #[derive(Clone, Default, PartialEq)]
2120 #[non_exhaustive]
2121 pub struct SingleEdgeResponse {
2122 /// The overall result of active probing for this egress device.
2123 pub result: crate::model::probing_details::ProbingResult,
2124
2125 /// Number of probes sent.
2126 pub sent_probe_count: i32,
2127
2128 /// Number of probes that reached the destination.
2129 pub successful_probe_count: i32,
2130
2131 /// Latency as measured by active probing in one direction: from the source
2132 /// to the destination endpoint.
2133 pub probing_latency: std::option::Option<crate::model::LatencyDistribution>,
2134
2135 /// The EdgeLocation from which a packet, destined to the internet, will
2136 /// egress the Google network.
2137 /// This will only be populated for a connectivity test which has an internet
2138 /// destination address.
2139 /// The absence of this field *must not* be used as an indication that the
2140 /// destination is part of the Google network.
2141 pub destination_egress_location:
2142 std::option::Option<crate::model::probing_details::EdgeLocation>,
2143
2144 /// Router name in the format '{router}.{metroshard}'. For example:
2145 /// pf01.aaa01, pr02.aaa01.
2146 pub destination_router: std::string::String,
2147
2148 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2149 }
2150
2151 impl SingleEdgeResponse {
2152 pub fn new() -> Self {
2153 std::default::Default::default()
2154 }
2155
2156 /// Sets the value of [result][crate::model::probing_details::SingleEdgeResponse::result].
2157 ///
2158 /// # Example
2159 /// ```ignore,no_run
2160 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2161 /// use google_cloud_networkmanagement_v1::model::probing_details::ProbingResult;
2162 /// let x0 = SingleEdgeResponse::new().set_result(ProbingResult::Reachable);
2163 /// let x1 = SingleEdgeResponse::new().set_result(ProbingResult::Unreachable);
2164 /// let x2 = SingleEdgeResponse::new().set_result(ProbingResult::ReachabilityInconsistent);
2165 /// ```
2166 pub fn set_result<T: std::convert::Into<crate::model::probing_details::ProbingResult>>(
2167 mut self,
2168 v: T,
2169 ) -> Self {
2170 self.result = v.into();
2171 self
2172 }
2173
2174 /// Sets the value of [sent_probe_count][crate::model::probing_details::SingleEdgeResponse::sent_probe_count].
2175 ///
2176 /// # Example
2177 /// ```ignore,no_run
2178 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2179 /// let x = SingleEdgeResponse::new().set_sent_probe_count(42);
2180 /// ```
2181 pub fn set_sent_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2182 self.sent_probe_count = v.into();
2183 self
2184 }
2185
2186 /// Sets the value of [successful_probe_count][crate::model::probing_details::SingleEdgeResponse::successful_probe_count].
2187 ///
2188 /// # Example
2189 /// ```ignore,no_run
2190 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2191 /// let x = SingleEdgeResponse::new().set_successful_probe_count(42);
2192 /// ```
2193 pub fn set_successful_probe_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2194 self.successful_probe_count = v.into();
2195 self
2196 }
2197
2198 /// Sets the value of [probing_latency][crate::model::probing_details::SingleEdgeResponse::probing_latency].
2199 ///
2200 /// # Example
2201 /// ```ignore,no_run
2202 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2203 /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2204 /// let x = SingleEdgeResponse::new().set_probing_latency(LatencyDistribution::default()/* use setters */);
2205 /// ```
2206 pub fn set_probing_latency<T>(mut self, v: T) -> Self
2207 where
2208 T: std::convert::Into<crate::model::LatencyDistribution>,
2209 {
2210 self.probing_latency = std::option::Option::Some(v.into());
2211 self
2212 }
2213
2214 /// Sets or clears the value of [probing_latency][crate::model::probing_details::SingleEdgeResponse::probing_latency].
2215 ///
2216 /// # Example
2217 /// ```ignore,no_run
2218 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2219 /// use google_cloud_networkmanagement_v1::model::LatencyDistribution;
2220 /// let x = SingleEdgeResponse::new().set_or_clear_probing_latency(Some(LatencyDistribution::default()/* use setters */));
2221 /// let x = SingleEdgeResponse::new().set_or_clear_probing_latency(None::<LatencyDistribution>);
2222 /// ```
2223 pub fn set_or_clear_probing_latency<T>(mut self, v: std::option::Option<T>) -> Self
2224 where
2225 T: std::convert::Into<crate::model::LatencyDistribution>,
2226 {
2227 self.probing_latency = v.map(|x| x.into());
2228 self
2229 }
2230
2231 /// Sets the value of [destination_egress_location][crate::model::probing_details::SingleEdgeResponse::destination_egress_location].
2232 ///
2233 /// # Example
2234 /// ```ignore,no_run
2235 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2236 /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2237 /// let x = SingleEdgeResponse::new().set_destination_egress_location(EdgeLocation::default()/* use setters */);
2238 /// ```
2239 pub fn set_destination_egress_location<T>(mut self, v: T) -> Self
2240 where
2241 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2242 {
2243 self.destination_egress_location = std::option::Option::Some(v.into());
2244 self
2245 }
2246
2247 /// Sets or clears the value of [destination_egress_location][crate::model::probing_details::SingleEdgeResponse::destination_egress_location].
2248 ///
2249 /// # Example
2250 /// ```ignore,no_run
2251 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2252 /// use google_cloud_networkmanagement_v1::model::probing_details::EdgeLocation;
2253 /// let x = SingleEdgeResponse::new().set_or_clear_destination_egress_location(Some(EdgeLocation::default()/* use setters */));
2254 /// let x = SingleEdgeResponse::new().set_or_clear_destination_egress_location(None::<EdgeLocation>);
2255 /// ```
2256 pub fn set_or_clear_destination_egress_location<T>(
2257 mut self,
2258 v: std::option::Option<T>,
2259 ) -> Self
2260 where
2261 T: std::convert::Into<crate::model::probing_details::EdgeLocation>,
2262 {
2263 self.destination_egress_location = v.map(|x| x.into());
2264 self
2265 }
2266
2267 /// Sets the value of [destination_router][crate::model::probing_details::SingleEdgeResponse::destination_router].
2268 ///
2269 /// # Example
2270 /// ```ignore,no_run
2271 /// # use google_cloud_networkmanagement_v1::model::probing_details::SingleEdgeResponse;
2272 /// let x = SingleEdgeResponse::new().set_destination_router("example");
2273 /// ```
2274 pub fn set_destination_router<T: std::convert::Into<std::string::String>>(
2275 mut self,
2276 v: T,
2277 ) -> Self {
2278 self.destination_router = v.into();
2279 self
2280 }
2281 }
2282
2283 impl wkt::message::Message for SingleEdgeResponse {
2284 fn typename() -> &'static str {
2285 "type.googleapis.com/google.cloud.networkmanagement.v1.ProbingDetails.SingleEdgeResponse"
2286 }
2287 }
2288
2289 /// Overall probing result of the test.
2290 ///
2291 /// # Working with unknown values
2292 ///
2293 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2294 /// additional enum variants at any time. Adding new variants is not considered
2295 /// a breaking change. Applications should write their code in anticipation of:
2296 ///
2297 /// - New values appearing in future releases of the client library, **and**
2298 /// - New values received dynamically, without application changes.
2299 ///
2300 /// Please consult the [Working with enums] section in the user guide for some
2301 /// guidelines.
2302 ///
2303 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2304 #[derive(Clone, Debug, PartialEq)]
2305 #[non_exhaustive]
2306 pub enum ProbingResult {
2307 /// No result was specified.
2308 Unspecified,
2309 /// At least 95% of packets reached the destination.
2310 Reachable,
2311 /// No packets reached the destination.
2312 Unreachable,
2313 /// Less than 95% of packets reached the destination.
2314 ReachabilityInconsistent,
2315 /// Reachability could not be determined. Possible reasons are:
2316 ///
2317 /// * The user lacks permission to access some of the network resources
2318 /// required to run the test.
2319 /// * No valid source endpoint could be derived from the request.
2320 /// * An internal error occurred.
2321 Undetermined,
2322 /// If set, the enum was initialized with an unknown value.
2323 ///
2324 /// Applications can examine the value using [ProbingResult::value] or
2325 /// [ProbingResult::name].
2326 UnknownValue(probing_result::UnknownValue),
2327 }
2328
2329 #[doc(hidden)]
2330 pub mod probing_result {
2331 #[allow(unused_imports)]
2332 use super::*;
2333 #[derive(Clone, Debug, PartialEq)]
2334 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2335 }
2336
2337 impl ProbingResult {
2338 /// Gets the enum value.
2339 ///
2340 /// Returns `None` if the enum contains an unknown value deserialized from
2341 /// the string representation of enums.
2342 pub fn value(&self) -> std::option::Option<i32> {
2343 match self {
2344 Self::Unspecified => std::option::Option::Some(0),
2345 Self::Reachable => std::option::Option::Some(1),
2346 Self::Unreachable => std::option::Option::Some(2),
2347 Self::ReachabilityInconsistent => std::option::Option::Some(3),
2348 Self::Undetermined => std::option::Option::Some(4),
2349 Self::UnknownValue(u) => u.0.value(),
2350 }
2351 }
2352
2353 /// Gets the enum value as a string.
2354 ///
2355 /// Returns `None` if the enum contains an unknown value deserialized from
2356 /// the integer representation of enums.
2357 pub fn name(&self) -> std::option::Option<&str> {
2358 match self {
2359 Self::Unspecified => std::option::Option::Some("PROBING_RESULT_UNSPECIFIED"),
2360 Self::Reachable => std::option::Option::Some("REACHABLE"),
2361 Self::Unreachable => std::option::Option::Some("UNREACHABLE"),
2362 Self::ReachabilityInconsistent => {
2363 std::option::Option::Some("REACHABILITY_INCONSISTENT")
2364 }
2365 Self::Undetermined => std::option::Option::Some("UNDETERMINED"),
2366 Self::UnknownValue(u) => u.0.name(),
2367 }
2368 }
2369 }
2370
2371 impl std::default::Default for ProbingResult {
2372 fn default() -> Self {
2373 use std::convert::From;
2374 Self::from(0)
2375 }
2376 }
2377
2378 impl std::fmt::Display for ProbingResult {
2379 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2380 wkt::internal::display_enum(f, self.name(), self.value())
2381 }
2382 }
2383
2384 impl std::convert::From<i32> for ProbingResult {
2385 fn from(value: i32) -> Self {
2386 match value {
2387 0 => Self::Unspecified,
2388 1 => Self::Reachable,
2389 2 => Self::Unreachable,
2390 3 => Self::ReachabilityInconsistent,
2391 4 => Self::Undetermined,
2392 _ => Self::UnknownValue(probing_result::UnknownValue(
2393 wkt::internal::UnknownEnumValue::Integer(value),
2394 )),
2395 }
2396 }
2397 }
2398
2399 impl std::convert::From<&str> for ProbingResult {
2400 fn from(value: &str) -> Self {
2401 use std::string::ToString;
2402 match value {
2403 "PROBING_RESULT_UNSPECIFIED" => Self::Unspecified,
2404 "REACHABLE" => Self::Reachable,
2405 "UNREACHABLE" => Self::Unreachable,
2406 "REACHABILITY_INCONSISTENT" => Self::ReachabilityInconsistent,
2407 "UNDETERMINED" => Self::Undetermined,
2408 _ => Self::UnknownValue(probing_result::UnknownValue(
2409 wkt::internal::UnknownEnumValue::String(value.to_string()),
2410 )),
2411 }
2412 }
2413 }
2414
2415 impl serde::ser::Serialize for ProbingResult {
2416 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2417 where
2418 S: serde::Serializer,
2419 {
2420 match self {
2421 Self::Unspecified => serializer.serialize_i32(0),
2422 Self::Reachable => serializer.serialize_i32(1),
2423 Self::Unreachable => serializer.serialize_i32(2),
2424 Self::ReachabilityInconsistent => serializer.serialize_i32(3),
2425 Self::Undetermined => serializer.serialize_i32(4),
2426 Self::UnknownValue(u) => u.0.serialize(serializer),
2427 }
2428 }
2429 }
2430
2431 impl<'de> serde::de::Deserialize<'de> for ProbingResult {
2432 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2433 where
2434 D: serde::Deserializer<'de>,
2435 {
2436 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProbingResult>::new(
2437 ".google.cloud.networkmanagement.v1.ProbingDetails.ProbingResult",
2438 ))
2439 }
2440 }
2441
2442 /// Abort cause types.
2443 ///
2444 /// # Working with unknown values
2445 ///
2446 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2447 /// additional enum variants at any time. Adding new variants is not considered
2448 /// a breaking change. Applications should write their code in anticipation of:
2449 ///
2450 /// - New values appearing in future releases of the client library, **and**
2451 /// - New values received dynamically, without application changes.
2452 ///
2453 /// Please consult the [Working with enums] section in the user guide for some
2454 /// guidelines.
2455 ///
2456 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2457 #[derive(Clone, Debug, PartialEq)]
2458 #[non_exhaustive]
2459 pub enum ProbingAbortCause {
2460 /// No reason was specified.
2461 Unspecified,
2462 /// The user lacks permission to access some of the
2463 /// network resources required to run the test.
2464 PermissionDenied,
2465 /// No valid source endpoint could be derived from the request.
2466 NoSourceLocation,
2467 /// If set, the enum was initialized with an unknown value.
2468 ///
2469 /// Applications can examine the value using [ProbingAbortCause::value] or
2470 /// [ProbingAbortCause::name].
2471 UnknownValue(probing_abort_cause::UnknownValue),
2472 }
2473
2474 #[doc(hidden)]
2475 pub mod probing_abort_cause {
2476 #[allow(unused_imports)]
2477 use super::*;
2478 #[derive(Clone, Debug, PartialEq)]
2479 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2480 }
2481
2482 impl ProbingAbortCause {
2483 /// Gets the enum value.
2484 ///
2485 /// Returns `None` if the enum contains an unknown value deserialized from
2486 /// the string representation of enums.
2487 pub fn value(&self) -> std::option::Option<i32> {
2488 match self {
2489 Self::Unspecified => std::option::Option::Some(0),
2490 Self::PermissionDenied => std::option::Option::Some(1),
2491 Self::NoSourceLocation => std::option::Option::Some(2),
2492 Self::UnknownValue(u) => u.0.value(),
2493 }
2494 }
2495
2496 /// Gets the enum value as a string.
2497 ///
2498 /// Returns `None` if the enum contains an unknown value deserialized from
2499 /// the integer representation of enums.
2500 pub fn name(&self) -> std::option::Option<&str> {
2501 match self {
2502 Self::Unspecified => std::option::Option::Some("PROBING_ABORT_CAUSE_UNSPECIFIED"),
2503 Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
2504 Self::NoSourceLocation => std::option::Option::Some("NO_SOURCE_LOCATION"),
2505 Self::UnknownValue(u) => u.0.name(),
2506 }
2507 }
2508 }
2509
2510 impl std::default::Default for ProbingAbortCause {
2511 fn default() -> Self {
2512 use std::convert::From;
2513 Self::from(0)
2514 }
2515 }
2516
2517 impl std::fmt::Display for ProbingAbortCause {
2518 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2519 wkt::internal::display_enum(f, self.name(), self.value())
2520 }
2521 }
2522
2523 impl std::convert::From<i32> for ProbingAbortCause {
2524 fn from(value: i32) -> Self {
2525 match value {
2526 0 => Self::Unspecified,
2527 1 => Self::PermissionDenied,
2528 2 => Self::NoSourceLocation,
2529 _ => Self::UnknownValue(probing_abort_cause::UnknownValue(
2530 wkt::internal::UnknownEnumValue::Integer(value),
2531 )),
2532 }
2533 }
2534 }
2535
2536 impl std::convert::From<&str> for ProbingAbortCause {
2537 fn from(value: &str) -> Self {
2538 use std::string::ToString;
2539 match value {
2540 "PROBING_ABORT_CAUSE_UNSPECIFIED" => Self::Unspecified,
2541 "PERMISSION_DENIED" => Self::PermissionDenied,
2542 "NO_SOURCE_LOCATION" => Self::NoSourceLocation,
2543 _ => Self::UnknownValue(probing_abort_cause::UnknownValue(
2544 wkt::internal::UnknownEnumValue::String(value.to_string()),
2545 )),
2546 }
2547 }
2548 }
2549
2550 impl serde::ser::Serialize for ProbingAbortCause {
2551 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2552 where
2553 S: serde::Serializer,
2554 {
2555 match self {
2556 Self::Unspecified => serializer.serialize_i32(0),
2557 Self::PermissionDenied => serializer.serialize_i32(1),
2558 Self::NoSourceLocation => serializer.serialize_i32(2),
2559 Self::UnknownValue(u) => u.0.serialize(serializer),
2560 }
2561 }
2562 }
2563
2564 impl<'de> serde::de::Deserialize<'de> for ProbingAbortCause {
2565 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2566 where
2567 D: serde::Deserializer<'de>,
2568 {
2569 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProbingAbortCause>::new(
2570 ".google.cloud.networkmanagement.v1.ProbingDetails.ProbingAbortCause",
2571 ))
2572 }
2573 }
2574}
2575
2576/// Request for the `ListConnectivityTests` method.
2577#[derive(Clone, Default, PartialEq)]
2578#[non_exhaustive]
2579pub struct ListConnectivityTestsRequest {
2580 /// Required. The parent resource of the Connectivity Tests:
2581 /// `projects/{project_id}/locations/global`
2582 pub parent: std::string::String,
2583
2584 /// Number of `ConnectivityTests` to return.
2585 pub page_size: i32,
2586
2587 /// Page token from an earlier query, as returned in `next_page_token`.
2588 pub page_token: std::string::String,
2589
2590 /// Lists the `ConnectivityTests` that match the filter expression. A filter
2591 /// expression filters the resources listed in the response. The expression
2592 /// must be of the form `<field> <operator> <value>` where operators: `<`, `>`,
2593 /// `<=`,
2594 /// `>=`,
2595 /// `!=`, `=`, `:` are supported (colon `:` represents a HAS operator which is
2596 /// roughly synonymous with equality). \<field\> can refer to a proto or JSON
2597 /// field, or a synthetic field. Field names can be camelCase or snake_case.
2598 ///
2599 /// Examples:
2600 ///
2601 /// - Filter by name:
2602 /// name = "projects/proj-1/locations/global/connectivityTests/test-1
2603 ///
2604 /// - Filter by labels:
2605 ///
2606 /// - Resources that have a key called `foo`
2607 /// labels.foo:*
2608 /// - Resources that have a key called `foo` whose value is `bar`
2609 /// labels.foo = bar
2610 pub filter: std::string::String,
2611
2612 /// Field to use to sort the list.
2613 pub order_by: std::string::String,
2614
2615 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2616}
2617
2618impl ListConnectivityTestsRequest {
2619 pub fn new() -> Self {
2620 std::default::Default::default()
2621 }
2622
2623 /// Sets the value of [parent][crate::model::ListConnectivityTestsRequest::parent].
2624 ///
2625 /// # Example
2626 /// ```ignore,no_run
2627 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2628 /// let x = ListConnectivityTestsRequest::new().set_parent("example");
2629 /// ```
2630 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2631 self.parent = v.into();
2632 self
2633 }
2634
2635 /// Sets the value of [page_size][crate::model::ListConnectivityTestsRequest::page_size].
2636 ///
2637 /// # Example
2638 /// ```ignore,no_run
2639 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2640 /// let x = ListConnectivityTestsRequest::new().set_page_size(42);
2641 /// ```
2642 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2643 self.page_size = v.into();
2644 self
2645 }
2646
2647 /// Sets the value of [page_token][crate::model::ListConnectivityTestsRequest::page_token].
2648 ///
2649 /// # Example
2650 /// ```ignore,no_run
2651 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2652 /// let x = ListConnectivityTestsRequest::new().set_page_token("example");
2653 /// ```
2654 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2655 self.page_token = v.into();
2656 self
2657 }
2658
2659 /// Sets the value of [filter][crate::model::ListConnectivityTestsRequest::filter].
2660 ///
2661 /// # Example
2662 /// ```ignore,no_run
2663 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2664 /// let x = ListConnectivityTestsRequest::new().set_filter("example");
2665 /// ```
2666 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2667 self.filter = v.into();
2668 self
2669 }
2670
2671 /// Sets the value of [order_by][crate::model::ListConnectivityTestsRequest::order_by].
2672 ///
2673 /// # Example
2674 /// ```ignore,no_run
2675 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsRequest;
2676 /// let x = ListConnectivityTestsRequest::new().set_order_by("example");
2677 /// ```
2678 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2679 self.order_by = v.into();
2680 self
2681 }
2682}
2683
2684impl wkt::message::Message for ListConnectivityTestsRequest {
2685 fn typename() -> &'static str {
2686 "type.googleapis.com/google.cloud.networkmanagement.v1.ListConnectivityTestsRequest"
2687 }
2688}
2689
2690/// Response for the `ListConnectivityTests` method.
2691#[derive(Clone, Default, PartialEq)]
2692#[non_exhaustive]
2693pub struct ListConnectivityTestsResponse {
2694 /// List of Connectivity Tests.
2695 pub resources: std::vec::Vec<crate::model::ConnectivityTest>,
2696
2697 /// Page token to fetch the next set of Connectivity Tests.
2698 pub next_page_token: std::string::String,
2699
2700 /// Locations that could not be reached (when querying all locations with `-`).
2701 pub unreachable: std::vec::Vec<std::string::String>,
2702
2703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2704}
2705
2706impl ListConnectivityTestsResponse {
2707 pub fn new() -> Self {
2708 std::default::Default::default()
2709 }
2710
2711 /// Sets the value of [resources][crate::model::ListConnectivityTestsResponse::resources].
2712 ///
2713 /// # Example
2714 /// ```ignore,no_run
2715 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2716 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2717 /// let x = ListConnectivityTestsResponse::new()
2718 /// .set_resources([
2719 /// ConnectivityTest::default()/* use setters */,
2720 /// ConnectivityTest::default()/* use (different) setters */,
2721 /// ]);
2722 /// ```
2723 pub fn set_resources<T, V>(mut self, v: T) -> Self
2724 where
2725 T: std::iter::IntoIterator<Item = V>,
2726 V: std::convert::Into<crate::model::ConnectivityTest>,
2727 {
2728 use std::iter::Iterator;
2729 self.resources = v.into_iter().map(|i| i.into()).collect();
2730 self
2731 }
2732
2733 /// Sets the value of [next_page_token][crate::model::ListConnectivityTestsResponse::next_page_token].
2734 ///
2735 /// # Example
2736 /// ```ignore,no_run
2737 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2738 /// let x = ListConnectivityTestsResponse::new().set_next_page_token("example");
2739 /// ```
2740 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2741 self.next_page_token = v.into();
2742 self
2743 }
2744
2745 /// Sets the value of [unreachable][crate::model::ListConnectivityTestsResponse::unreachable].
2746 ///
2747 /// # Example
2748 /// ```ignore,no_run
2749 /// # use google_cloud_networkmanagement_v1::model::ListConnectivityTestsResponse;
2750 /// let x = ListConnectivityTestsResponse::new().set_unreachable(["a", "b", "c"]);
2751 /// ```
2752 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2753 where
2754 T: std::iter::IntoIterator<Item = V>,
2755 V: std::convert::Into<std::string::String>,
2756 {
2757 use std::iter::Iterator;
2758 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2759 self
2760 }
2761}
2762
2763impl wkt::message::Message for ListConnectivityTestsResponse {
2764 fn typename() -> &'static str {
2765 "type.googleapis.com/google.cloud.networkmanagement.v1.ListConnectivityTestsResponse"
2766 }
2767}
2768
2769#[doc(hidden)]
2770impl gax::paginator::internal::PageableResponse for ListConnectivityTestsResponse {
2771 type PageItem = crate::model::ConnectivityTest;
2772
2773 fn items(self) -> std::vec::Vec<Self::PageItem> {
2774 self.resources
2775 }
2776
2777 fn next_page_token(&self) -> std::string::String {
2778 use std::clone::Clone;
2779 self.next_page_token.clone()
2780 }
2781}
2782
2783/// Request for the `GetConnectivityTest` method.
2784#[derive(Clone, Default, PartialEq)]
2785#[non_exhaustive]
2786pub struct GetConnectivityTestRequest {
2787 /// Required. `ConnectivityTest` resource name using the form:
2788 /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
2789 pub name: std::string::String,
2790
2791 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2792}
2793
2794impl GetConnectivityTestRequest {
2795 pub fn new() -> Self {
2796 std::default::Default::default()
2797 }
2798
2799 /// Sets the value of [name][crate::model::GetConnectivityTestRequest::name].
2800 ///
2801 /// # Example
2802 /// ```ignore,no_run
2803 /// # use google_cloud_networkmanagement_v1::model::GetConnectivityTestRequest;
2804 /// let x = GetConnectivityTestRequest::new().set_name("example");
2805 /// ```
2806 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2807 self.name = v.into();
2808 self
2809 }
2810}
2811
2812impl wkt::message::Message for GetConnectivityTestRequest {
2813 fn typename() -> &'static str {
2814 "type.googleapis.com/google.cloud.networkmanagement.v1.GetConnectivityTestRequest"
2815 }
2816}
2817
2818/// Request for the `CreateConnectivityTest` method.
2819#[derive(Clone, Default, PartialEq)]
2820#[non_exhaustive]
2821pub struct CreateConnectivityTestRequest {
2822 /// Required. The parent resource of the Connectivity Test to create:
2823 /// `projects/{project_id}/locations/global`
2824 pub parent: std::string::String,
2825
2826 /// Required. The logical name of the Connectivity Test in your project
2827 /// with the following restrictions:
2828 ///
2829 /// * Must contain only lowercase letters, numbers, and hyphens.
2830 /// * Must start with a letter.
2831 /// * Must be between 1-40 characters.
2832 /// * Must end with a number or a letter.
2833 /// * Must be unique within the customer project
2834 pub test_id: std::string::String,
2835
2836 /// Required. A `ConnectivityTest` resource
2837 pub resource: std::option::Option<crate::model::ConnectivityTest>,
2838
2839 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2840}
2841
2842impl CreateConnectivityTestRequest {
2843 pub fn new() -> Self {
2844 std::default::Default::default()
2845 }
2846
2847 /// Sets the value of [parent][crate::model::CreateConnectivityTestRequest::parent].
2848 ///
2849 /// # Example
2850 /// ```ignore,no_run
2851 /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2852 /// let x = CreateConnectivityTestRequest::new().set_parent("example");
2853 /// ```
2854 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2855 self.parent = v.into();
2856 self
2857 }
2858
2859 /// Sets the value of [test_id][crate::model::CreateConnectivityTestRequest::test_id].
2860 ///
2861 /// # Example
2862 /// ```ignore,no_run
2863 /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2864 /// let x = CreateConnectivityTestRequest::new().set_test_id("example");
2865 /// ```
2866 pub fn set_test_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2867 self.test_id = v.into();
2868 self
2869 }
2870
2871 /// Sets the value of [resource][crate::model::CreateConnectivityTestRequest::resource].
2872 ///
2873 /// # Example
2874 /// ```ignore,no_run
2875 /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2876 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2877 /// let x = CreateConnectivityTestRequest::new().set_resource(ConnectivityTest::default()/* use setters */);
2878 /// ```
2879 pub fn set_resource<T>(mut self, v: T) -> Self
2880 where
2881 T: std::convert::Into<crate::model::ConnectivityTest>,
2882 {
2883 self.resource = std::option::Option::Some(v.into());
2884 self
2885 }
2886
2887 /// Sets or clears the value of [resource][crate::model::CreateConnectivityTestRequest::resource].
2888 ///
2889 /// # Example
2890 /// ```ignore,no_run
2891 /// # use google_cloud_networkmanagement_v1::model::CreateConnectivityTestRequest;
2892 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2893 /// let x = CreateConnectivityTestRequest::new().set_or_clear_resource(Some(ConnectivityTest::default()/* use setters */));
2894 /// let x = CreateConnectivityTestRequest::new().set_or_clear_resource(None::<ConnectivityTest>);
2895 /// ```
2896 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
2897 where
2898 T: std::convert::Into<crate::model::ConnectivityTest>,
2899 {
2900 self.resource = v.map(|x| x.into());
2901 self
2902 }
2903}
2904
2905impl wkt::message::Message for CreateConnectivityTestRequest {
2906 fn typename() -> &'static str {
2907 "type.googleapis.com/google.cloud.networkmanagement.v1.CreateConnectivityTestRequest"
2908 }
2909}
2910
2911/// Request for the `UpdateConnectivityTest` method.
2912#[derive(Clone, Default, PartialEq)]
2913#[non_exhaustive]
2914pub struct UpdateConnectivityTestRequest {
2915 /// Required. Mask of fields to update. At least one path must be supplied in
2916 /// this field.
2917 pub update_mask: std::option::Option<wkt::FieldMask>,
2918
2919 /// Required. Only fields specified in update_mask are updated.
2920 pub resource: std::option::Option<crate::model::ConnectivityTest>,
2921
2922 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2923}
2924
2925impl UpdateConnectivityTestRequest {
2926 pub fn new() -> Self {
2927 std::default::Default::default()
2928 }
2929
2930 /// Sets the value of [update_mask][crate::model::UpdateConnectivityTestRequest::update_mask].
2931 ///
2932 /// # Example
2933 /// ```ignore,no_run
2934 /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
2935 /// use wkt::FieldMask;
2936 /// let x = UpdateConnectivityTestRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2937 /// ```
2938 pub fn set_update_mask<T>(mut self, v: T) -> Self
2939 where
2940 T: std::convert::Into<wkt::FieldMask>,
2941 {
2942 self.update_mask = std::option::Option::Some(v.into());
2943 self
2944 }
2945
2946 /// Sets or clears the value of [update_mask][crate::model::UpdateConnectivityTestRequest::update_mask].
2947 ///
2948 /// # Example
2949 /// ```ignore,no_run
2950 /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
2951 /// use wkt::FieldMask;
2952 /// let x = UpdateConnectivityTestRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2953 /// let x = UpdateConnectivityTestRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2954 /// ```
2955 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2956 where
2957 T: std::convert::Into<wkt::FieldMask>,
2958 {
2959 self.update_mask = v.map(|x| x.into());
2960 self
2961 }
2962
2963 /// Sets the value of [resource][crate::model::UpdateConnectivityTestRequest::resource].
2964 ///
2965 /// # Example
2966 /// ```ignore,no_run
2967 /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
2968 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2969 /// let x = UpdateConnectivityTestRequest::new().set_resource(ConnectivityTest::default()/* use setters */);
2970 /// ```
2971 pub fn set_resource<T>(mut self, v: T) -> Self
2972 where
2973 T: std::convert::Into<crate::model::ConnectivityTest>,
2974 {
2975 self.resource = std::option::Option::Some(v.into());
2976 self
2977 }
2978
2979 /// Sets or clears the value of [resource][crate::model::UpdateConnectivityTestRequest::resource].
2980 ///
2981 /// # Example
2982 /// ```ignore,no_run
2983 /// # use google_cloud_networkmanagement_v1::model::UpdateConnectivityTestRequest;
2984 /// use google_cloud_networkmanagement_v1::model::ConnectivityTest;
2985 /// let x = UpdateConnectivityTestRequest::new().set_or_clear_resource(Some(ConnectivityTest::default()/* use setters */));
2986 /// let x = UpdateConnectivityTestRequest::new().set_or_clear_resource(None::<ConnectivityTest>);
2987 /// ```
2988 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
2989 where
2990 T: std::convert::Into<crate::model::ConnectivityTest>,
2991 {
2992 self.resource = v.map(|x| x.into());
2993 self
2994 }
2995}
2996
2997impl wkt::message::Message for UpdateConnectivityTestRequest {
2998 fn typename() -> &'static str {
2999 "type.googleapis.com/google.cloud.networkmanagement.v1.UpdateConnectivityTestRequest"
3000 }
3001}
3002
3003/// Request for the `DeleteConnectivityTest` method.
3004#[derive(Clone, Default, PartialEq)]
3005#[non_exhaustive]
3006pub struct DeleteConnectivityTestRequest {
3007 /// Required. Connectivity Test resource name using the form:
3008 /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
3009 pub name: std::string::String,
3010
3011 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3012}
3013
3014impl DeleteConnectivityTestRequest {
3015 pub fn new() -> Self {
3016 std::default::Default::default()
3017 }
3018
3019 /// Sets the value of [name][crate::model::DeleteConnectivityTestRequest::name].
3020 ///
3021 /// # Example
3022 /// ```ignore,no_run
3023 /// # use google_cloud_networkmanagement_v1::model::DeleteConnectivityTestRequest;
3024 /// let x = DeleteConnectivityTestRequest::new().set_name("example");
3025 /// ```
3026 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3027 self.name = v.into();
3028 self
3029 }
3030}
3031
3032impl wkt::message::Message for DeleteConnectivityTestRequest {
3033 fn typename() -> &'static str {
3034 "type.googleapis.com/google.cloud.networkmanagement.v1.DeleteConnectivityTestRequest"
3035 }
3036}
3037
3038/// Request for the `RerunConnectivityTest` method.
3039#[derive(Clone, Default, PartialEq)]
3040#[non_exhaustive]
3041pub struct RerunConnectivityTestRequest {
3042 /// Required. Connectivity Test resource name using the form:
3043 /// `projects/{project_id}/locations/global/connectivityTests/{test_id}`
3044 pub name: std::string::String,
3045
3046 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3047}
3048
3049impl RerunConnectivityTestRequest {
3050 pub fn new() -> Self {
3051 std::default::Default::default()
3052 }
3053
3054 /// Sets the value of [name][crate::model::RerunConnectivityTestRequest::name].
3055 ///
3056 /// # Example
3057 /// ```ignore,no_run
3058 /// # use google_cloud_networkmanagement_v1::model::RerunConnectivityTestRequest;
3059 /// let x = RerunConnectivityTestRequest::new().set_name("example");
3060 /// ```
3061 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3062 self.name = v.into();
3063 self
3064 }
3065}
3066
3067impl wkt::message::Message for RerunConnectivityTestRequest {
3068 fn typename() -> &'static str {
3069 "type.googleapis.com/google.cloud.networkmanagement.v1.RerunConnectivityTestRequest"
3070 }
3071}
3072
3073/// Metadata describing an [Operation][google.longrunning.Operation]
3074///
3075/// [google.longrunning.Operation]: longrunning::model::Operation
3076#[derive(Clone, Default, PartialEq)]
3077#[non_exhaustive]
3078pub struct OperationMetadata {
3079 /// The time the operation was created.
3080 pub create_time: std::option::Option<wkt::Timestamp>,
3081
3082 /// The time the operation finished running.
3083 pub end_time: std::option::Option<wkt::Timestamp>,
3084
3085 /// Target of the operation - for example
3086 /// projects/project-1/locations/global/connectivityTests/test-1
3087 pub target: std::string::String,
3088
3089 /// Name of the verb executed by the operation.
3090 pub verb: std::string::String,
3091
3092 /// Human-readable status of the operation, if any.
3093 pub status_detail: std::string::String,
3094
3095 /// Specifies if cancellation was requested for the operation.
3096 pub cancel_requested: bool,
3097
3098 /// API version.
3099 pub api_version: std::string::String,
3100
3101 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3102}
3103
3104impl OperationMetadata {
3105 pub fn new() -> Self {
3106 std::default::Default::default()
3107 }
3108
3109 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3110 ///
3111 /// # Example
3112 /// ```ignore,no_run
3113 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3114 /// use wkt::Timestamp;
3115 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
3116 /// ```
3117 pub fn set_create_time<T>(mut self, v: T) -> Self
3118 where
3119 T: std::convert::Into<wkt::Timestamp>,
3120 {
3121 self.create_time = std::option::Option::Some(v.into());
3122 self
3123 }
3124
3125 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3126 ///
3127 /// # Example
3128 /// ```ignore,no_run
3129 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3130 /// use wkt::Timestamp;
3131 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3132 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
3133 /// ```
3134 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3135 where
3136 T: std::convert::Into<wkt::Timestamp>,
3137 {
3138 self.create_time = v.map(|x| x.into());
3139 self
3140 }
3141
3142 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3143 ///
3144 /// # Example
3145 /// ```ignore,no_run
3146 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3147 /// use wkt::Timestamp;
3148 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3149 /// ```
3150 pub fn set_end_time<T>(mut self, v: T) -> Self
3151 where
3152 T: std::convert::Into<wkt::Timestamp>,
3153 {
3154 self.end_time = std::option::Option::Some(v.into());
3155 self
3156 }
3157
3158 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3159 ///
3160 /// # Example
3161 /// ```ignore,no_run
3162 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3163 /// use wkt::Timestamp;
3164 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3165 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3166 /// ```
3167 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3168 where
3169 T: std::convert::Into<wkt::Timestamp>,
3170 {
3171 self.end_time = v.map(|x| x.into());
3172 self
3173 }
3174
3175 /// Sets the value of [target][crate::model::OperationMetadata::target].
3176 ///
3177 /// # Example
3178 /// ```ignore,no_run
3179 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3180 /// let x = OperationMetadata::new().set_target("example");
3181 /// ```
3182 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3183 self.target = v.into();
3184 self
3185 }
3186
3187 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3188 ///
3189 /// # Example
3190 /// ```ignore,no_run
3191 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3192 /// let x = OperationMetadata::new().set_verb("example");
3193 /// ```
3194 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3195 self.verb = v.into();
3196 self
3197 }
3198
3199 /// Sets the value of [status_detail][crate::model::OperationMetadata::status_detail].
3200 ///
3201 /// # Example
3202 /// ```ignore,no_run
3203 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3204 /// let x = OperationMetadata::new().set_status_detail("example");
3205 /// ```
3206 pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3207 self.status_detail = v.into();
3208 self
3209 }
3210
3211 /// Sets the value of [cancel_requested][crate::model::OperationMetadata::cancel_requested].
3212 ///
3213 /// # Example
3214 /// ```ignore,no_run
3215 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3216 /// let x = OperationMetadata::new().set_cancel_requested(true);
3217 /// ```
3218 pub fn set_cancel_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3219 self.cancel_requested = v.into();
3220 self
3221 }
3222
3223 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3224 ///
3225 /// # Example
3226 /// ```ignore,no_run
3227 /// # use google_cloud_networkmanagement_v1::model::OperationMetadata;
3228 /// let x = OperationMetadata::new().set_api_version("example");
3229 /// ```
3230 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3231 self.api_version = v.into();
3232 self
3233 }
3234}
3235
3236impl wkt::message::Message for OperationMetadata {
3237 fn typename() -> &'static str {
3238 "type.googleapis.com/google.cloud.networkmanagement.v1.OperationMetadata"
3239 }
3240}
3241
3242/// Trace represents one simulated packet forwarding path.
3243///
3244/// * Each trace contains multiple ordered steps.
3245/// * Each step is in a particular state with associated configuration.
3246/// * State is categorized as final or non-final states.
3247/// * Each final state has a reason associated.
3248/// * Each trace must end with a final state (the last step).
3249///
3250/// ```norust
3251/// |---------------------Trace----------------------|
3252/// Step1(State) Step2(State) --- StepN(State(final))
3253/// ```
3254#[derive(Clone, Default, PartialEq)]
3255#[non_exhaustive]
3256pub struct Trace {
3257 /// Derived from the source and destination endpoints definition specified by
3258 /// user request, and validated by the data plane model.
3259 /// If there are multiple traces starting from different source locations, then
3260 /// the endpoint_info may be different between traces.
3261 pub endpoint_info: std::option::Option<crate::model::EndpointInfo>,
3262
3263 /// A trace of a test contains multiple steps from the initial state to the
3264 /// final state (delivered, dropped, forwarded, or aborted).
3265 ///
3266 /// The steps are ordered by the processing sequence within the simulated
3267 /// network state machine. It is critical to preserve the order of the steps
3268 /// and avoid reordering or sorting them.
3269 pub steps: std::vec::Vec<crate::model::Step>,
3270
3271 /// ID of trace. For forward traces, this ID is unique for each trace. For
3272 /// return traces, it matches ID of associated forward trace. A single forward
3273 /// trace can be associated with none, one or more than one return trace.
3274 pub forward_trace_id: i32,
3275
3276 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3277}
3278
3279impl Trace {
3280 pub fn new() -> Self {
3281 std::default::Default::default()
3282 }
3283
3284 /// Sets the value of [endpoint_info][crate::model::Trace::endpoint_info].
3285 ///
3286 /// # Example
3287 /// ```ignore,no_run
3288 /// # use google_cloud_networkmanagement_v1::model::Trace;
3289 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3290 /// let x = Trace::new().set_endpoint_info(EndpointInfo::default()/* use setters */);
3291 /// ```
3292 pub fn set_endpoint_info<T>(mut self, v: T) -> Self
3293 where
3294 T: std::convert::Into<crate::model::EndpointInfo>,
3295 {
3296 self.endpoint_info = std::option::Option::Some(v.into());
3297 self
3298 }
3299
3300 /// Sets or clears the value of [endpoint_info][crate::model::Trace::endpoint_info].
3301 ///
3302 /// # Example
3303 /// ```ignore,no_run
3304 /// # use google_cloud_networkmanagement_v1::model::Trace;
3305 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3306 /// let x = Trace::new().set_or_clear_endpoint_info(Some(EndpointInfo::default()/* use setters */));
3307 /// let x = Trace::new().set_or_clear_endpoint_info(None::<EndpointInfo>);
3308 /// ```
3309 pub fn set_or_clear_endpoint_info<T>(mut self, v: std::option::Option<T>) -> Self
3310 where
3311 T: std::convert::Into<crate::model::EndpointInfo>,
3312 {
3313 self.endpoint_info = v.map(|x| x.into());
3314 self
3315 }
3316
3317 /// Sets the value of [steps][crate::model::Trace::steps].
3318 ///
3319 /// # Example
3320 /// ```ignore,no_run
3321 /// # use google_cloud_networkmanagement_v1::model::Trace;
3322 /// use google_cloud_networkmanagement_v1::model::Step;
3323 /// let x = Trace::new()
3324 /// .set_steps([
3325 /// Step::default()/* use setters */,
3326 /// Step::default()/* use (different) setters */,
3327 /// ]);
3328 /// ```
3329 pub fn set_steps<T, V>(mut self, v: T) -> Self
3330 where
3331 T: std::iter::IntoIterator<Item = V>,
3332 V: std::convert::Into<crate::model::Step>,
3333 {
3334 use std::iter::Iterator;
3335 self.steps = v.into_iter().map(|i| i.into()).collect();
3336 self
3337 }
3338
3339 /// Sets the value of [forward_trace_id][crate::model::Trace::forward_trace_id].
3340 ///
3341 /// # Example
3342 /// ```ignore,no_run
3343 /// # use google_cloud_networkmanagement_v1::model::Trace;
3344 /// let x = Trace::new().set_forward_trace_id(42);
3345 /// ```
3346 pub fn set_forward_trace_id<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3347 self.forward_trace_id = v.into();
3348 self
3349 }
3350}
3351
3352impl wkt::message::Message for Trace {
3353 fn typename() -> &'static str {
3354 "type.googleapis.com/google.cloud.networkmanagement.v1.Trace"
3355 }
3356}
3357
3358/// A simulated forwarding path is composed of multiple steps.
3359/// Each step has a well-defined state and an associated configuration.
3360#[derive(Clone, Default, PartialEq)]
3361#[non_exhaustive]
3362pub struct Step {
3363 /// A description of the step. Usually this is a summary of the state.
3364 pub description: std::string::String,
3365
3366 /// Each step is in one of the pre-defined states.
3367 pub state: crate::model::step::State,
3368
3369 /// This is a step that leads to the final state Drop.
3370 pub causes_drop: bool,
3371
3372 /// Project ID that contains the configuration this step is validating.
3373 pub project_id: std::string::String,
3374
3375 /// Configuration or metadata associated with each step.
3376 /// The configuration is filtered based on viewer's permission. If a viewer
3377 /// has no permission to view the configuration in this step, for non-final
3378 /// states a special state is populated (VIEWER_PERMISSION_MISSING), and for
3379 /// final state the configuration is cleared.
3380 pub step_info: std::option::Option<crate::model::step::StepInfo>,
3381
3382 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3383}
3384
3385impl Step {
3386 pub fn new() -> Self {
3387 std::default::Default::default()
3388 }
3389
3390 /// Sets the value of [description][crate::model::Step::description].
3391 ///
3392 /// # Example
3393 /// ```ignore,no_run
3394 /// # use google_cloud_networkmanagement_v1::model::Step;
3395 /// let x = Step::new().set_description("example");
3396 /// ```
3397 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3398 self.description = v.into();
3399 self
3400 }
3401
3402 /// Sets the value of [state][crate::model::Step::state].
3403 ///
3404 /// # Example
3405 /// ```ignore,no_run
3406 /// # use google_cloud_networkmanagement_v1::model::Step;
3407 /// use google_cloud_networkmanagement_v1::model::step::State;
3408 /// let x0 = Step::new().set_state(State::StartFromInstance);
3409 /// let x1 = Step::new().set_state(State::StartFromInternet);
3410 /// let x2 = Step::new().set_state(State::StartFromGoogleService);
3411 /// ```
3412 pub fn set_state<T: std::convert::Into<crate::model::step::State>>(mut self, v: T) -> Self {
3413 self.state = v.into();
3414 self
3415 }
3416
3417 /// Sets the value of [causes_drop][crate::model::Step::causes_drop].
3418 ///
3419 /// # Example
3420 /// ```ignore,no_run
3421 /// # use google_cloud_networkmanagement_v1::model::Step;
3422 /// let x = Step::new().set_causes_drop(true);
3423 /// ```
3424 pub fn set_causes_drop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3425 self.causes_drop = v.into();
3426 self
3427 }
3428
3429 /// Sets the value of [project_id][crate::model::Step::project_id].
3430 ///
3431 /// # Example
3432 /// ```ignore,no_run
3433 /// # use google_cloud_networkmanagement_v1::model::Step;
3434 /// let x = Step::new().set_project_id("example");
3435 /// ```
3436 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3437 self.project_id = v.into();
3438 self
3439 }
3440
3441 /// Sets the value of [step_info][crate::model::Step::step_info].
3442 ///
3443 /// Note that all the setters affecting `step_info` are mutually
3444 /// exclusive.
3445 ///
3446 /// # Example
3447 /// ```ignore,no_run
3448 /// # use google_cloud_networkmanagement_v1::model::Step;
3449 /// use google_cloud_networkmanagement_v1::model::InstanceInfo;
3450 /// let x = Step::new().set_step_info(Some(
3451 /// google_cloud_networkmanagement_v1::model::step::StepInfo::Instance(InstanceInfo::default().into())));
3452 /// ```
3453 pub fn set_step_info<
3454 T: std::convert::Into<std::option::Option<crate::model::step::StepInfo>>,
3455 >(
3456 mut self,
3457 v: T,
3458 ) -> Self {
3459 self.step_info = v.into();
3460 self
3461 }
3462
3463 /// The value of [step_info][crate::model::Step::step_info]
3464 /// if it holds a `Instance`, `None` if the field is not set or
3465 /// holds a different branch.
3466 pub fn instance(&self) -> std::option::Option<&std::boxed::Box<crate::model::InstanceInfo>> {
3467 #[allow(unreachable_patterns)]
3468 self.step_info.as_ref().and_then(|v| match v {
3469 crate::model::step::StepInfo::Instance(v) => std::option::Option::Some(v),
3470 _ => std::option::Option::None,
3471 })
3472 }
3473
3474 /// Sets the value of [step_info][crate::model::Step::step_info]
3475 /// to hold a `Instance`.
3476 ///
3477 /// Note that all the setters affecting `step_info` are
3478 /// mutually exclusive.
3479 ///
3480 /// # Example
3481 /// ```ignore,no_run
3482 /// # use google_cloud_networkmanagement_v1::model::Step;
3483 /// use google_cloud_networkmanagement_v1::model::InstanceInfo;
3484 /// let x = Step::new().set_instance(InstanceInfo::default()/* use setters */);
3485 /// assert!(x.instance().is_some());
3486 /// assert!(x.firewall().is_none());
3487 /// assert!(x.route().is_none());
3488 /// assert!(x.endpoint().is_none());
3489 /// assert!(x.google_service().is_none());
3490 /// assert!(x.forwarding_rule().is_none());
3491 /// assert!(x.hybrid_subnet().is_none());
3492 /// assert!(x.vpn_gateway().is_none());
3493 /// assert!(x.vpn_tunnel().is_none());
3494 /// assert!(x.interconnect_attachment().is_none());
3495 /// assert!(x.vpc_connector().is_none());
3496 /// assert!(x.direct_vpc_egress_connection().is_none());
3497 /// assert!(x.serverless_external_connection().is_none());
3498 /// assert!(x.deliver().is_none());
3499 /// assert!(x.forward().is_none());
3500 /// assert!(x.abort().is_none());
3501 /// assert!(x.drop().is_none());
3502 /// assert!(x.load_balancer().is_none());
3503 /// assert!(x.network().is_none());
3504 /// assert!(x.gke_master().is_none());
3505 /// assert!(x.cloud_sql_instance().is_none());
3506 /// assert!(x.redis_instance().is_none());
3507 /// assert!(x.redis_cluster().is_none());
3508 /// assert!(x.cloud_function().is_none());
3509 /// assert!(x.app_engine_version().is_none());
3510 /// assert!(x.cloud_run_revision().is_none());
3511 /// assert!(x.nat().is_none());
3512 /// assert!(x.proxy_connection().is_none());
3513 /// assert!(x.load_balancer_backend_info().is_none());
3514 /// assert!(x.storage_bucket().is_none());
3515 /// assert!(x.serverless_neg().is_none());
3516 /// ```
3517 pub fn set_instance<T: std::convert::Into<std::boxed::Box<crate::model::InstanceInfo>>>(
3518 mut self,
3519 v: T,
3520 ) -> Self {
3521 self.step_info =
3522 std::option::Option::Some(crate::model::step::StepInfo::Instance(v.into()));
3523 self
3524 }
3525
3526 /// The value of [step_info][crate::model::Step::step_info]
3527 /// if it holds a `Firewall`, `None` if the field is not set or
3528 /// holds a different branch.
3529 pub fn firewall(&self) -> std::option::Option<&std::boxed::Box<crate::model::FirewallInfo>> {
3530 #[allow(unreachable_patterns)]
3531 self.step_info.as_ref().and_then(|v| match v {
3532 crate::model::step::StepInfo::Firewall(v) => std::option::Option::Some(v),
3533 _ => std::option::Option::None,
3534 })
3535 }
3536
3537 /// Sets the value of [step_info][crate::model::Step::step_info]
3538 /// to hold a `Firewall`.
3539 ///
3540 /// Note that all the setters affecting `step_info` are
3541 /// mutually exclusive.
3542 ///
3543 /// # Example
3544 /// ```ignore,no_run
3545 /// # use google_cloud_networkmanagement_v1::model::Step;
3546 /// use google_cloud_networkmanagement_v1::model::FirewallInfo;
3547 /// let x = Step::new().set_firewall(FirewallInfo::default()/* use setters */);
3548 /// assert!(x.firewall().is_some());
3549 /// assert!(x.instance().is_none());
3550 /// assert!(x.route().is_none());
3551 /// assert!(x.endpoint().is_none());
3552 /// assert!(x.google_service().is_none());
3553 /// assert!(x.forwarding_rule().is_none());
3554 /// assert!(x.hybrid_subnet().is_none());
3555 /// assert!(x.vpn_gateway().is_none());
3556 /// assert!(x.vpn_tunnel().is_none());
3557 /// assert!(x.interconnect_attachment().is_none());
3558 /// assert!(x.vpc_connector().is_none());
3559 /// assert!(x.direct_vpc_egress_connection().is_none());
3560 /// assert!(x.serverless_external_connection().is_none());
3561 /// assert!(x.deliver().is_none());
3562 /// assert!(x.forward().is_none());
3563 /// assert!(x.abort().is_none());
3564 /// assert!(x.drop().is_none());
3565 /// assert!(x.load_balancer().is_none());
3566 /// assert!(x.network().is_none());
3567 /// assert!(x.gke_master().is_none());
3568 /// assert!(x.cloud_sql_instance().is_none());
3569 /// assert!(x.redis_instance().is_none());
3570 /// assert!(x.redis_cluster().is_none());
3571 /// assert!(x.cloud_function().is_none());
3572 /// assert!(x.app_engine_version().is_none());
3573 /// assert!(x.cloud_run_revision().is_none());
3574 /// assert!(x.nat().is_none());
3575 /// assert!(x.proxy_connection().is_none());
3576 /// assert!(x.load_balancer_backend_info().is_none());
3577 /// assert!(x.storage_bucket().is_none());
3578 /// assert!(x.serverless_neg().is_none());
3579 /// ```
3580 pub fn set_firewall<T: std::convert::Into<std::boxed::Box<crate::model::FirewallInfo>>>(
3581 mut self,
3582 v: T,
3583 ) -> Self {
3584 self.step_info =
3585 std::option::Option::Some(crate::model::step::StepInfo::Firewall(v.into()));
3586 self
3587 }
3588
3589 /// The value of [step_info][crate::model::Step::step_info]
3590 /// if it holds a `Route`, `None` if the field is not set or
3591 /// holds a different branch.
3592 pub fn route(&self) -> std::option::Option<&std::boxed::Box<crate::model::RouteInfo>> {
3593 #[allow(unreachable_patterns)]
3594 self.step_info.as_ref().and_then(|v| match v {
3595 crate::model::step::StepInfo::Route(v) => std::option::Option::Some(v),
3596 _ => std::option::Option::None,
3597 })
3598 }
3599
3600 /// Sets the value of [step_info][crate::model::Step::step_info]
3601 /// to hold a `Route`.
3602 ///
3603 /// Note that all the setters affecting `step_info` are
3604 /// mutually exclusive.
3605 ///
3606 /// # Example
3607 /// ```ignore,no_run
3608 /// # use google_cloud_networkmanagement_v1::model::Step;
3609 /// use google_cloud_networkmanagement_v1::model::RouteInfo;
3610 /// let x = Step::new().set_route(RouteInfo::default()/* use setters */);
3611 /// assert!(x.route().is_some());
3612 /// assert!(x.instance().is_none());
3613 /// assert!(x.firewall().is_none());
3614 /// assert!(x.endpoint().is_none());
3615 /// assert!(x.google_service().is_none());
3616 /// assert!(x.forwarding_rule().is_none());
3617 /// assert!(x.hybrid_subnet().is_none());
3618 /// assert!(x.vpn_gateway().is_none());
3619 /// assert!(x.vpn_tunnel().is_none());
3620 /// assert!(x.interconnect_attachment().is_none());
3621 /// assert!(x.vpc_connector().is_none());
3622 /// assert!(x.direct_vpc_egress_connection().is_none());
3623 /// assert!(x.serverless_external_connection().is_none());
3624 /// assert!(x.deliver().is_none());
3625 /// assert!(x.forward().is_none());
3626 /// assert!(x.abort().is_none());
3627 /// assert!(x.drop().is_none());
3628 /// assert!(x.load_balancer().is_none());
3629 /// assert!(x.network().is_none());
3630 /// assert!(x.gke_master().is_none());
3631 /// assert!(x.cloud_sql_instance().is_none());
3632 /// assert!(x.redis_instance().is_none());
3633 /// assert!(x.redis_cluster().is_none());
3634 /// assert!(x.cloud_function().is_none());
3635 /// assert!(x.app_engine_version().is_none());
3636 /// assert!(x.cloud_run_revision().is_none());
3637 /// assert!(x.nat().is_none());
3638 /// assert!(x.proxy_connection().is_none());
3639 /// assert!(x.load_balancer_backend_info().is_none());
3640 /// assert!(x.storage_bucket().is_none());
3641 /// assert!(x.serverless_neg().is_none());
3642 /// ```
3643 pub fn set_route<T: std::convert::Into<std::boxed::Box<crate::model::RouteInfo>>>(
3644 mut self,
3645 v: T,
3646 ) -> Self {
3647 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Route(v.into()));
3648 self
3649 }
3650
3651 /// The value of [step_info][crate::model::Step::step_info]
3652 /// if it holds a `Endpoint`, `None` if the field is not set or
3653 /// holds a different branch.
3654 pub fn endpoint(&self) -> std::option::Option<&std::boxed::Box<crate::model::EndpointInfo>> {
3655 #[allow(unreachable_patterns)]
3656 self.step_info.as_ref().and_then(|v| match v {
3657 crate::model::step::StepInfo::Endpoint(v) => std::option::Option::Some(v),
3658 _ => std::option::Option::None,
3659 })
3660 }
3661
3662 /// Sets the value of [step_info][crate::model::Step::step_info]
3663 /// to hold a `Endpoint`.
3664 ///
3665 /// Note that all the setters affecting `step_info` are
3666 /// mutually exclusive.
3667 ///
3668 /// # Example
3669 /// ```ignore,no_run
3670 /// # use google_cloud_networkmanagement_v1::model::Step;
3671 /// use google_cloud_networkmanagement_v1::model::EndpointInfo;
3672 /// let x = Step::new().set_endpoint(EndpointInfo::default()/* use setters */);
3673 /// assert!(x.endpoint().is_some());
3674 /// assert!(x.instance().is_none());
3675 /// assert!(x.firewall().is_none());
3676 /// assert!(x.route().is_none());
3677 /// assert!(x.google_service().is_none());
3678 /// assert!(x.forwarding_rule().is_none());
3679 /// assert!(x.hybrid_subnet().is_none());
3680 /// assert!(x.vpn_gateway().is_none());
3681 /// assert!(x.vpn_tunnel().is_none());
3682 /// assert!(x.interconnect_attachment().is_none());
3683 /// assert!(x.vpc_connector().is_none());
3684 /// assert!(x.direct_vpc_egress_connection().is_none());
3685 /// assert!(x.serverless_external_connection().is_none());
3686 /// assert!(x.deliver().is_none());
3687 /// assert!(x.forward().is_none());
3688 /// assert!(x.abort().is_none());
3689 /// assert!(x.drop().is_none());
3690 /// assert!(x.load_balancer().is_none());
3691 /// assert!(x.network().is_none());
3692 /// assert!(x.gke_master().is_none());
3693 /// assert!(x.cloud_sql_instance().is_none());
3694 /// assert!(x.redis_instance().is_none());
3695 /// assert!(x.redis_cluster().is_none());
3696 /// assert!(x.cloud_function().is_none());
3697 /// assert!(x.app_engine_version().is_none());
3698 /// assert!(x.cloud_run_revision().is_none());
3699 /// assert!(x.nat().is_none());
3700 /// assert!(x.proxy_connection().is_none());
3701 /// assert!(x.load_balancer_backend_info().is_none());
3702 /// assert!(x.storage_bucket().is_none());
3703 /// assert!(x.serverless_neg().is_none());
3704 /// ```
3705 pub fn set_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::EndpointInfo>>>(
3706 mut self,
3707 v: T,
3708 ) -> Self {
3709 self.step_info =
3710 std::option::Option::Some(crate::model::step::StepInfo::Endpoint(v.into()));
3711 self
3712 }
3713
3714 /// The value of [step_info][crate::model::Step::step_info]
3715 /// if it holds a `GoogleService`, `None` if the field is not set or
3716 /// holds a different branch.
3717 pub fn google_service(
3718 &self,
3719 ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleServiceInfo>> {
3720 #[allow(unreachable_patterns)]
3721 self.step_info.as_ref().and_then(|v| match v {
3722 crate::model::step::StepInfo::GoogleService(v) => std::option::Option::Some(v),
3723 _ => std::option::Option::None,
3724 })
3725 }
3726
3727 /// Sets the value of [step_info][crate::model::Step::step_info]
3728 /// to hold a `GoogleService`.
3729 ///
3730 /// Note that all the setters affecting `step_info` are
3731 /// mutually exclusive.
3732 ///
3733 /// # Example
3734 /// ```ignore,no_run
3735 /// # use google_cloud_networkmanagement_v1::model::Step;
3736 /// use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
3737 /// let x = Step::new().set_google_service(GoogleServiceInfo::default()/* use setters */);
3738 /// assert!(x.google_service().is_some());
3739 /// assert!(x.instance().is_none());
3740 /// assert!(x.firewall().is_none());
3741 /// assert!(x.route().is_none());
3742 /// assert!(x.endpoint().is_none());
3743 /// assert!(x.forwarding_rule().is_none());
3744 /// assert!(x.hybrid_subnet().is_none());
3745 /// assert!(x.vpn_gateway().is_none());
3746 /// assert!(x.vpn_tunnel().is_none());
3747 /// assert!(x.interconnect_attachment().is_none());
3748 /// assert!(x.vpc_connector().is_none());
3749 /// assert!(x.direct_vpc_egress_connection().is_none());
3750 /// assert!(x.serverless_external_connection().is_none());
3751 /// assert!(x.deliver().is_none());
3752 /// assert!(x.forward().is_none());
3753 /// assert!(x.abort().is_none());
3754 /// assert!(x.drop().is_none());
3755 /// assert!(x.load_balancer().is_none());
3756 /// assert!(x.network().is_none());
3757 /// assert!(x.gke_master().is_none());
3758 /// assert!(x.cloud_sql_instance().is_none());
3759 /// assert!(x.redis_instance().is_none());
3760 /// assert!(x.redis_cluster().is_none());
3761 /// assert!(x.cloud_function().is_none());
3762 /// assert!(x.app_engine_version().is_none());
3763 /// assert!(x.cloud_run_revision().is_none());
3764 /// assert!(x.nat().is_none());
3765 /// assert!(x.proxy_connection().is_none());
3766 /// assert!(x.load_balancer_backend_info().is_none());
3767 /// assert!(x.storage_bucket().is_none());
3768 /// assert!(x.serverless_neg().is_none());
3769 /// ```
3770 pub fn set_google_service<
3771 T: std::convert::Into<std::boxed::Box<crate::model::GoogleServiceInfo>>,
3772 >(
3773 mut self,
3774 v: T,
3775 ) -> Self {
3776 self.step_info =
3777 std::option::Option::Some(crate::model::step::StepInfo::GoogleService(v.into()));
3778 self
3779 }
3780
3781 /// The value of [step_info][crate::model::Step::step_info]
3782 /// if it holds a `ForwardingRule`, `None` if the field is not set or
3783 /// holds a different branch.
3784 pub fn forwarding_rule(
3785 &self,
3786 ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardingRuleInfo>> {
3787 #[allow(unreachable_patterns)]
3788 self.step_info.as_ref().and_then(|v| match v {
3789 crate::model::step::StepInfo::ForwardingRule(v) => std::option::Option::Some(v),
3790 _ => std::option::Option::None,
3791 })
3792 }
3793
3794 /// Sets the value of [step_info][crate::model::Step::step_info]
3795 /// to hold a `ForwardingRule`.
3796 ///
3797 /// Note that all the setters affecting `step_info` are
3798 /// mutually exclusive.
3799 ///
3800 /// # Example
3801 /// ```ignore,no_run
3802 /// # use google_cloud_networkmanagement_v1::model::Step;
3803 /// use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
3804 /// let x = Step::new().set_forwarding_rule(ForwardingRuleInfo::default()/* use setters */);
3805 /// assert!(x.forwarding_rule().is_some());
3806 /// assert!(x.instance().is_none());
3807 /// assert!(x.firewall().is_none());
3808 /// assert!(x.route().is_none());
3809 /// assert!(x.endpoint().is_none());
3810 /// assert!(x.google_service().is_none());
3811 /// assert!(x.hybrid_subnet().is_none());
3812 /// assert!(x.vpn_gateway().is_none());
3813 /// assert!(x.vpn_tunnel().is_none());
3814 /// assert!(x.interconnect_attachment().is_none());
3815 /// assert!(x.vpc_connector().is_none());
3816 /// assert!(x.direct_vpc_egress_connection().is_none());
3817 /// assert!(x.serverless_external_connection().is_none());
3818 /// assert!(x.deliver().is_none());
3819 /// assert!(x.forward().is_none());
3820 /// assert!(x.abort().is_none());
3821 /// assert!(x.drop().is_none());
3822 /// assert!(x.load_balancer().is_none());
3823 /// assert!(x.network().is_none());
3824 /// assert!(x.gke_master().is_none());
3825 /// assert!(x.cloud_sql_instance().is_none());
3826 /// assert!(x.redis_instance().is_none());
3827 /// assert!(x.redis_cluster().is_none());
3828 /// assert!(x.cloud_function().is_none());
3829 /// assert!(x.app_engine_version().is_none());
3830 /// assert!(x.cloud_run_revision().is_none());
3831 /// assert!(x.nat().is_none());
3832 /// assert!(x.proxy_connection().is_none());
3833 /// assert!(x.load_balancer_backend_info().is_none());
3834 /// assert!(x.storage_bucket().is_none());
3835 /// assert!(x.serverless_neg().is_none());
3836 /// ```
3837 pub fn set_forwarding_rule<
3838 T: std::convert::Into<std::boxed::Box<crate::model::ForwardingRuleInfo>>,
3839 >(
3840 mut self,
3841 v: T,
3842 ) -> Self {
3843 self.step_info =
3844 std::option::Option::Some(crate::model::step::StepInfo::ForwardingRule(v.into()));
3845 self
3846 }
3847
3848 /// The value of [step_info][crate::model::Step::step_info]
3849 /// if it holds a `HybridSubnet`, `None` if the field is not set or
3850 /// holds a different branch.
3851 pub fn hybrid_subnet(
3852 &self,
3853 ) -> std::option::Option<&std::boxed::Box<crate::model::HybridSubnetInfo>> {
3854 #[allow(unreachable_patterns)]
3855 self.step_info.as_ref().and_then(|v| match v {
3856 crate::model::step::StepInfo::HybridSubnet(v) => std::option::Option::Some(v),
3857 _ => std::option::Option::None,
3858 })
3859 }
3860
3861 /// Sets the value of [step_info][crate::model::Step::step_info]
3862 /// to hold a `HybridSubnet`.
3863 ///
3864 /// Note that all the setters affecting `step_info` are
3865 /// mutually exclusive.
3866 ///
3867 /// # Example
3868 /// ```ignore,no_run
3869 /// # use google_cloud_networkmanagement_v1::model::Step;
3870 /// use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
3871 /// let x = Step::new().set_hybrid_subnet(HybridSubnetInfo::default()/* use setters */);
3872 /// assert!(x.hybrid_subnet().is_some());
3873 /// assert!(x.instance().is_none());
3874 /// assert!(x.firewall().is_none());
3875 /// assert!(x.route().is_none());
3876 /// assert!(x.endpoint().is_none());
3877 /// assert!(x.google_service().is_none());
3878 /// assert!(x.forwarding_rule().is_none());
3879 /// assert!(x.vpn_gateway().is_none());
3880 /// assert!(x.vpn_tunnel().is_none());
3881 /// assert!(x.interconnect_attachment().is_none());
3882 /// assert!(x.vpc_connector().is_none());
3883 /// assert!(x.direct_vpc_egress_connection().is_none());
3884 /// assert!(x.serverless_external_connection().is_none());
3885 /// assert!(x.deliver().is_none());
3886 /// assert!(x.forward().is_none());
3887 /// assert!(x.abort().is_none());
3888 /// assert!(x.drop().is_none());
3889 /// assert!(x.load_balancer().is_none());
3890 /// assert!(x.network().is_none());
3891 /// assert!(x.gke_master().is_none());
3892 /// assert!(x.cloud_sql_instance().is_none());
3893 /// assert!(x.redis_instance().is_none());
3894 /// assert!(x.redis_cluster().is_none());
3895 /// assert!(x.cloud_function().is_none());
3896 /// assert!(x.app_engine_version().is_none());
3897 /// assert!(x.cloud_run_revision().is_none());
3898 /// assert!(x.nat().is_none());
3899 /// assert!(x.proxy_connection().is_none());
3900 /// assert!(x.load_balancer_backend_info().is_none());
3901 /// assert!(x.storage_bucket().is_none());
3902 /// assert!(x.serverless_neg().is_none());
3903 /// ```
3904 pub fn set_hybrid_subnet<
3905 T: std::convert::Into<std::boxed::Box<crate::model::HybridSubnetInfo>>,
3906 >(
3907 mut self,
3908 v: T,
3909 ) -> Self {
3910 self.step_info =
3911 std::option::Option::Some(crate::model::step::StepInfo::HybridSubnet(v.into()));
3912 self
3913 }
3914
3915 /// The value of [step_info][crate::model::Step::step_info]
3916 /// if it holds a `VpnGateway`, `None` if the field is not set or
3917 /// holds a different branch.
3918 pub fn vpn_gateway(
3919 &self,
3920 ) -> std::option::Option<&std::boxed::Box<crate::model::VpnGatewayInfo>> {
3921 #[allow(unreachable_patterns)]
3922 self.step_info.as_ref().and_then(|v| match v {
3923 crate::model::step::StepInfo::VpnGateway(v) => std::option::Option::Some(v),
3924 _ => std::option::Option::None,
3925 })
3926 }
3927
3928 /// Sets the value of [step_info][crate::model::Step::step_info]
3929 /// to hold a `VpnGateway`.
3930 ///
3931 /// Note that all the setters affecting `step_info` are
3932 /// mutually exclusive.
3933 ///
3934 /// # Example
3935 /// ```ignore,no_run
3936 /// # use google_cloud_networkmanagement_v1::model::Step;
3937 /// use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
3938 /// let x = Step::new().set_vpn_gateway(VpnGatewayInfo::default()/* use setters */);
3939 /// assert!(x.vpn_gateway().is_some());
3940 /// assert!(x.instance().is_none());
3941 /// assert!(x.firewall().is_none());
3942 /// assert!(x.route().is_none());
3943 /// assert!(x.endpoint().is_none());
3944 /// assert!(x.google_service().is_none());
3945 /// assert!(x.forwarding_rule().is_none());
3946 /// assert!(x.hybrid_subnet().is_none());
3947 /// assert!(x.vpn_tunnel().is_none());
3948 /// assert!(x.interconnect_attachment().is_none());
3949 /// assert!(x.vpc_connector().is_none());
3950 /// assert!(x.direct_vpc_egress_connection().is_none());
3951 /// assert!(x.serverless_external_connection().is_none());
3952 /// assert!(x.deliver().is_none());
3953 /// assert!(x.forward().is_none());
3954 /// assert!(x.abort().is_none());
3955 /// assert!(x.drop().is_none());
3956 /// assert!(x.load_balancer().is_none());
3957 /// assert!(x.network().is_none());
3958 /// assert!(x.gke_master().is_none());
3959 /// assert!(x.cloud_sql_instance().is_none());
3960 /// assert!(x.redis_instance().is_none());
3961 /// assert!(x.redis_cluster().is_none());
3962 /// assert!(x.cloud_function().is_none());
3963 /// assert!(x.app_engine_version().is_none());
3964 /// assert!(x.cloud_run_revision().is_none());
3965 /// assert!(x.nat().is_none());
3966 /// assert!(x.proxy_connection().is_none());
3967 /// assert!(x.load_balancer_backend_info().is_none());
3968 /// assert!(x.storage_bucket().is_none());
3969 /// assert!(x.serverless_neg().is_none());
3970 /// ```
3971 pub fn set_vpn_gateway<T: std::convert::Into<std::boxed::Box<crate::model::VpnGatewayInfo>>>(
3972 mut self,
3973 v: T,
3974 ) -> Self {
3975 self.step_info =
3976 std::option::Option::Some(crate::model::step::StepInfo::VpnGateway(v.into()));
3977 self
3978 }
3979
3980 /// The value of [step_info][crate::model::Step::step_info]
3981 /// if it holds a `VpnTunnel`, `None` if the field is not set or
3982 /// holds a different branch.
3983 pub fn vpn_tunnel(&self) -> std::option::Option<&std::boxed::Box<crate::model::VpnTunnelInfo>> {
3984 #[allow(unreachable_patterns)]
3985 self.step_info.as_ref().and_then(|v| match v {
3986 crate::model::step::StepInfo::VpnTunnel(v) => std::option::Option::Some(v),
3987 _ => std::option::Option::None,
3988 })
3989 }
3990
3991 /// Sets the value of [step_info][crate::model::Step::step_info]
3992 /// to hold a `VpnTunnel`.
3993 ///
3994 /// Note that all the setters affecting `step_info` are
3995 /// mutually exclusive.
3996 ///
3997 /// # Example
3998 /// ```ignore,no_run
3999 /// # use google_cloud_networkmanagement_v1::model::Step;
4000 /// use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
4001 /// let x = Step::new().set_vpn_tunnel(VpnTunnelInfo::default()/* use setters */);
4002 /// assert!(x.vpn_tunnel().is_some());
4003 /// assert!(x.instance().is_none());
4004 /// assert!(x.firewall().is_none());
4005 /// assert!(x.route().is_none());
4006 /// assert!(x.endpoint().is_none());
4007 /// assert!(x.google_service().is_none());
4008 /// assert!(x.forwarding_rule().is_none());
4009 /// assert!(x.hybrid_subnet().is_none());
4010 /// assert!(x.vpn_gateway().is_none());
4011 /// assert!(x.interconnect_attachment().is_none());
4012 /// assert!(x.vpc_connector().is_none());
4013 /// assert!(x.direct_vpc_egress_connection().is_none());
4014 /// assert!(x.serverless_external_connection().is_none());
4015 /// assert!(x.deliver().is_none());
4016 /// assert!(x.forward().is_none());
4017 /// assert!(x.abort().is_none());
4018 /// assert!(x.drop().is_none());
4019 /// assert!(x.load_balancer().is_none());
4020 /// assert!(x.network().is_none());
4021 /// assert!(x.gke_master().is_none());
4022 /// assert!(x.cloud_sql_instance().is_none());
4023 /// assert!(x.redis_instance().is_none());
4024 /// assert!(x.redis_cluster().is_none());
4025 /// assert!(x.cloud_function().is_none());
4026 /// assert!(x.app_engine_version().is_none());
4027 /// assert!(x.cloud_run_revision().is_none());
4028 /// assert!(x.nat().is_none());
4029 /// assert!(x.proxy_connection().is_none());
4030 /// assert!(x.load_balancer_backend_info().is_none());
4031 /// assert!(x.storage_bucket().is_none());
4032 /// assert!(x.serverless_neg().is_none());
4033 /// ```
4034 pub fn set_vpn_tunnel<T: std::convert::Into<std::boxed::Box<crate::model::VpnTunnelInfo>>>(
4035 mut self,
4036 v: T,
4037 ) -> Self {
4038 self.step_info =
4039 std::option::Option::Some(crate::model::step::StepInfo::VpnTunnel(v.into()));
4040 self
4041 }
4042
4043 /// The value of [step_info][crate::model::Step::step_info]
4044 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
4045 /// holds a different branch.
4046 pub fn interconnect_attachment(
4047 &self,
4048 ) -> std::option::Option<&std::boxed::Box<crate::model::InterconnectAttachmentInfo>> {
4049 #[allow(unreachable_patterns)]
4050 self.step_info.as_ref().and_then(|v| match v {
4051 crate::model::step::StepInfo::InterconnectAttachment(v) => std::option::Option::Some(v),
4052 _ => std::option::Option::None,
4053 })
4054 }
4055
4056 /// Sets the value of [step_info][crate::model::Step::step_info]
4057 /// to hold a `InterconnectAttachment`.
4058 ///
4059 /// Note that all the setters affecting `step_info` are
4060 /// mutually exclusive.
4061 ///
4062 /// # Example
4063 /// ```ignore,no_run
4064 /// # use google_cloud_networkmanagement_v1::model::Step;
4065 /// use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
4066 /// let x = Step::new().set_interconnect_attachment(InterconnectAttachmentInfo::default()/* use setters */);
4067 /// assert!(x.interconnect_attachment().is_some());
4068 /// assert!(x.instance().is_none());
4069 /// assert!(x.firewall().is_none());
4070 /// assert!(x.route().is_none());
4071 /// assert!(x.endpoint().is_none());
4072 /// assert!(x.google_service().is_none());
4073 /// assert!(x.forwarding_rule().is_none());
4074 /// assert!(x.hybrid_subnet().is_none());
4075 /// assert!(x.vpn_gateway().is_none());
4076 /// assert!(x.vpn_tunnel().is_none());
4077 /// assert!(x.vpc_connector().is_none());
4078 /// assert!(x.direct_vpc_egress_connection().is_none());
4079 /// assert!(x.serverless_external_connection().is_none());
4080 /// assert!(x.deliver().is_none());
4081 /// assert!(x.forward().is_none());
4082 /// assert!(x.abort().is_none());
4083 /// assert!(x.drop().is_none());
4084 /// assert!(x.load_balancer().is_none());
4085 /// assert!(x.network().is_none());
4086 /// assert!(x.gke_master().is_none());
4087 /// assert!(x.cloud_sql_instance().is_none());
4088 /// assert!(x.redis_instance().is_none());
4089 /// assert!(x.redis_cluster().is_none());
4090 /// assert!(x.cloud_function().is_none());
4091 /// assert!(x.app_engine_version().is_none());
4092 /// assert!(x.cloud_run_revision().is_none());
4093 /// assert!(x.nat().is_none());
4094 /// assert!(x.proxy_connection().is_none());
4095 /// assert!(x.load_balancer_backend_info().is_none());
4096 /// assert!(x.storage_bucket().is_none());
4097 /// assert!(x.serverless_neg().is_none());
4098 /// ```
4099 pub fn set_interconnect_attachment<
4100 T: std::convert::Into<std::boxed::Box<crate::model::InterconnectAttachmentInfo>>,
4101 >(
4102 mut self,
4103 v: T,
4104 ) -> Self {
4105 self.step_info = std::option::Option::Some(
4106 crate::model::step::StepInfo::InterconnectAttachment(v.into()),
4107 );
4108 self
4109 }
4110
4111 /// The value of [step_info][crate::model::Step::step_info]
4112 /// if it holds a `VpcConnector`, `None` if the field is not set or
4113 /// holds a different branch.
4114 pub fn vpc_connector(
4115 &self,
4116 ) -> std::option::Option<&std::boxed::Box<crate::model::VpcConnectorInfo>> {
4117 #[allow(unreachable_patterns)]
4118 self.step_info.as_ref().and_then(|v| match v {
4119 crate::model::step::StepInfo::VpcConnector(v) => std::option::Option::Some(v),
4120 _ => std::option::Option::None,
4121 })
4122 }
4123
4124 /// Sets the value of [step_info][crate::model::Step::step_info]
4125 /// to hold a `VpcConnector`.
4126 ///
4127 /// Note that all the setters affecting `step_info` are
4128 /// mutually exclusive.
4129 ///
4130 /// # Example
4131 /// ```ignore,no_run
4132 /// # use google_cloud_networkmanagement_v1::model::Step;
4133 /// use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
4134 /// let x = Step::new().set_vpc_connector(VpcConnectorInfo::default()/* use setters */);
4135 /// assert!(x.vpc_connector().is_some());
4136 /// assert!(x.instance().is_none());
4137 /// assert!(x.firewall().is_none());
4138 /// assert!(x.route().is_none());
4139 /// assert!(x.endpoint().is_none());
4140 /// assert!(x.google_service().is_none());
4141 /// assert!(x.forwarding_rule().is_none());
4142 /// assert!(x.hybrid_subnet().is_none());
4143 /// assert!(x.vpn_gateway().is_none());
4144 /// assert!(x.vpn_tunnel().is_none());
4145 /// assert!(x.interconnect_attachment().is_none());
4146 /// assert!(x.direct_vpc_egress_connection().is_none());
4147 /// assert!(x.serverless_external_connection().is_none());
4148 /// assert!(x.deliver().is_none());
4149 /// assert!(x.forward().is_none());
4150 /// assert!(x.abort().is_none());
4151 /// assert!(x.drop().is_none());
4152 /// assert!(x.load_balancer().is_none());
4153 /// assert!(x.network().is_none());
4154 /// assert!(x.gke_master().is_none());
4155 /// assert!(x.cloud_sql_instance().is_none());
4156 /// assert!(x.redis_instance().is_none());
4157 /// assert!(x.redis_cluster().is_none());
4158 /// assert!(x.cloud_function().is_none());
4159 /// assert!(x.app_engine_version().is_none());
4160 /// assert!(x.cloud_run_revision().is_none());
4161 /// assert!(x.nat().is_none());
4162 /// assert!(x.proxy_connection().is_none());
4163 /// assert!(x.load_balancer_backend_info().is_none());
4164 /// assert!(x.storage_bucket().is_none());
4165 /// assert!(x.serverless_neg().is_none());
4166 /// ```
4167 pub fn set_vpc_connector<
4168 T: std::convert::Into<std::boxed::Box<crate::model::VpcConnectorInfo>>,
4169 >(
4170 mut self,
4171 v: T,
4172 ) -> Self {
4173 self.step_info =
4174 std::option::Option::Some(crate::model::step::StepInfo::VpcConnector(v.into()));
4175 self
4176 }
4177
4178 /// The value of [step_info][crate::model::Step::step_info]
4179 /// if it holds a `DirectVpcEgressConnection`, `None` if the field is not set or
4180 /// holds a different branch.
4181 pub fn direct_vpc_egress_connection(
4182 &self,
4183 ) -> std::option::Option<&std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>> {
4184 #[allow(unreachable_patterns)]
4185 self.step_info.as_ref().and_then(|v| match v {
4186 crate::model::step::StepInfo::DirectVpcEgressConnection(v) => {
4187 std::option::Option::Some(v)
4188 }
4189 _ => std::option::Option::None,
4190 })
4191 }
4192
4193 /// Sets the value of [step_info][crate::model::Step::step_info]
4194 /// to hold a `DirectVpcEgressConnection`.
4195 ///
4196 /// Note that all the setters affecting `step_info` are
4197 /// mutually exclusive.
4198 ///
4199 /// # Example
4200 /// ```ignore,no_run
4201 /// # use google_cloud_networkmanagement_v1::model::Step;
4202 /// use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
4203 /// let x = Step::new().set_direct_vpc_egress_connection(DirectVpcEgressConnectionInfo::default()/* use setters */);
4204 /// assert!(x.direct_vpc_egress_connection().is_some());
4205 /// assert!(x.instance().is_none());
4206 /// assert!(x.firewall().is_none());
4207 /// assert!(x.route().is_none());
4208 /// assert!(x.endpoint().is_none());
4209 /// assert!(x.google_service().is_none());
4210 /// assert!(x.forwarding_rule().is_none());
4211 /// assert!(x.hybrid_subnet().is_none());
4212 /// assert!(x.vpn_gateway().is_none());
4213 /// assert!(x.vpn_tunnel().is_none());
4214 /// assert!(x.interconnect_attachment().is_none());
4215 /// assert!(x.vpc_connector().is_none());
4216 /// assert!(x.serverless_external_connection().is_none());
4217 /// assert!(x.deliver().is_none());
4218 /// assert!(x.forward().is_none());
4219 /// assert!(x.abort().is_none());
4220 /// assert!(x.drop().is_none());
4221 /// assert!(x.load_balancer().is_none());
4222 /// assert!(x.network().is_none());
4223 /// assert!(x.gke_master().is_none());
4224 /// assert!(x.cloud_sql_instance().is_none());
4225 /// assert!(x.redis_instance().is_none());
4226 /// assert!(x.redis_cluster().is_none());
4227 /// assert!(x.cloud_function().is_none());
4228 /// assert!(x.app_engine_version().is_none());
4229 /// assert!(x.cloud_run_revision().is_none());
4230 /// assert!(x.nat().is_none());
4231 /// assert!(x.proxy_connection().is_none());
4232 /// assert!(x.load_balancer_backend_info().is_none());
4233 /// assert!(x.storage_bucket().is_none());
4234 /// assert!(x.serverless_neg().is_none());
4235 /// ```
4236 pub fn set_direct_vpc_egress_connection<
4237 T: std::convert::Into<std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>>,
4238 >(
4239 mut self,
4240 v: T,
4241 ) -> Self {
4242 self.step_info = std::option::Option::Some(
4243 crate::model::step::StepInfo::DirectVpcEgressConnection(v.into()),
4244 );
4245 self
4246 }
4247
4248 /// The value of [step_info][crate::model::Step::step_info]
4249 /// if it holds a `ServerlessExternalConnection`, `None` if the field is not set or
4250 /// holds a different branch.
4251 pub fn serverless_external_connection(
4252 &self,
4253 ) -> std::option::Option<&std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>> {
4254 #[allow(unreachable_patterns)]
4255 self.step_info.as_ref().and_then(|v| match v {
4256 crate::model::step::StepInfo::ServerlessExternalConnection(v) => {
4257 std::option::Option::Some(v)
4258 }
4259 _ => std::option::Option::None,
4260 })
4261 }
4262
4263 /// Sets the value of [step_info][crate::model::Step::step_info]
4264 /// to hold a `ServerlessExternalConnection`.
4265 ///
4266 /// Note that all the setters affecting `step_info` are
4267 /// mutually exclusive.
4268 ///
4269 /// # Example
4270 /// ```ignore,no_run
4271 /// # use google_cloud_networkmanagement_v1::model::Step;
4272 /// use google_cloud_networkmanagement_v1::model::ServerlessExternalConnectionInfo;
4273 /// let x = Step::new().set_serverless_external_connection(ServerlessExternalConnectionInfo::default()/* use setters */);
4274 /// assert!(x.serverless_external_connection().is_some());
4275 /// assert!(x.instance().is_none());
4276 /// assert!(x.firewall().is_none());
4277 /// assert!(x.route().is_none());
4278 /// assert!(x.endpoint().is_none());
4279 /// assert!(x.google_service().is_none());
4280 /// assert!(x.forwarding_rule().is_none());
4281 /// assert!(x.hybrid_subnet().is_none());
4282 /// assert!(x.vpn_gateway().is_none());
4283 /// assert!(x.vpn_tunnel().is_none());
4284 /// assert!(x.interconnect_attachment().is_none());
4285 /// assert!(x.vpc_connector().is_none());
4286 /// assert!(x.direct_vpc_egress_connection().is_none());
4287 /// assert!(x.deliver().is_none());
4288 /// assert!(x.forward().is_none());
4289 /// assert!(x.abort().is_none());
4290 /// assert!(x.drop().is_none());
4291 /// assert!(x.load_balancer().is_none());
4292 /// assert!(x.network().is_none());
4293 /// assert!(x.gke_master().is_none());
4294 /// assert!(x.cloud_sql_instance().is_none());
4295 /// assert!(x.redis_instance().is_none());
4296 /// assert!(x.redis_cluster().is_none());
4297 /// assert!(x.cloud_function().is_none());
4298 /// assert!(x.app_engine_version().is_none());
4299 /// assert!(x.cloud_run_revision().is_none());
4300 /// assert!(x.nat().is_none());
4301 /// assert!(x.proxy_connection().is_none());
4302 /// assert!(x.load_balancer_backend_info().is_none());
4303 /// assert!(x.storage_bucket().is_none());
4304 /// assert!(x.serverless_neg().is_none());
4305 /// ```
4306 pub fn set_serverless_external_connection<
4307 T: std::convert::Into<std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>>,
4308 >(
4309 mut self,
4310 v: T,
4311 ) -> Self {
4312 self.step_info = std::option::Option::Some(
4313 crate::model::step::StepInfo::ServerlessExternalConnection(v.into()),
4314 );
4315 self
4316 }
4317
4318 /// The value of [step_info][crate::model::Step::step_info]
4319 /// if it holds a `Deliver`, `None` if the field is not set or
4320 /// holds a different branch.
4321 pub fn deliver(&self) -> std::option::Option<&std::boxed::Box<crate::model::DeliverInfo>> {
4322 #[allow(unreachable_patterns)]
4323 self.step_info.as_ref().and_then(|v| match v {
4324 crate::model::step::StepInfo::Deliver(v) => std::option::Option::Some(v),
4325 _ => std::option::Option::None,
4326 })
4327 }
4328
4329 /// Sets the value of [step_info][crate::model::Step::step_info]
4330 /// to hold a `Deliver`.
4331 ///
4332 /// Note that all the setters affecting `step_info` are
4333 /// mutually exclusive.
4334 ///
4335 /// # Example
4336 /// ```ignore,no_run
4337 /// # use google_cloud_networkmanagement_v1::model::Step;
4338 /// use google_cloud_networkmanagement_v1::model::DeliverInfo;
4339 /// let x = Step::new().set_deliver(DeliverInfo::default()/* use setters */);
4340 /// assert!(x.deliver().is_some());
4341 /// assert!(x.instance().is_none());
4342 /// assert!(x.firewall().is_none());
4343 /// assert!(x.route().is_none());
4344 /// assert!(x.endpoint().is_none());
4345 /// assert!(x.google_service().is_none());
4346 /// assert!(x.forwarding_rule().is_none());
4347 /// assert!(x.hybrid_subnet().is_none());
4348 /// assert!(x.vpn_gateway().is_none());
4349 /// assert!(x.vpn_tunnel().is_none());
4350 /// assert!(x.interconnect_attachment().is_none());
4351 /// assert!(x.vpc_connector().is_none());
4352 /// assert!(x.direct_vpc_egress_connection().is_none());
4353 /// assert!(x.serverless_external_connection().is_none());
4354 /// assert!(x.forward().is_none());
4355 /// assert!(x.abort().is_none());
4356 /// assert!(x.drop().is_none());
4357 /// assert!(x.load_balancer().is_none());
4358 /// assert!(x.network().is_none());
4359 /// assert!(x.gke_master().is_none());
4360 /// assert!(x.cloud_sql_instance().is_none());
4361 /// assert!(x.redis_instance().is_none());
4362 /// assert!(x.redis_cluster().is_none());
4363 /// assert!(x.cloud_function().is_none());
4364 /// assert!(x.app_engine_version().is_none());
4365 /// assert!(x.cloud_run_revision().is_none());
4366 /// assert!(x.nat().is_none());
4367 /// assert!(x.proxy_connection().is_none());
4368 /// assert!(x.load_balancer_backend_info().is_none());
4369 /// assert!(x.storage_bucket().is_none());
4370 /// assert!(x.serverless_neg().is_none());
4371 /// ```
4372 pub fn set_deliver<T: std::convert::Into<std::boxed::Box<crate::model::DeliverInfo>>>(
4373 mut self,
4374 v: T,
4375 ) -> Self {
4376 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Deliver(v.into()));
4377 self
4378 }
4379
4380 /// The value of [step_info][crate::model::Step::step_info]
4381 /// if it holds a `Forward`, `None` if the field is not set or
4382 /// holds a different branch.
4383 pub fn forward(&self) -> std::option::Option<&std::boxed::Box<crate::model::ForwardInfo>> {
4384 #[allow(unreachable_patterns)]
4385 self.step_info.as_ref().and_then(|v| match v {
4386 crate::model::step::StepInfo::Forward(v) => std::option::Option::Some(v),
4387 _ => std::option::Option::None,
4388 })
4389 }
4390
4391 /// Sets the value of [step_info][crate::model::Step::step_info]
4392 /// to hold a `Forward`.
4393 ///
4394 /// Note that all the setters affecting `step_info` are
4395 /// mutually exclusive.
4396 ///
4397 /// # Example
4398 /// ```ignore,no_run
4399 /// # use google_cloud_networkmanagement_v1::model::Step;
4400 /// use google_cloud_networkmanagement_v1::model::ForwardInfo;
4401 /// let x = Step::new().set_forward(ForwardInfo::default()/* use setters */);
4402 /// assert!(x.forward().is_some());
4403 /// assert!(x.instance().is_none());
4404 /// assert!(x.firewall().is_none());
4405 /// assert!(x.route().is_none());
4406 /// assert!(x.endpoint().is_none());
4407 /// assert!(x.google_service().is_none());
4408 /// assert!(x.forwarding_rule().is_none());
4409 /// assert!(x.hybrid_subnet().is_none());
4410 /// assert!(x.vpn_gateway().is_none());
4411 /// assert!(x.vpn_tunnel().is_none());
4412 /// assert!(x.interconnect_attachment().is_none());
4413 /// assert!(x.vpc_connector().is_none());
4414 /// assert!(x.direct_vpc_egress_connection().is_none());
4415 /// assert!(x.serverless_external_connection().is_none());
4416 /// assert!(x.deliver().is_none());
4417 /// assert!(x.abort().is_none());
4418 /// assert!(x.drop().is_none());
4419 /// assert!(x.load_balancer().is_none());
4420 /// assert!(x.network().is_none());
4421 /// assert!(x.gke_master().is_none());
4422 /// assert!(x.cloud_sql_instance().is_none());
4423 /// assert!(x.redis_instance().is_none());
4424 /// assert!(x.redis_cluster().is_none());
4425 /// assert!(x.cloud_function().is_none());
4426 /// assert!(x.app_engine_version().is_none());
4427 /// assert!(x.cloud_run_revision().is_none());
4428 /// assert!(x.nat().is_none());
4429 /// assert!(x.proxy_connection().is_none());
4430 /// assert!(x.load_balancer_backend_info().is_none());
4431 /// assert!(x.storage_bucket().is_none());
4432 /// assert!(x.serverless_neg().is_none());
4433 /// ```
4434 pub fn set_forward<T: std::convert::Into<std::boxed::Box<crate::model::ForwardInfo>>>(
4435 mut self,
4436 v: T,
4437 ) -> Self {
4438 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Forward(v.into()));
4439 self
4440 }
4441
4442 /// The value of [step_info][crate::model::Step::step_info]
4443 /// if it holds a `Abort`, `None` if the field is not set or
4444 /// holds a different branch.
4445 pub fn abort(&self) -> std::option::Option<&std::boxed::Box<crate::model::AbortInfo>> {
4446 #[allow(unreachable_patterns)]
4447 self.step_info.as_ref().and_then(|v| match v {
4448 crate::model::step::StepInfo::Abort(v) => std::option::Option::Some(v),
4449 _ => std::option::Option::None,
4450 })
4451 }
4452
4453 /// Sets the value of [step_info][crate::model::Step::step_info]
4454 /// to hold a `Abort`.
4455 ///
4456 /// Note that all the setters affecting `step_info` are
4457 /// mutually exclusive.
4458 ///
4459 /// # Example
4460 /// ```ignore,no_run
4461 /// # use google_cloud_networkmanagement_v1::model::Step;
4462 /// use google_cloud_networkmanagement_v1::model::AbortInfo;
4463 /// let x = Step::new().set_abort(AbortInfo::default()/* use setters */);
4464 /// assert!(x.abort().is_some());
4465 /// assert!(x.instance().is_none());
4466 /// assert!(x.firewall().is_none());
4467 /// assert!(x.route().is_none());
4468 /// assert!(x.endpoint().is_none());
4469 /// assert!(x.google_service().is_none());
4470 /// assert!(x.forwarding_rule().is_none());
4471 /// assert!(x.hybrid_subnet().is_none());
4472 /// assert!(x.vpn_gateway().is_none());
4473 /// assert!(x.vpn_tunnel().is_none());
4474 /// assert!(x.interconnect_attachment().is_none());
4475 /// assert!(x.vpc_connector().is_none());
4476 /// assert!(x.direct_vpc_egress_connection().is_none());
4477 /// assert!(x.serverless_external_connection().is_none());
4478 /// assert!(x.deliver().is_none());
4479 /// assert!(x.forward().is_none());
4480 /// assert!(x.drop().is_none());
4481 /// assert!(x.load_balancer().is_none());
4482 /// assert!(x.network().is_none());
4483 /// assert!(x.gke_master().is_none());
4484 /// assert!(x.cloud_sql_instance().is_none());
4485 /// assert!(x.redis_instance().is_none());
4486 /// assert!(x.redis_cluster().is_none());
4487 /// assert!(x.cloud_function().is_none());
4488 /// assert!(x.app_engine_version().is_none());
4489 /// assert!(x.cloud_run_revision().is_none());
4490 /// assert!(x.nat().is_none());
4491 /// assert!(x.proxy_connection().is_none());
4492 /// assert!(x.load_balancer_backend_info().is_none());
4493 /// assert!(x.storage_bucket().is_none());
4494 /// assert!(x.serverless_neg().is_none());
4495 /// ```
4496 pub fn set_abort<T: std::convert::Into<std::boxed::Box<crate::model::AbortInfo>>>(
4497 mut self,
4498 v: T,
4499 ) -> Self {
4500 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Abort(v.into()));
4501 self
4502 }
4503
4504 /// The value of [step_info][crate::model::Step::step_info]
4505 /// if it holds a `Drop`, `None` if the field is not set or
4506 /// holds a different branch.
4507 pub fn drop(&self) -> std::option::Option<&std::boxed::Box<crate::model::DropInfo>> {
4508 #[allow(unreachable_patterns)]
4509 self.step_info.as_ref().and_then(|v| match v {
4510 crate::model::step::StepInfo::Drop(v) => std::option::Option::Some(v),
4511 _ => std::option::Option::None,
4512 })
4513 }
4514
4515 /// Sets the value of [step_info][crate::model::Step::step_info]
4516 /// to hold a `Drop`.
4517 ///
4518 /// Note that all the setters affecting `step_info` are
4519 /// mutually exclusive.
4520 ///
4521 /// # Example
4522 /// ```ignore,no_run
4523 /// # use google_cloud_networkmanagement_v1::model::Step;
4524 /// use google_cloud_networkmanagement_v1::model::DropInfo;
4525 /// let x = Step::new().set_drop(DropInfo::default()/* use setters */);
4526 /// assert!(x.drop().is_some());
4527 /// assert!(x.instance().is_none());
4528 /// assert!(x.firewall().is_none());
4529 /// assert!(x.route().is_none());
4530 /// assert!(x.endpoint().is_none());
4531 /// assert!(x.google_service().is_none());
4532 /// assert!(x.forwarding_rule().is_none());
4533 /// assert!(x.hybrid_subnet().is_none());
4534 /// assert!(x.vpn_gateway().is_none());
4535 /// assert!(x.vpn_tunnel().is_none());
4536 /// assert!(x.interconnect_attachment().is_none());
4537 /// assert!(x.vpc_connector().is_none());
4538 /// assert!(x.direct_vpc_egress_connection().is_none());
4539 /// assert!(x.serverless_external_connection().is_none());
4540 /// assert!(x.deliver().is_none());
4541 /// assert!(x.forward().is_none());
4542 /// assert!(x.abort().is_none());
4543 /// assert!(x.load_balancer().is_none());
4544 /// assert!(x.network().is_none());
4545 /// assert!(x.gke_master().is_none());
4546 /// assert!(x.cloud_sql_instance().is_none());
4547 /// assert!(x.redis_instance().is_none());
4548 /// assert!(x.redis_cluster().is_none());
4549 /// assert!(x.cloud_function().is_none());
4550 /// assert!(x.app_engine_version().is_none());
4551 /// assert!(x.cloud_run_revision().is_none());
4552 /// assert!(x.nat().is_none());
4553 /// assert!(x.proxy_connection().is_none());
4554 /// assert!(x.load_balancer_backend_info().is_none());
4555 /// assert!(x.storage_bucket().is_none());
4556 /// assert!(x.serverless_neg().is_none());
4557 /// ```
4558 pub fn set_drop<T: std::convert::Into<std::boxed::Box<crate::model::DropInfo>>>(
4559 mut self,
4560 v: T,
4561 ) -> Self {
4562 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Drop(v.into()));
4563 self
4564 }
4565
4566 /// The value of [step_info][crate::model::Step::step_info]
4567 /// if it holds a `LoadBalancer`, `None` if the field is not set or
4568 /// holds a different branch.
4569 #[deprecated]
4570 pub fn load_balancer(
4571 &self,
4572 ) -> std::option::Option<&std::boxed::Box<crate::model::LoadBalancerInfo>> {
4573 #[allow(unreachable_patterns)]
4574 self.step_info.as_ref().and_then(|v| match v {
4575 crate::model::step::StepInfo::LoadBalancer(v) => std::option::Option::Some(v),
4576 _ => std::option::Option::None,
4577 })
4578 }
4579
4580 /// Sets the value of [step_info][crate::model::Step::step_info]
4581 /// to hold a `LoadBalancer`.
4582 ///
4583 /// Note that all the setters affecting `step_info` are
4584 /// mutually exclusive.
4585 ///
4586 /// # Example
4587 /// ```ignore,no_run
4588 /// # use google_cloud_networkmanagement_v1::model::Step;
4589 /// use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
4590 /// let x = Step::new().set_load_balancer(LoadBalancerInfo::default()/* use setters */);
4591 /// assert!(x.load_balancer().is_some());
4592 /// assert!(x.instance().is_none());
4593 /// assert!(x.firewall().is_none());
4594 /// assert!(x.route().is_none());
4595 /// assert!(x.endpoint().is_none());
4596 /// assert!(x.google_service().is_none());
4597 /// assert!(x.forwarding_rule().is_none());
4598 /// assert!(x.hybrid_subnet().is_none());
4599 /// assert!(x.vpn_gateway().is_none());
4600 /// assert!(x.vpn_tunnel().is_none());
4601 /// assert!(x.interconnect_attachment().is_none());
4602 /// assert!(x.vpc_connector().is_none());
4603 /// assert!(x.direct_vpc_egress_connection().is_none());
4604 /// assert!(x.serverless_external_connection().is_none());
4605 /// assert!(x.deliver().is_none());
4606 /// assert!(x.forward().is_none());
4607 /// assert!(x.abort().is_none());
4608 /// assert!(x.drop().is_none());
4609 /// assert!(x.network().is_none());
4610 /// assert!(x.gke_master().is_none());
4611 /// assert!(x.cloud_sql_instance().is_none());
4612 /// assert!(x.redis_instance().is_none());
4613 /// assert!(x.redis_cluster().is_none());
4614 /// assert!(x.cloud_function().is_none());
4615 /// assert!(x.app_engine_version().is_none());
4616 /// assert!(x.cloud_run_revision().is_none());
4617 /// assert!(x.nat().is_none());
4618 /// assert!(x.proxy_connection().is_none());
4619 /// assert!(x.load_balancer_backend_info().is_none());
4620 /// assert!(x.storage_bucket().is_none());
4621 /// assert!(x.serverless_neg().is_none());
4622 /// ```
4623 #[deprecated]
4624 pub fn set_load_balancer<
4625 T: std::convert::Into<std::boxed::Box<crate::model::LoadBalancerInfo>>,
4626 >(
4627 mut self,
4628 v: T,
4629 ) -> Self {
4630 self.step_info =
4631 std::option::Option::Some(crate::model::step::StepInfo::LoadBalancer(v.into()));
4632 self
4633 }
4634
4635 /// The value of [step_info][crate::model::Step::step_info]
4636 /// if it holds a `Network`, `None` if the field is not set or
4637 /// holds a different branch.
4638 pub fn network(&self) -> std::option::Option<&std::boxed::Box<crate::model::NetworkInfo>> {
4639 #[allow(unreachable_patterns)]
4640 self.step_info.as_ref().and_then(|v| match v {
4641 crate::model::step::StepInfo::Network(v) => std::option::Option::Some(v),
4642 _ => std::option::Option::None,
4643 })
4644 }
4645
4646 /// Sets the value of [step_info][crate::model::Step::step_info]
4647 /// to hold a `Network`.
4648 ///
4649 /// Note that all the setters affecting `step_info` are
4650 /// mutually exclusive.
4651 ///
4652 /// # Example
4653 /// ```ignore,no_run
4654 /// # use google_cloud_networkmanagement_v1::model::Step;
4655 /// use google_cloud_networkmanagement_v1::model::NetworkInfo;
4656 /// let x = Step::new().set_network(NetworkInfo::default()/* use setters */);
4657 /// assert!(x.network().is_some());
4658 /// assert!(x.instance().is_none());
4659 /// assert!(x.firewall().is_none());
4660 /// assert!(x.route().is_none());
4661 /// assert!(x.endpoint().is_none());
4662 /// assert!(x.google_service().is_none());
4663 /// assert!(x.forwarding_rule().is_none());
4664 /// assert!(x.hybrid_subnet().is_none());
4665 /// assert!(x.vpn_gateway().is_none());
4666 /// assert!(x.vpn_tunnel().is_none());
4667 /// assert!(x.interconnect_attachment().is_none());
4668 /// assert!(x.vpc_connector().is_none());
4669 /// assert!(x.direct_vpc_egress_connection().is_none());
4670 /// assert!(x.serverless_external_connection().is_none());
4671 /// assert!(x.deliver().is_none());
4672 /// assert!(x.forward().is_none());
4673 /// assert!(x.abort().is_none());
4674 /// assert!(x.drop().is_none());
4675 /// assert!(x.load_balancer().is_none());
4676 /// assert!(x.gke_master().is_none());
4677 /// assert!(x.cloud_sql_instance().is_none());
4678 /// assert!(x.redis_instance().is_none());
4679 /// assert!(x.redis_cluster().is_none());
4680 /// assert!(x.cloud_function().is_none());
4681 /// assert!(x.app_engine_version().is_none());
4682 /// assert!(x.cloud_run_revision().is_none());
4683 /// assert!(x.nat().is_none());
4684 /// assert!(x.proxy_connection().is_none());
4685 /// assert!(x.load_balancer_backend_info().is_none());
4686 /// assert!(x.storage_bucket().is_none());
4687 /// assert!(x.serverless_neg().is_none());
4688 /// ```
4689 pub fn set_network<T: std::convert::Into<std::boxed::Box<crate::model::NetworkInfo>>>(
4690 mut self,
4691 v: T,
4692 ) -> Self {
4693 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Network(v.into()));
4694 self
4695 }
4696
4697 /// The value of [step_info][crate::model::Step::step_info]
4698 /// if it holds a `GkeMaster`, `None` if the field is not set or
4699 /// holds a different branch.
4700 pub fn gke_master(&self) -> std::option::Option<&std::boxed::Box<crate::model::GKEMasterInfo>> {
4701 #[allow(unreachable_patterns)]
4702 self.step_info.as_ref().and_then(|v| match v {
4703 crate::model::step::StepInfo::GkeMaster(v) => std::option::Option::Some(v),
4704 _ => std::option::Option::None,
4705 })
4706 }
4707
4708 /// Sets the value of [step_info][crate::model::Step::step_info]
4709 /// to hold a `GkeMaster`.
4710 ///
4711 /// Note that all the setters affecting `step_info` are
4712 /// mutually exclusive.
4713 ///
4714 /// # Example
4715 /// ```ignore,no_run
4716 /// # use google_cloud_networkmanagement_v1::model::Step;
4717 /// use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
4718 /// let x = Step::new().set_gke_master(GKEMasterInfo::default()/* use setters */);
4719 /// assert!(x.gke_master().is_some());
4720 /// assert!(x.instance().is_none());
4721 /// assert!(x.firewall().is_none());
4722 /// assert!(x.route().is_none());
4723 /// assert!(x.endpoint().is_none());
4724 /// assert!(x.google_service().is_none());
4725 /// assert!(x.forwarding_rule().is_none());
4726 /// assert!(x.hybrid_subnet().is_none());
4727 /// assert!(x.vpn_gateway().is_none());
4728 /// assert!(x.vpn_tunnel().is_none());
4729 /// assert!(x.interconnect_attachment().is_none());
4730 /// assert!(x.vpc_connector().is_none());
4731 /// assert!(x.direct_vpc_egress_connection().is_none());
4732 /// assert!(x.serverless_external_connection().is_none());
4733 /// assert!(x.deliver().is_none());
4734 /// assert!(x.forward().is_none());
4735 /// assert!(x.abort().is_none());
4736 /// assert!(x.drop().is_none());
4737 /// assert!(x.load_balancer().is_none());
4738 /// assert!(x.network().is_none());
4739 /// assert!(x.cloud_sql_instance().is_none());
4740 /// assert!(x.redis_instance().is_none());
4741 /// assert!(x.redis_cluster().is_none());
4742 /// assert!(x.cloud_function().is_none());
4743 /// assert!(x.app_engine_version().is_none());
4744 /// assert!(x.cloud_run_revision().is_none());
4745 /// assert!(x.nat().is_none());
4746 /// assert!(x.proxy_connection().is_none());
4747 /// assert!(x.load_balancer_backend_info().is_none());
4748 /// assert!(x.storage_bucket().is_none());
4749 /// assert!(x.serverless_neg().is_none());
4750 /// ```
4751 pub fn set_gke_master<T: std::convert::Into<std::boxed::Box<crate::model::GKEMasterInfo>>>(
4752 mut self,
4753 v: T,
4754 ) -> Self {
4755 self.step_info =
4756 std::option::Option::Some(crate::model::step::StepInfo::GkeMaster(v.into()));
4757 self
4758 }
4759
4760 /// The value of [step_info][crate::model::Step::step_info]
4761 /// if it holds a `CloudSqlInstance`, `None` if the field is not set or
4762 /// holds a different branch.
4763 pub fn cloud_sql_instance(
4764 &self,
4765 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudSQLInstanceInfo>> {
4766 #[allow(unreachable_patterns)]
4767 self.step_info.as_ref().and_then(|v| match v {
4768 crate::model::step::StepInfo::CloudSqlInstance(v) => std::option::Option::Some(v),
4769 _ => std::option::Option::None,
4770 })
4771 }
4772
4773 /// Sets the value of [step_info][crate::model::Step::step_info]
4774 /// to hold a `CloudSqlInstance`.
4775 ///
4776 /// Note that all the setters affecting `step_info` are
4777 /// mutually exclusive.
4778 ///
4779 /// # Example
4780 /// ```ignore,no_run
4781 /// # use google_cloud_networkmanagement_v1::model::Step;
4782 /// use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
4783 /// let x = Step::new().set_cloud_sql_instance(CloudSQLInstanceInfo::default()/* use setters */);
4784 /// assert!(x.cloud_sql_instance().is_some());
4785 /// assert!(x.instance().is_none());
4786 /// assert!(x.firewall().is_none());
4787 /// assert!(x.route().is_none());
4788 /// assert!(x.endpoint().is_none());
4789 /// assert!(x.google_service().is_none());
4790 /// assert!(x.forwarding_rule().is_none());
4791 /// assert!(x.hybrid_subnet().is_none());
4792 /// assert!(x.vpn_gateway().is_none());
4793 /// assert!(x.vpn_tunnel().is_none());
4794 /// assert!(x.interconnect_attachment().is_none());
4795 /// assert!(x.vpc_connector().is_none());
4796 /// assert!(x.direct_vpc_egress_connection().is_none());
4797 /// assert!(x.serverless_external_connection().is_none());
4798 /// assert!(x.deliver().is_none());
4799 /// assert!(x.forward().is_none());
4800 /// assert!(x.abort().is_none());
4801 /// assert!(x.drop().is_none());
4802 /// assert!(x.load_balancer().is_none());
4803 /// assert!(x.network().is_none());
4804 /// assert!(x.gke_master().is_none());
4805 /// assert!(x.redis_instance().is_none());
4806 /// assert!(x.redis_cluster().is_none());
4807 /// assert!(x.cloud_function().is_none());
4808 /// assert!(x.app_engine_version().is_none());
4809 /// assert!(x.cloud_run_revision().is_none());
4810 /// assert!(x.nat().is_none());
4811 /// assert!(x.proxy_connection().is_none());
4812 /// assert!(x.load_balancer_backend_info().is_none());
4813 /// assert!(x.storage_bucket().is_none());
4814 /// assert!(x.serverless_neg().is_none());
4815 /// ```
4816 pub fn set_cloud_sql_instance<
4817 T: std::convert::Into<std::boxed::Box<crate::model::CloudSQLInstanceInfo>>,
4818 >(
4819 mut self,
4820 v: T,
4821 ) -> Self {
4822 self.step_info =
4823 std::option::Option::Some(crate::model::step::StepInfo::CloudSqlInstance(v.into()));
4824 self
4825 }
4826
4827 /// The value of [step_info][crate::model::Step::step_info]
4828 /// if it holds a `RedisInstance`, `None` if the field is not set or
4829 /// holds a different branch.
4830 pub fn redis_instance(
4831 &self,
4832 ) -> std::option::Option<&std::boxed::Box<crate::model::RedisInstanceInfo>> {
4833 #[allow(unreachable_patterns)]
4834 self.step_info.as_ref().and_then(|v| match v {
4835 crate::model::step::StepInfo::RedisInstance(v) => std::option::Option::Some(v),
4836 _ => std::option::Option::None,
4837 })
4838 }
4839
4840 /// Sets the value of [step_info][crate::model::Step::step_info]
4841 /// to hold a `RedisInstance`.
4842 ///
4843 /// Note that all the setters affecting `step_info` are
4844 /// mutually exclusive.
4845 ///
4846 /// # Example
4847 /// ```ignore,no_run
4848 /// # use google_cloud_networkmanagement_v1::model::Step;
4849 /// use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
4850 /// let x = Step::new().set_redis_instance(RedisInstanceInfo::default()/* use setters */);
4851 /// assert!(x.redis_instance().is_some());
4852 /// assert!(x.instance().is_none());
4853 /// assert!(x.firewall().is_none());
4854 /// assert!(x.route().is_none());
4855 /// assert!(x.endpoint().is_none());
4856 /// assert!(x.google_service().is_none());
4857 /// assert!(x.forwarding_rule().is_none());
4858 /// assert!(x.hybrid_subnet().is_none());
4859 /// assert!(x.vpn_gateway().is_none());
4860 /// assert!(x.vpn_tunnel().is_none());
4861 /// assert!(x.interconnect_attachment().is_none());
4862 /// assert!(x.vpc_connector().is_none());
4863 /// assert!(x.direct_vpc_egress_connection().is_none());
4864 /// assert!(x.serverless_external_connection().is_none());
4865 /// assert!(x.deliver().is_none());
4866 /// assert!(x.forward().is_none());
4867 /// assert!(x.abort().is_none());
4868 /// assert!(x.drop().is_none());
4869 /// assert!(x.load_balancer().is_none());
4870 /// assert!(x.network().is_none());
4871 /// assert!(x.gke_master().is_none());
4872 /// assert!(x.cloud_sql_instance().is_none());
4873 /// assert!(x.redis_cluster().is_none());
4874 /// assert!(x.cloud_function().is_none());
4875 /// assert!(x.app_engine_version().is_none());
4876 /// assert!(x.cloud_run_revision().is_none());
4877 /// assert!(x.nat().is_none());
4878 /// assert!(x.proxy_connection().is_none());
4879 /// assert!(x.load_balancer_backend_info().is_none());
4880 /// assert!(x.storage_bucket().is_none());
4881 /// assert!(x.serverless_neg().is_none());
4882 /// ```
4883 pub fn set_redis_instance<
4884 T: std::convert::Into<std::boxed::Box<crate::model::RedisInstanceInfo>>,
4885 >(
4886 mut self,
4887 v: T,
4888 ) -> Self {
4889 self.step_info =
4890 std::option::Option::Some(crate::model::step::StepInfo::RedisInstance(v.into()));
4891 self
4892 }
4893
4894 /// The value of [step_info][crate::model::Step::step_info]
4895 /// if it holds a `RedisCluster`, `None` if the field is not set or
4896 /// holds a different branch.
4897 pub fn redis_cluster(
4898 &self,
4899 ) -> std::option::Option<&std::boxed::Box<crate::model::RedisClusterInfo>> {
4900 #[allow(unreachable_patterns)]
4901 self.step_info.as_ref().and_then(|v| match v {
4902 crate::model::step::StepInfo::RedisCluster(v) => std::option::Option::Some(v),
4903 _ => std::option::Option::None,
4904 })
4905 }
4906
4907 /// Sets the value of [step_info][crate::model::Step::step_info]
4908 /// to hold a `RedisCluster`.
4909 ///
4910 /// Note that all the setters affecting `step_info` are
4911 /// mutually exclusive.
4912 ///
4913 /// # Example
4914 /// ```ignore,no_run
4915 /// # use google_cloud_networkmanagement_v1::model::Step;
4916 /// use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
4917 /// let x = Step::new().set_redis_cluster(RedisClusterInfo::default()/* use setters */);
4918 /// assert!(x.redis_cluster().is_some());
4919 /// assert!(x.instance().is_none());
4920 /// assert!(x.firewall().is_none());
4921 /// assert!(x.route().is_none());
4922 /// assert!(x.endpoint().is_none());
4923 /// assert!(x.google_service().is_none());
4924 /// assert!(x.forwarding_rule().is_none());
4925 /// assert!(x.hybrid_subnet().is_none());
4926 /// assert!(x.vpn_gateway().is_none());
4927 /// assert!(x.vpn_tunnel().is_none());
4928 /// assert!(x.interconnect_attachment().is_none());
4929 /// assert!(x.vpc_connector().is_none());
4930 /// assert!(x.direct_vpc_egress_connection().is_none());
4931 /// assert!(x.serverless_external_connection().is_none());
4932 /// assert!(x.deliver().is_none());
4933 /// assert!(x.forward().is_none());
4934 /// assert!(x.abort().is_none());
4935 /// assert!(x.drop().is_none());
4936 /// assert!(x.load_balancer().is_none());
4937 /// assert!(x.network().is_none());
4938 /// assert!(x.gke_master().is_none());
4939 /// assert!(x.cloud_sql_instance().is_none());
4940 /// assert!(x.redis_instance().is_none());
4941 /// assert!(x.cloud_function().is_none());
4942 /// assert!(x.app_engine_version().is_none());
4943 /// assert!(x.cloud_run_revision().is_none());
4944 /// assert!(x.nat().is_none());
4945 /// assert!(x.proxy_connection().is_none());
4946 /// assert!(x.load_balancer_backend_info().is_none());
4947 /// assert!(x.storage_bucket().is_none());
4948 /// assert!(x.serverless_neg().is_none());
4949 /// ```
4950 pub fn set_redis_cluster<
4951 T: std::convert::Into<std::boxed::Box<crate::model::RedisClusterInfo>>,
4952 >(
4953 mut self,
4954 v: T,
4955 ) -> Self {
4956 self.step_info =
4957 std::option::Option::Some(crate::model::step::StepInfo::RedisCluster(v.into()));
4958 self
4959 }
4960
4961 /// The value of [step_info][crate::model::Step::step_info]
4962 /// if it holds a `CloudFunction`, `None` if the field is not set or
4963 /// holds a different branch.
4964 pub fn cloud_function(
4965 &self,
4966 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudFunctionInfo>> {
4967 #[allow(unreachable_patterns)]
4968 self.step_info.as_ref().and_then(|v| match v {
4969 crate::model::step::StepInfo::CloudFunction(v) => std::option::Option::Some(v),
4970 _ => std::option::Option::None,
4971 })
4972 }
4973
4974 /// Sets the value of [step_info][crate::model::Step::step_info]
4975 /// to hold a `CloudFunction`.
4976 ///
4977 /// Note that all the setters affecting `step_info` are
4978 /// mutually exclusive.
4979 ///
4980 /// # Example
4981 /// ```ignore,no_run
4982 /// # use google_cloud_networkmanagement_v1::model::Step;
4983 /// use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
4984 /// let x = Step::new().set_cloud_function(CloudFunctionInfo::default()/* use setters */);
4985 /// assert!(x.cloud_function().is_some());
4986 /// assert!(x.instance().is_none());
4987 /// assert!(x.firewall().is_none());
4988 /// assert!(x.route().is_none());
4989 /// assert!(x.endpoint().is_none());
4990 /// assert!(x.google_service().is_none());
4991 /// assert!(x.forwarding_rule().is_none());
4992 /// assert!(x.hybrid_subnet().is_none());
4993 /// assert!(x.vpn_gateway().is_none());
4994 /// assert!(x.vpn_tunnel().is_none());
4995 /// assert!(x.interconnect_attachment().is_none());
4996 /// assert!(x.vpc_connector().is_none());
4997 /// assert!(x.direct_vpc_egress_connection().is_none());
4998 /// assert!(x.serverless_external_connection().is_none());
4999 /// assert!(x.deliver().is_none());
5000 /// assert!(x.forward().is_none());
5001 /// assert!(x.abort().is_none());
5002 /// assert!(x.drop().is_none());
5003 /// assert!(x.load_balancer().is_none());
5004 /// assert!(x.network().is_none());
5005 /// assert!(x.gke_master().is_none());
5006 /// assert!(x.cloud_sql_instance().is_none());
5007 /// assert!(x.redis_instance().is_none());
5008 /// assert!(x.redis_cluster().is_none());
5009 /// assert!(x.app_engine_version().is_none());
5010 /// assert!(x.cloud_run_revision().is_none());
5011 /// assert!(x.nat().is_none());
5012 /// assert!(x.proxy_connection().is_none());
5013 /// assert!(x.load_balancer_backend_info().is_none());
5014 /// assert!(x.storage_bucket().is_none());
5015 /// assert!(x.serverless_neg().is_none());
5016 /// ```
5017 pub fn set_cloud_function<
5018 T: std::convert::Into<std::boxed::Box<crate::model::CloudFunctionInfo>>,
5019 >(
5020 mut self,
5021 v: T,
5022 ) -> Self {
5023 self.step_info =
5024 std::option::Option::Some(crate::model::step::StepInfo::CloudFunction(v.into()));
5025 self
5026 }
5027
5028 /// The value of [step_info][crate::model::Step::step_info]
5029 /// if it holds a `AppEngineVersion`, `None` if the field is not set or
5030 /// holds a different branch.
5031 pub fn app_engine_version(
5032 &self,
5033 ) -> std::option::Option<&std::boxed::Box<crate::model::AppEngineVersionInfo>> {
5034 #[allow(unreachable_patterns)]
5035 self.step_info.as_ref().and_then(|v| match v {
5036 crate::model::step::StepInfo::AppEngineVersion(v) => std::option::Option::Some(v),
5037 _ => std::option::Option::None,
5038 })
5039 }
5040
5041 /// Sets the value of [step_info][crate::model::Step::step_info]
5042 /// to hold a `AppEngineVersion`.
5043 ///
5044 /// Note that all the setters affecting `step_info` are
5045 /// mutually exclusive.
5046 ///
5047 /// # Example
5048 /// ```ignore,no_run
5049 /// # use google_cloud_networkmanagement_v1::model::Step;
5050 /// use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
5051 /// let x = Step::new().set_app_engine_version(AppEngineVersionInfo::default()/* use setters */);
5052 /// assert!(x.app_engine_version().is_some());
5053 /// assert!(x.instance().is_none());
5054 /// assert!(x.firewall().is_none());
5055 /// assert!(x.route().is_none());
5056 /// assert!(x.endpoint().is_none());
5057 /// assert!(x.google_service().is_none());
5058 /// assert!(x.forwarding_rule().is_none());
5059 /// assert!(x.hybrid_subnet().is_none());
5060 /// assert!(x.vpn_gateway().is_none());
5061 /// assert!(x.vpn_tunnel().is_none());
5062 /// assert!(x.interconnect_attachment().is_none());
5063 /// assert!(x.vpc_connector().is_none());
5064 /// assert!(x.direct_vpc_egress_connection().is_none());
5065 /// assert!(x.serverless_external_connection().is_none());
5066 /// assert!(x.deliver().is_none());
5067 /// assert!(x.forward().is_none());
5068 /// assert!(x.abort().is_none());
5069 /// assert!(x.drop().is_none());
5070 /// assert!(x.load_balancer().is_none());
5071 /// assert!(x.network().is_none());
5072 /// assert!(x.gke_master().is_none());
5073 /// assert!(x.cloud_sql_instance().is_none());
5074 /// assert!(x.redis_instance().is_none());
5075 /// assert!(x.redis_cluster().is_none());
5076 /// assert!(x.cloud_function().is_none());
5077 /// assert!(x.cloud_run_revision().is_none());
5078 /// assert!(x.nat().is_none());
5079 /// assert!(x.proxy_connection().is_none());
5080 /// assert!(x.load_balancer_backend_info().is_none());
5081 /// assert!(x.storage_bucket().is_none());
5082 /// assert!(x.serverless_neg().is_none());
5083 /// ```
5084 pub fn set_app_engine_version<
5085 T: std::convert::Into<std::boxed::Box<crate::model::AppEngineVersionInfo>>,
5086 >(
5087 mut self,
5088 v: T,
5089 ) -> Self {
5090 self.step_info =
5091 std::option::Option::Some(crate::model::step::StepInfo::AppEngineVersion(v.into()));
5092 self
5093 }
5094
5095 /// The value of [step_info][crate::model::Step::step_info]
5096 /// if it holds a `CloudRunRevision`, `None` if the field is not set or
5097 /// holds a different branch.
5098 pub fn cloud_run_revision(
5099 &self,
5100 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudRunRevisionInfo>> {
5101 #[allow(unreachable_patterns)]
5102 self.step_info.as_ref().and_then(|v| match v {
5103 crate::model::step::StepInfo::CloudRunRevision(v) => std::option::Option::Some(v),
5104 _ => std::option::Option::None,
5105 })
5106 }
5107
5108 /// Sets the value of [step_info][crate::model::Step::step_info]
5109 /// to hold a `CloudRunRevision`.
5110 ///
5111 /// Note that all the setters affecting `step_info` are
5112 /// mutually exclusive.
5113 ///
5114 /// # Example
5115 /// ```ignore,no_run
5116 /// # use google_cloud_networkmanagement_v1::model::Step;
5117 /// use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
5118 /// let x = Step::new().set_cloud_run_revision(CloudRunRevisionInfo::default()/* use setters */);
5119 /// assert!(x.cloud_run_revision().is_some());
5120 /// assert!(x.instance().is_none());
5121 /// assert!(x.firewall().is_none());
5122 /// assert!(x.route().is_none());
5123 /// assert!(x.endpoint().is_none());
5124 /// assert!(x.google_service().is_none());
5125 /// assert!(x.forwarding_rule().is_none());
5126 /// assert!(x.hybrid_subnet().is_none());
5127 /// assert!(x.vpn_gateway().is_none());
5128 /// assert!(x.vpn_tunnel().is_none());
5129 /// assert!(x.interconnect_attachment().is_none());
5130 /// assert!(x.vpc_connector().is_none());
5131 /// assert!(x.direct_vpc_egress_connection().is_none());
5132 /// assert!(x.serverless_external_connection().is_none());
5133 /// assert!(x.deliver().is_none());
5134 /// assert!(x.forward().is_none());
5135 /// assert!(x.abort().is_none());
5136 /// assert!(x.drop().is_none());
5137 /// assert!(x.load_balancer().is_none());
5138 /// assert!(x.network().is_none());
5139 /// assert!(x.gke_master().is_none());
5140 /// assert!(x.cloud_sql_instance().is_none());
5141 /// assert!(x.redis_instance().is_none());
5142 /// assert!(x.redis_cluster().is_none());
5143 /// assert!(x.cloud_function().is_none());
5144 /// assert!(x.app_engine_version().is_none());
5145 /// assert!(x.nat().is_none());
5146 /// assert!(x.proxy_connection().is_none());
5147 /// assert!(x.load_balancer_backend_info().is_none());
5148 /// assert!(x.storage_bucket().is_none());
5149 /// assert!(x.serverless_neg().is_none());
5150 /// ```
5151 pub fn set_cloud_run_revision<
5152 T: std::convert::Into<std::boxed::Box<crate::model::CloudRunRevisionInfo>>,
5153 >(
5154 mut self,
5155 v: T,
5156 ) -> Self {
5157 self.step_info =
5158 std::option::Option::Some(crate::model::step::StepInfo::CloudRunRevision(v.into()));
5159 self
5160 }
5161
5162 /// The value of [step_info][crate::model::Step::step_info]
5163 /// if it holds a `Nat`, `None` if the field is not set or
5164 /// holds a different branch.
5165 pub fn nat(&self) -> std::option::Option<&std::boxed::Box<crate::model::NatInfo>> {
5166 #[allow(unreachable_patterns)]
5167 self.step_info.as_ref().and_then(|v| match v {
5168 crate::model::step::StepInfo::Nat(v) => std::option::Option::Some(v),
5169 _ => std::option::Option::None,
5170 })
5171 }
5172
5173 /// Sets the value of [step_info][crate::model::Step::step_info]
5174 /// to hold a `Nat`.
5175 ///
5176 /// Note that all the setters affecting `step_info` are
5177 /// mutually exclusive.
5178 ///
5179 /// # Example
5180 /// ```ignore,no_run
5181 /// # use google_cloud_networkmanagement_v1::model::Step;
5182 /// use google_cloud_networkmanagement_v1::model::NatInfo;
5183 /// let x = Step::new().set_nat(NatInfo::default()/* use setters */);
5184 /// assert!(x.nat().is_some());
5185 /// assert!(x.instance().is_none());
5186 /// assert!(x.firewall().is_none());
5187 /// assert!(x.route().is_none());
5188 /// assert!(x.endpoint().is_none());
5189 /// assert!(x.google_service().is_none());
5190 /// assert!(x.forwarding_rule().is_none());
5191 /// assert!(x.hybrid_subnet().is_none());
5192 /// assert!(x.vpn_gateway().is_none());
5193 /// assert!(x.vpn_tunnel().is_none());
5194 /// assert!(x.interconnect_attachment().is_none());
5195 /// assert!(x.vpc_connector().is_none());
5196 /// assert!(x.direct_vpc_egress_connection().is_none());
5197 /// assert!(x.serverless_external_connection().is_none());
5198 /// assert!(x.deliver().is_none());
5199 /// assert!(x.forward().is_none());
5200 /// assert!(x.abort().is_none());
5201 /// assert!(x.drop().is_none());
5202 /// assert!(x.load_balancer().is_none());
5203 /// assert!(x.network().is_none());
5204 /// assert!(x.gke_master().is_none());
5205 /// assert!(x.cloud_sql_instance().is_none());
5206 /// assert!(x.redis_instance().is_none());
5207 /// assert!(x.redis_cluster().is_none());
5208 /// assert!(x.cloud_function().is_none());
5209 /// assert!(x.app_engine_version().is_none());
5210 /// assert!(x.cloud_run_revision().is_none());
5211 /// assert!(x.proxy_connection().is_none());
5212 /// assert!(x.load_balancer_backend_info().is_none());
5213 /// assert!(x.storage_bucket().is_none());
5214 /// assert!(x.serverless_neg().is_none());
5215 /// ```
5216 pub fn set_nat<T: std::convert::Into<std::boxed::Box<crate::model::NatInfo>>>(
5217 mut self,
5218 v: T,
5219 ) -> Self {
5220 self.step_info = std::option::Option::Some(crate::model::step::StepInfo::Nat(v.into()));
5221 self
5222 }
5223
5224 /// The value of [step_info][crate::model::Step::step_info]
5225 /// if it holds a `ProxyConnection`, `None` if the field is not set or
5226 /// holds a different branch.
5227 pub fn proxy_connection(
5228 &self,
5229 ) -> std::option::Option<&std::boxed::Box<crate::model::ProxyConnectionInfo>> {
5230 #[allow(unreachable_patterns)]
5231 self.step_info.as_ref().and_then(|v| match v {
5232 crate::model::step::StepInfo::ProxyConnection(v) => std::option::Option::Some(v),
5233 _ => std::option::Option::None,
5234 })
5235 }
5236
5237 /// Sets the value of [step_info][crate::model::Step::step_info]
5238 /// to hold a `ProxyConnection`.
5239 ///
5240 /// Note that all the setters affecting `step_info` are
5241 /// mutually exclusive.
5242 ///
5243 /// # Example
5244 /// ```ignore,no_run
5245 /// # use google_cloud_networkmanagement_v1::model::Step;
5246 /// use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
5247 /// let x = Step::new().set_proxy_connection(ProxyConnectionInfo::default()/* use setters */);
5248 /// assert!(x.proxy_connection().is_some());
5249 /// assert!(x.instance().is_none());
5250 /// assert!(x.firewall().is_none());
5251 /// assert!(x.route().is_none());
5252 /// assert!(x.endpoint().is_none());
5253 /// assert!(x.google_service().is_none());
5254 /// assert!(x.forwarding_rule().is_none());
5255 /// assert!(x.hybrid_subnet().is_none());
5256 /// assert!(x.vpn_gateway().is_none());
5257 /// assert!(x.vpn_tunnel().is_none());
5258 /// assert!(x.interconnect_attachment().is_none());
5259 /// assert!(x.vpc_connector().is_none());
5260 /// assert!(x.direct_vpc_egress_connection().is_none());
5261 /// assert!(x.serverless_external_connection().is_none());
5262 /// assert!(x.deliver().is_none());
5263 /// assert!(x.forward().is_none());
5264 /// assert!(x.abort().is_none());
5265 /// assert!(x.drop().is_none());
5266 /// assert!(x.load_balancer().is_none());
5267 /// assert!(x.network().is_none());
5268 /// assert!(x.gke_master().is_none());
5269 /// assert!(x.cloud_sql_instance().is_none());
5270 /// assert!(x.redis_instance().is_none());
5271 /// assert!(x.redis_cluster().is_none());
5272 /// assert!(x.cloud_function().is_none());
5273 /// assert!(x.app_engine_version().is_none());
5274 /// assert!(x.cloud_run_revision().is_none());
5275 /// assert!(x.nat().is_none());
5276 /// assert!(x.load_balancer_backend_info().is_none());
5277 /// assert!(x.storage_bucket().is_none());
5278 /// assert!(x.serverless_neg().is_none());
5279 /// ```
5280 pub fn set_proxy_connection<
5281 T: std::convert::Into<std::boxed::Box<crate::model::ProxyConnectionInfo>>,
5282 >(
5283 mut self,
5284 v: T,
5285 ) -> Self {
5286 self.step_info =
5287 std::option::Option::Some(crate::model::step::StepInfo::ProxyConnection(v.into()));
5288 self
5289 }
5290
5291 /// The value of [step_info][crate::model::Step::step_info]
5292 /// if it holds a `LoadBalancerBackendInfo`, `None` if the field is not set or
5293 /// holds a different branch.
5294 pub fn load_balancer_backend_info(
5295 &self,
5296 ) -> std::option::Option<&std::boxed::Box<crate::model::LoadBalancerBackendInfo>> {
5297 #[allow(unreachable_patterns)]
5298 self.step_info.as_ref().and_then(|v| match v {
5299 crate::model::step::StepInfo::LoadBalancerBackendInfo(v) => {
5300 std::option::Option::Some(v)
5301 }
5302 _ => std::option::Option::None,
5303 })
5304 }
5305
5306 /// Sets the value of [step_info][crate::model::Step::step_info]
5307 /// to hold a `LoadBalancerBackendInfo`.
5308 ///
5309 /// Note that all the setters affecting `step_info` are
5310 /// mutually exclusive.
5311 ///
5312 /// # Example
5313 /// ```ignore,no_run
5314 /// # use google_cloud_networkmanagement_v1::model::Step;
5315 /// use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
5316 /// let x = Step::new().set_load_balancer_backend_info(LoadBalancerBackendInfo::default()/* use setters */);
5317 /// assert!(x.load_balancer_backend_info().is_some());
5318 /// assert!(x.instance().is_none());
5319 /// assert!(x.firewall().is_none());
5320 /// assert!(x.route().is_none());
5321 /// assert!(x.endpoint().is_none());
5322 /// assert!(x.google_service().is_none());
5323 /// assert!(x.forwarding_rule().is_none());
5324 /// assert!(x.hybrid_subnet().is_none());
5325 /// assert!(x.vpn_gateway().is_none());
5326 /// assert!(x.vpn_tunnel().is_none());
5327 /// assert!(x.interconnect_attachment().is_none());
5328 /// assert!(x.vpc_connector().is_none());
5329 /// assert!(x.direct_vpc_egress_connection().is_none());
5330 /// assert!(x.serverless_external_connection().is_none());
5331 /// assert!(x.deliver().is_none());
5332 /// assert!(x.forward().is_none());
5333 /// assert!(x.abort().is_none());
5334 /// assert!(x.drop().is_none());
5335 /// assert!(x.load_balancer().is_none());
5336 /// assert!(x.network().is_none());
5337 /// assert!(x.gke_master().is_none());
5338 /// assert!(x.cloud_sql_instance().is_none());
5339 /// assert!(x.redis_instance().is_none());
5340 /// assert!(x.redis_cluster().is_none());
5341 /// assert!(x.cloud_function().is_none());
5342 /// assert!(x.app_engine_version().is_none());
5343 /// assert!(x.cloud_run_revision().is_none());
5344 /// assert!(x.nat().is_none());
5345 /// assert!(x.proxy_connection().is_none());
5346 /// assert!(x.storage_bucket().is_none());
5347 /// assert!(x.serverless_neg().is_none());
5348 /// ```
5349 pub fn set_load_balancer_backend_info<
5350 T: std::convert::Into<std::boxed::Box<crate::model::LoadBalancerBackendInfo>>,
5351 >(
5352 mut self,
5353 v: T,
5354 ) -> Self {
5355 self.step_info = std::option::Option::Some(
5356 crate::model::step::StepInfo::LoadBalancerBackendInfo(v.into()),
5357 );
5358 self
5359 }
5360
5361 /// The value of [step_info][crate::model::Step::step_info]
5362 /// if it holds a `StorageBucket`, `None` if the field is not set or
5363 /// holds a different branch.
5364 pub fn storage_bucket(
5365 &self,
5366 ) -> std::option::Option<&std::boxed::Box<crate::model::StorageBucketInfo>> {
5367 #[allow(unreachable_patterns)]
5368 self.step_info.as_ref().and_then(|v| match v {
5369 crate::model::step::StepInfo::StorageBucket(v) => std::option::Option::Some(v),
5370 _ => std::option::Option::None,
5371 })
5372 }
5373
5374 /// Sets the value of [step_info][crate::model::Step::step_info]
5375 /// to hold a `StorageBucket`.
5376 ///
5377 /// Note that all the setters affecting `step_info` are
5378 /// mutually exclusive.
5379 ///
5380 /// # Example
5381 /// ```ignore,no_run
5382 /// # use google_cloud_networkmanagement_v1::model::Step;
5383 /// use google_cloud_networkmanagement_v1::model::StorageBucketInfo;
5384 /// let x = Step::new().set_storage_bucket(StorageBucketInfo::default()/* use setters */);
5385 /// assert!(x.storage_bucket().is_some());
5386 /// assert!(x.instance().is_none());
5387 /// assert!(x.firewall().is_none());
5388 /// assert!(x.route().is_none());
5389 /// assert!(x.endpoint().is_none());
5390 /// assert!(x.google_service().is_none());
5391 /// assert!(x.forwarding_rule().is_none());
5392 /// assert!(x.hybrid_subnet().is_none());
5393 /// assert!(x.vpn_gateway().is_none());
5394 /// assert!(x.vpn_tunnel().is_none());
5395 /// assert!(x.interconnect_attachment().is_none());
5396 /// assert!(x.vpc_connector().is_none());
5397 /// assert!(x.direct_vpc_egress_connection().is_none());
5398 /// assert!(x.serverless_external_connection().is_none());
5399 /// assert!(x.deliver().is_none());
5400 /// assert!(x.forward().is_none());
5401 /// assert!(x.abort().is_none());
5402 /// assert!(x.drop().is_none());
5403 /// assert!(x.load_balancer().is_none());
5404 /// assert!(x.network().is_none());
5405 /// assert!(x.gke_master().is_none());
5406 /// assert!(x.cloud_sql_instance().is_none());
5407 /// assert!(x.redis_instance().is_none());
5408 /// assert!(x.redis_cluster().is_none());
5409 /// assert!(x.cloud_function().is_none());
5410 /// assert!(x.app_engine_version().is_none());
5411 /// assert!(x.cloud_run_revision().is_none());
5412 /// assert!(x.nat().is_none());
5413 /// assert!(x.proxy_connection().is_none());
5414 /// assert!(x.load_balancer_backend_info().is_none());
5415 /// assert!(x.serverless_neg().is_none());
5416 /// ```
5417 pub fn set_storage_bucket<
5418 T: std::convert::Into<std::boxed::Box<crate::model::StorageBucketInfo>>,
5419 >(
5420 mut self,
5421 v: T,
5422 ) -> Self {
5423 self.step_info =
5424 std::option::Option::Some(crate::model::step::StepInfo::StorageBucket(v.into()));
5425 self
5426 }
5427
5428 /// The value of [step_info][crate::model::Step::step_info]
5429 /// if it holds a `ServerlessNeg`, `None` if the field is not set or
5430 /// holds a different branch.
5431 pub fn serverless_neg(
5432 &self,
5433 ) -> std::option::Option<&std::boxed::Box<crate::model::ServerlessNegInfo>> {
5434 #[allow(unreachable_patterns)]
5435 self.step_info.as_ref().and_then(|v| match v {
5436 crate::model::step::StepInfo::ServerlessNeg(v) => std::option::Option::Some(v),
5437 _ => std::option::Option::None,
5438 })
5439 }
5440
5441 /// Sets the value of [step_info][crate::model::Step::step_info]
5442 /// to hold a `ServerlessNeg`.
5443 ///
5444 /// Note that all the setters affecting `step_info` are
5445 /// mutually exclusive.
5446 ///
5447 /// # Example
5448 /// ```ignore,no_run
5449 /// # use google_cloud_networkmanagement_v1::model::Step;
5450 /// use google_cloud_networkmanagement_v1::model::ServerlessNegInfo;
5451 /// let x = Step::new().set_serverless_neg(ServerlessNegInfo::default()/* use setters */);
5452 /// assert!(x.serverless_neg().is_some());
5453 /// assert!(x.instance().is_none());
5454 /// assert!(x.firewall().is_none());
5455 /// assert!(x.route().is_none());
5456 /// assert!(x.endpoint().is_none());
5457 /// assert!(x.google_service().is_none());
5458 /// assert!(x.forwarding_rule().is_none());
5459 /// assert!(x.hybrid_subnet().is_none());
5460 /// assert!(x.vpn_gateway().is_none());
5461 /// assert!(x.vpn_tunnel().is_none());
5462 /// assert!(x.interconnect_attachment().is_none());
5463 /// assert!(x.vpc_connector().is_none());
5464 /// assert!(x.direct_vpc_egress_connection().is_none());
5465 /// assert!(x.serverless_external_connection().is_none());
5466 /// assert!(x.deliver().is_none());
5467 /// assert!(x.forward().is_none());
5468 /// assert!(x.abort().is_none());
5469 /// assert!(x.drop().is_none());
5470 /// assert!(x.load_balancer().is_none());
5471 /// assert!(x.network().is_none());
5472 /// assert!(x.gke_master().is_none());
5473 /// assert!(x.cloud_sql_instance().is_none());
5474 /// assert!(x.redis_instance().is_none());
5475 /// assert!(x.redis_cluster().is_none());
5476 /// assert!(x.cloud_function().is_none());
5477 /// assert!(x.app_engine_version().is_none());
5478 /// assert!(x.cloud_run_revision().is_none());
5479 /// assert!(x.nat().is_none());
5480 /// assert!(x.proxy_connection().is_none());
5481 /// assert!(x.load_balancer_backend_info().is_none());
5482 /// assert!(x.storage_bucket().is_none());
5483 /// ```
5484 pub fn set_serverless_neg<
5485 T: std::convert::Into<std::boxed::Box<crate::model::ServerlessNegInfo>>,
5486 >(
5487 mut self,
5488 v: T,
5489 ) -> Self {
5490 self.step_info =
5491 std::option::Option::Some(crate::model::step::StepInfo::ServerlessNeg(v.into()));
5492 self
5493 }
5494}
5495
5496impl wkt::message::Message for Step {
5497 fn typename() -> &'static str {
5498 "type.googleapis.com/google.cloud.networkmanagement.v1.Step"
5499 }
5500}
5501
5502/// Defines additional types related to [Step].
5503pub mod step {
5504 #[allow(unused_imports)]
5505 use super::*;
5506
5507 /// Type of states that are defined in the network state machine.
5508 /// Each step in the packet trace is in a specific state.
5509 ///
5510 /// # Working with unknown values
5511 ///
5512 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5513 /// additional enum variants at any time. Adding new variants is not considered
5514 /// a breaking change. Applications should write their code in anticipation of:
5515 ///
5516 /// - New values appearing in future releases of the client library, **and**
5517 /// - New values received dynamically, without application changes.
5518 ///
5519 /// Please consult the [Working with enums] section in the user guide for some
5520 /// guidelines.
5521 ///
5522 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5523 #[derive(Clone, Debug, PartialEq)]
5524 #[non_exhaustive]
5525 pub enum State {
5526 /// Unspecified state.
5527 Unspecified,
5528 /// Initial state: packet originating from a Compute Engine instance.
5529 /// An InstanceInfo is populated with starting instance information.
5530 StartFromInstance,
5531 /// Initial state: packet originating from the internet.
5532 /// The endpoint information is populated.
5533 StartFromInternet,
5534 /// Initial state: packet originating from a Google service.
5535 /// The google_service information is populated.
5536 StartFromGoogleService,
5537 /// Initial state: packet originating from a VPC or on-premises network
5538 /// with internal source IP.
5539 /// If the source is a VPC network visible to the user, a NetworkInfo
5540 /// is populated with details of the network.
5541 StartFromPrivateNetwork,
5542 /// Initial state: packet originating from a Google Kubernetes Engine cluster
5543 /// master. A GKEMasterInfo is populated with starting instance information.
5544 StartFromGkeMaster,
5545 /// Initial state: packet originating from a Cloud SQL instance.
5546 /// A CloudSQLInstanceInfo is populated with starting instance information.
5547 StartFromCloudSqlInstance,
5548 /// Initial state: packet originating from a Redis instance.
5549 /// A RedisInstanceInfo is populated with starting instance information.
5550 StartFromRedisInstance,
5551 /// Initial state: packet originating from a Redis Cluster.
5552 /// A RedisClusterInfo is populated with starting Cluster information.
5553 StartFromRedisCluster,
5554 /// Initial state: packet originating from a Cloud Function.
5555 /// A CloudFunctionInfo is populated with starting function information.
5556 StartFromCloudFunction,
5557 /// Initial state: packet originating from an App Engine service version.
5558 /// An AppEngineVersionInfo is populated with starting version information.
5559 StartFromAppEngineVersion,
5560 /// Initial state: packet originating from a Cloud Run revision.
5561 /// A CloudRunRevisionInfo is populated with starting revision information.
5562 StartFromCloudRunRevision,
5563 /// Initial state: packet originating from a Storage Bucket. Used only for
5564 /// return traces.
5565 /// The storage_bucket information is populated.
5566 StartFromStorageBucket,
5567 /// Initial state: packet originating from a published service that uses
5568 /// Private Service Connect. Used only for return traces.
5569 StartFromPscPublishedService,
5570 /// Initial state: packet originating from a serverless network endpoint
5571 /// group backend. Used only for return traces.
5572 /// The serverless_neg information is populated.
5573 StartFromServerlessNeg,
5574 /// Config checking state: verify ingress firewall rule.
5575 ApplyIngressFirewallRule,
5576 /// Config checking state: verify egress firewall rule.
5577 ApplyEgressFirewallRule,
5578 /// Config checking state: verify route.
5579 ApplyRoute,
5580 /// Config checking state: match forwarding rule.
5581 ApplyForwardingRule,
5582 /// Config checking state: verify load balancer backend configuration.
5583 AnalyzeLoadBalancerBackend,
5584 /// Config checking state: packet sent or received under foreign IP
5585 /// address and allowed.
5586 SpoofingApproved,
5587 /// Forwarding state: arriving at a Compute Engine instance.
5588 ArriveAtInstance,
5589 /// Forwarding state: arriving at a Compute Engine internal load balancer.
5590 #[deprecated]
5591 ArriveAtInternalLoadBalancer,
5592 /// Forwarding state: arriving at a Compute Engine external load balancer.
5593 #[deprecated]
5594 ArriveAtExternalLoadBalancer,
5595 /// Forwarding state: arriving at a hybrid subnet. Appropriate routing
5596 /// configuration will be determined here.
5597 ArriveAtHybridSubnet,
5598 /// Forwarding state: arriving at a Cloud VPN gateway.
5599 ArriveAtVpnGateway,
5600 /// Forwarding state: arriving at a Cloud VPN tunnel.
5601 ArriveAtVpnTunnel,
5602 /// Forwarding state: arriving at an interconnect attachment.
5603 ArriveAtInterconnectAttachment,
5604 /// Forwarding state: arriving at a VPC connector.
5605 ArriveAtVpcConnector,
5606 /// Forwarding state: for packets originating from a serverless endpoint
5607 /// forwarded through Direct VPC egress.
5608 DirectVpcEgressConnection,
5609 /// Forwarding state: for packets originating from a serverless endpoint
5610 /// forwarded through public (external) connectivity.
5611 ServerlessExternalConnection,
5612 /// Transition state: packet header translated. The `nat` field is populated
5613 /// with the translation information.
5614 Nat,
5615 /// Transition state: original connection is terminated and a new proxied
5616 /// connection is initiated.
5617 ProxyConnection,
5618 /// Final state: packet could be delivered.
5619 Deliver,
5620 /// Final state: packet could be dropped.
5621 Drop,
5622 /// Final state: packet could be forwarded to a network with an unknown
5623 /// configuration.
5624 Forward,
5625 /// Final state: analysis is aborted.
5626 Abort,
5627 /// Special state: viewer of the test result does not have permission to
5628 /// see the configuration in this step.
5629 ViewerPermissionMissing,
5630 /// If set, the enum was initialized with an unknown value.
5631 ///
5632 /// Applications can examine the value using [State::value] or
5633 /// [State::name].
5634 UnknownValue(state::UnknownValue),
5635 }
5636
5637 #[doc(hidden)]
5638 pub mod state {
5639 #[allow(unused_imports)]
5640 use super::*;
5641 #[derive(Clone, Debug, PartialEq)]
5642 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5643 }
5644
5645 impl State {
5646 /// Gets the enum value.
5647 ///
5648 /// Returns `None` if the enum contains an unknown value deserialized from
5649 /// the string representation of enums.
5650 pub fn value(&self) -> std::option::Option<i32> {
5651 match self {
5652 Self::Unspecified => std::option::Option::Some(0),
5653 Self::StartFromInstance => std::option::Option::Some(1),
5654 Self::StartFromInternet => std::option::Option::Some(2),
5655 Self::StartFromGoogleService => std::option::Option::Some(27),
5656 Self::StartFromPrivateNetwork => std::option::Option::Some(3),
5657 Self::StartFromGkeMaster => std::option::Option::Some(21),
5658 Self::StartFromCloudSqlInstance => std::option::Option::Some(22),
5659 Self::StartFromRedisInstance => std::option::Option::Some(32),
5660 Self::StartFromRedisCluster => std::option::Option::Some(33),
5661 Self::StartFromCloudFunction => std::option::Option::Some(23),
5662 Self::StartFromAppEngineVersion => std::option::Option::Some(25),
5663 Self::StartFromCloudRunRevision => std::option::Option::Some(26),
5664 Self::StartFromStorageBucket => std::option::Option::Some(29),
5665 Self::StartFromPscPublishedService => std::option::Option::Some(30),
5666 Self::StartFromServerlessNeg => std::option::Option::Some(31),
5667 Self::ApplyIngressFirewallRule => std::option::Option::Some(4),
5668 Self::ApplyEgressFirewallRule => std::option::Option::Some(5),
5669 Self::ApplyRoute => std::option::Option::Some(6),
5670 Self::ApplyForwardingRule => std::option::Option::Some(7),
5671 Self::AnalyzeLoadBalancerBackend => std::option::Option::Some(28),
5672 Self::SpoofingApproved => std::option::Option::Some(8),
5673 Self::ArriveAtInstance => std::option::Option::Some(9),
5674 Self::ArriveAtInternalLoadBalancer => std::option::Option::Some(10),
5675 Self::ArriveAtExternalLoadBalancer => std::option::Option::Some(11),
5676 Self::ArriveAtHybridSubnet => std::option::Option::Some(38),
5677 Self::ArriveAtVpnGateway => std::option::Option::Some(12),
5678 Self::ArriveAtVpnTunnel => std::option::Option::Some(13),
5679 Self::ArriveAtInterconnectAttachment => std::option::Option::Some(37),
5680 Self::ArriveAtVpcConnector => std::option::Option::Some(24),
5681 Self::DirectVpcEgressConnection => std::option::Option::Some(35),
5682 Self::ServerlessExternalConnection => std::option::Option::Some(36),
5683 Self::Nat => std::option::Option::Some(14),
5684 Self::ProxyConnection => std::option::Option::Some(15),
5685 Self::Deliver => std::option::Option::Some(16),
5686 Self::Drop => std::option::Option::Some(17),
5687 Self::Forward => std::option::Option::Some(18),
5688 Self::Abort => std::option::Option::Some(19),
5689 Self::ViewerPermissionMissing => std::option::Option::Some(20),
5690 Self::UnknownValue(u) => u.0.value(),
5691 }
5692 }
5693
5694 /// Gets the enum value as a string.
5695 ///
5696 /// Returns `None` if the enum contains an unknown value deserialized from
5697 /// the integer representation of enums.
5698 pub fn name(&self) -> std::option::Option<&str> {
5699 match self {
5700 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5701 Self::StartFromInstance => std::option::Option::Some("START_FROM_INSTANCE"),
5702 Self::StartFromInternet => std::option::Option::Some("START_FROM_INTERNET"),
5703 Self::StartFromGoogleService => {
5704 std::option::Option::Some("START_FROM_GOOGLE_SERVICE")
5705 }
5706 Self::StartFromPrivateNetwork => {
5707 std::option::Option::Some("START_FROM_PRIVATE_NETWORK")
5708 }
5709 Self::StartFromGkeMaster => std::option::Option::Some("START_FROM_GKE_MASTER"),
5710 Self::StartFromCloudSqlInstance => {
5711 std::option::Option::Some("START_FROM_CLOUD_SQL_INSTANCE")
5712 }
5713 Self::StartFromRedisInstance => {
5714 std::option::Option::Some("START_FROM_REDIS_INSTANCE")
5715 }
5716 Self::StartFromRedisCluster => {
5717 std::option::Option::Some("START_FROM_REDIS_CLUSTER")
5718 }
5719 Self::StartFromCloudFunction => {
5720 std::option::Option::Some("START_FROM_CLOUD_FUNCTION")
5721 }
5722 Self::StartFromAppEngineVersion => {
5723 std::option::Option::Some("START_FROM_APP_ENGINE_VERSION")
5724 }
5725 Self::StartFromCloudRunRevision => {
5726 std::option::Option::Some("START_FROM_CLOUD_RUN_REVISION")
5727 }
5728 Self::StartFromStorageBucket => {
5729 std::option::Option::Some("START_FROM_STORAGE_BUCKET")
5730 }
5731 Self::StartFromPscPublishedService => {
5732 std::option::Option::Some("START_FROM_PSC_PUBLISHED_SERVICE")
5733 }
5734 Self::StartFromServerlessNeg => {
5735 std::option::Option::Some("START_FROM_SERVERLESS_NEG")
5736 }
5737 Self::ApplyIngressFirewallRule => {
5738 std::option::Option::Some("APPLY_INGRESS_FIREWALL_RULE")
5739 }
5740 Self::ApplyEgressFirewallRule => {
5741 std::option::Option::Some("APPLY_EGRESS_FIREWALL_RULE")
5742 }
5743 Self::ApplyRoute => std::option::Option::Some("APPLY_ROUTE"),
5744 Self::ApplyForwardingRule => std::option::Option::Some("APPLY_FORWARDING_RULE"),
5745 Self::AnalyzeLoadBalancerBackend => {
5746 std::option::Option::Some("ANALYZE_LOAD_BALANCER_BACKEND")
5747 }
5748 Self::SpoofingApproved => std::option::Option::Some("SPOOFING_APPROVED"),
5749 Self::ArriveAtInstance => std::option::Option::Some("ARRIVE_AT_INSTANCE"),
5750 Self::ArriveAtInternalLoadBalancer => {
5751 std::option::Option::Some("ARRIVE_AT_INTERNAL_LOAD_BALANCER")
5752 }
5753 Self::ArriveAtExternalLoadBalancer => {
5754 std::option::Option::Some("ARRIVE_AT_EXTERNAL_LOAD_BALANCER")
5755 }
5756 Self::ArriveAtHybridSubnet => std::option::Option::Some("ARRIVE_AT_HYBRID_SUBNET"),
5757 Self::ArriveAtVpnGateway => std::option::Option::Some("ARRIVE_AT_VPN_GATEWAY"),
5758 Self::ArriveAtVpnTunnel => std::option::Option::Some("ARRIVE_AT_VPN_TUNNEL"),
5759 Self::ArriveAtInterconnectAttachment => {
5760 std::option::Option::Some("ARRIVE_AT_INTERCONNECT_ATTACHMENT")
5761 }
5762 Self::ArriveAtVpcConnector => std::option::Option::Some("ARRIVE_AT_VPC_CONNECTOR"),
5763 Self::DirectVpcEgressConnection => {
5764 std::option::Option::Some("DIRECT_VPC_EGRESS_CONNECTION")
5765 }
5766 Self::ServerlessExternalConnection => {
5767 std::option::Option::Some("SERVERLESS_EXTERNAL_CONNECTION")
5768 }
5769 Self::Nat => std::option::Option::Some("NAT"),
5770 Self::ProxyConnection => std::option::Option::Some("PROXY_CONNECTION"),
5771 Self::Deliver => std::option::Option::Some("DELIVER"),
5772 Self::Drop => std::option::Option::Some("DROP"),
5773 Self::Forward => std::option::Option::Some("FORWARD"),
5774 Self::Abort => std::option::Option::Some("ABORT"),
5775 Self::ViewerPermissionMissing => {
5776 std::option::Option::Some("VIEWER_PERMISSION_MISSING")
5777 }
5778 Self::UnknownValue(u) => u.0.name(),
5779 }
5780 }
5781 }
5782
5783 impl std::default::Default for State {
5784 fn default() -> Self {
5785 use std::convert::From;
5786 Self::from(0)
5787 }
5788 }
5789
5790 impl std::fmt::Display for State {
5791 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5792 wkt::internal::display_enum(f, self.name(), self.value())
5793 }
5794 }
5795
5796 impl std::convert::From<i32> for State {
5797 fn from(value: i32) -> Self {
5798 match value {
5799 0 => Self::Unspecified,
5800 1 => Self::StartFromInstance,
5801 2 => Self::StartFromInternet,
5802 3 => Self::StartFromPrivateNetwork,
5803 4 => Self::ApplyIngressFirewallRule,
5804 5 => Self::ApplyEgressFirewallRule,
5805 6 => Self::ApplyRoute,
5806 7 => Self::ApplyForwardingRule,
5807 8 => Self::SpoofingApproved,
5808 9 => Self::ArriveAtInstance,
5809 10 => Self::ArriveAtInternalLoadBalancer,
5810 11 => Self::ArriveAtExternalLoadBalancer,
5811 12 => Self::ArriveAtVpnGateway,
5812 13 => Self::ArriveAtVpnTunnel,
5813 14 => Self::Nat,
5814 15 => Self::ProxyConnection,
5815 16 => Self::Deliver,
5816 17 => Self::Drop,
5817 18 => Self::Forward,
5818 19 => Self::Abort,
5819 20 => Self::ViewerPermissionMissing,
5820 21 => Self::StartFromGkeMaster,
5821 22 => Self::StartFromCloudSqlInstance,
5822 23 => Self::StartFromCloudFunction,
5823 24 => Self::ArriveAtVpcConnector,
5824 25 => Self::StartFromAppEngineVersion,
5825 26 => Self::StartFromCloudRunRevision,
5826 27 => Self::StartFromGoogleService,
5827 28 => Self::AnalyzeLoadBalancerBackend,
5828 29 => Self::StartFromStorageBucket,
5829 30 => Self::StartFromPscPublishedService,
5830 31 => Self::StartFromServerlessNeg,
5831 32 => Self::StartFromRedisInstance,
5832 33 => Self::StartFromRedisCluster,
5833 35 => Self::DirectVpcEgressConnection,
5834 36 => Self::ServerlessExternalConnection,
5835 37 => Self::ArriveAtInterconnectAttachment,
5836 38 => Self::ArriveAtHybridSubnet,
5837 _ => Self::UnknownValue(state::UnknownValue(
5838 wkt::internal::UnknownEnumValue::Integer(value),
5839 )),
5840 }
5841 }
5842 }
5843
5844 impl std::convert::From<&str> for State {
5845 fn from(value: &str) -> Self {
5846 use std::string::ToString;
5847 match value {
5848 "STATE_UNSPECIFIED" => Self::Unspecified,
5849 "START_FROM_INSTANCE" => Self::StartFromInstance,
5850 "START_FROM_INTERNET" => Self::StartFromInternet,
5851 "START_FROM_GOOGLE_SERVICE" => Self::StartFromGoogleService,
5852 "START_FROM_PRIVATE_NETWORK" => Self::StartFromPrivateNetwork,
5853 "START_FROM_GKE_MASTER" => Self::StartFromGkeMaster,
5854 "START_FROM_CLOUD_SQL_INSTANCE" => Self::StartFromCloudSqlInstance,
5855 "START_FROM_REDIS_INSTANCE" => Self::StartFromRedisInstance,
5856 "START_FROM_REDIS_CLUSTER" => Self::StartFromRedisCluster,
5857 "START_FROM_CLOUD_FUNCTION" => Self::StartFromCloudFunction,
5858 "START_FROM_APP_ENGINE_VERSION" => Self::StartFromAppEngineVersion,
5859 "START_FROM_CLOUD_RUN_REVISION" => Self::StartFromCloudRunRevision,
5860 "START_FROM_STORAGE_BUCKET" => Self::StartFromStorageBucket,
5861 "START_FROM_PSC_PUBLISHED_SERVICE" => Self::StartFromPscPublishedService,
5862 "START_FROM_SERVERLESS_NEG" => Self::StartFromServerlessNeg,
5863 "APPLY_INGRESS_FIREWALL_RULE" => Self::ApplyIngressFirewallRule,
5864 "APPLY_EGRESS_FIREWALL_RULE" => Self::ApplyEgressFirewallRule,
5865 "APPLY_ROUTE" => Self::ApplyRoute,
5866 "APPLY_FORWARDING_RULE" => Self::ApplyForwardingRule,
5867 "ANALYZE_LOAD_BALANCER_BACKEND" => Self::AnalyzeLoadBalancerBackend,
5868 "SPOOFING_APPROVED" => Self::SpoofingApproved,
5869 "ARRIVE_AT_INSTANCE" => Self::ArriveAtInstance,
5870 "ARRIVE_AT_INTERNAL_LOAD_BALANCER" => Self::ArriveAtInternalLoadBalancer,
5871 "ARRIVE_AT_EXTERNAL_LOAD_BALANCER" => Self::ArriveAtExternalLoadBalancer,
5872 "ARRIVE_AT_HYBRID_SUBNET" => Self::ArriveAtHybridSubnet,
5873 "ARRIVE_AT_VPN_GATEWAY" => Self::ArriveAtVpnGateway,
5874 "ARRIVE_AT_VPN_TUNNEL" => Self::ArriveAtVpnTunnel,
5875 "ARRIVE_AT_INTERCONNECT_ATTACHMENT" => Self::ArriveAtInterconnectAttachment,
5876 "ARRIVE_AT_VPC_CONNECTOR" => Self::ArriveAtVpcConnector,
5877 "DIRECT_VPC_EGRESS_CONNECTION" => Self::DirectVpcEgressConnection,
5878 "SERVERLESS_EXTERNAL_CONNECTION" => Self::ServerlessExternalConnection,
5879 "NAT" => Self::Nat,
5880 "PROXY_CONNECTION" => Self::ProxyConnection,
5881 "DELIVER" => Self::Deliver,
5882 "DROP" => Self::Drop,
5883 "FORWARD" => Self::Forward,
5884 "ABORT" => Self::Abort,
5885 "VIEWER_PERMISSION_MISSING" => Self::ViewerPermissionMissing,
5886 _ => Self::UnknownValue(state::UnknownValue(
5887 wkt::internal::UnknownEnumValue::String(value.to_string()),
5888 )),
5889 }
5890 }
5891 }
5892
5893 impl serde::ser::Serialize for State {
5894 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5895 where
5896 S: serde::Serializer,
5897 {
5898 match self {
5899 Self::Unspecified => serializer.serialize_i32(0),
5900 Self::StartFromInstance => serializer.serialize_i32(1),
5901 Self::StartFromInternet => serializer.serialize_i32(2),
5902 Self::StartFromGoogleService => serializer.serialize_i32(27),
5903 Self::StartFromPrivateNetwork => serializer.serialize_i32(3),
5904 Self::StartFromGkeMaster => serializer.serialize_i32(21),
5905 Self::StartFromCloudSqlInstance => serializer.serialize_i32(22),
5906 Self::StartFromRedisInstance => serializer.serialize_i32(32),
5907 Self::StartFromRedisCluster => serializer.serialize_i32(33),
5908 Self::StartFromCloudFunction => serializer.serialize_i32(23),
5909 Self::StartFromAppEngineVersion => serializer.serialize_i32(25),
5910 Self::StartFromCloudRunRevision => serializer.serialize_i32(26),
5911 Self::StartFromStorageBucket => serializer.serialize_i32(29),
5912 Self::StartFromPscPublishedService => serializer.serialize_i32(30),
5913 Self::StartFromServerlessNeg => serializer.serialize_i32(31),
5914 Self::ApplyIngressFirewallRule => serializer.serialize_i32(4),
5915 Self::ApplyEgressFirewallRule => serializer.serialize_i32(5),
5916 Self::ApplyRoute => serializer.serialize_i32(6),
5917 Self::ApplyForwardingRule => serializer.serialize_i32(7),
5918 Self::AnalyzeLoadBalancerBackend => serializer.serialize_i32(28),
5919 Self::SpoofingApproved => serializer.serialize_i32(8),
5920 Self::ArriveAtInstance => serializer.serialize_i32(9),
5921 Self::ArriveAtInternalLoadBalancer => serializer.serialize_i32(10),
5922 Self::ArriveAtExternalLoadBalancer => serializer.serialize_i32(11),
5923 Self::ArriveAtHybridSubnet => serializer.serialize_i32(38),
5924 Self::ArriveAtVpnGateway => serializer.serialize_i32(12),
5925 Self::ArriveAtVpnTunnel => serializer.serialize_i32(13),
5926 Self::ArriveAtInterconnectAttachment => serializer.serialize_i32(37),
5927 Self::ArriveAtVpcConnector => serializer.serialize_i32(24),
5928 Self::DirectVpcEgressConnection => serializer.serialize_i32(35),
5929 Self::ServerlessExternalConnection => serializer.serialize_i32(36),
5930 Self::Nat => serializer.serialize_i32(14),
5931 Self::ProxyConnection => serializer.serialize_i32(15),
5932 Self::Deliver => serializer.serialize_i32(16),
5933 Self::Drop => serializer.serialize_i32(17),
5934 Self::Forward => serializer.serialize_i32(18),
5935 Self::Abort => serializer.serialize_i32(19),
5936 Self::ViewerPermissionMissing => serializer.serialize_i32(20),
5937 Self::UnknownValue(u) => u.0.serialize(serializer),
5938 }
5939 }
5940 }
5941
5942 impl<'de> serde::de::Deserialize<'de> for State {
5943 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5944 where
5945 D: serde::Deserializer<'de>,
5946 {
5947 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5948 ".google.cloud.networkmanagement.v1.Step.State",
5949 ))
5950 }
5951 }
5952
5953 /// Configuration or metadata associated with each step.
5954 /// The configuration is filtered based on viewer's permission. If a viewer
5955 /// has no permission to view the configuration in this step, for non-final
5956 /// states a special state is populated (VIEWER_PERMISSION_MISSING), and for
5957 /// final state the configuration is cleared.
5958 #[derive(Clone, Debug, PartialEq)]
5959 #[non_exhaustive]
5960 pub enum StepInfo {
5961 /// Display information of a Compute Engine instance.
5962 Instance(std::boxed::Box<crate::model::InstanceInfo>),
5963 /// Display information of a Compute Engine firewall rule.
5964 Firewall(std::boxed::Box<crate::model::FirewallInfo>),
5965 /// Display information of a Compute Engine route.
5966 Route(std::boxed::Box<crate::model::RouteInfo>),
5967 /// Display information of the source and destination under analysis.
5968 /// The endpoint information in an intermediate state may differ with the
5969 /// initial input, as it might be modified by state like NAT,
5970 /// or Connection Proxy.
5971 Endpoint(std::boxed::Box<crate::model::EndpointInfo>),
5972 /// Display information of a Google service
5973 GoogleService(std::boxed::Box<crate::model::GoogleServiceInfo>),
5974 /// Display information of a Compute Engine forwarding rule.
5975 ForwardingRule(std::boxed::Box<crate::model::ForwardingRuleInfo>),
5976 /// Display information of a hybrid subnet.
5977 HybridSubnet(std::boxed::Box<crate::model::HybridSubnetInfo>),
5978 /// Display information of a Compute Engine VPN gateway.
5979 VpnGateway(std::boxed::Box<crate::model::VpnGatewayInfo>),
5980 /// Display information of a Compute Engine VPN tunnel.
5981 VpnTunnel(std::boxed::Box<crate::model::VpnTunnelInfo>),
5982 /// Display information of an interconnect attachment.
5983 InterconnectAttachment(std::boxed::Box<crate::model::InterconnectAttachmentInfo>),
5984 /// Display information of a VPC connector.
5985 VpcConnector(std::boxed::Box<crate::model::VpcConnectorInfo>),
5986 /// Display information of a serverless direct VPC egress connection.
5987 DirectVpcEgressConnection(std::boxed::Box<crate::model::DirectVpcEgressConnectionInfo>),
5988 /// Display information of a serverless public (external) connection.
5989 ServerlessExternalConnection(
5990 std::boxed::Box<crate::model::ServerlessExternalConnectionInfo>,
5991 ),
5992 /// Display information of the final state "deliver" and reason.
5993 Deliver(std::boxed::Box<crate::model::DeliverInfo>),
5994 /// Display information of the final state "forward" and reason.
5995 Forward(std::boxed::Box<crate::model::ForwardInfo>),
5996 /// Display information of the final state "abort" and reason.
5997 Abort(std::boxed::Box<crate::model::AbortInfo>),
5998 /// Display information of the final state "drop" and reason.
5999 Drop(std::boxed::Box<crate::model::DropInfo>),
6000 /// Display information of the load balancers. Deprecated in favor of the
6001 /// `load_balancer_backend_info` field, not used in new tests.
6002 #[deprecated]
6003 LoadBalancer(std::boxed::Box<crate::model::LoadBalancerInfo>),
6004 /// Display information of a Google Cloud network.
6005 Network(std::boxed::Box<crate::model::NetworkInfo>),
6006 /// Display information of a Google Kubernetes Engine cluster master.
6007 GkeMaster(std::boxed::Box<crate::model::GKEMasterInfo>),
6008 /// Display information of a Cloud SQL instance.
6009 CloudSqlInstance(std::boxed::Box<crate::model::CloudSQLInstanceInfo>),
6010 /// Display information of a Redis Instance.
6011 RedisInstance(std::boxed::Box<crate::model::RedisInstanceInfo>),
6012 /// Display information of a Redis Cluster.
6013 RedisCluster(std::boxed::Box<crate::model::RedisClusterInfo>),
6014 /// Display information of a Cloud Function.
6015 CloudFunction(std::boxed::Box<crate::model::CloudFunctionInfo>),
6016 /// Display information of an App Engine service version.
6017 AppEngineVersion(std::boxed::Box<crate::model::AppEngineVersionInfo>),
6018 /// Display information of a Cloud Run revision.
6019 CloudRunRevision(std::boxed::Box<crate::model::CloudRunRevisionInfo>),
6020 /// Display information of a NAT.
6021 Nat(std::boxed::Box<crate::model::NatInfo>),
6022 /// Display information of a ProxyConnection.
6023 ProxyConnection(std::boxed::Box<crate::model::ProxyConnectionInfo>),
6024 /// Display information of a specific load balancer backend.
6025 LoadBalancerBackendInfo(std::boxed::Box<crate::model::LoadBalancerBackendInfo>),
6026 /// Display information of a Storage Bucket. Used only for return traces.
6027 StorageBucket(std::boxed::Box<crate::model::StorageBucketInfo>),
6028 /// Display information of a Serverless network endpoint group backend. Used
6029 /// only for return traces.
6030 ServerlessNeg(std::boxed::Box<crate::model::ServerlessNegInfo>),
6031 }
6032}
6033
6034/// For display only. Metadata associated with a Compute Engine instance.
6035#[derive(Clone, Default, PartialEq)]
6036#[non_exhaustive]
6037pub struct InstanceInfo {
6038 /// Name of a Compute Engine instance.
6039 pub display_name: std::string::String,
6040
6041 /// URI of a Compute Engine instance.
6042 pub uri: std::string::String,
6043
6044 /// Name of the network interface of a Compute Engine instance.
6045 pub interface: std::string::String,
6046
6047 /// URI of a Compute Engine network.
6048 pub network_uri: std::string::String,
6049
6050 /// Internal IP address of the network interface.
6051 pub internal_ip: std::string::String,
6052
6053 /// External IP address of the network interface.
6054 pub external_ip: std::string::String,
6055
6056 /// Network tags configured on the instance.
6057 pub network_tags: std::vec::Vec<std::string::String>,
6058
6059 /// Service account authorized for the instance.
6060 #[deprecated]
6061 pub service_account: std::string::String,
6062
6063 /// URI of the PSC network attachment the NIC is attached to (if relevant).
6064 pub psc_network_attachment_uri: std::string::String,
6065
6066 /// Indicates whether the Compute Engine instance is running.
6067 /// Deprecated: use the `status` field instead.
6068 #[deprecated]
6069 pub running: bool,
6070
6071 /// The status of the instance.
6072 pub status: crate::model::instance_info::Status,
6073
6074 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6075}
6076
6077impl InstanceInfo {
6078 pub fn new() -> Self {
6079 std::default::Default::default()
6080 }
6081
6082 /// Sets the value of [display_name][crate::model::InstanceInfo::display_name].
6083 ///
6084 /// # Example
6085 /// ```ignore,no_run
6086 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6087 /// let x = InstanceInfo::new().set_display_name("example");
6088 /// ```
6089 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6090 self.display_name = v.into();
6091 self
6092 }
6093
6094 /// Sets the value of [uri][crate::model::InstanceInfo::uri].
6095 ///
6096 /// # Example
6097 /// ```ignore,no_run
6098 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6099 /// let x = InstanceInfo::new().set_uri("example");
6100 /// ```
6101 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6102 self.uri = v.into();
6103 self
6104 }
6105
6106 /// Sets the value of [interface][crate::model::InstanceInfo::interface].
6107 ///
6108 /// # Example
6109 /// ```ignore,no_run
6110 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6111 /// let x = InstanceInfo::new().set_interface("example");
6112 /// ```
6113 pub fn set_interface<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6114 self.interface = v.into();
6115 self
6116 }
6117
6118 /// Sets the value of [network_uri][crate::model::InstanceInfo::network_uri].
6119 ///
6120 /// # Example
6121 /// ```ignore,no_run
6122 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6123 /// let x = InstanceInfo::new().set_network_uri("example");
6124 /// ```
6125 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6126 self.network_uri = v.into();
6127 self
6128 }
6129
6130 /// Sets the value of [internal_ip][crate::model::InstanceInfo::internal_ip].
6131 ///
6132 /// # Example
6133 /// ```ignore,no_run
6134 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6135 /// let x = InstanceInfo::new().set_internal_ip("example");
6136 /// ```
6137 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6138 self.internal_ip = v.into();
6139 self
6140 }
6141
6142 /// Sets the value of [external_ip][crate::model::InstanceInfo::external_ip].
6143 ///
6144 /// # Example
6145 /// ```ignore,no_run
6146 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6147 /// let x = InstanceInfo::new().set_external_ip("example");
6148 /// ```
6149 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6150 self.external_ip = v.into();
6151 self
6152 }
6153
6154 /// Sets the value of [network_tags][crate::model::InstanceInfo::network_tags].
6155 ///
6156 /// # Example
6157 /// ```ignore,no_run
6158 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6159 /// let x = InstanceInfo::new().set_network_tags(["a", "b", "c"]);
6160 /// ```
6161 pub fn set_network_tags<T, V>(mut self, v: T) -> Self
6162 where
6163 T: std::iter::IntoIterator<Item = V>,
6164 V: std::convert::Into<std::string::String>,
6165 {
6166 use std::iter::Iterator;
6167 self.network_tags = v.into_iter().map(|i| i.into()).collect();
6168 self
6169 }
6170
6171 /// Sets the value of [service_account][crate::model::InstanceInfo::service_account].
6172 ///
6173 /// # Example
6174 /// ```ignore,no_run
6175 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6176 /// let x = InstanceInfo::new().set_service_account("example");
6177 /// ```
6178 #[deprecated]
6179 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6180 self.service_account = v.into();
6181 self
6182 }
6183
6184 /// Sets the value of [psc_network_attachment_uri][crate::model::InstanceInfo::psc_network_attachment_uri].
6185 ///
6186 /// # Example
6187 /// ```ignore,no_run
6188 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6189 /// let x = InstanceInfo::new().set_psc_network_attachment_uri("example");
6190 /// ```
6191 pub fn set_psc_network_attachment_uri<T: std::convert::Into<std::string::String>>(
6192 mut self,
6193 v: T,
6194 ) -> Self {
6195 self.psc_network_attachment_uri = v.into();
6196 self
6197 }
6198
6199 /// Sets the value of [running][crate::model::InstanceInfo::running].
6200 ///
6201 /// # Example
6202 /// ```ignore,no_run
6203 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6204 /// let x = InstanceInfo::new().set_running(true);
6205 /// ```
6206 #[deprecated]
6207 pub fn set_running<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6208 self.running = v.into();
6209 self
6210 }
6211
6212 /// Sets the value of [status][crate::model::InstanceInfo::status].
6213 ///
6214 /// # Example
6215 /// ```ignore,no_run
6216 /// # use google_cloud_networkmanagement_v1::model::InstanceInfo;
6217 /// use google_cloud_networkmanagement_v1::model::instance_info::Status;
6218 /// let x0 = InstanceInfo::new().set_status(Status::Running);
6219 /// let x1 = InstanceInfo::new().set_status(Status::NotRunning);
6220 /// ```
6221 pub fn set_status<T: std::convert::Into<crate::model::instance_info::Status>>(
6222 mut self,
6223 v: T,
6224 ) -> Self {
6225 self.status = v.into();
6226 self
6227 }
6228}
6229
6230impl wkt::message::Message for InstanceInfo {
6231 fn typename() -> &'static str {
6232 "type.googleapis.com/google.cloud.networkmanagement.v1.InstanceInfo"
6233 }
6234}
6235
6236/// Defines additional types related to [InstanceInfo].
6237pub mod instance_info {
6238 #[allow(unused_imports)]
6239 use super::*;
6240
6241 /// The status of the instance. We treat all states other than "RUNNING" as
6242 /// not running.
6243 ///
6244 /// # Working with unknown values
6245 ///
6246 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6247 /// additional enum variants at any time. Adding new variants is not considered
6248 /// a breaking change. Applications should write their code in anticipation of:
6249 ///
6250 /// - New values appearing in future releases of the client library, **and**
6251 /// - New values received dynamically, without application changes.
6252 ///
6253 /// Please consult the [Working with enums] section in the user guide for some
6254 /// guidelines.
6255 ///
6256 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6257 #[derive(Clone, Debug, PartialEq)]
6258 #[non_exhaustive]
6259 pub enum Status {
6260 /// Default unspecified value.
6261 Unspecified,
6262 /// The instance is running.
6263 Running,
6264 /// The instance has any status other than "RUNNING".
6265 NotRunning,
6266 /// If set, the enum was initialized with an unknown value.
6267 ///
6268 /// Applications can examine the value using [Status::value] or
6269 /// [Status::name].
6270 UnknownValue(status::UnknownValue),
6271 }
6272
6273 #[doc(hidden)]
6274 pub mod status {
6275 #[allow(unused_imports)]
6276 use super::*;
6277 #[derive(Clone, Debug, PartialEq)]
6278 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6279 }
6280
6281 impl Status {
6282 /// Gets the enum value.
6283 ///
6284 /// Returns `None` if the enum contains an unknown value deserialized from
6285 /// the string representation of enums.
6286 pub fn value(&self) -> std::option::Option<i32> {
6287 match self {
6288 Self::Unspecified => std::option::Option::Some(0),
6289 Self::Running => std::option::Option::Some(1),
6290 Self::NotRunning => std::option::Option::Some(2),
6291 Self::UnknownValue(u) => u.0.value(),
6292 }
6293 }
6294
6295 /// Gets the enum value as a string.
6296 ///
6297 /// Returns `None` if the enum contains an unknown value deserialized from
6298 /// the integer representation of enums.
6299 pub fn name(&self) -> std::option::Option<&str> {
6300 match self {
6301 Self::Unspecified => std::option::Option::Some("STATUS_UNSPECIFIED"),
6302 Self::Running => std::option::Option::Some("RUNNING"),
6303 Self::NotRunning => std::option::Option::Some("NOT_RUNNING"),
6304 Self::UnknownValue(u) => u.0.name(),
6305 }
6306 }
6307 }
6308
6309 impl std::default::Default for Status {
6310 fn default() -> Self {
6311 use std::convert::From;
6312 Self::from(0)
6313 }
6314 }
6315
6316 impl std::fmt::Display for Status {
6317 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6318 wkt::internal::display_enum(f, self.name(), self.value())
6319 }
6320 }
6321
6322 impl std::convert::From<i32> for Status {
6323 fn from(value: i32) -> Self {
6324 match value {
6325 0 => Self::Unspecified,
6326 1 => Self::Running,
6327 2 => Self::NotRunning,
6328 _ => Self::UnknownValue(status::UnknownValue(
6329 wkt::internal::UnknownEnumValue::Integer(value),
6330 )),
6331 }
6332 }
6333 }
6334
6335 impl std::convert::From<&str> for Status {
6336 fn from(value: &str) -> Self {
6337 use std::string::ToString;
6338 match value {
6339 "STATUS_UNSPECIFIED" => Self::Unspecified,
6340 "RUNNING" => Self::Running,
6341 "NOT_RUNNING" => Self::NotRunning,
6342 _ => Self::UnknownValue(status::UnknownValue(
6343 wkt::internal::UnknownEnumValue::String(value.to_string()),
6344 )),
6345 }
6346 }
6347 }
6348
6349 impl serde::ser::Serialize for Status {
6350 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6351 where
6352 S: serde::Serializer,
6353 {
6354 match self {
6355 Self::Unspecified => serializer.serialize_i32(0),
6356 Self::Running => serializer.serialize_i32(1),
6357 Self::NotRunning => serializer.serialize_i32(2),
6358 Self::UnknownValue(u) => u.0.serialize(serializer),
6359 }
6360 }
6361 }
6362
6363 impl<'de> serde::de::Deserialize<'de> for Status {
6364 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6365 where
6366 D: serde::Deserializer<'de>,
6367 {
6368 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Status>::new(
6369 ".google.cloud.networkmanagement.v1.InstanceInfo.Status",
6370 ))
6371 }
6372 }
6373}
6374
6375/// For display only. Metadata associated with a Compute Engine network.
6376#[derive(Clone, Default, PartialEq)]
6377#[non_exhaustive]
6378pub struct NetworkInfo {
6379 /// Name of a Compute Engine network.
6380 pub display_name: std::string::String,
6381
6382 /// URI of a Compute Engine network.
6383 pub uri: std::string::String,
6384
6385 /// URI of the subnet matching the source IP address of the test.
6386 pub matched_subnet_uri: std::string::String,
6387
6388 /// The IP range of the subnet matching the source IP address of the test.
6389 pub matched_ip_range: std::string::String,
6390
6391 /// The region of the subnet matching the source IP address of the test.
6392 pub region: std::string::String,
6393
6394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6395}
6396
6397impl NetworkInfo {
6398 pub fn new() -> Self {
6399 std::default::Default::default()
6400 }
6401
6402 /// Sets the value of [display_name][crate::model::NetworkInfo::display_name].
6403 ///
6404 /// # Example
6405 /// ```ignore,no_run
6406 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
6407 /// let x = NetworkInfo::new().set_display_name("example");
6408 /// ```
6409 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6410 self.display_name = v.into();
6411 self
6412 }
6413
6414 /// Sets the value of [uri][crate::model::NetworkInfo::uri].
6415 ///
6416 /// # Example
6417 /// ```ignore,no_run
6418 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
6419 /// let x = NetworkInfo::new().set_uri("example");
6420 /// ```
6421 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6422 self.uri = v.into();
6423 self
6424 }
6425
6426 /// Sets the value of [matched_subnet_uri][crate::model::NetworkInfo::matched_subnet_uri].
6427 ///
6428 /// # Example
6429 /// ```ignore,no_run
6430 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
6431 /// let x = NetworkInfo::new().set_matched_subnet_uri("example");
6432 /// ```
6433 pub fn set_matched_subnet_uri<T: std::convert::Into<std::string::String>>(
6434 mut self,
6435 v: T,
6436 ) -> Self {
6437 self.matched_subnet_uri = v.into();
6438 self
6439 }
6440
6441 /// Sets the value of [matched_ip_range][crate::model::NetworkInfo::matched_ip_range].
6442 ///
6443 /// # Example
6444 /// ```ignore,no_run
6445 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
6446 /// let x = NetworkInfo::new().set_matched_ip_range("example");
6447 /// ```
6448 pub fn set_matched_ip_range<T: std::convert::Into<std::string::String>>(
6449 mut self,
6450 v: T,
6451 ) -> Self {
6452 self.matched_ip_range = v.into();
6453 self
6454 }
6455
6456 /// Sets the value of [region][crate::model::NetworkInfo::region].
6457 ///
6458 /// # Example
6459 /// ```ignore,no_run
6460 /// # use google_cloud_networkmanagement_v1::model::NetworkInfo;
6461 /// let x = NetworkInfo::new().set_region("example");
6462 /// ```
6463 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6464 self.region = v.into();
6465 self
6466 }
6467}
6468
6469impl wkt::message::Message for NetworkInfo {
6470 fn typename() -> &'static str {
6471 "type.googleapis.com/google.cloud.networkmanagement.v1.NetworkInfo"
6472 }
6473}
6474
6475/// For display only. Metadata associated with a VPC firewall rule, an implied
6476/// VPC firewall rule, or a firewall policy rule.
6477#[derive(Clone, Default, PartialEq)]
6478#[non_exhaustive]
6479pub struct FirewallInfo {
6480 /// The display name of the firewall rule. This field might be empty for
6481 /// firewall policy rules.
6482 pub display_name: std::string::String,
6483
6484 /// The URI of the firewall rule. This field is not applicable to implied
6485 /// VPC firewall rules.
6486 pub uri: std::string::String,
6487
6488 /// Possible values: INGRESS, EGRESS
6489 pub direction: std::string::String,
6490
6491 /// Possible values: ALLOW, DENY, APPLY_SECURITY_PROFILE_GROUP
6492 pub action: std::string::String,
6493
6494 /// The priority of the firewall rule.
6495 pub priority: i32,
6496
6497 /// The URI of the VPC network that the firewall rule is associated with.
6498 /// This field is not applicable to hierarchical firewall policy rules.
6499 pub network_uri: std::string::String,
6500
6501 /// The target tags defined by the VPC firewall rule. This field is not
6502 /// applicable to firewall policy rules.
6503 pub target_tags: std::vec::Vec<std::string::String>,
6504
6505 /// The target service accounts specified by the firewall rule.
6506 pub target_service_accounts: std::vec::Vec<std::string::String>,
6507
6508 /// The name of the firewall policy that this rule is associated with.
6509 /// This field is not applicable to VPC firewall rules and implied VPC firewall
6510 /// rules.
6511 pub policy: std::string::String,
6512
6513 /// The URI of the firewall policy that this rule is associated with.
6514 /// This field is not applicable to VPC firewall rules and implied VPC firewall
6515 /// rules.
6516 pub policy_uri: std::string::String,
6517
6518 /// The firewall rule's type.
6519 pub firewall_rule_type: crate::model::firewall_info::FirewallRuleType,
6520
6521 /// The priority of the firewall policy that this rule is associated with.
6522 /// This field is not applicable to VPC firewall rules and implied VPC firewall
6523 /// rules.
6524 pub policy_priority: i32,
6525
6526 /// Target type of the firewall rule.
6527 pub target_type: crate::model::firewall_info::TargetType,
6528
6529 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6530}
6531
6532impl FirewallInfo {
6533 pub fn new() -> Self {
6534 std::default::Default::default()
6535 }
6536
6537 /// Sets the value of [display_name][crate::model::FirewallInfo::display_name].
6538 ///
6539 /// # Example
6540 /// ```ignore,no_run
6541 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6542 /// let x = FirewallInfo::new().set_display_name("example");
6543 /// ```
6544 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6545 self.display_name = v.into();
6546 self
6547 }
6548
6549 /// Sets the value of [uri][crate::model::FirewallInfo::uri].
6550 ///
6551 /// # Example
6552 /// ```ignore,no_run
6553 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6554 /// let x = FirewallInfo::new().set_uri("example");
6555 /// ```
6556 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6557 self.uri = v.into();
6558 self
6559 }
6560
6561 /// Sets the value of [direction][crate::model::FirewallInfo::direction].
6562 ///
6563 /// # Example
6564 /// ```ignore,no_run
6565 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6566 /// let x = FirewallInfo::new().set_direction("example");
6567 /// ```
6568 pub fn set_direction<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6569 self.direction = v.into();
6570 self
6571 }
6572
6573 /// Sets the value of [action][crate::model::FirewallInfo::action].
6574 ///
6575 /// # Example
6576 /// ```ignore,no_run
6577 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6578 /// let x = FirewallInfo::new().set_action("example");
6579 /// ```
6580 pub fn set_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6581 self.action = v.into();
6582 self
6583 }
6584
6585 /// Sets the value of [priority][crate::model::FirewallInfo::priority].
6586 ///
6587 /// # Example
6588 /// ```ignore,no_run
6589 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6590 /// let x = FirewallInfo::new().set_priority(42);
6591 /// ```
6592 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6593 self.priority = v.into();
6594 self
6595 }
6596
6597 /// Sets the value of [network_uri][crate::model::FirewallInfo::network_uri].
6598 ///
6599 /// # Example
6600 /// ```ignore,no_run
6601 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6602 /// let x = FirewallInfo::new().set_network_uri("example");
6603 /// ```
6604 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6605 self.network_uri = v.into();
6606 self
6607 }
6608
6609 /// Sets the value of [target_tags][crate::model::FirewallInfo::target_tags].
6610 ///
6611 /// # Example
6612 /// ```ignore,no_run
6613 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6614 /// let x = FirewallInfo::new().set_target_tags(["a", "b", "c"]);
6615 /// ```
6616 pub fn set_target_tags<T, V>(mut self, v: T) -> Self
6617 where
6618 T: std::iter::IntoIterator<Item = V>,
6619 V: std::convert::Into<std::string::String>,
6620 {
6621 use std::iter::Iterator;
6622 self.target_tags = v.into_iter().map(|i| i.into()).collect();
6623 self
6624 }
6625
6626 /// Sets the value of [target_service_accounts][crate::model::FirewallInfo::target_service_accounts].
6627 ///
6628 /// # Example
6629 /// ```ignore,no_run
6630 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6631 /// let x = FirewallInfo::new().set_target_service_accounts(["a", "b", "c"]);
6632 /// ```
6633 pub fn set_target_service_accounts<T, V>(mut self, v: T) -> Self
6634 where
6635 T: std::iter::IntoIterator<Item = V>,
6636 V: std::convert::Into<std::string::String>,
6637 {
6638 use std::iter::Iterator;
6639 self.target_service_accounts = v.into_iter().map(|i| i.into()).collect();
6640 self
6641 }
6642
6643 /// Sets the value of [policy][crate::model::FirewallInfo::policy].
6644 ///
6645 /// # Example
6646 /// ```ignore,no_run
6647 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6648 /// let x = FirewallInfo::new().set_policy("example");
6649 /// ```
6650 pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6651 self.policy = v.into();
6652 self
6653 }
6654
6655 /// Sets the value of [policy_uri][crate::model::FirewallInfo::policy_uri].
6656 ///
6657 /// # Example
6658 /// ```ignore,no_run
6659 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6660 /// let x = FirewallInfo::new().set_policy_uri("example");
6661 /// ```
6662 pub fn set_policy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6663 self.policy_uri = v.into();
6664 self
6665 }
6666
6667 /// Sets the value of [firewall_rule_type][crate::model::FirewallInfo::firewall_rule_type].
6668 ///
6669 /// # Example
6670 /// ```ignore,no_run
6671 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6672 /// use google_cloud_networkmanagement_v1::model::firewall_info::FirewallRuleType;
6673 /// let x0 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::HierarchicalFirewallPolicyRule);
6674 /// let x1 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::VpcFirewallRule);
6675 /// let x2 = FirewallInfo::new().set_firewall_rule_type(FirewallRuleType::ImpliedVpcFirewallRule);
6676 /// ```
6677 pub fn set_firewall_rule_type<
6678 T: std::convert::Into<crate::model::firewall_info::FirewallRuleType>,
6679 >(
6680 mut self,
6681 v: T,
6682 ) -> Self {
6683 self.firewall_rule_type = v.into();
6684 self
6685 }
6686
6687 /// Sets the value of [policy_priority][crate::model::FirewallInfo::policy_priority].
6688 ///
6689 /// # Example
6690 /// ```ignore,no_run
6691 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6692 /// let x = FirewallInfo::new().set_policy_priority(42);
6693 /// ```
6694 pub fn set_policy_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6695 self.policy_priority = v.into();
6696 self
6697 }
6698
6699 /// Sets the value of [target_type][crate::model::FirewallInfo::target_type].
6700 ///
6701 /// # Example
6702 /// ```ignore,no_run
6703 /// # use google_cloud_networkmanagement_v1::model::FirewallInfo;
6704 /// use google_cloud_networkmanagement_v1::model::firewall_info::TargetType;
6705 /// let x0 = FirewallInfo::new().set_target_type(TargetType::Instances);
6706 /// let x1 = FirewallInfo::new().set_target_type(TargetType::InternalManagedLb);
6707 /// ```
6708 pub fn set_target_type<T: std::convert::Into<crate::model::firewall_info::TargetType>>(
6709 mut self,
6710 v: T,
6711 ) -> Self {
6712 self.target_type = v.into();
6713 self
6714 }
6715}
6716
6717impl wkt::message::Message for FirewallInfo {
6718 fn typename() -> &'static str {
6719 "type.googleapis.com/google.cloud.networkmanagement.v1.FirewallInfo"
6720 }
6721}
6722
6723/// Defines additional types related to [FirewallInfo].
6724pub mod firewall_info {
6725 #[allow(unused_imports)]
6726 use super::*;
6727
6728 /// The firewall rule's type.
6729 ///
6730 /// # Working with unknown values
6731 ///
6732 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6733 /// additional enum variants at any time. Adding new variants is not considered
6734 /// a breaking change. Applications should write their code in anticipation of:
6735 ///
6736 /// - New values appearing in future releases of the client library, **and**
6737 /// - New values received dynamically, without application changes.
6738 ///
6739 /// Please consult the [Working with enums] section in the user guide for some
6740 /// guidelines.
6741 ///
6742 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6743 #[derive(Clone, Debug, PartialEq)]
6744 #[non_exhaustive]
6745 pub enum FirewallRuleType {
6746 /// Unspecified type.
6747 Unspecified,
6748 /// Hierarchical firewall policy rule. For details, see
6749 /// [Hierarchical firewall policies
6750 /// overview](https://cloud.google.com/vpc/docs/firewall-policies).
6751 HierarchicalFirewallPolicyRule,
6752 /// VPC firewall rule. For details, see
6753 /// [VPC firewall rules
6754 /// overview](https://cloud.google.com/vpc/docs/firewalls).
6755 VpcFirewallRule,
6756 /// Implied VPC firewall rule. For details, see
6757 /// [Implied
6758 /// rules](https://cloud.google.com/vpc/docs/firewalls#default_firewall_rules).
6759 ImpliedVpcFirewallRule,
6760 /// Implicit firewall rules that are managed by serverless VPC access to
6761 /// allow ingress access. They are not visible in the Google Cloud console.
6762 /// For details, see [VPC connector's implicit
6763 /// rules](https://cloud.google.com/functions/docs/networking/connecting-vpc#restrict-access).
6764 ServerlessVpcAccessManagedFirewallRule,
6765 /// Global network firewall policy rule.
6766 /// For details, see [Network firewall
6767 /// policies](https://cloud.google.com/vpc/docs/network-firewall-policies).
6768 NetworkFirewallPolicyRule,
6769 /// Regional network firewall policy rule.
6770 /// For details, see [Regional network firewall
6771 /// policies](https://cloud.google.com/firewall/docs/regional-firewall-policies).
6772 NetworkRegionalFirewallPolicyRule,
6773 /// Firewall policy rule containing attributes not yet supported in
6774 /// Connectivity tests. Firewall analysis is skipped if such a rule can
6775 /// potentially be matched. Please see the [list of unsupported
6776 /// configurations](https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/concepts/overview#unsupported-configs).
6777 UnsupportedFirewallPolicyRule,
6778 /// Tracking state for response traffic created when request traffic goes
6779 /// through allow firewall rule.
6780 /// For details, see [firewall rules
6781 /// specifications](https://cloud.google.com/firewall/docs/firewalls#specifications)
6782 TrackingState,
6783 /// Firewall analysis was skipped due to executing Connectivity Test in the
6784 /// BypassFirewallChecks mode
6785 AnalysisSkipped,
6786 /// If set, the enum was initialized with an unknown value.
6787 ///
6788 /// Applications can examine the value using [FirewallRuleType::value] or
6789 /// [FirewallRuleType::name].
6790 UnknownValue(firewall_rule_type::UnknownValue),
6791 }
6792
6793 #[doc(hidden)]
6794 pub mod firewall_rule_type {
6795 #[allow(unused_imports)]
6796 use super::*;
6797 #[derive(Clone, Debug, PartialEq)]
6798 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6799 }
6800
6801 impl FirewallRuleType {
6802 /// Gets the enum value.
6803 ///
6804 /// Returns `None` if the enum contains an unknown value deserialized from
6805 /// the string representation of enums.
6806 pub fn value(&self) -> std::option::Option<i32> {
6807 match self {
6808 Self::Unspecified => std::option::Option::Some(0),
6809 Self::HierarchicalFirewallPolicyRule => std::option::Option::Some(1),
6810 Self::VpcFirewallRule => std::option::Option::Some(2),
6811 Self::ImpliedVpcFirewallRule => std::option::Option::Some(3),
6812 Self::ServerlessVpcAccessManagedFirewallRule => std::option::Option::Some(4),
6813 Self::NetworkFirewallPolicyRule => std::option::Option::Some(5),
6814 Self::NetworkRegionalFirewallPolicyRule => std::option::Option::Some(6),
6815 Self::UnsupportedFirewallPolicyRule => std::option::Option::Some(100),
6816 Self::TrackingState => std::option::Option::Some(101),
6817 Self::AnalysisSkipped => std::option::Option::Some(102),
6818 Self::UnknownValue(u) => u.0.value(),
6819 }
6820 }
6821
6822 /// Gets the enum value as a string.
6823 ///
6824 /// Returns `None` if the enum contains an unknown value deserialized from
6825 /// the integer representation of enums.
6826 pub fn name(&self) -> std::option::Option<&str> {
6827 match self {
6828 Self::Unspecified => std::option::Option::Some("FIREWALL_RULE_TYPE_UNSPECIFIED"),
6829 Self::HierarchicalFirewallPolicyRule => {
6830 std::option::Option::Some("HIERARCHICAL_FIREWALL_POLICY_RULE")
6831 }
6832 Self::VpcFirewallRule => std::option::Option::Some("VPC_FIREWALL_RULE"),
6833 Self::ImpliedVpcFirewallRule => {
6834 std::option::Option::Some("IMPLIED_VPC_FIREWALL_RULE")
6835 }
6836 Self::ServerlessVpcAccessManagedFirewallRule => {
6837 std::option::Option::Some("SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE")
6838 }
6839 Self::NetworkFirewallPolicyRule => {
6840 std::option::Option::Some("NETWORK_FIREWALL_POLICY_RULE")
6841 }
6842 Self::NetworkRegionalFirewallPolicyRule => {
6843 std::option::Option::Some("NETWORK_REGIONAL_FIREWALL_POLICY_RULE")
6844 }
6845 Self::UnsupportedFirewallPolicyRule => {
6846 std::option::Option::Some("UNSUPPORTED_FIREWALL_POLICY_RULE")
6847 }
6848 Self::TrackingState => std::option::Option::Some("TRACKING_STATE"),
6849 Self::AnalysisSkipped => std::option::Option::Some("ANALYSIS_SKIPPED"),
6850 Self::UnknownValue(u) => u.0.name(),
6851 }
6852 }
6853 }
6854
6855 impl std::default::Default for FirewallRuleType {
6856 fn default() -> Self {
6857 use std::convert::From;
6858 Self::from(0)
6859 }
6860 }
6861
6862 impl std::fmt::Display for FirewallRuleType {
6863 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6864 wkt::internal::display_enum(f, self.name(), self.value())
6865 }
6866 }
6867
6868 impl std::convert::From<i32> for FirewallRuleType {
6869 fn from(value: i32) -> Self {
6870 match value {
6871 0 => Self::Unspecified,
6872 1 => Self::HierarchicalFirewallPolicyRule,
6873 2 => Self::VpcFirewallRule,
6874 3 => Self::ImpliedVpcFirewallRule,
6875 4 => Self::ServerlessVpcAccessManagedFirewallRule,
6876 5 => Self::NetworkFirewallPolicyRule,
6877 6 => Self::NetworkRegionalFirewallPolicyRule,
6878 100 => Self::UnsupportedFirewallPolicyRule,
6879 101 => Self::TrackingState,
6880 102 => Self::AnalysisSkipped,
6881 _ => Self::UnknownValue(firewall_rule_type::UnknownValue(
6882 wkt::internal::UnknownEnumValue::Integer(value),
6883 )),
6884 }
6885 }
6886 }
6887
6888 impl std::convert::From<&str> for FirewallRuleType {
6889 fn from(value: &str) -> Self {
6890 use std::string::ToString;
6891 match value {
6892 "FIREWALL_RULE_TYPE_UNSPECIFIED" => Self::Unspecified,
6893 "HIERARCHICAL_FIREWALL_POLICY_RULE" => Self::HierarchicalFirewallPolicyRule,
6894 "VPC_FIREWALL_RULE" => Self::VpcFirewallRule,
6895 "IMPLIED_VPC_FIREWALL_RULE" => Self::ImpliedVpcFirewallRule,
6896 "SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE" => {
6897 Self::ServerlessVpcAccessManagedFirewallRule
6898 }
6899 "NETWORK_FIREWALL_POLICY_RULE" => Self::NetworkFirewallPolicyRule,
6900 "NETWORK_REGIONAL_FIREWALL_POLICY_RULE" => Self::NetworkRegionalFirewallPolicyRule,
6901 "UNSUPPORTED_FIREWALL_POLICY_RULE" => Self::UnsupportedFirewallPolicyRule,
6902 "TRACKING_STATE" => Self::TrackingState,
6903 "ANALYSIS_SKIPPED" => Self::AnalysisSkipped,
6904 _ => Self::UnknownValue(firewall_rule_type::UnknownValue(
6905 wkt::internal::UnknownEnumValue::String(value.to_string()),
6906 )),
6907 }
6908 }
6909 }
6910
6911 impl serde::ser::Serialize for FirewallRuleType {
6912 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6913 where
6914 S: serde::Serializer,
6915 {
6916 match self {
6917 Self::Unspecified => serializer.serialize_i32(0),
6918 Self::HierarchicalFirewallPolicyRule => serializer.serialize_i32(1),
6919 Self::VpcFirewallRule => serializer.serialize_i32(2),
6920 Self::ImpliedVpcFirewallRule => serializer.serialize_i32(3),
6921 Self::ServerlessVpcAccessManagedFirewallRule => serializer.serialize_i32(4),
6922 Self::NetworkFirewallPolicyRule => serializer.serialize_i32(5),
6923 Self::NetworkRegionalFirewallPolicyRule => serializer.serialize_i32(6),
6924 Self::UnsupportedFirewallPolicyRule => serializer.serialize_i32(100),
6925 Self::TrackingState => serializer.serialize_i32(101),
6926 Self::AnalysisSkipped => serializer.serialize_i32(102),
6927 Self::UnknownValue(u) => u.0.serialize(serializer),
6928 }
6929 }
6930 }
6931
6932 impl<'de> serde::de::Deserialize<'de> for FirewallRuleType {
6933 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6934 where
6935 D: serde::Deserializer<'de>,
6936 {
6937 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FirewallRuleType>::new(
6938 ".google.cloud.networkmanagement.v1.FirewallInfo.FirewallRuleType",
6939 ))
6940 }
6941 }
6942
6943 /// Target type of the firewall rule.
6944 ///
6945 /// # Working with unknown values
6946 ///
6947 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6948 /// additional enum variants at any time. Adding new variants is not considered
6949 /// a breaking change. Applications should write their code in anticipation of:
6950 ///
6951 /// - New values appearing in future releases of the client library, **and**
6952 /// - New values received dynamically, without application changes.
6953 ///
6954 /// Please consult the [Working with enums] section in the user guide for some
6955 /// guidelines.
6956 ///
6957 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6958 #[derive(Clone, Debug, PartialEq)]
6959 #[non_exhaustive]
6960 pub enum TargetType {
6961 /// Target type is not specified. In this case we treat the rule as applying
6962 /// to INSTANCES target type.
6963 Unspecified,
6964 /// Firewall rule applies to instances.
6965 Instances,
6966 /// Firewall rule applies to internal managed load balancers.
6967 InternalManagedLb,
6968 /// If set, the enum was initialized with an unknown value.
6969 ///
6970 /// Applications can examine the value using [TargetType::value] or
6971 /// [TargetType::name].
6972 UnknownValue(target_type::UnknownValue),
6973 }
6974
6975 #[doc(hidden)]
6976 pub mod target_type {
6977 #[allow(unused_imports)]
6978 use super::*;
6979 #[derive(Clone, Debug, PartialEq)]
6980 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6981 }
6982
6983 impl TargetType {
6984 /// Gets the enum value.
6985 ///
6986 /// Returns `None` if the enum contains an unknown value deserialized from
6987 /// the string representation of enums.
6988 pub fn value(&self) -> std::option::Option<i32> {
6989 match self {
6990 Self::Unspecified => std::option::Option::Some(0),
6991 Self::Instances => std::option::Option::Some(1),
6992 Self::InternalManagedLb => std::option::Option::Some(2),
6993 Self::UnknownValue(u) => u.0.value(),
6994 }
6995 }
6996
6997 /// Gets the enum value as a string.
6998 ///
6999 /// Returns `None` if the enum contains an unknown value deserialized from
7000 /// the integer representation of enums.
7001 pub fn name(&self) -> std::option::Option<&str> {
7002 match self {
7003 Self::Unspecified => std::option::Option::Some("TARGET_TYPE_UNSPECIFIED"),
7004 Self::Instances => std::option::Option::Some("INSTANCES"),
7005 Self::InternalManagedLb => std::option::Option::Some("INTERNAL_MANAGED_LB"),
7006 Self::UnknownValue(u) => u.0.name(),
7007 }
7008 }
7009 }
7010
7011 impl std::default::Default for TargetType {
7012 fn default() -> Self {
7013 use std::convert::From;
7014 Self::from(0)
7015 }
7016 }
7017
7018 impl std::fmt::Display for TargetType {
7019 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7020 wkt::internal::display_enum(f, self.name(), self.value())
7021 }
7022 }
7023
7024 impl std::convert::From<i32> for TargetType {
7025 fn from(value: i32) -> Self {
7026 match value {
7027 0 => Self::Unspecified,
7028 1 => Self::Instances,
7029 2 => Self::InternalManagedLb,
7030 _ => Self::UnknownValue(target_type::UnknownValue(
7031 wkt::internal::UnknownEnumValue::Integer(value),
7032 )),
7033 }
7034 }
7035 }
7036
7037 impl std::convert::From<&str> for TargetType {
7038 fn from(value: &str) -> Self {
7039 use std::string::ToString;
7040 match value {
7041 "TARGET_TYPE_UNSPECIFIED" => Self::Unspecified,
7042 "INSTANCES" => Self::Instances,
7043 "INTERNAL_MANAGED_LB" => Self::InternalManagedLb,
7044 _ => Self::UnknownValue(target_type::UnknownValue(
7045 wkt::internal::UnknownEnumValue::String(value.to_string()),
7046 )),
7047 }
7048 }
7049 }
7050
7051 impl serde::ser::Serialize for TargetType {
7052 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7053 where
7054 S: serde::Serializer,
7055 {
7056 match self {
7057 Self::Unspecified => serializer.serialize_i32(0),
7058 Self::Instances => serializer.serialize_i32(1),
7059 Self::InternalManagedLb => serializer.serialize_i32(2),
7060 Self::UnknownValue(u) => u.0.serialize(serializer),
7061 }
7062 }
7063 }
7064
7065 impl<'de> serde::de::Deserialize<'de> for TargetType {
7066 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7067 where
7068 D: serde::Deserializer<'de>,
7069 {
7070 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetType>::new(
7071 ".google.cloud.networkmanagement.v1.FirewallInfo.TargetType",
7072 ))
7073 }
7074 }
7075}
7076
7077/// For display only. Metadata associated with a Compute Engine route.
7078#[derive(Clone, Default, PartialEq)]
7079#[non_exhaustive]
7080pub struct RouteInfo {
7081 /// Type of route.
7082 pub route_type: crate::model::route_info::RouteType,
7083
7084 /// Type of next hop.
7085 pub next_hop_type: crate::model::route_info::NextHopType,
7086
7087 /// Indicates where route is applicable. Deprecated, routes with NCC_HUB scope
7088 /// are not included in the trace in new tests.
7089 #[deprecated]
7090 pub route_scope: crate::model::route_info::RouteScope,
7091
7092 /// Name of a route.
7093 pub display_name: std::string::String,
7094
7095 /// URI of a route. SUBNET, STATIC, PEERING_SUBNET (only for peering network)
7096 /// and POLICY_BASED routes only.
7097 pub uri: std::string::String,
7098
7099 /// Region of the route. DYNAMIC, PEERING_DYNAMIC, POLICY_BASED and ADVERTISED
7100 /// routes only. If set for POLICY_BASED route, this is a region of VLAN
7101 /// attachments for Cloud Interconnect the route applies to.
7102 pub region: std::string::String,
7103
7104 /// Destination IP range of the route.
7105 pub dest_ip_range: std::string::String,
7106
7107 /// String type of the next hop of the route (for example, "VPN tunnel").
7108 /// Deprecated in favor of the next_hop_type and next_hop_uri fields, not used
7109 /// in new tests.
7110 #[deprecated]
7111 pub next_hop: std::string::String,
7112
7113 /// URI of a VPC network where route is located.
7114 pub network_uri: std::string::String,
7115
7116 /// Priority of the route.
7117 pub priority: i32,
7118
7119 /// Instance tags of the route.
7120 pub instance_tags: std::vec::Vec<std::string::String>,
7121
7122 /// Source IP address range of the route. POLICY_BASED routes only.
7123 pub src_ip_range: std::string::String,
7124
7125 /// Destination port ranges of the route. POLICY_BASED routes only.
7126 pub dest_port_ranges: std::vec::Vec<std::string::String>,
7127
7128 /// Source port ranges of the route. POLICY_BASED routes only.
7129 pub src_port_ranges: std::vec::Vec<std::string::String>,
7130
7131 /// Protocols of the route. POLICY_BASED routes only.
7132 pub protocols: std::vec::Vec<std::string::String>,
7133
7134 /// URI of the NCC Hub the route is advertised by. PEERING_SUBNET and
7135 /// PEERING_DYNAMIC routes that are advertised by NCC Hub only.
7136 pub ncc_hub_uri: std::option::Option<std::string::String>,
7137
7138 /// URI of the destination NCC Spoke. PEERING_SUBNET and PEERING_DYNAMIC routes
7139 /// that are advertised by NCC Hub only.
7140 pub ncc_spoke_uri: std::option::Option<std::string::String>,
7141
7142 /// For ADVERTISED dynamic routes, the URI of the Cloud Router that advertised
7143 /// the corresponding IP prefix.
7144 pub advertised_route_source_router_uri: std::option::Option<std::string::String>,
7145
7146 /// For ADVERTISED routes, the URI of their next hop, i.e. the URI of the
7147 /// hybrid endpoint (VPN tunnel, Interconnect attachment, NCC router appliance)
7148 /// the advertised prefix is advertised through, or URI of the source peered
7149 /// network. Deprecated in favor of the next_hop_uri field, not used in new
7150 /// tests.
7151 #[deprecated]
7152 pub advertised_route_next_hop_uri: std::option::Option<std::string::String>,
7153
7154 /// URI of the next hop resource.
7155 pub next_hop_uri: std::string::String,
7156
7157 /// URI of a VPC network where the next hop resource is located.
7158 pub next_hop_network_uri: std::string::String,
7159
7160 /// For PEERING_SUBNET and PEERING_STATIC routes, the URI of the originating
7161 /// SUBNET/STATIC route.
7162 pub originating_route_uri: std::string::String,
7163
7164 /// For PEERING_SUBNET, PEERING_STATIC and PEERING_DYNAMIC routes, the name of
7165 /// the originating SUBNET/STATIC/DYNAMIC route.
7166 pub originating_route_display_name: std::string::String,
7167
7168 /// For PEERING_SUBNET and PEERING_DYNAMIC routes that are advertised by NCC
7169 /// Hub, the URI of the corresponding route in NCC Hub's routing table.
7170 pub ncc_hub_route_uri: std::string::String,
7171
7172 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7173}
7174
7175impl RouteInfo {
7176 pub fn new() -> Self {
7177 std::default::Default::default()
7178 }
7179
7180 /// Sets the value of [route_type][crate::model::RouteInfo::route_type].
7181 ///
7182 /// # Example
7183 /// ```ignore,no_run
7184 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7185 /// use google_cloud_networkmanagement_v1::model::route_info::RouteType;
7186 /// let x0 = RouteInfo::new().set_route_type(RouteType::Subnet);
7187 /// let x1 = RouteInfo::new().set_route_type(RouteType::Static);
7188 /// let x2 = RouteInfo::new().set_route_type(RouteType::Dynamic);
7189 /// ```
7190 pub fn set_route_type<T: std::convert::Into<crate::model::route_info::RouteType>>(
7191 mut self,
7192 v: T,
7193 ) -> Self {
7194 self.route_type = v.into();
7195 self
7196 }
7197
7198 /// Sets the value of [next_hop_type][crate::model::RouteInfo::next_hop_type].
7199 ///
7200 /// # Example
7201 /// ```ignore,no_run
7202 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7203 /// use google_cloud_networkmanagement_v1::model::route_info::NextHopType;
7204 /// let x0 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopIp);
7205 /// let x1 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopInstance);
7206 /// let x2 = RouteInfo::new().set_next_hop_type(NextHopType::NextHopNetwork);
7207 /// ```
7208 pub fn set_next_hop_type<T: std::convert::Into<crate::model::route_info::NextHopType>>(
7209 mut self,
7210 v: T,
7211 ) -> Self {
7212 self.next_hop_type = v.into();
7213 self
7214 }
7215
7216 /// Sets the value of [route_scope][crate::model::RouteInfo::route_scope].
7217 ///
7218 /// # Example
7219 /// ```ignore,no_run
7220 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7221 /// use google_cloud_networkmanagement_v1::model::route_info::RouteScope;
7222 /// let x0 = RouteInfo::new().set_route_scope(RouteScope::Network);
7223 /// let x1 = RouteInfo::new().set_route_scope(RouteScope::NccHub);
7224 /// ```
7225 #[deprecated]
7226 pub fn set_route_scope<T: std::convert::Into<crate::model::route_info::RouteScope>>(
7227 mut self,
7228 v: T,
7229 ) -> Self {
7230 self.route_scope = v.into();
7231 self
7232 }
7233
7234 /// Sets the value of [display_name][crate::model::RouteInfo::display_name].
7235 ///
7236 /// # Example
7237 /// ```ignore,no_run
7238 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7239 /// let x = RouteInfo::new().set_display_name("example");
7240 /// ```
7241 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7242 self.display_name = v.into();
7243 self
7244 }
7245
7246 /// Sets the value of [uri][crate::model::RouteInfo::uri].
7247 ///
7248 /// # Example
7249 /// ```ignore,no_run
7250 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7251 /// let x = RouteInfo::new().set_uri("example");
7252 /// ```
7253 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7254 self.uri = v.into();
7255 self
7256 }
7257
7258 /// Sets the value of [region][crate::model::RouteInfo::region].
7259 ///
7260 /// # Example
7261 /// ```ignore,no_run
7262 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7263 /// let x = RouteInfo::new().set_region("example");
7264 /// ```
7265 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7266 self.region = v.into();
7267 self
7268 }
7269
7270 /// Sets the value of [dest_ip_range][crate::model::RouteInfo::dest_ip_range].
7271 ///
7272 /// # Example
7273 /// ```ignore,no_run
7274 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7275 /// let x = RouteInfo::new().set_dest_ip_range("example");
7276 /// ```
7277 pub fn set_dest_ip_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7278 self.dest_ip_range = v.into();
7279 self
7280 }
7281
7282 /// Sets the value of [next_hop][crate::model::RouteInfo::next_hop].
7283 ///
7284 /// # Example
7285 /// ```ignore,no_run
7286 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7287 /// let x = RouteInfo::new().set_next_hop("example");
7288 /// ```
7289 #[deprecated]
7290 pub fn set_next_hop<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7291 self.next_hop = v.into();
7292 self
7293 }
7294
7295 /// Sets the value of [network_uri][crate::model::RouteInfo::network_uri].
7296 ///
7297 /// # Example
7298 /// ```ignore,no_run
7299 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7300 /// let x = RouteInfo::new().set_network_uri("example");
7301 /// ```
7302 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7303 self.network_uri = v.into();
7304 self
7305 }
7306
7307 /// Sets the value of [priority][crate::model::RouteInfo::priority].
7308 ///
7309 /// # Example
7310 /// ```ignore,no_run
7311 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7312 /// let x = RouteInfo::new().set_priority(42);
7313 /// ```
7314 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7315 self.priority = v.into();
7316 self
7317 }
7318
7319 /// Sets the value of [instance_tags][crate::model::RouteInfo::instance_tags].
7320 ///
7321 /// # Example
7322 /// ```ignore,no_run
7323 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7324 /// let x = RouteInfo::new().set_instance_tags(["a", "b", "c"]);
7325 /// ```
7326 pub fn set_instance_tags<T, V>(mut self, v: T) -> Self
7327 where
7328 T: std::iter::IntoIterator<Item = V>,
7329 V: std::convert::Into<std::string::String>,
7330 {
7331 use std::iter::Iterator;
7332 self.instance_tags = v.into_iter().map(|i| i.into()).collect();
7333 self
7334 }
7335
7336 /// Sets the value of [src_ip_range][crate::model::RouteInfo::src_ip_range].
7337 ///
7338 /// # Example
7339 /// ```ignore,no_run
7340 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7341 /// let x = RouteInfo::new().set_src_ip_range("example");
7342 /// ```
7343 pub fn set_src_ip_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7344 self.src_ip_range = v.into();
7345 self
7346 }
7347
7348 /// Sets the value of [dest_port_ranges][crate::model::RouteInfo::dest_port_ranges].
7349 ///
7350 /// # Example
7351 /// ```ignore,no_run
7352 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7353 /// let x = RouteInfo::new().set_dest_port_ranges(["a", "b", "c"]);
7354 /// ```
7355 pub fn set_dest_port_ranges<T, V>(mut self, v: T) -> Self
7356 where
7357 T: std::iter::IntoIterator<Item = V>,
7358 V: std::convert::Into<std::string::String>,
7359 {
7360 use std::iter::Iterator;
7361 self.dest_port_ranges = v.into_iter().map(|i| i.into()).collect();
7362 self
7363 }
7364
7365 /// Sets the value of [src_port_ranges][crate::model::RouteInfo::src_port_ranges].
7366 ///
7367 /// # Example
7368 /// ```ignore,no_run
7369 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7370 /// let x = RouteInfo::new().set_src_port_ranges(["a", "b", "c"]);
7371 /// ```
7372 pub fn set_src_port_ranges<T, V>(mut self, v: T) -> Self
7373 where
7374 T: std::iter::IntoIterator<Item = V>,
7375 V: std::convert::Into<std::string::String>,
7376 {
7377 use std::iter::Iterator;
7378 self.src_port_ranges = v.into_iter().map(|i| i.into()).collect();
7379 self
7380 }
7381
7382 /// Sets the value of [protocols][crate::model::RouteInfo::protocols].
7383 ///
7384 /// # Example
7385 /// ```ignore,no_run
7386 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7387 /// let x = RouteInfo::new().set_protocols(["a", "b", "c"]);
7388 /// ```
7389 pub fn set_protocols<T, V>(mut self, v: T) -> Self
7390 where
7391 T: std::iter::IntoIterator<Item = V>,
7392 V: std::convert::Into<std::string::String>,
7393 {
7394 use std::iter::Iterator;
7395 self.protocols = v.into_iter().map(|i| i.into()).collect();
7396 self
7397 }
7398
7399 /// Sets the value of [ncc_hub_uri][crate::model::RouteInfo::ncc_hub_uri].
7400 ///
7401 /// # Example
7402 /// ```ignore,no_run
7403 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7404 /// let x = RouteInfo::new().set_ncc_hub_uri("example");
7405 /// ```
7406 pub fn set_ncc_hub_uri<T>(mut self, v: T) -> Self
7407 where
7408 T: std::convert::Into<std::string::String>,
7409 {
7410 self.ncc_hub_uri = std::option::Option::Some(v.into());
7411 self
7412 }
7413
7414 /// Sets or clears the value of [ncc_hub_uri][crate::model::RouteInfo::ncc_hub_uri].
7415 ///
7416 /// # Example
7417 /// ```ignore,no_run
7418 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7419 /// let x = RouteInfo::new().set_or_clear_ncc_hub_uri(Some("example"));
7420 /// let x = RouteInfo::new().set_or_clear_ncc_hub_uri(None::<String>);
7421 /// ```
7422 pub fn set_or_clear_ncc_hub_uri<T>(mut self, v: std::option::Option<T>) -> Self
7423 where
7424 T: std::convert::Into<std::string::String>,
7425 {
7426 self.ncc_hub_uri = v.map(|x| x.into());
7427 self
7428 }
7429
7430 /// Sets the value of [ncc_spoke_uri][crate::model::RouteInfo::ncc_spoke_uri].
7431 ///
7432 /// # Example
7433 /// ```ignore,no_run
7434 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7435 /// let x = RouteInfo::new().set_ncc_spoke_uri("example");
7436 /// ```
7437 pub fn set_ncc_spoke_uri<T>(mut self, v: T) -> Self
7438 where
7439 T: std::convert::Into<std::string::String>,
7440 {
7441 self.ncc_spoke_uri = std::option::Option::Some(v.into());
7442 self
7443 }
7444
7445 /// Sets or clears the value of [ncc_spoke_uri][crate::model::RouteInfo::ncc_spoke_uri].
7446 ///
7447 /// # Example
7448 /// ```ignore,no_run
7449 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7450 /// let x = RouteInfo::new().set_or_clear_ncc_spoke_uri(Some("example"));
7451 /// let x = RouteInfo::new().set_or_clear_ncc_spoke_uri(None::<String>);
7452 /// ```
7453 pub fn set_or_clear_ncc_spoke_uri<T>(mut self, v: std::option::Option<T>) -> Self
7454 where
7455 T: std::convert::Into<std::string::String>,
7456 {
7457 self.ncc_spoke_uri = v.map(|x| x.into());
7458 self
7459 }
7460
7461 /// Sets the value of [advertised_route_source_router_uri][crate::model::RouteInfo::advertised_route_source_router_uri].
7462 ///
7463 /// # Example
7464 /// ```ignore,no_run
7465 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7466 /// let x = RouteInfo::new().set_advertised_route_source_router_uri("example");
7467 /// ```
7468 pub fn set_advertised_route_source_router_uri<T>(mut self, v: T) -> Self
7469 where
7470 T: std::convert::Into<std::string::String>,
7471 {
7472 self.advertised_route_source_router_uri = std::option::Option::Some(v.into());
7473 self
7474 }
7475
7476 /// Sets or clears the value of [advertised_route_source_router_uri][crate::model::RouteInfo::advertised_route_source_router_uri].
7477 ///
7478 /// # Example
7479 /// ```ignore,no_run
7480 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7481 /// let x = RouteInfo::new().set_or_clear_advertised_route_source_router_uri(Some("example"));
7482 /// let x = RouteInfo::new().set_or_clear_advertised_route_source_router_uri(None::<String>);
7483 /// ```
7484 pub fn set_or_clear_advertised_route_source_router_uri<T>(
7485 mut self,
7486 v: std::option::Option<T>,
7487 ) -> Self
7488 where
7489 T: std::convert::Into<std::string::String>,
7490 {
7491 self.advertised_route_source_router_uri = v.map(|x| x.into());
7492 self
7493 }
7494
7495 /// Sets the value of [advertised_route_next_hop_uri][crate::model::RouteInfo::advertised_route_next_hop_uri].
7496 ///
7497 /// # Example
7498 /// ```ignore,no_run
7499 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7500 /// let x = RouteInfo::new().set_advertised_route_next_hop_uri("example");
7501 /// ```
7502 #[deprecated]
7503 pub fn set_advertised_route_next_hop_uri<T>(mut self, v: T) -> Self
7504 where
7505 T: std::convert::Into<std::string::String>,
7506 {
7507 self.advertised_route_next_hop_uri = std::option::Option::Some(v.into());
7508 self
7509 }
7510
7511 /// Sets or clears the value of [advertised_route_next_hop_uri][crate::model::RouteInfo::advertised_route_next_hop_uri].
7512 ///
7513 /// # Example
7514 /// ```ignore,no_run
7515 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7516 /// let x = RouteInfo::new().set_or_clear_advertised_route_next_hop_uri(Some("example"));
7517 /// let x = RouteInfo::new().set_or_clear_advertised_route_next_hop_uri(None::<String>);
7518 /// ```
7519 #[deprecated]
7520 pub fn set_or_clear_advertised_route_next_hop_uri<T>(
7521 mut self,
7522 v: std::option::Option<T>,
7523 ) -> Self
7524 where
7525 T: std::convert::Into<std::string::String>,
7526 {
7527 self.advertised_route_next_hop_uri = v.map(|x| x.into());
7528 self
7529 }
7530
7531 /// Sets the value of [next_hop_uri][crate::model::RouteInfo::next_hop_uri].
7532 ///
7533 /// # Example
7534 /// ```ignore,no_run
7535 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7536 /// let x = RouteInfo::new().set_next_hop_uri("example");
7537 /// ```
7538 pub fn set_next_hop_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7539 self.next_hop_uri = v.into();
7540 self
7541 }
7542
7543 /// Sets the value of [next_hop_network_uri][crate::model::RouteInfo::next_hop_network_uri].
7544 ///
7545 /// # Example
7546 /// ```ignore,no_run
7547 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7548 /// let x = RouteInfo::new().set_next_hop_network_uri("example");
7549 /// ```
7550 pub fn set_next_hop_network_uri<T: std::convert::Into<std::string::String>>(
7551 mut self,
7552 v: T,
7553 ) -> Self {
7554 self.next_hop_network_uri = v.into();
7555 self
7556 }
7557
7558 /// Sets the value of [originating_route_uri][crate::model::RouteInfo::originating_route_uri].
7559 ///
7560 /// # Example
7561 /// ```ignore,no_run
7562 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7563 /// let x = RouteInfo::new().set_originating_route_uri("example");
7564 /// ```
7565 pub fn set_originating_route_uri<T: std::convert::Into<std::string::String>>(
7566 mut self,
7567 v: T,
7568 ) -> Self {
7569 self.originating_route_uri = v.into();
7570 self
7571 }
7572
7573 /// Sets the value of [originating_route_display_name][crate::model::RouteInfo::originating_route_display_name].
7574 ///
7575 /// # Example
7576 /// ```ignore,no_run
7577 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7578 /// let x = RouteInfo::new().set_originating_route_display_name("example");
7579 /// ```
7580 pub fn set_originating_route_display_name<T: std::convert::Into<std::string::String>>(
7581 mut self,
7582 v: T,
7583 ) -> Self {
7584 self.originating_route_display_name = v.into();
7585 self
7586 }
7587
7588 /// Sets the value of [ncc_hub_route_uri][crate::model::RouteInfo::ncc_hub_route_uri].
7589 ///
7590 /// # Example
7591 /// ```ignore,no_run
7592 /// # use google_cloud_networkmanagement_v1::model::RouteInfo;
7593 /// let x = RouteInfo::new().set_ncc_hub_route_uri("example");
7594 /// ```
7595 pub fn set_ncc_hub_route_uri<T: std::convert::Into<std::string::String>>(
7596 mut self,
7597 v: T,
7598 ) -> Self {
7599 self.ncc_hub_route_uri = v.into();
7600 self
7601 }
7602}
7603
7604impl wkt::message::Message for RouteInfo {
7605 fn typename() -> &'static str {
7606 "type.googleapis.com/google.cloud.networkmanagement.v1.RouteInfo"
7607 }
7608}
7609
7610/// Defines additional types related to [RouteInfo].
7611pub mod route_info {
7612 #[allow(unused_imports)]
7613 use super::*;
7614
7615 /// Type of route:
7616 ///
7617 /// # Working with unknown values
7618 ///
7619 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7620 /// additional enum variants at any time. Adding new variants is not considered
7621 /// a breaking change. Applications should write their code in anticipation of:
7622 ///
7623 /// - New values appearing in future releases of the client library, **and**
7624 /// - New values received dynamically, without application changes.
7625 ///
7626 /// Please consult the [Working with enums] section in the user guide for some
7627 /// guidelines.
7628 ///
7629 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7630 #[derive(Clone, Debug, PartialEq)]
7631 #[non_exhaustive]
7632 pub enum RouteType {
7633 /// Unspecified type. Default value.
7634 Unspecified,
7635 /// Route is a subnet route automatically created by the system.
7636 Subnet,
7637 /// Static route created by the user, including the default route to the
7638 /// internet.
7639 Static,
7640 /// Dynamic route exchanged between BGP peers.
7641 Dynamic,
7642 /// A subnet route received from peering network or NCC Hub.
7643 PeeringSubnet,
7644 /// A static route received from peering network.
7645 PeeringStatic,
7646 /// A dynamic route received from peering network or NCC Hub.
7647 PeeringDynamic,
7648 /// Policy based route.
7649 PolicyBased,
7650 /// Advertised route. Synthetic route which is used to transition from the
7651 /// StartFromPrivateNetwork state in Connectivity tests.
7652 Advertised,
7653 /// If set, the enum was initialized with an unknown value.
7654 ///
7655 /// Applications can examine the value using [RouteType::value] or
7656 /// [RouteType::name].
7657 UnknownValue(route_type::UnknownValue),
7658 }
7659
7660 #[doc(hidden)]
7661 pub mod route_type {
7662 #[allow(unused_imports)]
7663 use super::*;
7664 #[derive(Clone, Debug, PartialEq)]
7665 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7666 }
7667
7668 impl RouteType {
7669 /// Gets the enum value.
7670 ///
7671 /// Returns `None` if the enum contains an unknown value deserialized from
7672 /// the string representation of enums.
7673 pub fn value(&self) -> std::option::Option<i32> {
7674 match self {
7675 Self::Unspecified => std::option::Option::Some(0),
7676 Self::Subnet => std::option::Option::Some(1),
7677 Self::Static => std::option::Option::Some(2),
7678 Self::Dynamic => std::option::Option::Some(3),
7679 Self::PeeringSubnet => std::option::Option::Some(4),
7680 Self::PeeringStatic => std::option::Option::Some(5),
7681 Self::PeeringDynamic => std::option::Option::Some(6),
7682 Self::PolicyBased => std::option::Option::Some(7),
7683 Self::Advertised => std::option::Option::Some(101),
7684 Self::UnknownValue(u) => u.0.value(),
7685 }
7686 }
7687
7688 /// Gets the enum value as a string.
7689 ///
7690 /// Returns `None` if the enum contains an unknown value deserialized from
7691 /// the integer representation of enums.
7692 pub fn name(&self) -> std::option::Option<&str> {
7693 match self {
7694 Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
7695 Self::Subnet => std::option::Option::Some("SUBNET"),
7696 Self::Static => std::option::Option::Some("STATIC"),
7697 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
7698 Self::PeeringSubnet => std::option::Option::Some("PEERING_SUBNET"),
7699 Self::PeeringStatic => std::option::Option::Some("PEERING_STATIC"),
7700 Self::PeeringDynamic => std::option::Option::Some("PEERING_DYNAMIC"),
7701 Self::PolicyBased => std::option::Option::Some("POLICY_BASED"),
7702 Self::Advertised => std::option::Option::Some("ADVERTISED"),
7703 Self::UnknownValue(u) => u.0.name(),
7704 }
7705 }
7706 }
7707
7708 impl std::default::Default for RouteType {
7709 fn default() -> Self {
7710 use std::convert::From;
7711 Self::from(0)
7712 }
7713 }
7714
7715 impl std::fmt::Display for RouteType {
7716 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7717 wkt::internal::display_enum(f, self.name(), self.value())
7718 }
7719 }
7720
7721 impl std::convert::From<i32> for RouteType {
7722 fn from(value: i32) -> Self {
7723 match value {
7724 0 => Self::Unspecified,
7725 1 => Self::Subnet,
7726 2 => Self::Static,
7727 3 => Self::Dynamic,
7728 4 => Self::PeeringSubnet,
7729 5 => Self::PeeringStatic,
7730 6 => Self::PeeringDynamic,
7731 7 => Self::PolicyBased,
7732 101 => Self::Advertised,
7733 _ => Self::UnknownValue(route_type::UnknownValue(
7734 wkt::internal::UnknownEnumValue::Integer(value),
7735 )),
7736 }
7737 }
7738 }
7739
7740 impl std::convert::From<&str> for RouteType {
7741 fn from(value: &str) -> Self {
7742 use std::string::ToString;
7743 match value {
7744 "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
7745 "SUBNET" => Self::Subnet,
7746 "STATIC" => Self::Static,
7747 "DYNAMIC" => Self::Dynamic,
7748 "PEERING_SUBNET" => Self::PeeringSubnet,
7749 "PEERING_STATIC" => Self::PeeringStatic,
7750 "PEERING_DYNAMIC" => Self::PeeringDynamic,
7751 "POLICY_BASED" => Self::PolicyBased,
7752 "ADVERTISED" => Self::Advertised,
7753 _ => Self::UnknownValue(route_type::UnknownValue(
7754 wkt::internal::UnknownEnumValue::String(value.to_string()),
7755 )),
7756 }
7757 }
7758 }
7759
7760 impl serde::ser::Serialize for RouteType {
7761 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7762 where
7763 S: serde::Serializer,
7764 {
7765 match self {
7766 Self::Unspecified => serializer.serialize_i32(0),
7767 Self::Subnet => serializer.serialize_i32(1),
7768 Self::Static => serializer.serialize_i32(2),
7769 Self::Dynamic => serializer.serialize_i32(3),
7770 Self::PeeringSubnet => serializer.serialize_i32(4),
7771 Self::PeeringStatic => serializer.serialize_i32(5),
7772 Self::PeeringDynamic => serializer.serialize_i32(6),
7773 Self::PolicyBased => serializer.serialize_i32(7),
7774 Self::Advertised => serializer.serialize_i32(101),
7775 Self::UnknownValue(u) => u.0.serialize(serializer),
7776 }
7777 }
7778 }
7779
7780 impl<'de> serde::de::Deserialize<'de> for RouteType {
7781 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7782 where
7783 D: serde::Deserializer<'de>,
7784 {
7785 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
7786 ".google.cloud.networkmanagement.v1.RouteInfo.RouteType",
7787 ))
7788 }
7789 }
7790
7791 /// Type of next hop:
7792 ///
7793 /// # Working with unknown values
7794 ///
7795 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7796 /// additional enum variants at any time. Adding new variants is not considered
7797 /// a breaking change. Applications should write their code in anticipation of:
7798 ///
7799 /// - New values appearing in future releases of the client library, **and**
7800 /// - New values received dynamically, without application changes.
7801 ///
7802 /// Please consult the [Working with enums] section in the user guide for some
7803 /// guidelines.
7804 ///
7805 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7806 #[derive(Clone, Debug, PartialEq)]
7807 #[non_exhaustive]
7808 pub enum NextHopType {
7809 /// Unspecified type. Default value.
7810 Unspecified,
7811 /// Next hop is an IP address.
7812 NextHopIp,
7813 /// Next hop is a Compute Engine instance.
7814 NextHopInstance,
7815 /// Next hop is a VPC network gateway.
7816 NextHopNetwork,
7817 /// Next hop is a peering VPC. This scenario only happens when the user
7818 /// doesn't have permissions to the project where the next hop resource is
7819 /// located.
7820 NextHopPeering,
7821 /// Next hop is an interconnect.
7822 NextHopInterconnect,
7823 /// Next hop is a VPN tunnel.
7824 NextHopVpnTunnel,
7825 /// Next hop is a VPN gateway. This scenario only happens when tracing
7826 /// connectivity from an on-premises network to Google Cloud through a VPN.
7827 /// The analysis simulates a packet departing from the on-premises network
7828 /// through a VPN tunnel and arriving at a Cloud VPN gateway.
7829 NextHopVpnGateway,
7830 /// Next hop is an internet gateway.
7831 NextHopInternetGateway,
7832 /// Next hop is blackhole; that is, the next hop either does not exist or is
7833 /// unusable.
7834 NextHopBlackhole,
7835 /// Next hop is the forwarding rule of an Internal Load Balancer.
7836 NextHopIlb,
7837 /// Next hop is a
7838 /// [router appliance
7839 /// instance](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/ra-overview).
7840 NextHopRouterAppliance,
7841 /// Next hop is an NCC hub. This scenario only happens when the user doesn't
7842 /// have permissions to the project where the next hop resource is located.
7843 NextHopNccHub,
7844 /// Next hop is Secure Web Proxy Gateway.
7845 SecureWebProxyGateway,
7846 /// If set, the enum was initialized with an unknown value.
7847 ///
7848 /// Applications can examine the value using [NextHopType::value] or
7849 /// [NextHopType::name].
7850 UnknownValue(next_hop_type::UnknownValue),
7851 }
7852
7853 #[doc(hidden)]
7854 pub mod next_hop_type {
7855 #[allow(unused_imports)]
7856 use super::*;
7857 #[derive(Clone, Debug, PartialEq)]
7858 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7859 }
7860
7861 impl NextHopType {
7862 /// Gets the enum value.
7863 ///
7864 /// Returns `None` if the enum contains an unknown value deserialized from
7865 /// the string representation of enums.
7866 pub fn value(&self) -> std::option::Option<i32> {
7867 match self {
7868 Self::Unspecified => std::option::Option::Some(0),
7869 Self::NextHopIp => std::option::Option::Some(1),
7870 Self::NextHopInstance => std::option::Option::Some(2),
7871 Self::NextHopNetwork => std::option::Option::Some(3),
7872 Self::NextHopPeering => std::option::Option::Some(4),
7873 Self::NextHopInterconnect => std::option::Option::Some(5),
7874 Self::NextHopVpnTunnel => std::option::Option::Some(6),
7875 Self::NextHopVpnGateway => std::option::Option::Some(7),
7876 Self::NextHopInternetGateway => std::option::Option::Some(8),
7877 Self::NextHopBlackhole => std::option::Option::Some(9),
7878 Self::NextHopIlb => std::option::Option::Some(10),
7879 Self::NextHopRouterAppliance => std::option::Option::Some(11),
7880 Self::NextHopNccHub => std::option::Option::Some(12),
7881 Self::SecureWebProxyGateway => std::option::Option::Some(13),
7882 Self::UnknownValue(u) => u.0.value(),
7883 }
7884 }
7885
7886 /// Gets the enum value as a string.
7887 ///
7888 /// Returns `None` if the enum contains an unknown value deserialized from
7889 /// the integer representation of enums.
7890 pub fn name(&self) -> std::option::Option<&str> {
7891 match self {
7892 Self::Unspecified => std::option::Option::Some("NEXT_HOP_TYPE_UNSPECIFIED"),
7893 Self::NextHopIp => std::option::Option::Some("NEXT_HOP_IP"),
7894 Self::NextHopInstance => std::option::Option::Some("NEXT_HOP_INSTANCE"),
7895 Self::NextHopNetwork => std::option::Option::Some("NEXT_HOP_NETWORK"),
7896 Self::NextHopPeering => std::option::Option::Some("NEXT_HOP_PEERING"),
7897 Self::NextHopInterconnect => std::option::Option::Some("NEXT_HOP_INTERCONNECT"),
7898 Self::NextHopVpnTunnel => std::option::Option::Some("NEXT_HOP_VPN_TUNNEL"),
7899 Self::NextHopVpnGateway => std::option::Option::Some("NEXT_HOP_VPN_GATEWAY"),
7900 Self::NextHopInternetGateway => {
7901 std::option::Option::Some("NEXT_HOP_INTERNET_GATEWAY")
7902 }
7903 Self::NextHopBlackhole => std::option::Option::Some("NEXT_HOP_BLACKHOLE"),
7904 Self::NextHopIlb => std::option::Option::Some("NEXT_HOP_ILB"),
7905 Self::NextHopRouterAppliance => {
7906 std::option::Option::Some("NEXT_HOP_ROUTER_APPLIANCE")
7907 }
7908 Self::NextHopNccHub => std::option::Option::Some("NEXT_HOP_NCC_HUB"),
7909 Self::SecureWebProxyGateway => {
7910 std::option::Option::Some("SECURE_WEB_PROXY_GATEWAY")
7911 }
7912 Self::UnknownValue(u) => u.0.name(),
7913 }
7914 }
7915 }
7916
7917 impl std::default::Default for NextHopType {
7918 fn default() -> Self {
7919 use std::convert::From;
7920 Self::from(0)
7921 }
7922 }
7923
7924 impl std::fmt::Display for NextHopType {
7925 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7926 wkt::internal::display_enum(f, self.name(), self.value())
7927 }
7928 }
7929
7930 impl std::convert::From<i32> for NextHopType {
7931 fn from(value: i32) -> Self {
7932 match value {
7933 0 => Self::Unspecified,
7934 1 => Self::NextHopIp,
7935 2 => Self::NextHopInstance,
7936 3 => Self::NextHopNetwork,
7937 4 => Self::NextHopPeering,
7938 5 => Self::NextHopInterconnect,
7939 6 => Self::NextHopVpnTunnel,
7940 7 => Self::NextHopVpnGateway,
7941 8 => Self::NextHopInternetGateway,
7942 9 => Self::NextHopBlackhole,
7943 10 => Self::NextHopIlb,
7944 11 => Self::NextHopRouterAppliance,
7945 12 => Self::NextHopNccHub,
7946 13 => Self::SecureWebProxyGateway,
7947 _ => Self::UnknownValue(next_hop_type::UnknownValue(
7948 wkt::internal::UnknownEnumValue::Integer(value),
7949 )),
7950 }
7951 }
7952 }
7953
7954 impl std::convert::From<&str> for NextHopType {
7955 fn from(value: &str) -> Self {
7956 use std::string::ToString;
7957 match value {
7958 "NEXT_HOP_TYPE_UNSPECIFIED" => Self::Unspecified,
7959 "NEXT_HOP_IP" => Self::NextHopIp,
7960 "NEXT_HOP_INSTANCE" => Self::NextHopInstance,
7961 "NEXT_HOP_NETWORK" => Self::NextHopNetwork,
7962 "NEXT_HOP_PEERING" => Self::NextHopPeering,
7963 "NEXT_HOP_INTERCONNECT" => Self::NextHopInterconnect,
7964 "NEXT_HOP_VPN_TUNNEL" => Self::NextHopVpnTunnel,
7965 "NEXT_HOP_VPN_GATEWAY" => Self::NextHopVpnGateway,
7966 "NEXT_HOP_INTERNET_GATEWAY" => Self::NextHopInternetGateway,
7967 "NEXT_HOP_BLACKHOLE" => Self::NextHopBlackhole,
7968 "NEXT_HOP_ILB" => Self::NextHopIlb,
7969 "NEXT_HOP_ROUTER_APPLIANCE" => Self::NextHopRouterAppliance,
7970 "NEXT_HOP_NCC_HUB" => Self::NextHopNccHub,
7971 "SECURE_WEB_PROXY_GATEWAY" => Self::SecureWebProxyGateway,
7972 _ => Self::UnknownValue(next_hop_type::UnknownValue(
7973 wkt::internal::UnknownEnumValue::String(value.to_string()),
7974 )),
7975 }
7976 }
7977 }
7978
7979 impl serde::ser::Serialize for NextHopType {
7980 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7981 where
7982 S: serde::Serializer,
7983 {
7984 match self {
7985 Self::Unspecified => serializer.serialize_i32(0),
7986 Self::NextHopIp => serializer.serialize_i32(1),
7987 Self::NextHopInstance => serializer.serialize_i32(2),
7988 Self::NextHopNetwork => serializer.serialize_i32(3),
7989 Self::NextHopPeering => serializer.serialize_i32(4),
7990 Self::NextHopInterconnect => serializer.serialize_i32(5),
7991 Self::NextHopVpnTunnel => serializer.serialize_i32(6),
7992 Self::NextHopVpnGateway => serializer.serialize_i32(7),
7993 Self::NextHopInternetGateway => serializer.serialize_i32(8),
7994 Self::NextHopBlackhole => serializer.serialize_i32(9),
7995 Self::NextHopIlb => serializer.serialize_i32(10),
7996 Self::NextHopRouterAppliance => serializer.serialize_i32(11),
7997 Self::NextHopNccHub => serializer.serialize_i32(12),
7998 Self::SecureWebProxyGateway => serializer.serialize_i32(13),
7999 Self::UnknownValue(u) => u.0.serialize(serializer),
8000 }
8001 }
8002 }
8003
8004 impl<'de> serde::de::Deserialize<'de> for NextHopType {
8005 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8006 where
8007 D: serde::Deserializer<'de>,
8008 {
8009 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NextHopType>::new(
8010 ".google.cloud.networkmanagement.v1.RouteInfo.NextHopType",
8011 ))
8012 }
8013 }
8014
8015 /// Indicates where routes are applicable.
8016 ///
8017 /// # Working with unknown values
8018 ///
8019 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8020 /// additional enum variants at any time. Adding new variants is not considered
8021 /// a breaking change. Applications should write their code in anticipation of:
8022 ///
8023 /// - New values appearing in future releases of the client library, **and**
8024 /// - New values received dynamically, without application changes.
8025 ///
8026 /// Please consult the [Working with enums] section in the user guide for some
8027 /// guidelines.
8028 ///
8029 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8030 #[derive(Clone, Debug, PartialEq)]
8031 #[non_exhaustive]
8032 pub enum RouteScope {
8033 /// Unspecified scope. Default value.
8034 Unspecified,
8035 /// Route is applicable to packets in Network.
8036 Network,
8037 /// Route is applicable to packets using NCC Hub's routing table.
8038 NccHub,
8039 /// If set, the enum was initialized with an unknown value.
8040 ///
8041 /// Applications can examine the value using [RouteScope::value] or
8042 /// [RouteScope::name].
8043 UnknownValue(route_scope::UnknownValue),
8044 }
8045
8046 #[doc(hidden)]
8047 pub mod route_scope {
8048 #[allow(unused_imports)]
8049 use super::*;
8050 #[derive(Clone, Debug, PartialEq)]
8051 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8052 }
8053
8054 impl RouteScope {
8055 /// Gets the enum value.
8056 ///
8057 /// Returns `None` if the enum contains an unknown value deserialized from
8058 /// the string representation of enums.
8059 pub fn value(&self) -> std::option::Option<i32> {
8060 match self {
8061 Self::Unspecified => std::option::Option::Some(0),
8062 Self::Network => std::option::Option::Some(1),
8063 Self::NccHub => std::option::Option::Some(2),
8064 Self::UnknownValue(u) => u.0.value(),
8065 }
8066 }
8067
8068 /// Gets the enum value as a string.
8069 ///
8070 /// Returns `None` if the enum contains an unknown value deserialized from
8071 /// the integer representation of enums.
8072 pub fn name(&self) -> std::option::Option<&str> {
8073 match self {
8074 Self::Unspecified => std::option::Option::Some("ROUTE_SCOPE_UNSPECIFIED"),
8075 Self::Network => std::option::Option::Some("NETWORK"),
8076 Self::NccHub => std::option::Option::Some("NCC_HUB"),
8077 Self::UnknownValue(u) => u.0.name(),
8078 }
8079 }
8080 }
8081
8082 impl std::default::Default for RouteScope {
8083 fn default() -> Self {
8084 use std::convert::From;
8085 Self::from(0)
8086 }
8087 }
8088
8089 impl std::fmt::Display for RouteScope {
8090 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8091 wkt::internal::display_enum(f, self.name(), self.value())
8092 }
8093 }
8094
8095 impl std::convert::From<i32> for RouteScope {
8096 fn from(value: i32) -> Self {
8097 match value {
8098 0 => Self::Unspecified,
8099 1 => Self::Network,
8100 2 => Self::NccHub,
8101 _ => Self::UnknownValue(route_scope::UnknownValue(
8102 wkt::internal::UnknownEnumValue::Integer(value),
8103 )),
8104 }
8105 }
8106 }
8107
8108 impl std::convert::From<&str> for RouteScope {
8109 fn from(value: &str) -> Self {
8110 use std::string::ToString;
8111 match value {
8112 "ROUTE_SCOPE_UNSPECIFIED" => Self::Unspecified,
8113 "NETWORK" => Self::Network,
8114 "NCC_HUB" => Self::NccHub,
8115 _ => Self::UnknownValue(route_scope::UnknownValue(
8116 wkt::internal::UnknownEnumValue::String(value.to_string()),
8117 )),
8118 }
8119 }
8120 }
8121
8122 impl serde::ser::Serialize for RouteScope {
8123 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8124 where
8125 S: serde::Serializer,
8126 {
8127 match self {
8128 Self::Unspecified => serializer.serialize_i32(0),
8129 Self::Network => serializer.serialize_i32(1),
8130 Self::NccHub => serializer.serialize_i32(2),
8131 Self::UnknownValue(u) => u.0.serialize(serializer),
8132 }
8133 }
8134 }
8135
8136 impl<'de> serde::de::Deserialize<'de> for RouteScope {
8137 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8138 where
8139 D: serde::Deserializer<'de>,
8140 {
8141 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteScope>::new(
8142 ".google.cloud.networkmanagement.v1.RouteInfo.RouteScope",
8143 ))
8144 }
8145 }
8146}
8147
8148/// For display only. Details of a Google Service sending packets to a
8149/// VPC network. Although the source IP might be a publicly routable address,
8150/// some Google Services use special routes within Google production
8151/// infrastructure to reach Compute Engine Instances.
8152/// <https://cloud.google.com/vpc/docs/routes#special_return_paths>
8153#[derive(Clone, Default, PartialEq)]
8154#[non_exhaustive]
8155pub struct GoogleServiceInfo {
8156 /// Source IP address.
8157 pub source_ip: std::string::String,
8158
8159 /// Recognized type of a Google Service.
8160 pub google_service_type: crate::model::google_service_info::GoogleServiceType,
8161
8162 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8163}
8164
8165impl GoogleServiceInfo {
8166 pub fn new() -> Self {
8167 std::default::Default::default()
8168 }
8169
8170 /// Sets the value of [source_ip][crate::model::GoogleServiceInfo::source_ip].
8171 ///
8172 /// # Example
8173 /// ```ignore,no_run
8174 /// # use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
8175 /// let x = GoogleServiceInfo::new().set_source_ip("example");
8176 /// ```
8177 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8178 self.source_ip = v.into();
8179 self
8180 }
8181
8182 /// Sets the value of [google_service_type][crate::model::GoogleServiceInfo::google_service_type].
8183 ///
8184 /// # Example
8185 /// ```ignore,no_run
8186 /// # use google_cloud_networkmanagement_v1::model::GoogleServiceInfo;
8187 /// use google_cloud_networkmanagement_v1::model::google_service_info::GoogleServiceType;
8188 /// let x0 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::Iap);
8189 /// let x1 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::GfeProxyOrHealthCheckProber);
8190 /// let x2 = GoogleServiceInfo::new().set_google_service_type(GoogleServiceType::CloudDns);
8191 /// ```
8192 pub fn set_google_service_type<
8193 T: std::convert::Into<crate::model::google_service_info::GoogleServiceType>,
8194 >(
8195 mut self,
8196 v: T,
8197 ) -> Self {
8198 self.google_service_type = v.into();
8199 self
8200 }
8201}
8202
8203impl wkt::message::Message for GoogleServiceInfo {
8204 fn typename() -> &'static str {
8205 "type.googleapis.com/google.cloud.networkmanagement.v1.GoogleServiceInfo"
8206 }
8207}
8208
8209/// Defines additional types related to [GoogleServiceInfo].
8210pub mod google_service_info {
8211 #[allow(unused_imports)]
8212 use super::*;
8213
8214 /// Recognized type of a Google Service.
8215 ///
8216 /// # Working with unknown values
8217 ///
8218 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8219 /// additional enum variants at any time. Adding new variants is not considered
8220 /// a breaking change. Applications should write their code in anticipation of:
8221 ///
8222 /// - New values appearing in future releases of the client library, **and**
8223 /// - New values received dynamically, without application changes.
8224 ///
8225 /// Please consult the [Working with enums] section in the user guide for some
8226 /// guidelines.
8227 ///
8228 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8229 #[derive(Clone, Debug, PartialEq)]
8230 #[non_exhaustive]
8231 pub enum GoogleServiceType {
8232 /// Unspecified Google Service.
8233 Unspecified,
8234 /// Identity aware proxy.
8235 /// <https://cloud.google.com/iap/docs/using-tcp-forwarding>
8236 Iap,
8237 /// One of two services sharing IP ranges:
8238 ///
8239 /// * Load Balancer proxy
8240 /// * Centralized Health Check prober
8241 /// <https://cloud.google.com/load-balancing/docs/firewall-rules>
8242 GfeProxyOrHealthCheckProber,
8243 /// Connectivity from Cloud DNS to forwarding targets or alternate name
8244 /// servers that use private routing.
8245 /// <https://cloud.google.com/dns/docs/zones/forwarding-zones#firewall-rules>
8246 /// <https://cloud.google.com/dns/docs/policies#firewall-rules>
8247 CloudDns,
8248 /// private.googleapis.com and restricted.googleapis.com
8249 GoogleApi,
8250 /// Google API via Private Service Connect.
8251 /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
8252 GoogleApiPsc,
8253 /// Google API via VPC Service Controls.
8254 /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
8255 GoogleApiVpcSc,
8256 /// Google API via Serverless VPC Access.
8257 /// <https://cloud.google.com/vpc/docs/serverless-vpc-access>
8258 ServerlessVpcAccess,
8259 /// If set, the enum was initialized with an unknown value.
8260 ///
8261 /// Applications can examine the value using [GoogleServiceType::value] or
8262 /// [GoogleServiceType::name].
8263 UnknownValue(google_service_type::UnknownValue),
8264 }
8265
8266 #[doc(hidden)]
8267 pub mod google_service_type {
8268 #[allow(unused_imports)]
8269 use super::*;
8270 #[derive(Clone, Debug, PartialEq)]
8271 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8272 }
8273
8274 impl GoogleServiceType {
8275 /// Gets the enum value.
8276 ///
8277 /// Returns `None` if the enum contains an unknown value deserialized from
8278 /// the string representation of enums.
8279 pub fn value(&self) -> std::option::Option<i32> {
8280 match self {
8281 Self::Unspecified => std::option::Option::Some(0),
8282 Self::Iap => std::option::Option::Some(1),
8283 Self::GfeProxyOrHealthCheckProber => std::option::Option::Some(2),
8284 Self::CloudDns => std::option::Option::Some(3),
8285 Self::GoogleApi => std::option::Option::Some(4),
8286 Self::GoogleApiPsc => std::option::Option::Some(5),
8287 Self::GoogleApiVpcSc => std::option::Option::Some(6),
8288 Self::ServerlessVpcAccess => std::option::Option::Some(7),
8289 Self::UnknownValue(u) => u.0.value(),
8290 }
8291 }
8292
8293 /// Gets the enum value as a string.
8294 ///
8295 /// Returns `None` if the enum contains an unknown value deserialized from
8296 /// the integer representation of enums.
8297 pub fn name(&self) -> std::option::Option<&str> {
8298 match self {
8299 Self::Unspecified => std::option::Option::Some("GOOGLE_SERVICE_TYPE_UNSPECIFIED"),
8300 Self::Iap => std::option::Option::Some("IAP"),
8301 Self::GfeProxyOrHealthCheckProber => {
8302 std::option::Option::Some("GFE_PROXY_OR_HEALTH_CHECK_PROBER")
8303 }
8304 Self::CloudDns => std::option::Option::Some("CLOUD_DNS"),
8305 Self::GoogleApi => std::option::Option::Some("GOOGLE_API"),
8306 Self::GoogleApiPsc => std::option::Option::Some("GOOGLE_API_PSC"),
8307 Self::GoogleApiVpcSc => std::option::Option::Some("GOOGLE_API_VPC_SC"),
8308 Self::ServerlessVpcAccess => std::option::Option::Some("SERVERLESS_VPC_ACCESS"),
8309 Self::UnknownValue(u) => u.0.name(),
8310 }
8311 }
8312 }
8313
8314 impl std::default::Default for GoogleServiceType {
8315 fn default() -> Self {
8316 use std::convert::From;
8317 Self::from(0)
8318 }
8319 }
8320
8321 impl std::fmt::Display for GoogleServiceType {
8322 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8323 wkt::internal::display_enum(f, self.name(), self.value())
8324 }
8325 }
8326
8327 impl std::convert::From<i32> for GoogleServiceType {
8328 fn from(value: i32) -> Self {
8329 match value {
8330 0 => Self::Unspecified,
8331 1 => Self::Iap,
8332 2 => Self::GfeProxyOrHealthCheckProber,
8333 3 => Self::CloudDns,
8334 4 => Self::GoogleApi,
8335 5 => Self::GoogleApiPsc,
8336 6 => Self::GoogleApiVpcSc,
8337 7 => Self::ServerlessVpcAccess,
8338 _ => Self::UnknownValue(google_service_type::UnknownValue(
8339 wkt::internal::UnknownEnumValue::Integer(value),
8340 )),
8341 }
8342 }
8343 }
8344
8345 impl std::convert::From<&str> for GoogleServiceType {
8346 fn from(value: &str) -> Self {
8347 use std::string::ToString;
8348 match value {
8349 "GOOGLE_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
8350 "IAP" => Self::Iap,
8351 "GFE_PROXY_OR_HEALTH_CHECK_PROBER" => Self::GfeProxyOrHealthCheckProber,
8352 "CLOUD_DNS" => Self::CloudDns,
8353 "GOOGLE_API" => Self::GoogleApi,
8354 "GOOGLE_API_PSC" => Self::GoogleApiPsc,
8355 "GOOGLE_API_VPC_SC" => Self::GoogleApiVpcSc,
8356 "SERVERLESS_VPC_ACCESS" => Self::ServerlessVpcAccess,
8357 _ => Self::UnknownValue(google_service_type::UnknownValue(
8358 wkt::internal::UnknownEnumValue::String(value.to_string()),
8359 )),
8360 }
8361 }
8362 }
8363
8364 impl serde::ser::Serialize for GoogleServiceType {
8365 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8366 where
8367 S: serde::Serializer,
8368 {
8369 match self {
8370 Self::Unspecified => serializer.serialize_i32(0),
8371 Self::Iap => serializer.serialize_i32(1),
8372 Self::GfeProxyOrHealthCheckProber => serializer.serialize_i32(2),
8373 Self::CloudDns => serializer.serialize_i32(3),
8374 Self::GoogleApi => serializer.serialize_i32(4),
8375 Self::GoogleApiPsc => serializer.serialize_i32(5),
8376 Self::GoogleApiVpcSc => serializer.serialize_i32(6),
8377 Self::ServerlessVpcAccess => serializer.serialize_i32(7),
8378 Self::UnknownValue(u) => u.0.serialize(serializer),
8379 }
8380 }
8381 }
8382
8383 impl<'de> serde::de::Deserialize<'de> for GoogleServiceType {
8384 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8385 where
8386 D: serde::Deserializer<'de>,
8387 {
8388 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GoogleServiceType>::new(
8389 ".google.cloud.networkmanagement.v1.GoogleServiceInfo.GoogleServiceType",
8390 ))
8391 }
8392 }
8393}
8394
8395/// For display only. Metadata associated with a Compute Engine forwarding rule.
8396#[derive(Clone, Default, PartialEq)]
8397#[non_exhaustive]
8398pub struct ForwardingRuleInfo {
8399 /// Name of the forwarding rule.
8400 pub display_name: std::string::String,
8401
8402 /// URI of the forwarding rule.
8403 pub uri: std::string::String,
8404
8405 /// Protocol defined in the forwarding rule that matches the packet.
8406 pub matched_protocol: std::string::String,
8407
8408 /// Port range defined in the forwarding rule that matches the packet.
8409 pub matched_port_range: std::string::String,
8410
8411 /// VIP of the forwarding rule.
8412 pub vip: std::string::String,
8413
8414 /// Target type of the forwarding rule.
8415 pub target: std::string::String,
8416
8417 /// Network URI.
8418 pub network_uri: std::string::String,
8419
8420 /// Region of the forwarding rule. Set only for regional forwarding rules.
8421 pub region: std::string::String,
8422
8423 /// Name of the load balancer the forwarding rule belongs to. Empty for
8424 /// forwarding rules not related to load balancers (like PSC forwarding rules).
8425 pub load_balancer_name: std::string::String,
8426
8427 /// URI of the PSC service attachment this forwarding rule targets (if
8428 /// applicable).
8429 pub psc_service_attachment_uri: std::string::String,
8430
8431 /// PSC Google API target this forwarding rule targets (if applicable).
8432 pub psc_google_api_target: std::string::String,
8433
8434 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8435}
8436
8437impl ForwardingRuleInfo {
8438 pub fn new() -> Self {
8439 std::default::Default::default()
8440 }
8441
8442 /// Sets the value of [display_name][crate::model::ForwardingRuleInfo::display_name].
8443 ///
8444 /// # Example
8445 /// ```ignore,no_run
8446 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8447 /// let x = ForwardingRuleInfo::new().set_display_name("example");
8448 /// ```
8449 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8450 self.display_name = v.into();
8451 self
8452 }
8453
8454 /// Sets the value of [uri][crate::model::ForwardingRuleInfo::uri].
8455 ///
8456 /// # Example
8457 /// ```ignore,no_run
8458 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8459 /// let x = ForwardingRuleInfo::new().set_uri("example");
8460 /// ```
8461 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8462 self.uri = v.into();
8463 self
8464 }
8465
8466 /// Sets the value of [matched_protocol][crate::model::ForwardingRuleInfo::matched_protocol].
8467 ///
8468 /// # Example
8469 /// ```ignore,no_run
8470 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8471 /// let x = ForwardingRuleInfo::new().set_matched_protocol("example");
8472 /// ```
8473 pub fn set_matched_protocol<T: std::convert::Into<std::string::String>>(
8474 mut self,
8475 v: T,
8476 ) -> Self {
8477 self.matched_protocol = v.into();
8478 self
8479 }
8480
8481 /// Sets the value of [matched_port_range][crate::model::ForwardingRuleInfo::matched_port_range].
8482 ///
8483 /// # Example
8484 /// ```ignore,no_run
8485 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8486 /// let x = ForwardingRuleInfo::new().set_matched_port_range("example");
8487 /// ```
8488 pub fn set_matched_port_range<T: std::convert::Into<std::string::String>>(
8489 mut self,
8490 v: T,
8491 ) -> Self {
8492 self.matched_port_range = v.into();
8493 self
8494 }
8495
8496 /// Sets the value of [vip][crate::model::ForwardingRuleInfo::vip].
8497 ///
8498 /// # Example
8499 /// ```ignore,no_run
8500 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8501 /// let x = ForwardingRuleInfo::new().set_vip("example");
8502 /// ```
8503 pub fn set_vip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8504 self.vip = v.into();
8505 self
8506 }
8507
8508 /// Sets the value of [target][crate::model::ForwardingRuleInfo::target].
8509 ///
8510 /// # Example
8511 /// ```ignore,no_run
8512 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8513 /// let x = ForwardingRuleInfo::new().set_target("example");
8514 /// ```
8515 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8516 self.target = v.into();
8517 self
8518 }
8519
8520 /// Sets the value of [network_uri][crate::model::ForwardingRuleInfo::network_uri].
8521 ///
8522 /// # Example
8523 /// ```ignore,no_run
8524 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8525 /// let x = ForwardingRuleInfo::new().set_network_uri("example");
8526 /// ```
8527 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8528 self.network_uri = v.into();
8529 self
8530 }
8531
8532 /// Sets the value of [region][crate::model::ForwardingRuleInfo::region].
8533 ///
8534 /// # Example
8535 /// ```ignore,no_run
8536 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8537 /// let x = ForwardingRuleInfo::new().set_region("example");
8538 /// ```
8539 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8540 self.region = v.into();
8541 self
8542 }
8543
8544 /// Sets the value of [load_balancer_name][crate::model::ForwardingRuleInfo::load_balancer_name].
8545 ///
8546 /// # Example
8547 /// ```ignore,no_run
8548 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8549 /// let x = ForwardingRuleInfo::new().set_load_balancer_name("example");
8550 /// ```
8551 pub fn set_load_balancer_name<T: std::convert::Into<std::string::String>>(
8552 mut self,
8553 v: T,
8554 ) -> Self {
8555 self.load_balancer_name = v.into();
8556 self
8557 }
8558
8559 /// Sets the value of [psc_service_attachment_uri][crate::model::ForwardingRuleInfo::psc_service_attachment_uri].
8560 ///
8561 /// # Example
8562 /// ```ignore,no_run
8563 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8564 /// let x = ForwardingRuleInfo::new().set_psc_service_attachment_uri("example");
8565 /// ```
8566 pub fn set_psc_service_attachment_uri<T: std::convert::Into<std::string::String>>(
8567 mut self,
8568 v: T,
8569 ) -> Self {
8570 self.psc_service_attachment_uri = v.into();
8571 self
8572 }
8573
8574 /// Sets the value of [psc_google_api_target][crate::model::ForwardingRuleInfo::psc_google_api_target].
8575 ///
8576 /// # Example
8577 /// ```ignore,no_run
8578 /// # use google_cloud_networkmanagement_v1::model::ForwardingRuleInfo;
8579 /// let x = ForwardingRuleInfo::new().set_psc_google_api_target("example");
8580 /// ```
8581 pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
8582 mut self,
8583 v: T,
8584 ) -> Self {
8585 self.psc_google_api_target = v.into();
8586 self
8587 }
8588}
8589
8590impl wkt::message::Message for ForwardingRuleInfo {
8591 fn typename() -> &'static str {
8592 "type.googleapis.com/google.cloud.networkmanagement.v1.ForwardingRuleInfo"
8593 }
8594}
8595
8596/// For display only. Metadata associated with a load balancer.
8597#[derive(Clone, Default, PartialEq)]
8598#[non_exhaustive]
8599pub struct LoadBalancerInfo {
8600 /// Type of the load balancer.
8601 pub load_balancer_type: crate::model::load_balancer_info::LoadBalancerType,
8602
8603 /// URI of the health check for the load balancer. Deprecated and no longer
8604 /// populated as different load balancer backends might have different health
8605 /// checks.
8606 #[deprecated]
8607 pub health_check_uri: std::string::String,
8608
8609 /// Information for the loadbalancer backends.
8610 pub backends: std::vec::Vec<crate::model::LoadBalancerBackend>,
8611
8612 /// Type of load balancer's backend configuration.
8613 pub backend_type: crate::model::load_balancer_info::BackendType,
8614
8615 /// Backend configuration URI.
8616 pub backend_uri: std::string::String,
8617
8618 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8619}
8620
8621impl LoadBalancerInfo {
8622 pub fn new() -> Self {
8623 std::default::Default::default()
8624 }
8625
8626 /// Sets the value of [load_balancer_type][crate::model::LoadBalancerInfo::load_balancer_type].
8627 ///
8628 /// # Example
8629 /// ```ignore,no_run
8630 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
8631 /// use google_cloud_networkmanagement_v1::model::load_balancer_info::LoadBalancerType;
8632 /// let x0 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::InternalTcpUdp);
8633 /// let x1 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::NetworkTcpUdp);
8634 /// let x2 = LoadBalancerInfo::new().set_load_balancer_type(LoadBalancerType::HttpProxy);
8635 /// ```
8636 pub fn set_load_balancer_type<
8637 T: std::convert::Into<crate::model::load_balancer_info::LoadBalancerType>,
8638 >(
8639 mut self,
8640 v: T,
8641 ) -> Self {
8642 self.load_balancer_type = v.into();
8643 self
8644 }
8645
8646 /// Sets the value of [health_check_uri][crate::model::LoadBalancerInfo::health_check_uri].
8647 ///
8648 /// # Example
8649 /// ```ignore,no_run
8650 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
8651 /// let x = LoadBalancerInfo::new().set_health_check_uri("example");
8652 /// ```
8653 #[deprecated]
8654 pub fn set_health_check_uri<T: std::convert::Into<std::string::String>>(
8655 mut self,
8656 v: T,
8657 ) -> Self {
8658 self.health_check_uri = v.into();
8659 self
8660 }
8661
8662 /// Sets the value of [backends][crate::model::LoadBalancerInfo::backends].
8663 ///
8664 /// # Example
8665 /// ```ignore,no_run
8666 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
8667 /// use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
8668 /// let x = LoadBalancerInfo::new()
8669 /// .set_backends([
8670 /// LoadBalancerBackend::default()/* use setters */,
8671 /// LoadBalancerBackend::default()/* use (different) setters */,
8672 /// ]);
8673 /// ```
8674 pub fn set_backends<T, V>(mut self, v: T) -> Self
8675 where
8676 T: std::iter::IntoIterator<Item = V>,
8677 V: std::convert::Into<crate::model::LoadBalancerBackend>,
8678 {
8679 use std::iter::Iterator;
8680 self.backends = v.into_iter().map(|i| i.into()).collect();
8681 self
8682 }
8683
8684 /// Sets the value of [backend_type][crate::model::LoadBalancerInfo::backend_type].
8685 ///
8686 /// # Example
8687 /// ```ignore,no_run
8688 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
8689 /// use google_cloud_networkmanagement_v1::model::load_balancer_info::BackendType;
8690 /// let x0 = LoadBalancerInfo::new().set_backend_type(BackendType::BackendService);
8691 /// let x1 = LoadBalancerInfo::new().set_backend_type(BackendType::TargetPool);
8692 /// let x2 = LoadBalancerInfo::new().set_backend_type(BackendType::TargetInstance);
8693 /// ```
8694 pub fn set_backend_type<
8695 T: std::convert::Into<crate::model::load_balancer_info::BackendType>,
8696 >(
8697 mut self,
8698 v: T,
8699 ) -> Self {
8700 self.backend_type = v.into();
8701 self
8702 }
8703
8704 /// Sets the value of [backend_uri][crate::model::LoadBalancerInfo::backend_uri].
8705 ///
8706 /// # Example
8707 /// ```ignore,no_run
8708 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerInfo;
8709 /// let x = LoadBalancerInfo::new().set_backend_uri("example");
8710 /// ```
8711 pub fn set_backend_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8712 self.backend_uri = v.into();
8713 self
8714 }
8715}
8716
8717impl wkt::message::Message for LoadBalancerInfo {
8718 fn typename() -> &'static str {
8719 "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerInfo"
8720 }
8721}
8722
8723/// Defines additional types related to [LoadBalancerInfo].
8724pub mod load_balancer_info {
8725 #[allow(unused_imports)]
8726 use super::*;
8727
8728 /// The type definition for a load balancer:
8729 ///
8730 /// # Working with unknown values
8731 ///
8732 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8733 /// additional enum variants at any time. Adding new variants is not considered
8734 /// a breaking change. Applications should write their code in anticipation of:
8735 ///
8736 /// - New values appearing in future releases of the client library, **and**
8737 /// - New values received dynamically, without application changes.
8738 ///
8739 /// Please consult the [Working with enums] section in the user guide for some
8740 /// guidelines.
8741 ///
8742 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8743 #[derive(Clone, Debug, PartialEq)]
8744 #[non_exhaustive]
8745 pub enum LoadBalancerType {
8746 /// Type is unspecified.
8747 Unspecified,
8748 /// Internal TCP/UDP load balancer.
8749 InternalTcpUdp,
8750 /// Network TCP/UDP load balancer.
8751 NetworkTcpUdp,
8752 /// HTTP(S) proxy load balancer.
8753 HttpProxy,
8754 /// TCP proxy load balancer.
8755 TcpProxy,
8756 /// SSL proxy load balancer.
8757 SslProxy,
8758 /// If set, the enum was initialized with an unknown value.
8759 ///
8760 /// Applications can examine the value using [LoadBalancerType::value] or
8761 /// [LoadBalancerType::name].
8762 UnknownValue(load_balancer_type::UnknownValue),
8763 }
8764
8765 #[doc(hidden)]
8766 pub mod load_balancer_type {
8767 #[allow(unused_imports)]
8768 use super::*;
8769 #[derive(Clone, Debug, PartialEq)]
8770 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8771 }
8772
8773 impl LoadBalancerType {
8774 /// Gets the enum value.
8775 ///
8776 /// Returns `None` if the enum contains an unknown value deserialized from
8777 /// the string representation of enums.
8778 pub fn value(&self) -> std::option::Option<i32> {
8779 match self {
8780 Self::Unspecified => std::option::Option::Some(0),
8781 Self::InternalTcpUdp => std::option::Option::Some(1),
8782 Self::NetworkTcpUdp => std::option::Option::Some(2),
8783 Self::HttpProxy => std::option::Option::Some(3),
8784 Self::TcpProxy => std::option::Option::Some(4),
8785 Self::SslProxy => std::option::Option::Some(5),
8786 Self::UnknownValue(u) => u.0.value(),
8787 }
8788 }
8789
8790 /// Gets the enum value as a string.
8791 ///
8792 /// Returns `None` if the enum contains an unknown value deserialized from
8793 /// the integer representation of enums.
8794 pub fn name(&self) -> std::option::Option<&str> {
8795 match self {
8796 Self::Unspecified => std::option::Option::Some("LOAD_BALANCER_TYPE_UNSPECIFIED"),
8797 Self::InternalTcpUdp => std::option::Option::Some("INTERNAL_TCP_UDP"),
8798 Self::NetworkTcpUdp => std::option::Option::Some("NETWORK_TCP_UDP"),
8799 Self::HttpProxy => std::option::Option::Some("HTTP_PROXY"),
8800 Self::TcpProxy => std::option::Option::Some("TCP_PROXY"),
8801 Self::SslProxy => std::option::Option::Some("SSL_PROXY"),
8802 Self::UnknownValue(u) => u.0.name(),
8803 }
8804 }
8805 }
8806
8807 impl std::default::Default for LoadBalancerType {
8808 fn default() -> Self {
8809 use std::convert::From;
8810 Self::from(0)
8811 }
8812 }
8813
8814 impl std::fmt::Display for LoadBalancerType {
8815 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8816 wkt::internal::display_enum(f, self.name(), self.value())
8817 }
8818 }
8819
8820 impl std::convert::From<i32> for LoadBalancerType {
8821 fn from(value: i32) -> Self {
8822 match value {
8823 0 => Self::Unspecified,
8824 1 => Self::InternalTcpUdp,
8825 2 => Self::NetworkTcpUdp,
8826 3 => Self::HttpProxy,
8827 4 => Self::TcpProxy,
8828 5 => Self::SslProxy,
8829 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
8830 wkt::internal::UnknownEnumValue::Integer(value),
8831 )),
8832 }
8833 }
8834 }
8835
8836 impl std::convert::From<&str> for LoadBalancerType {
8837 fn from(value: &str) -> Self {
8838 use std::string::ToString;
8839 match value {
8840 "LOAD_BALANCER_TYPE_UNSPECIFIED" => Self::Unspecified,
8841 "INTERNAL_TCP_UDP" => Self::InternalTcpUdp,
8842 "NETWORK_TCP_UDP" => Self::NetworkTcpUdp,
8843 "HTTP_PROXY" => Self::HttpProxy,
8844 "TCP_PROXY" => Self::TcpProxy,
8845 "SSL_PROXY" => Self::SslProxy,
8846 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
8847 wkt::internal::UnknownEnumValue::String(value.to_string()),
8848 )),
8849 }
8850 }
8851 }
8852
8853 impl serde::ser::Serialize for LoadBalancerType {
8854 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8855 where
8856 S: serde::Serializer,
8857 {
8858 match self {
8859 Self::Unspecified => serializer.serialize_i32(0),
8860 Self::InternalTcpUdp => serializer.serialize_i32(1),
8861 Self::NetworkTcpUdp => serializer.serialize_i32(2),
8862 Self::HttpProxy => serializer.serialize_i32(3),
8863 Self::TcpProxy => serializer.serialize_i32(4),
8864 Self::SslProxy => serializer.serialize_i32(5),
8865 Self::UnknownValue(u) => u.0.serialize(serializer),
8866 }
8867 }
8868 }
8869
8870 impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
8871 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8872 where
8873 D: serde::Deserializer<'de>,
8874 {
8875 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
8876 ".google.cloud.networkmanagement.v1.LoadBalancerInfo.LoadBalancerType",
8877 ))
8878 }
8879 }
8880
8881 /// The type definition for a load balancer backend configuration:
8882 ///
8883 /// # Working with unknown values
8884 ///
8885 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8886 /// additional enum variants at any time. Adding new variants is not considered
8887 /// a breaking change. Applications should write their code in anticipation of:
8888 ///
8889 /// - New values appearing in future releases of the client library, **and**
8890 /// - New values received dynamically, without application changes.
8891 ///
8892 /// Please consult the [Working with enums] section in the user guide for some
8893 /// guidelines.
8894 ///
8895 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8896 #[derive(Clone, Debug, PartialEq)]
8897 #[non_exhaustive]
8898 pub enum BackendType {
8899 /// Type is unspecified.
8900 Unspecified,
8901 /// Backend Service as the load balancer's backend.
8902 BackendService,
8903 /// Target Pool as the load balancer's backend.
8904 TargetPool,
8905 /// Target Instance as the load balancer's backend.
8906 TargetInstance,
8907 /// If set, the enum was initialized with an unknown value.
8908 ///
8909 /// Applications can examine the value using [BackendType::value] or
8910 /// [BackendType::name].
8911 UnknownValue(backend_type::UnknownValue),
8912 }
8913
8914 #[doc(hidden)]
8915 pub mod backend_type {
8916 #[allow(unused_imports)]
8917 use super::*;
8918 #[derive(Clone, Debug, PartialEq)]
8919 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8920 }
8921
8922 impl BackendType {
8923 /// Gets the enum value.
8924 ///
8925 /// Returns `None` if the enum contains an unknown value deserialized from
8926 /// the string representation of enums.
8927 pub fn value(&self) -> std::option::Option<i32> {
8928 match self {
8929 Self::Unspecified => std::option::Option::Some(0),
8930 Self::BackendService => std::option::Option::Some(1),
8931 Self::TargetPool => std::option::Option::Some(2),
8932 Self::TargetInstance => std::option::Option::Some(3),
8933 Self::UnknownValue(u) => u.0.value(),
8934 }
8935 }
8936
8937 /// Gets the enum value as a string.
8938 ///
8939 /// Returns `None` if the enum contains an unknown value deserialized from
8940 /// the integer representation of enums.
8941 pub fn name(&self) -> std::option::Option<&str> {
8942 match self {
8943 Self::Unspecified => std::option::Option::Some("BACKEND_TYPE_UNSPECIFIED"),
8944 Self::BackendService => std::option::Option::Some("BACKEND_SERVICE"),
8945 Self::TargetPool => std::option::Option::Some("TARGET_POOL"),
8946 Self::TargetInstance => std::option::Option::Some("TARGET_INSTANCE"),
8947 Self::UnknownValue(u) => u.0.name(),
8948 }
8949 }
8950 }
8951
8952 impl std::default::Default for BackendType {
8953 fn default() -> Self {
8954 use std::convert::From;
8955 Self::from(0)
8956 }
8957 }
8958
8959 impl std::fmt::Display for BackendType {
8960 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8961 wkt::internal::display_enum(f, self.name(), self.value())
8962 }
8963 }
8964
8965 impl std::convert::From<i32> for BackendType {
8966 fn from(value: i32) -> Self {
8967 match value {
8968 0 => Self::Unspecified,
8969 1 => Self::BackendService,
8970 2 => Self::TargetPool,
8971 3 => Self::TargetInstance,
8972 _ => Self::UnknownValue(backend_type::UnknownValue(
8973 wkt::internal::UnknownEnumValue::Integer(value),
8974 )),
8975 }
8976 }
8977 }
8978
8979 impl std::convert::From<&str> for BackendType {
8980 fn from(value: &str) -> Self {
8981 use std::string::ToString;
8982 match value {
8983 "BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
8984 "BACKEND_SERVICE" => Self::BackendService,
8985 "TARGET_POOL" => Self::TargetPool,
8986 "TARGET_INSTANCE" => Self::TargetInstance,
8987 _ => Self::UnknownValue(backend_type::UnknownValue(
8988 wkt::internal::UnknownEnumValue::String(value.to_string()),
8989 )),
8990 }
8991 }
8992 }
8993
8994 impl serde::ser::Serialize for BackendType {
8995 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8996 where
8997 S: serde::Serializer,
8998 {
8999 match self {
9000 Self::Unspecified => serializer.serialize_i32(0),
9001 Self::BackendService => serializer.serialize_i32(1),
9002 Self::TargetPool => serializer.serialize_i32(2),
9003 Self::TargetInstance => serializer.serialize_i32(3),
9004 Self::UnknownValue(u) => u.0.serialize(serializer),
9005 }
9006 }
9007 }
9008
9009 impl<'de> serde::de::Deserialize<'de> for BackendType {
9010 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9011 where
9012 D: serde::Deserializer<'de>,
9013 {
9014 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackendType>::new(
9015 ".google.cloud.networkmanagement.v1.LoadBalancerInfo.BackendType",
9016 ))
9017 }
9018 }
9019}
9020
9021/// For display only. Metadata associated with a specific load balancer backend.
9022#[derive(Clone, Default, PartialEq)]
9023#[non_exhaustive]
9024pub struct LoadBalancerBackend {
9025 /// Name of a Compute Engine instance or network endpoint.
9026 pub display_name: std::string::String,
9027
9028 /// URI of a Compute Engine instance or network endpoint.
9029 pub uri: std::string::String,
9030
9031 /// State of the health check firewall configuration.
9032 pub health_check_firewall_state: crate::model::load_balancer_backend::HealthCheckFirewallState,
9033
9034 /// A list of firewall rule URIs allowing probes from health check IP ranges.
9035 pub health_check_allowing_firewall_rules: std::vec::Vec<std::string::String>,
9036
9037 /// A list of firewall rule URIs blocking probes from health check IP ranges.
9038 pub health_check_blocking_firewall_rules: std::vec::Vec<std::string::String>,
9039
9040 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9041}
9042
9043impl LoadBalancerBackend {
9044 pub fn new() -> Self {
9045 std::default::Default::default()
9046 }
9047
9048 /// Sets the value of [display_name][crate::model::LoadBalancerBackend::display_name].
9049 ///
9050 /// # Example
9051 /// ```ignore,no_run
9052 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9053 /// let x = LoadBalancerBackend::new().set_display_name("example");
9054 /// ```
9055 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9056 self.display_name = v.into();
9057 self
9058 }
9059
9060 /// Sets the value of [uri][crate::model::LoadBalancerBackend::uri].
9061 ///
9062 /// # Example
9063 /// ```ignore,no_run
9064 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9065 /// let x = LoadBalancerBackend::new().set_uri("example");
9066 /// ```
9067 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9068 self.uri = v.into();
9069 self
9070 }
9071
9072 /// Sets the value of [health_check_firewall_state][crate::model::LoadBalancerBackend::health_check_firewall_state].
9073 ///
9074 /// # Example
9075 /// ```ignore,no_run
9076 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9077 /// use google_cloud_networkmanagement_v1::model::load_balancer_backend::HealthCheckFirewallState;
9078 /// let x0 = LoadBalancerBackend::new().set_health_check_firewall_state(HealthCheckFirewallState::Configured);
9079 /// let x1 = LoadBalancerBackend::new().set_health_check_firewall_state(HealthCheckFirewallState::Misconfigured);
9080 /// ```
9081 pub fn set_health_check_firewall_state<
9082 T: std::convert::Into<crate::model::load_balancer_backend::HealthCheckFirewallState>,
9083 >(
9084 mut self,
9085 v: T,
9086 ) -> Self {
9087 self.health_check_firewall_state = v.into();
9088 self
9089 }
9090
9091 /// Sets the value of [health_check_allowing_firewall_rules][crate::model::LoadBalancerBackend::health_check_allowing_firewall_rules].
9092 ///
9093 /// # Example
9094 /// ```ignore,no_run
9095 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9096 /// let x = LoadBalancerBackend::new().set_health_check_allowing_firewall_rules(["a", "b", "c"]);
9097 /// ```
9098 pub fn set_health_check_allowing_firewall_rules<T, V>(mut self, v: T) -> Self
9099 where
9100 T: std::iter::IntoIterator<Item = V>,
9101 V: std::convert::Into<std::string::String>,
9102 {
9103 use std::iter::Iterator;
9104 self.health_check_allowing_firewall_rules = v.into_iter().map(|i| i.into()).collect();
9105 self
9106 }
9107
9108 /// Sets the value of [health_check_blocking_firewall_rules][crate::model::LoadBalancerBackend::health_check_blocking_firewall_rules].
9109 ///
9110 /// # Example
9111 /// ```ignore,no_run
9112 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackend;
9113 /// let x = LoadBalancerBackend::new().set_health_check_blocking_firewall_rules(["a", "b", "c"]);
9114 /// ```
9115 pub fn set_health_check_blocking_firewall_rules<T, V>(mut self, v: T) -> Self
9116 where
9117 T: std::iter::IntoIterator<Item = V>,
9118 V: std::convert::Into<std::string::String>,
9119 {
9120 use std::iter::Iterator;
9121 self.health_check_blocking_firewall_rules = v.into_iter().map(|i| i.into()).collect();
9122 self
9123 }
9124}
9125
9126impl wkt::message::Message for LoadBalancerBackend {
9127 fn typename() -> &'static str {
9128 "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerBackend"
9129 }
9130}
9131
9132/// Defines additional types related to [LoadBalancerBackend].
9133pub mod load_balancer_backend {
9134 #[allow(unused_imports)]
9135 use super::*;
9136
9137 /// State of a health check firewall configuration:
9138 ///
9139 /// # Working with unknown values
9140 ///
9141 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9142 /// additional enum variants at any time. Adding new variants is not considered
9143 /// a breaking change. Applications should write their code in anticipation of:
9144 ///
9145 /// - New values appearing in future releases of the client library, **and**
9146 /// - New values received dynamically, without application changes.
9147 ///
9148 /// Please consult the [Working with enums] section in the user guide for some
9149 /// guidelines.
9150 ///
9151 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9152 #[derive(Clone, Debug, PartialEq)]
9153 #[non_exhaustive]
9154 pub enum HealthCheckFirewallState {
9155 /// State is unspecified. Default state if not populated.
9156 Unspecified,
9157 /// There are configured firewall rules to allow health check probes to the
9158 /// backend.
9159 Configured,
9160 /// There are firewall rules configured to allow partial health check ranges
9161 /// or block all health check ranges.
9162 /// If a health check probe is sent from denied IP ranges,
9163 /// the health check to the backend will fail. Then, the backend will be
9164 /// marked unhealthy and will not receive traffic sent to the load balancer.
9165 Misconfigured,
9166 /// If set, the enum was initialized with an unknown value.
9167 ///
9168 /// Applications can examine the value using [HealthCheckFirewallState::value] or
9169 /// [HealthCheckFirewallState::name].
9170 UnknownValue(health_check_firewall_state::UnknownValue),
9171 }
9172
9173 #[doc(hidden)]
9174 pub mod health_check_firewall_state {
9175 #[allow(unused_imports)]
9176 use super::*;
9177 #[derive(Clone, Debug, PartialEq)]
9178 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9179 }
9180
9181 impl HealthCheckFirewallState {
9182 /// Gets the enum value.
9183 ///
9184 /// Returns `None` if the enum contains an unknown value deserialized from
9185 /// the string representation of enums.
9186 pub fn value(&self) -> std::option::Option<i32> {
9187 match self {
9188 Self::Unspecified => std::option::Option::Some(0),
9189 Self::Configured => std::option::Option::Some(1),
9190 Self::Misconfigured => std::option::Option::Some(2),
9191 Self::UnknownValue(u) => u.0.value(),
9192 }
9193 }
9194
9195 /// Gets the enum value as a string.
9196 ///
9197 /// Returns `None` if the enum contains an unknown value deserialized from
9198 /// the integer representation of enums.
9199 pub fn name(&self) -> std::option::Option<&str> {
9200 match self {
9201 Self::Unspecified => {
9202 std::option::Option::Some("HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED")
9203 }
9204 Self::Configured => std::option::Option::Some("CONFIGURED"),
9205 Self::Misconfigured => std::option::Option::Some("MISCONFIGURED"),
9206 Self::UnknownValue(u) => u.0.name(),
9207 }
9208 }
9209 }
9210
9211 impl std::default::Default for HealthCheckFirewallState {
9212 fn default() -> Self {
9213 use std::convert::From;
9214 Self::from(0)
9215 }
9216 }
9217
9218 impl std::fmt::Display for HealthCheckFirewallState {
9219 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9220 wkt::internal::display_enum(f, self.name(), self.value())
9221 }
9222 }
9223
9224 impl std::convert::From<i32> for HealthCheckFirewallState {
9225 fn from(value: i32) -> Self {
9226 match value {
9227 0 => Self::Unspecified,
9228 1 => Self::Configured,
9229 2 => Self::Misconfigured,
9230 _ => Self::UnknownValue(health_check_firewall_state::UnknownValue(
9231 wkt::internal::UnknownEnumValue::Integer(value),
9232 )),
9233 }
9234 }
9235 }
9236
9237 impl std::convert::From<&str> for HealthCheckFirewallState {
9238 fn from(value: &str) -> Self {
9239 use std::string::ToString;
9240 match value {
9241 "HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED" => Self::Unspecified,
9242 "CONFIGURED" => Self::Configured,
9243 "MISCONFIGURED" => Self::Misconfigured,
9244 _ => Self::UnknownValue(health_check_firewall_state::UnknownValue(
9245 wkt::internal::UnknownEnumValue::String(value.to_string()),
9246 )),
9247 }
9248 }
9249 }
9250
9251 impl serde::ser::Serialize for HealthCheckFirewallState {
9252 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9253 where
9254 S: serde::Serializer,
9255 {
9256 match self {
9257 Self::Unspecified => serializer.serialize_i32(0),
9258 Self::Configured => serializer.serialize_i32(1),
9259 Self::Misconfigured => serializer.serialize_i32(2),
9260 Self::UnknownValue(u) => u.0.serialize(serializer),
9261 }
9262 }
9263 }
9264
9265 impl<'de> serde::de::Deserialize<'de> for HealthCheckFirewallState {
9266 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9267 where
9268 D: serde::Deserializer<'de>,
9269 {
9270 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HealthCheckFirewallState>::new(
9271 ".google.cloud.networkmanagement.v1.LoadBalancerBackend.HealthCheckFirewallState"))
9272 }
9273 }
9274}
9275
9276/// For display only. Metadata associated with a hybrid subnet.
9277#[derive(Clone, Default, PartialEq)]
9278#[non_exhaustive]
9279pub struct HybridSubnetInfo {
9280 /// Name of a hybrid subnet.
9281 pub display_name: std::string::String,
9282
9283 /// URI of a hybrid subnet.
9284 pub uri: std::string::String,
9285
9286 /// Name of a Google Cloud region where the hybrid subnet is configured.
9287 pub region: std::string::String,
9288
9289 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9290}
9291
9292impl HybridSubnetInfo {
9293 pub fn new() -> Self {
9294 std::default::Default::default()
9295 }
9296
9297 /// Sets the value of [display_name][crate::model::HybridSubnetInfo::display_name].
9298 ///
9299 /// # Example
9300 /// ```ignore,no_run
9301 /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
9302 /// let x = HybridSubnetInfo::new().set_display_name("example");
9303 /// ```
9304 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9305 self.display_name = v.into();
9306 self
9307 }
9308
9309 /// Sets the value of [uri][crate::model::HybridSubnetInfo::uri].
9310 ///
9311 /// # Example
9312 /// ```ignore,no_run
9313 /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
9314 /// let x = HybridSubnetInfo::new().set_uri("example");
9315 /// ```
9316 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9317 self.uri = v.into();
9318 self
9319 }
9320
9321 /// Sets the value of [region][crate::model::HybridSubnetInfo::region].
9322 ///
9323 /// # Example
9324 /// ```ignore,no_run
9325 /// # use google_cloud_networkmanagement_v1::model::HybridSubnetInfo;
9326 /// let x = HybridSubnetInfo::new().set_region("example");
9327 /// ```
9328 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9329 self.region = v.into();
9330 self
9331 }
9332}
9333
9334impl wkt::message::Message for HybridSubnetInfo {
9335 fn typename() -> &'static str {
9336 "type.googleapis.com/google.cloud.networkmanagement.v1.HybridSubnetInfo"
9337 }
9338}
9339
9340/// For display only. Metadata associated with a Compute Engine VPN gateway.
9341#[derive(Clone, Default, PartialEq)]
9342#[non_exhaustive]
9343pub struct VpnGatewayInfo {
9344 /// Name of a VPN gateway.
9345 pub display_name: std::string::String,
9346
9347 /// URI of a VPN gateway.
9348 pub uri: std::string::String,
9349
9350 /// URI of a Compute Engine network where the VPN gateway is configured.
9351 pub network_uri: std::string::String,
9352
9353 /// IP address of the VPN gateway.
9354 pub ip_address: std::string::String,
9355
9356 /// A VPN tunnel that is associated with this VPN gateway.
9357 /// There may be multiple VPN tunnels configured on a VPN gateway, and only
9358 /// the one relevant to the test is displayed.
9359 pub vpn_tunnel_uri: std::string::String,
9360
9361 /// Name of a Google Cloud region where this VPN gateway is configured.
9362 pub region: std::string::String,
9363
9364 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9365}
9366
9367impl VpnGatewayInfo {
9368 pub fn new() -> Self {
9369 std::default::Default::default()
9370 }
9371
9372 /// Sets the value of [display_name][crate::model::VpnGatewayInfo::display_name].
9373 ///
9374 /// # Example
9375 /// ```ignore,no_run
9376 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
9377 /// let x = VpnGatewayInfo::new().set_display_name("example");
9378 /// ```
9379 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9380 self.display_name = v.into();
9381 self
9382 }
9383
9384 /// Sets the value of [uri][crate::model::VpnGatewayInfo::uri].
9385 ///
9386 /// # Example
9387 /// ```ignore,no_run
9388 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
9389 /// let x = VpnGatewayInfo::new().set_uri("example");
9390 /// ```
9391 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9392 self.uri = v.into();
9393 self
9394 }
9395
9396 /// Sets the value of [network_uri][crate::model::VpnGatewayInfo::network_uri].
9397 ///
9398 /// # Example
9399 /// ```ignore,no_run
9400 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
9401 /// let x = VpnGatewayInfo::new().set_network_uri("example");
9402 /// ```
9403 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9404 self.network_uri = v.into();
9405 self
9406 }
9407
9408 /// Sets the value of [ip_address][crate::model::VpnGatewayInfo::ip_address].
9409 ///
9410 /// # Example
9411 /// ```ignore,no_run
9412 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
9413 /// let x = VpnGatewayInfo::new().set_ip_address("example");
9414 /// ```
9415 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9416 self.ip_address = v.into();
9417 self
9418 }
9419
9420 /// Sets the value of [vpn_tunnel_uri][crate::model::VpnGatewayInfo::vpn_tunnel_uri].
9421 ///
9422 /// # Example
9423 /// ```ignore,no_run
9424 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
9425 /// let x = VpnGatewayInfo::new().set_vpn_tunnel_uri("example");
9426 /// ```
9427 pub fn set_vpn_tunnel_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9428 self.vpn_tunnel_uri = v.into();
9429 self
9430 }
9431
9432 /// Sets the value of [region][crate::model::VpnGatewayInfo::region].
9433 ///
9434 /// # Example
9435 /// ```ignore,no_run
9436 /// # use google_cloud_networkmanagement_v1::model::VpnGatewayInfo;
9437 /// let x = VpnGatewayInfo::new().set_region("example");
9438 /// ```
9439 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9440 self.region = v.into();
9441 self
9442 }
9443}
9444
9445impl wkt::message::Message for VpnGatewayInfo {
9446 fn typename() -> &'static str {
9447 "type.googleapis.com/google.cloud.networkmanagement.v1.VpnGatewayInfo"
9448 }
9449}
9450
9451/// For display only. Metadata associated with a Compute Engine VPN tunnel.
9452#[derive(Clone, Default, PartialEq)]
9453#[non_exhaustive]
9454pub struct VpnTunnelInfo {
9455 /// Name of a VPN tunnel.
9456 pub display_name: std::string::String,
9457
9458 /// URI of a VPN tunnel.
9459 pub uri: std::string::String,
9460
9461 /// URI of the VPN gateway at local end of the tunnel.
9462 pub source_gateway: std::string::String,
9463
9464 /// URI of a VPN gateway at remote end of the tunnel.
9465 pub remote_gateway: std::string::String,
9466
9467 /// Remote VPN gateway's IP address.
9468 pub remote_gateway_ip: std::string::String,
9469
9470 /// Local VPN gateway's IP address.
9471 pub source_gateway_ip: std::string::String,
9472
9473 /// URI of a Compute Engine network where the VPN tunnel is configured.
9474 pub network_uri: std::string::String,
9475
9476 /// Name of a Google Cloud region where this VPN tunnel is configured.
9477 pub region: std::string::String,
9478
9479 /// Type of the routing policy.
9480 pub routing_type: crate::model::vpn_tunnel_info::RoutingType,
9481
9482 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9483}
9484
9485impl VpnTunnelInfo {
9486 pub fn new() -> Self {
9487 std::default::Default::default()
9488 }
9489
9490 /// Sets the value of [display_name][crate::model::VpnTunnelInfo::display_name].
9491 ///
9492 /// # Example
9493 /// ```ignore,no_run
9494 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9495 /// let x = VpnTunnelInfo::new().set_display_name("example");
9496 /// ```
9497 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9498 self.display_name = v.into();
9499 self
9500 }
9501
9502 /// Sets the value of [uri][crate::model::VpnTunnelInfo::uri].
9503 ///
9504 /// # Example
9505 /// ```ignore,no_run
9506 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9507 /// let x = VpnTunnelInfo::new().set_uri("example");
9508 /// ```
9509 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9510 self.uri = v.into();
9511 self
9512 }
9513
9514 /// Sets the value of [source_gateway][crate::model::VpnTunnelInfo::source_gateway].
9515 ///
9516 /// # Example
9517 /// ```ignore,no_run
9518 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9519 /// let x = VpnTunnelInfo::new().set_source_gateway("example");
9520 /// ```
9521 pub fn set_source_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9522 self.source_gateway = v.into();
9523 self
9524 }
9525
9526 /// Sets the value of [remote_gateway][crate::model::VpnTunnelInfo::remote_gateway].
9527 ///
9528 /// # Example
9529 /// ```ignore,no_run
9530 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9531 /// let x = VpnTunnelInfo::new().set_remote_gateway("example");
9532 /// ```
9533 pub fn set_remote_gateway<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9534 self.remote_gateway = v.into();
9535 self
9536 }
9537
9538 /// Sets the value of [remote_gateway_ip][crate::model::VpnTunnelInfo::remote_gateway_ip].
9539 ///
9540 /// # Example
9541 /// ```ignore,no_run
9542 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9543 /// let x = VpnTunnelInfo::new().set_remote_gateway_ip("example");
9544 /// ```
9545 pub fn set_remote_gateway_ip<T: std::convert::Into<std::string::String>>(
9546 mut self,
9547 v: T,
9548 ) -> Self {
9549 self.remote_gateway_ip = v.into();
9550 self
9551 }
9552
9553 /// Sets the value of [source_gateway_ip][crate::model::VpnTunnelInfo::source_gateway_ip].
9554 ///
9555 /// # Example
9556 /// ```ignore,no_run
9557 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9558 /// let x = VpnTunnelInfo::new().set_source_gateway_ip("example");
9559 /// ```
9560 pub fn set_source_gateway_ip<T: std::convert::Into<std::string::String>>(
9561 mut self,
9562 v: T,
9563 ) -> Self {
9564 self.source_gateway_ip = v.into();
9565 self
9566 }
9567
9568 /// Sets the value of [network_uri][crate::model::VpnTunnelInfo::network_uri].
9569 ///
9570 /// # Example
9571 /// ```ignore,no_run
9572 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9573 /// let x = VpnTunnelInfo::new().set_network_uri("example");
9574 /// ```
9575 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9576 self.network_uri = v.into();
9577 self
9578 }
9579
9580 /// Sets the value of [region][crate::model::VpnTunnelInfo::region].
9581 ///
9582 /// # Example
9583 /// ```ignore,no_run
9584 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9585 /// let x = VpnTunnelInfo::new().set_region("example");
9586 /// ```
9587 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9588 self.region = v.into();
9589 self
9590 }
9591
9592 /// Sets the value of [routing_type][crate::model::VpnTunnelInfo::routing_type].
9593 ///
9594 /// # Example
9595 /// ```ignore,no_run
9596 /// # use google_cloud_networkmanagement_v1::model::VpnTunnelInfo;
9597 /// use google_cloud_networkmanagement_v1::model::vpn_tunnel_info::RoutingType;
9598 /// let x0 = VpnTunnelInfo::new().set_routing_type(RoutingType::RouteBased);
9599 /// let x1 = VpnTunnelInfo::new().set_routing_type(RoutingType::PolicyBased);
9600 /// let x2 = VpnTunnelInfo::new().set_routing_type(RoutingType::Dynamic);
9601 /// ```
9602 pub fn set_routing_type<T: std::convert::Into<crate::model::vpn_tunnel_info::RoutingType>>(
9603 mut self,
9604 v: T,
9605 ) -> Self {
9606 self.routing_type = v.into();
9607 self
9608 }
9609}
9610
9611impl wkt::message::Message for VpnTunnelInfo {
9612 fn typename() -> &'static str {
9613 "type.googleapis.com/google.cloud.networkmanagement.v1.VpnTunnelInfo"
9614 }
9615}
9616
9617/// Defines additional types related to [VpnTunnelInfo].
9618pub mod vpn_tunnel_info {
9619 #[allow(unused_imports)]
9620 use super::*;
9621
9622 /// Types of VPN routing policy. For details, refer to [Networks and Tunnel
9623 /// routing](https://cloud.google.com/network-connectivity/docs/vpn/concepts/choosing-networks-routing/).
9624 ///
9625 /// # Working with unknown values
9626 ///
9627 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9628 /// additional enum variants at any time. Adding new variants is not considered
9629 /// a breaking change. Applications should write their code in anticipation of:
9630 ///
9631 /// - New values appearing in future releases of the client library, **and**
9632 /// - New values received dynamically, without application changes.
9633 ///
9634 /// Please consult the [Working with enums] section in the user guide for some
9635 /// guidelines.
9636 ///
9637 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9638 #[derive(Clone, Debug, PartialEq)]
9639 #[non_exhaustive]
9640 pub enum RoutingType {
9641 /// Unspecified type. Default value.
9642 Unspecified,
9643 /// Route based VPN.
9644 RouteBased,
9645 /// Policy based routing.
9646 PolicyBased,
9647 /// Dynamic (BGP) routing.
9648 Dynamic,
9649 /// If set, the enum was initialized with an unknown value.
9650 ///
9651 /// Applications can examine the value using [RoutingType::value] or
9652 /// [RoutingType::name].
9653 UnknownValue(routing_type::UnknownValue),
9654 }
9655
9656 #[doc(hidden)]
9657 pub mod routing_type {
9658 #[allow(unused_imports)]
9659 use super::*;
9660 #[derive(Clone, Debug, PartialEq)]
9661 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9662 }
9663
9664 impl RoutingType {
9665 /// Gets the enum value.
9666 ///
9667 /// Returns `None` if the enum contains an unknown value deserialized from
9668 /// the string representation of enums.
9669 pub fn value(&self) -> std::option::Option<i32> {
9670 match self {
9671 Self::Unspecified => std::option::Option::Some(0),
9672 Self::RouteBased => std::option::Option::Some(1),
9673 Self::PolicyBased => std::option::Option::Some(2),
9674 Self::Dynamic => std::option::Option::Some(3),
9675 Self::UnknownValue(u) => u.0.value(),
9676 }
9677 }
9678
9679 /// Gets the enum value as a string.
9680 ///
9681 /// Returns `None` if the enum contains an unknown value deserialized from
9682 /// the integer representation of enums.
9683 pub fn name(&self) -> std::option::Option<&str> {
9684 match self {
9685 Self::Unspecified => std::option::Option::Some("ROUTING_TYPE_UNSPECIFIED"),
9686 Self::RouteBased => std::option::Option::Some("ROUTE_BASED"),
9687 Self::PolicyBased => std::option::Option::Some("POLICY_BASED"),
9688 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
9689 Self::UnknownValue(u) => u.0.name(),
9690 }
9691 }
9692 }
9693
9694 impl std::default::Default for RoutingType {
9695 fn default() -> Self {
9696 use std::convert::From;
9697 Self::from(0)
9698 }
9699 }
9700
9701 impl std::fmt::Display for RoutingType {
9702 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9703 wkt::internal::display_enum(f, self.name(), self.value())
9704 }
9705 }
9706
9707 impl std::convert::From<i32> for RoutingType {
9708 fn from(value: i32) -> Self {
9709 match value {
9710 0 => Self::Unspecified,
9711 1 => Self::RouteBased,
9712 2 => Self::PolicyBased,
9713 3 => Self::Dynamic,
9714 _ => Self::UnknownValue(routing_type::UnknownValue(
9715 wkt::internal::UnknownEnumValue::Integer(value),
9716 )),
9717 }
9718 }
9719 }
9720
9721 impl std::convert::From<&str> for RoutingType {
9722 fn from(value: &str) -> Self {
9723 use std::string::ToString;
9724 match value {
9725 "ROUTING_TYPE_UNSPECIFIED" => Self::Unspecified,
9726 "ROUTE_BASED" => Self::RouteBased,
9727 "POLICY_BASED" => Self::PolicyBased,
9728 "DYNAMIC" => Self::Dynamic,
9729 _ => Self::UnknownValue(routing_type::UnknownValue(
9730 wkt::internal::UnknownEnumValue::String(value.to_string()),
9731 )),
9732 }
9733 }
9734 }
9735
9736 impl serde::ser::Serialize for RoutingType {
9737 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9738 where
9739 S: serde::Serializer,
9740 {
9741 match self {
9742 Self::Unspecified => serializer.serialize_i32(0),
9743 Self::RouteBased => serializer.serialize_i32(1),
9744 Self::PolicyBased => serializer.serialize_i32(2),
9745 Self::Dynamic => serializer.serialize_i32(3),
9746 Self::UnknownValue(u) => u.0.serialize(serializer),
9747 }
9748 }
9749 }
9750
9751 impl<'de> serde::de::Deserialize<'de> for RoutingType {
9752 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9753 where
9754 D: serde::Deserializer<'de>,
9755 {
9756 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutingType>::new(
9757 ".google.cloud.networkmanagement.v1.VpnTunnelInfo.RoutingType",
9758 ))
9759 }
9760 }
9761}
9762
9763/// For display only. Metadata associated with an Interconnect attachment.
9764#[derive(Clone, Default, PartialEq)]
9765#[non_exhaustive]
9766pub struct InterconnectAttachmentInfo {
9767 /// Name of an Interconnect attachment.
9768 pub display_name: std::string::String,
9769
9770 /// URI of an Interconnect attachment.
9771 pub uri: std::string::String,
9772
9773 /// URI of the Interconnect where the Interconnect attachment is
9774 /// configured.
9775 pub interconnect_uri: std::string::String,
9776
9777 /// Name of a Google Cloud region where the Interconnect attachment is
9778 /// configured.
9779 pub region: std::string::String,
9780
9781 /// URI of the Cloud Router to be used for dynamic routing.
9782 pub cloud_router_uri: std::string::String,
9783
9784 /// The type of interconnect attachment this is.
9785 pub r#type: crate::model::interconnect_attachment_info::Type,
9786
9787 /// Appliance IP address that was matched for L2_DEDICATED attachments.
9788 pub l2_attachment_matched_ip_address: std::string::String,
9789
9790 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9791}
9792
9793impl InterconnectAttachmentInfo {
9794 pub fn new() -> Self {
9795 std::default::Default::default()
9796 }
9797
9798 /// Sets the value of [display_name][crate::model::InterconnectAttachmentInfo::display_name].
9799 ///
9800 /// # Example
9801 /// ```ignore,no_run
9802 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
9803 /// let x = InterconnectAttachmentInfo::new().set_display_name("example");
9804 /// ```
9805 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9806 self.display_name = v.into();
9807 self
9808 }
9809
9810 /// Sets the value of [uri][crate::model::InterconnectAttachmentInfo::uri].
9811 ///
9812 /// # Example
9813 /// ```ignore,no_run
9814 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
9815 /// let x = InterconnectAttachmentInfo::new().set_uri("example");
9816 /// ```
9817 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9818 self.uri = v.into();
9819 self
9820 }
9821
9822 /// Sets the value of [interconnect_uri][crate::model::InterconnectAttachmentInfo::interconnect_uri].
9823 ///
9824 /// # Example
9825 /// ```ignore,no_run
9826 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
9827 /// let x = InterconnectAttachmentInfo::new().set_interconnect_uri("example");
9828 /// ```
9829 pub fn set_interconnect_uri<T: std::convert::Into<std::string::String>>(
9830 mut self,
9831 v: T,
9832 ) -> Self {
9833 self.interconnect_uri = v.into();
9834 self
9835 }
9836
9837 /// Sets the value of [region][crate::model::InterconnectAttachmentInfo::region].
9838 ///
9839 /// # Example
9840 /// ```ignore,no_run
9841 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
9842 /// let x = InterconnectAttachmentInfo::new().set_region("example");
9843 /// ```
9844 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9845 self.region = v.into();
9846 self
9847 }
9848
9849 /// Sets the value of [cloud_router_uri][crate::model::InterconnectAttachmentInfo::cloud_router_uri].
9850 ///
9851 /// # Example
9852 /// ```ignore,no_run
9853 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
9854 /// let x = InterconnectAttachmentInfo::new().set_cloud_router_uri("example");
9855 /// ```
9856 pub fn set_cloud_router_uri<T: std::convert::Into<std::string::String>>(
9857 mut self,
9858 v: T,
9859 ) -> Self {
9860 self.cloud_router_uri = v.into();
9861 self
9862 }
9863
9864 /// Sets the value of [r#type][crate::model::InterconnectAttachmentInfo::type].
9865 ///
9866 /// # Example
9867 /// ```ignore,no_run
9868 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
9869 /// use google_cloud_networkmanagement_v1::model::interconnect_attachment_info::Type;
9870 /// let x0 = InterconnectAttachmentInfo::new().set_type(Type::Dedicated);
9871 /// let x1 = InterconnectAttachmentInfo::new().set_type(Type::Partner);
9872 /// let x2 = InterconnectAttachmentInfo::new().set_type(Type::PartnerProvider);
9873 /// ```
9874 pub fn set_type<T: std::convert::Into<crate::model::interconnect_attachment_info::Type>>(
9875 mut self,
9876 v: T,
9877 ) -> Self {
9878 self.r#type = v.into();
9879 self
9880 }
9881
9882 /// Sets the value of [l2_attachment_matched_ip_address][crate::model::InterconnectAttachmentInfo::l2_attachment_matched_ip_address].
9883 ///
9884 /// # Example
9885 /// ```ignore,no_run
9886 /// # use google_cloud_networkmanagement_v1::model::InterconnectAttachmentInfo;
9887 /// let x = InterconnectAttachmentInfo::new().set_l2_attachment_matched_ip_address("example");
9888 /// ```
9889 pub fn set_l2_attachment_matched_ip_address<T: std::convert::Into<std::string::String>>(
9890 mut self,
9891 v: T,
9892 ) -> Self {
9893 self.l2_attachment_matched_ip_address = v.into();
9894 self
9895 }
9896}
9897
9898impl wkt::message::Message for InterconnectAttachmentInfo {
9899 fn typename() -> &'static str {
9900 "type.googleapis.com/google.cloud.networkmanagement.v1.InterconnectAttachmentInfo"
9901 }
9902}
9903
9904/// Defines additional types related to [InterconnectAttachmentInfo].
9905pub mod interconnect_attachment_info {
9906 #[allow(unused_imports)]
9907 use super::*;
9908
9909 /// What type of interconnect attachment this is.
9910 ///
9911 /// # Working with unknown values
9912 ///
9913 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9914 /// additional enum variants at any time. Adding new variants is not considered
9915 /// a breaking change. Applications should write their code in anticipation of:
9916 ///
9917 /// - New values appearing in future releases of the client library, **and**
9918 /// - New values received dynamically, without application changes.
9919 ///
9920 /// Please consult the [Working with enums] section in the user guide for some
9921 /// guidelines.
9922 ///
9923 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9924 #[derive(Clone, Debug, PartialEq)]
9925 #[non_exhaustive]
9926 pub enum Type {
9927 /// Unspecified type.
9928 Unspecified,
9929 /// Attachment to a dedicated interconnect.
9930 Dedicated,
9931 /// Attachment to a partner interconnect, created by the customer.
9932 Partner,
9933 /// Attachment to a partner interconnect, created by the partner.
9934 PartnerProvider,
9935 /// Attachment to a L2 interconnect, created by the customer.
9936 L2Dedicated,
9937 /// If set, the enum was initialized with an unknown value.
9938 ///
9939 /// Applications can examine the value using [Type::value] or
9940 /// [Type::name].
9941 UnknownValue(r#type::UnknownValue),
9942 }
9943
9944 #[doc(hidden)]
9945 pub mod r#type {
9946 #[allow(unused_imports)]
9947 use super::*;
9948 #[derive(Clone, Debug, PartialEq)]
9949 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9950 }
9951
9952 impl Type {
9953 /// Gets the enum value.
9954 ///
9955 /// Returns `None` if the enum contains an unknown value deserialized from
9956 /// the string representation of enums.
9957 pub fn value(&self) -> std::option::Option<i32> {
9958 match self {
9959 Self::Unspecified => std::option::Option::Some(0),
9960 Self::Dedicated => std::option::Option::Some(1),
9961 Self::Partner => std::option::Option::Some(2),
9962 Self::PartnerProvider => std::option::Option::Some(3),
9963 Self::L2Dedicated => std::option::Option::Some(4),
9964 Self::UnknownValue(u) => u.0.value(),
9965 }
9966 }
9967
9968 /// Gets the enum value as a string.
9969 ///
9970 /// Returns `None` if the enum contains an unknown value deserialized from
9971 /// the integer representation of enums.
9972 pub fn name(&self) -> std::option::Option<&str> {
9973 match self {
9974 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
9975 Self::Dedicated => std::option::Option::Some("DEDICATED"),
9976 Self::Partner => std::option::Option::Some("PARTNER"),
9977 Self::PartnerProvider => std::option::Option::Some("PARTNER_PROVIDER"),
9978 Self::L2Dedicated => std::option::Option::Some("L2_DEDICATED"),
9979 Self::UnknownValue(u) => u.0.name(),
9980 }
9981 }
9982 }
9983
9984 impl std::default::Default for Type {
9985 fn default() -> Self {
9986 use std::convert::From;
9987 Self::from(0)
9988 }
9989 }
9990
9991 impl std::fmt::Display for Type {
9992 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9993 wkt::internal::display_enum(f, self.name(), self.value())
9994 }
9995 }
9996
9997 impl std::convert::From<i32> for Type {
9998 fn from(value: i32) -> Self {
9999 match value {
10000 0 => Self::Unspecified,
10001 1 => Self::Dedicated,
10002 2 => Self::Partner,
10003 3 => Self::PartnerProvider,
10004 4 => Self::L2Dedicated,
10005 _ => Self::UnknownValue(r#type::UnknownValue(
10006 wkt::internal::UnknownEnumValue::Integer(value),
10007 )),
10008 }
10009 }
10010 }
10011
10012 impl std::convert::From<&str> for Type {
10013 fn from(value: &str) -> Self {
10014 use std::string::ToString;
10015 match value {
10016 "TYPE_UNSPECIFIED" => Self::Unspecified,
10017 "DEDICATED" => Self::Dedicated,
10018 "PARTNER" => Self::Partner,
10019 "PARTNER_PROVIDER" => Self::PartnerProvider,
10020 "L2_DEDICATED" => Self::L2Dedicated,
10021 _ => Self::UnknownValue(r#type::UnknownValue(
10022 wkt::internal::UnknownEnumValue::String(value.to_string()),
10023 )),
10024 }
10025 }
10026 }
10027
10028 impl serde::ser::Serialize for Type {
10029 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10030 where
10031 S: serde::Serializer,
10032 {
10033 match self {
10034 Self::Unspecified => serializer.serialize_i32(0),
10035 Self::Dedicated => serializer.serialize_i32(1),
10036 Self::Partner => serializer.serialize_i32(2),
10037 Self::PartnerProvider => serializer.serialize_i32(3),
10038 Self::L2Dedicated => serializer.serialize_i32(4),
10039 Self::UnknownValue(u) => u.0.serialize(serializer),
10040 }
10041 }
10042 }
10043
10044 impl<'de> serde::de::Deserialize<'de> for Type {
10045 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10046 where
10047 D: serde::Deserializer<'de>,
10048 {
10049 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
10050 ".google.cloud.networkmanagement.v1.InterconnectAttachmentInfo.Type",
10051 ))
10052 }
10053 }
10054}
10055
10056/// For display only. The specification of the endpoints for the test.
10057/// EndpointInfo is derived from source and destination Endpoint and validated
10058/// by the backend data plane model.
10059#[derive(Clone, Default, PartialEq)]
10060#[non_exhaustive]
10061pub struct EndpointInfo {
10062 /// Source IP address.
10063 pub source_ip: std::string::String,
10064
10065 /// Destination IP address.
10066 pub destination_ip: std::string::String,
10067
10068 /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
10069 pub protocol: std::string::String,
10070
10071 /// Source port. Only valid when protocol is TCP or UDP.
10072 pub source_port: i32,
10073
10074 /// Destination port. Only valid when protocol is TCP or UDP.
10075 pub destination_port: i32,
10076
10077 /// URI of the network where this packet originates from.
10078 pub source_network_uri: std::string::String,
10079
10080 /// URI of the network where this packet is sent to.
10081 pub destination_network_uri: std::string::String,
10082
10083 /// URI of the source telemetry agent this packet originates from.
10084 pub source_agent_uri: std::string::String,
10085
10086 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10087}
10088
10089impl EndpointInfo {
10090 pub fn new() -> Self {
10091 std::default::Default::default()
10092 }
10093
10094 /// Sets the value of [source_ip][crate::model::EndpointInfo::source_ip].
10095 ///
10096 /// # Example
10097 /// ```ignore,no_run
10098 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10099 /// let x = EndpointInfo::new().set_source_ip("example");
10100 /// ```
10101 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10102 self.source_ip = v.into();
10103 self
10104 }
10105
10106 /// Sets the value of [destination_ip][crate::model::EndpointInfo::destination_ip].
10107 ///
10108 /// # Example
10109 /// ```ignore,no_run
10110 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10111 /// let x = EndpointInfo::new().set_destination_ip("example");
10112 /// ```
10113 pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10114 self.destination_ip = v.into();
10115 self
10116 }
10117
10118 /// Sets the value of [protocol][crate::model::EndpointInfo::protocol].
10119 ///
10120 /// # Example
10121 /// ```ignore,no_run
10122 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10123 /// let x = EndpointInfo::new().set_protocol("example");
10124 /// ```
10125 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10126 self.protocol = v.into();
10127 self
10128 }
10129
10130 /// Sets the value of [source_port][crate::model::EndpointInfo::source_port].
10131 ///
10132 /// # Example
10133 /// ```ignore,no_run
10134 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10135 /// let x = EndpointInfo::new().set_source_port(42);
10136 /// ```
10137 pub fn set_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10138 self.source_port = v.into();
10139 self
10140 }
10141
10142 /// Sets the value of [destination_port][crate::model::EndpointInfo::destination_port].
10143 ///
10144 /// # Example
10145 /// ```ignore,no_run
10146 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10147 /// let x = EndpointInfo::new().set_destination_port(42);
10148 /// ```
10149 pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10150 self.destination_port = v.into();
10151 self
10152 }
10153
10154 /// Sets the value of [source_network_uri][crate::model::EndpointInfo::source_network_uri].
10155 ///
10156 /// # Example
10157 /// ```ignore,no_run
10158 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10159 /// let x = EndpointInfo::new().set_source_network_uri("example");
10160 /// ```
10161 pub fn set_source_network_uri<T: std::convert::Into<std::string::String>>(
10162 mut self,
10163 v: T,
10164 ) -> Self {
10165 self.source_network_uri = v.into();
10166 self
10167 }
10168
10169 /// Sets the value of [destination_network_uri][crate::model::EndpointInfo::destination_network_uri].
10170 ///
10171 /// # Example
10172 /// ```ignore,no_run
10173 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10174 /// let x = EndpointInfo::new().set_destination_network_uri("example");
10175 /// ```
10176 pub fn set_destination_network_uri<T: std::convert::Into<std::string::String>>(
10177 mut self,
10178 v: T,
10179 ) -> Self {
10180 self.destination_network_uri = v.into();
10181 self
10182 }
10183
10184 /// Sets the value of [source_agent_uri][crate::model::EndpointInfo::source_agent_uri].
10185 ///
10186 /// # Example
10187 /// ```ignore,no_run
10188 /// # use google_cloud_networkmanagement_v1::model::EndpointInfo;
10189 /// let x = EndpointInfo::new().set_source_agent_uri("example");
10190 /// ```
10191 pub fn set_source_agent_uri<T: std::convert::Into<std::string::String>>(
10192 mut self,
10193 v: T,
10194 ) -> Self {
10195 self.source_agent_uri = v.into();
10196 self
10197 }
10198}
10199
10200impl wkt::message::Message for EndpointInfo {
10201 fn typename() -> &'static str {
10202 "type.googleapis.com/google.cloud.networkmanagement.v1.EndpointInfo"
10203 }
10204}
10205
10206/// Details of the final state "deliver" and associated resource.
10207#[derive(Clone, Default, PartialEq)]
10208#[non_exhaustive]
10209pub struct DeliverInfo {
10210 /// Target type where the packet is delivered to.
10211 pub target: crate::model::deliver_info::Target,
10212
10213 /// URI of the resource that the packet is delivered to.
10214 pub resource_uri: std::string::String,
10215
10216 /// IP address of the target (if applicable).
10217 pub ip_address: std::string::String,
10218
10219 /// Name of the Cloud Storage Bucket the packet is delivered to (if
10220 /// applicable).
10221 pub storage_bucket: std::string::String,
10222
10223 /// PSC Google API target the packet is delivered to (if applicable).
10224 pub psc_google_api_target: std::string::String,
10225
10226 /// Recognized type of a Google Service the packet is delivered to (if
10227 /// applicable).
10228 pub google_service_type: crate::model::deliver_info::GoogleServiceType,
10229
10230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10231}
10232
10233impl DeliverInfo {
10234 pub fn new() -> Self {
10235 std::default::Default::default()
10236 }
10237
10238 /// Sets the value of [target][crate::model::DeliverInfo::target].
10239 ///
10240 /// # Example
10241 /// ```ignore,no_run
10242 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10243 /// use google_cloud_networkmanagement_v1::model::deliver_info::Target;
10244 /// let x0 = DeliverInfo::new().set_target(Target::Instance);
10245 /// let x1 = DeliverInfo::new().set_target(Target::Internet);
10246 /// let x2 = DeliverInfo::new().set_target(Target::GoogleApi);
10247 /// ```
10248 pub fn set_target<T: std::convert::Into<crate::model::deliver_info::Target>>(
10249 mut self,
10250 v: T,
10251 ) -> Self {
10252 self.target = v.into();
10253 self
10254 }
10255
10256 /// Sets the value of [resource_uri][crate::model::DeliverInfo::resource_uri].
10257 ///
10258 /// # Example
10259 /// ```ignore,no_run
10260 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10261 /// let x = DeliverInfo::new().set_resource_uri("example");
10262 /// ```
10263 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10264 self.resource_uri = v.into();
10265 self
10266 }
10267
10268 /// Sets the value of [ip_address][crate::model::DeliverInfo::ip_address].
10269 ///
10270 /// # Example
10271 /// ```ignore,no_run
10272 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10273 /// let x = DeliverInfo::new().set_ip_address("example");
10274 /// ```
10275 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10276 self.ip_address = v.into();
10277 self
10278 }
10279
10280 /// Sets the value of [storage_bucket][crate::model::DeliverInfo::storage_bucket].
10281 ///
10282 /// # Example
10283 /// ```ignore,no_run
10284 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10285 /// let x = DeliverInfo::new().set_storage_bucket("example");
10286 /// ```
10287 pub fn set_storage_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10288 self.storage_bucket = v.into();
10289 self
10290 }
10291
10292 /// Sets the value of [psc_google_api_target][crate::model::DeliverInfo::psc_google_api_target].
10293 ///
10294 /// # Example
10295 /// ```ignore,no_run
10296 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10297 /// let x = DeliverInfo::new().set_psc_google_api_target("example");
10298 /// ```
10299 pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
10300 mut self,
10301 v: T,
10302 ) -> Self {
10303 self.psc_google_api_target = v.into();
10304 self
10305 }
10306
10307 /// Sets the value of [google_service_type][crate::model::DeliverInfo::google_service_type].
10308 ///
10309 /// # Example
10310 /// ```ignore,no_run
10311 /// # use google_cloud_networkmanagement_v1::model::DeliverInfo;
10312 /// use google_cloud_networkmanagement_v1::model::deliver_info::GoogleServiceType;
10313 /// let x0 = DeliverInfo::new().set_google_service_type(GoogleServiceType::Iap);
10314 /// let x1 = DeliverInfo::new().set_google_service_type(GoogleServiceType::GfeProxyOrHealthCheckProber);
10315 /// let x2 = DeliverInfo::new().set_google_service_type(GoogleServiceType::CloudDns);
10316 /// ```
10317 pub fn set_google_service_type<
10318 T: std::convert::Into<crate::model::deliver_info::GoogleServiceType>,
10319 >(
10320 mut self,
10321 v: T,
10322 ) -> Self {
10323 self.google_service_type = v.into();
10324 self
10325 }
10326}
10327
10328impl wkt::message::Message for DeliverInfo {
10329 fn typename() -> &'static str {
10330 "type.googleapis.com/google.cloud.networkmanagement.v1.DeliverInfo"
10331 }
10332}
10333
10334/// Defines additional types related to [DeliverInfo].
10335pub mod deliver_info {
10336 #[allow(unused_imports)]
10337 use super::*;
10338
10339 /// Deliver target types:
10340 ///
10341 /// # Working with unknown values
10342 ///
10343 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10344 /// additional enum variants at any time. Adding new variants is not considered
10345 /// a breaking change. Applications should write their code in anticipation of:
10346 ///
10347 /// - New values appearing in future releases of the client library, **and**
10348 /// - New values received dynamically, without application changes.
10349 ///
10350 /// Please consult the [Working with enums] section in the user guide for some
10351 /// guidelines.
10352 ///
10353 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10354 #[derive(Clone, Debug, PartialEq)]
10355 #[non_exhaustive]
10356 pub enum Target {
10357 /// Target not specified.
10358 Unspecified,
10359 /// Target is a Compute Engine instance.
10360 Instance,
10361 /// Target is the internet.
10362 Internet,
10363 /// Target is a Google API.
10364 GoogleApi,
10365 /// Target is a Google Kubernetes Engine cluster master.
10366 GkeMaster,
10367 /// Target is a Cloud SQL instance.
10368 CloudSqlInstance,
10369 /// Target is a published service that uses [Private Service
10370 /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
10371 PscPublishedService,
10372 /// Target is Google APIs that use [Private Service
10373 /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-apis).
10374 PscGoogleApi,
10375 /// Target is a VPC-SC that uses [Private Service
10376 /// Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-apis).
10377 PscVpcSc,
10378 /// Target is a serverless network endpoint group.
10379 ServerlessNeg,
10380 /// Target is a Cloud Storage bucket.
10381 StorageBucket,
10382 /// Target is a private network. Used only for return traces.
10383 PrivateNetwork,
10384 /// Target is a Cloud Function. Used only for return traces.
10385 CloudFunction,
10386 /// Target is a App Engine service version. Used only for return traces.
10387 AppEngineVersion,
10388 /// Target is a Cloud Run revision. Used only for return traces.
10389 CloudRunRevision,
10390 /// Target is a Google-managed service. Used only for return traces.
10391 GoogleManagedService,
10392 /// Target is a Redis Instance.
10393 RedisInstance,
10394 /// Target is a Redis Cluster.
10395 RedisCluster,
10396 /// If set, the enum was initialized with an unknown value.
10397 ///
10398 /// Applications can examine the value using [Target::value] or
10399 /// [Target::name].
10400 UnknownValue(target::UnknownValue),
10401 }
10402
10403 #[doc(hidden)]
10404 pub mod target {
10405 #[allow(unused_imports)]
10406 use super::*;
10407 #[derive(Clone, Debug, PartialEq)]
10408 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10409 }
10410
10411 impl Target {
10412 /// Gets the enum value.
10413 ///
10414 /// Returns `None` if the enum contains an unknown value deserialized from
10415 /// the string representation of enums.
10416 pub fn value(&self) -> std::option::Option<i32> {
10417 match self {
10418 Self::Unspecified => std::option::Option::Some(0),
10419 Self::Instance => std::option::Option::Some(1),
10420 Self::Internet => std::option::Option::Some(2),
10421 Self::GoogleApi => std::option::Option::Some(3),
10422 Self::GkeMaster => std::option::Option::Some(4),
10423 Self::CloudSqlInstance => std::option::Option::Some(5),
10424 Self::PscPublishedService => std::option::Option::Some(6),
10425 Self::PscGoogleApi => std::option::Option::Some(7),
10426 Self::PscVpcSc => std::option::Option::Some(8),
10427 Self::ServerlessNeg => std::option::Option::Some(9),
10428 Self::StorageBucket => std::option::Option::Some(10),
10429 Self::PrivateNetwork => std::option::Option::Some(11),
10430 Self::CloudFunction => std::option::Option::Some(12),
10431 Self::AppEngineVersion => std::option::Option::Some(13),
10432 Self::CloudRunRevision => std::option::Option::Some(14),
10433 Self::GoogleManagedService => std::option::Option::Some(15),
10434 Self::RedisInstance => std::option::Option::Some(16),
10435 Self::RedisCluster => std::option::Option::Some(17),
10436 Self::UnknownValue(u) => u.0.value(),
10437 }
10438 }
10439
10440 /// Gets the enum value as a string.
10441 ///
10442 /// Returns `None` if the enum contains an unknown value deserialized from
10443 /// the integer representation of enums.
10444 pub fn name(&self) -> std::option::Option<&str> {
10445 match self {
10446 Self::Unspecified => std::option::Option::Some("TARGET_UNSPECIFIED"),
10447 Self::Instance => std::option::Option::Some("INSTANCE"),
10448 Self::Internet => std::option::Option::Some("INTERNET"),
10449 Self::GoogleApi => std::option::Option::Some("GOOGLE_API"),
10450 Self::GkeMaster => std::option::Option::Some("GKE_MASTER"),
10451 Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
10452 Self::PscPublishedService => std::option::Option::Some("PSC_PUBLISHED_SERVICE"),
10453 Self::PscGoogleApi => std::option::Option::Some("PSC_GOOGLE_API"),
10454 Self::PscVpcSc => std::option::Option::Some("PSC_VPC_SC"),
10455 Self::ServerlessNeg => std::option::Option::Some("SERVERLESS_NEG"),
10456 Self::StorageBucket => std::option::Option::Some("STORAGE_BUCKET"),
10457 Self::PrivateNetwork => std::option::Option::Some("PRIVATE_NETWORK"),
10458 Self::CloudFunction => std::option::Option::Some("CLOUD_FUNCTION"),
10459 Self::AppEngineVersion => std::option::Option::Some("APP_ENGINE_VERSION"),
10460 Self::CloudRunRevision => std::option::Option::Some("CLOUD_RUN_REVISION"),
10461 Self::GoogleManagedService => std::option::Option::Some("GOOGLE_MANAGED_SERVICE"),
10462 Self::RedisInstance => std::option::Option::Some("REDIS_INSTANCE"),
10463 Self::RedisCluster => std::option::Option::Some("REDIS_CLUSTER"),
10464 Self::UnknownValue(u) => u.0.name(),
10465 }
10466 }
10467 }
10468
10469 impl std::default::Default for Target {
10470 fn default() -> Self {
10471 use std::convert::From;
10472 Self::from(0)
10473 }
10474 }
10475
10476 impl std::fmt::Display for Target {
10477 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10478 wkt::internal::display_enum(f, self.name(), self.value())
10479 }
10480 }
10481
10482 impl std::convert::From<i32> for Target {
10483 fn from(value: i32) -> Self {
10484 match value {
10485 0 => Self::Unspecified,
10486 1 => Self::Instance,
10487 2 => Self::Internet,
10488 3 => Self::GoogleApi,
10489 4 => Self::GkeMaster,
10490 5 => Self::CloudSqlInstance,
10491 6 => Self::PscPublishedService,
10492 7 => Self::PscGoogleApi,
10493 8 => Self::PscVpcSc,
10494 9 => Self::ServerlessNeg,
10495 10 => Self::StorageBucket,
10496 11 => Self::PrivateNetwork,
10497 12 => Self::CloudFunction,
10498 13 => Self::AppEngineVersion,
10499 14 => Self::CloudRunRevision,
10500 15 => Self::GoogleManagedService,
10501 16 => Self::RedisInstance,
10502 17 => Self::RedisCluster,
10503 _ => Self::UnknownValue(target::UnknownValue(
10504 wkt::internal::UnknownEnumValue::Integer(value),
10505 )),
10506 }
10507 }
10508 }
10509
10510 impl std::convert::From<&str> for Target {
10511 fn from(value: &str) -> Self {
10512 use std::string::ToString;
10513 match value {
10514 "TARGET_UNSPECIFIED" => Self::Unspecified,
10515 "INSTANCE" => Self::Instance,
10516 "INTERNET" => Self::Internet,
10517 "GOOGLE_API" => Self::GoogleApi,
10518 "GKE_MASTER" => Self::GkeMaster,
10519 "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
10520 "PSC_PUBLISHED_SERVICE" => Self::PscPublishedService,
10521 "PSC_GOOGLE_API" => Self::PscGoogleApi,
10522 "PSC_VPC_SC" => Self::PscVpcSc,
10523 "SERVERLESS_NEG" => Self::ServerlessNeg,
10524 "STORAGE_BUCKET" => Self::StorageBucket,
10525 "PRIVATE_NETWORK" => Self::PrivateNetwork,
10526 "CLOUD_FUNCTION" => Self::CloudFunction,
10527 "APP_ENGINE_VERSION" => Self::AppEngineVersion,
10528 "CLOUD_RUN_REVISION" => Self::CloudRunRevision,
10529 "GOOGLE_MANAGED_SERVICE" => Self::GoogleManagedService,
10530 "REDIS_INSTANCE" => Self::RedisInstance,
10531 "REDIS_CLUSTER" => Self::RedisCluster,
10532 _ => Self::UnknownValue(target::UnknownValue(
10533 wkt::internal::UnknownEnumValue::String(value.to_string()),
10534 )),
10535 }
10536 }
10537 }
10538
10539 impl serde::ser::Serialize for Target {
10540 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10541 where
10542 S: serde::Serializer,
10543 {
10544 match self {
10545 Self::Unspecified => serializer.serialize_i32(0),
10546 Self::Instance => serializer.serialize_i32(1),
10547 Self::Internet => serializer.serialize_i32(2),
10548 Self::GoogleApi => serializer.serialize_i32(3),
10549 Self::GkeMaster => serializer.serialize_i32(4),
10550 Self::CloudSqlInstance => serializer.serialize_i32(5),
10551 Self::PscPublishedService => serializer.serialize_i32(6),
10552 Self::PscGoogleApi => serializer.serialize_i32(7),
10553 Self::PscVpcSc => serializer.serialize_i32(8),
10554 Self::ServerlessNeg => serializer.serialize_i32(9),
10555 Self::StorageBucket => serializer.serialize_i32(10),
10556 Self::PrivateNetwork => serializer.serialize_i32(11),
10557 Self::CloudFunction => serializer.serialize_i32(12),
10558 Self::AppEngineVersion => serializer.serialize_i32(13),
10559 Self::CloudRunRevision => serializer.serialize_i32(14),
10560 Self::GoogleManagedService => serializer.serialize_i32(15),
10561 Self::RedisInstance => serializer.serialize_i32(16),
10562 Self::RedisCluster => serializer.serialize_i32(17),
10563 Self::UnknownValue(u) => u.0.serialize(serializer),
10564 }
10565 }
10566 }
10567
10568 impl<'de> serde::de::Deserialize<'de> for Target {
10569 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10570 where
10571 D: serde::Deserializer<'de>,
10572 {
10573 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Target>::new(
10574 ".google.cloud.networkmanagement.v1.DeliverInfo.Target",
10575 ))
10576 }
10577 }
10578
10579 /// Recognized type of a Google Service.
10580 ///
10581 /// # Working with unknown values
10582 ///
10583 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10584 /// additional enum variants at any time. Adding new variants is not considered
10585 /// a breaking change. Applications should write their code in anticipation of:
10586 ///
10587 /// - New values appearing in future releases of the client library, **and**
10588 /// - New values received dynamically, without application changes.
10589 ///
10590 /// Please consult the [Working with enums] section in the user guide for some
10591 /// guidelines.
10592 ///
10593 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10594 #[derive(Clone, Debug, PartialEq)]
10595 #[non_exhaustive]
10596 pub enum GoogleServiceType {
10597 /// Unspecified Google Service.
10598 Unspecified,
10599 /// Identity aware proxy.
10600 /// <https://cloud.google.com/iap/docs/using-tcp-forwarding>
10601 Iap,
10602 /// One of two services sharing IP ranges:
10603 ///
10604 /// * Load Balancer proxy
10605 /// * Centralized Health Check prober
10606 /// <https://cloud.google.com/load-balancing/docs/firewall-rules>
10607 GfeProxyOrHealthCheckProber,
10608 /// Connectivity from Cloud DNS to forwarding targets or alternate name
10609 /// servers that use private routing.
10610 /// <https://cloud.google.com/dns/docs/zones/forwarding-zones#firewall-rules>
10611 /// <https://cloud.google.com/dns/docs/policies#firewall-rules>
10612 CloudDns,
10613 /// private.googleapis.com and restricted.googleapis.com
10614 PrivateGoogleAccess,
10615 /// Google API via Private Service Connect.
10616 /// <https://cloud.google.com/vpc/docs/configure-private-service-connect-apis>
10617 /// Google API via Serverless VPC Access.
10618 /// <https://cloud.google.com/vpc/docs/serverless-vpc-access>
10619 ServerlessVpcAccess,
10620 /// If set, the enum was initialized with an unknown value.
10621 ///
10622 /// Applications can examine the value using [GoogleServiceType::value] or
10623 /// [GoogleServiceType::name].
10624 UnknownValue(google_service_type::UnknownValue),
10625 }
10626
10627 #[doc(hidden)]
10628 pub mod google_service_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 GoogleServiceType {
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::Iap => std::option::Option::Some(1),
10644 Self::GfeProxyOrHealthCheckProber => std::option::Option::Some(2),
10645 Self::CloudDns => std::option::Option::Some(3),
10646 Self::PrivateGoogleAccess => std::option::Option::Some(4),
10647 Self::ServerlessVpcAccess => std::option::Option::Some(5),
10648 Self::UnknownValue(u) => u.0.value(),
10649 }
10650 }
10651
10652 /// Gets the enum value as a string.
10653 ///
10654 /// Returns `None` if the enum contains an unknown value deserialized from
10655 /// the integer representation of enums.
10656 pub fn name(&self) -> std::option::Option<&str> {
10657 match self {
10658 Self::Unspecified => std::option::Option::Some("GOOGLE_SERVICE_TYPE_UNSPECIFIED"),
10659 Self::Iap => std::option::Option::Some("IAP"),
10660 Self::GfeProxyOrHealthCheckProber => {
10661 std::option::Option::Some("GFE_PROXY_OR_HEALTH_CHECK_PROBER")
10662 }
10663 Self::CloudDns => std::option::Option::Some("CLOUD_DNS"),
10664 Self::PrivateGoogleAccess => std::option::Option::Some("PRIVATE_GOOGLE_ACCESS"),
10665 Self::ServerlessVpcAccess => std::option::Option::Some("SERVERLESS_VPC_ACCESS"),
10666 Self::UnknownValue(u) => u.0.name(),
10667 }
10668 }
10669 }
10670
10671 impl std::default::Default for GoogleServiceType {
10672 fn default() -> Self {
10673 use std::convert::From;
10674 Self::from(0)
10675 }
10676 }
10677
10678 impl std::fmt::Display for GoogleServiceType {
10679 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10680 wkt::internal::display_enum(f, self.name(), self.value())
10681 }
10682 }
10683
10684 impl std::convert::From<i32> for GoogleServiceType {
10685 fn from(value: i32) -> Self {
10686 match value {
10687 0 => Self::Unspecified,
10688 1 => Self::Iap,
10689 2 => Self::GfeProxyOrHealthCheckProber,
10690 3 => Self::CloudDns,
10691 4 => Self::PrivateGoogleAccess,
10692 5 => Self::ServerlessVpcAccess,
10693 _ => Self::UnknownValue(google_service_type::UnknownValue(
10694 wkt::internal::UnknownEnumValue::Integer(value),
10695 )),
10696 }
10697 }
10698 }
10699
10700 impl std::convert::From<&str> for GoogleServiceType {
10701 fn from(value: &str) -> Self {
10702 use std::string::ToString;
10703 match value {
10704 "GOOGLE_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
10705 "IAP" => Self::Iap,
10706 "GFE_PROXY_OR_HEALTH_CHECK_PROBER" => Self::GfeProxyOrHealthCheckProber,
10707 "CLOUD_DNS" => Self::CloudDns,
10708 "PRIVATE_GOOGLE_ACCESS" => Self::PrivateGoogleAccess,
10709 "SERVERLESS_VPC_ACCESS" => Self::ServerlessVpcAccess,
10710 _ => Self::UnknownValue(google_service_type::UnknownValue(
10711 wkt::internal::UnknownEnumValue::String(value.to_string()),
10712 )),
10713 }
10714 }
10715 }
10716
10717 impl serde::ser::Serialize for GoogleServiceType {
10718 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10719 where
10720 S: serde::Serializer,
10721 {
10722 match self {
10723 Self::Unspecified => serializer.serialize_i32(0),
10724 Self::Iap => serializer.serialize_i32(1),
10725 Self::GfeProxyOrHealthCheckProber => serializer.serialize_i32(2),
10726 Self::CloudDns => serializer.serialize_i32(3),
10727 Self::PrivateGoogleAccess => serializer.serialize_i32(4),
10728 Self::ServerlessVpcAccess => serializer.serialize_i32(5),
10729 Self::UnknownValue(u) => u.0.serialize(serializer),
10730 }
10731 }
10732 }
10733
10734 impl<'de> serde::de::Deserialize<'de> for GoogleServiceType {
10735 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10736 where
10737 D: serde::Deserializer<'de>,
10738 {
10739 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GoogleServiceType>::new(
10740 ".google.cloud.networkmanagement.v1.DeliverInfo.GoogleServiceType",
10741 ))
10742 }
10743 }
10744}
10745
10746/// Details of the final state "forward" and associated resource.
10747#[derive(Clone, Default, PartialEq)]
10748#[non_exhaustive]
10749pub struct ForwardInfo {
10750 /// Target type where this packet is forwarded to.
10751 pub target: crate::model::forward_info::Target,
10752
10753 /// URI of the resource that the packet is forwarded to.
10754 pub resource_uri: std::string::String,
10755
10756 /// IP address of the target (if applicable).
10757 pub ip_address: std::string::String,
10758
10759 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10760}
10761
10762impl ForwardInfo {
10763 pub fn new() -> Self {
10764 std::default::Default::default()
10765 }
10766
10767 /// Sets the value of [target][crate::model::ForwardInfo::target].
10768 ///
10769 /// # Example
10770 /// ```ignore,no_run
10771 /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
10772 /// use google_cloud_networkmanagement_v1::model::forward_info::Target;
10773 /// let x0 = ForwardInfo::new().set_target(Target::PeeringVpc);
10774 /// let x1 = ForwardInfo::new().set_target(Target::VpnGateway);
10775 /// let x2 = ForwardInfo::new().set_target(Target::Interconnect);
10776 /// ```
10777 pub fn set_target<T: std::convert::Into<crate::model::forward_info::Target>>(
10778 mut self,
10779 v: T,
10780 ) -> Self {
10781 self.target = v.into();
10782 self
10783 }
10784
10785 /// Sets the value of [resource_uri][crate::model::ForwardInfo::resource_uri].
10786 ///
10787 /// # Example
10788 /// ```ignore,no_run
10789 /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
10790 /// let x = ForwardInfo::new().set_resource_uri("example");
10791 /// ```
10792 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10793 self.resource_uri = v.into();
10794 self
10795 }
10796
10797 /// Sets the value of [ip_address][crate::model::ForwardInfo::ip_address].
10798 ///
10799 /// # Example
10800 /// ```ignore,no_run
10801 /// # use google_cloud_networkmanagement_v1::model::ForwardInfo;
10802 /// let x = ForwardInfo::new().set_ip_address("example");
10803 /// ```
10804 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10805 self.ip_address = v.into();
10806 self
10807 }
10808}
10809
10810impl wkt::message::Message for ForwardInfo {
10811 fn typename() -> &'static str {
10812 "type.googleapis.com/google.cloud.networkmanagement.v1.ForwardInfo"
10813 }
10814}
10815
10816/// Defines additional types related to [ForwardInfo].
10817pub mod forward_info {
10818 #[allow(unused_imports)]
10819 use super::*;
10820
10821 /// Forward target types.
10822 ///
10823 /// # Working with unknown values
10824 ///
10825 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10826 /// additional enum variants at any time. Adding new variants is not considered
10827 /// a breaking change. Applications should write their code in anticipation of:
10828 ///
10829 /// - New values appearing in future releases of the client library, **and**
10830 /// - New values received dynamically, without application changes.
10831 ///
10832 /// Please consult the [Working with enums] section in the user guide for some
10833 /// guidelines.
10834 ///
10835 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10836 #[derive(Clone, Debug, PartialEq)]
10837 #[non_exhaustive]
10838 pub enum Target {
10839 /// Target not specified.
10840 Unspecified,
10841 /// Forwarded to a VPC peering network.
10842 PeeringVpc,
10843 /// Forwarded to a Cloud VPN gateway.
10844 VpnGateway,
10845 /// Forwarded to a Cloud Interconnect connection.
10846 Interconnect,
10847 /// Forwarded to a Google Kubernetes Engine Container cluster master.
10848 #[deprecated]
10849 GkeMaster,
10850 /// Forwarded to the next hop of a custom route imported from a peering VPC.
10851 ImportedCustomRouteNextHop,
10852 /// Forwarded to a Cloud SQL instance.
10853 #[deprecated]
10854 CloudSqlInstance,
10855 /// Forwarded to a VPC network in another project.
10856 AnotherProject,
10857 /// Forwarded to an NCC Hub.
10858 NccHub,
10859 /// Forwarded to a router appliance.
10860 RouterAppliance,
10861 /// Forwarded to a Secure Web Proxy Gateway.
10862 SecureWebProxyGateway,
10863 /// If set, the enum was initialized with an unknown value.
10864 ///
10865 /// Applications can examine the value using [Target::value] or
10866 /// [Target::name].
10867 UnknownValue(target::UnknownValue),
10868 }
10869
10870 #[doc(hidden)]
10871 pub mod target {
10872 #[allow(unused_imports)]
10873 use super::*;
10874 #[derive(Clone, Debug, PartialEq)]
10875 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10876 }
10877
10878 impl Target {
10879 /// Gets the enum value.
10880 ///
10881 /// Returns `None` if the enum contains an unknown value deserialized from
10882 /// the string representation of enums.
10883 pub fn value(&self) -> std::option::Option<i32> {
10884 match self {
10885 Self::Unspecified => std::option::Option::Some(0),
10886 Self::PeeringVpc => std::option::Option::Some(1),
10887 Self::VpnGateway => std::option::Option::Some(2),
10888 Self::Interconnect => std::option::Option::Some(3),
10889 Self::GkeMaster => std::option::Option::Some(4),
10890 Self::ImportedCustomRouteNextHop => std::option::Option::Some(5),
10891 Self::CloudSqlInstance => std::option::Option::Some(6),
10892 Self::AnotherProject => std::option::Option::Some(7),
10893 Self::NccHub => std::option::Option::Some(8),
10894 Self::RouterAppliance => std::option::Option::Some(9),
10895 Self::SecureWebProxyGateway => std::option::Option::Some(10),
10896 Self::UnknownValue(u) => u.0.value(),
10897 }
10898 }
10899
10900 /// Gets the enum value as a string.
10901 ///
10902 /// Returns `None` if the enum contains an unknown value deserialized from
10903 /// the integer representation of enums.
10904 pub fn name(&self) -> std::option::Option<&str> {
10905 match self {
10906 Self::Unspecified => std::option::Option::Some("TARGET_UNSPECIFIED"),
10907 Self::PeeringVpc => std::option::Option::Some("PEERING_VPC"),
10908 Self::VpnGateway => std::option::Option::Some("VPN_GATEWAY"),
10909 Self::Interconnect => std::option::Option::Some("INTERCONNECT"),
10910 Self::GkeMaster => std::option::Option::Some("GKE_MASTER"),
10911 Self::ImportedCustomRouteNextHop => {
10912 std::option::Option::Some("IMPORTED_CUSTOM_ROUTE_NEXT_HOP")
10913 }
10914 Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
10915 Self::AnotherProject => std::option::Option::Some("ANOTHER_PROJECT"),
10916 Self::NccHub => std::option::Option::Some("NCC_HUB"),
10917 Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
10918 Self::SecureWebProxyGateway => {
10919 std::option::Option::Some("SECURE_WEB_PROXY_GATEWAY")
10920 }
10921 Self::UnknownValue(u) => u.0.name(),
10922 }
10923 }
10924 }
10925
10926 impl std::default::Default for Target {
10927 fn default() -> Self {
10928 use std::convert::From;
10929 Self::from(0)
10930 }
10931 }
10932
10933 impl std::fmt::Display for Target {
10934 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10935 wkt::internal::display_enum(f, self.name(), self.value())
10936 }
10937 }
10938
10939 impl std::convert::From<i32> for Target {
10940 fn from(value: i32) -> Self {
10941 match value {
10942 0 => Self::Unspecified,
10943 1 => Self::PeeringVpc,
10944 2 => Self::VpnGateway,
10945 3 => Self::Interconnect,
10946 4 => Self::GkeMaster,
10947 5 => Self::ImportedCustomRouteNextHop,
10948 6 => Self::CloudSqlInstance,
10949 7 => Self::AnotherProject,
10950 8 => Self::NccHub,
10951 9 => Self::RouterAppliance,
10952 10 => Self::SecureWebProxyGateway,
10953 _ => Self::UnknownValue(target::UnknownValue(
10954 wkt::internal::UnknownEnumValue::Integer(value),
10955 )),
10956 }
10957 }
10958 }
10959
10960 impl std::convert::From<&str> for Target {
10961 fn from(value: &str) -> Self {
10962 use std::string::ToString;
10963 match value {
10964 "TARGET_UNSPECIFIED" => Self::Unspecified,
10965 "PEERING_VPC" => Self::PeeringVpc,
10966 "VPN_GATEWAY" => Self::VpnGateway,
10967 "INTERCONNECT" => Self::Interconnect,
10968 "GKE_MASTER" => Self::GkeMaster,
10969 "IMPORTED_CUSTOM_ROUTE_NEXT_HOP" => Self::ImportedCustomRouteNextHop,
10970 "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
10971 "ANOTHER_PROJECT" => Self::AnotherProject,
10972 "NCC_HUB" => Self::NccHub,
10973 "ROUTER_APPLIANCE" => Self::RouterAppliance,
10974 "SECURE_WEB_PROXY_GATEWAY" => Self::SecureWebProxyGateway,
10975 _ => Self::UnknownValue(target::UnknownValue(
10976 wkt::internal::UnknownEnumValue::String(value.to_string()),
10977 )),
10978 }
10979 }
10980 }
10981
10982 impl serde::ser::Serialize for Target {
10983 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10984 where
10985 S: serde::Serializer,
10986 {
10987 match self {
10988 Self::Unspecified => serializer.serialize_i32(0),
10989 Self::PeeringVpc => serializer.serialize_i32(1),
10990 Self::VpnGateway => serializer.serialize_i32(2),
10991 Self::Interconnect => serializer.serialize_i32(3),
10992 Self::GkeMaster => serializer.serialize_i32(4),
10993 Self::ImportedCustomRouteNextHop => serializer.serialize_i32(5),
10994 Self::CloudSqlInstance => serializer.serialize_i32(6),
10995 Self::AnotherProject => serializer.serialize_i32(7),
10996 Self::NccHub => serializer.serialize_i32(8),
10997 Self::RouterAppliance => serializer.serialize_i32(9),
10998 Self::SecureWebProxyGateway => serializer.serialize_i32(10),
10999 Self::UnknownValue(u) => u.0.serialize(serializer),
11000 }
11001 }
11002 }
11003
11004 impl<'de> serde::de::Deserialize<'de> for Target {
11005 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11006 where
11007 D: serde::Deserializer<'de>,
11008 {
11009 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Target>::new(
11010 ".google.cloud.networkmanagement.v1.ForwardInfo.Target",
11011 ))
11012 }
11013 }
11014}
11015
11016/// Details of the final state "abort" and associated resource.
11017#[derive(Clone, Default, PartialEq)]
11018#[non_exhaustive]
11019pub struct AbortInfo {
11020 /// Causes that the analysis is aborted.
11021 pub cause: crate::model::abort_info::Cause,
11022
11023 /// URI of the resource that caused the abort.
11024 pub resource_uri: std::string::String,
11025
11026 /// IP address that caused the abort.
11027 pub ip_address: std::string::String,
11028
11029 /// List of project IDs the user specified in the request but lacks access to.
11030 /// In this case, analysis is aborted with the PERMISSION_DENIED cause.
11031 pub projects_missing_permission: std::vec::Vec<std::string::String>,
11032
11033 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11034}
11035
11036impl AbortInfo {
11037 pub fn new() -> Self {
11038 std::default::Default::default()
11039 }
11040
11041 /// Sets the value of [cause][crate::model::AbortInfo::cause].
11042 ///
11043 /// # Example
11044 /// ```ignore,no_run
11045 /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11046 /// use google_cloud_networkmanagement_v1::model::abort_info::Cause;
11047 /// let x0 = AbortInfo::new().set_cause(Cause::UnknownIp);
11048 /// let x1 = AbortInfo::new().set_cause(Cause::GoogleManagedServiceUnknownIp);
11049 /// let x2 = AbortInfo::new().set_cause(Cause::SourceIpAddressNotInSourceNetwork);
11050 /// ```
11051 pub fn set_cause<T: std::convert::Into<crate::model::abort_info::Cause>>(
11052 mut self,
11053 v: T,
11054 ) -> Self {
11055 self.cause = v.into();
11056 self
11057 }
11058
11059 /// Sets the value of [resource_uri][crate::model::AbortInfo::resource_uri].
11060 ///
11061 /// # Example
11062 /// ```ignore,no_run
11063 /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11064 /// let x = AbortInfo::new().set_resource_uri("example");
11065 /// ```
11066 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11067 self.resource_uri = v.into();
11068 self
11069 }
11070
11071 /// Sets the value of [ip_address][crate::model::AbortInfo::ip_address].
11072 ///
11073 /// # Example
11074 /// ```ignore,no_run
11075 /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11076 /// let x = AbortInfo::new().set_ip_address("example");
11077 /// ```
11078 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11079 self.ip_address = v.into();
11080 self
11081 }
11082
11083 /// Sets the value of [projects_missing_permission][crate::model::AbortInfo::projects_missing_permission].
11084 ///
11085 /// # Example
11086 /// ```ignore,no_run
11087 /// # use google_cloud_networkmanagement_v1::model::AbortInfo;
11088 /// let x = AbortInfo::new().set_projects_missing_permission(["a", "b", "c"]);
11089 /// ```
11090 pub fn set_projects_missing_permission<T, V>(mut self, v: T) -> Self
11091 where
11092 T: std::iter::IntoIterator<Item = V>,
11093 V: std::convert::Into<std::string::String>,
11094 {
11095 use std::iter::Iterator;
11096 self.projects_missing_permission = v.into_iter().map(|i| i.into()).collect();
11097 self
11098 }
11099}
11100
11101impl wkt::message::Message for AbortInfo {
11102 fn typename() -> &'static str {
11103 "type.googleapis.com/google.cloud.networkmanagement.v1.AbortInfo"
11104 }
11105}
11106
11107/// Defines additional types related to [AbortInfo].
11108pub mod abort_info {
11109 #[allow(unused_imports)]
11110 use super::*;
11111
11112 /// Abort cause types:
11113 ///
11114 /// # Working with unknown values
11115 ///
11116 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11117 /// additional enum variants at any time. Adding new variants is not considered
11118 /// a breaking change. Applications should write their code in anticipation of:
11119 ///
11120 /// - New values appearing in future releases of the client library, **and**
11121 /// - New values received dynamically, without application changes.
11122 ///
11123 /// Please consult the [Working with enums] section in the user guide for some
11124 /// guidelines.
11125 ///
11126 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11127 #[derive(Clone, Debug, PartialEq)]
11128 #[non_exhaustive]
11129 pub enum Cause {
11130 /// Cause is unspecified.
11131 Unspecified,
11132 /// Aborted due to unknown network. Deprecated, not used in the new tests.
11133 #[deprecated]
11134 UnknownNetwork,
11135 /// Aborted because no project information can be derived from the test
11136 /// input. Deprecated, not used in the new tests.
11137 #[deprecated]
11138 UnknownProject,
11139 /// Aborted because traffic is sent from a public IP to an instance without
11140 /// an external IP. Deprecated, not used in the new tests.
11141 #[deprecated]
11142 NoExternalIp,
11143 /// Aborted because none of the traces matches destination information
11144 /// specified in the input test request. Deprecated, not used in the new
11145 /// tests.
11146 #[deprecated]
11147 UnintendedDestination,
11148 /// Aborted because the source endpoint could not be found. Deprecated, not
11149 /// used in the new tests.
11150 #[deprecated]
11151 SourceEndpointNotFound,
11152 /// Aborted because the source network does not match the source endpoint.
11153 /// Deprecated, not used in the new tests.
11154 #[deprecated]
11155 MismatchedSourceNetwork,
11156 /// Aborted because the destination endpoint could not be found. Deprecated,
11157 /// not used in the new tests.
11158 #[deprecated]
11159 DestinationEndpointNotFound,
11160 /// Aborted because the destination network does not match the destination
11161 /// endpoint. Deprecated, not used in the new tests.
11162 #[deprecated]
11163 MismatchedDestinationNetwork,
11164 /// Aborted because no endpoint with the packet's destination IP address is
11165 /// found.
11166 UnknownIp,
11167 /// Aborted because no endpoint with the packet's destination IP is found in
11168 /// the Google-managed project.
11169 GoogleManagedServiceUnknownIp,
11170 /// Aborted because the source IP address doesn't belong to any of the
11171 /// subnets of the source VPC network.
11172 SourceIpAddressNotInSourceNetwork,
11173 /// Aborted because user lacks permission to access all or part of the
11174 /// network configurations required to run the test.
11175 PermissionDenied,
11176 /// Aborted because user lacks permission to access Cloud NAT configs
11177 /// required to run the test.
11178 PermissionDeniedNoCloudNatConfigs,
11179 /// Aborted because user lacks permission to access Network endpoint group
11180 /// endpoint configs required to run the test.
11181 PermissionDeniedNoNegEndpointConfigs,
11182 /// Aborted because user lacks permission to access Cloud Router configs
11183 /// required to run the test.
11184 PermissionDeniedNoCloudRouterConfigs,
11185 /// Aborted because no valid source or destination endpoint is derived from
11186 /// the input test request.
11187 NoSourceLocation,
11188 /// Aborted because the source or destination endpoint specified in
11189 /// the request is invalid. Some examples:
11190 ///
11191 /// - The request might contain malformed resource URI, project ID, or IP
11192 /// address.
11193 /// - The request might contain inconsistent information (for example, the
11194 /// request might include both the instance and the network, but the instance
11195 /// might not have a NIC in that network).
11196 InvalidArgument,
11197 /// Aborted because the number of steps in the trace exceeds a certain
11198 /// limit. It might be caused by a routing loop.
11199 TraceTooLong,
11200 /// Aborted due to internal server error.
11201 InternalError,
11202 /// Aborted because the test scenario is not supported.
11203 Unsupported,
11204 /// Aborted because the source and destination resources have no common IP
11205 /// version.
11206 MismatchedIpVersion,
11207 /// Aborted because the connection between the control plane and the node of
11208 /// the source cluster is initiated by the node and managed by the
11209 /// Konnectivity proxy.
11210 GkeKonnectivityProxyUnsupported,
11211 /// Aborted because expected resource configuration was missing.
11212 ResourceConfigNotFound,
11213 /// Aborted because expected VM instance configuration was missing.
11214 VmInstanceConfigNotFound,
11215 /// Aborted because expected network configuration was missing.
11216 NetworkConfigNotFound,
11217 /// Aborted because expected firewall configuration was missing.
11218 FirewallConfigNotFound,
11219 /// Aborted because expected route configuration was missing.
11220 RouteConfigNotFound,
11221 /// Aborted because PSC endpoint selection for the Google-managed service
11222 /// is ambiguous (several PSC endpoints satisfy test input).
11223 GoogleManagedServiceAmbiguousPscEndpoint,
11224 /// Aborted because endpoint selection for the Google-managed service is
11225 /// ambiguous (several endpoints satisfy test input).
11226 GoogleManagedServiceAmbiguousEndpoint,
11227 /// Aborted because tests with a PSC-based Cloud SQL instance as a source are
11228 /// not supported.
11229 SourcePscCloudSqlUnsupported,
11230 /// Aborted because tests with a Redis Cluster as a source are not supported.
11231 SourceRedisClusterUnsupported,
11232 /// Aborted because tests with a Redis Instance as a source are not
11233 /// supported.
11234 SourceRedisInstanceUnsupported,
11235 /// Aborted because tests with a forwarding rule as a source are not
11236 /// supported.
11237 SourceForwardingRuleUnsupported,
11238 /// Aborted because one of the endpoints is a non-routable IP address
11239 /// (loopback, link-local, etc).
11240 NonRoutableIpAddress,
11241 /// Aborted due to an unknown issue in the Google-managed project.
11242 UnknownIssueInGoogleManagedProject,
11243 /// Aborted due to an unsupported configuration of the Google-managed
11244 /// project.
11245 UnsupportedGoogleManagedProjectConfig,
11246 /// Aborted because the source endpoint is a Cloud Run revision with direct
11247 /// VPC access enabled, but there are no reserved serverless IP ranges.
11248 NoServerlessIpRanges,
11249 /// Aborted because the used protocol is not supported for the used IP
11250 /// version.
11251 IpVersionProtocolMismatch,
11252 /// If set, the enum was initialized with an unknown value.
11253 ///
11254 /// Applications can examine the value using [Cause::value] or
11255 /// [Cause::name].
11256 UnknownValue(cause::UnknownValue),
11257 }
11258
11259 #[doc(hidden)]
11260 pub mod cause {
11261 #[allow(unused_imports)]
11262 use super::*;
11263 #[derive(Clone, Debug, PartialEq)]
11264 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11265 }
11266
11267 impl Cause {
11268 /// Gets the enum value.
11269 ///
11270 /// Returns `None` if the enum contains an unknown value deserialized from
11271 /// the string representation of enums.
11272 pub fn value(&self) -> std::option::Option<i32> {
11273 match self {
11274 Self::Unspecified => std::option::Option::Some(0),
11275 Self::UnknownNetwork => std::option::Option::Some(1),
11276 Self::UnknownProject => std::option::Option::Some(3),
11277 Self::NoExternalIp => std::option::Option::Some(7),
11278 Self::UnintendedDestination => std::option::Option::Some(8),
11279 Self::SourceEndpointNotFound => std::option::Option::Some(11),
11280 Self::MismatchedSourceNetwork => std::option::Option::Some(12),
11281 Self::DestinationEndpointNotFound => std::option::Option::Some(13),
11282 Self::MismatchedDestinationNetwork => std::option::Option::Some(14),
11283 Self::UnknownIp => std::option::Option::Some(2),
11284 Self::GoogleManagedServiceUnknownIp => std::option::Option::Some(32),
11285 Self::SourceIpAddressNotInSourceNetwork => std::option::Option::Some(23),
11286 Self::PermissionDenied => std::option::Option::Some(4),
11287 Self::PermissionDeniedNoCloudNatConfigs => std::option::Option::Some(28),
11288 Self::PermissionDeniedNoNegEndpointConfigs => std::option::Option::Some(29),
11289 Self::PermissionDeniedNoCloudRouterConfigs => std::option::Option::Some(36),
11290 Self::NoSourceLocation => std::option::Option::Some(5),
11291 Self::InvalidArgument => std::option::Option::Some(6),
11292 Self::TraceTooLong => std::option::Option::Some(9),
11293 Self::InternalError => std::option::Option::Some(10),
11294 Self::Unsupported => std::option::Option::Some(15),
11295 Self::MismatchedIpVersion => std::option::Option::Some(16),
11296 Self::GkeKonnectivityProxyUnsupported => std::option::Option::Some(17),
11297 Self::ResourceConfigNotFound => std::option::Option::Some(18),
11298 Self::VmInstanceConfigNotFound => std::option::Option::Some(24),
11299 Self::NetworkConfigNotFound => std::option::Option::Some(25),
11300 Self::FirewallConfigNotFound => std::option::Option::Some(26),
11301 Self::RouteConfigNotFound => std::option::Option::Some(27),
11302 Self::GoogleManagedServiceAmbiguousPscEndpoint => std::option::Option::Some(19),
11303 Self::GoogleManagedServiceAmbiguousEndpoint => std::option::Option::Some(39),
11304 Self::SourcePscCloudSqlUnsupported => std::option::Option::Some(20),
11305 Self::SourceRedisClusterUnsupported => std::option::Option::Some(34),
11306 Self::SourceRedisInstanceUnsupported => std::option::Option::Some(35),
11307 Self::SourceForwardingRuleUnsupported => std::option::Option::Some(21),
11308 Self::NonRoutableIpAddress => std::option::Option::Some(22),
11309 Self::UnknownIssueInGoogleManagedProject => std::option::Option::Some(30),
11310 Self::UnsupportedGoogleManagedProjectConfig => std::option::Option::Some(31),
11311 Self::NoServerlessIpRanges => std::option::Option::Some(37),
11312 Self::IpVersionProtocolMismatch => std::option::Option::Some(40),
11313 Self::UnknownValue(u) => u.0.value(),
11314 }
11315 }
11316
11317 /// Gets the enum value as a string.
11318 ///
11319 /// Returns `None` if the enum contains an unknown value deserialized from
11320 /// the integer representation of enums.
11321 pub fn name(&self) -> std::option::Option<&str> {
11322 match self {
11323 Self::Unspecified => std::option::Option::Some("CAUSE_UNSPECIFIED"),
11324 Self::UnknownNetwork => std::option::Option::Some("UNKNOWN_NETWORK"),
11325 Self::UnknownProject => std::option::Option::Some("UNKNOWN_PROJECT"),
11326 Self::NoExternalIp => std::option::Option::Some("NO_EXTERNAL_IP"),
11327 Self::UnintendedDestination => std::option::Option::Some("UNINTENDED_DESTINATION"),
11328 Self::SourceEndpointNotFound => {
11329 std::option::Option::Some("SOURCE_ENDPOINT_NOT_FOUND")
11330 }
11331 Self::MismatchedSourceNetwork => {
11332 std::option::Option::Some("MISMATCHED_SOURCE_NETWORK")
11333 }
11334 Self::DestinationEndpointNotFound => {
11335 std::option::Option::Some("DESTINATION_ENDPOINT_NOT_FOUND")
11336 }
11337 Self::MismatchedDestinationNetwork => {
11338 std::option::Option::Some("MISMATCHED_DESTINATION_NETWORK")
11339 }
11340 Self::UnknownIp => std::option::Option::Some("UNKNOWN_IP"),
11341 Self::GoogleManagedServiceUnknownIp => {
11342 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_UNKNOWN_IP")
11343 }
11344 Self::SourceIpAddressNotInSourceNetwork => {
11345 std::option::Option::Some("SOURCE_IP_ADDRESS_NOT_IN_SOURCE_NETWORK")
11346 }
11347 Self::PermissionDenied => std::option::Option::Some("PERMISSION_DENIED"),
11348 Self::PermissionDeniedNoCloudNatConfigs => {
11349 std::option::Option::Some("PERMISSION_DENIED_NO_CLOUD_NAT_CONFIGS")
11350 }
11351 Self::PermissionDeniedNoNegEndpointConfigs => {
11352 std::option::Option::Some("PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS")
11353 }
11354 Self::PermissionDeniedNoCloudRouterConfigs => {
11355 std::option::Option::Some("PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS")
11356 }
11357 Self::NoSourceLocation => std::option::Option::Some("NO_SOURCE_LOCATION"),
11358 Self::InvalidArgument => std::option::Option::Some("INVALID_ARGUMENT"),
11359 Self::TraceTooLong => std::option::Option::Some("TRACE_TOO_LONG"),
11360 Self::InternalError => std::option::Option::Some("INTERNAL_ERROR"),
11361 Self::Unsupported => std::option::Option::Some("UNSUPPORTED"),
11362 Self::MismatchedIpVersion => std::option::Option::Some("MISMATCHED_IP_VERSION"),
11363 Self::GkeKonnectivityProxyUnsupported => {
11364 std::option::Option::Some("GKE_KONNECTIVITY_PROXY_UNSUPPORTED")
11365 }
11366 Self::ResourceConfigNotFound => {
11367 std::option::Option::Some("RESOURCE_CONFIG_NOT_FOUND")
11368 }
11369 Self::VmInstanceConfigNotFound => {
11370 std::option::Option::Some("VM_INSTANCE_CONFIG_NOT_FOUND")
11371 }
11372 Self::NetworkConfigNotFound => {
11373 std::option::Option::Some("NETWORK_CONFIG_NOT_FOUND")
11374 }
11375 Self::FirewallConfigNotFound => {
11376 std::option::Option::Some("FIREWALL_CONFIG_NOT_FOUND")
11377 }
11378 Self::RouteConfigNotFound => std::option::Option::Some("ROUTE_CONFIG_NOT_FOUND"),
11379 Self::GoogleManagedServiceAmbiguousPscEndpoint => {
11380 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT")
11381 }
11382 Self::GoogleManagedServiceAmbiguousEndpoint => {
11383 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT")
11384 }
11385 Self::SourcePscCloudSqlUnsupported => {
11386 std::option::Option::Some("SOURCE_PSC_CLOUD_SQL_UNSUPPORTED")
11387 }
11388 Self::SourceRedisClusterUnsupported => {
11389 std::option::Option::Some("SOURCE_REDIS_CLUSTER_UNSUPPORTED")
11390 }
11391 Self::SourceRedisInstanceUnsupported => {
11392 std::option::Option::Some("SOURCE_REDIS_INSTANCE_UNSUPPORTED")
11393 }
11394 Self::SourceForwardingRuleUnsupported => {
11395 std::option::Option::Some("SOURCE_FORWARDING_RULE_UNSUPPORTED")
11396 }
11397 Self::NonRoutableIpAddress => std::option::Option::Some("NON_ROUTABLE_IP_ADDRESS"),
11398 Self::UnknownIssueInGoogleManagedProject => {
11399 std::option::Option::Some("UNKNOWN_ISSUE_IN_GOOGLE_MANAGED_PROJECT")
11400 }
11401 Self::UnsupportedGoogleManagedProjectConfig => {
11402 std::option::Option::Some("UNSUPPORTED_GOOGLE_MANAGED_PROJECT_CONFIG")
11403 }
11404 Self::NoServerlessIpRanges => std::option::Option::Some("NO_SERVERLESS_IP_RANGES"),
11405 Self::IpVersionProtocolMismatch => {
11406 std::option::Option::Some("IP_VERSION_PROTOCOL_MISMATCH")
11407 }
11408 Self::UnknownValue(u) => u.0.name(),
11409 }
11410 }
11411 }
11412
11413 impl std::default::Default for Cause {
11414 fn default() -> Self {
11415 use std::convert::From;
11416 Self::from(0)
11417 }
11418 }
11419
11420 impl std::fmt::Display for Cause {
11421 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11422 wkt::internal::display_enum(f, self.name(), self.value())
11423 }
11424 }
11425
11426 impl std::convert::From<i32> for Cause {
11427 fn from(value: i32) -> Self {
11428 match value {
11429 0 => Self::Unspecified,
11430 1 => Self::UnknownNetwork,
11431 2 => Self::UnknownIp,
11432 3 => Self::UnknownProject,
11433 4 => Self::PermissionDenied,
11434 5 => Self::NoSourceLocation,
11435 6 => Self::InvalidArgument,
11436 7 => Self::NoExternalIp,
11437 8 => Self::UnintendedDestination,
11438 9 => Self::TraceTooLong,
11439 10 => Self::InternalError,
11440 11 => Self::SourceEndpointNotFound,
11441 12 => Self::MismatchedSourceNetwork,
11442 13 => Self::DestinationEndpointNotFound,
11443 14 => Self::MismatchedDestinationNetwork,
11444 15 => Self::Unsupported,
11445 16 => Self::MismatchedIpVersion,
11446 17 => Self::GkeKonnectivityProxyUnsupported,
11447 18 => Self::ResourceConfigNotFound,
11448 19 => Self::GoogleManagedServiceAmbiguousPscEndpoint,
11449 20 => Self::SourcePscCloudSqlUnsupported,
11450 21 => Self::SourceForwardingRuleUnsupported,
11451 22 => Self::NonRoutableIpAddress,
11452 23 => Self::SourceIpAddressNotInSourceNetwork,
11453 24 => Self::VmInstanceConfigNotFound,
11454 25 => Self::NetworkConfigNotFound,
11455 26 => Self::FirewallConfigNotFound,
11456 27 => Self::RouteConfigNotFound,
11457 28 => Self::PermissionDeniedNoCloudNatConfigs,
11458 29 => Self::PermissionDeniedNoNegEndpointConfigs,
11459 30 => Self::UnknownIssueInGoogleManagedProject,
11460 31 => Self::UnsupportedGoogleManagedProjectConfig,
11461 32 => Self::GoogleManagedServiceUnknownIp,
11462 34 => Self::SourceRedisClusterUnsupported,
11463 35 => Self::SourceRedisInstanceUnsupported,
11464 36 => Self::PermissionDeniedNoCloudRouterConfigs,
11465 37 => Self::NoServerlessIpRanges,
11466 39 => Self::GoogleManagedServiceAmbiguousEndpoint,
11467 40 => Self::IpVersionProtocolMismatch,
11468 _ => Self::UnknownValue(cause::UnknownValue(
11469 wkt::internal::UnknownEnumValue::Integer(value),
11470 )),
11471 }
11472 }
11473 }
11474
11475 impl std::convert::From<&str> for Cause {
11476 fn from(value: &str) -> Self {
11477 use std::string::ToString;
11478 match value {
11479 "CAUSE_UNSPECIFIED" => Self::Unspecified,
11480 "UNKNOWN_NETWORK" => Self::UnknownNetwork,
11481 "UNKNOWN_PROJECT" => Self::UnknownProject,
11482 "NO_EXTERNAL_IP" => Self::NoExternalIp,
11483 "UNINTENDED_DESTINATION" => Self::UnintendedDestination,
11484 "SOURCE_ENDPOINT_NOT_FOUND" => Self::SourceEndpointNotFound,
11485 "MISMATCHED_SOURCE_NETWORK" => Self::MismatchedSourceNetwork,
11486 "DESTINATION_ENDPOINT_NOT_FOUND" => Self::DestinationEndpointNotFound,
11487 "MISMATCHED_DESTINATION_NETWORK" => Self::MismatchedDestinationNetwork,
11488 "UNKNOWN_IP" => Self::UnknownIp,
11489 "GOOGLE_MANAGED_SERVICE_UNKNOWN_IP" => Self::GoogleManagedServiceUnknownIp,
11490 "SOURCE_IP_ADDRESS_NOT_IN_SOURCE_NETWORK" => {
11491 Self::SourceIpAddressNotInSourceNetwork
11492 }
11493 "PERMISSION_DENIED" => Self::PermissionDenied,
11494 "PERMISSION_DENIED_NO_CLOUD_NAT_CONFIGS" => Self::PermissionDeniedNoCloudNatConfigs,
11495 "PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS" => {
11496 Self::PermissionDeniedNoNegEndpointConfigs
11497 }
11498 "PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS" => {
11499 Self::PermissionDeniedNoCloudRouterConfigs
11500 }
11501 "NO_SOURCE_LOCATION" => Self::NoSourceLocation,
11502 "INVALID_ARGUMENT" => Self::InvalidArgument,
11503 "TRACE_TOO_LONG" => Self::TraceTooLong,
11504 "INTERNAL_ERROR" => Self::InternalError,
11505 "UNSUPPORTED" => Self::Unsupported,
11506 "MISMATCHED_IP_VERSION" => Self::MismatchedIpVersion,
11507 "GKE_KONNECTIVITY_PROXY_UNSUPPORTED" => Self::GkeKonnectivityProxyUnsupported,
11508 "RESOURCE_CONFIG_NOT_FOUND" => Self::ResourceConfigNotFound,
11509 "VM_INSTANCE_CONFIG_NOT_FOUND" => Self::VmInstanceConfigNotFound,
11510 "NETWORK_CONFIG_NOT_FOUND" => Self::NetworkConfigNotFound,
11511 "FIREWALL_CONFIG_NOT_FOUND" => Self::FirewallConfigNotFound,
11512 "ROUTE_CONFIG_NOT_FOUND" => Self::RouteConfigNotFound,
11513 "GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT" => {
11514 Self::GoogleManagedServiceAmbiguousPscEndpoint
11515 }
11516 "GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT" => {
11517 Self::GoogleManagedServiceAmbiguousEndpoint
11518 }
11519 "SOURCE_PSC_CLOUD_SQL_UNSUPPORTED" => Self::SourcePscCloudSqlUnsupported,
11520 "SOURCE_REDIS_CLUSTER_UNSUPPORTED" => Self::SourceRedisClusterUnsupported,
11521 "SOURCE_REDIS_INSTANCE_UNSUPPORTED" => Self::SourceRedisInstanceUnsupported,
11522 "SOURCE_FORWARDING_RULE_UNSUPPORTED" => Self::SourceForwardingRuleUnsupported,
11523 "NON_ROUTABLE_IP_ADDRESS" => Self::NonRoutableIpAddress,
11524 "UNKNOWN_ISSUE_IN_GOOGLE_MANAGED_PROJECT" => {
11525 Self::UnknownIssueInGoogleManagedProject
11526 }
11527 "UNSUPPORTED_GOOGLE_MANAGED_PROJECT_CONFIG" => {
11528 Self::UnsupportedGoogleManagedProjectConfig
11529 }
11530 "NO_SERVERLESS_IP_RANGES" => Self::NoServerlessIpRanges,
11531 "IP_VERSION_PROTOCOL_MISMATCH" => Self::IpVersionProtocolMismatch,
11532 _ => Self::UnknownValue(cause::UnknownValue(
11533 wkt::internal::UnknownEnumValue::String(value.to_string()),
11534 )),
11535 }
11536 }
11537 }
11538
11539 impl serde::ser::Serialize for Cause {
11540 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11541 where
11542 S: serde::Serializer,
11543 {
11544 match self {
11545 Self::Unspecified => serializer.serialize_i32(0),
11546 Self::UnknownNetwork => serializer.serialize_i32(1),
11547 Self::UnknownProject => serializer.serialize_i32(3),
11548 Self::NoExternalIp => serializer.serialize_i32(7),
11549 Self::UnintendedDestination => serializer.serialize_i32(8),
11550 Self::SourceEndpointNotFound => serializer.serialize_i32(11),
11551 Self::MismatchedSourceNetwork => serializer.serialize_i32(12),
11552 Self::DestinationEndpointNotFound => serializer.serialize_i32(13),
11553 Self::MismatchedDestinationNetwork => serializer.serialize_i32(14),
11554 Self::UnknownIp => serializer.serialize_i32(2),
11555 Self::GoogleManagedServiceUnknownIp => serializer.serialize_i32(32),
11556 Self::SourceIpAddressNotInSourceNetwork => serializer.serialize_i32(23),
11557 Self::PermissionDenied => serializer.serialize_i32(4),
11558 Self::PermissionDeniedNoCloudNatConfigs => serializer.serialize_i32(28),
11559 Self::PermissionDeniedNoNegEndpointConfigs => serializer.serialize_i32(29),
11560 Self::PermissionDeniedNoCloudRouterConfigs => serializer.serialize_i32(36),
11561 Self::NoSourceLocation => serializer.serialize_i32(5),
11562 Self::InvalidArgument => serializer.serialize_i32(6),
11563 Self::TraceTooLong => serializer.serialize_i32(9),
11564 Self::InternalError => serializer.serialize_i32(10),
11565 Self::Unsupported => serializer.serialize_i32(15),
11566 Self::MismatchedIpVersion => serializer.serialize_i32(16),
11567 Self::GkeKonnectivityProxyUnsupported => serializer.serialize_i32(17),
11568 Self::ResourceConfigNotFound => serializer.serialize_i32(18),
11569 Self::VmInstanceConfigNotFound => serializer.serialize_i32(24),
11570 Self::NetworkConfigNotFound => serializer.serialize_i32(25),
11571 Self::FirewallConfigNotFound => serializer.serialize_i32(26),
11572 Self::RouteConfigNotFound => serializer.serialize_i32(27),
11573 Self::GoogleManagedServiceAmbiguousPscEndpoint => serializer.serialize_i32(19),
11574 Self::GoogleManagedServiceAmbiguousEndpoint => serializer.serialize_i32(39),
11575 Self::SourcePscCloudSqlUnsupported => serializer.serialize_i32(20),
11576 Self::SourceRedisClusterUnsupported => serializer.serialize_i32(34),
11577 Self::SourceRedisInstanceUnsupported => serializer.serialize_i32(35),
11578 Self::SourceForwardingRuleUnsupported => serializer.serialize_i32(21),
11579 Self::NonRoutableIpAddress => serializer.serialize_i32(22),
11580 Self::UnknownIssueInGoogleManagedProject => serializer.serialize_i32(30),
11581 Self::UnsupportedGoogleManagedProjectConfig => serializer.serialize_i32(31),
11582 Self::NoServerlessIpRanges => serializer.serialize_i32(37),
11583 Self::IpVersionProtocolMismatch => serializer.serialize_i32(40),
11584 Self::UnknownValue(u) => u.0.serialize(serializer),
11585 }
11586 }
11587 }
11588
11589 impl<'de> serde::de::Deserialize<'de> for Cause {
11590 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11591 where
11592 D: serde::Deserializer<'de>,
11593 {
11594 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Cause>::new(
11595 ".google.cloud.networkmanagement.v1.AbortInfo.Cause",
11596 ))
11597 }
11598 }
11599}
11600
11601/// Details of the final state "drop" and associated resource.
11602#[derive(Clone, Default, PartialEq)]
11603#[non_exhaustive]
11604pub struct DropInfo {
11605 /// Cause that the packet is dropped.
11606 pub cause: crate::model::drop_info::Cause,
11607
11608 /// URI of the resource that caused the drop.
11609 pub resource_uri: std::string::String,
11610
11611 /// Source IP address of the dropped packet (if relevant).
11612 pub source_ip: std::string::String,
11613
11614 /// Destination IP address of the dropped packet (if relevant).
11615 pub destination_ip: std::string::String,
11616
11617 /// Region of the dropped packet (if relevant).
11618 pub region: std::string::String,
11619
11620 /// Geolocation (region code) of the source IP address (if relevant).
11621 pub source_geolocation_code: std::string::String,
11622
11623 /// Geolocation (region code) of the destination IP address (if relevant).
11624 pub destination_geolocation_code: std::string::String,
11625
11626 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11627}
11628
11629impl DropInfo {
11630 pub fn new() -> Self {
11631 std::default::Default::default()
11632 }
11633
11634 /// Sets the value of [cause][crate::model::DropInfo::cause].
11635 ///
11636 /// # Example
11637 /// ```ignore,no_run
11638 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
11639 /// use google_cloud_networkmanagement_v1::model::drop_info::Cause;
11640 /// let x0 = DropInfo::new().set_cause(Cause::UnknownExternalAddress);
11641 /// let x1 = DropInfo::new().set_cause(Cause::ForeignIpDisallowed);
11642 /// let x2 = DropInfo::new().set_cause(Cause::FirewallRule);
11643 /// ```
11644 pub fn set_cause<T: std::convert::Into<crate::model::drop_info::Cause>>(
11645 mut self,
11646 v: T,
11647 ) -> Self {
11648 self.cause = v.into();
11649 self
11650 }
11651
11652 /// Sets the value of [resource_uri][crate::model::DropInfo::resource_uri].
11653 ///
11654 /// # Example
11655 /// ```ignore,no_run
11656 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
11657 /// let x = DropInfo::new().set_resource_uri("example");
11658 /// ```
11659 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11660 self.resource_uri = v.into();
11661 self
11662 }
11663
11664 /// Sets the value of [source_ip][crate::model::DropInfo::source_ip].
11665 ///
11666 /// # Example
11667 /// ```ignore,no_run
11668 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
11669 /// let x = DropInfo::new().set_source_ip("example");
11670 /// ```
11671 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11672 self.source_ip = v.into();
11673 self
11674 }
11675
11676 /// Sets the value of [destination_ip][crate::model::DropInfo::destination_ip].
11677 ///
11678 /// # Example
11679 /// ```ignore,no_run
11680 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
11681 /// let x = DropInfo::new().set_destination_ip("example");
11682 /// ```
11683 pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11684 self.destination_ip = v.into();
11685 self
11686 }
11687
11688 /// Sets the value of [region][crate::model::DropInfo::region].
11689 ///
11690 /// # Example
11691 /// ```ignore,no_run
11692 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
11693 /// let x = DropInfo::new().set_region("example");
11694 /// ```
11695 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11696 self.region = v.into();
11697 self
11698 }
11699
11700 /// Sets the value of [source_geolocation_code][crate::model::DropInfo::source_geolocation_code].
11701 ///
11702 /// # Example
11703 /// ```ignore,no_run
11704 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
11705 /// let x = DropInfo::new().set_source_geolocation_code("example");
11706 /// ```
11707 pub fn set_source_geolocation_code<T: std::convert::Into<std::string::String>>(
11708 mut self,
11709 v: T,
11710 ) -> Self {
11711 self.source_geolocation_code = v.into();
11712 self
11713 }
11714
11715 /// Sets the value of [destination_geolocation_code][crate::model::DropInfo::destination_geolocation_code].
11716 ///
11717 /// # Example
11718 /// ```ignore,no_run
11719 /// # use google_cloud_networkmanagement_v1::model::DropInfo;
11720 /// let x = DropInfo::new().set_destination_geolocation_code("example");
11721 /// ```
11722 pub fn set_destination_geolocation_code<T: std::convert::Into<std::string::String>>(
11723 mut self,
11724 v: T,
11725 ) -> Self {
11726 self.destination_geolocation_code = v.into();
11727 self
11728 }
11729}
11730
11731impl wkt::message::Message for DropInfo {
11732 fn typename() -> &'static str {
11733 "type.googleapis.com/google.cloud.networkmanagement.v1.DropInfo"
11734 }
11735}
11736
11737/// Defines additional types related to [DropInfo].
11738pub mod drop_info {
11739 #[allow(unused_imports)]
11740 use super::*;
11741
11742 /// Drop cause types:
11743 ///
11744 /// # Working with unknown values
11745 ///
11746 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11747 /// additional enum variants at any time. Adding new variants is not considered
11748 /// a breaking change. Applications should write their code in anticipation of:
11749 ///
11750 /// - New values appearing in future releases of the client library, **and**
11751 /// - New values received dynamically, without application changes.
11752 ///
11753 /// Please consult the [Working with enums] section in the user guide for some
11754 /// guidelines.
11755 ///
11756 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11757 #[derive(Clone, Debug, PartialEq)]
11758 #[non_exhaustive]
11759 pub enum Cause {
11760 /// Cause is unspecified.
11761 Unspecified,
11762 /// Destination external address cannot be resolved to a known target. If
11763 /// the address is used in a Google Cloud project, provide the project ID
11764 /// as test input.
11765 UnknownExternalAddress,
11766 /// A Compute Engine instance can only send or receive a packet with a
11767 /// foreign IP address if ip_forward is enabled.
11768 ForeignIpDisallowed,
11769 /// Dropped due to a firewall rule, unless allowed due to connection
11770 /// tracking.
11771 FirewallRule,
11772 /// Dropped due to no matching routes.
11773 NoRoute,
11774 /// Dropped due to invalid route. Route's next hop is a blackhole.
11775 RouteBlackhole,
11776 /// Packet is sent to a wrong (unintended) network. Example: you trace a
11777 /// packet from VM1:Network1 to VM2:Network2, however, the route configured
11778 /// in Network1 sends the packet destined for VM2's IP address to Network3.
11779 RouteWrongNetwork,
11780 /// Route's next hop IP address cannot be resolved to a GCP resource.
11781 RouteNextHopIpAddressNotResolved,
11782 /// Route's next hop resource is not found.
11783 RouteNextHopResourceNotFound,
11784 /// Route's next hop instance doesn't have a NIC in the route's network.
11785 RouteNextHopInstanceWrongNetwork,
11786 /// Route's next hop IP address is not a primary IP address of the next hop
11787 /// instance.
11788 RouteNextHopInstanceNonPrimaryIp,
11789 /// Route's next hop forwarding rule doesn't match next hop IP address.
11790 RouteNextHopForwardingRuleIpMismatch,
11791 /// Route's next hop VPN tunnel is down (does not have valid IKE SAs).
11792 RouteNextHopVpnTunnelNotEstablished,
11793 /// Route's next hop forwarding rule type is invalid (it's not a forwarding
11794 /// rule of the internal passthrough load balancer).
11795 RouteNextHopForwardingRuleTypeInvalid,
11796 /// Packet is sent from the Internet or Google service to the private IPv6
11797 /// address.
11798 NoRouteFromInternetToPrivateIpv6Address,
11799 /// Packet is sent from the external IPv6 source address of an instance to
11800 /// the private IPv6 address of an instance.
11801 NoRouteFromExternalIpv6SourceToPrivateIpv6Address,
11802 /// The packet does not match a policy-based VPN tunnel local selector.
11803 VpnTunnelLocalSelectorMismatch,
11804 /// The packet does not match a policy-based VPN tunnel remote selector.
11805 VpnTunnelRemoteSelectorMismatch,
11806 /// Packet with internal destination address sent to the internet gateway.
11807 PrivateTrafficToInternet,
11808 /// Endpoint with only an internal IP address tries to access Google API and
11809 /// services, but Private Google Access is not enabled in the subnet or is
11810 /// not applicable.
11811 PrivateGoogleAccessDisallowed,
11812 /// Source endpoint tries to access Google API and services through the VPN
11813 /// tunnel to another network, but Private Google Access needs to be enabled
11814 /// in the source endpoint network.
11815 PrivateGoogleAccessViaVpnTunnelUnsupported,
11816 /// Endpoint with only an internal IP address tries to access external hosts,
11817 /// but there is no matching Cloud NAT gateway in the subnet.
11818 NoExternalAddress,
11819 /// Destination internal address cannot be resolved to a known target. If
11820 /// this is a shared VPC scenario, verify if the service project ID is
11821 /// provided as test input. Otherwise, verify if the IP address is being
11822 /// used in the project.
11823 UnknownInternalAddress,
11824 /// Forwarding rule's protocol and ports do not match the packet header.
11825 ForwardingRuleMismatch,
11826 /// Forwarding rule does not have backends configured.
11827 ForwardingRuleNoInstances,
11828 /// Firewalls block the health check probes to the backends and cause
11829 /// the backends to be unavailable for traffic from the load balancer.
11830 /// For more details, see [Health check firewall
11831 /// rules](https://cloud.google.com/load-balancing/docs/health-checks#firewall_rules).
11832 FirewallBlockingLoadBalancerBackendHealthCheck,
11833 /// Matching ingress firewall rules by network tags for packets sent via
11834 /// serverless VPC direct egress is unsupported. Behavior is undefined.
11835 /// <https://cloud.google.com/run/docs/configuring/vpc-direct-vpc#limitations>
11836 IngressFirewallTagsUnsupportedByDirectVpcEgress,
11837 /// Packet is sent from or to a Compute Engine instance that is not in a
11838 /// running state.
11839 InstanceNotRunning,
11840 /// Packet sent from or to a GKE cluster that is not in running state.
11841 GkeClusterNotRunning,
11842 /// Packet sent from or to a Cloud SQL instance that is not in running state.
11843 CloudSqlInstanceNotRunning,
11844 /// Packet sent from or to a Redis Instance that is not in running state.
11845 RedisInstanceNotRunning,
11846 /// Packet sent from or to a Redis Cluster that is not in running state.
11847 RedisClusterNotRunning,
11848 /// The type of traffic is blocked and the user cannot configure a firewall
11849 /// rule to enable it. See [Always blocked
11850 /// traffic](https://cloud.google.com/vpc/docs/firewalls#blockedtraffic) for
11851 /// more details.
11852 TrafficTypeBlocked,
11853 /// Access to Google Kubernetes Engine cluster master's endpoint is not
11854 /// authorized. See [Access to the cluster
11855 /// endpoints](https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#access_to_the_cluster_endpoints)
11856 /// for more details.
11857 GkeMasterUnauthorizedAccess,
11858 /// Access to the Cloud SQL instance endpoint is not authorized.
11859 /// See [Authorizing with authorized
11860 /// networks](https://cloud.google.com/sql/docs/mysql/authorize-networks) for
11861 /// more details.
11862 CloudSqlInstanceUnauthorizedAccess,
11863 /// Packet was dropped inside Google Kubernetes Engine Service.
11864 DroppedInsideGkeService,
11865 /// Packet was dropped inside Cloud SQL Service.
11866 DroppedInsideCloudSqlService,
11867 /// Packet was dropped because there is no peering between the originating
11868 /// network and the Google Managed Services Network.
11869 GoogleManagedServiceNoPeering,
11870 /// Packet was dropped because the Google-managed service uses Private
11871 /// Service Connect (PSC), but the PSC endpoint is not found in the project.
11872 GoogleManagedServiceNoPscEndpoint,
11873 /// Packet was dropped because the GKE cluster uses Private Service Connect
11874 /// (PSC), but the PSC endpoint is not found in the project.
11875 GkePscEndpointMissing,
11876 /// Packet was dropped because the Cloud SQL instance has neither a private
11877 /// nor a public IP address.
11878 CloudSqlInstanceNoIpAddress,
11879 /// Packet was dropped because a GKE cluster private endpoint is
11880 /// unreachable from a region different from the cluster's region.
11881 GkeControlPlaneRegionMismatch,
11882 /// Packet sent from a public GKE cluster control plane to a private
11883 /// IP address.
11884 PublicGkeControlPlaneToPrivateDestination,
11885 /// Packet was dropped because there is no route from a GKE cluster
11886 /// control plane to a destination network.
11887 GkeControlPlaneNoRoute,
11888 /// Packet sent from a Cloud SQL instance to an external IP address is not
11889 /// allowed. The Cloud SQL instance is not configured to send packets to
11890 /// external IP addresses.
11891 CloudSqlInstanceNotConfiguredForExternalTraffic,
11892 /// Packet sent from a Cloud SQL instance with only a public IP address to a
11893 /// private IP address.
11894 PublicCloudSqlInstanceToPrivateDestination,
11895 /// Packet was dropped because there is no route from a Cloud SQL
11896 /// instance to a destination network.
11897 CloudSqlInstanceNoRoute,
11898 /// Packet was dropped because the Cloud SQL instance requires all
11899 /// connections to use Cloud SQL connectors and to target the Cloud SQL proxy
11900 /// port (3307).
11901 CloudSqlConnectorRequired,
11902 /// Packet could be dropped because the Cloud Function is not in an active
11903 /// status.
11904 CloudFunctionNotActive,
11905 /// Packet could be dropped because no VPC connector is set.
11906 VpcConnectorNotSet,
11907 /// Packet could be dropped because the VPC connector is not in a running
11908 /// state.
11909 VpcConnectorNotRunning,
11910 /// Packet could be dropped because the traffic from the serverless service
11911 /// to the VPC connector is not allowed.
11912 VpcConnectorServerlessTrafficBlocked,
11913 /// Packet could be dropped because the health check traffic to the VPC
11914 /// connector is not allowed.
11915 VpcConnectorHealthCheckTrafficBlocked,
11916 /// Packet could be dropped because it was sent from a different region
11917 /// to a regional forwarding without global access.
11918 ForwardingRuleRegionMismatch,
11919 /// The Private Service Connect endpoint is in a project that is not approved
11920 /// to connect to the service.
11921 PscConnectionNotAccepted,
11922 /// The packet is sent to the Private Service Connect endpoint over the
11923 /// peering, but [it's not
11924 /// supported](https://cloud.google.com/vpc/docs/configure-private-service-connect-services#on-premises).
11925 PscEndpointAccessedFromPeeredNetwork,
11926 /// The packet is sent to the Private Service Connect backend (network
11927 /// endpoint group), but the producer PSC forwarding rule does not have
11928 /// global access enabled.
11929 PscNegProducerEndpointNoGlobalAccess,
11930 /// The packet is sent to the Private Service Connect backend (network
11931 /// endpoint group), but the producer PSC forwarding rule has multiple ports
11932 /// specified.
11933 PscNegProducerForwardingRuleMultiplePorts,
11934 /// The packet is sent to the Private Service Connect backend (network
11935 /// endpoint group) targeting a Cloud SQL service attachment, but this
11936 /// configuration is not supported.
11937 CloudSqlPscNegUnsupported,
11938 /// No NAT subnets are defined for the PSC service attachment.
11939 NoNatSubnetsForPscServiceAttachment,
11940 /// PSC endpoint is accessed via NCC, but PSC transitivity configuration is
11941 /// not yet propagated.
11942 PscTransitivityNotPropagated,
11943 /// The packet sent from the hybrid NEG proxy matches a non-dynamic route,
11944 /// but such a configuration is not supported.
11945 HybridNegNonDynamicRouteMatched,
11946 /// The packet sent from the hybrid NEG proxy matches a dynamic route with a
11947 /// next hop in a different region, but such a configuration is not
11948 /// supported.
11949 HybridNegNonLocalDynamicRouteMatched,
11950 /// Packet sent from a Cloud Run revision that is not ready.
11951 CloudRunRevisionNotReady,
11952 /// Packet was dropped inside Private Service Connect service producer.
11953 DroppedInsidePscServiceProducer,
11954 /// Packet sent to a load balancer, which requires a proxy-only subnet and
11955 /// the subnet is not found.
11956 LoadBalancerHasNoProxySubnet,
11957 /// Packet sent to Cloud Nat without active NAT IPs.
11958 CloudNatNoAddresses,
11959 /// Packet is stuck in a routing loop.
11960 RoutingLoop,
11961 /// Packet is dropped inside a Google-managed service due to being delivered
11962 /// in return trace to an endpoint that doesn't match the endpoint the packet
11963 /// was sent from in forward trace. Used only for return traces.
11964 DroppedInsideGoogleManagedService,
11965 /// Packet is dropped due to a load balancer backend instance not having a
11966 /// network interface in the network expected by the load balancer.
11967 LoadBalancerBackendInvalidNetwork,
11968 /// Packet is dropped due to a backend service named port not being defined
11969 /// on the instance group level.
11970 BackendServiceNamedPortNotDefined,
11971 /// Packet is dropped due to a destination IP range being part of a Private
11972 /// NAT IP range.
11973 DestinationIsPrivateNatIpRange,
11974 /// Generic drop cause for a packet being dropped inside a Redis Instance
11975 /// service project.
11976 DroppedInsideRedisInstanceService,
11977 /// Packet is dropped due to an unsupported port being used to connect to a
11978 /// Redis Instance. Port 6379 should be used to connect to a Redis Instance.
11979 RedisInstanceUnsupportedPort,
11980 /// Packet is dropped due to connecting from PUPI address to a PSA based
11981 /// Redis Instance.
11982 RedisInstanceConnectingFromPupiAddress,
11983 /// Packet is dropped due to no route to the destination network.
11984 RedisInstanceNoRouteToDestinationNetwork,
11985 /// Redis Instance does not have an external IP address.
11986 RedisInstanceNoExternalIp,
11987 /// Packet is dropped due to an unsupported protocol being used to connect to
11988 /// a Redis Instance. Only TCP connections are accepted by a Redis Instance.
11989 RedisInstanceUnsupportedProtocol,
11990 /// Generic drop cause for a packet being dropped inside a Redis Cluster
11991 /// service project.
11992 DroppedInsideRedisClusterService,
11993 /// Packet is dropped due to an unsupported port being used to connect to a
11994 /// Redis Cluster. Ports 6379 and 11000 to 13047 should be used to connect to
11995 /// a Redis Cluster.
11996 RedisClusterUnsupportedPort,
11997 /// Redis Cluster does not have an external IP address.
11998 RedisClusterNoExternalIp,
11999 /// Packet is dropped due to an unsupported protocol being used to connect to
12000 /// a Redis Cluster. Only TCP connections are accepted by a Redis Cluster.
12001 RedisClusterUnsupportedProtocol,
12002 /// Packet from the non-GCP (on-prem) or unknown GCP network is dropped due
12003 /// to the destination IP address not belonging to any IP prefix advertised
12004 /// via BGP by the Cloud Router.
12005 NoAdvertisedRouteToGcpDestination,
12006 /// Packet from the non-GCP (on-prem) or unknown GCP network is dropped due
12007 /// to the destination IP address not belonging to any IP prefix included to
12008 /// the local traffic selector of the VPN tunnel.
12009 NoTrafficSelectorToGcpDestination,
12010 /// Packet from the unknown peered network is dropped due to no known route
12011 /// from the source network to the destination IP address.
12012 NoKnownRouteFromPeeredNetworkToDestination,
12013 /// Sending packets processed by the Private NAT Gateways to the Private
12014 /// Service Connect endpoints is not supported.
12015 PrivateNatToPscEndpointUnsupported,
12016 /// Packet is sent to the PSC port mapping service, but its destination port
12017 /// does not match any port mapping rules.
12018 PscPortMappingPortMismatch,
12019 /// Sending packets directly to the PSC port mapping service without going
12020 /// through the PSC connection is not supported.
12021 PscPortMappingWithoutPscConnectionUnsupported,
12022 /// Packet with destination IP address within the reserved NAT64 range is
12023 /// dropped due to matching a route of an unsupported type.
12024 UnsupportedRouteMatchedForNat64Destination,
12025 /// Packet could be dropped because hybrid endpoint like a VPN gateway or
12026 /// Interconnect is not allowed to send traffic to the Internet.
12027 TrafficFromHybridEndpointToInternetDisallowed,
12028 /// Packet with destination IP address within the reserved NAT64 range is
12029 /// dropped due to no matching NAT gateway in the subnet.
12030 NoMatchingNat64Gateway,
12031 /// Packet is dropped due to being sent to a backend of a passthrough load
12032 /// balancer that doesn't use the same IP version as the frontend.
12033 LoadBalancerBackendIpVersionMismatch,
12034 /// Packet from the unknown NCC network is dropped due to no known route
12035 /// from the source network to the destination IP address.
12036 NoKnownRouteFromNccNetworkToDestination,
12037 /// Packet is dropped by Cloud NAT due to using an unsupported protocol.
12038 CloudNatProtocolUnsupported,
12039 /// Packet is dropped due to using an unsupported protocol (any other than
12040 /// UDP) for L2 Interconnect.
12041 L2InterconnectUnsupportedProtocol,
12042 /// Packet is dropped due to using an unsupported port (any other than
12043 /// 6081) for L2 Interconnect.
12044 L2InterconnectUnsupportedPort,
12045 /// Packet is dropped due to destination IP not matching the appliance
12046 /// mapping IPs configured on the L2 Interconnect attachment.
12047 L2InterconnectDestinationIpMismatch,
12048 /// Packet could be dropped because it matches a route associated with an NCC
12049 /// spoke in the hybrid subnet context, but such a configuration is not
12050 /// supported.
12051 NccRouteWithinHybridSubnetUnsupported,
12052 /// Packet is dropped because the region of the hybrid subnet is different
12053 /// from the region of the next hop of the route matched within this hybrid
12054 /// subnet.
12055 HybridSubnetRegionMismatch,
12056 /// If set, the enum was initialized with an unknown value.
12057 ///
12058 /// Applications can examine the value using [Cause::value] or
12059 /// [Cause::name].
12060 UnknownValue(cause::UnknownValue),
12061 }
12062
12063 #[doc(hidden)]
12064 pub mod cause {
12065 #[allow(unused_imports)]
12066 use super::*;
12067 #[derive(Clone, Debug, PartialEq)]
12068 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12069 }
12070
12071 impl Cause {
12072 /// Gets the enum value.
12073 ///
12074 /// Returns `None` if the enum contains an unknown value deserialized from
12075 /// the string representation of enums.
12076 pub fn value(&self) -> std::option::Option<i32> {
12077 match self {
12078 Self::Unspecified => std::option::Option::Some(0),
12079 Self::UnknownExternalAddress => std::option::Option::Some(1),
12080 Self::ForeignIpDisallowed => std::option::Option::Some(2),
12081 Self::FirewallRule => std::option::Option::Some(3),
12082 Self::NoRoute => std::option::Option::Some(4),
12083 Self::RouteBlackhole => std::option::Option::Some(5),
12084 Self::RouteWrongNetwork => std::option::Option::Some(6),
12085 Self::RouteNextHopIpAddressNotResolved => std::option::Option::Some(42),
12086 Self::RouteNextHopResourceNotFound => std::option::Option::Some(43),
12087 Self::RouteNextHopInstanceWrongNetwork => std::option::Option::Some(49),
12088 Self::RouteNextHopInstanceNonPrimaryIp => std::option::Option::Some(50),
12089 Self::RouteNextHopForwardingRuleIpMismatch => std::option::Option::Some(51),
12090 Self::RouteNextHopVpnTunnelNotEstablished => std::option::Option::Some(52),
12091 Self::RouteNextHopForwardingRuleTypeInvalid => std::option::Option::Some(53),
12092 Self::NoRouteFromInternetToPrivateIpv6Address => std::option::Option::Some(44),
12093 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
12094 std::option::Option::Some(98)
12095 }
12096 Self::VpnTunnelLocalSelectorMismatch => std::option::Option::Some(45),
12097 Self::VpnTunnelRemoteSelectorMismatch => std::option::Option::Some(46),
12098 Self::PrivateTrafficToInternet => std::option::Option::Some(7),
12099 Self::PrivateGoogleAccessDisallowed => std::option::Option::Some(8),
12100 Self::PrivateGoogleAccessViaVpnTunnelUnsupported => std::option::Option::Some(47),
12101 Self::NoExternalAddress => std::option::Option::Some(9),
12102 Self::UnknownInternalAddress => std::option::Option::Some(10),
12103 Self::ForwardingRuleMismatch => std::option::Option::Some(11),
12104 Self::ForwardingRuleNoInstances => std::option::Option::Some(12),
12105 Self::FirewallBlockingLoadBalancerBackendHealthCheck => {
12106 std::option::Option::Some(13)
12107 }
12108 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => {
12109 std::option::Option::Some(85)
12110 }
12111 Self::InstanceNotRunning => std::option::Option::Some(14),
12112 Self::GkeClusterNotRunning => std::option::Option::Some(27),
12113 Self::CloudSqlInstanceNotRunning => std::option::Option::Some(28),
12114 Self::RedisInstanceNotRunning => std::option::Option::Some(68),
12115 Self::RedisClusterNotRunning => std::option::Option::Some(69),
12116 Self::TrafficTypeBlocked => std::option::Option::Some(15),
12117 Self::GkeMasterUnauthorizedAccess => std::option::Option::Some(16),
12118 Self::CloudSqlInstanceUnauthorizedAccess => std::option::Option::Some(17),
12119 Self::DroppedInsideGkeService => std::option::Option::Some(18),
12120 Self::DroppedInsideCloudSqlService => std::option::Option::Some(19),
12121 Self::GoogleManagedServiceNoPeering => std::option::Option::Some(20),
12122 Self::GoogleManagedServiceNoPscEndpoint => std::option::Option::Some(38),
12123 Self::GkePscEndpointMissing => std::option::Option::Some(36),
12124 Self::CloudSqlInstanceNoIpAddress => std::option::Option::Some(21),
12125 Self::GkeControlPlaneRegionMismatch => std::option::Option::Some(30),
12126 Self::PublicGkeControlPlaneToPrivateDestination => std::option::Option::Some(31),
12127 Self::GkeControlPlaneNoRoute => std::option::Option::Some(32),
12128 Self::CloudSqlInstanceNotConfiguredForExternalTraffic => {
12129 std::option::Option::Some(33)
12130 }
12131 Self::PublicCloudSqlInstanceToPrivateDestination => std::option::Option::Some(34),
12132 Self::CloudSqlInstanceNoRoute => std::option::Option::Some(35),
12133 Self::CloudSqlConnectorRequired => std::option::Option::Some(63),
12134 Self::CloudFunctionNotActive => std::option::Option::Some(22),
12135 Self::VpcConnectorNotSet => std::option::Option::Some(23),
12136 Self::VpcConnectorNotRunning => std::option::Option::Some(24),
12137 Self::VpcConnectorServerlessTrafficBlocked => std::option::Option::Some(60),
12138 Self::VpcConnectorHealthCheckTrafficBlocked => std::option::Option::Some(61),
12139 Self::ForwardingRuleRegionMismatch => std::option::Option::Some(25),
12140 Self::PscConnectionNotAccepted => std::option::Option::Some(26),
12141 Self::PscEndpointAccessedFromPeeredNetwork => std::option::Option::Some(41),
12142 Self::PscNegProducerEndpointNoGlobalAccess => std::option::Option::Some(48),
12143 Self::PscNegProducerForwardingRuleMultiplePorts => std::option::Option::Some(54),
12144 Self::CloudSqlPscNegUnsupported => std::option::Option::Some(58),
12145 Self::NoNatSubnetsForPscServiceAttachment => std::option::Option::Some(57),
12146 Self::PscTransitivityNotPropagated => std::option::Option::Some(64),
12147 Self::HybridNegNonDynamicRouteMatched => std::option::Option::Some(55),
12148 Self::HybridNegNonLocalDynamicRouteMatched => std::option::Option::Some(56),
12149 Self::CloudRunRevisionNotReady => std::option::Option::Some(29),
12150 Self::DroppedInsidePscServiceProducer => std::option::Option::Some(37),
12151 Self::LoadBalancerHasNoProxySubnet => std::option::Option::Some(39),
12152 Self::CloudNatNoAddresses => std::option::Option::Some(40),
12153 Self::RoutingLoop => std::option::Option::Some(59),
12154 Self::DroppedInsideGoogleManagedService => std::option::Option::Some(62),
12155 Self::LoadBalancerBackendInvalidNetwork => std::option::Option::Some(65),
12156 Self::BackendServiceNamedPortNotDefined => std::option::Option::Some(66),
12157 Self::DestinationIsPrivateNatIpRange => std::option::Option::Some(67),
12158 Self::DroppedInsideRedisInstanceService => std::option::Option::Some(70),
12159 Self::RedisInstanceUnsupportedPort => std::option::Option::Some(71),
12160 Self::RedisInstanceConnectingFromPupiAddress => std::option::Option::Some(72),
12161 Self::RedisInstanceNoRouteToDestinationNetwork => std::option::Option::Some(73),
12162 Self::RedisInstanceNoExternalIp => std::option::Option::Some(74),
12163 Self::RedisInstanceUnsupportedProtocol => std::option::Option::Some(78),
12164 Self::DroppedInsideRedisClusterService => std::option::Option::Some(75),
12165 Self::RedisClusterUnsupportedPort => std::option::Option::Some(76),
12166 Self::RedisClusterNoExternalIp => std::option::Option::Some(77),
12167 Self::RedisClusterUnsupportedProtocol => std::option::Option::Some(79),
12168 Self::NoAdvertisedRouteToGcpDestination => std::option::Option::Some(80),
12169 Self::NoTrafficSelectorToGcpDestination => std::option::Option::Some(81),
12170 Self::NoKnownRouteFromPeeredNetworkToDestination => std::option::Option::Some(82),
12171 Self::PrivateNatToPscEndpointUnsupported => std::option::Option::Some(83),
12172 Self::PscPortMappingPortMismatch => std::option::Option::Some(86),
12173 Self::PscPortMappingWithoutPscConnectionUnsupported => {
12174 std::option::Option::Some(87)
12175 }
12176 Self::UnsupportedRouteMatchedForNat64Destination => std::option::Option::Some(88),
12177 Self::TrafficFromHybridEndpointToInternetDisallowed => {
12178 std::option::Option::Some(89)
12179 }
12180 Self::NoMatchingNat64Gateway => std::option::Option::Some(90),
12181 Self::LoadBalancerBackendIpVersionMismatch => std::option::Option::Some(96),
12182 Self::NoKnownRouteFromNccNetworkToDestination => std::option::Option::Some(97),
12183 Self::CloudNatProtocolUnsupported => std::option::Option::Some(99),
12184 Self::L2InterconnectUnsupportedProtocol => std::option::Option::Some(100),
12185 Self::L2InterconnectUnsupportedPort => std::option::Option::Some(101),
12186 Self::L2InterconnectDestinationIpMismatch => std::option::Option::Some(102),
12187 Self::NccRouteWithinHybridSubnetUnsupported => std::option::Option::Some(104),
12188 Self::HybridSubnetRegionMismatch => std::option::Option::Some(105),
12189 Self::UnknownValue(u) => u.0.value(),
12190 }
12191 }
12192
12193 /// Gets the enum value as a string.
12194 ///
12195 /// Returns `None` if the enum contains an unknown value deserialized from
12196 /// the integer representation of enums.
12197 pub fn name(&self) -> std::option::Option<&str> {
12198 match self {
12199 Self::Unspecified => std::option::Option::Some("CAUSE_UNSPECIFIED"),
12200 Self::UnknownExternalAddress => {
12201 std::option::Option::Some("UNKNOWN_EXTERNAL_ADDRESS")
12202 }
12203 Self::ForeignIpDisallowed => std::option::Option::Some("FOREIGN_IP_DISALLOWED"),
12204 Self::FirewallRule => std::option::Option::Some("FIREWALL_RULE"),
12205 Self::NoRoute => std::option::Option::Some("NO_ROUTE"),
12206 Self::RouteBlackhole => std::option::Option::Some("ROUTE_BLACKHOLE"),
12207 Self::RouteWrongNetwork => std::option::Option::Some("ROUTE_WRONG_NETWORK"),
12208 Self::RouteNextHopIpAddressNotResolved => {
12209 std::option::Option::Some("ROUTE_NEXT_HOP_IP_ADDRESS_NOT_RESOLVED")
12210 }
12211 Self::RouteNextHopResourceNotFound => {
12212 std::option::Option::Some("ROUTE_NEXT_HOP_RESOURCE_NOT_FOUND")
12213 }
12214 Self::RouteNextHopInstanceWrongNetwork => {
12215 std::option::Option::Some("ROUTE_NEXT_HOP_INSTANCE_WRONG_NETWORK")
12216 }
12217 Self::RouteNextHopInstanceNonPrimaryIp => {
12218 std::option::Option::Some("ROUTE_NEXT_HOP_INSTANCE_NON_PRIMARY_IP")
12219 }
12220 Self::RouteNextHopForwardingRuleIpMismatch => {
12221 std::option::Option::Some("ROUTE_NEXT_HOP_FORWARDING_RULE_IP_MISMATCH")
12222 }
12223 Self::RouteNextHopVpnTunnelNotEstablished => {
12224 std::option::Option::Some("ROUTE_NEXT_HOP_VPN_TUNNEL_NOT_ESTABLISHED")
12225 }
12226 Self::RouteNextHopForwardingRuleTypeInvalid => {
12227 std::option::Option::Some("ROUTE_NEXT_HOP_FORWARDING_RULE_TYPE_INVALID")
12228 }
12229 Self::NoRouteFromInternetToPrivateIpv6Address => {
12230 std::option::Option::Some("NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV6_ADDRESS")
12231 }
12232 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
12233 std::option::Option::Some(
12234 "NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS",
12235 )
12236 }
12237 Self::VpnTunnelLocalSelectorMismatch => {
12238 std::option::Option::Some("VPN_TUNNEL_LOCAL_SELECTOR_MISMATCH")
12239 }
12240 Self::VpnTunnelRemoteSelectorMismatch => {
12241 std::option::Option::Some("VPN_TUNNEL_REMOTE_SELECTOR_MISMATCH")
12242 }
12243 Self::PrivateTrafficToInternet => {
12244 std::option::Option::Some("PRIVATE_TRAFFIC_TO_INTERNET")
12245 }
12246 Self::PrivateGoogleAccessDisallowed => {
12247 std::option::Option::Some("PRIVATE_GOOGLE_ACCESS_DISALLOWED")
12248 }
12249 Self::PrivateGoogleAccessViaVpnTunnelUnsupported => {
12250 std::option::Option::Some("PRIVATE_GOOGLE_ACCESS_VIA_VPN_TUNNEL_UNSUPPORTED")
12251 }
12252 Self::NoExternalAddress => std::option::Option::Some("NO_EXTERNAL_ADDRESS"),
12253 Self::UnknownInternalAddress => {
12254 std::option::Option::Some("UNKNOWN_INTERNAL_ADDRESS")
12255 }
12256 Self::ForwardingRuleMismatch => {
12257 std::option::Option::Some("FORWARDING_RULE_MISMATCH")
12258 }
12259 Self::ForwardingRuleNoInstances => {
12260 std::option::Option::Some("FORWARDING_RULE_NO_INSTANCES")
12261 }
12262 Self::FirewallBlockingLoadBalancerBackendHealthCheck => std::option::Option::Some(
12263 "FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK",
12264 ),
12265 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => std::option::Option::Some(
12266 "INGRESS_FIREWALL_TAGS_UNSUPPORTED_BY_DIRECT_VPC_EGRESS",
12267 ),
12268 Self::InstanceNotRunning => std::option::Option::Some("INSTANCE_NOT_RUNNING"),
12269 Self::GkeClusterNotRunning => std::option::Option::Some("GKE_CLUSTER_NOT_RUNNING"),
12270 Self::CloudSqlInstanceNotRunning => {
12271 std::option::Option::Some("CLOUD_SQL_INSTANCE_NOT_RUNNING")
12272 }
12273 Self::RedisInstanceNotRunning => {
12274 std::option::Option::Some("REDIS_INSTANCE_NOT_RUNNING")
12275 }
12276 Self::RedisClusterNotRunning => {
12277 std::option::Option::Some("REDIS_CLUSTER_NOT_RUNNING")
12278 }
12279 Self::TrafficTypeBlocked => std::option::Option::Some("TRAFFIC_TYPE_BLOCKED"),
12280 Self::GkeMasterUnauthorizedAccess => {
12281 std::option::Option::Some("GKE_MASTER_UNAUTHORIZED_ACCESS")
12282 }
12283 Self::CloudSqlInstanceUnauthorizedAccess => {
12284 std::option::Option::Some("CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS")
12285 }
12286 Self::DroppedInsideGkeService => {
12287 std::option::Option::Some("DROPPED_INSIDE_GKE_SERVICE")
12288 }
12289 Self::DroppedInsideCloudSqlService => {
12290 std::option::Option::Some("DROPPED_INSIDE_CLOUD_SQL_SERVICE")
12291 }
12292 Self::GoogleManagedServiceNoPeering => {
12293 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_NO_PEERING")
12294 }
12295 Self::GoogleManagedServiceNoPscEndpoint => {
12296 std::option::Option::Some("GOOGLE_MANAGED_SERVICE_NO_PSC_ENDPOINT")
12297 }
12298 Self::GkePscEndpointMissing => {
12299 std::option::Option::Some("GKE_PSC_ENDPOINT_MISSING")
12300 }
12301 Self::CloudSqlInstanceNoIpAddress => {
12302 std::option::Option::Some("CLOUD_SQL_INSTANCE_NO_IP_ADDRESS")
12303 }
12304 Self::GkeControlPlaneRegionMismatch => {
12305 std::option::Option::Some("GKE_CONTROL_PLANE_REGION_MISMATCH")
12306 }
12307 Self::PublicGkeControlPlaneToPrivateDestination => {
12308 std::option::Option::Some("PUBLIC_GKE_CONTROL_PLANE_TO_PRIVATE_DESTINATION")
12309 }
12310 Self::GkeControlPlaneNoRoute => {
12311 std::option::Option::Some("GKE_CONTROL_PLANE_NO_ROUTE")
12312 }
12313 Self::CloudSqlInstanceNotConfiguredForExternalTraffic => std::option::Option::Some(
12314 "CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC",
12315 ),
12316 Self::PublicCloudSqlInstanceToPrivateDestination => {
12317 std::option::Option::Some("PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION")
12318 }
12319 Self::CloudSqlInstanceNoRoute => {
12320 std::option::Option::Some("CLOUD_SQL_INSTANCE_NO_ROUTE")
12321 }
12322 Self::CloudSqlConnectorRequired => {
12323 std::option::Option::Some("CLOUD_SQL_CONNECTOR_REQUIRED")
12324 }
12325 Self::CloudFunctionNotActive => {
12326 std::option::Option::Some("CLOUD_FUNCTION_NOT_ACTIVE")
12327 }
12328 Self::VpcConnectorNotSet => std::option::Option::Some("VPC_CONNECTOR_NOT_SET"),
12329 Self::VpcConnectorNotRunning => {
12330 std::option::Option::Some("VPC_CONNECTOR_NOT_RUNNING")
12331 }
12332 Self::VpcConnectorServerlessTrafficBlocked => {
12333 std::option::Option::Some("VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED")
12334 }
12335 Self::VpcConnectorHealthCheckTrafficBlocked => {
12336 std::option::Option::Some("VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED")
12337 }
12338 Self::ForwardingRuleRegionMismatch => {
12339 std::option::Option::Some("FORWARDING_RULE_REGION_MISMATCH")
12340 }
12341 Self::PscConnectionNotAccepted => {
12342 std::option::Option::Some("PSC_CONNECTION_NOT_ACCEPTED")
12343 }
12344 Self::PscEndpointAccessedFromPeeredNetwork => {
12345 std::option::Option::Some("PSC_ENDPOINT_ACCESSED_FROM_PEERED_NETWORK")
12346 }
12347 Self::PscNegProducerEndpointNoGlobalAccess => {
12348 std::option::Option::Some("PSC_NEG_PRODUCER_ENDPOINT_NO_GLOBAL_ACCESS")
12349 }
12350 Self::PscNegProducerForwardingRuleMultiplePorts => {
12351 std::option::Option::Some("PSC_NEG_PRODUCER_FORWARDING_RULE_MULTIPLE_PORTS")
12352 }
12353 Self::CloudSqlPscNegUnsupported => {
12354 std::option::Option::Some("CLOUD_SQL_PSC_NEG_UNSUPPORTED")
12355 }
12356 Self::NoNatSubnetsForPscServiceAttachment => {
12357 std::option::Option::Some("NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT")
12358 }
12359 Self::PscTransitivityNotPropagated => {
12360 std::option::Option::Some("PSC_TRANSITIVITY_NOT_PROPAGATED")
12361 }
12362 Self::HybridNegNonDynamicRouteMatched => {
12363 std::option::Option::Some("HYBRID_NEG_NON_DYNAMIC_ROUTE_MATCHED")
12364 }
12365 Self::HybridNegNonLocalDynamicRouteMatched => {
12366 std::option::Option::Some("HYBRID_NEG_NON_LOCAL_DYNAMIC_ROUTE_MATCHED")
12367 }
12368 Self::CloudRunRevisionNotReady => {
12369 std::option::Option::Some("CLOUD_RUN_REVISION_NOT_READY")
12370 }
12371 Self::DroppedInsidePscServiceProducer => {
12372 std::option::Option::Some("DROPPED_INSIDE_PSC_SERVICE_PRODUCER")
12373 }
12374 Self::LoadBalancerHasNoProxySubnet => {
12375 std::option::Option::Some("LOAD_BALANCER_HAS_NO_PROXY_SUBNET")
12376 }
12377 Self::CloudNatNoAddresses => std::option::Option::Some("CLOUD_NAT_NO_ADDRESSES"),
12378 Self::RoutingLoop => std::option::Option::Some("ROUTING_LOOP"),
12379 Self::DroppedInsideGoogleManagedService => {
12380 std::option::Option::Some("DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE")
12381 }
12382 Self::LoadBalancerBackendInvalidNetwork => {
12383 std::option::Option::Some("LOAD_BALANCER_BACKEND_INVALID_NETWORK")
12384 }
12385 Self::BackendServiceNamedPortNotDefined => {
12386 std::option::Option::Some("BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED")
12387 }
12388 Self::DestinationIsPrivateNatIpRange => {
12389 std::option::Option::Some("DESTINATION_IS_PRIVATE_NAT_IP_RANGE")
12390 }
12391 Self::DroppedInsideRedisInstanceService => {
12392 std::option::Option::Some("DROPPED_INSIDE_REDIS_INSTANCE_SERVICE")
12393 }
12394 Self::RedisInstanceUnsupportedPort => {
12395 std::option::Option::Some("REDIS_INSTANCE_UNSUPPORTED_PORT")
12396 }
12397 Self::RedisInstanceConnectingFromPupiAddress => {
12398 std::option::Option::Some("REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS")
12399 }
12400 Self::RedisInstanceNoRouteToDestinationNetwork => {
12401 std::option::Option::Some("REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK")
12402 }
12403 Self::RedisInstanceNoExternalIp => {
12404 std::option::Option::Some("REDIS_INSTANCE_NO_EXTERNAL_IP")
12405 }
12406 Self::RedisInstanceUnsupportedProtocol => {
12407 std::option::Option::Some("REDIS_INSTANCE_UNSUPPORTED_PROTOCOL")
12408 }
12409 Self::DroppedInsideRedisClusterService => {
12410 std::option::Option::Some("DROPPED_INSIDE_REDIS_CLUSTER_SERVICE")
12411 }
12412 Self::RedisClusterUnsupportedPort => {
12413 std::option::Option::Some("REDIS_CLUSTER_UNSUPPORTED_PORT")
12414 }
12415 Self::RedisClusterNoExternalIp => {
12416 std::option::Option::Some("REDIS_CLUSTER_NO_EXTERNAL_IP")
12417 }
12418 Self::RedisClusterUnsupportedProtocol => {
12419 std::option::Option::Some("REDIS_CLUSTER_UNSUPPORTED_PROTOCOL")
12420 }
12421 Self::NoAdvertisedRouteToGcpDestination => {
12422 std::option::Option::Some("NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION")
12423 }
12424 Self::NoTrafficSelectorToGcpDestination => {
12425 std::option::Option::Some("NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION")
12426 }
12427 Self::NoKnownRouteFromPeeredNetworkToDestination => {
12428 std::option::Option::Some("NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION")
12429 }
12430 Self::PrivateNatToPscEndpointUnsupported => {
12431 std::option::Option::Some("PRIVATE_NAT_TO_PSC_ENDPOINT_UNSUPPORTED")
12432 }
12433 Self::PscPortMappingPortMismatch => {
12434 std::option::Option::Some("PSC_PORT_MAPPING_PORT_MISMATCH")
12435 }
12436 Self::PscPortMappingWithoutPscConnectionUnsupported => {
12437 std::option::Option::Some("PSC_PORT_MAPPING_WITHOUT_PSC_CONNECTION_UNSUPPORTED")
12438 }
12439 Self::UnsupportedRouteMatchedForNat64Destination => {
12440 std::option::Option::Some("UNSUPPORTED_ROUTE_MATCHED_FOR_NAT64_DESTINATION")
12441 }
12442 Self::TrafficFromHybridEndpointToInternetDisallowed => {
12443 std::option::Option::Some("TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED")
12444 }
12445 Self::NoMatchingNat64Gateway => {
12446 std::option::Option::Some("NO_MATCHING_NAT64_GATEWAY")
12447 }
12448 Self::LoadBalancerBackendIpVersionMismatch => {
12449 std::option::Option::Some("LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH")
12450 }
12451 Self::NoKnownRouteFromNccNetworkToDestination => {
12452 std::option::Option::Some("NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION")
12453 }
12454 Self::CloudNatProtocolUnsupported => {
12455 std::option::Option::Some("CLOUD_NAT_PROTOCOL_UNSUPPORTED")
12456 }
12457 Self::L2InterconnectUnsupportedProtocol => {
12458 std::option::Option::Some("L2_INTERCONNECT_UNSUPPORTED_PROTOCOL")
12459 }
12460 Self::L2InterconnectUnsupportedPort => {
12461 std::option::Option::Some("L2_INTERCONNECT_UNSUPPORTED_PORT")
12462 }
12463 Self::L2InterconnectDestinationIpMismatch => {
12464 std::option::Option::Some("L2_INTERCONNECT_DESTINATION_IP_MISMATCH")
12465 }
12466 Self::NccRouteWithinHybridSubnetUnsupported => {
12467 std::option::Option::Some("NCC_ROUTE_WITHIN_HYBRID_SUBNET_UNSUPPORTED")
12468 }
12469 Self::HybridSubnetRegionMismatch => {
12470 std::option::Option::Some("HYBRID_SUBNET_REGION_MISMATCH")
12471 }
12472 Self::UnknownValue(u) => u.0.name(),
12473 }
12474 }
12475 }
12476
12477 impl std::default::Default for Cause {
12478 fn default() -> Self {
12479 use std::convert::From;
12480 Self::from(0)
12481 }
12482 }
12483
12484 impl std::fmt::Display for Cause {
12485 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12486 wkt::internal::display_enum(f, self.name(), self.value())
12487 }
12488 }
12489
12490 impl std::convert::From<i32> for Cause {
12491 fn from(value: i32) -> Self {
12492 match value {
12493 0 => Self::Unspecified,
12494 1 => Self::UnknownExternalAddress,
12495 2 => Self::ForeignIpDisallowed,
12496 3 => Self::FirewallRule,
12497 4 => Self::NoRoute,
12498 5 => Self::RouteBlackhole,
12499 6 => Self::RouteWrongNetwork,
12500 7 => Self::PrivateTrafficToInternet,
12501 8 => Self::PrivateGoogleAccessDisallowed,
12502 9 => Self::NoExternalAddress,
12503 10 => Self::UnknownInternalAddress,
12504 11 => Self::ForwardingRuleMismatch,
12505 12 => Self::ForwardingRuleNoInstances,
12506 13 => Self::FirewallBlockingLoadBalancerBackendHealthCheck,
12507 14 => Self::InstanceNotRunning,
12508 15 => Self::TrafficTypeBlocked,
12509 16 => Self::GkeMasterUnauthorizedAccess,
12510 17 => Self::CloudSqlInstanceUnauthorizedAccess,
12511 18 => Self::DroppedInsideGkeService,
12512 19 => Self::DroppedInsideCloudSqlService,
12513 20 => Self::GoogleManagedServiceNoPeering,
12514 21 => Self::CloudSqlInstanceNoIpAddress,
12515 22 => Self::CloudFunctionNotActive,
12516 23 => Self::VpcConnectorNotSet,
12517 24 => Self::VpcConnectorNotRunning,
12518 25 => Self::ForwardingRuleRegionMismatch,
12519 26 => Self::PscConnectionNotAccepted,
12520 27 => Self::GkeClusterNotRunning,
12521 28 => Self::CloudSqlInstanceNotRunning,
12522 29 => Self::CloudRunRevisionNotReady,
12523 30 => Self::GkeControlPlaneRegionMismatch,
12524 31 => Self::PublicGkeControlPlaneToPrivateDestination,
12525 32 => Self::GkeControlPlaneNoRoute,
12526 33 => Self::CloudSqlInstanceNotConfiguredForExternalTraffic,
12527 34 => Self::PublicCloudSqlInstanceToPrivateDestination,
12528 35 => Self::CloudSqlInstanceNoRoute,
12529 36 => Self::GkePscEndpointMissing,
12530 37 => Self::DroppedInsidePscServiceProducer,
12531 38 => Self::GoogleManagedServiceNoPscEndpoint,
12532 39 => Self::LoadBalancerHasNoProxySubnet,
12533 40 => Self::CloudNatNoAddresses,
12534 41 => Self::PscEndpointAccessedFromPeeredNetwork,
12535 42 => Self::RouteNextHopIpAddressNotResolved,
12536 43 => Self::RouteNextHopResourceNotFound,
12537 44 => Self::NoRouteFromInternetToPrivateIpv6Address,
12538 45 => Self::VpnTunnelLocalSelectorMismatch,
12539 46 => Self::VpnTunnelRemoteSelectorMismatch,
12540 47 => Self::PrivateGoogleAccessViaVpnTunnelUnsupported,
12541 48 => Self::PscNegProducerEndpointNoGlobalAccess,
12542 49 => Self::RouteNextHopInstanceWrongNetwork,
12543 50 => Self::RouteNextHopInstanceNonPrimaryIp,
12544 51 => Self::RouteNextHopForwardingRuleIpMismatch,
12545 52 => Self::RouteNextHopVpnTunnelNotEstablished,
12546 53 => Self::RouteNextHopForwardingRuleTypeInvalid,
12547 54 => Self::PscNegProducerForwardingRuleMultiplePorts,
12548 55 => Self::HybridNegNonDynamicRouteMatched,
12549 56 => Self::HybridNegNonLocalDynamicRouteMatched,
12550 57 => Self::NoNatSubnetsForPscServiceAttachment,
12551 58 => Self::CloudSqlPscNegUnsupported,
12552 59 => Self::RoutingLoop,
12553 60 => Self::VpcConnectorServerlessTrafficBlocked,
12554 61 => Self::VpcConnectorHealthCheckTrafficBlocked,
12555 62 => Self::DroppedInsideGoogleManagedService,
12556 63 => Self::CloudSqlConnectorRequired,
12557 64 => Self::PscTransitivityNotPropagated,
12558 65 => Self::LoadBalancerBackendInvalidNetwork,
12559 66 => Self::BackendServiceNamedPortNotDefined,
12560 67 => Self::DestinationIsPrivateNatIpRange,
12561 68 => Self::RedisInstanceNotRunning,
12562 69 => Self::RedisClusterNotRunning,
12563 70 => Self::DroppedInsideRedisInstanceService,
12564 71 => Self::RedisInstanceUnsupportedPort,
12565 72 => Self::RedisInstanceConnectingFromPupiAddress,
12566 73 => Self::RedisInstanceNoRouteToDestinationNetwork,
12567 74 => Self::RedisInstanceNoExternalIp,
12568 75 => Self::DroppedInsideRedisClusterService,
12569 76 => Self::RedisClusterUnsupportedPort,
12570 77 => Self::RedisClusterNoExternalIp,
12571 78 => Self::RedisInstanceUnsupportedProtocol,
12572 79 => Self::RedisClusterUnsupportedProtocol,
12573 80 => Self::NoAdvertisedRouteToGcpDestination,
12574 81 => Self::NoTrafficSelectorToGcpDestination,
12575 82 => Self::NoKnownRouteFromPeeredNetworkToDestination,
12576 83 => Self::PrivateNatToPscEndpointUnsupported,
12577 85 => Self::IngressFirewallTagsUnsupportedByDirectVpcEgress,
12578 86 => Self::PscPortMappingPortMismatch,
12579 87 => Self::PscPortMappingWithoutPscConnectionUnsupported,
12580 88 => Self::UnsupportedRouteMatchedForNat64Destination,
12581 89 => Self::TrafficFromHybridEndpointToInternetDisallowed,
12582 90 => Self::NoMatchingNat64Gateway,
12583 96 => Self::LoadBalancerBackendIpVersionMismatch,
12584 97 => Self::NoKnownRouteFromNccNetworkToDestination,
12585 98 => Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address,
12586 99 => Self::CloudNatProtocolUnsupported,
12587 100 => Self::L2InterconnectUnsupportedProtocol,
12588 101 => Self::L2InterconnectUnsupportedPort,
12589 102 => Self::L2InterconnectDestinationIpMismatch,
12590 104 => Self::NccRouteWithinHybridSubnetUnsupported,
12591 105 => Self::HybridSubnetRegionMismatch,
12592 _ => Self::UnknownValue(cause::UnknownValue(
12593 wkt::internal::UnknownEnumValue::Integer(value),
12594 )),
12595 }
12596 }
12597 }
12598
12599 impl std::convert::From<&str> for Cause {
12600 fn from(value: &str) -> Self {
12601 use std::string::ToString;
12602 match value {
12603 "CAUSE_UNSPECIFIED" => Self::Unspecified,
12604 "UNKNOWN_EXTERNAL_ADDRESS" => Self::UnknownExternalAddress,
12605 "FOREIGN_IP_DISALLOWED" => Self::ForeignIpDisallowed,
12606 "FIREWALL_RULE" => Self::FirewallRule,
12607 "NO_ROUTE" => Self::NoRoute,
12608 "ROUTE_BLACKHOLE" => Self::RouteBlackhole,
12609 "ROUTE_WRONG_NETWORK" => Self::RouteWrongNetwork,
12610 "ROUTE_NEXT_HOP_IP_ADDRESS_NOT_RESOLVED" => Self::RouteNextHopIpAddressNotResolved,
12611 "ROUTE_NEXT_HOP_RESOURCE_NOT_FOUND" => Self::RouteNextHopResourceNotFound,
12612 "ROUTE_NEXT_HOP_INSTANCE_WRONG_NETWORK" => Self::RouteNextHopInstanceWrongNetwork,
12613 "ROUTE_NEXT_HOP_INSTANCE_NON_PRIMARY_IP" => Self::RouteNextHopInstanceNonPrimaryIp,
12614 "ROUTE_NEXT_HOP_FORWARDING_RULE_IP_MISMATCH" => {
12615 Self::RouteNextHopForwardingRuleIpMismatch
12616 }
12617 "ROUTE_NEXT_HOP_VPN_TUNNEL_NOT_ESTABLISHED" => {
12618 Self::RouteNextHopVpnTunnelNotEstablished
12619 }
12620 "ROUTE_NEXT_HOP_FORWARDING_RULE_TYPE_INVALID" => {
12621 Self::RouteNextHopForwardingRuleTypeInvalid
12622 }
12623 "NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV6_ADDRESS" => {
12624 Self::NoRouteFromInternetToPrivateIpv6Address
12625 }
12626 "NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS" => {
12627 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address
12628 }
12629 "VPN_TUNNEL_LOCAL_SELECTOR_MISMATCH" => Self::VpnTunnelLocalSelectorMismatch,
12630 "VPN_TUNNEL_REMOTE_SELECTOR_MISMATCH" => Self::VpnTunnelRemoteSelectorMismatch,
12631 "PRIVATE_TRAFFIC_TO_INTERNET" => Self::PrivateTrafficToInternet,
12632 "PRIVATE_GOOGLE_ACCESS_DISALLOWED" => Self::PrivateGoogleAccessDisallowed,
12633 "PRIVATE_GOOGLE_ACCESS_VIA_VPN_TUNNEL_UNSUPPORTED" => {
12634 Self::PrivateGoogleAccessViaVpnTunnelUnsupported
12635 }
12636 "NO_EXTERNAL_ADDRESS" => Self::NoExternalAddress,
12637 "UNKNOWN_INTERNAL_ADDRESS" => Self::UnknownInternalAddress,
12638 "FORWARDING_RULE_MISMATCH" => Self::ForwardingRuleMismatch,
12639 "FORWARDING_RULE_NO_INSTANCES" => Self::ForwardingRuleNoInstances,
12640 "FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK" => {
12641 Self::FirewallBlockingLoadBalancerBackendHealthCheck
12642 }
12643 "INGRESS_FIREWALL_TAGS_UNSUPPORTED_BY_DIRECT_VPC_EGRESS" => {
12644 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress
12645 }
12646 "INSTANCE_NOT_RUNNING" => Self::InstanceNotRunning,
12647 "GKE_CLUSTER_NOT_RUNNING" => Self::GkeClusterNotRunning,
12648 "CLOUD_SQL_INSTANCE_NOT_RUNNING" => Self::CloudSqlInstanceNotRunning,
12649 "REDIS_INSTANCE_NOT_RUNNING" => Self::RedisInstanceNotRunning,
12650 "REDIS_CLUSTER_NOT_RUNNING" => Self::RedisClusterNotRunning,
12651 "TRAFFIC_TYPE_BLOCKED" => Self::TrafficTypeBlocked,
12652 "GKE_MASTER_UNAUTHORIZED_ACCESS" => Self::GkeMasterUnauthorizedAccess,
12653 "CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS" => {
12654 Self::CloudSqlInstanceUnauthorizedAccess
12655 }
12656 "DROPPED_INSIDE_GKE_SERVICE" => Self::DroppedInsideGkeService,
12657 "DROPPED_INSIDE_CLOUD_SQL_SERVICE" => Self::DroppedInsideCloudSqlService,
12658 "GOOGLE_MANAGED_SERVICE_NO_PEERING" => Self::GoogleManagedServiceNoPeering,
12659 "GOOGLE_MANAGED_SERVICE_NO_PSC_ENDPOINT" => Self::GoogleManagedServiceNoPscEndpoint,
12660 "GKE_PSC_ENDPOINT_MISSING" => Self::GkePscEndpointMissing,
12661 "CLOUD_SQL_INSTANCE_NO_IP_ADDRESS" => Self::CloudSqlInstanceNoIpAddress,
12662 "GKE_CONTROL_PLANE_REGION_MISMATCH" => Self::GkeControlPlaneRegionMismatch,
12663 "PUBLIC_GKE_CONTROL_PLANE_TO_PRIVATE_DESTINATION" => {
12664 Self::PublicGkeControlPlaneToPrivateDestination
12665 }
12666 "GKE_CONTROL_PLANE_NO_ROUTE" => Self::GkeControlPlaneNoRoute,
12667 "CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC" => {
12668 Self::CloudSqlInstanceNotConfiguredForExternalTraffic
12669 }
12670 "PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION" => {
12671 Self::PublicCloudSqlInstanceToPrivateDestination
12672 }
12673 "CLOUD_SQL_INSTANCE_NO_ROUTE" => Self::CloudSqlInstanceNoRoute,
12674 "CLOUD_SQL_CONNECTOR_REQUIRED" => Self::CloudSqlConnectorRequired,
12675 "CLOUD_FUNCTION_NOT_ACTIVE" => Self::CloudFunctionNotActive,
12676 "VPC_CONNECTOR_NOT_SET" => Self::VpcConnectorNotSet,
12677 "VPC_CONNECTOR_NOT_RUNNING" => Self::VpcConnectorNotRunning,
12678 "VPC_CONNECTOR_SERVERLESS_TRAFFIC_BLOCKED" => {
12679 Self::VpcConnectorServerlessTrafficBlocked
12680 }
12681 "VPC_CONNECTOR_HEALTH_CHECK_TRAFFIC_BLOCKED" => {
12682 Self::VpcConnectorHealthCheckTrafficBlocked
12683 }
12684 "FORWARDING_RULE_REGION_MISMATCH" => Self::ForwardingRuleRegionMismatch,
12685 "PSC_CONNECTION_NOT_ACCEPTED" => Self::PscConnectionNotAccepted,
12686 "PSC_ENDPOINT_ACCESSED_FROM_PEERED_NETWORK" => {
12687 Self::PscEndpointAccessedFromPeeredNetwork
12688 }
12689 "PSC_NEG_PRODUCER_ENDPOINT_NO_GLOBAL_ACCESS" => {
12690 Self::PscNegProducerEndpointNoGlobalAccess
12691 }
12692 "PSC_NEG_PRODUCER_FORWARDING_RULE_MULTIPLE_PORTS" => {
12693 Self::PscNegProducerForwardingRuleMultiplePorts
12694 }
12695 "CLOUD_SQL_PSC_NEG_UNSUPPORTED" => Self::CloudSqlPscNegUnsupported,
12696 "NO_NAT_SUBNETS_FOR_PSC_SERVICE_ATTACHMENT" => {
12697 Self::NoNatSubnetsForPscServiceAttachment
12698 }
12699 "PSC_TRANSITIVITY_NOT_PROPAGATED" => Self::PscTransitivityNotPropagated,
12700 "HYBRID_NEG_NON_DYNAMIC_ROUTE_MATCHED" => Self::HybridNegNonDynamicRouteMatched,
12701 "HYBRID_NEG_NON_LOCAL_DYNAMIC_ROUTE_MATCHED" => {
12702 Self::HybridNegNonLocalDynamicRouteMatched
12703 }
12704 "CLOUD_RUN_REVISION_NOT_READY" => Self::CloudRunRevisionNotReady,
12705 "DROPPED_INSIDE_PSC_SERVICE_PRODUCER" => Self::DroppedInsidePscServiceProducer,
12706 "LOAD_BALANCER_HAS_NO_PROXY_SUBNET" => Self::LoadBalancerHasNoProxySubnet,
12707 "CLOUD_NAT_NO_ADDRESSES" => Self::CloudNatNoAddresses,
12708 "ROUTING_LOOP" => Self::RoutingLoop,
12709 "DROPPED_INSIDE_GOOGLE_MANAGED_SERVICE" => Self::DroppedInsideGoogleManagedService,
12710 "LOAD_BALANCER_BACKEND_INVALID_NETWORK" => Self::LoadBalancerBackendInvalidNetwork,
12711 "BACKEND_SERVICE_NAMED_PORT_NOT_DEFINED" => Self::BackendServiceNamedPortNotDefined,
12712 "DESTINATION_IS_PRIVATE_NAT_IP_RANGE" => Self::DestinationIsPrivateNatIpRange,
12713 "DROPPED_INSIDE_REDIS_INSTANCE_SERVICE" => Self::DroppedInsideRedisInstanceService,
12714 "REDIS_INSTANCE_UNSUPPORTED_PORT" => Self::RedisInstanceUnsupportedPort,
12715 "REDIS_INSTANCE_CONNECTING_FROM_PUPI_ADDRESS" => {
12716 Self::RedisInstanceConnectingFromPupiAddress
12717 }
12718 "REDIS_INSTANCE_NO_ROUTE_TO_DESTINATION_NETWORK" => {
12719 Self::RedisInstanceNoRouteToDestinationNetwork
12720 }
12721 "REDIS_INSTANCE_NO_EXTERNAL_IP" => Self::RedisInstanceNoExternalIp,
12722 "REDIS_INSTANCE_UNSUPPORTED_PROTOCOL" => Self::RedisInstanceUnsupportedProtocol,
12723 "DROPPED_INSIDE_REDIS_CLUSTER_SERVICE" => Self::DroppedInsideRedisClusterService,
12724 "REDIS_CLUSTER_UNSUPPORTED_PORT" => Self::RedisClusterUnsupportedPort,
12725 "REDIS_CLUSTER_NO_EXTERNAL_IP" => Self::RedisClusterNoExternalIp,
12726 "REDIS_CLUSTER_UNSUPPORTED_PROTOCOL" => Self::RedisClusterUnsupportedProtocol,
12727 "NO_ADVERTISED_ROUTE_TO_GCP_DESTINATION" => Self::NoAdvertisedRouteToGcpDestination,
12728 "NO_TRAFFIC_SELECTOR_TO_GCP_DESTINATION" => Self::NoTrafficSelectorToGcpDestination,
12729 "NO_KNOWN_ROUTE_FROM_PEERED_NETWORK_TO_DESTINATION" => {
12730 Self::NoKnownRouteFromPeeredNetworkToDestination
12731 }
12732 "PRIVATE_NAT_TO_PSC_ENDPOINT_UNSUPPORTED" => {
12733 Self::PrivateNatToPscEndpointUnsupported
12734 }
12735 "PSC_PORT_MAPPING_PORT_MISMATCH" => Self::PscPortMappingPortMismatch,
12736 "PSC_PORT_MAPPING_WITHOUT_PSC_CONNECTION_UNSUPPORTED" => {
12737 Self::PscPortMappingWithoutPscConnectionUnsupported
12738 }
12739 "UNSUPPORTED_ROUTE_MATCHED_FOR_NAT64_DESTINATION" => {
12740 Self::UnsupportedRouteMatchedForNat64Destination
12741 }
12742 "TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED" => {
12743 Self::TrafficFromHybridEndpointToInternetDisallowed
12744 }
12745 "NO_MATCHING_NAT64_GATEWAY" => Self::NoMatchingNat64Gateway,
12746 "LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH" => {
12747 Self::LoadBalancerBackendIpVersionMismatch
12748 }
12749 "NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION" => {
12750 Self::NoKnownRouteFromNccNetworkToDestination
12751 }
12752 "CLOUD_NAT_PROTOCOL_UNSUPPORTED" => Self::CloudNatProtocolUnsupported,
12753 "L2_INTERCONNECT_UNSUPPORTED_PROTOCOL" => Self::L2InterconnectUnsupportedProtocol,
12754 "L2_INTERCONNECT_UNSUPPORTED_PORT" => Self::L2InterconnectUnsupportedPort,
12755 "L2_INTERCONNECT_DESTINATION_IP_MISMATCH" => {
12756 Self::L2InterconnectDestinationIpMismatch
12757 }
12758 "NCC_ROUTE_WITHIN_HYBRID_SUBNET_UNSUPPORTED" => {
12759 Self::NccRouteWithinHybridSubnetUnsupported
12760 }
12761 "HYBRID_SUBNET_REGION_MISMATCH" => Self::HybridSubnetRegionMismatch,
12762 _ => Self::UnknownValue(cause::UnknownValue(
12763 wkt::internal::UnknownEnumValue::String(value.to_string()),
12764 )),
12765 }
12766 }
12767 }
12768
12769 impl serde::ser::Serialize for Cause {
12770 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12771 where
12772 S: serde::Serializer,
12773 {
12774 match self {
12775 Self::Unspecified => serializer.serialize_i32(0),
12776 Self::UnknownExternalAddress => serializer.serialize_i32(1),
12777 Self::ForeignIpDisallowed => serializer.serialize_i32(2),
12778 Self::FirewallRule => serializer.serialize_i32(3),
12779 Self::NoRoute => serializer.serialize_i32(4),
12780 Self::RouteBlackhole => serializer.serialize_i32(5),
12781 Self::RouteWrongNetwork => serializer.serialize_i32(6),
12782 Self::RouteNextHopIpAddressNotResolved => serializer.serialize_i32(42),
12783 Self::RouteNextHopResourceNotFound => serializer.serialize_i32(43),
12784 Self::RouteNextHopInstanceWrongNetwork => serializer.serialize_i32(49),
12785 Self::RouteNextHopInstanceNonPrimaryIp => serializer.serialize_i32(50),
12786 Self::RouteNextHopForwardingRuleIpMismatch => serializer.serialize_i32(51),
12787 Self::RouteNextHopVpnTunnelNotEstablished => serializer.serialize_i32(52),
12788 Self::RouteNextHopForwardingRuleTypeInvalid => serializer.serialize_i32(53),
12789 Self::NoRouteFromInternetToPrivateIpv6Address => serializer.serialize_i32(44),
12790 Self::NoRouteFromExternalIpv6SourceToPrivateIpv6Address => {
12791 serializer.serialize_i32(98)
12792 }
12793 Self::VpnTunnelLocalSelectorMismatch => serializer.serialize_i32(45),
12794 Self::VpnTunnelRemoteSelectorMismatch => serializer.serialize_i32(46),
12795 Self::PrivateTrafficToInternet => serializer.serialize_i32(7),
12796 Self::PrivateGoogleAccessDisallowed => serializer.serialize_i32(8),
12797 Self::PrivateGoogleAccessViaVpnTunnelUnsupported => serializer.serialize_i32(47),
12798 Self::NoExternalAddress => serializer.serialize_i32(9),
12799 Self::UnknownInternalAddress => serializer.serialize_i32(10),
12800 Self::ForwardingRuleMismatch => serializer.serialize_i32(11),
12801 Self::ForwardingRuleNoInstances => serializer.serialize_i32(12),
12802 Self::FirewallBlockingLoadBalancerBackendHealthCheck => {
12803 serializer.serialize_i32(13)
12804 }
12805 Self::IngressFirewallTagsUnsupportedByDirectVpcEgress => {
12806 serializer.serialize_i32(85)
12807 }
12808 Self::InstanceNotRunning => serializer.serialize_i32(14),
12809 Self::GkeClusterNotRunning => serializer.serialize_i32(27),
12810 Self::CloudSqlInstanceNotRunning => serializer.serialize_i32(28),
12811 Self::RedisInstanceNotRunning => serializer.serialize_i32(68),
12812 Self::RedisClusterNotRunning => serializer.serialize_i32(69),
12813 Self::TrafficTypeBlocked => serializer.serialize_i32(15),
12814 Self::GkeMasterUnauthorizedAccess => serializer.serialize_i32(16),
12815 Self::CloudSqlInstanceUnauthorizedAccess => serializer.serialize_i32(17),
12816 Self::DroppedInsideGkeService => serializer.serialize_i32(18),
12817 Self::DroppedInsideCloudSqlService => serializer.serialize_i32(19),
12818 Self::GoogleManagedServiceNoPeering => serializer.serialize_i32(20),
12819 Self::GoogleManagedServiceNoPscEndpoint => serializer.serialize_i32(38),
12820 Self::GkePscEndpointMissing => serializer.serialize_i32(36),
12821 Self::CloudSqlInstanceNoIpAddress => serializer.serialize_i32(21),
12822 Self::GkeControlPlaneRegionMismatch => serializer.serialize_i32(30),
12823 Self::PublicGkeControlPlaneToPrivateDestination => serializer.serialize_i32(31),
12824 Self::GkeControlPlaneNoRoute => serializer.serialize_i32(32),
12825 Self::CloudSqlInstanceNotConfiguredForExternalTraffic => {
12826 serializer.serialize_i32(33)
12827 }
12828 Self::PublicCloudSqlInstanceToPrivateDestination => serializer.serialize_i32(34),
12829 Self::CloudSqlInstanceNoRoute => serializer.serialize_i32(35),
12830 Self::CloudSqlConnectorRequired => serializer.serialize_i32(63),
12831 Self::CloudFunctionNotActive => serializer.serialize_i32(22),
12832 Self::VpcConnectorNotSet => serializer.serialize_i32(23),
12833 Self::VpcConnectorNotRunning => serializer.serialize_i32(24),
12834 Self::VpcConnectorServerlessTrafficBlocked => serializer.serialize_i32(60),
12835 Self::VpcConnectorHealthCheckTrafficBlocked => serializer.serialize_i32(61),
12836 Self::ForwardingRuleRegionMismatch => serializer.serialize_i32(25),
12837 Self::PscConnectionNotAccepted => serializer.serialize_i32(26),
12838 Self::PscEndpointAccessedFromPeeredNetwork => serializer.serialize_i32(41),
12839 Self::PscNegProducerEndpointNoGlobalAccess => serializer.serialize_i32(48),
12840 Self::PscNegProducerForwardingRuleMultiplePorts => serializer.serialize_i32(54),
12841 Self::CloudSqlPscNegUnsupported => serializer.serialize_i32(58),
12842 Self::NoNatSubnetsForPscServiceAttachment => serializer.serialize_i32(57),
12843 Self::PscTransitivityNotPropagated => serializer.serialize_i32(64),
12844 Self::HybridNegNonDynamicRouteMatched => serializer.serialize_i32(55),
12845 Self::HybridNegNonLocalDynamicRouteMatched => serializer.serialize_i32(56),
12846 Self::CloudRunRevisionNotReady => serializer.serialize_i32(29),
12847 Self::DroppedInsidePscServiceProducer => serializer.serialize_i32(37),
12848 Self::LoadBalancerHasNoProxySubnet => serializer.serialize_i32(39),
12849 Self::CloudNatNoAddresses => serializer.serialize_i32(40),
12850 Self::RoutingLoop => serializer.serialize_i32(59),
12851 Self::DroppedInsideGoogleManagedService => serializer.serialize_i32(62),
12852 Self::LoadBalancerBackendInvalidNetwork => serializer.serialize_i32(65),
12853 Self::BackendServiceNamedPortNotDefined => serializer.serialize_i32(66),
12854 Self::DestinationIsPrivateNatIpRange => serializer.serialize_i32(67),
12855 Self::DroppedInsideRedisInstanceService => serializer.serialize_i32(70),
12856 Self::RedisInstanceUnsupportedPort => serializer.serialize_i32(71),
12857 Self::RedisInstanceConnectingFromPupiAddress => serializer.serialize_i32(72),
12858 Self::RedisInstanceNoRouteToDestinationNetwork => serializer.serialize_i32(73),
12859 Self::RedisInstanceNoExternalIp => serializer.serialize_i32(74),
12860 Self::RedisInstanceUnsupportedProtocol => serializer.serialize_i32(78),
12861 Self::DroppedInsideRedisClusterService => serializer.serialize_i32(75),
12862 Self::RedisClusterUnsupportedPort => serializer.serialize_i32(76),
12863 Self::RedisClusterNoExternalIp => serializer.serialize_i32(77),
12864 Self::RedisClusterUnsupportedProtocol => serializer.serialize_i32(79),
12865 Self::NoAdvertisedRouteToGcpDestination => serializer.serialize_i32(80),
12866 Self::NoTrafficSelectorToGcpDestination => serializer.serialize_i32(81),
12867 Self::NoKnownRouteFromPeeredNetworkToDestination => serializer.serialize_i32(82),
12868 Self::PrivateNatToPscEndpointUnsupported => serializer.serialize_i32(83),
12869 Self::PscPortMappingPortMismatch => serializer.serialize_i32(86),
12870 Self::PscPortMappingWithoutPscConnectionUnsupported => serializer.serialize_i32(87),
12871 Self::UnsupportedRouteMatchedForNat64Destination => serializer.serialize_i32(88),
12872 Self::TrafficFromHybridEndpointToInternetDisallowed => serializer.serialize_i32(89),
12873 Self::NoMatchingNat64Gateway => serializer.serialize_i32(90),
12874 Self::LoadBalancerBackendIpVersionMismatch => serializer.serialize_i32(96),
12875 Self::NoKnownRouteFromNccNetworkToDestination => serializer.serialize_i32(97),
12876 Self::CloudNatProtocolUnsupported => serializer.serialize_i32(99),
12877 Self::L2InterconnectUnsupportedProtocol => serializer.serialize_i32(100),
12878 Self::L2InterconnectUnsupportedPort => serializer.serialize_i32(101),
12879 Self::L2InterconnectDestinationIpMismatch => serializer.serialize_i32(102),
12880 Self::NccRouteWithinHybridSubnetUnsupported => serializer.serialize_i32(104),
12881 Self::HybridSubnetRegionMismatch => serializer.serialize_i32(105),
12882 Self::UnknownValue(u) => u.0.serialize(serializer),
12883 }
12884 }
12885 }
12886
12887 impl<'de> serde::de::Deserialize<'de> for Cause {
12888 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12889 where
12890 D: serde::Deserializer<'de>,
12891 {
12892 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Cause>::new(
12893 ".google.cloud.networkmanagement.v1.DropInfo.Cause",
12894 ))
12895 }
12896 }
12897}
12898
12899/// For display only. Metadata associated with a Google Kubernetes Engine (GKE)
12900/// cluster master.
12901#[derive(Clone, Default, PartialEq)]
12902#[non_exhaustive]
12903pub struct GKEMasterInfo {
12904 /// URI of a GKE cluster.
12905 pub cluster_uri: std::string::String,
12906
12907 /// URI of a GKE cluster network.
12908 pub cluster_network_uri: std::string::String,
12909
12910 /// Internal IP address of a GKE cluster control plane.
12911 pub internal_ip: std::string::String,
12912
12913 /// External IP address of a GKE cluster control plane.
12914 pub external_ip: std::string::String,
12915
12916 /// DNS endpoint of a GKE cluster control plane.
12917 pub dns_endpoint: std::string::String,
12918
12919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12920}
12921
12922impl GKEMasterInfo {
12923 pub fn new() -> Self {
12924 std::default::Default::default()
12925 }
12926
12927 /// Sets the value of [cluster_uri][crate::model::GKEMasterInfo::cluster_uri].
12928 ///
12929 /// # Example
12930 /// ```ignore,no_run
12931 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
12932 /// let x = GKEMasterInfo::new().set_cluster_uri("example");
12933 /// ```
12934 pub fn set_cluster_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12935 self.cluster_uri = v.into();
12936 self
12937 }
12938
12939 /// Sets the value of [cluster_network_uri][crate::model::GKEMasterInfo::cluster_network_uri].
12940 ///
12941 /// # Example
12942 /// ```ignore,no_run
12943 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
12944 /// let x = GKEMasterInfo::new().set_cluster_network_uri("example");
12945 /// ```
12946 pub fn set_cluster_network_uri<T: std::convert::Into<std::string::String>>(
12947 mut self,
12948 v: T,
12949 ) -> Self {
12950 self.cluster_network_uri = v.into();
12951 self
12952 }
12953
12954 /// Sets the value of [internal_ip][crate::model::GKEMasterInfo::internal_ip].
12955 ///
12956 /// # Example
12957 /// ```ignore,no_run
12958 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
12959 /// let x = GKEMasterInfo::new().set_internal_ip("example");
12960 /// ```
12961 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12962 self.internal_ip = v.into();
12963 self
12964 }
12965
12966 /// Sets the value of [external_ip][crate::model::GKEMasterInfo::external_ip].
12967 ///
12968 /// # Example
12969 /// ```ignore,no_run
12970 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
12971 /// let x = GKEMasterInfo::new().set_external_ip("example");
12972 /// ```
12973 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12974 self.external_ip = v.into();
12975 self
12976 }
12977
12978 /// Sets the value of [dns_endpoint][crate::model::GKEMasterInfo::dns_endpoint].
12979 ///
12980 /// # Example
12981 /// ```ignore,no_run
12982 /// # use google_cloud_networkmanagement_v1::model::GKEMasterInfo;
12983 /// let x = GKEMasterInfo::new().set_dns_endpoint("example");
12984 /// ```
12985 pub fn set_dns_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12986 self.dns_endpoint = v.into();
12987 self
12988 }
12989}
12990
12991impl wkt::message::Message for GKEMasterInfo {
12992 fn typename() -> &'static str {
12993 "type.googleapis.com/google.cloud.networkmanagement.v1.GKEMasterInfo"
12994 }
12995}
12996
12997/// For display only. Metadata associated with a Cloud SQL instance.
12998#[derive(Clone, Default, PartialEq)]
12999#[non_exhaustive]
13000pub struct CloudSQLInstanceInfo {
13001 /// Name of a Cloud SQL instance.
13002 pub display_name: std::string::String,
13003
13004 /// URI of a Cloud SQL instance.
13005 pub uri: std::string::String,
13006
13007 /// URI of a Cloud SQL instance network or empty string if the instance does
13008 /// not have one.
13009 pub network_uri: std::string::String,
13010
13011 /// Internal IP address of a Cloud SQL instance.
13012 pub internal_ip: std::string::String,
13013
13014 /// External IP address of a Cloud SQL instance.
13015 pub external_ip: std::string::String,
13016
13017 /// Region in which the Cloud SQL instance is running.
13018 pub region: std::string::String,
13019
13020 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13021}
13022
13023impl CloudSQLInstanceInfo {
13024 pub fn new() -> Self {
13025 std::default::Default::default()
13026 }
13027
13028 /// Sets the value of [display_name][crate::model::CloudSQLInstanceInfo::display_name].
13029 ///
13030 /// # Example
13031 /// ```ignore,no_run
13032 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
13033 /// let x = CloudSQLInstanceInfo::new().set_display_name("example");
13034 /// ```
13035 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13036 self.display_name = v.into();
13037 self
13038 }
13039
13040 /// Sets the value of [uri][crate::model::CloudSQLInstanceInfo::uri].
13041 ///
13042 /// # Example
13043 /// ```ignore,no_run
13044 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
13045 /// let x = CloudSQLInstanceInfo::new().set_uri("example");
13046 /// ```
13047 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13048 self.uri = v.into();
13049 self
13050 }
13051
13052 /// Sets the value of [network_uri][crate::model::CloudSQLInstanceInfo::network_uri].
13053 ///
13054 /// # Example
13055 /// ```ignore,no_run
13056 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
13057 /// let x = CloudSQLInstanceInfo::new().set_network_uri("example");
13058 /// ```
13059 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13060 self.network_uri = v.into();
13061 self
13062 }
13063
13064 /// Sets the value of [internal_ip][crate::model::CloudSQLInstanceInfo::internal_ip].
13065 ///
13066 /// # Example
13067 /// ```ignore,no_run
13068 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
13069 /// let x = CloudSQLInstanceInfo::new().set_internal_ip("example");
13070 /// ```
13071 pub fn set_internal_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13072 self.internal_ip = v.into();
13073 self
13074 }
13075
13076 /// Sets the value of [external_ip][crate::model::CloudSQLInstanceInfo::external_ip].
13077 ///
13078 /// # Example
13079 /// ```ignore,no_run
13080 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
13081 /// let x = CloudSQLInstanceInfo::new().set_external_ip("example");
13082 /// ```
13083 pub fn set_external_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13084 self.external_ip = v.into();
13085 self
13086 }
13087
13088 /// Sets the value of [region][crate::model::CloudSQLInstanceInfo::region].
13089 ///
13090 /// # Example
13091 /// ```ignore,no_run
13092 /// # use google_cloud_networkmanagement_v1::model::CloudSQLInstanceInfo;
13093 /// let x = CloudSQLInstanceInfo::new().set_region("example");
13094 /// ```
13095 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13096 self.region = v.into();
13097 self
13098 }
13099}
13100
13101impl wkt::message::Message for CloudSQLInstanceInfo {
13102 fn typename() -> &'static str {
13103 "type.googleapis.com/google.cloud.networkmanagement.v1.CloudSQLInstanceInfo"
13104 }
13105}
13106
13107/// For display only. Metadata associated with a Cloud Redis Instance.
13108#[derive(Clone, Default, PartialEq)]
13109#[non_exhaustive]
13110pub struct RedisInstanceInfo {
13111 /// Name of a Cloud Redis Instance.
13112 pub display_name: std::string::String,
13113
13114 /// URI of a Cloud Redis Instance.
13115 pub uri: std::string::String,
13116
13117 /// URI of a Cloud Redis Instance network.
13118 pub network_uri: std::string::String,
13119
13120 /// Primary endpoint IP address of a Cloud Redis Instance.
13121 pub primary_endpoint_ip: std::string::String,
13122
13123 /// Read endpoint IP address of a Cloud Redis Instance (if applicable).
13124 pub read_endpoint_ip: std::string::String,
13125
13126 /// Region in which the Cloud Redis Instance is defined.
13127 pub region: std::string::String,
13128
13129 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13130}
13131
13132impl RedisInstanceInfo {
13133 pub fn new() -> Self {
13134 std::default::Default::default()
13135 }
13136
13137 /// Sets the value of [display_name][crate::model::RedisInstanceInfo::display_name].
13138 ///
13139 /// # Example
13140 /// ```ignore,no_run
13141 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
13142 /// let x = RedisInstanceInfo::new().set_display_name("example");
13143 /// ```
13144 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13145 self.display_name = v.into();
13146 self
13147 }
13148
13149 /// Sets the value of [uri][crate::model::RedisInstanceInfo::uri].
13150 ///
13151 /// # Example
13152 /// ```ignore,no_run
13153 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
13154 /// let x = RedisInstanceInfo::new().set_uri("example");
13155 /// ```
13156 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13157 self.uri = v.into();
13158 self
13159 }
13160
13161 /// Sets the value of [network_uri][crate::model::RedisInstanceInfo::network_uri].
13162 ///
13163 /// # Example
13164 /// ```ignore,no_run
13165 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
13166 /// let x = RedisInstanceInfo::new().set_network_uri("example");
13167 /// ```
13168 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13169 self.network_uri = v.into();
13170 self
13171 }
13172
13173 /// Sets the value of [primary_endpoint_ip][crate::model::RedisInstanceInfo::primary_endpoint_ip].
13174 ///
13175 /// # Example
13176 /// ```ignore,no_run
13177 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
13178 /// let x = RedisInstanceInfo::new().set_primary_endpoint_ip("example");
13179 /// ```
13180 pub fn set_primary_endpoint_ip<T: std::convert::Into<std::string::String>>(
13181 mut self,
13182 v: T,
13183 ) -> Self {
13184 self.primary_endpoint_ip = v.into();
13185 self
13186 }
13187
13188 /// Sets the value of [read_endpoint_ip][crate::model::RedisInstanceInfo::read_endpoint_ip].
13189 ///
13190 /// # Example
13191 /// ```ignore,no_run
13192 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
13193 /// let x = RedisInstanceInfo::new().set_read_endpoint_ip("example");
13194 /// ```
13195 pub fn set_read_endpoint_ip<T: std::convert::Into<std::string::String>>(
13196 mut self,
13197 v: T,
13198 ) -> Self {
13199 self.read_endpoint_ip = v.into();
13200 self
13201 }
13202
13203 /// Sets the value of [region][crate::model::RedisInstanceInfo::region].
13204 ///
13205 /// # Example
13206 /// ```ignore,no_run
13207 /// # use google_cloud_networkmanagement_v1::model::RedisInstanceInfo;
13208 /// let x = RedisInstanceInfo::new().set_region("example");
13209 /// ```
13210 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13211 self.region = v.into();
13212 self
13213 }
13214}
13215
13216impl wkt::message::Message for RedisInstanceInfo {
13217 fn typename() -> &'static str {
13218 "type.googleapis.com/google.cloud.networkmanagement.v1.RedisInstanceInfo"
13219 }
13220}
13221
13222/// For display only. Metadata associated with a Redis Cluster.
13223#[derive(Clone, Default, PartialEq)]
13224#[non_exhaustive]
13225pub struct RedisClusterInfo {
13226 /// Name of a Redis Cluster.
13227 pub display_name: std::string::String,
13228
13229 /// URI of a Redis Cluster in format
13230 /// "projects/{project_id}/locations/{location}/clusters/{cluster_id}"
13231 pub uri: std::string::String,
13232
13233 /// URI of the network containing the Redis Cluster endpoints in format
13234 /// "projects/{project_id}/global/networks/{network_id}".
13235 pub network_uri: std::string::String,
13236
13237 /// Discovery endpoint IP address of a Redis Cluster.
13238 pub discovery_endpoint_ip_address: std::string::String,
13239
13240 /// Secondary endpoint IP address of a Redis Cluster.
13241 pub secondary_endpoint_ip_address: std::string::String,
13242
13243 /// Name of the region in which the Redis Cluster is defined. For example,
13244 /// "us-central1".
13245 pub location: std::string::String,
13246
13247 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13248}
13249
13250impl RedisClusterInfo {
13251 pub fn new() -> Self {
13252 std::default::Default::default()
13253 }
13254
13255 /// Sets the value of [display_name][crate::model::RedisClusterInfo::display_name].
13256 ///
13257 /// # Example
13258 /// ```ignore,no_run
13259 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
13260 /// let x = RedisClusterInfo::new().set_display_name("example");
13261 /// ```
13262 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13263 self.display_name = v.into();
13264 self
13265 }
13266
13267 /// Sets the value of [uri][crate::model::RedisClusterInfo::uri].
13268 ///
13269 /// # Example
13270 /// ```ignore,no_run
13271 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
13272 /// let x = RedisClusterInfo::new().set_uri("example");
13273 /// ```
13274 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13275 self.uri = v.into();
13276 self
13277 }
13278
13279 /// Sets the value of [network_uri][crate::model::RedisClusterInfo::network_uri].
13280 ///
13281 /// # Example
13282 /// ```ignore,no_run
13283 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
13284 /// let x = RedisClusterInfo::new().set_network_uri("example");
13285 /// ```
13286 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13287 self.network_uri = v.into();
13288 self
13289 }
13290
13291 /// Sets the value of [discovery_endpoint_ip_address][crate::model::RedisClusterInfo::discovery_endpoint_ip_address].
13292 ///
13293 /// # Example
13294 /// ```ignore,no_run
13295 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
13296 /// let x = RedisClusterInfo::new().set_discovery_endpoint_ip_address("example");
13297 /// ```
13298 pub fn set_discovery_endpoint_ip_address<T: std::convert::Into<std::string::String>>(
13299 mut self,
13300 v: T,
13301 ) -> Self {
13302 self.discovery_endpoint_ip_address = v.into();
13303 self
13304 }
13305
13306 /// Sets the value of [secondary_endpoint_ip_address][crate::model::RedisClusterInfo::secondary_endpoint_ip_address].
13307 ///
13308 /// # Example
13309 /// ```ignore,no_run
13310 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
13311 /// let x = RedisClusterInfo::new().set_secondary_endpoint_ip_address("example");
13312 /// ```
13313 pub fn set_secondary_endpoint_ip_address<T: std::convert::Into<std::string::String>>(
13314 mut self,
13315 v: T,
13316 ) -> Self {
13317 self.secondary_endpoint_ip_address = v.into();
13318 self
13319 }
13320
13321 /// Sets the value of [location][crate::model::RedisClusterInfo::location].
13322 ///
13323 /// # Example
13324 /// ```ignore,no_run
13325 /// # use google_cloud_networkmanagement_v1::model::RedisClusterInfo;
13326 /// let x = RedisClusterInfo::new().set_location("example");
13327 /// ```
13328 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13329 self.location = v.into();
13330 self
13331 }
13332}
13333
13334impl wkt::message::Message for RedisClusterInfo {
13335 fn typename() -> &'static str {
13336 "type.googleapis.com/google.cloud.networkmanagement.v1.RedisClusterInfo"
13337 }
13338}
13339
13340/// For display only. Metadata associated with a Cloud Function.
13341#[derive(Clone, Default, PartialEq)]
13342#[non_exhaustive]
13343pub struct CloudFunctionInfo {
13344 /// Name of a Cloud Function.
13345 pub display_name: std::string::String,
13346
13347 /// URI of a Cloud Function.
13348 pub uri: std::string::String,
13349
13350 /// Location in which the Cloud Function is deployed.
13351 pub location: std::string::String,
13352
13353 /// Latest successfully deployed version id of the Cloud Function.
13354 pub version_id: i64,
13355
13356 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13357}
13358
13359impl CloudFunctionInfo {
13360 pub fn new() -> Self {
13361 std::default::Default::default()
13362 }
13363
13364 /// Sets the value of [display_name][crate::model::CloudFunctionInfo::display_name].
13365 ///
13366 /// # Example
13367 /// ```ignore,no_run
13368 /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
13369 /// let x = CloudFunctionInfo::new().set_display_name("example");
13370 /// ```
13371 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13372 self.display_name = v.into();
13373 self
13374 }
13375
13376 /// Sets the value of [uri][crate::model::CloudFunctionInfo::uri].
13377 ///
13378 /// # Example
13379 /// ```ignore,no_run
13380 /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
13381 /// let x = CloudFunctionInfo::new().set_uri("example");
13382 /// ```
13383 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13384 self.uri = v.into();
13385 self
13386 }
13387
13388 /// Sets the value of [location][crate::model::CloudFunctionInfo::location].
13389 ///
13390 /// # Example
13391 /// ```ignore,no_run
13392 /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
13393 /// let x = CloudFunctionInfo::new().set_location("example");
13394 /// ```
13395 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13396 self.location = v.into();
13397 self
13398 }
13399
13400 /// Sets the value of [version_id][crate::model::CloudFunctionInfo::version_id].
13401 ///
13402 /// # Example
13403 /// ```ignore,no_run
13404 /// # use google_cloud_networkmanagement_v1::model::CloudFunctionInfo;
13405 /// let x = CloudFunctionInfo::new().set_version_id(42);
13406 /// ```
13407 pub fn set_version_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13408 self.version_id = v.into();
13409 self
13410 }
13411}
13412
13413impl wkt::message::Message for CloudFunctionInfo {
13414 fn typename() -> &'static str {
13415 "type.googleapis.com/google.cloud.networkmanagement.v1.CloudFunctionInfo"
13416 }
13417}
13418
13419/// For display only. Metadata associated with a Cloud Run revision.
13420#[derive(Clone, Default, PartialEq)]
13421#[non_exhaustive]
13422pub struct CloudRunRevisionInfo {
13423 /// Name of a Cloud Run revision.
13424 pub display_name: std::string::String,
13425
13426 /// URI of a Cloud Run revision.
13427 pub uri: std::string::String,
13428
13429 /// Location in which this revision is deployed.
13430 pub location: std::string::String,
13431
13432 /// URI of Cloud Run service this revision belongs to.
13433 pub service_uri: std::string::String,
13434
13435 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13436}
13437
13438impl CloudRunRevisionInfo {
13439 pub fn new() -> Self {
13440 std::default::Default::default()
13441 }
13442
13443 /// Sets the value of [display_name][crate::model::CloudRunRevisionInfo::display_name].
13444 ///
13445 /// # Example
13446 /// ```ignore,no_run
13447 /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
13448 /// let x = CloudRunRevisionInfo::new().set_display_name("example");
13449 /// ```
13450 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13451 self.display_name = v.into();
13452 self
13453 }
13454
13455 /// Sets the value of [uri][crate::model::CloudRunRevisionInfo::uri].
13456 ///
13457 /// # Example
13458 /// ```ignore,no_run
13459 /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
13460 /// let x = CloudRunRevisionInfo::new().set_uri("example");
13461 /// ```
13462 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13463 self.uri = v.into();
13464 self
13465 }
13466
13467 /// Sets the value of [location][crate::model::CloudRunRevisionInfo::location].
13468 ///
13469 /// # Example
13470 /// ```ignore,no_run
13471 /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
13472 /// let x = CloudRunRevisionInfo::new().set_location("example");
13473 /// ```
13474 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13475 self.location = v.into();
13476 self
13477 }
13478
13479 /// Sets the value of [service_uri][crate::model::CloudRunRevisionInfo::service_uri].
13480 ///
13481 /// # Example
13482 /// ```ignore,no_run
13483 /// # use google_cloud_networkmanagement_v1::model::CloudRunRevisionInfo;
13484 /// let x = CloudRunRevisionInfo::new().set_service_uri("example");
13485 /// ```
13486 pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13487 self.service_uri = v.into();
13488 self
13489 }
13490}
13491
13492impl wkt::message::Message for CloudRunRevisionInfo {
13493 fn typename() -> &'static str {
13494 "type.googleapis.com/google.cloud.networkmanagement.v1.CloudRunRevisionInfo"
13495 }
13496}
13497
13498/// For display only. Metadata associated with an App Engine version.
13499#[derive(Clone, Default, PartialEq)]
13500#[non_exhaustive]
13501pub struct AppEngineVersionInfo {
13502 /// Name of an App Engine version.
13503 pub display_name: std::string::String,
13504
13505 /// URI of an App Engine version.
13506 pub uri: std::string::String,
13507
13508 /// Runtime of the App Engine version.
13509 pub runtime: std::string::String,
13510
13511 /// App Engine execution environment for a version.
13512 pub environment: std::string::String,
13513
13514 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13515}
13516
13517impl AppEngineVersionInfo {
13518 pub fn new() -> Self {
13519 std::default::Default::default()
13520 }
13521
13522 /// Sets the value of [display_name][crate::model::AppEngineVersionInfo::display_name].
13523 ///
13524 /// # Example
13525 /// ```ignore,no_run
13526 /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
13527 /// let x = AppEngineVersionInfo::new().set_display_name("example");
13528 /// ```
13529 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13530 self.display_name = v.into();
13531 self
13532 }
13533
13534 /// Sets the value of [uri][crate::model::AppEngineVersionInfo::uri].
13535 ///
13536 /// # Example
13537 /// ```ignore,no_run
13538 /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
13539 /// let x = AppEngineVersionInfo::new().set_uri("example");
13540 /// ```
13541 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13542 self.uri = v.into();
13543 self
13544 }
13545
13546 /// Sets the value of [runtime][crate::model::AppEngineVersionInfo::runtime].
13547 ///
13548 /// # Example
13549 /// ```ignore,no_run
13550 /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
13551 /// let x = AppEngineVersionInfo::new().set_runtime("example");
13552 /// ```
13553 pub fn set_runtime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13554 self.runtime = v.into();
13555 self
13556 }
13557
13558 /// Sets the value of [environment][crate::model::AppEngineVersionInfo::environment].
13559 ///
13560 /// # Example
13561 /// ```ignore,no_run
13562 /// # use google_cloud_networkmanagement_v1::model::AppEngineVersionInfo;
13563 /// let x = AppEngineVersionInfo::new().set_environment("example");
13564 /// ```
13565 pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13566 self.environment = v.into();
13567 self
13568 }
13569}
13570
13571impl wkt::message::Message for AppEngineVersionInfo {
13572 fn typename() -> &'static str {
13573 "type.googleapis.com/google.cloud.networkmanagement.v1.AppEngineVersionInfo"
13574 }
13575}
13576
13577/// For display only. Metadata associated with a VPC connector.
13578#[derive(Clone, Default, PartialEq)]
13579#[non_exhaustive]
13580pub struct VpcConnectorInfo {
13581 /// Name of a VPC connector.
13582 pub display_name: std::string::String,
13583
13584 /// URI of a VPC connector.
13585 pub uri: std::string::String,
13586
13587 /// Location in which the VPC connector is deployed.
13588 pub location: std::string::String,
13589
13590 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13591}
13592
13593impl VpcConnectorInfo {
13594 pub fn new() -> Self {
13595 std::default::Default::default()
13596 }
13597
13598 /// Sets the value of [display_name][crate::model::VpcConnectorInfo::display_name].
13599 ///
13600 /// # Example
13601 /// ```ignore,no_run
13602 /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
13603 /// let x = VpcConnectorInfo::new().set_display_name("example");
13604 /// ```
13605 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13606 self.display_name = v.into();
13607 self
13608 }
13609
13610 /// Sets the value of [uri][crate::model::VpcConnectorInfo::uri].
13611 ///
13612 /// # Example
13613 /// ```ignore,no_run
13614 /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
13615 /// let x = VpcConnectorInfo::new().set_uri("example");
13616 /// ```
13617 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13618 self.uri = v.into();
13619 self
13620 }
13621
13622 /// Sets the value of [location][crate::model::VpcConnectorInfo::location].
13623 ///
13624 /// # Example
13625 /// ```ignore,no_run
13626 /// # use google_cloud_networkmanagement_v1::model::VpcConnectorInfo;
13627 /// let x = VpcConnectorInfo::new().set_location("example");
13628 /// ```
13629 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13630 self.location = v.into();
13631 self
13632 }
13633}
13634
13635impl wkt::message::Message for VpcConnectorInfo {
13636 fn typename() -> &'static str {
13637 "type.googleapis.com/google.cloud.networkmanagement.v1.VpcConnectorInfo"
13638 }
13639}
13640
13641/// For display only. Metadata associated with a serverless direct VPC egress
13642/// connection.
13643#[derive(Clone, Default, PartialEq)]
13644#[non_exhaustive]
13645pub struct DirectVpcEgressConnectionInfo {
13646 /// URI of direct access network.
13647 pub network_uri: std::string::String,
13648
13649 /// URI of direct access subnetwork.
13650 pub subnetwork_uri: std::string::String,
13651
13652 /// Selected IP range.
13653 pub selected_ip_range: std::string::String,
13654
13655 /// Selected starting IP address, from the selected IP range.
13656 pub selected_ip_address: std::string::String,
13657
13658 /// Region in which the Direct VPC egress is deployed.
13659 pub region: std::string::String,
13660
13661 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13662}
13663
13664impl DirectVpcEgressConnectionInfo {
13665 pub fn new() -> Self {
13666 std::default::Default::default()
13667 }
13668
13669 /// Sets the value of [network_uri][crate::model::DirectVpcEgressConnectionInfo::network_uri].
13670 ///
13671 /// # Example
13672 /// ```ignore,no_run
13673 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
13674 /// let x = DirectVpcEgressConnectionInfo::new().set_network_uri("example");
13675 /// ```
13676 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13677 self.network_uri = v.into();
13678 self
13679 }
13680
13681 /// Sets the value of [subnetwork_uri][crate::model::DirectVpcEgressConnectionInfo::subnetwork_uri].
13682 ///
13683 /// # Example
13684 /// ```ignore,no_run
13685 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
13686 /// let x = DirectVpcEgressConnectionInfo::new().set_subnetwork_uri("example");
13687 /// ```
13688 pub fn set_subnetwork_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13689 self.subnetwork_uri = v.into();
13690 self
13691 }
13692
13693 /// Sets the value of [selected_ip_range][crate::model::DirectVpcEgressConnectionInfo::selected_ip_range].
13694 ///
13695 /// # Example
13696 /// ```ignore,no_run
13697 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
13698 /// let x = DirectVpcEgressConnectionInfo::new().set_selected_ip_range("example");
13699 /// ```
13700 pub fn set_selected_ip_range<T: std::convert::Into<std::string::String>>(
13701 mut self,
13702 v: T,
13703 ) -> Self {
13704 self.selected_ip_range = v.into();
13705 self
13706 }
13707
13708 /// Sets the value of [selected_ip_address][crate::model::DirectVpcEgressConnectionInfo::selected_ip_address].
13709 ///
13710 /// # Example
13711 /// ```ignore,no_run
13712 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
13713 /// let x = DirectVpcEgressConnectionInfo::new().set_selected_ip_address("example");
13714 /// ```
13715 pub fn set_selected_ip_address<T: std::convert::Into<std::string::String>>(
13716 mut self,
13717 v: T,
13718 ) -> Self {
13719 self.selected_ip_address = v.into();
13720 self
13721 }
13722
13723 /// Sets the value of [region][crate::model::DirectVpcEgressConnectionInfo::region].
13724 ///
13725 /// # Example
13726 /// ```ignore,no_run
13727 /// # use google_cloud_networkmanagement_v1::model::DirectVpcEgressConnectionInfo;
13728 /// let x = DirectVpcEgressConnectionInfo::new().set_region("example");
13729 /// ```
13730 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13731 self.region = v.into();
13732 self
13733 }
13734}
13735
13736impl wkt::message::Message for DirectVpcEgressConnectionInfo {
13737 fn typename() -> &'static str {
13738 "type.googleapis.com/google.cloud.networkmanagement.v1.DirectVpcEgressConnectionInfo"
13739 }
13740}
13741
13742/// For display only. Metadata associated with a serverless public connection.
13743#[derive(Clone, Default, PartialEq)]
13744#[non_exhaustive]
13745pub struct ServerlessExternalConnectionInfo {
13746 /// Selected starting IP address, from the Google dynamic address pool.
13747 pub selected_ip_address: std::string::String,
13748
13749 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13750}
13751
13752impl ServerlessExternalConnectionInfo {
13753 pub fn new() -> Self {
13754 std::default::Default::default()
13755 }
13756
13757 /// Sets the value of [selected_ip_address][crate::model::ServerlessExternalConnectionInfo::selected_ip_address].
13758 ///
13759 /// # Example
13760 /// ```ignore,no_run
13761 /// # use google_cloud_networkmanagement_v1::model::ServerlessExternalConnectionInfo;
13762 /// let x = ServerlessExternalConnectionInfo::new().set_selected_ip_address("example");
13763 /// ```
13764 pub fn set_selected_ip_address<T: std::convert::Into<std::string::String>>(
13765 mut self,
13766 v: T,
13767 ) -> Self {
13768 self.selected_ip_address = v.into();
13769 self
13770 }
13771}
13772
13773impl wkt::message::Message for ServerlessExternalConnectionInfo {
13774 fn typename() -> &'static str {
13775 "type.googleapis.com/google.cloud.networkmanagement.v1.ServerlessExternalConnectionInfo"
13776 }
13777}
13778
13779/// For display only. Metadata associated with NAT.
13780#[derive(Clone, Default, PartialEq)]
13781#[non_exhaustive]
13782pub struct NatInfo {
13783 /// Type of NAT.
13784 pub r#type: crate::model::nat_info::Type,
13785
13786 /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
13787 pub protocol: std::string::String,
13788
13789 /// URI of the network where NAT translation takes place.
13790 pub network_uri: std::string::String,
13791
13792 /// Source IP address before NAT translation.
13793 pub old_source_ip: std::string::String,
13794
13795 /// Source IP address after NAT translation.
13796 pub new_source_ip: std::string::String,
13797
13798 /// Destination IP address before NAT translation.
13799 pub old_destination_ip: std::string::String,
13800
13801 /// Destination IP address after NAT translation.
13802 pub new_destination_ip: std::string::String,
13803
13804 /// Source port before NAT translation. Only valid when protocol is TCP or UDP.
13805 pub old_source_port: i32,
13806
13807 /// Source port after NAT translation. Only valid when protocol is TCP or UDP.
13808 pub new_source_port: i32,
13809
13810 /// Destination port before NAT translation. Only valid when protocol is TCP or
13811 /// UDP.
13812 pub old_destination_port: i32,
13813
13814 /// Destination port after NAT translation. Only valid when protocol is TCP or
13815 /// UDP.
13816 pub new_destination_port: i32,
13817
13818 /// Uri of the Cloud Router. Only valid when type is CLOUD_NAT.
13819 pub router_uri: std::string::String,
13820
13821 /// The name of Cloud NAT Gateway. Only valid when type is CLOUD_NAT.
13822 pub nat_gateway_name: std::string::String,
13823
13824 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13825}
13826
13827impl NatInfo {
13828 pub fn new() -> Self {
13829 std::default::Default::default()
13830 }
13831
13832 /// Sets the value of [r#type][crate::model::NatInfo::type].
13833 ///
13834 /// # Example
13835 /// ```ignore,no_run
13836 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
13837 /// use google_cloud_networkmanagement_v1::model::nat_info::Type;
13838 /// let x0 = NatInfo::new().set_type(Type::InternalToExternal);
13839 /// let x1 = NatInfo::new().set_type(Type::ExternalToInternal);
13840 /// let x2 = NatInfo::new().set_type(Type::CloudNat);
13841 /// ```
13842 pub fn set_type<T: std::convert::Into<crate::model::nat_info::Type>>(mut self, v: T) -> Self {
13843 self.r#type = v.into();
13844 self
13845 }
13846
13847 /// Sets the value of [protocol][crate::model::NatInfo::protocol].
13848 ///
13849 /// # Example
13850 /// ```ignore,no_run
13851 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
13852 /// let x = NatInfo::new().set_protocol("example");
13853 /// ```
13854 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13855 self.protocol = v.into();
13856 self
13857 }
13858
13859 /// Sets the value of [network_uri][crate::model::NatInfo::network_uri].
13860 ///
13861 /// # Example
13862 /// ```ignore,no_run
13863 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
13864 /// let x = NatInfo::new().set_network_uri("example");
13865 /// ```
13866 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13867 self.network_uri = v.into();
13868 self
13869 }
13870
13871 /// Sets the value of [old_source_ip][crate::model::NatInfo::old_source_ip].
13872 ///
13873 /// # Example
13874 /// ```ignore,no_run
13875 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
13876 /// let x = NatInfo::new().set_old_source_ip("example");
13877 /// ```
13878 pub fn set_old_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13879 self.old_source_ip = v.into();
13880 self
13881 }
13882
13883 /// Sets the value of [new_source_ip][crate::model::NatInfo::new_source_ip].
13884 ///
13885 /// # Example
13886 /// ```ignore,no_run
13887 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
13888 /// let x = NatInfo::new().set_new_source_ip("example");
13889 /// ```
13890 pub fn set_new_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13891 self.new_source_ip = v.into();
13892 self
13893 }
13894
13895 /// Sets the value of [old_destination_ip][crate::model::NatInfo::old_destination_ip].
13896 ///
13897 /// # Example
13898 /// ```ignore,no_run
13899 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
13900 /// let x = NatInfo::new().set_old_destination_ip("example");
13901 /// ```
13902 pub fn set_old_destination_ip<T: std::convert::Into<std::string::String>>(
13903 mut self,
13904 v: T,
13905 ) -> Self {
13906 self.old_destination_ip = v.into();
13907 self
13908 }
13909
13910 /// Sets the value of [new_destination_ip][crate::model::NatInfo::new_destination_ip].
13911 ///
13912 /// # Example
13913 /// ```ignore,no_run
13914 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
13915 /// let x = NatInfo::new().set_new_destination_ip("example");
13916 /// ```
13917 pub fn set_new_destination_ip<T: std::convert::Into<std::string::String>>(
13918 mut self,
13919 v: T,
13920 ) -> Self {
13921 self.new_destination_ip = v.into();
13922 self
13923 }
13924
13925 /// Sets the value of [old_source_port][crate::model::NatInfo::old_source_port].
13926 ///
13927 /// # Example
13928 /// ```ignore,no_run
13929 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
13930 /// let x = NatInfo::new().set_old_source_port(42);
13931 /// ```
13932 pub fn set_old_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13933 self.old_source_port = v.into();
13934 self
13935 }
13936
13937 /// Sets the value of [new_source_port][crate::model::NatInfo::new_source_port].
13938 ///
13939 /// # Example
13940 /// ```ignore,no_run
13941 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
13942 /// let x = NatInfo::new().set_new_source_port(42);
13943 /// ```
13944 pub fn set_new_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13945 self.new_source_port = v.into();
13946 self
13947 }
13948
13949 /// Sets the value of [old_destination_port][crate::model::NatInfo::old_destination_port].
13950 ///
13951 /// # Example
13952 /// ```ignore,no_run
13953 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
13954 /// let x = NatInfo::new().set_old_destination_port(42);
13955 /// ```
13956 pub fn set_old_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13957 self.old_destination_port = v.into();
13958 self
13959 }
13960
13961 /// Sets the value of [new_destination_port][crate::model::NatInfo::new_destination_port].
13962 ///
13963 /// # Example
13964 /// ```ignore,no_run
13965 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
13966 /// let x = NatInfo::new().set_new_destination_port(42);
13967 /// ```
13968 pub fn set_new_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13969 self.new_destination_port = v.into();
13970 self
13971 }
13972
13973 /// Sets the value of [router_uri][crate::model::NatInfo::router_uri].
13974 ///
13975 /// # Example
13976 /// ```ignore,no_run
13977 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
13978 /// let x = NatInfo::new().set_router_uri("example");
13979 /// ```
13980 pub fn set_router_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13981 self.router_uri = v.into();
13982 self
13983 }
13984
13985 /// Sets the value of [nat_gateway_name][crate::model::NatInfo::nat_gateway_name].
13986 ///
13987 /// # Example
13988 /// ```ignore,no_run
13989 /// # use google_cloud_networkmanagement_v1::model::NatInfo;
13990 /// let x = NatInfo::new().set_nat_gateway_name("example");
13991 /// ```
13992 pub fn set_nat_gateway_name<T: std::convert::Into<std::string::String>>(
13993 mut self,
13994 v: T,
13995 ) -> Self {
13996 self.nat_gateway_name = v.into();
13997 self
13998 }
13999}
14000
14001impl wkt::message::Message for NatInfo {
14002 fn typename() -> &'static str {
14003 "type.googleapis.com/google.cloud.networkmanagement.v1.NatInfo"
14004 }
14005}
14006
14007/// Defines additional types related to [NatInfo].
14008pub mod nat_info {
14009 #[allow(unused_imports)]
14010 use super::*;
14011
14012 /// Types of NAT.
14013 ///
14014 /// # Working with unknown values
14015 ///
14016 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14017 /// additional enum variants at any time. Adding new variants is not considered
14018 /// a breaking change. Applications should write their code in anticipation of:
14019 ///
14020 /// - New values appearing in future releases of the client library, **and**
14021 /// - New values received dynamically, without application changes.
14022 ///
14023 /// Please consult the [Working with enums] section in the user guide for some
14024 /// guidelines.
14025 ///
14026 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14027 #[derive(Clone, Debug, PartialEq)]
14028 #[non_exhaustive]
14029 pub enum Type {
14030 /// Type is unspecified.
14031 Unspecified,
14032 /// From Compute Engine instance's internal address to external address.
14033 InternalToExternal,
14034 /// From Compute Engine instance's external address to internal address.
14035 ExternalToInternal,
14036 /// Cloud NAT Gateway.
14037 CloudNat,
14038 /// Private service connect NAT.
14039 PrivateServiceConnect,
14040 /// GKE Pod IP address masquerading.
14041 GkePodIpMasquerading,
14042 /// If set, the enum was initialized with an unknown value.
14043 ///
14044 /// Applications can examine the value using [Type::value] or
14045 /// [Type::name].
14046 UnknownValue(r#type::UnknownValue),
14047 }
14048
14049 #[doc(hidden)]
14050 pub mod r#type {
14051 #[allow(unused_imports)]
14052 use super::*;
14053 #[derive(Clone, Debug, PartialEq)]
14054 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14055 }
14056
14057 impl Type {
14058 /// Gets the enum value.
14059 ///
14060 /// Returns `None` if the enum contains an unknown value deserialized from
14061 /// the string representation of enums.
14062 pub fn value(&self) -> std::option::Option<i32> {
14063 match self {
14064 Self::Unspecified => std::option::Option::Some(0),
14065 Self::InternalToExternal => std::option::Option::Some(1),
14066 Self::ExternalToInternal => std::option::Option::Some(2),
14067 Self::CloudNat => std::option::Option::Some(3),
14068 Self::PrivateServiceConnect => std::option::Option::Some(4),
14069 Self::GkePodIpMasquerading => std::option::Option::Some(5),
14070 Self::UnknownValue(u) => u.0.value(),
14071 }
14072 }
14073
14074 /// Gets the enum value as a string.
14075 ///
14076 /// Returns `None` if the enum contains an unknown value deserialized from
14077 /// the integer representation of enums.
14078 pub fn name(&self) -> std::option::Option<&str> {
14079 match self {
14080 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
14081 Self::InternalToExternal => std::option::Option::Some("INTERNAL_TO_EXTERNAL"),
14082 Self::ExternalToInternal => std::option::Option::Some("EXTERNAL_TO_INTERNAL"),
14083 Self::CloudNat => std::option::Option::Some("CLOUD_NAT"),
14084 Self::PrivateServiceConnect => std::option::Option::Some("PRIVATE_SERVICE_CONNECT"),
14085 Self::GkePodIpMasquerading => std::option::Option::Some("GKE_POD_IP_MASQUERADING"),
14086 Self::UnknownValue(u) => u.0.name(),
14087 }
14088 }
14089 }
14090
14091 impl std::default::Default for Type {
14092 fn default() -> Self {
14093 use std::convert::From;
14094 Self::from(0)
14095 }
14096 }
14097
14098 impl std::fmt::Display for Type {
14099 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14100 wkt::internal::display_enum(f, self.name(), self.value())
14101 }
14102 }
14103
14104 impl std::convert::From<i32> for Type {
14105 fn from(value: i32) -> Self {
14106 match value {
14107 0 => Self::Unspecified,
14108 1 => Self::InternalToExternal,
14109 2 => Self::ExternalToInternal,
14110 3 => Self::CloudNat,
14111 4 => Self::PrivateServiceConnect,
14112 5 => Self::GkePodIpMasquerading,
14113 _ => Self::UnknownValue(r#type::UnknownValue(
14114 wkt::internal::UnknownEnumValue::Integer(value),
14115 )),
14116 }
14117 }
14118 }
14119
14120 impl std::convert::From<&str> for Type {
14121 fn from(value: &str) -> Self {
14122 use std::string::ToString;
14123 match value {
14124 "TYPE_UNSPECIFIED" => Self::Unspecified,
14125 "INTERNAL_TO_EXTERNAL" => Self::InternalToExternal,
14126 "EXTERNAL_TO_INTERNAL" => Self::ExternalToInternal,
14127 "CLOUD_NAT" => Self::CloudNat,
14128 "PRIVATE_SERVICE_CONNECT" => Self::PrivateServiceConnect,
14129 "GKE_POD_IP_MASQUERADING" => Self::GkePodIpMasquerading,
14130 _ => Self::UnknownValue(r#type::UnknownValue(
14131 wkt::internal::UnknownEnumValue::String(value.to_string()),
14132 )),
14133 }
14134 }
14135 }
14136
14137 impl serde::ser::Serialize for Type {
14138 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14139 where
14140 S: serde::Serializer,
14141 {
14142 match self {
14143 Self::Unspecified => serializer.serialize_i32(0),
14144 Self::InternalToExternal => serializer.serialize_i32(1),
14145 Self::ExternalToInternal => serializer.serialize_i32(2),
14146 Self::CloudNat => serializer.serialize_i32(3),
14147 Self::PrivateServiceConnect => serializer.serialize_i32(4),
14148 Self::GkePodIpMasquerading => serializer.serialize_i32(5),
14149 Self::UnknownValue(u) => u.0.serialize(serializer),
14150 }
14151 }
14152 }
14153
14154 impl<'de> serde::de::Deserialize<'de> for Type {
14155 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14156 where
14157 D: serde::Deserializer<'de>,
14158 {
14159 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
14160 ".google.cloud.networkmanagement.v1.NatInfo.Type",
14161 ))
14162 }
14163 }
14164}
14165
14166/// For display only. Metadata associated with ProxyConnection.
14167#[derive(Clone, Default, PartialEq)]
14168#[non_exhaustive]
14169pub struct ProxyConnectionInfo {
14170 /// IP protocol in string format, for example: "TCP", "UDP", "ICMP".
14171 pub protocol: std::string::String,
14172
14173 /// Source IP address of an original connection.
14174 pub old_source_ip: std::string::String,
14175
14176 /// Source IP address of a new connection.
14177 pub new_source_ip: std::string::String,
14178
14179 /// Destination IP address of an original connection
14180 pub old_destination_ip: std::string::String,
14181
14182 /// Destination IP address of a new connection.
14183 pub new_destination_ip: std::string::String,
14184
14185 /// Source port of an original connection. Only valid when protocol is TCP or
14186 /// UDP.
14187 pub old_source_port: i32,
14188
14189 /// Source port of a new connection. Only valid when protocol is TCP or UDP.
14190 pub new_source_port: i32,
14191
14192 /// Destination port of an original connection. Only valid when protocol is TCP
14193 /// or UDP.
14194 pub old_destination_port: i32,
14195
14196 /// Destination port of a new connection. Only valid when protocol is TCP or
14197 /// UDP.
14198 pub new_destination_port: i32,
14199
14200 /// Uri of proxy subnet.
14201 pub subnet_uri: std::string::String,
14202
14203 /// URI of the network where connection is proxied.
14204 pub network_uri: std::string::String,
14205
14206 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14207}
14208
14209impl ProxyConnectionInfo {
14210 pub fn new() -> Self {
14211 std::default::Default::default()
14212 }
14213
14214 /// Sets the value of [protocol][crate::model::ProxyConnectionInfo::protocol].
14215 ///
14216 /// # Example
14217 /// ```ignore,no_run
14218 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
14219 /// let x = ProxyConnectionInfo::new().set_protocol("example");
14220 /// ```
14221 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14222 self.protocol = v.into();
14223 self
14224 }
14225
14226 /// Sets the value of [old_source_ip][crate::model::ProxyConnectionInfo::old_source_ip].
14227 ///
14228 /// # Example
14229 /// ```ignore,no_run
14230 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
14231 /// let x = ProxyConnectionInfo::new().set_old_source_ip("example");
14232 /// ```
14233 pub fn set_old_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14234 self.old_source_ip = v.into();
14235 self
14236 }
14237
14238 /// Sets the value of [new_source_ip][crate::model::ProxyConnectionInfo::new_source_ip].
14239 ///
14240 /// # Example
14241 /// ```ignore,no_run
14242 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
14243 /// let x = ProxyConnectionInfo::new().set_new_source_ip("example");
14244 /// ```
14245 pub fn set_new_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14246 self.new_source_ip = v.into();
14247 self
14248 }
14249
14250 /// Sets the value of [old_destination_ip][crate::model::ProxyConnectionInfo::old_destination_ip].
14251 ///
14252 /// # Example
14253 /// ```ignore,no_run
14254 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
14255 /// let x = ProxyConnectionInfo::new().set_old_destination_ip("example");
14256 /// ```
14257 pub fn set_old_destination_ip<T: std::convert::Into<std::string::String>>(
14258 mut self,
14259 v: T,
14260 ) -> Self {
14261 self.old_destination_ip = v.into();
14262 self
14263 }
14264
14265 /// Sets the value of [new_destination_ip][crate::model::ProxyConnectionInfo::new_destination_ip].
14266 ///
14267 /// # Example
14268 /// ```ignore,no_run
14269 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
14270 /// let x = ProxyConnectionInfo::new().set_new_destination_ip("example");
14271 /// ```
14272 pub fn set_new_destination_ip<T: std::convert::Into<std::string::String>>(
14273 mut self,
14274 v: T,
14275 ) -> Self {
14276 self.new_destination_ip = v.into();
14277 self
14278 }
14279
14280 /// Sets the value of [old_source_port][crate::model::ProxyConnectionInfo::old_source_port].
14281 ///
14282 /// # Example
14283 /// ```ignore,no_run
14284 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
14285 /// let x = ProxyConnectionInfo::new().set_old_source_port(42);
14286 /// ```
14287 pub fn set_old_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14288 self.old_source_port = v.into();
14289 self
14290 }
14291
14292 /// Sets the value of [new_source_port][crate::model::ProxyConnectionInfo::new_source_port].
14293 ///
14294 /// # Example
14295 /// ```ignore,no_run
14296 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
14297 /// let x = ProxyConnectionInfo::new().set_new_source_port(42);
14298 /// ```
14299 pub fn set_new_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14300 self.new_source_port = v.into();
14301 self
14302 }
14303
14304 /// Sets the value of [old_destination_port][crate::model::ProxyConnectionInfo::old_destination_port].
14305 ///
14306 /// # Example
14307 /// ```ignore,no_run
14308 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
14309 /// let x = ProxyConnectionInfo::new().set_old_destination_port(42);
14310 /// ```
14311 pub fn set_old_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14312 self.old_destination_port = v.into();
14313 self
14314 }
14315
14316 /// Sets the value of [new_destination_port][crate::model::ProxyConnectionInfo::new_destination_port].
14317 ///
14318 /// # Example
14319 /// ```ignore,no_run
14320 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
14321 /// let x = ProxyConnectionInfo::new().set_new_destination_port(42);
14322 /// ```
14323 pub fn set_new_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14324 self.new_destination_port = v.into();
14325 self
14326 }
14327
14328 /// Sets the value of [subnet_uri][crate::model::ProxyConnectionInfo::subnet_uri].
14329 ///
14330 /// # Example
14331 /// ```ignore,no_run
14332 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
14333 /// let x = ProxyConnectionInfo::new().set_subnet_uri("example");
14334 /// ```
14335 pub fn set_subnet_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14336 self.subnet_uri = v.into();
14337 self
14338 }
14339
14340 /// Sets the value of [network_uri][crate::model::ProxyConnectionInfo::network_uri].
14341 ///
14342 /// # Example
14343 /// ```ignore,no_run
14344 /// # use google_cloud_networkmanagement_v1::model::ProxyConnectionInfo;
14345 /// let x = ProxyConnectionInfo::new().set_network_uri("example");
14346 /// ```
14347 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14348 self.network_uri = v.into();
14349 self
14350 }
14351}
14352
14353impl wkt::message::Message for ProxyConnectionInfo {
14354 fn typename() -> &'static str {
14355 "type.googleapis.com/google.cloud.networkmanagement.v1.ProxyConnectionInfo"
14356 }
14357}
14358
14359/// For display only. Metadata associated with the load balancer backend.
14360#[derive(Clone, Default, PartialEq)]
14361#[non_exhaustive]
14362pub struct LoadBalancerBackendInfo {
14363 /// Display name of the backend. For example, it might be an instance name for
14364 /// the instance group backends, or an IP address and port for zonal network
14365 /// endpoint group backends.
14366 pub name: std::string::String,
14367
14368 /// URI of the backend instance (if applicable). Populated for instance group
14369 /// backends, and zonal NEG backends.
14370 pub instance_uri: std::string::String,
14371
14372 /// URI of the backend service this backend belongs to (if applicable).
14373 pub backend_service_uri: std::string::String,
14374
14375 /// URI of the instance group this backend belongs to (if applicable).
14376 pub instance_group_uri: std::string::String,
14377
14378 /// URI of the network endpoint group this backend belongs to (if applicable).
14379 pub network_endpoint_group_uri: std::string::String,
14380
14381 /// URI of the backend bucket this backend targets (if applicable).
14382 pub backend_bucket_uri: std::string::String,
14383
14384 /// URI of the PSC service attachment this PSC NEG backend targets (if
14385 /// applicable).
14386 pub psc_service_attachment_uri: std::string::String,
14387
14388 /// PSC Google API target this PSC NEG backend targets (if applicable).
14389 pub psc_google_api_target: std::string::String,
14390
14391 /// URI of the health check attached to this backend (if applicable).
14392 pub health_check_uri: std::string::String,
14393
14394 /// Output only. Health check firewalls configuration state for the backend.
14395 /// This is a result of the static firewall analysis (verifying that health
14396 /// check traffic from required IP ranges to the backend is allowed or not).
14397 /// The backend might still be unhealthy even if these firewalls are
14398 /// configured. Please refer to the documentation for more information:
14399 /// <https://cloud.google.com/load-balancing/docs/firewall-rules>
14400 pub health_check_firewalls_config_state:
14401 crate::model::load_balancer_backend_info::HealthCheckFirewallsConfigState,
14402
14403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14404}
14405
14406impl LoadBalancerBackendInfo {
14407 pub fn new() -> Self {
14408 std::default::Default::default()
14409 }
14410
14411 /// Sets the value of [name][crate::model::LoadBalancerBackendInfo::name].
14412 ///
14413 /// # Example
14414 /// ```ignore,no_run
14415 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
14416 /// let x = LoadBalancerBackendInfo::new().set_name("example");
14417 /// ```
14418 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14419 self.name = v.into();
14420 self
14421 }
14422
14423 /// Sets the value of [instance_uri][crate::model::LoadBalancerBackendInfo::instance_uri].
14424 ///
14425 /// # Example
14426 /// ```ignore,no_run
14427 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
14428 /// let x = LoadBalancerBackendInfo::new().set_instance_uri("example");
14429 /// ```
14430 pub fn set_instance_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14431 self.instance_uri = v.into();
14432 self
14433 }
14434
14435 /// Sets the value of [backend_service_uri][crate::model::LoadBalancerBackendInfo::backend_service_uri].
14436 ///
14437 /// # Example
14438 /// ```ignore,no_run
14439 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
14440 /// let x = LoadBalancerBackendInfo::new().set_backend_service_uri("example");
14441 /// ```
14442 pub fn set_backend_service_uri<T: std::convert::Into<std::string::String>>(
14443 mut self,
14444 v: T,
14445 ) -> Self {
14446 self.backend_service_uri = v.into();
14447 self
14448 }
14449
14450 /// Sets the value of [instance_group_uri][crate::model::LoadBalancerBackendInfo::instance_group_uri].
14451 ///
14452 /// # Example
14453 /// ```ignore,no_run
14454 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
14455 /// let x = LoadBalancerBackendInfo::new().set_instance_group_uri("example");
14456 /// ```
14457 pub fn set_instance_group_uri<T: std::convert::Into<std::string::String>>(
14458 mut self,
14459 v: T,
14460 ) -> Self {
14461 self.instance_group_uri = v.into();
14462 self
14463 }
14464
14465 /// Sets the value of [network_endpoint_group_uri][crate::model::LoadBalancerBackendInfo::network_endpoint_group_uri].
14466 ///
14467 /// # Example
14468 /// ```ignore,no_run
14469 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
14470 /// let x = LoadBalancerBackendInfo::new().set_network_endpoint_group_uri("example");
14471 /// ```
14472 pub fn set_network_endpoint_group_uri<T: std::convert::Into<std::string::String>>(
14473 mut self,
14474 v: T,
14475 ) -> Self {
14476 self.network_endpoint_group_uri = v.into();
14477 self
14478 }
14479
14480 /// Sets the value of [backend_bucket_uri][crate::model::LoadBalancerBackendInfo::backend_bucket_uri].
14481 ///
14482 /// # Example
14483 /// ```ignore,no_run
14484 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
14485 /// let x = LoadBalancerBackendInfo::new().set_backend_bucket_uri("example");
14486 /// ```
14487 pub fn set_backend_bucket_uri<T: std::convert::Into<std::string::String>>(
14488 mut self,
14489 v: T,
14490 ) -> Self {
14491 self.backend_bucket_uri = v.into();
14492 self
14493 }
14494
14495 /// Sets the value of [psc_service_attachment_uri][crate::model::LoadBalancerBackendInfo::psc_service_attachment_uri].
14496 ///
14497 /// # Example
14498 /// ```ignore,no_run
14499 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
14500 /// let x = LoadBalancerBackendInfo::new().set_psc_service_attachment_uri("example");
14501 /// ```
14502 pub fn set_psc_service_attachment_uri<T: std::convert::Into<std::string::String>>(
14503 mut self,
14504 v: T,
14505 ) -> Self {
14506 self.psc_service_attachment_uri = v.into();
14507 self
14508 }
14509
14510 /// Sets the value of [psc_google_api_target][crate::model::LoadBalancerBackendInfo::psc_google_api_target].
14511 ///
14512 /// # Example
14513 /// ```ignore,no_run
14514 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
14515 /// let x = LoadBalancerBackendInfo::new().set_psc_google_api_target("example");
14516 /// ```
14517 pub fn set_psc_google_api_target<T: std::convert::Into<std::string::String>>(
14518 mut self,
14519 v: T,
14520 ) -> Self {
14521 self.psc_google_api_target = v.into();
14522 self
14523 }
14524
14525 /// Sets the value of [health_check_uri][crate::model::LoadBalancerBackendInfo::health_check_uri].
14526 ///
14527 /// # Example
14528 /// ```ignore,no_run
14529 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
14530 /// let x = LoadBalancerBackendInfo::new().set_health_check_uri("example");
14531 /// ```
14532 pub fn set_health_check_uri<T: std::convert::Into<std::string::String>>(
14533 mut self,
14534 v: T,
14535 ) -> Self {
14536 self.health_check_uri = v.into();
14537 self
14538 }
14539
14540 /// Sets the value of [health_check_firewalls_config_state][crate::model::LoadBalancerBackendInfo::health_check_firewalls_config_state].
14541 ///
14542 /// # Example
14543 /// ```ignore,no_run
14544 /// # use google_cloud_networkmanagement_v1::model::LoadBalancerBackendInfo;
14545 /// use google_cloud_networkmanagement_v1::model::load_balancer_backend_info::HealthCheckFirewallsConfigState;
14546 /// let x0 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsConfigured);
14547 /// let x1 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsPartiallyConfigured);
14548 /// let x2 = LoadBalancerBackendInfo::new().set_health_check_firewalls_config_state(HealthCheckFirewallsConfigState::FirewallsNotConfigured);
14549 /// ```
14550 pub fn set_health_check_firewalls_config_state<
14551 T: std::convert::Into<
14552 crate::model::load_balancer_backend_info::HealthCheckFirewallsConfigState,
14553 >,
14554 >(
14555 mut self,
14556 v: T,
14557 ) -> Self {
14558 self.health_check_firewalls_config_state = v.into();
14559 self
14560 }
14561}
14562
14563impl wkt::message::Message for LoadBalancerBackendInfo {
14564 fn typename() -> &'static str {
14565 "type.googleapis.com/google.cloud.networkmanagement.v1.LoadBalancerBackendInfo"
14566 }
14567}
14568
14569/// Defines additional types related to [LoadBalancerBackendInfo].
14570pub mod load_balancer_backend_info {
14571 #[allow(unused_imports)]
14572 use super::*;
14573
14574 /// Health check firewalls configuration state enum.
14575 ///
14576 /// # Working with unknown values
14577 ///
14578 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14579 /// additional enum variants at any time. Adding new variants is not considered
14580 /// a breaking change. Applications should write their code in anticipation of:
14581 ///
14582 /// - New values appearing in future releases of the client library, **and**
14583 /// - New values received dynamically, without application changes.
14584 ///
14585 /// Please consult the [Working with enums] section in the user guide for some
14586 /// guidelines.
14587 ///
14588 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14589 #[derive(Clone, Debug, PartialEq)]
14590 #[non_exhaustive]
14591 pub enum HealthCheckFirewallsConfigState {
14592 /// Configuration state unspecified. It usually means that the backend has
14593 /// no health check attached, or there was an unexpected configuration error
14594 /// preventing Connectivity tests from verifying health check configuration.
14595 Unspecified,
14596 /// Firewall rules (policies) allowing health check traffic from all required
14597 /// IP ranges to the backend are configured.
14598 FirewallsConfigured,
14599 /// Firewall rules (policies) allow health check traffic only from a part of
14600 /// required IP ranges.
14601 FirewallsPartiallyConfigured,
14602 /// Firewall rules (policies) deny health check traffic from all required
14603 /// IP ranges to the backend.
14604 FirewallsNotConfigured,
14605 /// The network contains firewall rules of unsupported types, so Connectivity
14606 /// tests were not able to verify health check configuration status. Please
14607 /// refer to the documentation for the list of unsupported configurations:
14608 /// <https://cloud.google.com/network-intelligence-center/docs/connectivity-tests/concepts/overview#unsupported-configs>
14609 FirewallsUnsupported,
14610 /// If set, the enum was initialized with an unknown value.
14611 ///
14612 /// Applications can examine the value using [HealthCheckFirewallsConfigState::value] or
14613 /// [HealthCheckFirewallsConfigState::name].
14614 UnknownValue(health_check_firewalls_config_state::UnknownValue),
14615 }
14616
14617 #[doc(hidden)]
14618 pub mod health_check_firewalls_config_state {
14619 #[allow(unused_imports)]
14620 use super::*;
14621 #[derive(Clone, Debug, PartialEq)]
14622 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14623 }
14624
14625 impl HealthCheckFirewallsConfigState {
14626 /// Gets the enum value.
14627 ///
14628 /// Returns `None` if the enum contains an unknown value deserialized from
14629 /// the string representation of enums.
14630 pub fn value(&self) -> std::option::Option<i32> {
14631 match self {
14632 Self::Unspecified => std::option::Option::Some(0),
14633 Self::FirewallsConfigured => std::option::Option::Some(1),
14634 Self::FirewallsPartiallyConfigured => std::option::Option::Some(2),
14635 Self::FirewallsNotConfigured => std::option::Option::Some(3),
14636 Self::FirewallsUnsupported => std::option::Option::Some(4),
14637 Self::UnknownValue(u) => u.0.value(),
14638 }
14639 }
14640
14641 /// Gets the enum value as a string.
14642 ///
14643 /// Returns `None` if the enum contains an unknown value deserialized from
14644 /// the integer representation of enums.
14645 pub fn name(&self) -> std::option::Option<&str> {
14646 match self {
14647 Self::Unspecified => {
14648 std::option::Option::Some("HEALTH_CHECK_FIREWALLS_CONFIG_STATE_UNSPECIFIED")
14649 }
14650 Self::FirewallsConfigured => std::option::Option::Some("FIREWALLS_CONFIGURED"),
14651 Self::FirewallsPartiallyConfigured => {
14652 std::option::Option::Some("FIREWALLS_PARTIALLY_CONFIGURED")
14653 }
14654 Self::FirewallsNotConfigured => {
14655 std::option::Option::Some("FIREWALLS_NOT_CONFIGURED")
14656 }
14657 Self::FirewallsUnsupported => std::option::Option::Some("FIREWALLS_UNSUPPORTED"),
14658 Self::UnknownValue(u) => u.0.name(),
14659 }
14660 }
14661 }
14662
14663 impl std::default::Default for HealthCheckFirewallsConfigState {
14664 fn default() -> Self {
14665 use std::convert::From;
14666 Self::from(0)
14667 }
14668 }
14669
14670 impl std::fmt::Display for HealthCheckFirewallsConfigState {
14671 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14672 wkt::internal::display_enum(f, self.name(), self.value())
14673 }
14674 }
14675
14676 impl std::convert::From<i32> for HealthCheckFirewallsConfigState {
14677 fn from(value: i32) -> Self {
14678 match value {
14679 0 => Self::Unspecified,
14680 1 => Self::FirewallsConfigured,
14681 2 => Self::FirewallsPartiallyConfigured,
14682 3 => Self::FirewallsNotConfigured,
14683 4 => Self::FirewallsUnsupported,
14684 _ => Self::UnknownValue(health_check_firewalls_config_state::UnknownValue(
14685 wkt::internal::UnknownEnumValue::Integer(value),
14686 )),
14687 }
14688 }
14689 }
14690
14691 impl std::convert::From<&str> for HealthCheckFirewallsConfigState {
14692 fn from(value: &str) -> Self {
14693 use std::string::ToString;
14694 match value {
14695 "HEALTH_CHECK_FIREWALLS_CONFIG_STATE_UNSPECIFIED" => Self::Unspecified,
14696 "FIREWALLS_CONFIGURED" => Self::FirewallsConfigured,
14697 "FIREWALLS_PARTIALLY_CONFIGURED" => Self::FirewallsPartiallyConfigured,
14698 "FIREWALLS_NOT_CONFIGURED" => Self::FirewallsNotConfigured,
14699 "FIREWALLS_UNSUPPORTED" => Self::FirewallsUnsupported,
14700 _ => Self::UnknownValue(health_check_firewalls_config_state::UnknownValue(
14701 wkt::internal::UnknownEnumValue::String(value.to_string()),
14702 )),
14703 }
14704 }
14705 }
14706
14707 impl serde::ser::Serialize for HealthCheckFirewallsConfigState {
14708 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14709 where
14710 S: serde::Serializer,
14711 {
14712 match self {
14713 Self::Unspecified => serializer.serialize_i32(0),
14714 Self::FirewallsConfigured => serializer.serialize_i32(1),
14715 Self::FirewallsPartiallyConfigured => serializer.serialize_i32(2),
14716 Self::FirewallsNotConfigured => serializer.serialize_i32(3),
14717 Self::FirewallsUnsupported => serializer.serialize_i32(4),
14718 Self::UnknownValue(u) => u.0.serialize(serializer),
14719 }
14720 }
14721 }
14722
14723 impl<'de> serde::de::Deserialize<'de> for HealthCheckFirewallsConfigState {
14724 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14725 where
14726 D: serde::Deserializer<'de>,
14727 {
14728 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HealthCheckFirewallsConfigState>::new(
14729 ".google.cloud.networkmanagement.v1.LoadBalancerBackendInfo.HealthCheckFirewallsConfigState"))
14730 }
14731 }
14732}
14733
14734/// For display only. Metadata associated with Storage Bucket.
14735#[derive(Clone, Default, PartialEq)]
14736#[non_exhaustive]
14737pub struct StorageBucketInfo {
14738 /// Cloud Storage Bucket name.
14739 pub bucket: std::string::String,
14740
14741 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14742}
14743
14744impl StorageBucketInfo {
14745 pub fn new() -> Self {
14746 std::default::Default::default()
14747 }
14748
14749 /// Sets the value of [bucket][crate::model::StorageBucketInfo::bucket].
14750 ///
14751 /// # Example
14752 /// ```ignore,no_run
14753 /// # use google_cloud_networkmanagement_v1::model::StorageBucketInfo;
14754 /// let x = StorageBucketInfo::new().set_bucket("example");
14755 /// ```
14756 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14757 self.bucket = v.into();
14758 self
14759 }
14760}
14761
14762impl wkt::message::Message for StorageBucketInfo {
14763 fn typename() -> &'static str {
14764 "type.googleapis.com/google.cloud.networkmanagement.v1.StorageBucketInfo"
14765 }
14766}
14767
14768/// For display only. Metadata associated with the serverless network endpoint
14769/// group backend.
14770#[derive(Clone, Default, PartialEq)]
14771#[non_exhaustive]
14772pub struct ServerlessNegInfo {
14773 /// URI of the serverless network endpoint group.
14774 pub neg_uri: std::string::String,
14775
14776 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14777}
14778
14779impl ServerlessNegInfo {
14780 pub fn new() -> Self {
14781 std::default::Default::default()
14782 }
14783
14784 /// Sets the value of [neg_uri][crate::model::ServerlessNegInfo::neg_uri].
14785 ///
14786 /// # Example
14787 /// ```ignore,no_run
14788 /// # use google_cloud_networkmanagement_v1::model::ServerlessNegInfo;
14789 /// let x = ServerlessNegInfo::new().set_neg_uri("example");
14790 /// ```
14791 pub fn set_neg_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14792 self.neg_uri = v.into();
14793 self
14794 }
14795}
14796
14797impl wkt::message::Message for ServerlessNegInfo {
14798 fn typename() -> &'static str {
14799 "type.googleapis.com/google.cloud.networkmanagement.v1.ServerlessNegInfo"
14800 }
14801}
14802
14803/// Request for the `ListVpcFlowLogsConfigs` method.
14804#[derive(Clone, Default, PartialEq)]
14805#[non_exhaustive]
14806pub struct ListVpcFlowLogsConfigsRequest {
14807 /// Required. The parent resource of the VpcFlowLogsConfig,
14808 /// in one of the following formats:
14809 ///
14810 /// - For project-level resourcs: `projects/{project_id}/locations/global`
14811 ///
14812 /// - For organization-level resources:
14813 /// `organizations/{organization_id}/locations/global`
14814 ///
14815 pub parent: std::string::String,
14816
14817 /// Optional. Number of `VpcFlowLogsConfigs` to return.
14818 pub page_size: i32,
14819
14820 /// Optional. Page token from an earlier query, as returned in
14821 /// `next_page_token`.
14822 pub page_token: std::string::String,
14823
14824 /// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
14825 /// A filter expression must use the supported [CEL logic operators]
14826 /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
14827 pub filter: std::string::String,
14828
14829 /// Optional. Field to use to sort the list.
14830 pub order_by: std::string::String,
14831
14832 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14833}
14834
14835impl ListVpcFlowLogsConfigsRequest {
14836 pub fn new() -> Self {
14837 std::default::Default::default()
14838 }
14839
14840 /// Sets the value of [parent][crate::model::ListVpcFlowLogsConfigsRequest::parent].
14841 ///
14842 /// # Example
14843 /// ```ignore,no_run
14844 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
14845 /// let x = ListVpcFlowLogsConfigsRequest::new().set_parent("example");
14846 /// ```
14847 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14848 self.parent = v.into();
14849 self
14850 }
14851
14852 /// Sets the value of [page_size][crate::model::ListVpcFlowLogsConfigsRequest::page_size].
14853 ///
14854 /// # Example
14855 /// ```ignore,no_run
14856 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
14857 /// let x = ListVpcFlowLogsConfigsRequest::new().set_page_size(42);
14858 /// ```
14859 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14860 self.page_size = v.into();
14861 self
14862 }
14863
14864 /// Sets the value of [page_token][crate::model::ListVpcFlowLogsConfigsRequest::page_token].
14865 ///
14866 /// # Example
14867 /// ```ignore,no_run
14868 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
14869 /// let x = ListVpcFlowLogsConfigsRequest::new().set_page_token("example");
14870 /// ```
14871 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14872 self.page_token = v.into();
14873 self
14874 }
14875
14876 /// Sets the value of [filter][crate::model::ListVpcFlowLogsConfigsRequest::filter].
14877 ///
14878 /// # Example
14879 /// ```ignore,no_run
14880 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
14881 /// let x = ListVpcFlowLogsConfigsRequest::new().set_filter("example");
14882 /// ```
14883 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14884 self.filter = v.into();
14885 self
14886 }
14887
14888 /// Sets the value of [order_by][crate::model::ListVpcFlowLogsConfigsRequest::order_by].
14889 ///
14890 /// # Example
14891 /// ```ignore,no_run
14892 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsRequest;
14893 /// let x = ListVpcFlowLogsConfigsRequest::new().set_order_by("example");
14894 /// ```
14895 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14896 self.order_by = v.into();
14897 self
14898 }
14899}
14900
14901impl wkt::message::Message for ListVpcFlowLogsConfigsRequest {
14902 fn typename() -> &'static str {
14903 "type.googleapis.com/google.cloud.networkmanagement.v1.ListVpcFlowLogsConfigsRequest"
14904 }
14905}
14906
14907/// Response for the `ListVpcFlowLogsConfigs` method.
14908#[derive(Clone, Default, PartialEq)]
14909#[non_exhaustive]
14910pub struct ListVpcFlowLogsConfigsResponse {
14911 /// List of VPC Flow Log configurations.
14912 pub vpc_flow_logs_configs: std::vec::Vec<crate::model::VpcFlowLogsConfig>,
14913
14914 /// Page token to fetch the next set of configurations.
14915 pub next_page_token: std::string::String,
14916
14917 /// Locations that could not be reached (when querying all locations with `-`).
14918 pub unreachable: std::vec::Vec<std::string::String>,
14919
14920 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14921}
14922
14923impl ListVpcFlowLogsConfigsResponse {
14924 pub fn new() -> Self {
14925 std::default::Default::default()
14926 }
14927
14928 /// Sets the value of [vpc_flow_logs_configs][crate::model::ListVpcFlowLogsConfigsResponse::vpc_flow_logs_configs].
14929 ///
14930 /// # Example
14931 /// ```ignore,no_run
14932 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
14933 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
14934 /// let x = ListVpcFlowLogsConfigsResponse::new()
14935 /// .set_vpc_flow_logs_configs([
14936 /// VpcFlowLogsConfig::default()/* use setters */,
14937 /// VpcFlowLogsConfig::default()/* use (different) setters */,
14938 /// ]);
14939 /// ```
14940 pub fn set_vpc_flow_logs_configs<T, V>(mut self, v: T) -> Self
14941 where
14942 T: std::iter::IntoIterator<Item = V>,
14943 V: std::convert::Into<crate::model::VpcFlowLogsConfig>,
14944 {
14945 use std::iter::Iterator;
14946 self.vpc_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
14947 self
14948 }
14949
14950 /// Sets the value of [next_page_token][crate::model::ListVpcFlowLogsConfigsResponse::next_page_token].
14951 ///
14952 /// # Example
14953 /// ```ignore,no_run
14954 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
14955 /// let x = ListVpcFlowLogsConfigsResponse::new().set_next_page_token("example");
14956 /// ```
14957 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14958 self.next_page_token = v.into();
14959 self
14960 }
14961
14962 /// Sets the value of [unreachable][crate::model::ListVpcFlowLogsConfigsResponse::unreachable].
14963 ///
14964 /// # Example
14965 /// ```ignore,no_run
14966 /// # use google_cloud_networkmanagement_v1::model::ListVpcFlowLogsConfigsResponse;
14967 /// let x = ListVpcFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
14968 /// ```
14969 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
14970 where
14971 T: std::iter::IntoIterator<Item = V>,
14972 V: std::convert::Into<std::string::String>,
14973 {
14974 use std::iter::Iterator;
14975 self.unreachable = v.into_iter().map(|i| i.into()).collect();
14976 self
14977 }
14978}
14979
14980impl wkt::message::Message for ListVpcFlowLogsConfigsResponse {
14981 fn typename() -> &'static str {
14982 "type.googleapis.com/google.cloud.networkmanagement.v1.ListVpcFlowLogsConfigsResponse"
14983 }
14984}
14985
14986#[doc(hidden)]
14987impl gax::paginator::internal::PageableResponse for ListVpcFlowLogsConfigsResponse {
14988 type PageItem = crate::model::VpcFlowLogsConfig;
14989
14990 fn items(self) -> std::vec::Vec<Self::PageItem> {
14991 self.vpc_flow_logs_configs
14992 }
14993
14994 fn next_page_token(&self) -> std::string::String {
14995 use std::clone::Clone;
14996 self.next_page_token.clone()
14997 }
14998}
14999
15000/// Request for the `GetVpcFlowLogsConfig` method.
15001#[derive(Clone, Default, PartialEq)]
15002#[non_exhaustive]
15003pub struct GetVpcFlowLogsConfigRequest {
15004 /// Required. The resource name of the VpcFlowLogsConfig,
15005 /// in one of the following formats:
15006 ///
15007 /// - For project-level resources:
15008 /// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
15009 ///
15010 /// - For organization-level resources:
15011 /// `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
15012 ///
15013 pub name: std::string::String,
15014
15015 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15016}
15017
15018impl GetVpcFlowLogsConfigRequest {
15019 pub fn new() -> Self {
15020 std::default::Default::default()
15021 }
15022
15023 /// Sets the value of [name][crate::model::GetVpcFlowLogsConfigRequest::name].
15024 ///
15025 /// # Example
15026 /// ```ignore,no_run
15027 /// # use google_cloud_networkmanagement_v1::model::GetVpcFlowLogsConfigRequest;
15028 /// let x = GetVpcFlowLogsConfigRequest::new().set_name("example");
15029 /// ```
15030 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15031 self.name = v.into();
15032 self
15033 }
15034}
15035
15036impl wkt::message::Message for GetVpcFlowLogsConfigRequest {
15037 fn typename() -> &'static str {
15038 "type.googleapis.com/google.cloud.networkmanagement.v1.GetVpcFlowLogsConfigRequest"
15039 }
15040}
15041
15042/// Request for the `CreateVpcFlowLogsConfig` method.
15043#[derive(Clone, Default, PartialEq)]
15044#[non_exhaustive]
15045pub struct CreateVpcFlowLogsConfigRequest {
15046 /// Required. The parent resource of the VpcFlowLogsConfig to create,
15047 /// in one of the following formats:
15048 ///
15049 /// - For project-level resources: `projects/{project_id}/locations/global`
15050 ///
15051 /// - For organization-level resources:
15052 /// `organizations/{organization_id}/locations/global`
15053 ///
15054 pub parent: std::string::String,
15055
15056 /// Required. ID of the `VpcFlowLogsConfig`.
15057 pub vpc_flow_logs_config_id: std::string::String,
15058
15059 /// Required. A `VpcFlowLogsConfig` resource
15060 pub vpc_flow_logs_config: std::option::Option<crate::model::VpcFlowLogsConfig>,
15061
15062 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15063}
15064
15065impl CreateVpcFlowLogsConfigRequest {
15066 pub fn new() -> Self {
15067 std::default::Default::default()
15068 }
15069
15070 /// Sets the value of [parent][crate::model::CreateVpcFlowLogsConfigRequest::parent].
15071 ///
15072 /// # Example
15073 /// ```ignore,no_run
15074 /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
15075 /// let x = CreateVpcFlowLogsConfigRequest::new().set_parent("example");
15076 /// ```
15077 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15078 self.parent = v.into();
15079 self
15080 }
15081
15082 /// Sets the value of [vpc_flow_logs_config_id][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config_id].
15083 ///
15084 /// # Example
15085 /// ```ignore,no_run
15086 /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
15087 /// let x = CreateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config_id("example");
15088 /// ```
15089 pub fn set_vpc_flow_logs_config_id<T: std::convert::Into<std::string::String>>(
15090 mut self,
15091 v: T,
15092 ) -> Self {
15093 self.vpc_flow_logs_config_id = v.into();
15094 self
15095 }
15096
15097 /// Sets the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
15098 ///
15099 /// # Example
15100 /// ```ignore,no_run
15101 /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
15102 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15103 /// let x = CreateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config(VpcFlowLogsConfig::default()/* use setters */);
15104 /// ```
15105 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
15106 where
15107 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
15108 {
15109 self.vpc_flow_logs_config = std::option::Option::Some(v.into());
15110 self
15111 }
15112
15113 /// Sets or clears the value of [vpc_flow_logs_config][crate::model::CreateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
15114 ///
15115 /// # Example
15116 /// ```ignore,no_run
15117 /// # use google_cloud_networkmanagement_v1::model::CreateVpcFlowLogsConfigRequest;
15118 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15119 /// let x = CreateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(Some(VpcFlowLogsConfig::default()/* use setters */));
15120 /// let x = CreateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(None::<VpcFlowLogsConfig>);
15121 /// ```
15122 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
15123 where
15124 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
15125 {
15126 self.vpc_flow_logs_config = v.map(|x| x.into());
15127 self
15128 }
15129}
15130
15131impl wkt::message::Message for CreateVpcFlowLogsConfigRequest {
15132 fn typename() -> &'static str {
15133 "type.googleapis.com/google.cloud.networkmanagement.v1.CreateVpcFlowLogsConfigRequest"
15134 }
15135}
15136
15137/// Request for the `UpdateVpcFlowLogsConfig` method.
15138#[derive(Clone, Default, PartialEq)]
15139#[non_exhaustive]
15140pub struct UpdateVpcFlowLogsConfigRequest {
15141 /// Required. Mask of fields to update. At least one path must be supplied in
15142 /// this field.
15143 /// For example, to change the state of the configuration to ENABLED, specify
15144 /// `update_mask` = `"state"`, and the `vpc_flow_logs_config` would be:
15145 /// `vpc_flow_logs_config = {
15146 /// name =
15147 /// "projects/my-project/locations/global/vpcFlowLogsConfigs/my-config"
15148 /// state = "ENABLED" }`
15149 pub update_mask: std::option::Option<wkt::FieldMask>,
15150
15151 /// Required. Only fields specified in update_mask are updated.
15152 pub vpc_flow_logs_config: std::option::Option<crate::model::VpcFlowLogsConfig>,
15153
15154 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15155}
15156
15157impl UpdateVpcFlowLogsConfigRequest {
15158 pub fn new() -> Self {
15159 std::default::Default::default()
15160 }
15161
15162 /// Sets the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
15163 ///
15164 /// # Example
15165 /// ```ignore,no_run
15166 /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
15167 /// use wkt::FieldMask;
15168 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
15169 /// ```
15170 pub fn set_update_mask<T>(mut self, v: T) -> Self
15171 where
15172 T: std::convert::Into<wkt::FieldMask>,
15173 {
15174 self.update_mask = std::option::Option::Some(v.into());
15175 self
15176 }
15177
15178 /// Sets or clears the value of [update_mask][crate::model::UpdateVpcFlowLogsConfigRequest::update_mask].
15179 ///
15180 /// # Example
15181 /// ```ignore,no_run
15182 /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
15183 /// use wkt::FieldMask;
15184 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
15185 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
15186 /// ```
15187 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15188 where
15189 T: std::convert::Into<wkt::FieldMask>,
15190 {
15191 self.update_mask = v.map(|x| x.into());
15192 self
15193 }
15194
15195 /// Sets the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
15196 ///
15197 /// # Example
15198 /// ```ignore,no_run
15199 /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
15200 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15201 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_vpc_flow_logs_config(VpcFlowLogsConfig::default()/* use setters */);
15202 /// ```
15203 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
15204 where
15205 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
15206 {
15207 self.vpc_flow_logs_config = std::option::Option::Some(v.into());
15208 self
15209 }
15210
15211 /// Sets or clears the value of [vpc_flow_logs_config][crate::model::UpdateVpcFlowLogsConfigRequest::vpc_flow_logs_config].
15212 ///
15213 /// # Example
15214 /// ```ignore,no_run
15215 /// # use google_cloud_networkmanagement_v1::model::UpdateVpcFlowLogsConfigRequest;
15216 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15217 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(Some(VpcFlowLogsConfig::default()/* use setters */));
15218 /// let x = UpdateVpcFlowLogsConfigRequest::new().set_or_clear_vpc_flow_logs_config(None::<VpcFlowLogsConfig>);
15219 /// ```
15220 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
15221 where
15222 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
15223 {
15224 self.vpc_flow_logs_config = v.map(|x| x.into());
15225 self
15226 }
15227}
15228
15229impl wkt::message::Message for UpdateVpcFlowLogsConfigRequest {
15230 fn typename() -> &'static str {
15231 "type.googleapis.com/google.cloud.networkmanagement.v1.UpdateVpcFlowLogsConfigRequest"
15232 }
15233}
15234
15235/// Request for the `DeleteVpcFlowLogsConfig` method.
15236#[derive(Clone, Default, PartialEq)]
15237#[non_exhaustive]
15238pub struct DeleteVpcFlowLogsConfigRequest {
15239 /// Required. The resource name of the VpcFlowLogsConfig,
15240 /// in one of the following formats:
15241 ///
15242 /// - For a project-level resource:
15243 /// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
15244 ///
15245 /// - For an organization-level resource:
15246 /// `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
15247 ///
15248 pub name: std::string::String,
15249
15250 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15251}
15252
15253impl DeleteVpcFlowLogsConfigRequest {
15254 pub fn new() -> Self {
15255 std::default::Default::default()
15256 }
15257
15258 /// Sets the value of [name][crate::model::DeleteVpcFlowLogsConfigRequest::name].
15259 ///
15260 /// # Example
15261 /// ```ignore,no_run
15262 /// # use google_cloud_networkmanagement_v1::model::DeleteVpcFlowLogsConfigRequest;
15263 /// let x = DeleteVpcFlowLogsConfigRequest::new().set_name("example");
15264 /// ```
15265 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15266 self.name = v.into();
15267 self
15268 }
15269}
15270
15271impl wkt::message::Message for DeleteVpcFlowLogsConfigRequest {
15272 fn typename() -> &'static str {
15273 "type.googleapis.com/google.cloud.networkmanagement.v1.DeleteVpcFlowLogsConfigRequest"
15274 }
15275}
15276
15277/// Request for the `QueryOrgVpcFlowLogsConfigs` method.
15278#[derive(Clone, Default, PartialEq)]
15279#[non_exhaustive]
15280pub struct QueryOrgVpcFlowLogsConfigsRequest {
15281 /// Required. The parent resource of the VpcFlowLogsConfig, specified in
15282 /// the following format: `projects/{project_id}/locations/global`
15283 pub parent: std::string::String,
15284
15285 /// Optional. Number of `VpcFlowLogsConfigs` to return.
15286 pub page_size: i32,
15287
15288 /// Optional. Page token from an earlier query, as returned in
15289 /// `next_page_token`.
15290 pub page_token: std::string::String,
15291
15292 /// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
15293 /// A filter expression must use the supported [CEL logic operators]
15294 /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
15295 pub filter: std::string::String,
15296
15297 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15298}
15299
15300impl QueryOrgVpcFlowLogsConfigsRequest {
15301 pub fn new() -> Self {
15302 std::default::Default::default()
15303 }
15304
15305 /// Sets the value of [parent][crate::model::QueryOrgVpcFlowLogsConfigsRequest::parent].
15306 ///
15307 /// # Example
15308 /// ```ignore,no_run
15309 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
15310 /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_parent("example");
15311 /// ```
15312 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15313 self.parent = v.into();
15314 self
15315 }
15316
15317 /// Sets the value of [page_size][crate::model::QueryOrgVpcFlowLogsConfigsRequest::page_size].
15318 ///
15319 /// # Example
15320 /// ```ignore,no_run
15321 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
15322 /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_page_size(42);
15323 /// ```
15324 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15325 self.page_size = v.into();
15326 self
15327 }
15328
15329 /// Sets the value of [page_token][crate::model::QueryOrgVpcFlowLogsConfigsRequest::page_token].
15330 ///
15331 /// # Example
15332 /// ```ignore,no_run
15333 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
15334 /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_page_token("example");
15335 /// ```
15336 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15337 self.page_token = v.into();
15338 self
15339 }
15340
15341 /// Sets the value of [filter][crate::model::QueryOrgVpcFlowLogsConfigsRequest::filter].
15342 ///
15343 /// # Example
15344 /// ```ignore,no_run
15345 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsRequest;
15346 /// let x = QueryOrgVpcFlowLogsConfigsRequest::new().set_filter("example");
15347 /// ```
15348 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15349 self.filter = v.into();
15350 self
15351 }
15352}
15353
15354impl wkt::message::Message for QueryOrgVpcFlowLogsConfigsRequest {
15355 fn typename() -> &'static str {
15356 "type.googleapis.com/google.cloud.networkmanagement.v1.QueryOrgVpcFlowLogsConfigsRequest"
15357 }
15358}
15359
15360/// Response for the `QueryVpcFlowLogsConfigs` method.
15361#[derive(Clone, Default, PartialEq)]
15362#[non_exhaustive]
15363pub struct QueryOrgVpcFlowLogsConfigsResponse {
15364 /// List of VPC Flow Log configurations.
15365 pub vpc_flow_logs_configs: std::vec::Vec<crate::model::VpcFlowLogsConfig>,
15366
15367 /// Page token to fetch the next set of configurations.
15368 pub next_page_token: std::string::String,
15369
15370 /// Locations that could not be reached (when querying all locations with `-`).
15371 pub unreachable: std::vec::Vec<std::string::String>,
15372
15373 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15374}
15375
15376impl QueryOrgVpcFlowLogsConfigsResponse {
15377 pub fn new() -> Self {
15378 std::default::Default::default()
15379 }
15380
15381 /// Sets the value of [vpc_flow_logs_configs][crate::model::QueryOrgVpcFlowLogsConfigsResponse::vpc_flow_logs_configs].
15382 ///
15383 /// # Example
15384 /// ```ignore,no_run
15385 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
15386 /// use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15387 /// let x = QueryOrgVpcFlowLogsConfigsResponse::new()
15388 /// .set_vpc_flow_logs_configs([
15389 /// VpcFlowLogsConfig::default()/* use setters */,
15390 /// VpcFlowLogsConfig::default()/* use (different) setters */,
15391 /// ]);
15392 /// ```
15393 pub fn set_vpc_flow_logs_configs<T, V>(mut self, v: T) -> Self
15394 where
15395 T: std::iter::IntoIterator<Item = V>,
15396 V: std::convert::Into<crate::model::VpcFlowLogsConfig>,
15397 {
15398 use std::iter::Iterator;
15399 self.vpc_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
15400 self
15401 }
15402
15403 /// Sets the value of [next_page_token][crate::model::QueryOrgVpcFlowLogsConfigsResponse::next_page_token].
15404 ///
15405 /// # Example
15406 /// ```ignore,no_run
15407 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
15408 /// let x = QueryOrgVpcFlowLogsConfigsResponse::new().set_next_page_token("example");
15409 /// ```
15410 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15411 self.next_page_token = v.into();
15412 self
15413 }
15414
15415 /// Sets the value of [unreachable][crate::model::QueryOrgVpcFlowLogsConfigsResponse::unreachable].
15416 ///
15417 /// # Example
15418 /// ```ignore,no_run
15419 /// # use google_cloud_networkmanagement_v1::model::QueryOrgVpcFlowLogsConfigsResponse;
15420 /// let x = QueryOrgVpcFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
15421 /// ```
15422 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
15423 where
15424 T: std::iter::IntoIterator<Item = V>,
15425 V: std::convert::Into<std::string::String>,
15426 {
15427 use std::iter::Iterator;
15428 self.unreachable = v.into_iter().map(|i| i.into()).collect();
15429 self
15430 }
15431}
15432
15433impl wkt::message::Message for QueryOrgVpcFlowLogsConfigsResponse {
15434 fn typename() -> &'static str {
15435 "type.googleapis.com/google.cloud.networkmanagement.v1.QueryOrgVpcFlowLogsConfigsResponse"
15436 }
15437}
15438
15439#[doc(hidden)]
15440impl gax::paginator::internal::PageableResponse for QueryOrgVpcFlowLogsConfigsResponse {
15441 type PageItem = crate::model::VpcFlowLogsConfig;
15442
15443 fn items(self) -> std::vec::Vec<Self::PageItem> {
15444 self.vpc_flow_logs_configs
15445 }
15446
15447 fn next_page_token(&self) -> std::string::String {
15448 use std::clone::Clone;
15449 self.next_page_token.clone()
15450 }
15451}
15452
15453/// Request for the `ShowEffectiveFlowLogsConfigs` method.
15454#[derive(Clone, Default, PartialEq)]
15455#[non_exhaustive]
15456pub struct ShowEffectiveFlowLogsConfigsRequest {
15457 /// Required. The parent resource of the VpcFlowLogsConfig, specified in
15458 /// the following format: `projects/{project_id}/locations/global`
15459 pub parent: std::string::String,
15460
15461 /// Required. The resource to get the effective VPC Flow Logs configuration
15462 /// for. The resource must belong to the same project as the parent. The
15463 /// resource must be a network, subnetwork, interconnect attachment, VPN
15464 /// tunnel, or a project.
15465 pub resource: std::string::String,
15466
15467 /// Optional. Number of `EffectiveVpcFlowLogsConfigs` to return. Default is 30.
15468 pub page_size: i32,
15469
15470 /// Optional. Page token from an earlier query, as returned in
15471 /// `next_page_token`.
15472 pub page_token: std::string::String,
15473
15474 /// Optional. Lists the `EffectiveVpcFlowLogsConfigs` that match the filter
15475 /// expression. A filter expression must use the supported [CEL logic
15476 /// operators]
15477 /// (<https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators>).
15478 pub filter: std::string::String,
15479
15480 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15481}
15482
15483impl ShowEffectiveFlowLogsConfigsRequest {
15484 pub fn new() -> Self {
15485 std::default::Default::default()
15486 }
15487
15488 /// Sets the value of [parent][crate::model::ShowEffectiveFlowLogsConfigsRequest::parent].
15489 ///
15490 /// # Example
15491 /// ```ignore,no_run
15492 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
15493 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_parent("example");
15494 /// ```
15495 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15496 self.parent = v.into();
15497 self
15498 }
15499
15500 /// Sets the value of [resource][crate::model::ShowEffectiveFlowLogsConfigsRequest::resource].
15501 ///
15502 /// # Example
15503 /// ```ignore,no_run
15504 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
15505 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_resource("example");
15506 /// ```
15507 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15508 self.resource = v.into();
15509 self
15510 }
15511
15512 /// Sets the value of [page_size][crate::model::ShowEffectiveFlowLogsConfigsRequest::page_size].
15513 ///
15514 /// # Example
15515 /// ```ignore,no_run
15516 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
15517 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_page_size(42);
15518 /// ```
15519 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15520 self.page_size = v.into();
15521 self
15522 }
15523
15524 /// Sets the value of [page_token][crate::model::ShowEffectiveFlowLogsConfigsRequest::page_token].
15525 ///
15526 /// # Example
15527 /// ```ignore,no_run
15528 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
15529 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_page_token("example");
15530 /// ```
15531 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15532 self.page_token = v.into();
15533 self
15534 }
15535
15536 /// Sets the value of [filter][crate::model::ShowEffectiveFlowLogsConfigsRequest::filter].
15537 ///
15538 /// # Example
15539 /// ```ignore,no_run
15540 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsRequest;
15541 /// let x = ShowEffectiveFlowLogsConfigsRequest::new().set_filter("example");
15542 /// ```
15543 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15544 self.filter = v.into();
15545 self
15546 }
15547}
15548
15549impl wkt::message::Message for ShowEffectiveFlowLogsConfigsRequest {
15550 fn typename() -> &'static str {
15551 "type.googleapis.com/google.cloud.networkmanagement.v1.ShowEffectiveFlowLogsConfigsRequest"
15552 }
15553}
15554
15555/// Response for the `ShowEffectiveFlowLogsConfigs` method.
15556#[derive(Clone, Default, PartialEq)]
15557#[non_exhaustive]
15558pub struct ShowEffectiveFlowLogsConfigsResponse {
15559 /// List of Effective Vpc Flow Logs configurations.
15560 pub effective_flow_logs_configs: std::vec::Vec<crate::model::EffectiveVpcFlowLogsConfig>,
15561
15562 /// Page token to fetch the next set of configurations.
15563 pub next_page_token: std::string::String,
15564
15565 /// Locations that could not be reached (when querying all locations with `-`).
15566 pub unreachable: std::vec::Vec<std::string::String>,
15567
15568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15569}
15570
15571impl ShowEffectiveFlowLogsConfigsResponse {
15572 pub fn new() -> Self {
15573 std::default::Default::default()
15574 }
15575
15576 /// Sets the value of [effective_flow_logs_configs][crate::model::ShowEffectiveFlowLogsConfigsResponse::effective_flow_logs_configs].
15577 ///
15578 /// # Example
15579 /// ```ignore,no_run
15580 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
15581 /// use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
15582 /// let x = ShowEffectiveFlowLogsConfigsResponse::new()
15583 /// .set_effective_flow_logs_configs([
15584 /// EffectiveVpcFlowLogsConfig::default()/* use setters */,
15585 /// EffectiveVpcFlowLogsConfig::default()/* use (different) setters */,
15586 /// ]);
15587 /// ```
15588 pub fn set_effective_flow_logs_configs<T, V>(mut self, v: T) -> Self
15589 where
15590 T: std::iter::IntoIterator<Item = V>,
15591 V: std::convert::Into<crate::model::EffectiveVpcFlowLogsConfig>,
15592 {
15593 use std::iter::Iterator;
15594 self.effective_flow_logs_configs = v.into_iter().map(|i| i.into()).collect();
15595 self
15596 }
15597
15598 /// Sets the value of [next_page_token][crate::model::ShowEffectiveFlowLogsConfigsResponse::next_page_token].
15599 ///
15600 /// # Example
15601 /// ```ignore,no_run
15602 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
15603 /// let x = ShowEffectiveFlowLogsConfigsResponse::new().set_next_page_token("example");
15604 /// ```
15605 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15606 self.next_page_token = v.into();
15607 self
15608 }
15609
15610 /// Sets the value of [unreachable][crate::model::ShowEffectiveFlowLogsConfigsResponse::unreachable].
15611 ///
15612 /// # Example
15613 /// ```ignore,no_run
15614 /// # use google_cloud_networkmanagement_v1::model::ShowEffectiveFlowLogsConfigsResponse;
15615 /// let x = ShowEffectiveFlowLogsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
15616 /// ```
15617 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
15618 where
15619 T: std::iter::IntoIterator<Item = V>,
15620 V: std::convert::Into<std::string::String>,
15621 {
15622 use std::iter::Iterator;
15623 self.unreachable = v.into_iter().map(|i| i.into()).collect();
15624 self
15625 }
15626}
15627
15628impl wkt::message::Message for ShowEffectiveFlowLogsConfigsResponse {
15629 fn typename() -> &'static str {
15630 "type.googleapis.com/google.cloud.networkmanagement.v1.ShowEffectiveFlowLogsConfigsResponse"
15631 }
15632}
15633
15634#[doc(hidden)]
15635impl gax::paginator::internal::PageableResponse for ShowEffectiveFlowLogsConfigsResponse {
15636 type PageItem = crate::model::EffectiveVpcFlowLogsConfig;
15637
15638 fn items(self) -> std::vec::Vec<Self::PageItem> {
15639 self.effective_flow_logs_configs
15640 }
15641
15642 fn next_page_token(&self) -> std::string::String {
15643 use std::clone::Clone;
15644 self.next_page_token.clone()
15645 }
15646}
15647
15648/// A configuration to generate VPC Flow Logs.
15649#[derive(Clone, Default, PartialEq)]
15650#[non_exhaustive]
15651pub struct VpcFlowLogsConfig {
15652 /// Identifier. Unique name of the configuration. The name can have one of the
15653 /// following forms:
15654 ///
15655 /// - For project-level configurations:
15656 /// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
15657 ///
15658 /// - For organization-level configurations:
15659 /// `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
15660 ///
15661 pub name: std::string::String,
15662
15663 /// Optional. The user-supplied description of the VPC Flow Logs configuration.
15664 /// Maximum of 512 characters.
15665 pub description: std::option::Option<std::string::String>,
15666
15667 /// Optional. The state of the VPC Flow Log configuration. Default value is
15668 /// ENABLED. When creating a new configuration, it must be enabled. Setting
15669 /// state=DISABLED will pause the log generation for this config.
15670 pub state: std::option::Option<crate::model::vpc_flow_logs_config::State>,
15671
15672 /// Optional. The aggregation interval for the logs. Default value is
15673 /// INTERVAL_5_SEC.
15674 pub aggregation_interval:
15675 std::option::Option<crate::model::vpc_flow_logs_config::AggregationInterval>,
15676
15677 /// Optional. The value of the field must be in (0, 1]. The sampling rate of
15678 /// VPC Flow Logs where 1.0 means all collected logs are reported. Setting the
15679 /// sampling rate to 0.0 is not allowed. If you want to disable VPC Flow Logs,
15680 /// use the state field instead. Default value is 1.0.
15681 pub flow_sampling: std::option::Option<f32>,
15682
15683 /// Optional. Configures whether all, none or a subset of metadata fields
15684 /// should be added to the reported VPC flow logs. Default value is
15685 /// INCLUDE_ALL_METADATA.
15686 pub metadata: std::option::Option<crate::model::vpc_flow_logs_config::Metadata>,
15687
15688 /// Optional. Custom metadata fields to include in the reported VPC flow logs.
15689 /// Can only be specified if "metadata" was set to CUSTOM_METADATA.
15690 pub metadata_fields: std::vec::Vec<std::string::String>,
15691
15692 /// Optional. Export filter used to define which VPC Flow Logs should be
15693 /// logged.
15694 pub filter_expr: std::option::Option<std::string::String>,
15695
15696 /// Optional. Determines whether to include cross project annotations in the
15697 /// logs. This field is available only for organization configurations. If not
15698 /// specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
15699 pub cross_project_metadata:
15700 std::option::Option<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
15701
15702 /// Output only. Describes the state of the configured target resource for
15703 /// diagnostic purposes.
15704 pub target_resource_state:
15705 std::option::Option<crate::model::vpc_flow_logs_config::TargetResourceState>,
15706
15707 /// Optional. Resource labels to represent user-provided metadata.
15708 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
15709
15710 /// Output only. The time the config was created.
15711 pub create_time: std::option::Option<wkt::Timestamp>,
15712
15713 /// Output only. The time the config was updated.
15714 pub update_time: std::option::Option<wkt::Timestamp>,
15715
15716 /// Reference to the resource of the config scope. That is, the scope from
15717 /// which traffic is logged. The target resource must belong to the same
15718 /// project as the configuration.
15719 /// This field is not supported for organization level configurations.
15720 pub target_resource: std::option::Option<crate::model::vpc_flow_logs_config::TargetResource>,
15721
15722 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15723}
15724
15725impl VpcFlowLogsConfig {
15726 pub fn new() -> Self {
15727 std::default::Default::default()
15728 }
15729
15730 /// Sets the value of [name][crate::model::VpcFlowLogsConfig::name].
15731 ///
15732 /// # Example
15733 /// ```ignore,no_run
15734 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15735 /// let x = VpcFlowLogsConfig::new().set_name("example");
15736 /// ```
15737 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15738 self.name = v.into();
15739 self
15740 }
15741
15742 /// Sets the value of [description][crate::model::VpcFlowLogsConfig::description].
15743 ///
15744 /// # Example
15745 /// ```ignore,no_run
15746 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15747 /// let x = VpcFlowLogsConfig::new().set_description("example");
15748 /// ```
15749 pub fn set_description<T>(mut self, v: T) -> Self
15750 where
15751 T: std::convert::Into<std::string::String>,
15752 {
15753 self.description = std::option::Option::Some(v.into());
15754 self
15755 }
15756
15757 /// Sets or clears the value of [description][crate::model::VpcFlowLogsConfig::description].
15758 ///
15759 /// # Example
15760 /// ```ignore,no_run
15761 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15762 /// let x = VpcFlowLogsConfig::new().set_or_clear_description(Some("example"));
15763 /// let x = VpcFlowLogsConfig::new().set_or_clear_description(None::<String>);
15764 /// ```
15765 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
15766 where
15767 T: std::convert::Into<std::string::String>,
15768 {
15769 self.description = v.map(|x| x.into());
15770 self
15771 }
15772
15773 /// Sets the value of [state][crate::model::VpcFlowLogsConfig::state].
15774 ///
15775 /// # Example
15776 /// ```ignore,no_run
15777 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15778 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
15779 /// let x0 = VpcFlowLogsConfig::new().set_state(State::Enabled);
15780 /// let x1 = VpcFlowLogsConfig::new().set_state(State::Disabled);
15781 /// ```
15782 pub fn set_state<T>(mut self, v: T) -> Self
15783 where
15784 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
15785 {
15786 self.state = std::option::Option::Some(v.into());
15787 self
15788 }
15789
15790 /// Sets or clears the value of [state][crate::model::VpcFlowLogsConfig::state].
15791 ///
15792 /// # Example
15793 /// ```ignore,no_run
15794 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15795 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
15796 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_state(Some(State::Enabled));
15797 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_state(Some(State::Disabled));
15798 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_state(None::<State>);
15799 /// ```
15800 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
15801 where
15802 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
15803 {
15804 self.state = v.map(|x| x.into());
15805 self
15806 }
15807
15808 /// Sets the value of [aggregation_interval][crate::model::VpcFlowLogsConfig::aggregation_interval].
15809 ///
15810 /// # Example
15811 /// ```ignore,no_run
15812 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15813 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
15814 /// let x0 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval5Sec);
15815 /// let x1 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval30Sec);
15816 /// let x2 = VpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval1Min);
15817 /// ```
15818 pub fn set_aggregation_interval<T>(mut self, v: T) -> Self
15819 where
15820 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
15821 {
15822 self.aggregation_interval = std::option::Option::Some(v.into());
15823 self
15824 }
15825
15826 /// Sets or clears the value of [aggregation_interval][crate::model::VpcFlowLogsConfig::aggregation_interval].
15827 ///
15828 /// # Example
15829 /// ```ignore,no_run
15830 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15831 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
15832 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval5Sec));
15833 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval30Sec));
15834 /// let x2 = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval1Min));
15835 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_aggregation_interval(None::<AggregationInterval>);
15836 /// ```
15837 pub fn set_or_clear_aggregation_interval<T>(mut self, v: std::option::Option<T>) -> Self
15838 where
15839 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
15840 {
15841 self.aggregation_interval = v.map(|x| x.into());
15842 self
15843 }
15844
15845 /// Sets the value of [flow_sampling][crate::model::VpcFlowLogsConfig::flow_sampling].
15846 ///
15847 /// # Example
15848 /// ```ignore,no_run
15849 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15850 /// let x = VpcFlowLogsConfig::new().set_flow_sampling(42.0);
15851 /// ```
15852 pub fn set_flow_sampling<T>(mut self, v: T) -> Self
15853 where
15854 T: std::convert::Into<f32>,
15855 {
15856 self.flow_sampling = std::option::Option::Some(v.into());
15857 self
15858 }
15859
15860 /// Sets or clears the value of [flow_sampling][crate::model::VpcFlowLogsConfig::flow_sampling].
15861 ///
15862 /// # Example
15863 /// ```ignore,no_run
15864 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15865 /// let x = VpcFlowLogsConfig::new().set_or_clear_flow_sampling(Some(42.0));
15866 /// let x = VpcFlowLogsConfig::new().set_or_clear_flow_sampling(None::<f32>);
15867 /// ```
15868 pub fn set_or_clear_flow_sampling<T>(mut self, v: std::option::Option<T>) -> Self
15869 where
15870 T: std::convert::Into<f32>,
15871 {
15872 self.flow_sampling = v.map(|x| x.into());
15873 self
15874 }
15875
15876 /// Sets the value of [metadata][crate::model::VpcFlowLogsConfig::metadata].
15877 ///
15878 /// # Example
15879 /// ```ignore,no_run
15880 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15881 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
15882 /// let x0 = VpcFlowLogsConfig::new().set_metadata(Metadata::IncludeAllMetadata);
15883 /// let x1 = VpcFlowLogsConfig::new().set_metadata(Metadata::ExcludeAllMetadata);
15884 /// let x2 = VpcFlowLogsConfig::new().set_metadata(Metadata::CustomMetadata);
15885 /// ```
15886 pub fn set_metadata<T>(mut self, v: T) -> Self
15887 where
15888 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
15889 {
15890 self.metadata = std::option::Option::Some(v.into());
15891 self
15892 }
15893
15894 /// Sets or clears the value of [metadata][crate::model::VpcFlowLogsConfig::metadata].
15895 ///
15896 /// # Example
15897 /// ```ignore,no_run
15898 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15899 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
15900 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::IncludeAllMetadata));
15901 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::ExcludeAllMetadata));
15902 /// let x2 = VpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::CustomMetadata));
15903 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_metadata(None::<Metadata>);
15904 /// ```
15905 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
15906 where
15907 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
15908 {
15909 self.metadata = v.map(|x| x.into());
15910 self
15911 }
15912
15913 /// Sets the value of [metadata_fields][crate::model::VpcFlowLogsConfig::metadata_fields].
15914 ///
15915 /// # Example
15916 /// ```ignore,no_run
15917 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15918 /// let x = VpcFlowLogsConfig::new().set_metadata_fields(["a", "b", "c"]);
15919 /// ```
15920 pub fn set_metadata_fields<T, V>(mut self, v: T) -> Self
15921 where
15922 T: std::iter::IntoIterator<Item = V>,
15923 V: std::convert::Into<std::string::String>,
15924 {
15925 use std::iter::Iterator;
15926 self.metadata_fields = v.into_iter().map(|i| i.into()).collect();
15927 self
15928 }
15929
15930 /// Sets the value of [filter_expr][crate::model::VpcFlowLogsConfig::filter_expr].
15931 ///
15932 /// # Example
15933 /// ```ignore,no_run
15934 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15935 /// let x = VpcFlowLogsConfig::new().set_filter_expr("example");
15936 /// ```
15937 pub fn set_filter_expr<T>(mut self, v: T) -> Self
15938 where
15939 T: std::convert::Into<std::string::String>,
15940 {
15941 self.filter_expr = std::option::Option::Some(v.into());
15942 self
15943 }
15944
15945 /// Sets or clears the value of [filter_expr][crate::model::VpcFlowLogsConfig::filter_expr].
15946 ///
15947 /// # Example
15948 /// ```ignore,no_run
15949 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15950 /// let x = VpcFlowLogsConfig::new().set_or_clear_filter_expr(Some("example"));
15951 /// let x = VpcFlowLogsConfig::new().set_or_clear_filter_expr(None::<String>);
15952 /// ```
15953 pub fn set_or_clear_filter_expr<T>(mut self, v: std::option::Option<T>) -> Self
15954 where
15955 T: std::convert::Into<std::string::String>,
15956 {
15957 self.filter_expr = v.map(|x| x.into());
15958 self
15959 }
15960
15961 /// Sets the value of [cross_project_metadata][crate::model::VpcFlowLogsConfig::cross_project_metadata].
15962 ///
15963 /// # Example
15964 /// ```ignore,no_run
15965 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15966 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
15967 /// let x0 = VpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Enabled);
15968 /// let x1 = VpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Disabled);
15969 /// ```
15970 pub fn set_cross_project_metadata<T>(mut self, v: T) -> Self
15971 where
15972 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
15973 {
15974 self.cross_project_metadata = std::option::Option::Some(v.into());
15975 self
15976 }
15977
15978 /// Sets or clears the value of [cross_project_metadata][crate::model::VpcFlowLogsConfig::cross_project_metadata].
15979 ///
15980 /// # Example
15981 /// ```ignore,no_run
15982 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
15983 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
15984 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Enabled));
15985 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Disabled));
15986 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(None::<CrossProjectMetadata>);
15987 /// ```
15988 pub fn set_or_clear_cross_project_metadata<T>(mut self, v: std::option::Option<T>) -> Self
15989 where
15990 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
15991 {
15992 self.cross_project_metadata = v.map(|x| x.into());
15993 self
15994 }
15995
15996 /// Sets the value of [target_resource_state][crate::model::VpcFlowLogsConfig::target_resource_state].
15997 ///
15998 /// # Example
15999 /// ```ignore,no_run
16000 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16001 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResourceState;
16002 /// let x0 = VpcFlowLogsConfig::new().set_target_resource_state(TargetResourceState::TargetResourceExists);
16003 /// let x1 = VpcFlowLogsConfig::new().set_target_resource_state(TargetResourceState::TargetResourceDoesNotExist);
16004 /// ```
16005 pub fn set_target_resource_state<T>(mut self, v: T) -> Self
16006 where
16007 T: std::convert::Into<crate::model::vpc_flow_logs_config::TargetResourceState>,
16008 {
16009 self.target_resource_state = std::option::Option::Some(v.into());
16010 self
16011 }
16012
16013 /// Sets or clears the value of [target_resource_state][crate::model::VpcFlowLogsConfig::target_resource_state].
16014 ///
16015 /// # Example
16016 /// ```ignore,no_run
16017 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16018 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResourceState;
16019 /// let x0 = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(Some(TargetResourceState::TargetResourceExists));
16020 /// let x1 = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(Some(TargetResourceState::TargetResourceDoesNotExist));
16021 /// let x_none = VpcFlowLogsConfig::new().set_or_clear_target_resource_state(None::<TargetResourceState>);
16022 /// ```
16023 pub fn set_or_clear_target_resource_state<T>(mut self, v: std::option::Option<T>) -> Self
16024 where
16025 T: std::convert::Into<crate::model::vpc_flow_logs_config::TargetResourceState>,
16026 {
16027 self.target_resource_state = v.map(|x| x.into());
16028 self
16029 }
16030
16031 /// Sets the value of [labels][crate::model::VpcFlowLogsConfig::labels].
16032 ///
16033 /// # Example
16034 /// ```ignore,no_run
16035 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16036 /// let x = VpcFlowLogsConfig::new().set_labels([
16037 /// ("key0", "abc"),
16038 /// ("key1", "xyz"),
16039 /// ]);
16040 /// ```
16041 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16042 where
16043 T: std::iter::IntoIterator<Item = (K, V)>,
16044 K: std::convert::Into<std::string::String>,
16045 V: std::convert::Into<std::string::String>,
16046 {
16047 use std::iter::Iterator;
16048 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16049 self
16050 }
16051
16052 /// Sets the value of [create_time][crate::model::VpcFlowLogsConfig::create_time].
16053 ///
16054 /// # Example
16055 /// ```ignore,no_run
16056 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16057 /// use wkt::Timestamp;
16058 /// let x = VpcFlowLogsConfig::new().set_create_time(Timestamp::default()/* use setters */);
16059 /// ```
16060 pub fn set_create_time<T>(mut self, v: T) -> Self
16061 where
16062 T: std::convert::Into<wkt::Timestamp>,
16063 {
16064 self.create_time = std::option::Option::Some(v.into());
16065 self
16066 }
16067
16068 /// Sets or clears the value of [create_time][crate::model::VpcFlowLogsConfig::create_time].
16069 ///
16070 /// # Example
16071 /// ```ignore,no_run
16072 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16073 /// use wkt::Timestamp;
16074 /// let x = VpcFlowLogsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16075 /// let x = VpcFlowLogsConfig::new().set_or_clear_create_time(None::<Timestamp>);
16076 /// ```
16077 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16078 where
16079 T: std::convert::Into<wkt::Timestamp>,
16080 {
16081 self.create_time = v.map(|x| x.into());
16082 self
16083 }
16084
16085 /// Sets the value of [update_time][crate::model::VpcFlowLogsConfig::update_time].
16086 ///
16087 /// # Example
16088 /// ```ignore,no_run
16089 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16090 /// use wkt::Timestamp;
16091 /// let x = VpcFlowLogsConfig::new().set_update_time(Timestamp::default()/* use setters */);
16092 /// ```
16093 pub fn set_update_time<T>(mut self, v: T) -> Self
16094 where
16095 T: std::convert::Into<wkt::Timestamp>,
16096 {
16097 self.update_time = std::option::Option::Some(v.into());
16098 self
16099 }
16100
16101 /// Sets or clears the value of [update_time][crate::model::VpcFlowLogsConfig::update_time].
16102 ///
16103 /// # Example
16104 /// ```ignore,no_run
16105 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16106 /// use wkt::Timestamp;
16107 /// let x = VpcFlowLogsConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16108 /// let x = VpcFlowLogsConfig::new().set_or_clear_update_time(None::<Timestamp>);
16109 /// ```
16110 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16111 where
16112 T: std::convert::Into<wkt::Timestamp>,
16113 {
16114 self.update_time = v.map(|x| x.into());
16115 self
16116 }
16117
16118 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource].
16119 ///
16120 /// Note that all the setters affecting `target_resource` are mutually
16121 /// exclusive.
16122 ///
16123 /// # Example
16124 /// ```ignore,no_run
16125 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16126 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::TargetResource;
16127 /// let x = VpcFlowLogsConfig::new().set_target_resource(Some(TargetResource::Network("example".to_string())));
16128 /// ```
16129 pub fn set_target_resource<
16130 T: std::convert::Into<std::option::Option<crate::model::vpc_flow_logs_config::TargetResource>>,
16131 >(
16132 mut self,
16133 v: T,
16134 ) -> Self {
16135 self.target_resource = v.into();
16136 self
16137 }
16138
16139 /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
16140 /// if it holds a `Network`, `None` if the field is not set or
16141 /// holds a different branch.
16142 pub fn network(&self) -> std::option::Option<&std::string::String> {
16143 #[allow(unreachable_patterns)]
16144 self.target_resource.as_ref().and_then(|v| match v {
16145 crate::model::vpc_flow_logs_config::TargetResource::Network(v) => {
16146 std::option::Option::Some(v)
16147 }
16148 _ => std::option::Option::None,
16149 })
16150 }
16151
16152 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
16153 /// to hold a `Network`.
16154 ///
16155 /// Note that all the setters affecting `target_resource` are
16156 /// mutually exclusive.
16157 ///
16158 /// # Example
16159 /// ```ignore,no_run
16160 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16161 /// let x = VpcFlowLogsConfig::new().set_network("example");
16162 /// assert!(x.network().is_some());
16163 /// assert!(x.subnet().is_none());
16164 /// assert!(x.interconnect_attachment().is_none());
16165 /// assert!(x.vpn_tunnel().is_none());
16166 /// ```
16167 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16168 self.target_resource = std::option::Option::Some(
16169 crate::model::vpc_flow_logs_config::TargetResource::Network(v.into()),
16170 );
16171 self
16172 }
16173
16174 /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
16175 /// if it holds a `Subnet`, `None` if the field is not set or
16176 /// holds a different branch.
16177 pub fn subnet(&self) -> std::option::Option<&std::string::String> {
16178 #[allow(unreachable_patterns)]
16179 self.target_resource.as_ref().and_then(|v| match v {
16180 crate::model::vpc_flow_logs_config::TargetResource::Subnet(v) => {
16181 std::option::Option::Some(v)
16182 }
16183 _ => std::option::Option::None,
16184 })
16185 }
16186
16187 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
16188 /// to hold a `Subnet`.
16189 ///
16190 /// Note that all the setters affecting `target_resource` are
16191 /// mutually exclusive.
16192 ///
16193 /// # Example
16194 /// ```ignore,no_run
16195 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16196 /// let x = VpcFlowLogsConfig::new().set_subnet("example");
16197 /// assert!(x.subnet().is_some());
16198 /// assert!(x.network().is_none());
16199 /// assert!(x.interconnect_attachment().is_none());
16200 /// assert!(x.vpn_tunnel().is_none());
16201 /// ```
16202 pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16203 self.target_resource = std::option::Option::Some(
16204 crate::model::vpc_flow_logs_config::TargetResource::Subnet(v.into()),
16205 );
16206 self
16207 }
16208
16209 /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
16210 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
16211 /// holds a different branch.
16212 pub fn interconnect_attachment(&self) -> std::option::Option<&std::string::String> {
16213 #[allow(unreachable_patterns)]
16214 self.target_resource.as_ref().and_then(|v| match v {
16215 crate::model::vpc_flow_logs_config::TargetResource::InterconnectAttachment(v) => {
16216 std::option::Option::Some(v)
16217 }
16218 _ => std::option::Option::None,
16219 })
16220 }
16221
16222 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
16223 /// to hold a `InterconnectAttachment`.
16224 ///
16225 /// Note that all the setters affecting `target_resource` are
16226 /// mutually exclusive.
16227 ///
16228 /// # Example
16229 /// ```ignore,no_run
16230 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16231 /// let x = VpcFlowLogsConfig::new().set_interconnect_attachment("example");
16232 /// assert!(x.interconnect_attachment().is_some());
16233 /// assert!(x.network().is_none());
16234 /// assert!(x.subnet().is_none());
16235 /// assert!(x.vpn_tunnel().is_none());
16236 /// ```
16237 pub fn set_interconnect_attachment<T: std::convert::Into<std::string::String>>(
16238 mut self,
16239 v: T,
16240 ) -> Self {
16241 self.target_resource = std::option::Option::Some(
16242 crate::model::vpc_flow_logs_config::TargetResource::InterconnectAttachment(v.into()),
16243 );
16244 self
16245 }
16246
16247 /// The value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
16248 /// if it holds a `VpnTunnel`, `None` if the field is not set or
16249 /// holds a different branch.
16250 pub fn vpn_tunnel(&self) -> std::option::Option<&std::string::String> {
16251 #[allow(unreachable_patterns)]
16252 self.target_resource.as_ref().and_then(|v| match v {
16253 crate::model::vpc_flow_logs_config::TargetResource::VpnTunnel(v) => {
16254 std::option::Option::Some(v)
16255 }
16256 _ => std::option::Option::None,
16257 })
16258 }
16259
16260 /// Sets the value of [target_resource][crate::model::VpcFlowLogsConfig::target_resource]
16261 /// to hold a `VpnTunnel`.
16262 ///
16263 /// Note that all the setters affecting `target_resource` are
16264 /// mutually exclusive.
16265 ///
16266 /// # Example
16267 /// ```ignore,no_run
16268 /// # use google_cloud_networkmanagement_v1::model::VpcFlowLogsConfig;
16269 /// let x = VpcFlowLogsConfig::new().set_vpn_tunnel("example");
16270 /// assert!(x.vpn_tunnel().is_some());
16271 /// assert!(x.network().is_none());
16272 /// assert!(x.subnet().is_none());
16273 /// assert!(x.interconnect_attachment().is_none());
16274 /// ```
16275 pub fn set_vpn_tunnel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16276 self.target_resource = std::option::Option::Some(
16277 crate::model::vpc_flow_logs_config::TargetResource::VpnTunnel(v.into()),
16278 );
16279 self
16280 }
16281}
16282
16283impl wkt::message::Message for VpcFlowLogsConfig {
16284 fn typename() -> &'static str {
16285 "type.googleapis.com/google.cloud.networkmanagement.v1.VpcFlowLogsConfig"
16286 }
16287}
16288
16289/// Defines additional types related to [VpcFlowLogsConfig].
16290pub mod vpc_flow_logs_config {
16291 #[allow(unused_imports)]
16292 use super::*;
16293
16294 /// Determines whether this configuration will be generating logs.
16295 ///
16296 /// # Working with unknown values
16297 ///
16298 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16299 /// additional enum variants at any time. Adding new variants is not considered
16300 /// a breaking change. Applications should write their code in anticipation of:
16301 ///
16302 /// - New values appearing in future releases of the client library, **and**
16303 /// - New values received dynamically, without application changes.
16304 ///
16305 /// Please consult the [Working with enums] section in the user guide for some
16306 /// guidelines.
16307 ///
16308 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16309 #[derive(Clone, Debug, PartialEq)]
16310 #[non_exhaustive]
16311 pub enum State {
16312 /// If not specified, will default to ENABLED.
16313 Unspecified,
16314 /// When ENABLED, this configuration will generate logs.
16315 Enabled,
16316 /// When DISABLED, this configuration will not generate logs.
16317 Disabled,
16318 /// If set, the enum was initialized with an unknown value.
16319 ///
16320 /// Applications can examine the value using [State::value] or
16321 /// [State::name].
16322 UnknownValue(state::UnknownValue),
16323 }
16324
16325 #[doc(hidden)]
16326 pub mod state {
16327 #[allow(unused_imports)]
16328 use super::*;
16329 #[derive(Clone, Debug, PartialEq)]
16330 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16331 }
16332
16333 impl State {
16334 /// Gets the enum value.
16335 ///
16336 /// Returns `None` if the enum contains an unknown value deserialized from
16337 /// the string representation of enums.
16338 pub fn value(&self) -> std::option::Option<i32> {
16339 match self {
16340 Self::Unspecified => std::option::Option::Some(0),
16341 Self::Enabled => std::option::Option::Some(1),
16342 Self::Disabled => std::option::Option::Some(2),
16343 Self::UnknownValue(u) => u.0.value(),
16344 }
16345 }
16346
16347 /// Gets the enum value as a string.
16348 ///
16349 /// Returns `None` if the enum contains an unknown value deserialized from
16350 /// the integer representation of enums.
16351 pub fn name(&self) -> std::option::Option<&str> {
16352 match self {
16353 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16354 Self::Enabled => std::option::Option::Some("ENABLED"),
16355 Self::Disabled => std::option::Option::Some("DISABLED"),
16356 Self::UnknownValue(u) => u.0.name(),
16357 }
16358 }
16359 }
16360
16361 impl std::default::Default for State {
16362 fn default() -> Self {
16363 use std::convert::From;
16364 Self::from(0)
16365 }
16366 }
16367
16368 impl std::fmt::Display for State {
16369 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16370 wkt::internal::display_enum(f, self.name(), self.value())
16371 }
16372 }
16373
16374 impl std::convert::From<i32> for State {
16375 fn from(value: i32) -> Self {
16376 match value {
16377 0 => Self::Unspecified,
16378 1 => Self::Enabled,
16379 2 => Self::Disabled,
16380 _ => Self::UnknownValue(state::UnknownValue(
16381 wkt::internal::UnknownEnumValue::Integer(value),
16382 )),
16383 }
16384 }
16385 }
16386
16387 impl std::convert::From<&str> for State {
16388 fn from(value: &str) -> Self {
16389 use std::string::ToString;
16390 match value {
16391 "STATE_UNSPECIFIED" => Self::Unspecified,
16392 "ENABLED" => Self::Enabled,
16393 "DISABLED" => Self::Disabled,
16394 _ => Self::UnknownValue(state::UnknownValue(
16395 wkt::internal::UnknownEnumValue::String(value.to_string()),
16396 )),
16397 }
16398 }
16399 }
16400
16401 impl serde::ser::Serialize for State {
16402 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16403 where
16404 S: serde::Serializer,
16405 {
16406 match self {
16407 Self::Unspecified => serializer.serialize_i32(0),
16408 Self::Enabled => serializer.serialize_i32(1),
16409 Self::Disabled => serializer.serialize_i32(2),
16410 Self::UnknownValue(u) => u.0.serialize(serializer),
16411 }
16412 }
16413 }
16414
16415 impl<'de> serde::de::Deserialize<'de> for State {
16416 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16417 where
16418 D: serde::Deserializer<'de>,
16419 {
16420 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16421 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.State",
16422 ))
16423 }
16424 }
16425
16426 /// Toggles the aggregation interval for collecting flow logs by 5-tuple.
16427 ///
16428 /// # Working with unknown values
16429 ///
16430 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16431 /// additional enum variants at any time. Adding new variants is not considered
16432 /// a breaking change. Applications should write their code in anticipation of:
16433 ///
16434 /// - New values appearing in future releases of the client library, **and**
16435 /// - New values received dynamically, without application changes.
16436 ///
16437 /// Please consult the [Working with enums] section in the user guide for some
16438 /// guidelines.
16439 ///
16440 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16441 #[derive(Clone, Debug, PartialEq)]
16442 #[non_exhaustive]
16443 pub enum AggregationInterval {
16444 /// If not specified, will default to INTERVAL_5_SEC.
16445 Unspecified,
16446 /// Aggregate logs in 5s intervals.
16447 Interval5Sec,
16448 /// Aggregate logs in 30s intervals.
16449 Interval30Sec,
16450 /// Aggregate logs in 1m intervals.
16451 Interval1Min,
16452 /// Aggregate logs in 5m intervals.
16453 Interval5Min,
16454 /// Aggregate logs in 10m intervals.
16455 Interval10Min,
16456 /// Aggregate logs in 15m intervals.
16457 Interval15Min,
16458 /// If set, the enum was initialized with an unknown value.
16459 ///
16460 /// Applications can examine the value using [AggregationInterval::value] or
16461 /// [AggregationInterval::name].
16462 UnknownValue(aggregation_interval::UnknownValue),
16463 }
16464
16465 #[doc(hidden)]
16466 pub mod aggregation_interval {
16467 #[allow(unused_imports)]
16468 use super::*;
16469 #[derive(Clone, Debug, PartialEq)]
16470 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16471 }
16472
16473 impl AggregationInterval {
16474 /// Gets the enum value.
16475 ///
16476 /// Returns `None` if the enum contains an unknown value deserialized from
16477 /// the string representation of enums.
16478 pub fn value(&self) -> std::option::Option<i32> {
16479 match self {
16480 Self::Unspecified => std::option::Option::Some(0),
16481 Self::Interval5Sec => std::option::Option::Some(1),
16482 Self::Interval30Sec => std::option::Option::Some(2),
16483 Self::Interval1Min => std::option::Option::Some(3),
16484 Self::Interval5Min => std::option::Option::Some(4),
16485 Self::Interval10Min => std::option::Option::Some(5),
16486 Self::Interval15Min => std::option::Option::Some(6),
16487 Self::UnknownValue(u) => u.0.value(),
16488 }
16489 }
16490
16491 /// Gets the enum value as a string.
16492 ///
16493 /// Returns `None` if the enum contains an unknown value deserialized from
16494 /// the integer representation of enums.
16495 pub fn name(&self) -> std::option::Option<&str> {
16496 match self {
16497 Self::Unspecified => std::option::Option::Some("AGGREGATION_INTERVAL_UNSPECIFIED"),
16498 Self::Interval5Sec => std::option::Option::Some("INTERVAL_5_SEC"),
16499 Self::Interval30Sec => std::option::Option::Some("INTERVAL_30_SEC"),
16500 Self::Interval1Min => std::option::Option::Some("INTERVAL_1_MIN"),
16501 Self::Interval5Min => std::option::Option::Some("INTERVAL_5_MIN"),
16502 Self::Interval10Min => std::option::Option::Some("INTERVAL_10_MIN"),
16503 Self::Interval15Min => std::option::Option::Some("INTERVAL_15_MIN"),
16504 Self::UnknownValue(u) => u.0.name(),
16505 }
16506 }
16507 }
16508
16509 impl std::default::Default for AggregationInterval {
16510 fn default() -> Self {
16511 use std::convert::From;
16512 Self::from(0)
16513 }
16514 }
16515
16516 impl std::fmt::Display for AggregationInterval {
16517 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16518 wkt::internal::display_enum(f, self.name(), self.value())
16519 }
16520 }
16521
16522 impl std::convert::From<i32> for AggregationInterval {
16523 fn from(value: i32) -> Self {
16524 match value {
16525 0 => Self::Unspecified,
16526 1 => Self::Interval5Sec,
16527 2 => Self::Interval30Sec,
16528 3 => Self::Interval1Min,
16529 4 => Self::Interval5Min,
16530 5 => Self::Interval10Min,
16531 6 => Self::Interval15Min,
16532 _ => Self::UnknownValue(aggregation_interval::UnknownValue(
16533 wkt::internal::UnknownEnumValue::Integer(value),
16534 )),
16535 }
16536 }
16537 }
16538
16539 impl std::convert::From<&str> for AggregationInterval {
16540 fn from(value: &str) -> Self {
16541 use std::string::ToString;
16542 match value {
16543 "AGGREGATION_INTERVAL_UNSPECIFIED" => Self::Unspecified,
16544 "INTERVAL_5_SEC" => Self::Interval5Sec,
16545 "INTERVAL_30_SEC" => Self::Interval30Sec,
16546 "INTERVAL_1_MIN" => Self::Interval1Min,
16547 "INTERVAL_5_MIN" => Self::Interval5Min,
16548 "INTERVAL_10_MIN" => Self::Interval10Min,
16549 "INTERVAL_15_MIN" => Self::Interval15Min,
16550 _ => Self::UnknownValue(aggregation_interval::UnknownValue(
16551 wkt::internal::UnknownEnumValue::String(value.to_string()),
16552 )),
16553 }
16554 }
16555 }
16556
16557 impl serde::ser::Serialize for AggregationInterval {
16558 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16559 where
16560 S: serde::Serializer,
16561 {
16562 match self {
16563 Self::Unspecified => serializer.serialize_i32(0),
16564 Self::Interval5Sec => serializer.serialize_i32(1),
16565 Self::Interval30Sec => serializer.serialize_i32(2),
16566 Self::Interval1Min => serializer.serialize_i32(3),
16567 Self::Interval5Min => serializer.serialize_i32(4),
16568 Self::Interval10Min => serializer.serialize_i32(5),
16569 Self::Interval15Min => serializer.serialize_i32(6),
16570 Self::UnknownValue(u) => u.0.serialize(serializer),
16571 }
16572 }
16573 }
16574
16575 impl<'de> serde::de::Deserialize<'de> for AggregationInterval {
16576 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16577 where
16578 D: serde::Deserializer<'de>,
16579 {
16580 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AggregationInterval>::new(
16581 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.AggregationInterval",
16582 ))
16583 }
16584 }
16585
16586 /// Configures which log fields would be included.
16587 ///
16588 /// # Working with unknown values
16589 ///
16590 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16591 /// additional enum variants at any time. Adding new variants is not considered
16592 /// a breaking change. Applications should write their code in anticipation of:
16593 ///
16594 /// - New values appearing in future releases of the client library, **and**
16595 /// - New values received dynamically, without application changes.
16596 ///
16597 /// Please consult the [Working with enums] section in the user guide for some
16598 /// guidelines.
16599 ///
16600 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16601 #[derive(Clone, Debug, PartialEq)]
16602 #[non_exhaustive]
16603 pub enum Metadata {
16604 /// If not specified, will default to INCLUDE_ALL_METADATA.
16605 Unspecified,
16606 /// Include all metadata fields.
16607 IncludeAllMetadata,
16608 /// Exclude all metadata fields.
16609 ExcludeAllMetadata,
16610 /// Include only custom fields (specified in metadata_fields).
16611 CustomMetadata,
16612 /// If set, the enum was initialized with an unknown value.
16613 ///
16614 /// Applications can examine the value using [Metadata::value] or
16615 /// [Metadata::name].
16616 UnknownValue(metadata::UnknownValue),
16617 }
16618
16619 #[doc(hidden)]
16620 pub mod metadata {
16621 #[allow(unused_imports)]
16622 use super::*;
16623 #[derive(Clone, Debug, PartialEq)]
16624 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16625 }
16626
16627 impl Metadata {
16628 /// Gets the enum value.
16629 ///
16630 /// Returns `None` if the enum contains an unknown value deserialized from
16631 /// the string representation of enums.
16632 pub fn value(&self) -> std::option::Option<i32> {
16633 match self {
16634 Self::Unspecified => std::option::Option::Some(0),
16635 Self::IncludeAllMetadata => std::option::Option::Some(1),
16636 Self::ExcludeAllMetadata => std::option::Option::Some(2),
16637 Self::CustomMetadata => std::option::Option::Some(3),
16638 Self::UnknownValue(u) => u.0.value(),
16639 }
16640 }
16641
16642 /// Gets the enum value as a string.
16643 ///
16644 /// Returns `None` if the enum contains an unknown value deserialized from
16645 /// the integer representation of enums.
16646 pub fn name(&self) -> std::option::Option<&str> {
16647 match self {
16648 Self::Unspecified => std::option::Option::Some("METADATA_UNSPECIFIED"),
16649 Self::IncludeAllMetadata => std::option::Option::Some("INCLUDE_ALL_METADATA"),
16650 Self::ExcludeAllMetadata => std::option::Option::Some("EXCLUDE_ALL_METADATA"),
16651 Self::CustomMetadata => std::option::Option::Some("CUSTOM_METADATA"),
16652 Self::UnknownValue(u) => u.0.name(),
16653 }
16654 }
16655 }
16656
16657 impl std::default::Default for Metadata {
16658 fn default() -> Self {
16659 use std::convert::From;
16660 Self::from(0)
16661 }
16662 }
16663
16664 impl std::fmt::Display for Metadata {
16665 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16666 wkt::internal::display_enum(f, self.name(), self.value())
16667 }
16668 }
16669
16670 impl std::convert::From<i32> for Metadata {
16671 fn from(value: i32) -> Self {
16672 match value {
16673 0 => Self::Unspecified,
16674 1 => Self::IncludeAllMetadata,
16675 2 => Self::ExcludeAllMetadata,
16676 3 => Self::CustomMetadata,
16677 _ => Self::UnknownValue(metadata::UnknownValue(
16678 wkt::internal::UnknownEnumValue::Integer(value),
16679 )),
16680 }
16681 }
16682 }
16683
16684 impl std::convert::From<&str> for Metadata {
16685 fn from(value: &str) -> Self {
16686 use std::string::ToString;
16687 match value {
16688 "METADATA_UNSPECIFIED" => Self::Unspecified,
16689 "INCLUDE_ALL_METADATA" => Self::IncludeAllMetadata,
16690 "EXCLUDE_ALL_METADATA" => Self::ExcludeAllMetadata,
16691 "CUSTOM_METADATA" => Self::CustomMetadata,
16692 _ => Self::UnknownValue(metadata::UnknownValue(
16693 wkt::internal::UnknownEnumValue::String(value.to_string()),
16694 )),
16695 }
16696 }
16697 }
16698
16699 impl serde::ser::Serialize for Metadata {
16700 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16701 where
16702 S: serde::Serializer,
16703 {
16704 match self {
16705 Self::Unspecified => serializer.serialize_i32(0),
16706 Self::IncludeAllMetadata => serializer.serialize_i32(1),
16707 Self::ExcludeAllMetadata => serializer.serialize_i32(2),
16708 Self::CustomMetadata => serializer.serialize_i32(3),
16709 Self::UnknownValue(u) => u.0.serialize(serializer),
16710 }
16711 }
16712 }
16713
16714 impl<'de> serde::de::Deserialize<'de> for Metadata {
16715 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16716 where
16717 D: serde::Deserializer<'de>,
16718 {
16719 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Metadata>::new(
16720 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.Metadata",
16721 ))
16722 }
16723 }
16724
16725 /// Determines whether to include cross project annotations in the logs.
16726 /// Project configurations will always have CROSS_PROJECT_METADATA_DISABLED.
16727 ///
16728 /// # Working with unknown values
16729 ///
16730 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16731 /// additional enum variants at any time. Adding new variants is not considered
16732 /// a breaking change. Applications should write their code in anticipation of:
16733 ///
16734 /// - New values appearing in future releases of the client library, **and**
16735 /// - New values received dynamically, without application changes.
16736 ///
16737 /// Please consult the [Working with enums] section in the user guide for some
16738 /// guidelines.
16739 ///
16740 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16741 #[derive(Clone, Debug, PartialEq)]
16742 #[non_exhaustive]
16743 pub enum CrossProjectMetadata {
16744 /// If not specified, the default is CROSS_PROJECT_METADATA_ENABLED.
16745 Unspecified,
16746 /// When CROSS_PROJECT_METADATA_ENABLED, metadata from other projects will be
16747 /// included in the logs.
16748 Enabled,
16749 /// When CROSS_PROJECT_METADATA_DISABLED, metadata from other projects will
16750 /// not be included in the logs.
16751 Disabled,
16752 /// If set, the enum was initialized with an unknown value.
16753 ///
16754 /// Applications can examine the value using [CrossProjectMetadata::value] or
16755 /// [CrossProjectMetadata::name].
16756 UnknownValue(cross_project_metadata::UnknownValue),
16757 }
16758
16759 #[doc(hidden)]
16760 pub mod cross_project_metadata {
16761 #[allow(unused_imports)]
16762 use super::*;
16763 #[derive(Clone, Debug, PartialEq)]
16764 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16765 }
16766
16767 impl CrossProjectMetadata {
16768 /// Gets the enum value.
16769 ///
16770 /// Returns `None` if the enum contains an unknown value deserialized from
16771 /// the string representation of enums.
16772 pub fn value(&self) -> std::option::Option<i32> {
16773 match self {
16774 Self::Unspecified => std::option::Option::Some(0),
16775 Self::Enabled => std::option::Option::Some(1),
16776 Self::Disabled => std::option::Option::Some(2),
16777 Self::UnknownValue(u) => u.0.value(),
16778 }
16779 }
16780
16781 /// Gets the enum value as a string.
16782 ///
16783 /// Returns `None` if the enum contains an unknown value deserialized from
16784 /// the integer representation of enums.
16785 pub fn name(&self) -> std::option::Option<&str> {
16786 match self {
16787 Self::Unspecified => {
16788 std::option::Option::Some("CROSS_PROJECT_METADATA_UNSPECIFIED")
16789 }
16790 Self::Enabled => std::option::Option::Some("CROSS_PROJECT_METADATA_ENABLED"),
16791 Self::Disabled => std::option::Option::Some("CROSS_PROJECT_METADATA_DISABLED"),
16792 Self::UnknownValue(u) => u.0.name(),
16793 }
16794 }
16795 }
16796
16797 impl std::default::Default for CrossProjectMetadata {
16798 fn default() -> Self {
16799 use std::convert::From;
16800 Self::from(0)
16801 }
16802 }
16803
16804 impl std::fmt::Display for CrossProjectMetadata {
16805 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16806 wkt::internal::display_enum(f, self.name(), self.value())
16807 }
16808 }
16809
16810 impl std::convert::From<i32> for CrossProjectMetadata {
16811 fn from(value: i32) -> Self {
16812 match value {
16813 0 => Self::Unspecified,
16814 1 => Self::Enabled,
16815 2 => Self::Disabled,
16816 _ => Self::UnknownValue(cross_project_metadata::UnknownValue(
16817 wkt::internal::UnknownEnumValue::Integer(value),
16818 )),
16819 }
16820 }
16821 }
16822
16823 impl std::convert::From<&str> for CrossProjectMetadata {
16824 fn from(value: &str) -> Self {
16825 use std::string::ToString;
16826 match value {
16827 "CROSS_PROJECT_METADATA_UNSPECIFIED" => Self::Unspecified,
16828 "CROSS_PROJECT_METADATA_ENABLED" => Self::Enabled,
16829 "CROSS_PROJECT_METADATA_DISABLED" => Self::Disabled,
16830 _ => Self::UnknownValue(cross_project_metadata::UnknownValue(
16831 wkt::internal::UnknownEnumValue::String(value.to_string()),
16832 )),
16833 }
16834 }
16835 }
16836
16837 impl serde::ser::Serialize for CrossProjectMetadata {
16838 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16839 where
16840 S: serde::Serializer,
16841 {
16842 match self {
16843 Self::Unspecified => serializer.serialize_i32(0),
16844 Self::Enabled => serializer.serialize_i32(1),
16845 Self::Disabled => serializer.serialize_i32(2),
16846 Self::UnknownValue(u) => u.0.serialize(serializer),
16847 }
16848 }
16849 }
16850
16851 impl<'de> serde::de::Deserialize<'de> for CrossProjectMetadata {
16852 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16853 where
16854 D: serde::Deserializer<'de>,
16855 {
16856 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CrossProjectMetadata>::new(
16857 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.CrossProjectMetadata",
16858 ))
16859 }
16860 }
16861
16862 /// Output only. Indicates whether the target resource exists, for diagnostic
16863 /// purposes.
16864 ///
16865 /// # Working with unknown values
16866 ///
16867 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16868 /// additional enum variants at any time. Adding new variants is not considered
16869 /// a breaking change. Applications should write their code in anticipation of:
16870 ///
16871 /// - New values appearing in future releases of the client library, **and**
16872 /// - New values received dynamically, without application changes.
16873 ///
16874 /// Please consult the [Working with enums] section in the user guide for some
16875 /// guidelines.
16876 ///
16877 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16878 #[derive(Clone, Debug, PartialEq)]
16879 #[non_exhaustive]
16880 pub enum TargetResourceState {
16881 /// Unspecified target resource state.
16882 Unspecified,
16883 /// Indicates that the target resource exists.
16884 TargetResourceExists,
16885 /// Indicates that the target resource does not exist.
16886 TargetResourceDoesNotExist,
16887 /// If set, the enum was initialized with an unknown value.
16888 ///
16889 /// Applications can examine the value using [TargetResourceState::value] or
16890 /// [TargetResourceState::name].
16891 UnknownValue(target_resource_state::UnknownValue),
16892 }
16893
16894 #[doc(hidden)]
16895 pub mod target_resource_state {
16896 #[allow(unused_imports)]
16897 use super::*;
16898 #[derive(Clone, Debug, PartialEq)]
16899 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16900 }
16901
16902 impl TargetResourceState {
16903 /// Gets the enum value.
16904 ///
16905 /// Returns `None` if the enum contains an unknown value deserialized from
16906 /// the string representation of enums.
16907 pub fn value(&self) -> std::option::Option<i32> {
16908 match self {
16909 Self::Unspecified => std::option::Option::Some(0),
16910 Self::TargetResourceExists => std::option::Option::Some(1),
16911 Self::TargetResourceDoesNotExist => std::option::Option::Some(2),
16912 Self::UnknownValue(u) => u.0.value(),
16913 }
16914 }
16915
16916 /// Gets the enum value as a string.
16917 ///
16918 /// Returns `None` if the enum contains an unknown value deserialized from
16919 /// the integer representation of enums.
16920 pub fn name(&self) -> std::option::Option<&str> {
16921 match self {
16922 Self::Unspecified => std::option::Option::Some("TARGET_RESOURCE_STATE_UNSPECIFIED"),
16923 Self::TargetResourceExists => std::option::Option::Some("TARGET_RESOURCE_EXISTS"),
16924 Self::TargetResourceDoesNotExist => {
16925 std::option::Option::Some("TARGET_RESOURCE_DOES_NOT_EXIST")
16926 }
16927 Self::UnknownValue(u) => u.0.name(),
16928 }
16929 }
16930 }
16931
16932 impl std::default::Default for TargetResourceState {
16933 fn default() -> Self {
16934 use std::convert::From;
16935 Self::from(0)
16936 }
16937 }
16938
16939 impl std::fmt::Display for TargetResourceState {
16940 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16941 wkt::internal::display_enum(f, self.name(), self.value())
16942 }
16943 }
16944
16945 impl std::convert::From<i32> for TargetResourceState {
16946 fn from(value: i32) -> Self {
16947 match value {
16948 0 => Self::Unspecified,
16949 1 => Self::TargetResourceExists,
16950 2 => Self::TargetResourceDoesNotExist,
16951 _ => Self::UnknownValue(target_resource_state::UnknownValue(
16952 wkt::internal::UnknownEnumValue::Integer(value),
16953 )),
16954 }
16955 }
16956 }
16957
16958 impl std::convert::From<&str> for TargetResourceState {
16959 fn from(value: &str) -> Self {
16960 use std::string::ToString;
16961 match value {
16962 "TARGET_RESOURCE_STATE_UNSPECIFIED" => Self::Unspecified,
16963 "TARGET_RESOURCE_EXISTS" => Self::TargetResourceExists,
16964 "TARGET_RESOURCE_DOES_NOT_EXIST" => Self::TargetResourceDoesNotExist,
16965 _ => Self::UnknownValue(target_resource_state::UnknownValue(
16966 wkt::internal::UnknownEnumValue::String(value.to_string()),
16967 )),
16968 }
16969 }
16970 }
16971
16972 impl serde::ser::Serialize for TargetResourceState {
16973 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16974 where
16975 S: serde::Serializer,
16976 {
16977 match self {
16978 Self::Unspecified => serializer.serialize_i32(0),
16979 Self::TargetResourceExists => serializer.serialize_i32(1),
16980 Self::TargetResourceDoesNotExist => serializer.serialize_i32(2),
16981 Self::UnknownValue(u) => u.0.serialize(serializer),
16982 }
16983 }
16984 }
16985
16986 impl<'de> serde::de::Deserialize<'de> for TargetResourceState {
16987 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16988 where
16989 D: serde::Deserializer<'de>,
16990 {
16991 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetResourceState>::new(
16992 ".google.cloud.networkmanagement.v1.VpcFlowLogsConfig.TargetResourceState",
16993 ))
16994 }
16995 }
16996
16997 /// Reference to the resource of the config scope. That is, the scope from
16998 /// which traffic is logged. The target resource must belong to the same
16999 /// project as the configuration.
17000 /// This field is not supported for organization level configurations.
17001 #[derive(Clone, Debug, PartialEq)]
17002 #[non_exhaustive]
17003 pub enum TargetResource {
17004 /// Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
17005 /// within the network.
17006 /// Format: projects/{project_id}/global/networks/{name}
17007 Network(std::string::String),
17008 /// Traffic will be logged from VMs within the subnetwork.
17009 /// Format: projects/{project_id}/regions/{region}/subnetworks/{name}
17010 Subnet(std::string::String),
17011 /// Traffic will be logged from the Interconnect Attachment.
17012 /// Format:
17013 /// projects/{project_id}/regions/{region}/interconnectAttachments/{name}
17014 InterconnectAttachment(std::string::String),
17015 /// Traffic will be logged from the VPN Tunnel.
17016 /// Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
17017 VpnTunnel(std::string::String),
17018 }
17019}
17020
17021/// A configuration to generate a response for GetEffectiveVpcFlowLogsConfig
17022/// request.
17023#[derive(Clone, Default, PartialEq)]
17024#[non_exhaustive]
17025pub struct EffectiveVpcFlowLogsConfig {
17026 /// Unique name of the configuration. The name can have one of the following
17027 /// forms:
17028 ///
17029 /// - For project-level configurations:
17030 /// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
17031 ///
17032 /// - For organization-level configurations:
17033 /// `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
17034 ///
17035 /// - For a Compute config, the name will be the path of the subnet:
17036 /// `projects/{project_id}/regions/{region}/subnetworks/{subnet_id}`
17037 ///
17038 pub name: std::string::String,
17039
17040 /// The state of the VPC Flow Log configuration. Default value is ENABLED.
17041 /// When creating a new configuration, it must be enabled.
17042 /// Setting state=DISABLED will pause the log generation for this config.
17043 pub state: std::option::Option<crate::model::vpc_flow_logs_config::State>,
17044
17045 /// The aggregation interval for the logs. Default value is INTERVAL_5_SEC.
17046 pub aggregation_interval:
17047 std::option::Option<crate::model::vpc_flow_logs_config::AggregationInterval>,
17048
17049 /// The value of the field must be in (0, 1]. The sampling rate of VPC Flow
17050 /// Logs where 1.0 means all collected logs are reported.
17051 /// Setting the sampling rate to 0.0 is not allowed. If you want to disable VPC
17052 /// Flow Logs, use the state field instead.
17053 /// Default value is 1.0.
17054 pub flow_sampling: std::option::Option<f32>,
17055
17056 /// Configures whether all, none or a subset of metadata fields should be
17057 /// added to the reported VPC flow logs.
17058 /// Default value is INCLUDE_ALL_METADATA.
17059 pub metadata: std::option::Option<crate::model::vpc_flow_logs_config::Metadata>,
17060
17061 /// Custom metadata fields to include in the reported VPC flow logs.
17062 /// Can only be specified if "metadata" was set to CUSTOM_METADATA.
17063 pub metadata_fields: std::vec::Vec<std::string::String>,
17064
17065 /// Export filter used to define which VPC Flow Logs should be logged.
17066 pub filter_expr: std::option::Option<std::string::String>,
17067
17068 /// Determines whether to include cross project annotations in the logs.
17069 /// This field is available only for organization configurations. If not
17070 /// specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
17071 pub cross_project_metadata:
17072 std::option::Option<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
17073
17074 /// Specifies the scope of the config (e.g., SUBNET, NETWORK, ORGANIZATION..).
17075 pub scope: std::option::Option<crate::model::effective_vpc_flow_logs_config::Scope>,
17076
17077 /// Reference to the resource of the config scope. That is, the scope from
17078 /// which traffic is logged. The target resource must belong to the same
17079 /// project as the configuration.
17080 /// This field is not supported for organization level configurations.
17081 pub target_resource:
17082 std::option::Option<crate::model::effective_vpc_flow_logs_config::TargetResource>,
17083
17084 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17085}
17086
17087impl EffectiveVpcFlowLogsConfig {
17088 pub fn new() -> Self {
17089 std::default::Default::default()
17090 }
17091
17092 /// Sets the value of [name][crate::model::EffectiveVpcFlowLogsConfig::name].
17093 ///
17094 /// # Example
17095 /// ```ignore,no_run
17096 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17097 /// let x = EffectiveVpcFlowLogsConfig::new().set_name("example");
17098 /// ```
17099 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17100 self.name = v.into();
17101 self
17102 }
17103
17104 /// Sets the value of [state][crate::model::EffectiveVpcFlowLogsConfig::state].
17105 ///
17106 /// # Example
17107 /// ```ignore,no_run
17108 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17109 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
17110 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_state(State::Enabled);
17111 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_state(State::Disabled);
17112 /// ```
17113 pub fn set_state<T>(mut self, v: T) -> Self
17114 where
17115 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
17116 {
17117 self.state = std::option::Option::Some(v.into());
17118 self
17119 }
17120
17121 /// Sets or clears the value of [state][crate::model::EffectiveVpcFlowLogsConfig::state].
17122 ///
17123 /// # Example
17124 /// ```ignore,no_run
17125 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17126 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::State;
17127 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(Some(State::Enabled));
17128 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(Some(State::Disabled));
17129 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_state(None::<State>);
17130 /// ```
17131 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
17132 where
17133 T: std::convert::Into<crate::model::vpc_flow_logs_config::State>,
17134 {
17135 self.state = v.map(|x| x.into());
17136 self
17137 }
17138
17139 /// Sets the value of [aggregation_interval][crate::model::EffectiveVpcFlowLogsConfig::aggregation_interval].
17140 ///
17141 /// # Example
17142 /// ```ignore,no_run
17143 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17144 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
17145 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval5Sec);
17146 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval30Sec);
17147 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_aggregation_interval(AggregationInterval::Interval1Min);
17148 /// ```
17149 pub fn set_aggregation_interval<T>(mut self, v: T) -> Self
17150 where
17151 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
17152 {
17153 self.aggregation_interval = std::option::Option::Some(v.into());
17154 self
17155 }
17156
17157 /// Sets or clears the value of [aggregation_interval][crate::model::EffectiveVpcFlowLogsConfig::aggregation_interval].
17158 ///
17159 /// # Example
17160 /// ```ignore,no_run
17161 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17162 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::AggregationInterval;
17163 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval5Sec));
17164 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval30Sec));
17165 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(Some(AggregationInterval::Interval1Min));
17166 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_aggregation_interval(None::<AggregationInterval>);
17167 /// ```
17168 pub fn set_or_clear_aggregation_interval<T>(mut self, v: std::option::Option<T>) -> Self
17169 where
17170 T: std::convert::Into<crate::model::vpc_flow_logs_config::AggregationInterval>,
17171 {
17172 self.aggregation_interval = v.map(|x| x.into());
17173 self
17174 }
17175
17176 /// Sets the value of [flow_sampling][crate::model::EffectiveVpcFlowLogsConfig::flow_sampling].
17177 ///
17178 /// # Example
17179 /// ```ignore,no_run
17180 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17181 /// let x = EffectiveVpcFlowLogsConfig::new().set_flow_sampling(42.0);
17182 /// ```
17183 pub fn set_flow_sampling<T>(mut self, v: T) -> Self
17184 where
17185 T: std::convert::Into<f32>,
17186 {
17187 self.flow_sampling = std::option::Option::Some(v.into());
17188 self
17189 }
17190
17191 /// Sets or clears the value of [flow_sampling][crate::model::EffectiveVpcFlowLogsConfig::flow_sampling].
17192 ///
17193 /// # Example
17194 /// ```ignore,no_run
17195 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17196 /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_flow_sampling(Some(42.0));
17197 /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_flow_sampling(None::<f32>);
17198 /// ```
17199 pub fn set_or_clear_flow_sampling<T>(mut self, v: std::option::Option<T>) -> Self
17200 where
17201 T: std::convert::Into<f32>,
17202 {
17203 self.flow_sampling = v.map(|x| x.into());
17204 self
17205 }
17206
17207 /// Sets the value of [metadata][crate::model::EffectiveVpcFlowLogsConfig::metadata].
17208 ///
17209 /// # Example
17210 /// ```ignore,no_run
17211 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17212 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
17213 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::IncludeAllMetadata);
17214 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::ExcludeAllMetadata);
17215 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_metadata(Metadata::CustomMetadata);
17216 /// ```
17217 pub fn set_metadata<T>(mut self, v: T) -> Self
17218 where
17219 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
17220 {
17221 self.metadata = std::option::Option::Some(v.into());
17222 self
17223 }
17224
17225 /// Sets or clears the value of [metadata][crate::model::EffectiveVpcFlowLogsConfig::metadata].
17226 ///
17227 /// # Example
17228 /// ```ignore,no_run
17229 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17230 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::Metadata;
17231 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::IncludeAllMetadata));
17232 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::ExcludeAllMetadata));
17233 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(Some(Metadata::CustomMetadata));
17234 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_metadata(None::<Metadata>);
17235 /// ```
17236 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
17237 where
17238 T: std::convert::Into<crate::model::vpc_flow_logs_config::Metadata>,
17239 {
17240 self.metadata = v.map(|x| x.into());
17241 self
17242 }
17243
17244 /// Sets the value of [metadata_fields][crate::model::EffectiveVpcFlowLogsConfig::metadata_fields].
17245 ///
17246 /// # Example
17247 /// ```ignore,no_run
17248 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17249 /// let x = EffectiveVpcFlowLogsConfig::new().set_metadata_fields(["a", "b", "c"]);
17250 /// ```
17251 pub fn set_metadata_fields<T, V>(mut self, v: T) -> Self
17252 where
17253 T: std::iter::IntoIterator<Item = V>,
17254 V: std::convert::Into<std::string::String>,
17255 {
17256 use std::iter::Iterator;
17257 self.metadata_fields = v.into_iter().map(|i| i.into()).collect();
17258 self
17259 }
17260
17261 /// Sets the value of [filter_expr][crate::model::EffectiveVpcFlowLogsConfig::filter_expr].
17262 ///
17263 /// # Example
17264 /// ```ignore,no_run
17265 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17266 /// let x = EffectiveVpcFlowLogsConfig::new().set_filter_expr("example");
17267 /// ```
17268 pub fn set_filter_expr<T>(mut self, v: T) -> Self
17269 where
17270 T: std::convert::Into<std::string::String>,
17271 {
17272 self.filter_expr = std::option::Option::Some(v.into());
17273 self
17274 }
17275
17276 /// Sets or clears the value of [filter_expr][crate::model::EffectiveVpcFlowLogsConfig::filter_expr].
17277 ///
17278 /// # Example
17279 /// ```ignore,no_run
17280 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17281 /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_filter_expr(Some("example"));
17282 /// let x = EffectiveVpcFlowLogsConfig::new().set_or_clear_filter_expr(None::<String>);
17283 /// ```
17284 pub fn set_or_clear_filter_expr<T>(mut self, v: std::option::Option<T>) -> Self
17285 where
17286 T: std::convert::Into<std::string::String>,
17287 {
17288 self.filter_expr = v.map(|x| x.into());
17289 self
17290 }
17291
17292 /// Sets the value of [cross_project_metadata][crate::model::EffectiveVpcFlowLogsConfig::cross_project_metadata].
17293 ///
17294 /// # Example
17295 /// ```ignore,no_run
17296 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17297 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
17298 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Enabled);
17299 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_cross_project_metadata(CrossProjectMetadata::Disabled);
17300 /// ```
17301 pub fn set_cross_project_metadata<T>(mut self, v: T) -> Self
17302 where
17303 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
17304 {
17305 self.cross_project_metadata = std::option::Option::Some(v.into());
17306 self
17307 }
17308
17309 /// Sets or clears the value of [cross_project_metadata][crate::model::EffectiveVpcFlowLogsConfig::cross_project_metadata].
17310 ///
17311 /// # Example
17312 /// ```ignore,no_run
17313 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17314 /// use google_cloud_networkmanagement_v1::model::vpc_flow_logs_config::CrossProjectMetadata;
17315 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Enabled));
17316 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(Some(CrossProjectMetadata::Disabled));
17317 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_cross_project_metadata(None::<CrossProjectMetadata>);
17318 /// ```
17319 pub fn set_or_clear_cross_project_metadata<T>(mut self, v: std::option::Option<T>) -> Self
17320 where
17321 T: std::convert::Into<crate::model::vpc_flow_logs_config::CrossProjectMetadata>,
17322 {
17323 self.cross_project_metadata = v.map(|x| x.into());
17324 self
17325 }
17326
17327 /// Sets the value of [scope][crate::model::EffectiveVpcFlowLogsConfig::scope].
17328 ///
17329 /// # Example
17330 /// ```ignore,no_run
17331 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17332 /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::Scope;
17333 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::Subnet);
17334 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::ComputeApiSubnet);
17335 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_scope(Scope::Network);
17336 /// ```
17337 pub fn set_scope<T>(mut self, v: T) -> Self
17338 where
17339 T: std::convert::Into<crate::model::effective_vpc_flow_logs_config::Scope>,
17340 {
17341 self.scope = std::option::Option::Some(v.into());
17342 self
17343 }
17344
17345 /// Sets or clears the value of [scope][crate::model::EffectiveVpcFlowLogsConfig::scope].
17346 ///
17347 /// # Example
17348 /// ```ignore,no_run
17349 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17350 /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::Scope;
17351 /// let x0 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::Subnet));
17352 /// let x1 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::ComputeApiSubnet));
17353 /// let x2 = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(Some(Scope::Network));
17354 /// let x_none = EffectiveVpcFlowLogsConfig::new().set_or_clear_scope(None::<Scope>);
17355 /// ```
17356 pub fn set_or_clear_scope<T>(mut self, v: std::option::Option<T>) -> Self
17357 where
17358 T: std::convert::Into<crate::model::effective_vpc_flow_logs_config::Scope>,
17359 {
17360 self.scope = v.map(|x| x.into());
17361 self
17362 }
17363
17364 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource].
17365 ///
17366 /// Note that all the setters affecting `target_resource` are mutually
17367 /// exclusive.
17368 ///
17369 /// # Example
17370 /// ```ignore,no_run
17371 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17372 /// use google_cloud_networkmanagement_v1::model::effective_vpc_flow_logs_config::TargetResource;
17373 /// let x = EffectiveVpcFlowLogsConfig::new().set_target_resource(Some(TargetResource::Network("example".to_string())));
17374 /// ```
17375 pub fn set_target_resource<
17376 T: std::convert::Into<
17377 std::option::Option<crate::model::effective_vpc_flow_logs_config::TargetResource>,
17378 >,
17379 >(
17380 mut self,
17381 v: T,
17382 ) -> Self {
17383 self.target_resource = v.into();
17384 self
17385 }
17386
17387 /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
17388 /// if it holds a `Network`, `None` if the field is not set or
17389 /// holds a different branch.
17390 pub fn network(&self) -> std::option::Option<&std::string::String> {
17391 #[allow(unreachable_patterns)]
17392 self.target_resource.as_ref().and_then(|v| match v {
17393 crate::model::effective_vpc_flow_logs_config::TargetResource::Network(v) => {
17394 std::option::Option::Some(v)
17395 }
17396 _ => std::option::Option::None,
17397 })
17398 }
17399
17400 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
17401 /// to hold a `Network`.
17402 ///
17403 /// Note that all the setters affecting `target_resource` are
17404 /// mutually exclusive.
17405 ///
17406 /// # Example
17407 /// ```ignore,no_run
17408 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17409 /// let x = EffectiveVpcFlowLogsConfig::new().set_network("example");
17410 /// assert!(x.network().is_some());
17411 /// assert!(x.subnet().is_none());
17412 /// assert!(x.interconnect_attachment().is_none());
17413 /// assert!(x.vpn_tunnel().is_none());
17414 /// ```
17415 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17416 self.target_resource = std::option::Option::Some(
17417 crate::model::effective_vpc_flow_logs_config::TargetResource::Network(v.into()),
17418 );
17419 self
17420 }
17421
17422 /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
17423 /// if it holds a `Subnet`, `None` if the field is not set or
17424 /// holds a different branch.
17425 pub fn subnet(&self) -> std::option::Option<&std::string::String> {
17426 #[allow(unreachable_patterns)]
17427 self.target_resource.as_ref().and_then(|v| match v {
17428 crate::model::effective_vpc_flow_logs_config::TargetResource::Subnet(v) => {
17429 std::option::Option::Some(v)
17430 }
17431 _ => std::option::Option::None,
17432 })
17433 }
17434
17435 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
17436 /// to hold a `Subnet`.
17437 ///
17438 /// Note that all the setters affecting `target_resource` are
17439 /// mutually exclusive.
17440 ///
17441 /// # Example
17442 /// ```ignore,no_run
17443 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17444 /// let x = EffectiveVpcFlowLogsConfig::new().set_subnet("example");
17445 /// assert!(x.subnet().is_some());
17446 /// assert!(x.network().is_none());
17447 /// assert!(x.interconnect_attachment().is_none());
17448 /// assert!(x.vpn_tunnel().is_none());
17449 /// ```
17450 pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17451 self.target_resource = std::option::Option::Some(
17452 crate::model::effective_vpc_flow_logs_config::TargetResource::Subnet(v.into()),
17453 );
17454 self
17455 }
17456
17457 /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
17458 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
17459 /// holds a different branch.
17460 pub fn interconnect_attachment(&self) -> std::option::Option<&std::string::String> {
17461 #[allow(unreachable_patterns)]
17462 self.target_resource.as_ref().and_then(|v| match v {
17463 crate::model::effective_vpc_flow_logs_config::TargetResource::InterconnectAttachment(v) => std::option::Option::Some(v),
17464 _ => std::option::Option::None,
17465 })
17466 }
17467
17468 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
17469 /// to hold a `InterconnectAttachment`.
17470 ///
17471 /// Note that all the setters affecting `target_resource` are
17472 /// mutually exclusive.
17473 ///
17474 /// # Example
17475 /// ```ignore,no_run
17476 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17477 /// let x = EffectiveVpcFlowLogsConfig::new().set_interconnect_attachment("example");
17478 /// assert!(x.interconnect_attachment().is_some());
17479 /// assert!(x.network().is_none());
17480 /// assert!(x.subnet().is_none());
17481 /// assert!(x.vpn_tunnel().is_none());
17482 /// ```
17483 pub fn set_interconnect_attachment<T: std::convert::Into<std::string::String>>(
17484 mut self,
17485 v: T,
17486 ) -> Self {
17487 self.target_resource = std::option::Option::Some(
17488 crate::model::effective_vpc_flow_logs_config::TargetResource::InterconnectAttachment(
17489 v.into(),
17490 ),
17491 );
17492 self
17493 }
17494
17495 /// The value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
17496 /// if it holds a `VpnTunnel`, `None` if the field is not set or
17497 /// holds a different branch.
17498 pub fn vpn_tunnel(&self) -> std::option::Option<&std::string::String> {
17499 #[allow(unreachable_patterns)]
17500 self.target_resource.as_ref().and_then(|v| match v {
17501 crate::model::effective_vpc_flow_logs_config::TargetResource::VpnTunnel(v) => {
17502 std::option::Option::Some(v)
17503 }
17504 _ => std::option::Option::None,
17505 })
17506 }
17507
17508 /// Sets the value of [target_resource][crate::model::EffectiveVpcFlowLogsConfig::target_resource]
17509 /// to hold a `VpnTunnel`.
17510 ///
17511 /// Note that all the setters affecting `target_resource` are
17512 /// mutually exclusive.
17513 ///
17514 /// # Example
17515 /// ```ignore,no_run
17516 /// # use google_cloud_networkmanagement_v1::model::EffectiveVpcFlowLogsConfig;
17517 /// let x = EffectiveVpcFlowLogsConfig::new().set_vpn_tunnel("example");
17518 /// assert!(x.vpn_tunnel().is_some());
17519 /// assert!(x.network().is_none());
17520 /// assert!(x.subnet().is_none());
17521 /// assert!(x.interconnect_attachment().is_none());
17522 /// ```
17523 pub fn set_vpn_tunnel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17524 self.target_resource = std::option::Option::Some(
17525 crate::model::effective_vpc_flow_logs_config::TargetResource::VpnTunnel(v.into()),
17526 );
17527 self
17528 }
17529}
17530
17531impl wkt::message::Message for EffectiveVpcFlowLogsConfig {
17532 fn typename() -> &'static str {
17533 "type.googleapis.com/google.cloud.networkmanagement.v1.EffectiveVpcFlowLogsConfig"
17534 }
17535}
17536
17537/// Defines additional types related to [EffectiveVpcFlowLogsConfig].
17538pub mod effective_vpc_flow_logs_config {
17539 #[allow(unused_imports)]
17540 use super::*;
17541
17542 /// The scope for this flow log configuration.
17543 ///
17544 /// # Working with unknown values
17545 ///
17546 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17547 /// additional enum variants at any time. Adding new variants is not considered
17548 /// a breaking change. Applications should write their code in anticipation of:
17549 ///
17550 /// - New values appearing in future releases of the client library, **and**
17551 /// - New values received dynamically, without application changes.
17552 ///
17553 /// Please consult the [Working with enums] section in the user guide for some
17554 /// guidelines.
17555 ///
17556 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17557 #[derive(Clone, Debug, PartialEq)]
17558 #[non_exhaustive]
17559 pub enum Scope {
17560 /// Scope is unspecified.
17561 Unspecified,
17562 /// Target resource is a subnet (Network Management API).
17563 Subnet,
17564 /// Target resource is a subnet, and the config originates from the Compute
17565 /// API.
17566 ComputeApiSubnet,
17567 /// Target resource is a network.
17568 Network,
17569 /// Target resource is a VPN tunnel.
17570 VpnTunnel,
17571 /// Target resource is an interconnect attachment.
17572 InterconnectAttachment,
17573 /// Configuration applies to an entire organization.
17574 Organization,
17575 /// If set, the enum was initialized with an unknown value.
17576 ///
17577 /// Applications can examine the value using [Scope::value] or
17578 /// [Scope::name].
17579 UnknownValue(scope::UnknownValue),
17580 }
17581
17582 #[doc(hidden)]
17583 pub mod scope {
17584 #[allow(unused_imports)]
17585 use super::*;
17586 #[derive(Clone, Debug, PartialEq)]
17587 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17588 }
17589
17590 impl Scope {
17591 /// Gets the enum value.
17592 ///
17593 /// Returns `None` if the enum contains an unknown value deserialized from
17594 /// the string representation of enums.
17595 pub fn value(&self) -> std::option::Option<i32> {
17596 match self {
17597 Self::Unspecified => std::option::Option::Some(0),
17598 Self::Subnet => std::option::Option::Some(1),
17599 Self::ComputeApiSubnet => std::option::Option::Some(2),
17600 Self::Network => std::option::Option::Some(3),
17601 Self::VpnTunnel => std::option::Option::Some(4),
17602 Self::InterconnectAttachment => std::option::Option::Some(5),
17603 Self::Organization => std::option::Option::Some(6),
17604 Self::UnknownValue(u) => u.0.value(),
17605 }
17606 }
17607
17608 /// Gets the enum value as a string.
17609 ///
17610 /// Returns `None` if the enum contains an unknown value deserialized from
17611 /// the integer representation of enums.
17612 pub fn name(&self) -> std::option::Option<&str> {
17613 match self {
17614 Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
17615 Self::Subnet => std::option::Option::Some("SUBNET"),
17616 Self::ComputeApiSubnet => std::option::Option::Some("COMPUTE_API_SUBNET"),
17617 Self::Network => std::option::Option::Some("NETWORK"),
17618 Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
17619 Self::InterconnectAttachment => {
17620 std::option::Option::Some("INTERCONNECT_ATTACHMENT")
17621 }
17622 Self::Organization => std::option::Option::Some("ORGANIZATION"),
17623 Self::UnknownValue(u) => u.0.name(),
17624 }
17625 }
17626 }
17627
17628 impl std::default::Default for Scope {
17629 fn default() -> Self {
17630 use std::convert::From;
17631 Self::from(0)
17632 }
17633 }
17634
17635 impl std::fmt::Display for Scope {
17636 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17637 wkt::internal::display_enum(f, self.name(), self.value())
17638 }
17639 }
17640
17641 impl std::convert::From<i32> for Scope {
17642 fn from(value: i32) -> Self {
17643 match value {
17644 0 => Self::Unspecified,
17645 1 => Self::Subnet,
17646 2 => Self::ComputeApiSubnet,
17647 3 => Self::Network,
17648 4 => Self::VpnTunnel,
17649 5 => Self::InterconnectAttachment,
17650 6 => Self::Organization,
17651 _ => Self::UnknownValue(scope::UnknownValue(
17652 wkt::internal::UnknownEnumValue::Integer(value),
17653 )),
17654 }
17655 }
17656 }
17657
17658 impl std::convert::From<&str> for Scope {
17659 fn from(value: &str) -> Self {
17660 use std::string::ToString;
17661 match value {
17662 "SCOPE_UNSPECIFIED" => Self::Unspecified,
17663 "SUBNET" => Self::Subnet,
17664 "COMPUTE_API_SUBNET" => Self::ComputeApiSubnet,
17665 "NETWORK" => Self::Network,
17666 "VPN_TUNNEL" => Self::VpnTunnel,
17667 "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
17668 "ORGANIZATION" => Self::Organization,
17669 _ => Self::UnknownValue(scope::UnknownValue(
17670 wkt::internal::UnknownEnumValue::String(value.to_string()),
17671 )),
17672 }
17673 }
17674 }
17675
17676 impl serde::ser::Serialize for Scope {
17677 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17678 where
17679 S: serde::Serializer,
17680 {
17681 match self {
17682 Self::Unspecified => serializer.serialize_i32(0),
17683 Self::Subnet => serializer.serialize_i32(1),
17684 Self::ComputeApiSubnet => serializer.serialize_i32(2),
17685 Self::Network => serializer.serialize_i32(3),
17686 Self::VpnTunnel => serializer.serialize_i32(4),
17687 Self::InterconnectAttachment => serializer.serialize_i32(5),
17688 Self::Organization => serializer.serialize_i32(6),
17689 Self::UnknownValue(u) => u.0.serialize(serializer),
17690 }
17691 }
17692 }
17693
17694 impl<'de> serde::de::Deserialize<'de> for Scope {
17695 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17696 where
17697 D: serde::Deserializer<'de>,
17698 {
17699 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
17700 ".google.cloud.networkmanagement.v1.EffectiveVpcFlowLogsConfig.Scope",
17701 ))
17702 }
17703 }
17704
17705 /// Reference to the resource of the config scope. That is, the scope from
17706 /// which traffic is logged. The target resource must belong to the same
17707 /// project as the configuration.
17708 /// This field is not supported for organization level configurations.
17709 #[derive(Clone, Debug, PartialEq)]
17710 #[non_exhaustive]
17711 pub enum TargetResource {
17712 /// Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
17713 /// within the network.
17714 /// Format: projects/{project_id}/global/networks/{name}
17715 Network(std::string::String),
17716 /// Traffic will be logged from VMs within the subnetwork.
17717 /// Format: projects/{project_id}/regions/{region}/subnetworks/{name}
17718 Subnet(std::string::String),
17719 /// Traffic will be logged from the Interconnect Attachment.
17720 /// Format:
17721 /// projects/{project_id}/regions/{region}/interconnectAttachments/{name}
17722 InterconnectAttachment(std::string::String),
17723 /// Traffic will be logged from the VPN Tunnel.
17724 /// Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
17725 VpnTunnel(std::string::String),
17726 }
17727}
17728
17729/// Type of a load balancer. For more information, see [Summary of Google Cloud
17730/// load
17731/// balancers](https://cloud.google.com/load-balancing/docs/load-balancing-overview#summary-of-google-cloud-load-balancers).
17732///
17733/// # Working with unknown values
17734///
17735/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17736/// additional enum variants at any time. Adding new variants is not considered
17737/// a breaking change. Applications should write their code in anticipation of:
17738///
17739/// - New values appearing in future releases of the client library, **and**
17740/// - New values received dynamically, without application changes.
17741///
17742/// Please consult the [Working with enums] section in the user guide for some
17743/// guidelines.
17744///
17745/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17746#[derive(Clone, Debug, PartialEq)]
17747#[non_exhaustive]
17748pub enum LoadBalancerType {
17749 /// Forwarding rule points to a different target than a load balancer or a
17750 /// load balancer type is unknown.
17751 Unspecified,
17752 /// Global external HTTP(S) load balancer.
17753 HttpsAdvancedLoadBalancer,
17754 /// Global external HTTP(S) load balancer (classic)
17755 HttpsLoadBalancer,
17756 /// Regional external HTTP(S) load balancer.
17757 RegionalHttpsLoadBalancer,
17758 /// Internal HTTP(S) load balancer.
17759 InternalHttpsLoadBalancer,
17760 /// External SSL proxy load balancer.
17761 SslProxyLoadBalancer,
17762 /// External TCP proxy load balancer.
17763 TcpProxyLoadBalancer,
17764 /// Internal regional TCP proxy load balancer.
17765 InternalTcpProxyLoadBalancer,
17766 /// External TCP/UDP Network load balancer.
17767 NetworkLoadBalancer,
17768 /// Target-pool based external TCP/UDP Network load balancer.
17769 LegacyNetworkLoadBalancer,
17770 /// Internal TCP/UDP load balancer.
17771 TcpUdpInternalLoadBalancer,
17772 /// If set, the enum was initialized with an unknown value.
17773 ///
17774 /// Applications can examine the value using [LoadBalancerType::value] or
17775 /// [LoadBalancerType::name].
17776 UnknownValue(load_balancer_type::UnknownValue),
17777}
17778
17779#[doc(hidden)]
17780pub mod load_balancer_type {
17781 #[allow(unused_imports)]
17782 use super::*;
17783 #[derive(Clone, Debug, PartialEq)]
17784 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17785}
17786
17787impl LoadBalancerType {
17788 /// Gets the enum value.
17789 ///
17790 /// Returns `None` if the enum contains an unknown value deserialized from
17791 /// the string representation of enums.
17792 pub fn value(&self) -> std::option::Option<i32> {
17793 match self {
17794 Self::Unspecified => std::option::Option::Some(0),
17795 Self::HttpsAdvancedLoadBalancer => std::option::Option::Some(1),
17796 Self::HttpsLoadBalancer => std::option::Option::Some(2),
17797 Self::RegionalHttpsLoadBalancer => std::option::Option::Some(3),
17798 Self::InternalHttpsLoadBalancer => std::option::Option::Some(4),
17799 Self::SslProxyLoadBalancer => std::option::Option::Some(5),
17800 Self::TcpProxyLoadBalancer => std::option::Option::Some(6),
17801 Self::InternalTcpProxyLoadBalancer => std::option::Option::Some(7),
17802 Self::NetworkLoadBalancer => std::option::Option::Some(8),
17803 Self::LegacyNetworkLoadBalancer => std::option::Option::Some(9),
17804 Self::TcpUdpInternalLoadBalancer => std::option::Option::Some(10),
17805 Self::UnknownValue(u) => u.0.value(),
17806 }
17807 }
17808
17809 /// Gets the enum value as a string.
17810 ///
17811 /// Returns `None` if the enum contains an unknown value deserialized from
17812 /// the integer representation of enums.
17813 pub fn name(&self) -> std::option::Option<&str> {
17814 match self {
17815 Self::Unspecified => std::option::Option::Some("LOAD_BALANCER_TYPE_UNSPECIFIED"),
17816 Self::HttpsAdvancedLoadBalancer => {
17817 std::option::Option::Some("HTTPS_ADVANCED_LOAD_BALANCER")
17818 }
17819 Self::HttpsLoadBalancer => std::option::Option::Some("HTTPS_LOAD_BALANCER"),
17820 Self::RegionalHttpsLoadBalancer => {
17821 std::option::Option::Some("REGIONAL_HTTPS_LOAD_BALANCER")
17822 }
17823 Self::InternalHttpsLoadBalancer => {
17824 std::option::Option::Some("INTERNAL_HTTPS_LOAD_BALANCER")
17825 }
17826 Self::SslProxyLoadBalancer => std::option::Option::Some("SSL_PROXY_LOAD_BALANCER"),
17827 Self::TcpProxyLoadBalancer => std::option::Option::Some("TCP_PROXY_LOAD_BALANCER"),
17828 Self::InternalTcpProxyLoadBalancer => {
17829 std::option::Option::Some("INTERNAL_TCP_PROXY_LOAD_BALANCER")
17830 }
17831 Self::NetworkLoadBalancer => std::option::Option::Some("NETWORK_LOAD_BALANCER"),
17832 Self::LegacyNetworkLoadBalancer => {
17833 std::option::Option::Some("LEGACY_NETWORK_LOAD_BALANCER")
17834 }
17835 Self::TcpUdpInternalLoadBalancer => {
17836 std::option::Option::Some("TCP_UDP_INTERNAL_LOAD_BALANCER")
17837 }
17838 Self::UnknownValue(u) => u.0.name(),
17839 }
17840 }
17841}
17842
17843impl std::default::Default for LoadBalancerType {
17844 fn default() -> Self {
17845 use std::convert::From;
17846 Self::from(0)
17847 }
17848}
17849
17850impl std::fmt::Display for LoadBalancerType {
17851 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17852 wkt::internal::display_enum(f, self.name(), self.value())
17853 }
17854}
17855
17856impl std::convert::From<i32> for LoadBalancerType {
17857 fn from(value: i32) -> Self {
17858 match value {
17859 0 => Self::Unspecified,
17860 1 => Self::HttpsAdvancedLoadBalancer,
17861 2 => Self::HttpsLoadBalancer,
17862 3 => Self::RegionalHttpsLoadBalancer,
17863 4 => Self::InternalHttpsLoadBalancer,
17864 5 => Self::SslProxyLoadBalancer,
17865 6 => Self::TcpProxyLoadBalancer,
17866 7 => Self::InternalTcpProxyLoadBalancer,
17867 8 => Self::NetworkLoadBalancer,
17868 9 => Self::LegacyNetworkLoadBalancer,
17869 10 => Self::TcpUdpInternalLoadBalancer,
17870 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
17871 wkt::internal::UnknownEnumValue::Integer(value),
17872 )),
17873 }
17874 }
17875}
17876
17877impl std::convert::From<&str> for LoadBalancerType {
17878 fn from(value: &str) -> Self {
17879 use std::string::ToString;
17880 match value {
17881 "LOAD_BALANCER_TYPE_UNSPECIFIED" => Self::Unspecified,
17882 "HTTPS_ADVANCED_LOAD_BALANCER" => Self::HttpsAdvancedLoadBalancer,
17883 "HTTPS_LOAD_BALANCER" => Self::HttpsLoadBalancer,
17884 "REGIONAL_HTTPS_LOAD_BALANCER" => Self::RegionalHttpsLoadBalancer,
17885 "INTERNAL_HTTPS_LOAD_BALANCER" => Self::InternalHttpsLoadBalancer,
17886 "SSL_PROXY_LOAD_BALANCER" => Self::SslProxyLoadBalancer,
17887 "TCP_PROXY_LOAD_BALANCER" => Self::TcpProxyLoadBalancer,
17888 "INTERNAL_TCP_PROXY_LOAD_BALANCER" => Self::InternalTcpProxyLoadBalancer,
17889 "NETWORK_LOAD_BALANCER" => Self::NetworkLoadBalancer,
17890 "LEGACY_NETWORK_LOAD_BALANCER" => Self::LegacyNetworkLoadBalancer,
17891 "TCP_UDP_INTERNAL_LOAD_BALANCER" => Self::TcpUdpInternalLoadBalancer,
17892 _ => Self::UnknownValue(load_balancer_type::UnknownValue(
17893 wkt::internal::UnknownEnumValue::String(value.to_string()),
17894 )),
17895 }
17896 }
17897}
17898
17899impl serde::ser::Serialize for LoadBalancerType {
17900 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17901 where
17902 S: serde::Serializer,
17903 {
17904 match self {
17905 Self::Unspecified => serializer.serialize_i32(0),
17906 Self::HttpsAdvancedLoadBalancer => serializer.serialize_i32(1),
17907 Self::HttpsLoadBalancer => serializer.serialize_i32(2),
17908 Self::RegionalHttpsLoadBalancer => serializer.serialize_i32(3),
17909 Self::InternalHttpsLoadBalancer => serializer.serialize_i32(4),
17910 Self::SslProxyLoadBalancer => serializer.serialize_i32(5),
17911 Self::TcpProxyLoadBalancer => serializer.serialize_i32(6),
17912 Self::InternalTcpProxyLoadBalancer => serializer.serialize_i32(7),
17913 Self::NetworkLoadBalancer => serializer.serialize_i32(8),
17914 Self::LegacyNetworkLoadBalancer => serializer.serialize_i32(9),
17915 Self::TcpUdpInternalLoadBalancer => serializer.serialize_i32(10),
17916 Self::UnknownValue(u) => u.0.serialize(serializer),
17917 }
17918 }
17919}
17920
17921impl<'de> serde::de::Deserialize<'de> for LoadBalancerType {
17922 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17923 where
17924 D: serde::Deserializer<'de>,
17925 {
17926 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancerType>::new(
17927 ".google.cloud.networkmanagement.v1.LoadBalancerType",
17928 ))
17929 }
17930}