google_cloud_networksecurity_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// AddressGroup is a resource that specifies how a collection of IP/DNS used
40/// in Firewall Policy.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct AddressGroup {
44 /// Required. Name of the AddressGroup resource. It matches pattern
45 /// `projects/*/locations/{location}/addressGroups/<address_group>`.
46 pub name: std::string::String,
47
48 /// Optional. Free-text description of the resource.
49 pub description: std::string::String,
50
51 /// Output only. The timestamp when the resource was created.
52 pub create_time: std::option::Option<wkt::Timestamp>,
53
54 /// Output only. The timestamp when the resource was updated.
55 pub update_time: std::option::Option<wkt::Timestamp>,
56
57 /// Optional. Set of label tags associated with the AddressGroup resource.
58 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
59
60 /// Required. The type of the Address Group. Possible values are "IPv4" or
61 /// "IPV6".
62 pub r#type: crate::model::address_group::Type,
63
64 /// Optional. List of items.
65 pub items: std::vec::Vec<std::string::String>,
66
67 /// Required. Capacity of the Address Group
68 pub capacity: i32,
69
70 /// Output only. Server-defined fully-qualified URL for this resource.
71 pub self_link: std::string::String,
72
73 /// Optional. List of supported purposes of the Address Group.
74 pub purpose: std::vec::Vec<crate::model::address_group::Purpose>,
75
76 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
77}
78
79impl AddressGroup {
80 pub fn new() -> Self {
81 std::default::Default::default()
82 }
83
84 /// Sets the value of [name][crate::model::AddressGroup::name].
85 ///
86 /// # Example
87 /// ```ignore,no_run
88 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
89 /// let x = AddressGroup::new().set_name("example");
90 /// ```
91 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
92 self.name = v.into();
93 self
94 }
95
96 /// Sets the value of [description][crate::model::AddressGroup::description].
97 ///
98 /// # Example
99 /// ```ignore,no_run
100 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
101 /// let x = AddressGroup::new().set_description("example");
102 /// ```
103 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
104 self.description = v.into();
105 self
106 }
107
108 /// Sets the value of [create_time][crate::model::AddressGroup::create_time].
109 ///
110 /// # Example
111 /// ```ignore,no_run
112 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
113 /// use wkt::Timestamp;
114 /// let x = AddressGroup::new().set_create_time(Timestamp::default()/* use setters */);
115 /// ```
116 pub fn set_create_time<T>(mut self, v: T) -> Self
117 where
118 T: std::convert::Into<wkt::Timestamp>,
119 {
120 self.create_time = std::option::Option::Some(v.into());
121 self
122 }
123
124 /// Sets or clears the value of [create_time][crate::model::AddressGroup::create_time].
125 ///
126 /// # Example
127 /// ```ignore,no_run
128 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
129 /// use wkt::Timestamp;
130 /// let x = AddressGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
131 /// let x = AddressGroup::new().set_or_clear_create_time(None::<Timestamp>);
132 /// ```
133 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
134 where
135 T: std::convert::Into<wkt::Timestamp>,
136 {
137 self.create_time = v.map(|x| x.into());
138 self
139 }
140
141 /// Sets the value of [update_time][crate::model::AddressGroup::update_time].
142 ///
143 /// # Example
144 /// ```ignore,no_run
145 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
146 /// use wkt::Timestamp;
147 /// let x = AddressGroup::new().set_update_time(Timestamp::default()/* use setters */);
148 /// ```
149 pub fn set_update_time<T>(mut self, v: T) -> Self
150 where
151 T: std::convert::Into<wkt::Timestamp>,
152 {
153 self.update_time = std::option::Option::Some(v.into());
154 self
155 }
156
157 /// Sets or clears the value of [update_time][crate::model::AddressGroup::update_time].
158 ///
159 /// # Example
160 /// ```ignore,no_run
161 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
162 /// use wkt::Timestamp;
163 /// let x = AddressGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
164 /// let x = AddressGroup::new().set_or_clear_update_time(None::<Timestamp>);
165 /// ```
166 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
167 where
168 T: std::convert::Into<wkt::Timestamp>,
169 {
170 self.update_time = v.map(|x| x.into());
171 self
172 }
173
174 /// Sets the value of [labels][crate::model::AddressGroup::labels].
175 ///
176 /// # Example
177 /// ```ignore,no_run
178 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
179 /// let x = AddressGroup::new().set_labels([
180 /// ("key0", "abc"),
181 /// ("key1", "xyz"),
182 /// ]);
183 /// ```
184 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
185 where
186 T: std::iter::IntoIterator<Item = (K, V)>,
187 K: std::convert::Into<std::string::String>,
188 V: std::convert::Into<std::string::String>,
189 {
190 use std::iter::Iterator;
191 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
192 self
193 }
194
195 /// Sets the value of [r#type][crate::model::AddressGroup::type].
196 ///
197 /// # Example
198 /// ```ignore,no_run
199 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
200 /// use google_cloud_networksecurity_v1::model::address_group::Type;
201 /// let x0 = AddressGroup::new().set_type(Type::Ipv4);
202 /// let x1 = AddressGroup::new().set_type(Type::Ipv6);
203 /// ```
204 pub fn set_type<T: std::convert::Into<crate::model::address_group::Type>>(
205 mut self,
206 v: T,
207 ) -> Self {
208 self.r#type = v.into();
209 self
210 }
211
212 /// Sets the value of [items][crate::model::AddressGroup::items].
213 ///
214 /// # Example
215 /// ```ignore,no_run
216 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
217 /// let x = AddressGroup::new().set_items(["a", "b", "c"]);
218 /// ```
219 pub fn set_items<T, V>(mut self, v: T) -> Self
220 where
221 T: std::iter::IntoIterator<Item = V>,
222 V: std::convert::Into<std::string::String>,
223 {
224 use std::iter::Iterator;
225 self.items = v.into_iter().map(|i| i.into()).collect();
226 self
227 }
228
229 /// Sets the value of [capacity][crate::model::AddressGroup::capacity].
230 ///
231 /// # Example
232 /// ```ignore,no_run
233 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
234 /// let x = AddressGroup::new().set_capacity(42);
235 /// ```
236 pub fn set_capacity<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
237 self.capacity = v.into();
238 self
239 }
240
241 /// Sets the value of [self_link][crate::model::AddressGroup::self_link].
242 ///
243 /// # Example
244 /// ```ignore,no_run
245 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
246 /// let x = AddressGroup::new().set_self_link("example");
247 /// ```
248 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
249 self.self_link = v.into();
250 self
251 }
252
253 /// Sets the value of [purpose][crate::model::AddressGroup::purpose].
254 ///
255 /// # Example
256 /// ```ignore,no_run
257 /// # use google_cloud_networksecurity_v1::model::AddressGroup;
258 /// use google_cloud_networksecurity_v1::model::address_group::Purpose;
259 /// let x = AddressGroup::new().set_purpose([
260 /// Purpose::Default,
261 /// Purpose::CloudArmor,
262 /// ]);
263 /// ```
264 pub fn set_purpose<T, V>(mut self, v: T) -> Self
265 where
266 T: std::iter::IntoIterator<Item = V>,
267 V: std::convert::Into<crate::model::address_group::Purpose>,
268 {
269 use std::iter::Iterator;
270 self.purpose = v.into_iter().map(|i| i.into()).collect();
271 self
272 }
273}
274
275impl wkt::message::Message for AddressGroup {
276 fn typename() -> &'static str {
277 "type.googleapis.com/google.cloud.networksecurity.v1.AddressGroup"
278 }
279}
280
281/// Defines additional types related to [AddressGroup].
282pub mod address_group {
283 #[allow(unused_imports)]
284 use super::*;
285
286 /// Possible type of the Address Group.
287 ///
288 /// # Working with unknown values
289 ///
290 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
291 /// additional enum variants at any time. Adding new variants is not considered
292 /// a breaking change. Applications should write their code in anticipation of:
293 ///
294 /// - New values appearing in future releases of the client library, **and**
295 /// - New values received dynamically, without application changes.
296 ///
297 /// Please consult the [Working with enums] section in the user guide for some
298 /// guidelines.
299 ///
300 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
301 #[derive(Clone, Debug, PartialEq)]
302 #[non_exhaustive]
303 pub enum Type {
304 /// Default value.
305 Unspecified,
306 /// IP v4 ranges.
307 Ipv4,
308 /// IP v6 ranges.
309 Ipv6,
310 /// If set, the enum was initialized with an unknown value.
311 ///
312 /// Applications can examine the value using [Type::value] or
313 /// [Type::name].
314 UnknownValue(r#type::UnknownValue),
315 }
316
317 #[doc(hidden)]
318 pub mod r#type {
319 #[allow(unused_imports)]
320 use super::*;
321 #[derive(Clone, Debug, PartialEq)]
322 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
323 }
324
325 impl Type {
326 /// Gets the enum value.
327 ///
328 /// Returns `None` if the enum contains an unknown value deserialized from
329 /// the string representation of enums.
330 pub fn value(&self) -> std::option::Option<i32> {
331 match self {
332 Self::Unspecified => std::option::Option::Some(0),
333 Self::Ipv4 => std::option::Option::Some(1),
334 Self::Ipv6 => std::option::Option::Some(2),
335 Self::UnknownValue(u) => u.0.value(),
336 }
337 }
338
339 /// Gets the enum value as a string.
340 ///
341 /// Returns `None` if the enum contains an unknown value deserialized from
342 /// the integer representation of enums.
343 pub fn name(&self) -> std::option::Option<&str> {
344 match self {
345 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
346 Self::Ipv4 => std::option::Option::Some("IPV4"),
347 Self::Ipv6 => std::option::Option::Some("IPV6"),
348 Self::UnknownValue(u) => u.0.name(),
349 }
350 }
351 }
352
353 impl std::default::Default for Type {
354 fn default() -> Self {
355 use std::convert::From;
356 Self::from(0)
357 }
358 }
359
360 impl std::fmt::Display for Type {
361 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
362 wkt::internal::display_enum(f, self.name(), self.value())
363 }
364 }
365
366 impl std::convert::From<i32> for Type {
367 fn from(value: i32) -> Self {
368 match value {
369 0 => Self::Unspecified,
370 1 => Self::Ipv4,
371 2 => Self::Ipv6,
372 _ => Self::UnknownValue(r#type::UnknownValue(
373 wkt::internal::UnknownEnumValue::Integer(value),
374 )),
375 }
376 }
377 }
378
379 impl std::convert::From<&str> for Type {
380 fn from(value: &str) -> Self {
381 use std::string::ToString;
382 match value {
383 "TYPE_UNSPECIFIED" => Self::Unspecified,
384 "IPV4" => Self::Ipv4,
385 "IPV6" => Self::Ipv6,
386 _ => Self::UnknownValue(r#type::UnknownValue(
387 wkt::internal::UnknownEnumValue::String(value.to_string()),
388 )),
389 }
390 }
391 }
392
393 impl serde::ser::Serialize for Type {
394 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
395 where
396 S: serde::Serializer,
397 {
398 match self {
399 Self::Unspecified => serializer.serialize_i32(0),
400 Self::Ipv4 => serializer.serialize_i32(1),
401 Self::Ipv6 => serializer.serialize_i32(2),
402 Self::UnknownValue(u) => u.0.serialize(serializer),
403 }
404 }
405 }
406
407 impl<'de> serde::de::Deserialize<'de> for Type {
408 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
409 where
410 D: serde::Deserializer<'de>,
411 {
412 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
413 ".google.cloud.networksecurity.v1.AddressGroup.Type",
414 ))
415 }
416 }
417
418 /// Purpose of the Address Group.
419 ///
420 /// # Working with unknown values
421 ///
422 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
423 /// additional enum variants at any time. Adding new variants is not considered
424 /// a breaking change. Applications should write their code in anticipation of:
425 ///
426 /// - New values appearing in future releases of the client library, **and**
427 /// - New values received dynamically, without application changes.
428 ///
429 /// Please consult the [Working with enums] section in the user guide for some
430 /// guidelines.
431 ///
432 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
433 #[derive(Clone, Debug, PartialEq)]
434 #[non_exhaustive]
435 pub enum Purpose {
436 /// Default value. Should never happen.
437 Unspecified,
438 /// Address Group is distributed to VMC, and is usable in Firewall Policies
439 /// and other systems that rely on VMC.
440 Default,
441 /// Address Group is usable in Cloud Armor.
442 CloudArmor,
443 /// If set, the enum was initialized with an unknown value.
444 ///
445 /// Applications can examine the value using [Purpose::value] or
446 /// [Purpose::name].
447 UnknownValue(purpose::UnknownValue),
448 }
449
450 #[doc(hidden)]
451 pub mod purpose {
452 #[allow(unused_imports)]
453 use super::*;
454 #[derive(Clone, Debug, PartialEq)]
455 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
456 }
457
458 impl Purpose {
459 /// Gets the enum value.
460 ///
461 /// Returns `None` if the enum contains an unknown value deserialized from
462 /// the string representation of enums.
463 pub fn value(&self) -> std::option::Option<i32> {
464 match self {
465 Self::Unspecified => std::option::Option::Some(0),
466 Self::Default => std::option::Option::Some(1),
467 Self::CloudArmor => std::option::Option::Some(2),
468 Self::UnknownValue(u) => u.0.value(),
469 }
470 }
471
472 /// Gets the enum value as a string.
473 ///
474 /// Returns `None` if the enum contains an unknown value deserialized from
475 /// the integer representation of enums.
476 pub fn name(&self) -> std::option::Option<&str> {
477 match self {
478 Self::Unspecified => std::option::Option::Some("PURPOSE_UNSPECIFIED"),
479 Self::Default => std::option::Option::Some("DEFAULT"),
480 Self::CloudArmor => std::option::Option::Some("CLOUD_ARMOR"),
481 Self::UnknownValue(u) => u.0.name(),
482 }
483 }
484 }
485
486 impl std::default::Default for Purpose {
487 fn default() -> Self {
488 use std::convert::From;
489 Self::from(0)
490 }
491 }
492
493 impl std::fmt::Display for Purpose {
494 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
495 wkt::internal::display_enum(f, self.name(), self.value())
496 }
497 }
498
499 impl std::convert::From<i32> for Purpose {
500 fn from(value: i32) -> Self {
501 match value {
502 0 => Self::Unspecified,
503 1 => Self::Default,
504 2 => Self::CloudArmor,
505 _ => Self::UnknownValue(purpose::UnknownValue(
506 wkt::internal::UnknownEnumValue::Integer(value),
507 )),
508 }
509 }
510 }
511
512 impl std::convert::From<&str> for Purpose {
513 fn from(value: &str) -> Self {
514 use std::string::ToString;
515 match value {
516 "PURPOSE_UNSPECIFIED" => Self::Unspecified,
517 "DEFAULT" => Self::Default,
518 "CLOUD_ARMOR" => Self::CloudArmor,
519 _ => Self::UnknownValue(purpose::UnknownValue(
520 wkt::internal::UnknownEnumValue::String(value.to_string()),
521 )),
522 }
523 }
524 }
525
526 impl serde::ser::Serialize for Purpose {
527 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
528 where
529 S: serde::Serializer,
530 {
531 match self {
532 Self::Unspecified => serializer.serialize_i32(0),
533 Self::Default => serializer.serialize_i32(1),
534 Self::CloudArmor => serializer.serialize_i32(2),
535 Self::UnknownValue(u) => u.0.serialize(serializer),
536 }
537 }
538 }
539
540 impl<'de> serde::de::Deserialize<'de> for Purpose {
541 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
542 where
543 D: serde::Deserializer<'de>,
544 {
545 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Purpose>::new(
546 ".google.cloud.networksecurity.v1.AddressGroup.Purpose",
547 ))
548 }
549 }
550}
551
552/// Request used with the ListAddressGroups method.
553#[derive(Clone, Default, PartialEq)]
554#[non_exhaustive]
555pub struct ListAddressGroupsRequest {
556 /// Required. The project and location from which the AddressGroups
557 /// should be listed, specified in the format
558 /// `projects/*/locations/{location}`.
559 pub parent: std::string::String,
560
561 /// Maximum number of AddressGroups to return per call.
562 pub page_size: i32,
563
564 /// The value returned by the last
565 /// `ListAddressGroupsResponse` Indicates that this is a
566 /// continuation of a prior `ListAddressGroups` call, and
567 /// that the system should return the next page of data.
568 pub page_token: std::string::String,
569
570 /// Optional. If true, allow partial responses for multi-regional Aggregated
571 /// List requests.
572 pub return_partial_success: bool,
573
574 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
575}
576
577impl ListAddressGroupsRequest {
578 pub fn new() -> Self {
579 std::default::Default::default()
580 }
581
582 /// Sets the value of [parent][crate::model::ListAddressGroupsRequest::parent].
583 ///
584 /// # Example
585 /// ```ignore,no_run
586 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsRequest;
587 /// let x = ListAddressGroupsRequest::new().set_parent("example");
588 /// ```
589 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
590 self.parent = v.into();
591 self
592 }
593
594 /// Sets the value of [page_size][crate::model::ListAddressGroupsRequest::page_size].
595 ///
596 /// # Example
597 /// ```ignore,no_run
598 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsRequest;
599 /// let x = ListAddressGroupsRequest::new().set_page_size(42);
600 /// ```
601 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
602 self.page_size = v.into();
603 self
604 }
605
606 /// Sets the value of [page_token][crate::model::ListAddressGroupsRequest::page_token].
607 ///
608 /// # Example
609 /// ```ignore,no_run
610 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsRequest;
611 /// let x = ListAddressGroupsRequest::new().set_page_token("example");
612 /// ```
613 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
614 self.page_token = v.into();
615 self
616 }
617
618 /// Sets the value of [return_partial_success][crate::model::ListAddressGroupsRequest::return_partial_success].
619 ///
620 /// # Example
621 /// ```ignore,no_run
622 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsRequest;
623 /// let x = ListAddressGroupsRequest::new().set_return_partial_success(true);
624 /// ```
625 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
626 self.return_partial_success = v.into();
627 self
628 }
629}
630
631impl wkt::message::Message for ListAddressGroupsRequest {
632 fn typename() -> &'static str {
633 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupsRequest"
634 }
635}
636
637/// Response returned by the ListAddressGroups method.
638#[derive(Clone, Default, PartialEq)]
639#[non_exhaustive]
640pub struct ListAddressGroupsResponse {
641 /// List of AddressGroups resources.
642 pub address_groups: std::vec::Vec<crate::model::AddressGroup>,
643
644 /// If there might be more results than those appearing in this response, then
645 /// `next_page_token` is included. To get the next set of results, call this
646 /// method again using the value of `next_page_token` as `page_token`.
647 pub next_page_token: std::string::String,
648
649 /// Locations that could not be reached.
650 pub unreachable: std::vec::Vec<std::string::String>,
651
652 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
653}
654
655impl ListAddressGroupsResponse {
656 pub fn new() -> Self {
657 std::default::Default::default()
658 }
659
660 /// Sets the value of [address_groups][crate::model::ListAddressGroupsResponse::address_groups].
661 ///
662 /// # Example
663 /// ```ignore,no_run
664 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsResponse;
665 /// use google_cloud_networksecurity_v1::model::AddressGroup;
666 /// let x = ListAddressGroupsResponse::new()
667 /// .set_address_groups([
668 /// AddressGroup::default()/* use setters */,
669 /// AddressGroup::default()/* use (different) setters */,
670 /// ]);
671 /// ```
672 pub fn set_address_groups<T, V>(mut self, v: T) -> Self
673 where
674 T: std::iter::IntoIterator<Item = V>,
675 V: std::convert::Into<crate::model::AddressGroup>,
676 {
677 use std::iter::Iterator;
678 self.address_groups = v.into_iter().map(|i| i.into()).collect();
679 self
680 }
681
682 /// Sets the value of [next_page_token][crate::model::ListAddressGroupsResponse::next_page_token].
683 ///
684 /// # Example
685 /// ```ignore,no_run
686 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsResponse;
687 /// let x = ListAddressGroupsResponse::new().set_next_page_token("example");
688 /// ```
689 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
690 self.next_page_token = v.into();
691 self
692 }
693
694 /// Sets the value of [unreachable][crate::model::ListAddressGroupsResponse::unreachable].
695 ///
696 /// # Example
697 /// ```ignore,no_run
698 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupsResponse;
699 /// let x = ListAddressGroupsResponse::new().set_unreachable(["a", "b", "c"]);
700 /// ```
701 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
702 where
703 T: std::iter::IntoIterator<Item = V>,
704 V: std::convert::Into<std::string::String>,
705 {
706 use std::iter::Iterator;
707 self.unreachable = v.into_iter().map(|i| i.into()).collect();
708 self
709 }
710}
711
712impl wkt::message::Message for ListAddressGroupsResponse {
713 fn typename() -> &'static str {
714 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupsResponse"
715 }
716}
717
718#[doc(hidden)]
719impl google_cloud_gax::paginator::internal::PageableResponse for ListAddressGroupsResponse {
720 type PageItem = crate::model::AddressGroup;
721
722 fn items(self) -> std::vec::Vec<Self::PageItem> {
723 self.address_groups
724 }
725
726 fn next_page_token(&self) -> std::string::String {
727 use std::clone::Clone;
728 self.next_page_token.clone()
729 }
730}
731
732/// Request used by the GetAddressGroup method.
733#[derive(Clone, Default, PartialEq)]
734#[non_exhaustive]
735pub struct GetAddressGroupRequest {
736 /// Required. A name of the AddressGroup to get. Must be in the format
737 /// `projects/*/locations/{location}/addressGroups/*`.
738 pub name: std::string::String,
739
740 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
741}
742
743impl GetAddressGroupRequest {
744 pub fn new() -> Self {
745 std::default::Default::default()
746 }
747
748 /// Sets the value of [name][crate::model::GetAddressGroupRequest::name].
749 ///
750 /// # Example
751 /// ```ignore,no_run
752 /// # use google_cloud_networksecurity_v1::model::GetAddressGroupRequest;
753 /// let x = GetAddressGroupRequest::new().set_name("example");
754 /// ```
755 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
756 self.name = v.into();
757 self
758 }
759}
760
761impl wkt::message::Message for GetAddressGroupRequest {
762 fn typename() -> &'static str {
763 "type.googleapis.com/google.cloud.networksecurity.v1.GetAddressGroupRequest"
764 }
765}
766
767/// Request used by the CreateAddressGroup method.
768#[derive(Clone, Default, PartialEq)]
769#[non_exhaustive]
770pub struct CreateAddressGroupRequest {
771 /// Required. The parent resource of the AddressGroup. Must be in the
772 /// format `projects/*/locations/{location}`.
773 pub parent: std::string::String,
774
775 /// Required. Short name of the AddressGroup resource to be created.
776 /// This value should be 1-63 characters long, containing only
777 /// letters, numbers, hyphens, and underscores, and should not start
778 /// with a number. E.g. "authz_policy".
779 pub address_group_id: std::string::String,
780
781 /// Required. AddressGroup resource to be created.
782 pub address_group: std::option::Option<crate::model::AddressGroup>,
783
784 /// Optional. An optional request ID to identify requests. Specify a unique
785 /// request ID so that if you must retry your request, the server will know to
786 /// ignore the request if it has already been completed. The server will
787 /// guarantee that for at least 60 minutes since the first request.
788 ///
789 /// For example, consider a situation where you make an initial request and
790 /// the request times out. If you make the request again with the same request
791 /// ID, the server can check if original operation with the same request ID
792 /// was received, and if so, will ignore the second request. This prevents
793 /// clients from accidentally creating duplicate commitments.
794 ///
795 /// The request ID must be a valid UUID with the exception that zero UUID is
796 /// not supported (00000000-0000-0000-0000-000000000000).
797 pub request_id: std::string::String,
798
799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
800}
801
802impl CreateAddressGroupRequest {
803 pub fn new() -> Self {
804 std::default::Default::default()
805 }
806
807 /// Sets the value of [parent][crate::model::CreateAddressGroupRequest::parent].
808 ///
809 /// # Example
810 /// ```ignore,no_run
811 /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
812 /// let x = CreateAddressGroupRequest::new().set_parent("example");
813 /// ```
814 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
815 self.parent = v.into();
816 self
817 }
818
819 /// Sets the value of [address_group_id][crate::model::CreateAddressGroupRequest::address_group_id].
820 ///
821 /// # Example
822 /// ```ignore,no_run
823 /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
824 /// let x = CreateAddressGroupRequest::new().set_address_group_id("example");
825 /// ```
826 pub fn set_address_group_id<T: std::convert::Into<std::string::String>>(
827 mut self,
828 v: T,
829 ) -> Self {
830 self.address_group_id = v.into();
831 self
832 }
833
834 /// Sets the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
835 ///
836 /// # Example
837 /// ```ignore,no_run
838 /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
839 /// use google_cloud_networksecurity_v1::model::AddressGroup;
840 /// let x = CreateAddressGroupRequest::new().set_address_group(AddressGroup::default()/* use setters */);
841 /// ```
842 pub fn set_address_group<T>(mut self, v: T) -> Self
843 where
844 T: std::convert::Into<crate::model::AddressGroup>,
845 {
846 self.address_group = std::option::Option::Some(v.into());
847 self
848 }
849
850 /// Sets or clears the value of [address_group][crate::model::CreateAddressGroupRequest::address_group].
851 ///
852 /// # Example
853 /// ```ignore,no_run
854 /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
855 /// use google_cloud_networksecurity_v1::model::AddressGroup;
856 /// let x = CreateAddressGroupRequest::new().set_or_clear_address_group(Some(AddressGroup::default()/* use setters */));
857 /// let x = CreateAddressGroupRequest::new().set_or_clear_address_group(None::<AddressGroup>);
858 /// ```
859 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
860 where
861 T: std::convert::Into<crate::model::AddressGroup>,
862 {
863 self.address_group = v.map(|x| x.into());
864 self
865 }
866
867 /// Sets the value of [request_id][crate::model::CreateAddressGroupRequest::request_id].
868 ///
869 /// # Example
870 /// ```ignore,no_run
871 /// # use google_cloud_networksecurity_v1::model::CreateAddressGroupRequest;
872 /// let x = CreateAddressGroupRequest::new().set_request_id("example");
873 /// ```
874 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
875 self.request_id = v.into();
876 self
877 }
878}
879
880impl wkt::message::Message for CreateAddressGroupRequest {
881 fn typename() -> &'static str {
882 "type.googleapis.com/google.cloud.networksecurity.v1.CreateAddressGroupRequest"
883 }
884}
885
886/// Request used by the UpdateAddressGroup method.
887#[derive(Clone, Default, PartialEq)]
888#[non_exhaustive]
889pub struct UpdateAddressGroupRequest {
890 /// Optional. Field mask is used to specify the fields to be overwritten in the
891 /// AddressGroup resource by the update.
892 /// The fields specified in the update_mask are relative to the resource, not
893 /// the full request. A field will be overwritten if it is in the mask. If the
894 /// user does not provide a mask then all fields will be overwritten.
895 pub update_mask: std::option::Option<wkt::FieldMask>,
896
897 /// Required. Updated AddressGroup resource.
898 pub address_group: std::option::Option<crate::model::AddressGroup>,
899
900 /// Optional. An optional request ID to identify requests. Specify a unique
901 /// request ID so that if you must retry your request, the server will know to
902 /// ignore the request if it has already been completed. The server will
903 /// guarantee that for at least 60 minutes since the first request.
904 ///
905 /// For example, consider a situation where you make an initial request and
906 /// the request times out. If you make the request again with the same request
907 /// ID, the server can check if original operation with the same request ID
908 /// was received, and if so, will ignore the second request. This prevents
909 /// clients from accidentally creating duplicate commitments.
910 ///
911 /// The request ID must be a valid UUID with the exception that zero UUID is
912 /// not supported (00000000-0000-0000-0000-000000000000).
913 pub request_id: std::string::String,
914
915 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
916}
917
918impl UpdateAddressGroupRequest {
919 pub fn new() -> Self {
920 std::default::Default::default()
921 }
922
923 /// Sets the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
924 ///
925 /// # Example
926 /// ```ignore,no_run
927 /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
928 /// use wkt::FieldMask;
929 /// let x = UpdateAddressGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
930 /// ```
931 pub fn set_update_mask<T>(mut self, v: T) -> Self
932 where
933 T: std::convert::Into<wkt::FieldMask>,
934 {
935 self.update_mask = std::option::Option::Some(v.into());
936 self
937 }
938
939 /// Sets or clears the value of [update_mask][crate::model::UpdateAddressGroupRequest::update_mask].
940 ///
941 /// # Example
942 /// ```ignore,no_run
943 /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
944 /// use wkt::FieldMask;
945 /// let x = UpdateAddressGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
946 /// let x = UpdateAddressGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
947 /// ```
948 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
949 where
950 T: std::convert::Into<wkt::FieldMask>,
951 {
952 self.update_mask = v.map(|x| x.into());
953 self
954 }
955
956 /// Sets the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
957 ///
958 /// # Example
959 /// ```ignore,no_run
960 /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
961 /// use google_cloud_networksecurity_v1::model::AddressGroup;
962 /// let x = UpdateAddressGroupRequest::new().set_address_group(AddressGroup::default()/* use setters */);
963 /// ```
964 pub fn set_address_group<T>(mut self, v: T) -> Self
965 where
966 T: std::convert::Into<crate::model::AddressGroup>,
967 {
968 self.address_group = std::option::Option::Some(v.into());
969 self
970 }
971
972 /// Sets or clears the value of [address_group][crate::model::UpdateAddressGroupRequest::address_group].
973 ///
974 /// # Example
975 /// ```ignore,no_run
976 /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
977 /// use google_cloud_networksecurity_v1::model::AddressGroup;
978 /// let x = UpdateAddressGroupRequest::new().set_or_clear_address_group(Some(AddressGroup::default()/* use setters */));
979 /// let x = UpdateAddressGroupRequest::new().set_or_clear_address_group(None::<AddressGroup>);
980 /// ```
981 pub fn set_or_clear_address_group<T>(mut self, v: std::option::Option<T>) -> Self
982 where
983 T: std::convert::Into<crate::model::AddressGroup>,
984 {
985 self.address_group = v.map(|x| x.into());
986 self
987 }
988
989 /// Sets the value of [request_id][crate::model::UpdateAddressGroupRequest::request_id].
990 ///
991 /// # Example
992 /// ```ignore,no_run
993 /// # use google_cloud_networksecurity_v1::model::UpdateAddressGroupRequest;
994 /// let x = UpdateAddressGroupRequest::new().set_request_id("example");
995 /// ```
996 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
997 self.request_id = v.into();
998 self
999 }
1000}
1001
1002impl wkt::message::Message for UpdateAddressGroupRequest {
1003 fn typename() -> &'static str {
1004 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateAddressGroupRequest"
1005 }
1006}
1007
1008/// Request used by the DeleteAddressGroup method.
1009#[derive(Clone, Default, PartialEq)]
1010#[non_exhaustive]
1011pub struct DeleteAddressGroupRequest {
1012 /// Required. A name of the AddressGroup to delete. Must be in the format
1013 /// `projects/*/locations/{location}/addressGroups/*`.
1014 pub name: std::string::String,
1015
1016 /// Optional. An optional request ID to identify requests. Specify a unique
1017 /// request ID so that if you must retry your request, the server will know to
1018 /// ignore the request if it has already been completed. The server will
1019 /// guarantee that for at least 60 minutes since the first request.
1020 ///
1021 /// For example, consider a situation where you make an initial request and
1022 /// the request times out. If you make the request again with the same request
1023 /// ID, the server can check if original operation with the same request ID
1024 /// was received, and if so, will ignore the second request. This prevents
1025 /// clients from accidentally creating duplicate commitments.
1026 ///
1027 /// The request ID must be a valid UUID with the exception that zero UUID is
1028 /// not supported (00000000-0000-0000-0000-000000000000).
1029 pub request_id: std::string::String,
1030
1031 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1032}
1033
1034impl DeleteAddressGroupRequest {
1035 pub fn new() -> Self {
1036 std::default::Default::default()
1037 }
1038
1039 /// Sets the value of [name][crate::model::DeleteAddressGroupRequest::name].
1040 ///
1041 /// # Example
1042 /// ```ignore,no_run
1043 /// # use google_cloud_networksecurity_v1::model::DeleteAddressGroupRequest;
1044 /// let x = DeleteAddressGroupRequest::new().set_name("example");
1045 /// ```
1046 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1047 self.name = v.into();
1048 self
1049 }
1050
1051 /// Sets the value of [request_id][crate::model::DeleteAddressGroupRequest::request_id].
1052 ///
1053 /// # Example
1054 /// ```ignore,no_run
1055 /// # use google_cloud_networksecurity_v1::model::DeleteAddressGroupRequest;
1056 /// let x = DeleteAddressGroupRequest::new().set_request_id("example");
1057 /// ```
1058 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1059 self.request_id = v.into();
1060 self
1061 }
1062}
1063
1064impl wkt::message::Message for DeleteAddressGroupRequest {
1065 fn typename() -> &'static str {
1066 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteAddressGroupRequest"
1067 }
1068}
1069
1070/// Request used by the AddAddressGroupItems method.
1071#[derive(Clone, Default, PartialEq)]
1072#[non_exhaustive]
1073pub struct AddAddressGroupItemsRequest {
1074 /// Required. A name of the AddressGroup to add items to. Must be in the format
1075 /// `projects|organization/*/locations/{location}/addressGroups/*`.
1076 pub address_group: std::string::String,
1077
1078 /// Required. List of items to add.
1079 pub items: std::vec::Vec<std::string::String>,
1080
1081 /// Optional. An optional request ID to identify requests. Specify a unique
1082 /// request ID so that if you must retry your request, the server will know to
1083 /// ignore the request if it has already been completed. The server will
1084 /// guarantee that for at least 60 minutes since the first request.
1085 ///
1086 /// For example, consider a situation where you make an initial request and
1087 /// the request times out. If you make the request again with the same request
1088 /// ID, the server can check if original operation with the same request ID
1089 /// was received, and if so, will ignore the second request. This prevents
1090 /// clients from accidentally creating duplicate commitments.
1091 ///
1092 /// The request ID must be a valid UUID with the exception that zero UUID is
1093 /// not supported (00000000-0000-0000-0000-000000000000).
1094 pub request_id: std::string::String,
1095
1096 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1097}
1098
1099impl AddAddressGroupItemsRequest {
1100 pub fn new() -> Self {
1101 std::default::Default::default()
1102 }
1103
1104 /// Sets the value of [address_group][crate::model::AddAddressGroupItemsRequest::address_group].
1105 ///
1106 /// # Example
1107 /// ```ignore,no_run
1108 /// # use google_cloud_networksecurity_v1::model::AddAddressGroupItemsRequest;
1109 /// let x = AddAddressGroupItemsRequest::new().set_address_group("example");
1110 /// ```
1111 pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1112 self.address_group = v.into();
1113 self
1114 }
1115
1116 /// Sets the value of [items][crate::model::AddAddressGroupItemsRequest::items].
1117 ///
1118 /// # Example
1119 /// ```ignore,no_run
1120 /// # use google_cloud_networksecurity_v1::model::AddAddressGroupItemsRequest;
1121 /// let x = AddAddressGroupItemsRequest::new().set_items(["a", "b", "c"]);
1122 /// ```
1123 pub fn set_items<T, V>(mut self, v: T) -> Self
1124 where
1125 T: std::iter::IntoIterator<Item = V>,
1126 V: std::convert::Into<std::string::String>,
1127 {
1128 use std::iter::Iterator;
1129 self.items = v.into_iter().map(|i| i.into()).collect();
1130 self
1131 }
1132
1133 /// Sets the value of [request_id][crate::model::AddAddressGroupItemsRequest::request_id].
1134 ///
1135 /// # Example
1136 /// ```ignore,no_run
1137 /// # use google_cloud_networksecurity_v1::model::AddAddressGroupItemsRequest;
1138 /// let x = AddAddressGroupItemsRequest::new().set_request_id("example");
1139 /// ```
1140 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1141 self.request_id = v.into();
1142 self
1143 }
1144}
1145
1146impl wkt::message::Message for AddAddressGroupItemsRequest {
1147 fn typename() -> &'static str {
1148 "type.googleapis.com/google.cloud.networksecurity.v1.AddAddressGroupItemsRequest"
1149 }
1150}
1151
1152/// Request used by the RemoveAddressGroupItems method.
1153#[derive(Clone, Default, PartialEq)]
1154#[non_exhaustive]
1155pub struct RemoveAddressGroupItemsRequest {
1156 /// Required. A name of the AddressGroup to remove items from. Must be in the
1157 /// format `projects|organization/*/locations/{location}/addressGroups/*`.
1158 pub address_group: std::string::String,
1159
1160 /// Required. List of items to remove.
1161 pub items: std::vec::Vec<std::string::String>,
1162
1163 /// Optional. An optional request ID to identify requests. Specify a unique
1164 /// request ID so that if you must retry your request, the server will know to
1165 /// ignore the request if it has already been completed. The server will
1166 /// guarantee that for at least 60 minutes since the first request.
1167 ///
1168 /// For example, consider a situation where you make an initial request and
1169 /// the request times out. If you make the request again with the same request
1170 /// ID, the server can check if original operation with the same request ID
1171 /// was received, and if so, will ignore the second request. This prevents
1172 /// clients from accidentally creating duplicate commitments.
1173 ///
1174 /// The request ID must be a valid UUID with the exception that zero UUID is
1175 /// not supported (00000000-0000-0000-0000-000000000000).
1176 pub request_id: std::string::String,
1177
1178 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1179}
1180
1181impl RemoveAddressGroupItemsRequest {
1182 pub fn new() -> Self {
1183 std::default::Default::default()
1184 }
1185
1186 /// Sets the value of [address_group][crate::model::RemoveAddressGroupItemsRequest::address_group].
1187 ///
1188 /// # Example
1189 /// ```ignore,no_run
1190 /// # use google_cloud_networksecurity_v1::model::RemoveAddressGroupItemsRequest;
1191 /// let x = RemoveAddressGroupItemsRequest::new().set_address_group("example");
1192 /// ```
1193 pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1194 self.address_group = v.into();
1195 self
1196 }
1197
1198 /// Sets the value of [items][crate::model::RemoveAddressGroupItemsRequest::items].
1199 ///
1200 /// # Example
1201 /// ```ignore,no_run
1202 /// # use google_cloud_networksecurity_v1::model::RemoveAddressGroupItemsRequest;
1203 /// let x = RemoveAddressGroupItemsRequest::new().set_items(["a", "b", "c"]);
1204 /// ```
1205 pub fn set_items<T, V>(mut self, v: T) -> Self
1206 where
1207 T: std::iter::IntoIterator<Item = V>,
1208 V: std::convert::Into<std::string::String>,
1209 {
1210 use std::iter::Iterator;
1211 self.items = v.into_iter().map(|i| i.into()).collect();
1212 self
1213 }
1214
1215 /// Sets the value of [request_id][crate::model::RemoveAddressGroupItemsRequest::request_id].
1216 ///
1217 /// # Example
1218 /// ```ignore,no_run
1219 /// # use google_cloud_networksecurity_v1::model::RemoveAddressGroupItemsRequest;
1220 /// let x = RemoveAddressGroupItemsRequest::new().set_request_id("example");
1221 /// ```
1222 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1223 self.request_id = v.into();
1224 self
1225 }
1226}
1227
1228impl wkt::message::Message for RemoveAddressGroupItemsRequest {
1229 fn typename() -> &'static str {
1230 "type.googleapis.com/google.cloud.networksecurity.v1.RemoveAddressGroupItemsRequest"
1231 }
1232}
1233
1234/// Request used by the CloneAddressGroupItems method.
1235#[derive(Clone, Default, PartialEq)]
1236#[non_exhaustive]
1237pub struct CloneAddressGroupItemsRequest {
1238 /// Required. A name of the AddressGroup to clone items to. Must be in the
1239 /// format `projects|organization/*/locations/{location}/addressGroups/*`.
1240 pub address_group: std::string::String,
1241
1242 /// Required. Source address group to clone items from.
1243 pub source_address_group: std::string::String,
1244
1245 /// Optional. An optional request ID to identify requests. Specify a unique
1246 /// request ID so that if you must retry your request, the server will know to
1247 /// ignore the request if it has already been completed. The server will
1248 /// guarantee that for at least 60 minutes since the first request.
1249 ///
1250 /// For example, consider a situation where you make an initial request and
1251 /// the request times out. If you make the request again with the same request
1252 /// ID, the server can check if original operation with the same request ID
1253 /// was received, and if so, will ignore the second request. This prevents
1254 /// clients from accidentally creating duplicate commitments.
1255 ///
1256 /// The request ID must be a valid UUID with the exception that zero UUID is
1257 /// not supported (00000000-0000-0000-0000-000000000000).
1258 pub request_id: std::string::String,
1259
1260 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1261}
1262
1263impl CloneAddressGroupItemsRequest {
1264 pub fn new() -> Self {
1265 std::default::Default::default()
1266 }
1267
1268 /// Sets the value of [address_group][crate::model::CloneAddressGroupItemsRequest::address_group].
1269 ///
1270 /// # Example
1271 /// ```ignore,no_run
1272 /// # use google_cloud_networksecurity_v1::model::CloneAddressGroupItemsRequest;
1273 /// let x = CloneAddressGroupItemsRequest::new().set_address_group("example");
1274 /// ```
1275 pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1276 self.address_group = v.into();
1277 self
1278 }
1279
1280 /// Sets the value of [source_address_group][crate::model::CloneAddressGroupItemsRequest::source_address_group].
1281 ///
1282 /// # Example
1283 /// ```ignore,no_run
1284 /// # use google_cloud_networksecurity_v1::model::CloneAddressGroupItemsRequest;
1285 /// let x = CloneAddressGroupItemsRequest::new().set_source_address_group("example");
1286 /// ```
1287 pub fn set_source_address_group<T: std::convert::Into<std::string::String>>(
1288 mut self,
1289 v: T,
1290 ) -> Self {
1291 self.source_address_group = v.into();
1292 self
1293 }
1294
1295 /// Sets the value of [request_id][crate::model::CloneAddressGroupItemsRequest::request_id].
1296 ///
1297 /// # Example
1298 /// ```ignore,no_run
1299 /// # use google_cloud_networksecurity_v1::model::CloneAddressGroupItemsRequest;
1300 /// let x = CloneAddressGroupItemsRequest::new().set_request_id("example");
1301 /// ```
1302 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1303 self.request_id = v.into();
1304 self
1305 }
1306}
1307
1308impl wkt::message::Message for CloneAddressGroupItemsRequest {
1309 fn typename() -> &'static str {
1310 "type.googleapis.com/google.cloud.networksecurity.v1.CloneAddressGroupItemsRequest"
1311 }
1312}
1313
1314/// Request used by the ListAddressGroupReferences method.
1315#[derive(Clone, Default, PartialEq)]
1316#[non_exhaustive]
1317pub struct ListAddressGroupReferencesRequest {
1318 /// Required. A name of the AddressGroup to clone items to. Must be in the
1319 /// format `projects|organization/*/locations/{location}/addressGroups/*`.
1320 pub address_group: std::string::String,
1321
1322 /// The maximum number of references to return. If unspecified, server
1323 /// will pick an appropriate default. Server may return fewer items than
1324 /// requested. A caller should only rely on response's
1325 /// [next_page_token][google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse.next_page_token]
1326 /// to determine if there are more AddressGroupUsers left to be queried.
1327 ///
1328 /// [google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse.next_page_token]: crate::model::ListAddressGroupReferencesResponse::next_page_token
1329 pub page_size: i32,
1330
1331 /// The next_page_token value returned from a previous List request,
1332 /// if any.
1333 pub page_token: std::string::String,
1334
1335 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1336}
1337
1338impl ListAddressGroupReferencesRequest {
1339 pub fn new() -> Self {
1340 std::default::Default::default()
1341 }
1342
1343 /// Sets the value of [address_group][crate::model::ListAddressGroupReferencesRequest::address_group].
1344 ///
1345 /// # Example
1346 /// ```ignore,no_run
1347 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesRequest;
1348 /// let x = ListAddressGroupReferencesRequest::new().set_address_group("example");
1349 /// ```
1350 pub fn set_address_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1351 self.address_group = v.into();
1352 self
1353 }
1354
1355 /// Sets the value of [page_size][crate::model::ListAddressGroupReferencesRequest::page_size].
1356 ///
1357 /// # Example
1358 /// ```ignore,no_run
1359 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesRequest;
1360 /// let x = ListAddressGroupReferencesRequest::new().set_page_size(42);
1361 /// ```
1362 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1363 self.page_size = v.into();
1364 self
1365 }
1366
1367 /// Sets the value of [page_token][crate::model::ListAddressGroupReferencesRequest::page_token].
1368 ///
1369 /// # Example
1370 /// ```ignore,no_run
1371 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesRequest;
1372 /// let x = ListAddressGroupReferencesRequest::new().set_page_token("example");
1373 /// ```
1374 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1375 self.page_token = v.into();
1376 self
1377 }
1378}
1379
1380impl wkt::message::Message for ListAddressGroupReferencesRequest {
1381 fn typename() -> &'static str {
1382 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesRequest"
1383 }
1384}
1385
1386/// Response of the ListAddressGroupReferences method.
1387#[derive(Clone, Default, PartialEq)]
1388#[non_exhaustive]
1389pub struct ListAddressGroupReferencesResponse {
1390 /// A list of references that matches the specified filter in the request.
1391 pub address_group_references:
1392 std::vec::Vec<crate::model::list_address_group_references_response::AddressGroupReference>,
1393
1394 /// If there might be more results than those appearing in this response, then
1395 /// `next_page_token` is included. To get the next set of results, call this
1396 /// method again using the value of `next_page_token` as `page_token`.
1397 pub next_page_token: std::string::String,
1398
1399 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1400}
1401
1402impl ListAddressGroupReferencesResponse {
1403 pub fn new() -> Self {
1404 std::default::Default::default()
1405 }
1406
1407 /// Sets the value of [address_group_references][crate::model::ListAddressGroupReferencesResponse::address_group_references].
1408 ///
1409 /// # Example
1410 /// ```ignore,no_run
1411 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesResponse;
1412 /// use google_cloud_networksecurity_v1::model::list_address_group_references_response::AddressGroupReference;
1413 /// let x = ListAddressGroupReferencesResponse::new()
1414 /// .set_address_group_references([
1415 /// AddressGroupReference::default()/* use setters */,
1416 /// AddressGroupReference::default()/* use (different) setters */,
1417 /// ]);
1418 /// ```
1419 pub fn set_address_group_references<T, V>(mut self, v: T) -> Self
1420 where
1421 T: std::iter::IntoIterator<Item = V>,
1422 V: std::convert::Into<
1423 crate::model::list_address_group_references_response::AddressGroupReference,
1424 >,
1425 {
1426 use std::iter::Iterator;
1427 self.address_group_references = v.into_iter().map(|i| i.into()).collect();
1428 self
1429 }
1430
1431 /// Sets the value of [next_page_token][crate::model::ListAddressGroupReferencesResponse::next_page_token].
1432 ///
1433 /// # Example
1434 /// ```ignore,no_run
1435 /// # use google_cloud_networksecurity_v1::model::ListAddressGroupReferencesResponse;
1436 /// let x = ListAddressGroupReferencesResponse::new().set_next_page_token("example");
1437 /// ```
1438 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1439 self.next_page_token = v.into();
1440 self
1441 }
1442}
1443
1444impl wkt::message::Message for ListAddressGroupReferencesResponse {
1445 fn typename() -> &'static str {
1446 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse"
1447 }
1448}
1449
1450#[doc(hidden)]
1451impl google_cloud_gax::paginator::internal::PageableResponse
1452 for ListAddressGroupReferencesResponse
1453{
1454 type PageItem = crate::model::list_address_group_references_response::AddressGroupReference;
1455
1456 fn items(self) -> std::vec::Vec<Self::PageItem> {
1457 self.address_group_references
1458 }
1459
1460 fn next_page_token(&self) -> std::string::String {
1461 use std::clone::Clone;
1462 self.next_page_token.clone()
1463 }
1464}
1465
1466/// Defines additional types related to [ListAddressGroupReferencesResponse].
1467pub mod list_address_group_references_response {
1468 #[allow(unused_imports)]
1469 use super::*;
1470
1471 /// The Reference of AddressGroup.
1472 #[derive(Clone, Default, PartialEq)]
1473 #[non_exhaustive]
1474 pub struct AddressGroupReference {
1475 /// FirewallPolicy that is using the Address Group.
1476 pub firewall_policy: std::string::String,
1477
1478 /// Cloud Armor SecurityPolicy that is using the Address Group.
1479 pub security_policy: std::string::String,
1480
1481 /// Rule priority of the FirewallPolicy that is using the Address Group.
1482 pub rule_priority: i32,
1483
1484 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1485 }
1486
1487 impl AddressGroupReference {
1488 pub fn new() -> Self {
1489 std::default::Default::default()
1490 }
1491
1492 /// Sets the value of [firewall_policy][crate::model::list_address_group_references_response::AddressGroupReference::firewall_policy].
1493 ///
1494 /// # Example
1495 /// ```ignore,no_run
1496 /// # use google_cloud_networksecurity_v1::model::list_address_group_references_response::AddressGroupReference;
1497 /// let x = AddressGroupReference::new().set_firewall_policy("example");
1498 /// ```
1499 pub fn set_firewall_policy<T: std::convert::Into<std::string::String>>(
1500 mut self,
1501 v: T,
1502 ) -> Self {
1503 self.firewall_policy = v.into();
1504 self
1505 }
1506
1507 /// Sets the value of [security_policy][crate::model::list_address_group_references_response::AddressGroupReference::security_policy].
1508 ///
1509 /// # Example
1510 /// ```ignore,no_run
1511 /// # use google_cloud_networksecurity_v1::model::list_address_group_references_response::AddressGroupReference;
1512 /// let x = AddressGroupReference::new().set_security_policy("example");
1513 /// ```
1514 pub fn set_security_policy<T: std::convert::Into<std::string::String>>(
1515 mut self,
1516 v: T,
1517 ) -> Self {
1518 self.security_policy = v.into();
1519 self
1520 }
1521
1522 /// Sets the value of [rule_priority][crate::model::list_address_group_references_response::AddressGroupReference::rule_priority].
1523 ///
1524 /// # Example
1525 /// ```ignore,no_run
1526 /// # use google_cloud_networksecurity_v1::model::list_address_group_references_response::AddressGroupReference;
1527 /// let x = AddressGroupReference::new().set_rule_priority(42);
1528 /// ```
1529 pub fn set_rule_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1530 self.rule_priority = v.into();
1531 self
1532 }
1533 }
1534
1535 impl wkt::message::Message for AddressGroupReference {
1536 fn typename() -> &'static str {
1537 "type.googleapis.com/google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse.AddressGroupReference"
1538 }
1539 }
1540}
1541
1542/// AuthorizationPolicy is a resource that specifies how a server
1543/// should authorize incoming connections. This resource in itself does
1544/// not change the configuration unless it's attached to a target https
1545/// proxy or endpoint config selector resource.
1546#[derive(Clone, Default, PartialEq)]
1547#[non_exhaustive]
1548pub struct AuthorizationPolicy {
1549 /// Required. Name of the AuthorizationPolicy resource. It matches pattern
1550 /// `projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`.
1551 pub name: std::string::String,
1552
1553 /// Optional. Free-text description of the resource.
1554 pub description: std::string::String,
1555
1556 /// Output only. The timestamp when the resource was created.
1557 pub create_time: std::option::Option<wkt::Timestamp>,
1558
1559 /// Output only. The timestamp when the resource was updated.
1560 pub update_time: std::option::Option<wkt::Timestamp>,
1561
1562 /// Optional. Set of label tags associated with the AuthorizationPolicy
1563 /// resource.
1564 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1565
1566 /// Required. The action to take when a rule match is found. Possible values
1567 /// are "ALLOW" or "DENY".
1568 pub action: crate::model::authorization_policy::Action,
1569
1570 /// Optional. List of rules to match. Note that at least one of the rules must
1571 /// match in order for the action specified in the 'action' field to be taken.
1572 /// A rule is a match if there is a matching source and destination. If left
1573 /// blank, the action specified in the `action` field will be applied on every
1574 /// request.
1575 pub rules: std::vec::Vec<crate::model::authorization_policy::Rule>,
1576
1577 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1578}
1579
1580impl AuthorizationPolicy {
1581 pub fn new() -> Self {
1582 std::default::Default::default()
1583 }
1584
1585 /// Sets the value of [name][crate::model::AuthorizationPolicy::name].
1586 ///
1587 /// # Example
1588 /// ```ignore,no_run
1589 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1590 /// let x = AuthorizationPolicy::new().set_name("example");
1591 /// ```
1592 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1593 self.name = v.into();
1594 self
1595 }
1596
1597 /// Sets the value of [description][crate::model::AuthorizationPolicy::description].
1598 ///
1599 /// # Example
1600 /// ```ignore,no_run
1601 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1602 /// let x = AuthorizationPolicy::new().set_description("example");
1603 /// ```
1604 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1605 self.description = v.into();
1606 self
1607 }
1608
1609 /// Sets the value of [create_time][crate::model::AuthorizationPolicy::create_time].
1610 ///
1611 /// # Example
1612 /// ```ignore,no_run
1613 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1614 /// use wkt::Timestamp;
1615 /// let x = AuthorizationPolicy::new().set_create_time(Timestamp::default()/* use setters */);
1616 /// ```
1617 pub fn set_create_time<T>(mut self, v: T) -> Self
1618 where
1619 T: std::convert::Into<wkt::Timestamp>,
1620 {
1621 self.create_time = std::option::Option::Some(v.into());
1622 self
1623 }
1624
1625 /// Sets or clears the value of [create_time][crate::model::AuthorizationPolicy::create_time].
1626 ///
1627 /// # Example
1628 /// ```ignore,no_run
1629 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1630 /// use wkt::Timestamp;
1631 /// let x = AuthorizationPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1632 /// let x = AuthorizationPolicy::new().set_or_clear_create_time(None::<Timestamp>);
1633 /// ```
1634 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1635 where
1636 T: std::convert::Into<wkt::Timestamp>,
1637 {
1638 self.create_time = v.map(|x| x.into());
1639 self
1640 }
1641
1642 /// Sets the value of [update_time][crate::model::AuthorizationPolicy::update_time].
1643 ///
1644 /// # Example
1645 /// ```ignore,no_run
1646 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1647 /// use wkt::Timestamp;
1648 /// let x = AuthorizationPolicy::new().set_update_time(Timestamp::default()/* use setters */);
1649 /// ```
1650 pub fn set_update_time<T>(mut self, v: T) -> Self
1651 where
1652 T: std::convert::Into<wkt::Timestamp>,
1653 {
1654 self.update_time = std::option::Option::Some(v.into());
1655 self
1656 }
1657
1658 /// Sets or clears the value of [update_time][crate::model::AuthorizationPolicy::update_time].
1659 ///
1660 /// # Example
1661 /// ```ignore,no_run
1662 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1663 /// use wkt::Timestamp;
1664 /// let x = AuthorizationPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1665 /// let x = AuthorizationPolicy::new().set_or_clear_update_time(None::<Timestamp>);
1666 /// ```
1667 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1668 where
1669 T: std::convert::Into<wkt::Timestamp>,
1670 {
1671 self.update_time = v.map(|x| x.into());
1672 self
1673 }
1674
1675 /// Sets the value of [labels][crate::model::AuthorizationPolicy::labels].
1676 ///
1677 /// # Example
1678 /// ```ignore,no_run
1679 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1680 /// let x = AuthorizationPolicy::new().set_labels([
1681 /// ("key0", "abc"),
1682 /// ("key1", "xyz"),
1683 /// ]);
1684 /// ```
1685 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1686 where
1687 T: std::iter::IntoIterator<Item = (K, V)>,
1688 K: std::convert::Into<std::string::String>,
1689 V: std::convert::Into<std::string::String>,
1690 {
1691 use std::iter::Iterator;
1692 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1693 self
1694 }
1695
1696 /// Sets the value of [action][crate::model::AuthorizationPolicy::action].
1697 ///
1698 /// # Example
1699 /// ```ignore,no_run
1700 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1701 /// use google_cloud_networksecurity_v1::model::authorization_policy::Action;
1702 /// let x0 = AuthorizationPolicy::new().set_action(Action::Allow);
1703 /// let x1 = AuthorizationPolicy::new().set_action(Action::Deny);
1704 /// ```
1705 pub fn set_action<T: std::convert::Into<crate::model::authorization_policy::Action>>(
1706 mut self,
1707 v: T,
1708 ) -> Self {
1709 self.action = v.into();
1710 self
1711 }
1712
1713 /// Sets the value of [rules][crate::model::AuthorizationPolicy::rules].
1714 ///
1715 /// # Example
1716 /// ```ignore,no_run
1717 /// # use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
1718 /// use google_cloud_networksecurity_v1::model::authorization_policy::Rule;
1719 /// let x = AuthorizationPolicy::new()
1720 /// .set_rules([
1721 /// Rule::default()/* use setters */,
1722 /// Rule::default()/* use (different) setters */,
1723 /// ]);
1724 /// ```
1725 pub fn set_rules<T, V>(mut self, v: T) -> Self
1726 where
1727 T: std::iter::IntoIterator<Item = V>,
1728 V: std::convert::Into<crate::model::authorization_policy::Rule>,
1729 {
1730 use std::iter::Iterator;
1731 self.rules = v.into_iter().map(|i| i.into()).collect();
1732 self
1733 }
1734}
1735
1736impl wkt::message::Message for AuthorizationPolicy {
1737 fn typename() -> &'static str {
1738 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy"
1739 }
1740}
1741
1742/// Defines additional types related to [AuthorizationPolicy].
1743pub mod authorization_policy {
1744 #[allow(unused_imports)]
1745 use super::*;
1746
1747 /// Specification of rules.
1748 #[derive(Clone, Default, PartialEq)]
1749 #[non_exhaustive]
1750 pub struct Rule {
1751 /// Optional. List of attributes for the traffic source. All of the sources
1752 /// must match. A source is a match if both principals and ip_blocks match.
1753 /// If not set, the action specified in the 'action' field will be applied
1754 /// without any rule checks for the source.
1755 pub sources: std::vec::Vec<crate::model::authorization_policy::rule::Source>,
1756
1757 /// Optional. List of attributes for the traffic destination. All of the
1758 /// destinations must match. A destination is a match if a request matches
1759 /// all the specified hosts, ports, methods and headers. If not set, the
1760 /// action specified in the 'action' field will be applied without any rule
1761 /// checks for the destination.
1762 pub destinations: std::vec::Vec<crate::model::authorization_policy::rule::Destination>,
1763
1764 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1765 }
1766
1767 impl Rule {
1768 pub fn new() -> Self {
1769 std::default::Default::default()
1770 }
1771
1772 /// Sets the value of [sources][crate::model::authorization_policy::Rule::sources].
1773 ///
1774 /// # Example
1775 /// ```ignore,no_run
1776 /// # use google_cloud_networksecurity_v1::model::authorization_policy::Rule;
1777 /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::Source;
1778 /// let x = Rule::new()
1779 /// .set_sources([
1780 /// Source::default()/* use setters */,
1781 /// Source::default()/* use (different) setters */,
1782 /// ]);
1783 /// ```
1784 pub fn set_sources<T, V>(mut self, v: T) -> Self
1785 where
1786 T: std::iter::IntoIterator<Item = V>,
1787 V: std::convert::Into<crate::model::authorization_policy::rule::Source>,
1788 {
1789 use std::iter::Iterator;
1790 self.sources = v.into_iter().map(|i| i.into()).collect();
1791 self
1792 }
1793
1794 /// Sets the value of [destinations][crate::model::authorization_policy::Rule::destinations].
1795 ///
1796 /// # Example
1797 /// ```ignore,no_run
1798 /// # use google_cloud_networksecurity_v1::model::authorization_policy::Rule;
1799 /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
1800 /// let x = Rule::new()
1801 /// .set_destinations([
1802 /// Destination::default()/* use setters */,
1803 /// Destination::default()/* use (different) setters */,
1804 /// ]);
1805 /// ```
1806 pub fn set_destinations<T, V>(mut self, v: T) -> Self
1807 where
1808 T: std::iter::IntoIterator<Item = V>,
1809 V: std::convert::Into<crate::model::authorization_policy::rule::Destination>,
1810 {
1811 use std::iter::Iterator;
1812 self.destinations = v.into_iter().map(|i| i.into()).collect();
1813 self
1814 }
1815 }
1816
1817 impl wkt::message::Message for Rule {
1818 fn typename() -> &'static str {
1819 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule"
1820 }
1821 }
1822
1823 /// Defines additional types related to [Rule].
1824 pub mod rule {
1825 #[allow(unused_imports)]
1826 use super::*;
1827
1828 /// Specification of traffic source attributes.
1829 #[derive(Clone, Default, PartialEq)]
1830 #[non_exhaustive]
1831 pub struct Source {
1832 /// Optional. List of peer identities to match for authorization. At least
1833 /// one principal should match. Each peer can be an exact match, or a
1834 /// prefix match (example, "namespace/*") or a suffix match (example,
1835 /// "*/service-account") or a presence match "*". Authorization based on
1836 /// the principal name without certificate validation (configured by
1837 /// ServerTlsPolicy resource) is considered insecure.
1838 pub principals: std::vec::Vec<std::string::String>,
1839
1840 /// Optional. List of CIDR ranges to match based on source IP address. At
1841 /// least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
1842 /// (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
1843 /// alone should be avoided. The IP addresses of any load balancers or
1844 /// proxies should be considered untrusted.
1845 pub ip_blocks: std::vec::Vec<std::string::String>,
1846
1847 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1848 }
1849
1850 impl Source {
1851 pub fn new() -> Self {
1852 std::default::Default::default()
1853 }
1854
1855 /// Sets the value of [principals][crate::model::authorization_policy::rule::Source::principals].
1856 ///
1857 /// # Example
1858 /// ```ignore,no_run
1859 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Source;
1860 /// let x = Source::new().set_principals(["a", "b", "c"]);
1861 /// ```
1862 pub fn set_principals<T, V>(mut self, v: T) -> Self
1863 where
1864 T: std::iter::IntoIterator<Item = V>,
1865 V: std::convert::Into<std::string::String>,
1866 {
1867 use std::iter::Iterator;
1868 self.principals = v.into_iter().map(|i| i.into()).collect();
1869 self
1870 }
1871
1872 /// Sets the value of [ip_blocks][crate::model::authorization_policy::rule::Source::ip_blocks].
1873 ///
1874 /// # Example
1875 /// ```ignore,no_run
1876 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Source;
1877 /// let x = Source::new().set_ip_blocks(["a", "b", "c"]);
1878 /// ```
1879 pub fn set_ip_blocks<T, V>(mut self, v: T) -> Self
1880 where
1881 T: std::iter::IntoIterator<Item = V>,
1882 V: std::convert::Into<std::string::String>,
1883 {
1884 use std::iter::Iterator;
1885 self.ip_blocks = v.into_iter().map(|i| i.into()).collect();
1886 self
1887 }
1888 }
1889
1890 impl wkt::message::Message for Source {
1891 fn typename() -> &'static str {
1892 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Source"
1893 }
1894 }
1895
1896 /// Specification of traffic destination attributes.
1897 #[derive(Clone, Default, PartialEq)]
1898 #[non_exhaustive]
1899 pub struct Destination {
1900 /// Required. List of host names to match. Matched against the ":authority"
1901 /// header in http requests. At least one host should match. Each host can
1902 /// be an exact match, or a prefix match (example "mydomain.*") or a suffix
1903 /// match (example "*.myorg.com") or a presence (any) match "*".
1904 pub hosts: std::vec::Vec<std::string::String>,
1905
1906 /// Required. List of destination ports to match. At least one port should
1907 /// match.
1908 pub ports: std::vec::Vec<u32>,
1909
1910 /// Optional. A list of HTTP methods to match. At least one method should
1911 /// match. Should not be set for gRPC services.
1912 pub methods: std::vec::Vec<std::string::String>,
1913
1914 /// Optional. Match against key:value pair in http header. Provides a
1915 /// flexible match based on HTTP headers, for potentially advanced use
1916 /// cases. At least one header should match. Avoid using header matches to
1917 /// make authorization decisions unless there is a strong guarantee that
1918 /// requests arrive through a trusted client or proxy.
1919 pub http_header_match: std::option::Option<
1920 crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
1921 >,
1922
1923 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1924 }
1925
1926 impl Destination {
1927 pub fn new() -> Self {
1928 std::default::Default::default()
1929 }
1930
1931 /// Sets the value of [hosts][crate::model::authorization_policy::rule::Destination::hosts].
1932 ///
1933 /// # Example
1934 /// ```ignore,no_run
1935 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
1936 /// let x = Destination::new().set_hosts(["a", "b", "c"]);
1937 /// ```
1938 pub fn set_hosts<T, V>(mut self, v: T) -> Self
1939 where
1940 T: std::iter::IntoIterator<Item = V>,
1941 V: std::convert::Into<std::string::String>,
1942 {
1943 use std::iter::Iterator;
1944 self.hosts = v.into_iter().map(|i| i.into()).collect();
1945 self
1946 }
1947
1948 /// Sets the value of [ports][crate::model::authorization_policy::rule::Destination::ports].
1949 ///
1950 /// # Example
1951 /// ```ignore,no_run
1952 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
1953 /// let x = Destination::new().set_ports([1_u32, 2_u32, 3_u32]);
1954 /// ```
1955 pub fn set_ports<T, V>(mut self, v: T) -> Self
1956 where
1957 T: std::iter::IntoIterator<Item = V>,
1958 V: std::convert::Into<u32>,
1959 {
1960 use std::iter::Iterator;
1961 self.ports = v.into_iter().map(|i| i.into()).collect();
1962 self
1963 }
1964
1965 /// Sets the value of [methods][crate::model::authorization_policy::rule::Destination::methods].
1966 ///
1967 /// # Example
1968 /// ```ignore,no_run
1969 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
1970 /// let x = Destination::new().set_methods(["a", "b", "c"]);
1971 /// ```
1972 pub fn set_methods<T, V>(mut self, v: T) -> Self
1973 where
1974 T: std::iter::IntoIterator<Item = V>,
1975 V: std::convert::Into<std::string::String>,
1976 {
1977 use std::iter::Iterator;
1978 self.methods = v.into_iter().map(|i| i.into()).collect();
1979 self
1980 }
1981
1982 /// Sets the value of [http_header_match][crate::model::authorization_policy::rule::Destination::http_header_match].
1983 ///
1984 /// # Example
1985 /// ```ignore,no_run
1986 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
1987 /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
1988 /// let x = Destination::new().set_http_header_match(HttpHeaderMatch::default()/* use setters */);
1989 /// ```
1990 pub fn set_http_header_match<T>(mut self, v: T) -> Self
1991 where
1992 T: std::convert::Into<
1993 crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
1994 >,
1995 {
1996 self.http_header_match = std::option::Option::Some(v.into());
1997 self
1998 }
1999
2000 /// Sets or clears the value of [http_header_match][crate::model::authorization_policy::rule::Destination::http_header_match].
2001 ///
2002 /// # Example
2003 /// ```ignore,no_run
2004 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::Destination;
2005 /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2006 /// let x = Destination::new().set_or_clear_http_header_match(Some(HttpHeaderMatch::default()/* use setters */));
2007 /// let x = Destination::new().set_or_clear_http_header_match(None::<HttpHeaderMatch>);
2008 /// ```
2009 pub fn set_or_clear_http_header_match<T>(mut self, v: std::option::Option<T>) -> Self
2010 where
2011 T: std::convert::Into<
2012 crate::model::authorization_policy::rule::destination::HttpHeaderMatch,
2013 >,
2014 {
2015 self.http_header_match = v.map(|x| x.into());
2016 self
2017 }
2018 }
2019
2020 impl wkt::message::Message for Destination {
2021 fn typename() -> &'static str {
2022 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination"
2023 }
2024 }
2025
2026 /// Defines additional types related to [Destination].
2027 pub mod destination {
2028 #[allow(unused_imports)]
2029 use super::*;
2030
2031 /// Specification of HTTP header match attributes.
2032 #[derive(Clone, Default, PartialEq)]
2033 #[non_exhaustive]
2034 pub struct HttpHeaderMatch {
2035 /// Required. The name of the HTTP header to match. For matching
2036 /// against the HTTP request's authority, use a headerMatch
2037 /// with the header name ":authority". For matching a
2038 /// request's method, use the headerName ":method".
2039 pub header_name: std::string::String,
2040
2041 pub r#type: std::option::Option<
2042 crate::model::authorization_policy::rule::destination::http_header_match::Type,
2043 >,
2044
2045 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2046 }
2047
2048 impl HttpHeaderMatch {
2049 pub fn new() -> Self {
2050 std::default::Default::default()
2051 }
2052
2053 /// Sets the value of [header_name][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::header_name].
2054 ///
2055 /// # Example
2056 /// ```ignore,no_run
2057 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2058 /// let x = HttpHeaderMatch::new().set_header_name("example");
2059 /// ```
2060 pub fn set_header_name<T: std::convert::Into<std::string::String>>(
2061 mut self,
2062 v: T,
2063 ) -> Self {
2064 self.header_name = v.into();
2065 self
2066 }
2067
2068 /// Sets the value of [r#type][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::type].
2069 ///
2070 /// Note that all the setters affecting `r#type` are mutually
2071 /// exclusive.
2072 ///
2073 /// # Example
2074 /// ```ignore,no_run
2075 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2076 /// use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::http_header_match::Type;
2077 /// let x = HttpHeaderMatch::new().set_type(Some(Type::RegexMatch("example".to_string())));
2078 /// ```
2079 pub fn set_type<T: std::convert::Into<std::option::Option<crate::model::authorization_policy::rule::destination::http_header_match::Type>>>(mut self, v: T) -> Self
2080 {
2081 self.r#type = v.into();
2082 self
2083 }
2084
2085 /// The value of [r#type][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::r#type]
2086 /// if it holds a `RegexMatch`, `None` if the field is not set or
2087 /// holds a different branch.
2088 pub fn regex_match(&self) -> std::option::Option<&std::string::String> {
2089 #[allow(unreachable_patterns)]
2090 self.r#type.as_ref().and_then(|v| match v {
2091 crate::model::authorization_policy::rule::destination::http_header_match::Type::RegexMatch(v) => std::option::Option::Some(v),
2092 _ => std::option::Option::None,
2093 })
2094 }
2095
2096 /// Sets the value of [r#type][crate::model::authorization_policy::rule::destination::HttpHeaderMatch::r#type]
2097 /// to hold a `RegexMatch`.
2098 ///
2099 /// Note that all the setters affecting `r#type` are
2100 /// mutually exclusive.
2101 ///
2102 /// # Example
2103 /// ```ignore,no_run
2104 /// # use google_cloud_networksecurity_v1::model::authorization_policy::rule::destination::HttpHeaderMatch;
2105 /// let x = HttpHeaderMatch::new().set_regex_match("example");
2106 /// assert!(x.regex_match().is_some());
2107 /// ```
2108 pub fn set_regex_match<T: std::convert::Into<std::string::String>>(
2109 mut self,
2110 v: T,
2111 ) -> Self {
2112 self.r#type = std::option::Option::Some(
2113 crate::model::authorization_policy::rule::destination::http_header_match::Type::RegexMatch(
2114 v.into()
2115 )
2116 );
2117 self
2118 }
2119 }
2120
2121 impl wkt::message::Message for HttpHeaderMatch {
2122 fn typename() -> &'static str {
2123 "type.googleapis.com/google.cloud.networksecurity.v1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch"
2124 }
2125 }
2126
2127 /// Defines additional types related to [HttpHeaderMatch].
2128 pub mod http_header_match {
2129 #[allow(unused_imports)]
2130 use super::*;
2131
2132 #[derive(Clone, Debug, PartialEq)]
2133 #[non_exhaustive]
2134 pub enum Type {
2135 /// Required. The value of the header must match the regular expression
2136 /// specified in regexMatch. For regular expression grammar,
2137 /// please see: en.cppreference.com/w/cpp/regex/ecmascript
2138 /// For matching against a port specified in the HTTP
2139 /// request, use a headerMatch with headerName set to Host
2140 /// and a regular expression that satisfies the RFC2616 Host
2141 /// header's port specifier.
2142 RegexMatch(std::string::String),
2143 }
2144 }
2145 }
2146 }
2147
2148 /// Possible values that define what action to take.
2149 ///
2150 /// # Working with unknown values
2151 ///
2152 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2153 /// additional enum variants at any time. Adding new variants is not considered
2154 /// a breaking change. Applications should write their code in anticipation of:
2155 ///
2156 /// - New values appearing in future releases of the client library, **and**
2157 /// - New values received dynamically, without application changes.
2158 ///
2159 /// Please consult the [Working with enums] section in the user guide for some
2160 /// guidelines.
2161 ///
2162 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2163 #[derive(Clone, Debug, PartialEq)]
2164 #[non_exhaustive]
2165 pub enum Action {
2166 /// Default value.
2167 Unspecified,
2168 /// Grant access.
2169 Allow,
2170 /// Deny access.
2171 /// Deny rules should be avoided unless they are used to provide a default
2172 /// "deny all" fallback.
2173 Deny,
2174 /// If set, the enum was initialized with an unknown value.
2175 ///
2176 /// Applications can examine the value using [Action::value] or
2177 /// [Action::name].
2178 UnknownValue(action::UnknownValue),
2179 }
2180
2181 #[doc(hidden)]
2182 pub mod action {
2183 #[allow(unused_imports)]
2184 use super::*;
2185 #[derive(Clone, Debug, PartialEq)]
2186 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2187 }
2188
2189 impl Action {
2190 /// Gets the enum value.
2191 ///
2192 /// Returns `None` if the enum contains an unknown value deserialized from
2193 /// the string representation of enums.
2194 pub fn value(&self) -> std::option::Option<i32> {
2195 match self {
2196 Self::Unspecified => std::option::Option::Some(0),
2197 Self::Allow => std::option::Option::Some(1),
2198 Self::Deny => std::option::Option::Some(2),
2199 Self::UnknownValue(u) => u.0.value(),
2200 }
2201 }
2202
2203 /// Gets the enum value as a string.
2204 ///
2205 /// Returns `None` if the enum contains an unknown value deserialized from
2206 /// the integer representation of enums.
2207 pub fn name(&self) -> std::option::Option<&str> {
2208 match self {
2209 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
2210 Self::Allow => std::option::Option::Some("ALLOW"),
2211 Self::Deny => std::option::Option::Some("DENY"),
2212 Self::UnknownValue(u) => u.0.name(),
2213 }
2214 }
2215 }
2216
2217 impl std::default::Default for Action {
2218 fn default() -> Self {
2219 use std::convert::From;
2220 Self::from(0)
2221 }
2222 }
2223
2224 impl std::fmt::Display for Action {
2225 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2226 wkt::internal::display_enum(f, self.name(), self.value())
2227 }
2228 }
2229
2230 impl std::convert::From<i32> for Action {
2231 fn from(value: i32) -> Self {
2232 match value {
2233 0 => Self::Unspecified,
2234 1 => Self::Allow,
2235 2 => Self::Deny,
2236 _ => Self::UnknownValue(action::UnknownValue(
2237 wkt::internal::UnknownEnumValue::Integer(value),
2238 )),
2239 }
2240 }
2241 }
2242
2243 impl std::convert::From<&str> for Action {
2244 fn from(value: &str) -> Self {
2245 use std::string::ToString;
2246 match value {
2247 "ACTION_UNSPECIFIED" => Self::Unspecified,
2248 "ALLOW" => Self::Allow,
2249 "DENY" => Self::Deny,
2250 _ => Self::UnknownValue(action::UnknownValue(
2251 wkt::internal::UnknownEnumValue::String(value.to_string()),
2252 )),
2253 }
2254 }
2255 }
2256
2257 impl serde::ser::Serialize for Action {
2258 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2259 where
2260 S: serde::Serializer,
2261 {
2262 match self {
2263 Self::Unspecified => serializer.serialize_i32(0),
2264 Self::Allow => serializer.serialize_i32(1),
2265 Self::Deny => serializer.serialize_i32(2),
2266 Self::UnknownValue(u) => u.0.serialize(serializer),
2267 }
2268 }
2269 }
2270
2271 impl<'de> serde::de::Deserialize<'de> for Action {
2272 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2273 where
2274 D: serde::Deserializer<'de>,
2275 {
2276 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
2277 ".google.cloud.networksecurity.v1.AuthorizationPolicy.Action",
2278 ))
2279 }
2280 }
2281}
2282
2283/// Request used with the ListAuthorizationPolicies method.
2284#[derive(Clone, Default, PartialEq)]
2285#[non_exhaustive]
2286pub struct ListAuthorizationPoliciesRequest {
2287 /// Required. The project and location from which the AuthorizationPolicies
2288 /// should be listed, specified in the format
2289 /// `projects/{project}/locations/{location}`.
2290 pub parent: std::string::String,
2291
2292 /// Maximum number of AuthorizationPolicies to return per call.
2293 pub page_size: i32,
2294
2295 /// The value returned by the last
2296 /// `ListAuthorizationPoliciesResponse` Indicates that this is a
2297 /// continuation of a prior `ListAuthorizationPolicies` call, and
2298 /// that the system should return the next page of data.
2299 pub page_token: std::string::String,
2300
2301 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2302}
2303
2304impl ListAuthorizationPoliciesRequest {
2305 pub fn new() -> Self {
2306 std::default::Default::default()
2307 }
2308
2309 /// Sets the value of [parent][crate::model::ListAuthorizationPoliciesRequest::parent].
2310 ///
2311 /// # Example
2312 /// ```ignore,no_run
2313 /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesRequest;
2314 /// let x = ListAuthorizationPoliciesRequest::new().set_parent("example");
2315 /// ```
2316 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2317 self.parent = v.into();
2318 self
2319 }
2320
2321 /// Sets the value of [page_size][crate::model::ListAuthorizationPoliciesRequest::page_size].
2322 ///
2323 /// # Example
2324 /// ```ignore,no_run
2325 /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesRequest;
2326 /// let x = ListAuthorizationPoliciesRequest::new().set_page_size(42);
2327 /// ```
2328 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2329 self.page_size = v.into();
2330 self
2331 }
2332
2333 /// Sets the value of [page_token][crate::model::ListAuthorizationPoliciesRequest::page_token].
2334 ///
2335 /// # Example
2336 /// ```ignore,no_run
2337 /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesRequest;
2338 /// let x = ListAuthorizationPoliciesRequest::new().set_page_token("example");
2339 /// ```
2340 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2341 self.page_token = v.into();
2342 self
2343 }
2344}
2345
2346impl wkt::message::Message for ListAuthorizationPoliciesRequest {
2347 fn typename() -> &'static str {
2348 "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest"
2349 }
2350}
2351
2352/// Response returned by the ListAuthorizationPolicies method.
2353#[derive(Clone, Default, PartialEq)]
2354#[non_exhaustive]
2355pub struct ListAuthorizationPoliciesResponse {
2356 /// List of AuthorizationPolicies resources.
2357 pub authorization_policies: std::vec::Vec<crate::model::AuthorizationPolicy>,
2358
2359 /// If there might be more results than those appearing in this response, then
2360 /// `next_page_token` is included. To get the next set of results, call this
2361 /// method again using the value of `next_page_token` as `page_token`.
2362 pub next_page_token: std::string::String,
2363
2364 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2365}
2366
2367impl ListAuthorizationPoliciesResponse {
2368 pub fn new() -> Self {
2369 std::default::Default::default()
2370 }
2371
2372 /// Sets the value of [authorization_policies][crate::model::ListAuthorizationPoliciesResponse::authorization_policies].
2373 ///
2374 /// # Example
2375 /// ```ignore,no_run
2376 /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesResponse;
2377 /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2378 /// let x = ListAuthorizationPoliciesResponse::new()
2379 /// .set_authorization_policies([
2380 /// AuthorizationPolicy::default()/* use setters */,
2381 /// AuthorizationPolicy::default()/* use (different) setters */,
2382 /// ]);
2383 /// ```
2384 pub fn set_authorization_policies<T, V>(mut self, v: T) -> Self
2385 where
2386 T: std::iter::IntoIterator<Item = V>,
2387 V: std::convert::Into<crate::model::AuthorizationPolicy>,
2388 {
2389 use std::iter::Iterator;
2390 self.authorization_policies = v.into_iter().map(|i| i.into()).collect();
2391 self
2392 }
2393
2394 /// Sets the value of [next_page_token][crate::model::ListAuthorizationPoliciesResponse::next_page_token].
2395 ///
2396 /// # Example
2397 /// ```ignore,no_run
2398 /// # use google_cloud_networksecurity_v1::model::ListAuthorizationPoliciesResponse;
2399 /// let x = ListAuthorizationPoliciesResponse::new().set_next_page_token("example");
2400 /// ```
2401 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2402 self.next_page_token = v.into();
2403 self
2404 }
2405}
2406
2407impl wkt::message::Message for ListAuthorizationPoliciesResponse {
2408 fn typename() -> &'static str {
2409 "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse"
2410 }
2411}
2412
2413#[doc(hidden)]
2414impl google_cloud_gax::paginator::internal::PageableResponse for ListAuthorizationPoliciesResponse {
2415 type PageItem = crate::model::AuthorizationPolicy;
2416
2417 fn items(self) -> std::vec::Vec<Self::PageItem> {
2418 self.authorization_policies
2419 }
2420
2421 fn next_page_token(&self) -> std::string::String {
2422 use std::clone::Clone;
2423 self.next_page_token.clone()
2424 }
2425}
2426
2427/// Request used by the GetAuthorizationPolicy method.
2428#[derive(Clone, Default, PartialEq)]
2429#[non_exhaustive]
2430pub struct GetAuthorizationPolicyRequest {
2431 /// Required. A name of the AuthorizationPolicy to get. Must be in the format
2432 /// `projects/{project}/locations/{location}/authorizationPolicies/*`.
2433 pub name: std::string::String,
2434
2435 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2436}
2437
2438impl GetAuthorizationPolicyRequest {
2439 pub fn new() -> Self {
2440 std::default::Default::default()
2441 }
2442
2443 /// Sets the value of [name][crate::model::GetAuthorizationPolicyRequest::name].
2444 ///
2445 /// # Example
2446 /// ```ignore,no_run
2447 /// # use google_cloud_networksecurity_v1::model::GetAuthorizationPolicyRequest;
2448 /// let x = GetAuthorizationPolicyRequest::new().set_name("example");
2449 /// ```
2450 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2451 self.name = v.into();
2452 self
2453 }
2454}
2455
2456impl wkt::message::Message for GetAuthorizationPolicyRequest {
2457 fn typename() -> &'static str {
2458 "type.googleapis.com/google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest"
2459 }
2460}
2461
2462/// Request used by the CreateAuthorizationPolicy method.
2463#[derive(Clone, Default, PartialEq)]
2464#[non_exhaustive]
2465pub struct CreateAuthorizationPolicyRequest {
2466 /// Required. The parent resource of the AuthorizationPolicy. Must be in the
2467 /// format `projects/{project}/locations/{location}`.
2468 pub parent: std::string::String,
2469
2470 /// Required. Short name of the AuthorizationPolicy resource to be created.
2471 /// This value should be 1-63 characters long, containing only
2472 /// letters, numbers, hyphens, and underscores, and should not start
2473 /// with a number. E.g. "authz_policy".
2474 pub authorization_policy_id: std::string::String,
2475
2476 /// Required. AuthorizationPolicy resource to be created.
2477 pub authorization_policy: std::option::Option<crate::model::AuthorizationPolicy>,
2478
2479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2480}
2481
2482impl CreateAuthorizationPolicyRequest {
2483 pub fn new() -> Self {
2484 std::default::Default::default()
2485 }
2486
2487 /// Sets the value of [parent][crate::model::CreateAuthorizationPolicyRequest::parent].
2488 ///
2489 /// # Example
2490 /// ```ignore,no_run
2491 /// # use google_cloud_networksecurity_v1::model::CreateAuthorizationPolicyRequest;
2492 /// let x = CreateAuthorizationPolicyRequest::new().set_parent("example");
2493 /// ```
2494 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2495 self.parent = v.into();
2496 self
2497 }
2498
2499 /// Sets the value of [authorization_policy_id][crate::model::CreateAuthorizationPolicyRequest::authorization_policy_id].
2500 ///
2501 /// # Example
2502 /// ```ignore,no_run
2503 /// # use google_cloud_networksecurity_v1::model::CreateAuthorizationPolicyRequest;
2504 /// let x = CreateAuthorizationPolicyRequest::new().set_authorization_policy_id("example");
2505 /// ```
2506 pub fn set_authorization_policy_id<T: std::convert::Into<std::string::String>>(
2507 mut self,
2508 v: T,
2509 ) -> Self {
2510 self.authorization_policy_id = v.into();
2511 self
2512 }
2513
2514 /// Sets the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
2515 ///
2516 /// # Example
2517 /// ```ignore,no_run
2518 /// # use google_cloud_networksecurity_v1::model::CreateAuthorizationPolicyRequest;
2519 /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2520 /// let x = CreateAuthorizationPolicyRequest::new().set_authorization_policy(AuthorizationPolicy::default()/* use setters */);
2521 /// ```
2522 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
2523 where
2524 T: std::convert::Into<crate::model::AuthorizationPolicy>,
2525 {
2526 self.authorization_policy = std::option::Option::Some(v.into());
2527 self
2528 }
2529
2530 /// Sets or clears the value of [authorization_policy][crate::model::CreateAuthorizationPolicyRequest::authorization_policy].
2531 ///
2532 /// # Example
2533 /// ```ignore,no_run
2534 /// # use google_cloud_networksecurity_v1::model::CreateAuthorizationPolicyRequest;
2535 /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2536 /// let x = CreateAuthorizationPolicyRequest::new().set_or_clear_authorization_policy(Some(AuthorizationPolicy::default()/* use setters */));
2537 /// let x = CreateAuthorizationPolicyRequest::new().set_or_clear_authorization_policy(None::<AuthorizationPolicy>);
2538 /// ```
2539 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
2540 where
2541 T: std::convert::Into<crate::model::AuthorizationPolicy>,
2542 {
2543 self.authorization_policy = v.map(|x| x.into());
2544 self
2545 }
2546}
2547
2548impl wkt::message::Message for CreateAuthorizationPolicyRequest {
2549 fn typename() -> &'static str {
2550 "type.googleapis.com/google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest"
2551 }
2552}
2553
2554/// Request used by the UpdateAuthorizationPolicy method.
2555#[derive(Clone, Default, PartialEq)]
2556#[non_exhaustive]
2557pub struct UpdateAuthorizationPolicyRequest {
2558 /// Optional. Field mask is used to specify the fields to be overwritten in the
2559 /// AuthorizationPolicy resource by the update.
2560 /// The fields specified in the update_mask are relative to the resource, not
2561 /// the full request. A field will be overwritten if it is in the mask. If the
2562 /// user does not provide a mask then all fields will be overwritten.
2563 pub update_mask: std::option::Option<wkt::FieldMask>,
2564
2565 /// Required. Updated AuthorizationPolicy resource.
2566 pub authorization_policy: std::option::Option<crate::model::AuthorizationPolicy>,
2567
2568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2569}
2570
2571impl UpdateAuthorizationPolicyRequest {
2572 pub fn new() -> Self {
2573 std::default::Default::default()
2574 }
2575
2576 /// Sets the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
2577 ///
2578 /// # Example
2579 /// ```ignore,no_run
2580 /// # use google_cloud_networksecurity_v1::model::UpdateAuthorizationPolicyRequest;
2581 /// use wkt::FieldMask;
2582 /// let x = UpdateAuthorizationPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2583 /// ```
2584 pub fn set_update_mask<T>(mut self, v: T) -> Self
2585 where
2586 T: std::convert::Into<wkt::FieldMask>,
2587 {
2588 self.update_mask = std::option::Option::Some(v.into());
2589 self
2590 }
2591
2592 /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizationPolicyRequest::update_mask].
2593 ///
2594 /// # Example
2595 /// ```ignore,no_run
2596 /// # use google_cloud_networksecurity_v1::model::UpdateAuthorizationPolicyRequest;
2597 /// use wkt::FieldMask;
2598 /// let x = UpdateAuthorizationPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2599 /// let x = UpdateAuthorizationPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2600 /// ```
2601 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2602 where
2603 T: std::convert::Into<wkt::FieldMask>,
2604 {
2605 self.update_mask = v.map(|x| x.into());
2606 self
2607 }
2608
2609 /// Sets the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
2610 ///
2611 /// # Example
2612 /// ```ignore,no_run
2613 /// # use google_cloud_networksecurity_v1::model::UpdateAuthorizationPolicyRequest;
2614 /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2615 /// let x = UpdateAuthorizationPolicyRequest::new().set_authorization_policy(AuthorizationPolicy::default()/* use setters */);
2616 /// ```
2617 pub fn set_authorization_policy<T>(mut self, v: T) -> Self
2618 where
2619 T: std::convert::Into<crate::model::AuthorizationPolicy>,
2620 {
2621 self.authorization_policy = std::option::Option::Some(v.into());
2622 self
2623 }
2624
2625 /// Sets or clears the value of [authorization_policy][crate::model::UpdateAuthorizationPolicyRequest::authorization_policy].
2626 ///
2627 /// # Example
2628 /// ```ignore,no_run
2629 /// # use google_cloud_networksecurity_v1::model::UpdateAuthorizationPolicyRequest;
2630 /// use google_cloud_networksecurity_v1::model::AuthorizationPolicy;
2631 /// let x = UpdateAuthorizationPolicyRequest::new().set_or_clear_authorization_policy(Some(AuthorizationPolicy::default()/* use setters */));
2632 /// let x = UpdateAuthorizationPolicyRequest::new().set_or_clear_authorization_policy(None::<AuthorizationPolicy>);
2633 /// ```
2634 pub fn set_or_clear_authorization_policy<T>(mut self, v: std::option::Option<T>) -> Self
2635 where
2636 T: std::convert::Into<crate::model::AuthorizationPolicy>,
2637 {
2638 self.authorization_policy = v.map(|x| x.into());
2639 self
2640 }
2641}
2642
2643impl wkt::message::Message for UpdateAuthorizationPolicyRequest {
2644 fn typename() -> &'static str {
2645 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest"
2646 }
2647}
2648
2649/// Request used by the DeleteAuthorizationPolicy method.
2650#[derive(Clone, Default, PartialEq)]
2651#[non_exhaustive]
2652pub struct DeleteAuthorizationPolicyRequest {
2653 /// Required. A name of the AuthorizationPolicy to delete. Must be in the
2654 /// format `projects/{project}/locations/{location}/authorizationPolicies/*`.
2655 pub name: std::string::String,
2656
2657 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2658}
2659
2660impl DeleteAuthorizationPolicyRequest {
2661 pub fn new() -> Self {
2662 std::default::Default::default()
2663 }
2664
2665 /// Sets the value of [name][crate::model::DeleteAuthorizationPolicyRequest::name].
2666 ///
2667 /// # Example
2668 /// ```ignore,no_run
2669 /// # use google_cloud_networksecurity_v1::model::DeleteAuthorizationPolicyRequest;
2670 /// let x = DeleteAuthorizationPolicyRequest::new().set_name("example");
2671 /// ```
2672 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2673 self.name = v.into();
2674 self
2675 }
2676}
2677
2678impl wkt::message::Message for DeleteAuthorizationPolicyRequest {
2679 fn typename() -> &'static str {
2680 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest"
2681 }
2682}
2683
2684/// `AuthzPolicy` is a resource that allows to forward traffic to a
2685/// callout backend designed to scan the traffic for security purposes.
2686#[derive(Clone, Default, PartialEq)]
2687#[non_exhaustive]
2688pub struct AuthzPolicy {
2689 /// Required. Identifier. Name of the `AuthzPolicy` resource in the following
2690 /// format:
2691 /// `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
2692 pub name: std::string::String,
2693
2694 /// Output only. The timestamp when the resource was created.
2695 pub create_time: std::option::Option<wkt::Timestamp>,
2696
2697 /// Output only. The timestamp when the resource was updated.
2698 pub update_time: std::option::Option<wkt::Timestamp>,
2699
2700 /// Optional. A human-readable description of the resource.
2701 pub description: std::string::String,
2702
2703 /// Optional. Set of labels associated with the `AuthzPolicy` resource.
2704 ///
2705 /// The format must comply with [the following
2706 /// requirements](/compute/docs/labeling-resources#requirements).
2707 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2708
2709 /// Required. Specifies the set of resources to which this policy should be
2710 /// applied to.
2711 pub target: std::option::Option<crate::model::authz_policy::Target>,
2712
2713 /// Optional. A list of authorization HTTP rules to match against the incoming
2714 /// request. A policy match occurs when at least one HTTP rule matches the
2715 /// request or when no HTTP rules are specified in the policy.
2716 /// At least one HTTP Rule is required for Allow or Deny Action. Limited
2717 /// to 5 rules.
2718 pub http_rules: std::vec::Vec<crate::model::authz_policy::AuthzRule>,
2719
2720 /// Required. Can be one of `ALLOW`, `DENY`, `CUSTOM`.
2721 ///
2722 /// When the action is `CUSTOM`, `customProvider` must be specified.
2723 ///
2724 /// When the action is `ALLOW`, only requests matching the policy will
2725 /// be allowed.
2726 ///
2727 /// When the action is `DENY`, only requests matching the policy will be
2728 /// denied.
2729 ///
2730 /// When a request arrives, the policies are evaluated in the following order:
2731 ///
2732 /// 1. If there is a `CUSTOM` policy that matches the request, the `CUSTOM`
2733 /// policy is evaluated using the custom authorization providers and the
2734 /// request is denied if the provider rejects the request.
2735 ///
2736 /// 1. If there are any `DENY` policies that match the request, the request
2737 /// is denied.
2738 ///
2739 /// 1. If there are no `ALLOW` policies for the resource or if any of the
2740 /// `ALLOW` policies match the request, the request is allowed.
2741 ///
2742 /// 1. Else the request is denied by default if none of the configured
2743 /// AuthzPolicies with `ALLOW` action match the request.
2744 ///
2745 pub action: crate::model::authz_policy::AuthzAction,
2746
2747 /// Optional. Required if the action is `CUSTOM`. Allows delegating
2748 /// authorization decisions to Cloud IAP or to Service Extensions. One of
2749 /// `cloudIap` or `authzExtension` must be specified.
2750 pub custom_provider: std::option::Option<crate::model::authz_policy::CustomProvider>,
2751
2752 /// Optional. Immutable. Defines the type of authorization being performed.
2753 /// If not specified, `REQUEST_AUTHZ` is applied. This field cannot be changed
2754 /// once AuthzPolicy is created.
2755 pub policy_profile: crate::model::authz_policy::PolicyProfile,
2756
2757 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2758}
2759
2760impl AuthzPolicy {
2761 pub fn new() -> Self {
2762 std::default::Default::default()
2763 }
2764
2765 /// Sets the value of [name][crate::model::AuthzPolicy::name].
2766 ///
2767 /// # Example
2768 /// ```ignore,no_run
2769 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2770 /// let x = AuthzPolicy::new().set_name("example");
2771 /// ```
2772 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2773 self.name = v.into();
2774 self
2775 }
2776
2777 /// Sets the value of [create_time][crate::model::AuthzPolicy::create_time].
2778 ///
2779 /// # Example
2780 /// ```ignore,no_run
2781 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2782 /// use wkt::Timestamp;
2783 /// let x = AuthzPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2784 /// ```
2785 pub fn set_create_time<T>(mut self, v: T) -> Self
2786 where
2787 T: std::convert::Into<wkt::Timestamp>,
2788 {
2789 self.create_time = std::option::Option::Some(v.into());
2790 self
2791 }
2792
2793 /// Sets or clears the value of [create_time][crate::model::AuthzPolicy::create_time].
2794 ///
2795 /// # Example
2796 /// ```ignore,no_run
2797 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2798 /// use wkt::Timestamp;
2799 /// let x = AuthzPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2800 /// let x = AuthzPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2801 /// ```
2802 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2803 where
2804 T: std::convert::Into<wkt::Timestamp>,
2805 {
2806 self.create_time = v.map(|x| x.into());
2807 self
2808 }
2809
2810 /// Sets the value of [update_time][crate::model::AuthzPolicy::update_time].
2811 ///
2812 /// # Example
2813 /// ```ignore,no_run
2814 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2815 /// use wkt::Timestamp;
2816 /// let x = AuthzPolicy::new().set_update_time(Timestamp::default()/* use setters */);
2817 /// ```
2818 pub fn set_update_time<T>(mut self, v: T) -> Self
2819 where
2820 T: std::convert::Into<wkt::Timestamp>,
2821 {
2822 self.update_time = std::option::Option::Some(v.into());
2823 self
2824 }
2825
2826 /// Sets or clears the value of [update_time][crate::model::AuthzPolicy::update_time].
2827 ///
2828 /// # Example
2829 /// ```ignore,no_run
2830 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2831 /// use wkt::Timestamp;
2832 /// let x = AuthzPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2833 /// let x = AuthzPolicy::new().set_or_clear_update_time(None::<Timestamp>);
2834 /// ```
2835 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2836 where
2837 T: std::convert::Into<wkt::Timestamp>,
2838 {
2839 self.update_time = v.map(|x| x.into());
2840 self
2841 }
2842
2843 /// Sets the value of [description][crate::model::AuthzPolicy::description].
2844 ///
2845 /// # Example
2846 /// ```ignore,no_run
2847 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2848 /// let x = AuthzPolicy::new().set_description("example");
2849 /// ```
2850 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2851 self.description = v.into();
2852 self
2853 }
2854
2855 /// Sets the value of [labels][crate::model::AuthzPolicy::labels].
2856 ///
2857 /// # Example
2858 /// ```ignore,no_run
2859 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2860 /// let x = AuthzPolicy::new().set_labels([
2861 /// ("key0", "abc"),
2862 /// ("key1", "xyz"),
2863 /// ]);
2864 /// ```
2865 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2866 where
2867 T: std::iter::IntoIterator<Item = (K, V)>,
2868 K: std::convert::Into<std::string::String>,
2869 V: std::convert::Into<std::string::String>,
2870 {
2871 use std::iter::Iterator;
2872 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2873 self
2874 }
2875
2876 /// Sets the value of [target][crate::model::AuthzPolicy::target].
2877 ///
2878 /// # Example
2879 /// ```ignore,no_run
2880 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2881 /// use google_cloud_networksecurity_v1::model::authz_policy::Target;
2882 /// let x = AuthzPolicy::new().set_target(Target::default()/* use setters */);
2883 /// ```
2884 pub fn set_target<T>(mut self, v: T) -> Self
2885 where
2886 T: std::convert::Into<crate::model::authz_policy::Target>,
2887 {
2888 self.target = std::option::Option::Some(v.into());
2889 self
2890 }
2891
2892 /// Sets or clears the value of [target][crate::model::AuthzPolicy::target].
2893 ///
2894 /// # Example
2895 /// ```ignore,no_run
2896 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2897 /// use google_cloud_networksecurity_v1::model::authz_policy::Target;
2898 /// let x = AuthzPolicy::new().set_or_clear_target(Some(Target::default()/* use setters */));
2899 /// let x = AuthzPolicy::new().set_or_clear_target(None::<Target>);
2900 /// ```
2901 pub fn set_or_clear_target<T>(mut self, v: std::option::Option<T>) -> Self
2902 where
2903 T: std::convert::Into<crate::model::authz_policy::Target>,
2904 {
2905 self.target = v.map(|x| x.into());
2906 self
2907 }
2908
2909 /// Sets the value of [http_rules][crate::model::AuthzPolicy::http_rules].
2910 ///
2911 /// # Example
2912 /// ```ignore,no_run
2913 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2914 /// use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
2915 /// let x = AuthzPolicy::new()
2916 /// .set_http_rules([
2917 /// AuthzRule::default()/* use setters */,
2918 /// AuthzRule::default()/* use (different) setters */,
2919 /// ]);
2920 /// ```
2921 pub fn set_http_rules<T, V>(mut self, v: T) -> Self
2922 where
2923 T: std::iter::IntoIterator<Item = V>,
2924 V: std::convert::Into<crate::model::authz_policy::AuthzRule>,
2925 {
2926 use std::iter::Iterator;
2927 self.http_rules = v.into_iter().map(|i| i.into()).collect();
2928 self
2929 }
2930
2931 /// Sets the value of [action][crate::model::AuthzPolicy::action].
2932 ///
2933 /// # Example
2934 /// ```ignore,no_run
2935 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2936 /// use google_cloud_networksecurity_v1::model::authz_policy::AuthzAction;
2937 /// let x0 = AuthzPolicy::new().set_action(AuthzAction::Allow);
2938 /// let x1 = AuthzPolicy::new().set_action(AuthzAction::Deny);
2939 /// let x2 = AuthzPolicy::new().set_action(AuthzAction::Custom);
2940 /// ```
2941 pub fn set_action<T: std::convert::Into<crate::model::authz_policy::AuthzAction>>(
2942 mut self,
2943 v: T,
2944 ) -> Self {
2945 self.action = v.into();
2946 self
2947 }
2948
2949 /// Sets the value of [custom_provider][crate::model::AuthzPolicy::custom_provider].
2950 ///
2951 /// # Example
2952 /// ```ignore,no_run
2953 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2954 /// use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
2955 /// let x = AuthzPolicy::new().set_custom_provider(CustomProvider::default()/* use setters */);
2956 /// ```
2957 pub fn set_custom_provider<T>(mut self, v: T) -> Self
2958 where
2959 T: std::convert::Into<crate::model::authz_policy::CustomProvider>,
2960 {
2961 self.custom_provider = std::option::Option::Some(v.into());
2962 self
2963 }
2964
2965 /// Sets or clears the value of [custom_provider][crate::model::AuthzPolicy::custom_provider].
2966 ///
2967 /// # Example
2968 /// ```ignore,no_run
2969 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2970 /// use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
2971 /// let x = AuthzPolicy::new().set_or_clear_custom_provider(Some(CustomProvider::default()/* use setters */));
2972 /// let x = AuthzPolicy::new().set_or_clear_custom_provider(None::<CustomProvider>);
2973 /// ```
2974 pub fn set_or_clear_custom_provider<T>(mut self, v: std::option::Option<T>) -> Self
2975 where
2976 T: std::convert::Into<crate::model::authz_policy::CustomProvider>,
2977 {
2978 self.custom_provider = v.map(|x| x.into());
2979 self
2980 }
2981
2982 /// Sets the value of [policy_profile][crate::model::AuthzPolicy::policy_profile].
2983 ///
2984 /// # Example
2985 /// ```ignore,no_run
2986 /// # use google_cloud_networksecurity_v1::model::AuthzPolicy;
2987 /// use google_cloud_networksecurity_v1::model::authz_policy::PolicyProfile;
2988 /// let x0 = AuthzPolicy::new().set_policy_profile(PolicyProfile::RequestAuthz);
2989 /// let x1 = AuthzPolicy::new().set_policy_profile(PolicyProfile::ContentAuthz);
2990 /// ```
2991 pub fn set_policy_profile<T: std::convert::Into<crate::model::authz_policy::PolicyProfile>>(
2992 mut self,
2993 v: T,
2994 ) -> Self {
2995 self.policy_profile = v.into();
2996 self
2997 }
2998}
2999
3000impl wkt::message::Message for AuthzPolicy {
3001 fn typename() -> &'static str {
3002 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy"
3003 }
3004}
3005
3006/// Defines additional types related to [AuthzPolicy].
3007pub mod authz_policy {
3008 #[allow(unused_imports)]
3009 use super::*;
3010
3011 /// Specifies the set of targets to which this policy should be applied to.
3012 #[derive(Clone, Default, PartialEq)]
3013 #[non_exhaustive]
3014 pub struct Target {
3015 /// Optional. All gateways and forwarding rules referenced by this policy and
3016 /// extensions must share the same load balancing scheme. Supported values:
3017 /// `INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more information, refer
3018 /// to [Backend services
3019 /// overview](https://cloud.google.com/load-balancing/docs/backend-service).
3020 pub load_balancing_scheme: crate::model::authz_policy::LoadBalancingScheme,
3021
3022 /// Required. A list of references to the Forwarding Rules on which this
3023 /// policy will be applied.
3024 pub resources: std::vec::Vec<std::string::String>,
3025
3026 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3027 }
3028
3029 impl Target {
3030 pub fn new() -> Self {
3031 std::default::Default::default()
3032 }
3033
3034 /// Sets the value of [load_balancing_scheme][crate::model::authz_policy::Target::load_balancing_scheme].
3035 ///
3036 /// # Example
3037 /// ```ignore,no_run
3038 /// # use google_cloud_networksecurity_v1::model::authz_policy::Target;
3039 /// use google_cloud_networksecurity_v1::model::authz_policy::LoadBalancingScheme;
3040 /// let x0 = Target::new().set_load_balancing_scheme(LoadBalancingScheme::InternalManaged);
3041 /// let x1 = Target::new().set_load_balancing_scheme(LoadBalancingScheme::ExternalManaged);
3042 /// let x2 = Target::new().set_load_balancing_scheme(LoadBalancingScheme::InternalSelfManaged);
3043 /// ```
3044 pub fn set_load_balancing_scheme<
3045 T: std::convert::Into<crate::model::authz_policy::LoadBalancingScheme>,
3046 >(
3047 mut self,
3048 v: T,
3049 ) -> Self {
3050 self.load_balancing_scheme = v.into();
3051 self
3052 }
3053
3054 /// Sets the value of [resources][crate::model::authz_policy::Target::resources].
3055 ///
3056 /// # Example
3057 /// ```ignore,no_run
3058 /// # use google_cloud_networksecurity_v1::model::authz_policy::Target;
3059 /// let x = Target::new().set_resources(["a", "b", "c"]);
3060 /// ```
3061 pub fn set_resources<T, V>(mut self, v: T) -> Self
3062 where
3063 T: std::iter::IntoIterator<Item = V>,
3064 V: std::convert::Into<std::string::String>,
3065 {
3066 use std::iter::Iterator;
3067 self.resources = v.into_iter().map(|i| i.into()).collect();
3068 self
3069 }
3070 }
3071
3072 impl wkt::message::Message for Target {
3073 fn typename() -> &'static str {
3074 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.Target"
3075 }
3076 }
3077
3078 /// Conditions to match against the incoming request.
3079 #[derive(Clone, Default, PartialEq)]
3080 #[non_exhaustive]
3081 pub struct AuthzRule {
3082 /// Optional. Describes properties of a source of a request.
3083 pub from: std::option::Option<crate::model::authz_policy::authz_rule::From>,
3084
3085 /// Optional. Describes properties of a target of a request.
3086 pub to: std::option::Option<crate::model::authz_policy::authz_rule::To>,
3087
3088 /// Optional. CEL expression that describes the conditions to be satisfied
3089 /// for the action. The result of the CEL expression is ANDed with the from
3090 /// and to. Refer to the CEL language reference for a list of available
3091 /// attributes.
3092 pub when: std::string::String,
3093
3094 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3095 }
3096
3097 impl AuthzRule {
3098 pub fn new() -> Self {
3099 std::default::Default::default()
3100 }
3101
3102 /// Sets the value of [from][crate::model::authz_policy::AuthzRule::from].
3103 ///
3104 /// # Example
3105 /// ```ignore,no_run
3106 /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3107 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::From;
3108 /// let x = AuthzRule::new().set_from(From::default()/* use setters */);
3109 /// ```
3110 pub fn set_from<T>(mut self, v: T) -> Self
3111 where
3112 T: std::convert::Into<crate::model::authz_policy::authz_rule::From>,
3113 {
3114 self.from = std::option::Option::Some(v.into());
3115 self
3116 }
3117
3118 /// Sets or clears the value of [from][crate::model::authz_policy::AuthzRule::from].
3119 ///
3120 /// # Example
3121 /// ```ignore,no_run
3122 /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3123 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::From;
3124 /// let x = AuthzRule::new().set_or_clear_from(Some(From::default()/* use setters */));
3125 /// let x = AuthzRule::new().set_or_clear_from(None::<From>);
3126 /// ```
3127 pub fn set_or_clear_from<T>(mut self, v: std::option::Option<T>) -> Self
3128 where
3129 T: std::convert::Into<crate::model::authz_policy::authz_rule::From>,
3130 {
3131 self.from = v.map(|x| x.into());
3132 self
3133 }
3134
3135 /// Sets the value of [to][crate::model::authz_policy::AuthzRule::to].
3136 ///
3137 /// # Example
3138 /// ```ignore,no_run
3139 /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3140 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::To;
3141 /// let x = AuthzRule::new().set_to(To::default()/* use setters */);
3142 /// ```
3143 pub fn set_to<T>(mut self, v: T) -> Self
3144 where
3145 T: std::convert::Into<crate::model::authz_policy::authz_rule::To>,
3146 {
3147 self.to = std::option::Option::Some(v.into());
3148 self
3149 }
3150
3151 /// Sets or clears the value of [to][crate::model::authz_policy::AuthzRule::to].
3152 ///
3153 /// # Example
3154 /// ```ignore,no_run
3155 /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3156 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::To;
3157 /// let x = AuthzRule::new().set_or_clear_to(Some(To::default()/* use setters */));
3158 /// let x = AuthzRule::new().set_or_clear_to(None::<To>);
3159 /// ```
3160 pub fn set_or_clear_to<T>(mut self, v: std::option::Option<T>) -> Self
3161 where
3162 T: std::convert::Into<crate::model::authz_policy::authz_rule::To>,
3163 {
3164 self.to = v.map(|x| x.into());
3165 self
3166 }
3167
3168 /// Sets the value of [when][crate::model::authz_policy::AuthzRule::when].
3169 ///
3170 /// # Example
3171 /// ```ignore,no_run
3172 /// # use google_cloud_networksecurity_v1::model::authz_policy::AuthzRule;
3173 /// let x = AuthzRule::new().set_when("example");
3174 /// ```
3175 pub fn set_when<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3176 self.when = v.into();
3177 self
3178 }
3179 }
3180
3181 impl wkt::message::Message for AuthzRule {
3182 fn typename() -> &'static str {
3183 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule"
3184 }
3185 }
3186
3187 /// Defines additional types related to [AuthzRule].
3188 pub mod authz_rule {
3189 #[allow(unused_imports)]
3190 use super::*;
3191
3192 /// Determines how a string value should be matched.
3193 #[derive(Clone, Default, PartialEq)]
3194 #[non_exhaustive]
3195 pub struct StringMatch {
3196 /// If true, indicates the exact/prefix/suffix/contains matching should be
3197 /// case insensitive. For example, the matcher ``data`` will match both
3198 /// input string ``Data`` and ``data`` if set to true.
3199 pub ignore_case: bool,
3200
3201 pub match_pattern: std::option::Option<
3202 crate::model::authz_policy::authz_rule::string_match::MatchPattern,
3203 >,
3204
3205 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3206 }
3207
3208 impl StringMatch {
3209 pub fn new() -> Self {
3210 std::default::Default::default()
3211 }
3212
3213 /// Sets the value of [ignore_case][crate::model::authz_policy::authz_rule::StringMatch::ignore_case].
3214 ///
3215 /// # Example
3216 /// ```ignore,no_run
3217 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3218 /// let x = StringMatch::new().set_ignore_case(true);
3219 /// ```
3220 pub fn set_ignore_case<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3221 self.ignore_case = v.into();
3222 self
3223 }
3224
3225 /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern].
3226 ///
3227 /// Note that all the setters affecting `match_pattern` are mutually
3228 /// exclusive.
3229 ///
3230 /// # Example
3231 /// ```ignore,no_run
3232 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3233 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::string_match::MatchPattern;
3234 /// let x = StringMatch::new().set_match_pattern(Some(MatchPattern::Exact("example".to_string())));
3235 /// ```
3236 pub fn set_match_pattern<
3237 T: std::convert::Into<
3238 std::option::Option<
3239 crate::model::authz_policy::authz_rule::string_match::MatchPattern,
3240 >,
3241 >,
3242 >(
3243 mut self,
3244 v: T,
3245 ) -> Self {
3246 self.match_pattern = v.into();
3247 self
3248 }
3249
3250 /// The value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3251 /// if it holds a `Exact`, `None` if the field is not set or
3252 /// holds a different branch.
3253 pub fn exact(&self) -> std::option::Option<&std::string::String> {
3254 #[allow(unreachable_patterns)]
3255 self.match_pattern.as_ref().and_then(|v| match v {
3256 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Exact(
3257 v,
3258 ) => std::option::Option::Some(v),
3259 _ => std::option::Option::None,
3260 })
3261 }
3262
3263 /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3264 /// to hold a `Exact`.
3265 ///
3266 /// Note that all the setters affecting `match_pattern` are
3267 /// mutually exclusive.
3268 ///
3269 /// # Example
3270 /// ```ignore,no_run
3271 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3272 /// let x = StringMatch::new().set_exact("example");
3273 /// assert!(x.exact().is_some());
3274 /// assert!(x.prefix().is_none());
3275 /// assert!(x.suffix().is_none());
3276 /// assert!(x.contains().is_none());
3277 /// ```
3278 pub fn set_exact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3279 self.match_pattern = std::option::Option::Some(
3280 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Exact(
3281 v.into(),
3282 ),
3283 );
3284 self
3285 }
3286
3287 /// The value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3288 /// if it holds a `Prefix`, `None` if the field is not set or
3289 /// holds a different branch.
3290 pub fn prefix(&self) -> std::option::Option<&std::string::String> {
3291 #[allow(unreachable_patterns)]
3292 self.match_pattern.as_ref().and_then(|v| match v {
3293 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Prefix(
3294 v,
3295 ) => std::option::Option::Some(v),
3296 _ => std::option::Option::None,
3297 })
3298 }
3299
3300 /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3301 /// to hold a `Prefix`.
3302 ///
3303 /// Note that all the setters affecting `match_pattern` are
3304 /// mutually exclusive.
3305 ///
3306 /// # Example
3307 /// ```ignore,no_run
3308 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3309 /// let x = StringMatch::new().set_prefix("example");
3310 /// assert!(x.prefix().is_some());
3311 /// assert!(x.exact().is_none());
3312 /// assert!(x.suffix().is_none());
3313 /// assert!(x.contains().is_none());
3314 /// ```
3315 pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3316 self.match_pattern = std::option::Option::Some(
3317 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Prefix(
3318 v.into(),
3319 ),
3320 );
3321 self
3322 }
3323
3324 /// The value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3325 /// if it holds a `Suffix`, `None` if the field is not set or
3326 /// holds a different branch.
3327 pub fn suffix(&self) -> std::option::Option<&std::string::String> {
3328 #[allow(unreachable_patterns)]
3329 self.match_pattern.as_ref().and_then(|v| match v {
3330 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Suffix(
3331 v,
3332 ) => std::option::Option::Some(v),
3333 _ => std::option::Option::None,
3334 })
3335 }
3336
3337 /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3338 /// to hold a `Suffix`.
3339 ///
3340 /// Note that all the setters affecting `match_pattern` are
3341 /// mutually exclusive.
3342 ///
3343 /// # Example
3344 /// ```ignore,no_run
3345 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3346 /// let x = StringMatch::new().set_suffix("example");
3347 /// assert!(x.suffix().is_some());
3348 /// assert!(x.exact().is_none());
3349 /// assert!(x.prefix().is_none());
3350 /// assert!(x.contains().is_none());
3351 /// ```
3352 pub fn set_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3353 self.match_pattern = std::option::Option::Some(
3354 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Suffix(
3355 v.into(),
3356 ),
3357 );
3358 self
3359 }
3360
3361 /// The value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3362 /// if it holds a `Contains`, `None` if the field is not set or
3363 /// holds a different branch.
3364 pub fn contains(&self) -> std::option::Option<&std::string::String> {
3365 #[allow(unreachable_patterns)]
3366 self.match_pattern.as_ref().and_then(|v| match v {
3367 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Contains(v) => std::option::Option::Some(v),
3368 _ => std::option::Option::None,
3369 })
3370 }
3371
3372 /// Sets the value of [match_pattern][crate::model::authz_policy::authz_rule::StringMatch::match_pattern]
3373 /// to hold a `Contains`.
3374 ///
3375 /// Note that all the setters affecting `match_pattern` are
3376 /// mutually exclusive.
3377 ///
3378 /// # Example
3379 /// ```ignore,no_run
3380 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3381 /// let x = StringMatch::new().set_contains("example");
3382 /// assert!(x.contains().is_some());
3383 /// assert!(x.exact().is_none());
3384 /// assert!(x.prefix().is_none());
3385 /// assert!(x.suffix().is_none());
3386 /// ```
3387 pub fn set_contains<T: std::convert::Into<std::string::String>>(
3388 mut self,
3389 v: T,
3390 ) -> Self {
3391 self.match_pattern = std::option::Option::Some(
3392 crate::model::authz_policy::authz_rule::string_match::MatchPattern::Contains(
3393 v.into(),
3394 ),
3395 );
3396 self
3397 }
3398 }
3399
3400 impl wkt::message::Message for StringMatch {
3401 fn typename() -> &'static str {
3402 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch"
3403 }
3404 }
3405
3406 /// Defines additional types related to [StringMatch].
3407 pub mod string_match {
3408 #[allow(unused_imports)]
3409 use super::*;
3410
3411 #[derive(Clone, Debug, PartialEq)]
3412 #[non_exhaustive]
3413 pub enum MatchPattern {
3414 /// The input string must match exactly the string specified here.
3415 ///
3416 /// Examples:
3417 ///
3418 /// * ``abc`` only matches the value ``abc``.
3419 Exact(std::string::String),
3420 /// The input string must have the prefix specified here.
3421 /// Note: empty prefix is not allowed, please use regex instead.
3422 ///
3423 /// Examples:
3424 ///
3425 /// * ``abc`` matches the value ``abc.xyz``
3426 Prefix(std::string::String),
3427 /// The input string must have the suffix specified here.
3428 /// Note: empty prefix is not allowed, please use regex instead.
3429 ///
3430 /// Examples:
3431 ///
3432 /// * ``abc`` matches the value ``xyz.abc``
3433 Suffix(std::string::String),
3434 /// The input string must have the substring specified here.
3435 /// Note: empty contains match is not allowed, please use regex instead.
3436 ///
3437 /// Examples:
3438 ///
3439 /// * ``abc`` matches the value ``xyz.abc.def``
3440 Contains(std::string::String),
3441 }
3442 }
3443
3444 /// Represents a range of IP Addresses.
3445 #[derive(Clone, Default, PartialEq)]
3446 #[non_exhaustive]
3447 pub struct IpBlock {
3448 /// Required. The address prefix.
3449 pub prefix: std::string::String,
3450
3451 /// Required. The length of the address range.
3452 pub length: i32,
3453
3454 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3455 }
3456
3457 impl IpBlock {
3458 pub fn new() -> Self {
3459 std::default::Default::default()
3460 }
3461
3462 /// Sets the value of [prefix][crate::model::authz_policy::authz_rule::IpBlock::prefix].
3463 ///
3464 /// # Example
3465 /// ```ignore,no_run
3466 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::IpBlock;
3467 /// let x = IpBlock::new().set_prefix("example");
3468 /// ```
3469 pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3470 self.prefix = v.into();
3471 self
3472 }
3473
3474 /// Sets the value of [length][crate::model::authz_policy::authz_rule::IpBlock::length].
3475 ///
3476 /// # Example
3477 /// ```ignore,no_run
3478 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::IpBlock;
3479 /// let x = IpBlock::new().set_length(42);
3480 /// ```
3481 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3482 self.length = v.into();
3483 self
3484 }
3485 }
3486
3487 impl wkt::message::Message for IpBlock {
3488 fn typename() -> &'static str {
3489 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock"
3490 }
3491 }
3492
3493 /// Describes the properties of a client VM resource accessing the internal
3494 /// application load balancers.
3495 #[derive(Clone, Default, PartialEq)]
3496 #[non_exhaustive]
3497 pub struct RequestResource {
3498 /// Optional. A list of resource tag value permanent IDs to match against
3499 /// the resource manager tags value associated with the source VM of a
3500 /// request.
3501 pub tag_value_id_set: std::option::Option<
3502 crate::model::authz_policy::authz_rule::request_resource::TagValueIdSet,
3503 >,
3504
3505 /// Optional. An IAM service account to match against the source
3506 /// service account of the VM sending the request.
3507 pub iam_service_account:
3508 std::option::Option<crate::model::authz_policy::authz_rule::StringMatch>,
3509
3510 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3511 }
3512
3513 impl RequestResource {
3514 pub fn new() -> Self {
3515 std::default::Default::default()
3516 }
3517
3518 /// Sets the value of [tag_value_id_set][crate::model::authz_policy::authz_rule::RequestResource::tag_value_id_set].
3519 ///
3520 /// # Example
3521 /// ```ignore,no_run
3522 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
3523 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::request_resource::TagValueIdSet;
3524 /// let x = RequestResource::new().set_tag_value_id_set(TagValueIdSet::default()/* use setters */);
3525 /// ```
3526 pub fn set_tag_value_id_set<T>(mut self, v: T) -> Self
3527 where
3528 T: std::convert::Into<
3529 crate::model::authz_policy::authz_rule::request_resource::TagValueIdSet,
3530 >,
3531 {
3532 self.tag_value_id_set = std::option::Option::Some(v.into());
3533 self
3534 }
3535
3536 /// Sets or clears the value of [tag_value_id_set][crate::model::authz_policy::authz_rule::RequestResource::tag_value_id_set].
3537 ///
3538 /// # Example
3539 /// ```ignore,no_run
3540 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
3541 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::request_resource::TagValueIdSet;
3542 /// let x = RequestResource::new().set_or_clear_tag_value_id_set(Some(TagValueIdSet::default()/* use setters */));
3543 /// let x = RequestResource::new().set_or_clear_tag_value_id_set(None::<TagValueIdSet>);
3544 /// ```
3545 pub fn set_or_clear_tag_value_id_set<T>(mut self, v: std::option::Option<T>) -> Self
3546 where
3547 T: std::convert::Into<
3548 crate::model::authz_policy::authz_rule::request_resource::TagValueIdSet,
3549 >,
3550 {
3551 self.tag_value_id_set = v.map(|x| x.into());
3552 self
3553 }
3554
3555 /// Sets the value of [iam_service_account][crate::model::authz_policy::authz_rule::RequestResource::iam_service_account].
3556 ///
3557 /// # Example
3558 /// ```ignore,no_run
3559 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
3560 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3561 /// let x = RequestResource::new().set_iam_service_account(StringMatch::default()/* use setters */);
3562 /// ```
3563 pub fn set_iam_service_account<T>(mut self, v: T) -> Self
3564 where
3565 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3566 {
3567 self.iam_service_account = std::option::Option::Some(v.into());
3568 self
3569 }
3570
3571 /// Sets or clears the value of [iam_service_account][crate::model::authz_policy::authz_rule::RequestResource::iam_service_account].
3572 ///
3573 /// # Example
3574 /// ```ignore,no_run
3575 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
3576 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3577 /// let x = RequestResource::new().set_or_clear_iam_service_account(Some(StringMatch::default()/* use setters */));
3578 /// let x = RequestResource::new().set_or_clear_iam_service_account(None::<StringMatch>);
3579 /// ```
3580 pub fn set_or_clear_iam_service_account<T>(mut self, v: std::option::Option<T>) -> Self
3581 where
3582 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3583 {
3584 self.iam_service_account = v.map(|x| x.into());
3585 self
3586 }
3587 }
3588
3589 impl wkt::message::Message for RequestResource {
3590 fn typename() -> &'static str {
3591 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource"
3592 }
3593 }
3594
3595 /// Defines additional types related to [RequestResource].
3596 pub mod request_resource {
3597 #[allow(unused_imports)]
3598 use super::*;
3599
3600 /// Describes a set of resource tag value permanent IDs to match against
3601 /// the resource manager tags value associated with the source VM of a
3602 /// request.
3603 #[derive(Clone, Default, PartialEq)]
3604 #[non_exhaustive]
3605 pub struct TagValueIdSet {
3606 /// Required. A list of resource tag value permanent IDs to match against
3607 /// the resource manager tags value associated with the source VM of a
3608 /// request. The match follows AND semantics which means all
3609 /// the ids must match. Limited to 5 ids in the Tag value id set.
3610 pub ids: std::vec::Vec<i64>,
3611
3612 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3613 }
3614
3615 impl TagValueIdSet {
3616 pub fn new() -> Self {
3617 std::default::Default::default()
3618 }
3619
3620 /// Sets the value of [ids][crate::model::authz_policy::authz_rule::request_resource::TagValueIdSet::ids].
3621 ///
3622 /// # Example
3623 /// ```ignore,no_run
3624 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::request_resource::TagValueIdSet;
3625 /// let x = TagValueIdSet::new().set_ids([1, 2, 3]);
3626 /// ```
3627 pub fn set_ids<T, V>(mut self, v: T) -> Self
3628 where
3629 T: std::iter::IntoIterator<Item = V>,
3630 V: std::convert::Into<i64>,
3631 {
3632 use std::iter::Iterator;
3633 self.ids = v.into_iter().map(|i| i.into()).collect();
3634 self
3635 }
3636 }
3637
3638 impl wkt::message::Message for TagValueIdSet {
3639 fn typename() -> &'static str {
3640 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet"
3641 }
3642 }
3643 }
3644
3645 /// Determines how a HTTP header should be matched.
3646 #[derive(Clone, Default, PartialEq)]
3647 #[non_exhaustive]
3648 pub struct HeaderMatch {
3649 /// Optional. Specifies the name of the header in the request.
3650 pub name: std::string::String,
3651
3652 /// Optional. Specifies how the header match will be performed.
3653 pub value: std::option::Option<crate::model::authz_policy::authz_rule::StringMatch>,
3654
3655 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3656 }
3657
3658 impl HeaderMatch {
3659 pub fn new() -> Self {
3660 std::default::Default::default()
3661 }
3662
3663 /// Sets the value of [name][crate::model::authz_policy::authz_rule::HeaderMatch::name].
3664 ///
3665 /// # Example
3666 /// ```ignore,no_run
3667 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::HeaderMatch;
3668 /// let x = HeaderMatch::new().set_name("example");
3669 /// ```
3670 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3671 self.name = v.into();
3672 self
3673 }
3674
3675 /// Sets the value of [value][crate::model::authz_policy::authz_rule::HeaderMatch::value].
3676 ///
3677 /// # Example
3678 /// ```ignore,no_run
3679 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::HeaderMatch;
3680 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3681 /// let x = HeaderMatch::new().set_value(StringMatch::default()/* use setters */);
3682 /// ```
3683 pub fn set_value<T>(mut self, v: T) -> Self
3684 where
3685 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3686 {
3687 self.value = std::option::Option::Some(v.into());
3688 self
3689 }
3690
3691 /// Sets or clears the value of [value][crate::model::authz_policy::authz_rule::HeaderMatch::value].
3692 ///
3693 /// # Example
3694 /// ```ignore,no_run
3695 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::HeaderMatch;
3696 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3697 /// let x = HeaderMatch::new().set_or_clear_value(Some(StringMatch::default()/* use setters */));
3698 /// let x = HeaderMatch::new().set_or_clear_value(None::<StringMatch>);
3699 /// ```
3700 pub fn set_or_clear_value<T>(mut self, v: std::option::Option<T>) -> Self
3701 where
3702 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3703 {
3704 self.value = v.map(|x| x.into());
3705 self
3706 }
3707 }
3708
3709 impl wkt::message::Message for HeaderMatch {
3710 fn typename() -> &'static str {
3711 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch"
3712 }
3713 }
3714
3715 /// Describes the properties of a principal to be matched against.
3716 #[derive(Clone, Default, PartialEq)]
3717 #[non_exhaustive]
3718 pub struct Principal {
3719 /// Optional. An enum to decide what principal value the principal rule
3720 /// will match against. If not specified, the PrincipalSelector is
3721 /// CLIENT_CERT_URI_SAN.
3722 pub principal_selector:
3723 crate::model::authz_policy::authz_rule::principal::PrincipalSelector,
3724
3725 /// Required. A non-empty string whose value is matched against the
3726 /// principal value based on the principal_selector. Only exact match can
3727 /// be applied for CLIENT_CERT_URI_SAN, CLIENT_CERT_DNS_NAME_SAN,
3728 /// CLIENT_CERT_COMMON_NAME selectors.
3729 pub principal: std::option::Option<crate::model::authz_policy::authz_rule::StringMatch>,
3730
3731 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3732 }
3733
3734 impl Principal {
3735 pub fn new() -> Self {
3736 std::default::Default::default()
3737 }
3738
3739 /// Sets the value of [principal_selector][crate::model::authz_policy::authz_rule::Principal::principal_selector].
3740 ///
3741 /// # Example
3742 /// ```ignore,no_run
3743 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::Principal;
3744 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::principal::PrincipalSelector;
3745 /// let x0 = Principal::new().set_principal_selector(PrincipalSelector::ClientCertUriSan);
3746 /// let x1 = Principal::new().set_principal_selector(PrincipalSelector::ClientCertDnsNameSan);
3747 /// let x2 = Principal::new().set_principal_selector(PrincipalSelector::ClientCertCommonName);
3748 /// ```
3749 pub fn set_principal_selector<
3750 T: std::convert::Into<
3751 crate::model::authz_policy::authz_rule::principal::PrincipalSelector,
3752 >,
3753 >(
3754 mut self,
3755 v: T,
3756 ) -> Self {
3757 self.principal_selector = v.into();
3758 self
3759 }
3760
3761 /// Sets the value of [principal][crate::model::authz_policy::authz_rule::Principal::principal].
3762 ///
3763 /// # Example
3764 /// ```ignore,no_run
3765 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::Principal;
3766 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3767 /// let x = Principal::new().set_principal(StringMatch::default()/* use setters */);
3768 /// ```
3769 pub fn set_principal<T>(mut self, v: T) -> Self
3770 where
3771 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3772 {
3773 self.principal = std::option::Option::Some(v.into());
3774 self
3775 }
3776
3777 /// Sets or clears the value of [principal][crate::model::authz_policy::authz_rule::Principal::principal].
3778 ///
3779 /// # Example
3780 /// ```ignore,no_run
3781 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::Principal;
3782 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
3783 /// let x = Principal::new().set_or_clear_principal(Some(StringMatch::default()/* use setters */));
3784 /// let x = Principal::new().set_or_clear_principal(None::<StringMatch>);
3785 /// ```
3786 pub fn set_or_clear_principal<T>(mut self, v: std::option::Option<T>) -> Self
3787 where
3788 T: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
3789 {
3790 self.principal = v.map(|x| x.into());
3791 self
3792 }
3793 }
3794
3795 impl wkt::message::Message for Principal {
3796 fn typename() -> &'static str {
3797 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal"
3798 }
3799 }
3800
3801 /// Defines additional types related to [Principal].
3802 pub mod principal {
3803 #[allow(unused_imports)]
3804 use super::*;
3805
3806 /// The principal value the principal rule will match against.
3807 ///
3808 /// # Working with unknown values
3809 ///
3810 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3811 /// additional enum variants at any time. Adding new variants is not considered
3812 /// a breaking change. Applications should write their code in anticipation of:
3813 ///
3814 /// - New values appearing in future releases of the client library, **and**
3815 /// - New values received dynamically, without application changes.
3816 ///
3817 /// Please consult the [Working with enums] section in the user guide for some
3818 /// guidelines.
3819 ///
3820 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3821 #[derive(Clone, Debug, PartialEq)]
3822 #[non_exhaustive]
3823 pub enum PrincipalSelector {
3824 /// Unspecified principal selector. It will be treated as
3825 /// CLIENT_CERT_URI_SAN by default.
3826 Unspecified,
3827 /// The principal rule is matched against a list of URI SANs in the
3828 /// validated client's certificate. A match happens when there is any
3829 /// exact URI SAN value match. This is the default principal selector.
3830 ClientCertUriSan,
3831 /// The principal rule is matched against a list of DNS Name SANs in the
3832 /// validated client's certificate. A match happens when there is any
3833 /// exact DNS Name SAN value match.
3834 /// This is only applicable for Application Load Balancers
3835 /// except for classic Global External Application load balancer.
3836 /// CLIENT_CERT_DNS_NAME_SAN is not supported for INTERNAL_SELF_MANAGED
3837 /// load balancing scheme.
3838 ClientCertDnsNameSan,
3839 /// The principal rule is matched against the common name in the client's
3840 /// certificate. Authorization against multiple common names in the
3841 /// client certificate is not supported. Requests with multiple common
3842 /// names in the client certificate will be rejected if
3843 /// CLIENT_CERT_COMMON_NAME is set as the principal selector. A match
3844 /// happens when there is an exact common name value match.
3845 /// This is only applicable for Application Load Balancers
3846 /// except for global external Application Load Balancer and
3847 /// classic Application Load Balancer.
3848 /// CLIENT_CERT_COMMON_NAME is not supported for INTERNAL_SELF_MANAGED
3849 /// load balancing scheme.
3850 ClientCertCommonName,
3851 /// If set, the enum was initialized with an unknown value.
3852 ///
3853 /// Applications can examine the value using [PrincipalSelector::value] or
3854 /// [PrincipalSelector::name].
3855 UnknownValue(principal_selector::UnknownValue),
3856 }
3857
3858 #[doc(hidden)]
3859 pub mod principal_selector {
3860 #[allow(unused_imports)]
3861 use super::*;
3862 #[derive(Clone, Debug, PartialEq)]
3863 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3864 }
3865
3866 impl PrincipalSelector {
3867 /// Gets the enum value.
3868 ///
3869 /// Returns `None` if the enum contains an unknown value deserialized from
3870 /// the string representation of enums.
3871 pub fn value(&self) -> std::option::Option<i32> {
3872 match self {
3873 Self::Unspecified => std::option::Option::Some(0),
3874 Self::ClientCertUriSan => std::option::Option::Some(1),
3875 Self::ClientCertDnsNameSan => std::option::Option::Some(2),
3876 Self::ClientCertCommonName => std::option::Option::Some(3),
3877 Self::UnknownValue(u) => u.0.value(),
3878 }
3879 }
3880
3881 /// Gets the enum value as a string.
3882 ///
3883 /// Returns `None` if the enum contains an unknown value deserialized from
3884 /// the integer representation of enums.
3885 pub fn name(&self) -> std::option::Option<&str> {
3886 match self {
3887 Self::Unspecified => {
3888 std::option::Option::Some("PRINCIPAL_SELECTOR_UNSPECIFIED")
3889 }
3890 Self::ClientCertUriSan => std::option::Option::Some("CLIENT_CERT_URI_SAN"),
3891 Self::ClientCertDnsNameSan => {
3892 std::option::Option::Some("CLIENT_CERT_DNS_NAME_SAN")
3893 }
3894 Self::ClientCertCommonName => {
3895 std::option::Option::Some("CLIENT_CERT_COMMON_NAME")
3896 }
3897 Self::UnknownValue(u) => u.0.name(),
3898 }
3899 }
3900 }
3901
3902 impl std::default::Default for PrincipalSelector {
3903 fn default() -> Self {
3904 use std::convert::From;
3905 Self::from(0)
3906 }
3907 }
3908
3909 impl std::fmt::Display for PrincipalSelector {
3910 fn fmt(
3911 &self,
3912 f: &mut std::fmt::Formatter<'_>,
3913 ) -> std::result::Result<(), std::fmt::Error> {
3914 wkt::internal::display_enum(f, self.name(), self.value())
3915 }
3916 }
3917
3918 impl std::convert::From<i32> for PrincipalSelector {
3919 fn from(value: i32) -> Self {
3920 match value {
3921 0 => Self::Unspecified,
3922 1 => Self::ClientCertUriSan,
3923 2 => Self::ClientCertDnsNameSan,
3924 3 => Self::ClientCertCommonName,
3925 _ => Self::UnknownValue(principal_selector::UnknownValue(
3926 wkt::internal::UnknownEnumValue::Integer(value),
3927 )),
3928 }
3929 }
3930 }
3931
3932 impl std::convert::From<&str> for PrincipalSelector {
3933 fn from(value: &str) -> Self {
3934 use std::string::ToString;
3935 match value {
3936 "PRINCIPAL_SELECTOR_UNSPECIFIED" => Self::Unspecified,
3937 "CLIENT_CERT_URI_SAN" => Self::ClientCertUriSan,
3938 "CLIENT_CERT_DNS_NAME_SAN" => Self::ClientCertDnsNameSan,
3939 "CLIENT_CERT_COMMON_NAME" => Self::ClientCertCommonName,
3940 _ => Self::UnknownValue(principal_selector::UnknownValue(
3941 wkt::internal::UnknownEnumValue::String(value.to_string()),
3942 )),
3943 }
3944 }
3945 }
3946
3947 impl serde::ser::Serialize for PrincipalSelector {
3948 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3949 where
3950 S: serde::Serializer,
3951 {
3952 match self {
3953 Self::Unspecified => serializer.serialize_i32(0),
3954 Self::ClientCertUriSan => serializer.serialize_i32(1),
3955 Self::ClientCertDnsNameSan => serializer.serialize_i32(2),
3956 Self::ClientCertCommonName => serializer.serialize_i32(3),
3957 Self::UnknownValue(u) => u.0.serialize(serializer),
3958 }
3959 }
3960 }
3961
3962 impl<'de> serde::de::Deserialize<'de> for PrincipalSelector {
3963 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3964 where
3965 D: serde::Deserializer<'de>,
3966 {
3967 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrincipalSelector>::new(
3968 ".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.PrincipalSelector"))
3969 }
3970 }
3971 }
3972
3973 /// Describes properties of one or more sources of a request.
3974 #[derive(Clone, Default, PartialEq)]
3975 #[non_exhaustive]
3976 pub struct From {
3977 /// Optional. Describes the properties of a request's sources. At least one
3978 /// of sources or notSources must be specified. Limited to 1 source.
3979 /// A match occurs when ANY source (in sources or notSources) matches the
3980 /// request. Within a single source, the match follows AND semantics
3981 /// across fields and OR semantics within a single field, i.e. a match
3982 /// occurs when ANY principal matches AND ANY ipBlocks match.
3983 pub sources: std::vec::Vec<crate::model::authz_policy::authz_rule::from::RequestSource>,
3984
3985 /// Optional. Describes the negated properties of request sources. Matches
3986 /// requests from sources that do not match the criteria specified in this
3987 /// field. At least one of sources or notSources must be specified.
3988 pub not_sources:
3989 std::vec::Vec<crate::model::authz_policy::authz_rule::from::RequestSource>,
3990
3991 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3992 }
3993
3994 impl From {
3995 pub fn new() -> Self {
3996 std::default::Default::default()
3997 }
3998
3999 /// Sets the value of [sources][crate::model::authz_policy::authz_rule::From::sources].
4000 ///
4001 /// # Example
4002 /// ```ignore,no_run
4003 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::From;
4004 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4005 /// let x = From::new()
4006 /// .set_sources([
4007 /// RequestSource::default()/* use setters */,
4008 /// RequestSource::default()/* use (different) setters */,
4009 /// ]);
4010 /// ```
4011 pub fn set_sources<T, V>(mut self, v: T) -> Self
4012 where
4013 T: std::iter::IntoIterator<Item = V>,
4014 V: std::convert::Into<crate::model::authz_policy::authz_rule::from::RequestSource>,
4015 {
4016 use std::iter::Iterator;
4017 self.sources = v.into_iter().map(|i| i.into()).collect();
4018 self
4019 }
4020
4021 /// Sets the value of [not_sources][crate::model::authz_policy::authz_rule::From::not_sources].
4022 ///
4023 /// # Example
4024 /// ```ignore,no_run
4025 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::From;
4026 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4027 /// let x = From::new()
4028 /// .set_not_sources([
4029 /// RequestSource::default()/* use setters */,
4030 /// RequestSource::default()/* use (different) setters */,
4031 /// ]);
4032 /// ```
4033 pub fn set_not_sources<T, V>(mut self, v: T) -> Self
4034 where
4035 T: std::iter::IntoIterator<Item = V>,
4036 V: std::convert::Into<crate::model::authz_policy::authz_rule::from::RequestSource>,
4037 {
4038 use std::iter::Iterator;
4039 self.not_sources = v.into_iter().map(|i| i.into()).collect();
4040 self
4041 }
4042 }
4043
4044 impl wkt::message::Message for From {
4045 fn typename() -> &'static str {
4046 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From"
4047 }
4048 }
4049
4050 /// Defines additional types related to [From].
4051 pub mod from {
4052 #[allow(unused_imports)]
4053 use super::*;
4054
4055 /// Describes the properties of a single source.
4056 #[derive(Clone, Default, PartialEq)]
4057 #[non_exhaustive]
4058 pub struct RequestSource {
4059 /// Optional. A list of identities derived from the client's certificate.
4060 /// This field will not match on a request unless frontend mutual TLS is
4061 /// enabled for the forwarding rule or Gateway and the client certificate
4062 /// has been successfully validated by mTLS.
4063 /// Each identity is a string whose value is matched against a list of
4064 /// URI SANs, DNS Name SANs, or the common name in the client's
4065 /// certificate. A match happens when any principal matches with the
4066 /// rule. Limited to 50 principals per Authorization Policy for regional
4067 /// internal Application Load Balancers, regional external Application
4068 /// Load Balancers, cross-region internal Application Load Balancers, and
4069 /// Cloud Service Mesh. This field is not supported for global external
4070 /// Application Load Balancers.
4071 pub principals: std::vec::Vec<crate::model::authz_policy::authz_rule::Principal>,
4072
4073 /// Optional. A list of IP addresses or IP address ranges to match
4074 /// against the source IP address of the request. Limited to 10 ip_blocks
4075 /// per Authorization Policy
4076 pub ip_blocks: std::vec::Vec<crate::model::authz_policy::authz_rule::IpBlock>,
4077
4078 /// Optional. A list of resources to match against the resource of the
4079 /// source VM of a request. Limited to 10 resources per Authorization
4080 /// Policy.
4081 pub resources:
4082 std::vec::Vec<crate::model::authz_policy::authz_rule::RequestResource>,
4083
4084 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4085 }
4086
4087 impl RequestSource {
4088 pub fn new() -> Self {
4089 std::default::Default::default()
4090 }
4091
4092 /// Sets the value of [principals][crate::model::authz_policy::authz_rule::from::RequestSource::principals].
4093 ///
4094 /// # Example
4095 /// ```ignore,no_run
4096 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4097 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::Principal;
4098 /// let x = RequestSource::new()
4099 /// .set_principals([
4100 /// Principal::default()/* use setters */,
4101 /// Principal::default()/* use (different) setters */,
4102 /// ]);
4103 /// ```
4104 pub fn set_principals<T, V>(mut self, v: T) -> Self
4105 where
4106 T: std::iter::IntoIterator<Item = V>,
4107 V: std::convert::Into<crate::model::authz_policy::authz_rule::Principal>,
4108 {
4109 use std::iter::Iterator;
4110 self.principals = v.into_iter().map(|i| i.into()).collect();
4111 self
4112 }
4113
4114 /// Sets the value of [ip_blocks][crate::model::authz_policy::authz_rule::from::RequestSource::ip_blocks].
4115 ///
4116 /// # Example
4117 /// ```ignore,no_run
4118 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4119 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::IpBlock;
4120 /// let x = RequestSource::new()
4121 /// .set_ip_blocks([
4122 /// IpBlock::default()/* use setters */,
4123 /// IpBlock::default()/* use (different) setters */,
4124 /// ]);
4125 /// ```
4126 pub fn set_ip_blocks<T, V>(mut self, v: T) -> Self
4127 where
4128 T: std::iter::IntoIterator<Item = V>,
4129 V: std::convert::Into<crate::model::authz_policy::authz_rule::IpBlock>,
4130 {
4131 use std::iter::Iterator;
4132 self.ip_blocks = v.into_iter().map(|i| i.into()).collect();
4133 self
4134 }
4135
4136 /// Sets the value of [resources][crate::model::authz_policy::authz_rule::from::RequestSource::resources].
4137 ///
4138 /// # Example
4139 /// ```ignore,no_run
4140 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::from::RequestSource;
4141 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::RequestResource;
4142 /// let x = RequestSource::new()
4143 /// .set_resources([
4144 /// RequestResource::default()/* use setters */,
4145 /// RequestResource::default()/* use (different) setters */,
4146 /// ]);
4147 /// ```
4148 pub fn set_resources<T, V>(mut self, v: T) -> Self
4149 where
4150 T: std::iter::IntoIterator<Item = V>,
4151 V: std::convert::Into<crate::model::authz_policy::authz_rule::RequestResource>,
4152 {
4153 use std::iter::Iterator;
4154 self.resources = v.into_iter().map(|i| i.into()).collect();
4155 self
4156 }
4157 }
4158
4159 impl wkt::message::Message for RequestSource {
4160 fn typename() -> &'static str {
4161 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource"
4162 }
4163 }
4164 }
4165
4166 /// Describes properties of one or more targets of a request.
4167 #[derive(Clone, Default, PartialEq)]
4168 #[non_exhaustive]
4169 pub struct To {
4170 /// Optional. Describes properties of one or more targets of a request. At
4171 /// least one of operations or notOperations must be specified. Limited to
4172 /// 1 operation. A match occurs when ANY operation (in operations or
4173 /// notOperations) matches. Within an operation, the match follows AND
4174 /// semantics across fields and OR semantics within a field, i.e. a match
4175 /// occurs when ANY path matches AND ANY header matches and ANY method
4176 /// matches.
4177 pub operations:
4178 std::vec::Vec<crate::model::authz_policy::authz_rule::to::RequestOperation>,
4179
4180 /// Optional. Describes the negated properties of the targets of a request.
4181 /// Matches requests for operations that do not match the criteria
4182 /// specified in this field. At least one of operations or notOperations
4183 /// must be specified.
4184 pub not_operations:
4185 std::vec::Vec<crate::model::authz_policy::authz_rule::to::RequestOperation>,
4186
4187 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4188 }
4189
4190 impl To {
4191 pub fn new() -> Self {
4192 std::default::Default::default()
4193 }
4194
4195 /// Sets the value of [operations][crate::model::authz_policy::authz_rule::To::operations].
4196 ///
4197 /// # Example
4198 /// ```ignore,no_run
4199 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::To;
4200 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4201 /// let x = To::new()
4202 /// .set_operations([
4203 /// RequestOperation::default()/* use setters */,
4204 /// RequestOperation::default()/* use (different) setters */,
4205 /// ]);
4206 /// ```
4207 pub fn set_operations<T, V>(mut self, v: T) -> Self
4208 where
4209 T: std::iter::IntoIterator<Item = V>,
4210 V: std::convert::Into<crate::model::authz_policy::authz_rule::to::RequestOperation>,
4211 {
4212 use std::iter::Iterator;
4213 self.operations = v.into_iter().map(|i| i.into()).collect();
4214 self
4215 }
4216
4217 /// Sets the value of [not_operations][crate::model::authz_policy::authz_rule::To::not_operations].
4218 ///
4219 /// # Example
4220 /// ```ignore,no_run
4221 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::To;
4222 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4223 /// let x = To::new()
4224 /// .set_not_operations([
4225 /// RequestOperation::default()/* use setters */,
4226 /// RequestOperation::default()/* use (different) setters */,
4227 /// ]);
4228 /// ```
4229 pub fn set_not_operations<T, V>(mut self, v: T) -> Self
4230 where
4231 T: std::iter::IntoIterator<Item = V>,
4232 V: std::convert::Into<crate::model::authz_policy::authz_rule::to::RequestOperation>,
4233 {
4234 use std::iter::Iterator;
4235 self.not_operations = v.into_iter().map(|i| i.into()).collect();
4236 self
4237 }
4238 }
4239
4240 impl wkt::message::Message for To {
4241 fn typename() -> &'static str {
4242 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To"
4243 }
4244 }
4245
4246 /// Defines additional types related to [To].
4247 pub mod to {
4248 #[allow(unused_imports)]
4249 use super::*;
4250
4251 /// Describes properties of one or more targets of a request.
4252 #[derive(Clone, Default, PartialEq)]
4253 #[non_exhaustive]
4254 pub struct RequestOperation {
4255 /// Optional. A list of headers to match against in http header.
4256 pub header_set: std::option::Option<
4257 crate::model::authz_policy::authz_rule::to::request_operation::HeaderSet,
4258 >,
4259
4260 /// Optional. A list of HTTP Hosts to match against. The match can be one
4261 /// of exact, prefix, suffix, or contains (substring match). Matches are
4262 /// always case sensitive unless the ignoreCase is set. Limited to 10
4263 /// hosts per Authorization Policy.
4264 pub hosts: std::vec::Vec<crate::model::authz_policy::authz_rule::StringMatch>,
4265
4266 /// Optional. A list of paths to match against. The match can be one of
4267 /// exact, prefix, suffix, or contains (substring match). Matches are
4268 /// always case sensitive unless the ignoreCase is set. Limited to 10
4269 /// paths per Authorization Policy.
4270 /// Note that this path match includes the query parameters. For gRPC
4271 /// services, this should be a fully-qualified name of the form
4272 /// /package.service/method.
4273 pub paths: std::vec::Vec<crate::model::authz_policy::authz_rule::StringMatch>,
4274
4275 /// Optional. A list of HTTP methods to match against. Each entry must be
4276 /// a valid HTTP method name (GET, PUT, POST, HEAD, PATCH, DELETE,
4277 /// OPTIONS). It only allows exact match and is always case sensitive.
4278 /// Limited to 10 methods per Authorization Policy.
4279 pub methods: std::vec::Vec<std::string::String>,
4280
4281 /// Optional. Defines the MCP protocol attributes to match on. If the MCP
4282 /// payload in the request body cannot be successfully parsed, the
4283 /// request will be denied. This field can be set only for AuthzPolicies
4284 /// targeting AgentGateway resources.
4285 pub mcp: std::option::Option<
4286 crate::model::authz_policy::authz_rule::to::request_operation::Mcp,
4287 >,
4288
4289 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4290 }
4291
4292 impl RequestOperation {
4293 pub fn new() -> Self {
4294 std::default::Default::default()
4295 }
4296
4297 /// Sets the value of [header_set][crate::model::authz_policy::authz_rule::to::RequestOperation::header_set].
4298 ///
4299 /// # Example
4300 /// ```ignore,no_run
4301 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4302 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::HeaderSet;
4303 /// let x = RequestOperation::new().set_header_set(HeaderSet::default()/* use setters */);
4304 /// ```
4305 pub fn set_header_set<T>(mut self, v: T) -> Self
4306 where T: std::convert::Into<crate::model::authz_policy::authz_rule::to::request_operation::HeaderSet>
4307 {
4308 self.header_set = std::option::Option::Some(v.into());
4309 self
4310 }
4311
4312 /// Sets or clears the value of [header_set][crate::model::authz_policy::authz_rule::to::RequestOperation::header_set].
4313 ///
4314 /// # Example
4315 /// ```ignore,no_run
4316 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4317 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::HeaderSet;
4318 /// let x = RequestOperation::new().set_or_clear_header_set(Some(HeaderSet::default()/* use setters */));
4319 /// let x = RequestOperation::new().set_or_clear_header_set(None::<HeaderSet>);
4320 /// ```
4321 pub fn set_or_clear_header_set<T>(mut self, v: std::option::Option<T>) -> Self
4322 where T: std::convert::Into<crate::model::authz_policy::authz_rule::to::request_operation::HeaderSet>
4323 {
4324 self.header_set = v.map(|x| x.into());
4325 self
4326 }
4327
4328 /// Sets the value of [hosts][crate::model::authz_policy::authz_rule::to::RequestOperation::hosts].
4329 ///
4330 /// # Example
4331 /// ```ignore,no_run
4332 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4333 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
4334 /// let x = RequestOperation::new()
4335 /// .set_hosts([
4336 /// StringMatch::default()/* use setters */,
4337 /// StringMatch::default()/* use (different) setters */,
4338 /// ]);
4339 /// ```
4340 pub fn set_hosts<T, V>(mut self, v: T) -> Self
4341 where
4342 T: std::iter::IntoIterator<Item = V>,
4343 V: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
4344 {
4345 use std::iter::Iterator;
4346 self.hosts = v.into_iter().map(|i| i.into()).collect();
4347 self
4348 }
4349
4350 /// Sets the value of [paths][crate::model::authz_policy::authz_rule::to::RequestOperation::paths].
4351 ///
4352 /// # Example
4353 /// ```ignore,no_run
4354 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4355 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
4356 /// let x = RequestOperation::new()
4357 /// .set_paths([
4358 /// StringMatch::default()/* use setters */,
4359 /// StringMatch::default()/* use (different) setters */,
4360 /// ]);
4361 /// ```
4362 pub fn set_paths<T, V>(mut self, v: T) -> Self
4363 where
4364 T: std::iter::IntoIterator<Item = V>,
4365 V: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
4366 {
4367 use std::iter::Iterator;
4368 self.paths = v.into_iter().map(|i| i.into()).collect();
4369 self
4370 }
4371
4372 /// Sets the value of [methods][crate::model::authz_policy::authz_rule::to::RequestOperation::methods].
4373 ///
4374 /// # Example
4375 /// ```ignore,no_run
4376 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4377 /// let x = RequestOperation::new().set_methods(["a", "b", "c"]);
4378 /// ```
4379 pub fn set_methods<T, V>(mut self, v: T) -> Self
4380 where
4381 T: std::iter::IntoIterator<Item = V>,
4382 V: std::convert::Into<std::string::String>,
4383 {
4384 use std::iter::Iterator;
4385 self.methods = v.into_iter().map(|i| i.into()).collect();
4386 self
4387 }
4388
4389 /// Sets the value of [mcp][crate::model::authz_policy::authz_rule::to::RequestOperation::mcp].
4390 ///
4391 /// # Example
4392 /// ```ignore,no_run
4393 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4394 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::Mcp;
4395 /// let x = RequestOperation::new().set_mcp(Mcp::default()/* use setters */);
4396 /// ```
4397 pub fn set_mcp<T>(mut self, v: T) -> Self
4398 where
4399 T: std::convert::Into<
4400 crate::model::authz_policy::authz_rule::to::request_operation::Mcp,
4401 >,
4402 {
4403 self.mcp = std::option::Option::Some(v.into());
4404 self
4405 }
4406
4407 /// Sets or clears the value of [mcp][crate::model::authz_policy::authz_rule::to::RequestOperation::mcp].
4408 ///
4409 /// # Example
4410 /// ```ignore,no_run
4411 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::RequestOperation;
4412 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::Mcp;
4413 /// let x = RequestOperation::new().set_or_clear_mcp(Some(Mcp::default()/* use setters */));
4414 /// let x = RequestOperation::new().set_or_clear_mcp(None::<Mcp>);
4415 /// ```
4416 pub fn set_or_clear_mcp<T>(mut self, v: std::option::Option<T>) -> Self
4417 where
4418 T: std::convert::Into<
4419 crate::model::authz_policy::authz_rule::to::request_operation::Mcp,
4420 >,
4421 {
4422 self.mcp = v.map(|x| x.into());
4423 self
4424 }
4425 }
4426
4427 impl wkt::message::Message for RequestOperation {
4428 fn typename() -> &'static str {
4429 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation"
4430 }
4431 }
4432
4433 /// Defines additional types related to [RequestOperation].
4434 pub mod request_operation {
4435 #[allow(unused_imports)]
4436 use super::*;
4437
4438 /// Describes a set of HTTP headers to match against.
4439 #[derive(Clone, Default, PartialEq)]
4440 #[non_exhaustive]
4441 pub struct HeaderSet {
4442 /// Required. A list of headers to match against in http header.
4443 /// The match can be one of exact, prefix, suffix, or contains
4444 /// (substring match). The match follows AND semantics which means all
4445 /// the headers must match. Matches are always case sensitive unless
4446 /// the ignoreCase is set. Limited to 10 headers per Authorization
4447 /// Policy.
4448 pub headers: std::vec::Vec<crate::model::authz_policy::authz_rule::HeaderMatch>,
4449
4450 pub(crate) _unknown_fields:
4451 serde_json::Map<std::string::String, serde_json::Value>,
4452 }
4453
4454 impl HeaderSet {
4455 pub fn new() -> Self {
4456 std::default::Default::default()
4457 }
4458
4459 /// Sets the value of [headers][crate::model::authz_policy::authz_rule::to::request_operation::HeaderSet::headers].
4460 ///
4461 /// # Example
4462 /// ```ignore,no_run
4463 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::HeaderSet;
4464 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::HeaderMatch;
4465 /// let x = HeaderSet::new()
4466 /// .set_headers([
4467 /// HeaderMatch::default()/* use setters */,
4468 /// HeaderMatch::default()/* use (different) setters */,
4469 /// ]);
4470 /// ```
4471 pub fn set_headers<T, V>(mut self, v: T) -> Self
4472 where
4473 T: std::iter::IntoIterator<Item = V>,
4474 V: std::convert::Into<crate::model::authz_policy::authz_rule::HeaderMatch>,
4475 {
4476 use std::iter::Iterator;
4477 self.headers = v.into_iter().map(|i| i.into()).collect();
4478 self
4479 }
4480 }
4481
4482 impl wkt::message::Message for HeaderSet {
4483 fn typename() -> &'static str {
4484 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet"
4485 }
4486 }
4487
4488 /// Describes a set of MCP methods to match against.
4489 #[derive(Clone, Default, PartialEq)]
4490 #[non_exhaustive]
4491 pub struct MCPMethod {
4492 /// Required. The MCP method to match against. Allowed values are as
4493 /// follows:
4494 ///
4495 /// 1. `tools`, `prompts`, `resources` - these will match against all
4496 /// sub methods under the respective methods.
4497 /// 1. `prompts/list`, `tools/list`, `resources/list`,
4498 /// `resources/templates/list`
4499 /// 1. `prompts/get`, `tools/call`, `resources/subscribe`,
4500 /// `resources/unsubscribe`, `resources/read`
4501 /// Params cannot be specified for categories 1 and 2.
4502 pub name: std::string::String,
4503
4504 /// Optional. A list of MCP method parameters to match against. The
4505 /// match can be one of exact, prefix, suffix, or contains (substring
4506 /// match). Matches are always case sensitive unless the ignoreCase is
4507 /// set. Limited to 10 MCP method parameters per Authorization Policy.
4508 pub params: std::vec::Vec<crate::model::authz_policy::authz_rule::StringMatch>,
4509
4510 pub(crate) _unknown_fields:
4511 serde_json::Map<std::string::String, serde_json::Value>,
4512 }
4513
4514 impl MCPMethod {
4515 pub fn new() -> Self {
4516 std::default::Default::default()
4517 }
4518
4519 /// Sets the value of [name][crate::model::authz_policy::authz_rule::to::request_operation::MCPMethod::name].
4520 ///
4521 /// # Example
4522 /// ```ignore,no_run
4523 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::MCPMethod;
4524 /// let x = MCPMethod::new().set_name("example");
4525 /// ```
4526 pub fn set_name<T: std::convert::Into<std::string::String>>(
4527 mut self,
4528 v: T,
4529 ) -> Self {
4530 self.name = v.into();
4531 self
4532 }
4533
4534 /// Sets the value of [params][crate::model::authz_policy::authz_rule::to::request_operation::MCPMethod::params].
4535 ///
4536 /// # Example
4537 /// ```ignore,no_run
4538 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::MCPMethod;
4539 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::StringMatch;
4540 /// let x = MCPMethod::new()
4541 /// .set_params([
4542 /// StringMatch::default()/* use setters */,
4543 /// StringMatch::default()/* use (different) setters */,
4544 /// ]);
4545 /// ```
4546 pub fn set_params<T, V>(mut self, v: T) -> Self
4547 where
4548 T: std::iter::IntoIterator<Item = V>,
4549 V: std::convert::Into<crate::model::authz_policy::authz_rule::StringMatch>,
4550 {
4551 use std::iter::Iterator;
4552 self.params = v.into_iter().map(|i| i.into()).collect();
4553 self
4554 }
4555 }
4556
4557 impl wkt::message::Message for MCPMethod {
4558 fn typename() -> &'static str {
4559 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod"
4560 }
4561 }
4562
4563 /// Describes a set of MCP protocol attributes to match against for a
4564 /// given MCP request.
4565 #[derive(Clone, Default, PartialEq)]
4566 #[non_exhaustive]
4567 pub struct Mcp {
4568
4569 /// Optional. If specified, matches on the MCP protocol’s non-access
4570 /// specific methods namely:
4571 ///
4572 /// * initialize
4573 /// * completion/
4574 /// * logging/
4575 /// * notifications/
4576 /// * ping
4577 /// Defaults to SKIP_BASE_PROTOCOL_METHODS if not specified.
4578 pub base_protocol_methods_option: crate::model::authz_policy::authz_rule::to::request_operation::BaseProtocolMethodsOption,
4579
4580 /// Optional. A list of MCP methods and associated parameters to match
4581 /// on. It is recommended to use this field to match on tools, prompts
4582 /// and resource accesses while setting the baseProtocolMethodsOption
4583 /// to MATCH_BASE_PROTOCOL_METHODS to match on all the other MCP
4584 /// protocol methods.
4585 /// Limited to 10 MCP methods per Authorization Policy.
4586 pub methods: std::vec::Vec<crate::model::authz_policy::authz_rule::to::request_operation::MCPMethod>,
4587
4588 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4589 }
4590
4591 impl Mcp {
4592 pub fn new() -> Self {
4593 std::default::Default::default()
4594 }
4595
4596 /// Sets the value of [base_protocol_methods_option][crate::model::authz_policy::authz_rule::to::request_operation::Mcp::base_protocol_methods_option].
4597 ///
4598 /// # Example
4599 /// ```ignore,no_run
4600 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::Mcp;
4601 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::BaseProtocolMethodsOption;
4602 /// let x0 = Mcp::new().set_base_protocol_methods_option(BaseProtocolMethodsOption::SkipBaseProtocolMethods);
4603 /// let x1 = Mcp::new().set_base_protocol_methods_option(BaseProtocolMethodsOption::MatchBaseProtocolMethods);
4604 /// ```
4605 pub fn set_base_protocol_methods_option<T: std::convert::Into<crate::model::authz_policy::authz_rule::to::request_operation::BaseProtocolMethodsOption>>(mut self, v: T) -> Self{
4606 self.base_protocol_methods_option = v.into();
4607 self
4608 }
4609
4610 /// Sets the value of [methods][crate::model::authz_policy::authz_rule::to::request_operation::Mcp::methods].
4611 ///
4612 /// # Example
4613 /// ```ignore,no_run
4614 /// # use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::Mcp;
4615 /// use google_cloud_networksecurity_v1::model::authz_policy::authz_rule::to::request_operation::MCPMethod;
4616 /// let x = Mcp::new()
4617 /// .set_methods([
4618 /// MCPMethod::default()/* use setters */,
4619 /// MCPMethod::default()/* use (different) setters */,
4620 /// ]);
4621 /// ```
4622 pub fn set_methods<T, V>(mut self, v: T) -> Self
4623 where
4624 T: std::iter::IntoIterator<Item = V>,
4625 V: std::convert::Into<crate::model::authz_policy::authz_rule::to::request_operation::MCPMethod>
4626 {
4627 use std::iter::Iterator;
4628 self.methods = v.into_iter().map(|i| i.into()).collect();
4629 self
4630 }
4631 }
4632
4633 impl wkt::message::Message for Mcp {
4634 fn typename() -> &'static str {
4635 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP"
4636 }
4637 }
4638
4639 /// Describes the option to match against the base MCP protocol methods.
4640 ///
4641 /// # Working with unknown values
4642 ///
4643 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4644 /// additional enum variants at any time. Adding new variants is not considered
4645 /// a breaking change. Applications should write their code in anticipation of:
4646 ///
4647 /// - New values appearing in future releases of the client library, **and**
4648 /// - New values received dynamically, without application changes.
4649 ///
4650 /// Please consult the [Working with enums] section in the user guide for some
4651 /// guidelines.
4652 ///
4653 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4654 #[derive(Clone, Debug, PartialEq)]
4655 #[non_exhaustive]
4656 pub enum BaseProtocolMethodsOption {
4657 /// Unspecified option. Defaults to SKIP_BASE_PROTOCOL_METHODS.
4658 Unspecified,
4659 /// Skip matching on the base MCP protocol methods.
4660 SkipBaseProtocolMethods,
4661 /// Match on the base MCP protocol methods.
4662 MatchBaseProtocolMethods,
4663 /// If set, the enum was initialized with an unknown value.
4664 ///
4665 /// Applications can examine the value using [BaseProtocolMethodsOption::value] or
4666 /// [BaseProtocolMethodsOption::name].
4667 UnknownValue(base_protocol_methods_option::UnknownValue),
4668 }
4669
4670 #[doc(hidden)]
4671 pub mod base_protocol_methods_option {
4672 #[allow(unused_imports)]
4673 use super::*;
4674 #[derive(Clone, Debug, PartialEq)]
4675 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4676 }
4677
4678 impl BaseProtocolMethodsOption {
4679 /// Gets the enum value.
4680 ///
4681 /// Returns `None` if the enum contains an unknown value deserialized from
4682 /// the string representation of enums.
4683 pub fn value(&self) -> std::option::Option<i32> {
4684 match self {
4685 Self::Unspecified => std::option::Option::Some(0),
4686 Self::SkipBaseProtocolMethods => std::option::Option::Some(1),
4687 Self::MatchBaseProtocolMethods => std::option::Option::Some(2),
4688 Self::UnknownValue(u) => u.0.value(),
4689 }
4690 }
4691
4692 /// Gets the enum value as a string.
4693 ///
4694 /// Returns `None` if the enum contains an unknown value deserialized from
4695 /// the integer representation of enums.
4696 pub fn name(&self) -> std::option::Option<&str> {
4697 match self {
4698 Self::Unspecified => std::option::Option::Some(
4699 "BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED",
4700 ),
4701 Self::SkipBaseProtocolMethods => {
4702 std::option::Option::Some("SKIP_BASE_PROTOCOL_METHODS")
4703 }
4704 Self::MatchBaseProtocolMethods => {
4705 std::option::Option::Some("MATCH_BASE_PROTOCOL_METHODS")
4706 }
4707 Self::UnknownValue(u) => u.0.name(),
4708 }
4709 }
4710 }
4711
4712 impl std::default::Default for BaseProtocolMethodsOption {
4713 fn default() -> Self {
4714 use std::convert::From;
4715 Self::from(0)
4716 }
4717 }
4718
4719 impl std::fmt::Display for BaseProtocolMethodsOption {
4720 fn fmt(
4721 &self,
4722 f: &mut std::fmt::Formatter<'_>,
4723 ) -> std::result::Result<(), std::fmt::Error> {
4724 wkt::internal::display_enum(f, self.name(), self.value())
4725 }
4726 }
4727
4728 impl std::convert::From<i32> for BaseProtocolMethodsOption {
4729 fn from(value: i32) -> Self {
4730 match value {
4731 0 => Self::Unspecified,
4732 1 => Self::SkipBaseProtocolMethods,
4733 2 => Self::MatchBaseProtocolMethods,
4734 _ => Self::UnknownValue(base_protocol_methods_option::UnknownValue(
4735 wkt::internal::UnknownEnumValue::Integer(value),
4736 )),
4737 }
4738 }
4739 }
4740
4741 impl std::convert::From<&str> for BaseProtocolMethodsOption {
4742 fn from(value: &str) -> Self {
4743 use std::string::ToString;
4744 match value {
4745 "BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED" => Self::Unspecified,
4746 "SKIP_BASE_PROTOCOL_METHODS" => Self::SkipBaseProtocolMethods,
4747 "MATCH_BASE_PROTOCOL_METHODS" => Self::MatchBaseProtocolMethods,
4748 _ => Self::UnknownValue(base_protocol_methods_option::UnknownValue(
4749 wkt::internal::UnknownEnumValue::String(value.to_string()),
4750 )),
4751 }
4752 }
4753 }
4754
4755 impl serde::ser::Serialize for BaseProtocolMethodsOption {
4756 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4757 where
4758 S: serde::Serializer,
4759 {
4760 match self {
4761 Self::Unspecified => serializer.serialize_i32(0),
4762 Self::SkipBaseProtocolMethods => serializer.serialize_i32(1),
4763 Self::MatchBaseProtocolMethods => serializer.serialize_i32(2),
4764 Self::UnknownValue(u) => u.0.serialize(serializer),
4765 }
4766 }
4767 }
4768
4769 impl<'de> serde::de::Deserialize<'de> for BaseProtocolMethodsOption {
4770 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4771 where
4772 D: serde::Deserializer<'de>,
4773 {
4774 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BaseProtocolMethodsOption>::new(
4775 ".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOption"))
4776 }
4777 }
4778 }
4779 }
4780 }
4781
4782 /// Allows delegating authorization decisions to Cloud IAP or to
4783 /// Service Extensions.
4784 #[derive(Clone, Default, PartialEq)]
4785 #[non_exhaustive]
4786 pub struct CustomProvider {
4787 /// Optional. Delegates authorization decisions to Cloud IAP. Applicable
4788 /// only for managed load balancers. Enabling Cloud IAP at the AuthzPolicy
4789 /// level is not compatible with Cloud IAP settings in the BackendService.
4790 /// Enabling IAP in both places will result in request failure. Ensure that
4791 /// IAP is enabled in either the AuthzPolicy or the BackendService but not in
4792 /// both places.
4793 pub cloud_iap: std::option::Option<crate::model::authz_policy::custom_provider::CloudIap>,
4794
4795 /// Optional. Delegate authorization decision to user authored Service
4796 /// Extension. Only one of cloudIap or authzExtension can be specified.
4797 pub authz_extension:
4798 std::option::Option<crate::model::authz_policy::custom_provider::AuthzExtension>,
4799
4800 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4801 }
4802
4803 impl CustomProvider {
4804 pub fn new() -> Self {
4805 std::default::Default::default()
4806 }
4807
4808 /// Sets the value of [cloud_iap][crate::model::authz_policy::CustomProvider::cloud_iap].
4809 ///
4810 /// # Example
4811 /// ```ignore,no_run
4812 /// # use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
4813 /// use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::CloudIap;
4814 /// let x = CustomProvider::new().set_cloud_iap(CloudIap::default()/* use setters */);
4815 /// ```
4816 pub fn set_cloud_iap<T>(mut self, v: T) -> Self
4817 where
4818 T: std::convert::Into<crate::model::authz_policy::custom_provider::CloudIap>,
4819 {
4820 self.cloud_iap = std::option::Option::Some(v.into());
4821 self
4822 }
4823
4824 /// Sets or clears the value of [cloud_iap][crate::model::authz_policy::CustomProvider::cloud_iap].
4825 ///
4826 /// # Example
4827 /// ```ignore,no_run
4828 /// # use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
4829 /// use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::CloudIap;
4830 /// let x = CustomProvider::new().set_or_clear_cloud_iap(Some(CloudIap::default()/* use setters */));
4831 /// let x = CustomProvider::new().set_or_clear_cloud_iap(None::<CloudIap>);
4832 /// ```
4833 pub fn set_or_clear_cloud_iap<T>(mut self, v: std::option::Option<T>) -> Self
4834 where
4835 T: std::convert::Into<crate::model::authz_policy::custom_provider::CloudIap>,
4836 {
4837 self.cloud_iap = v.map(|x| x.into());
4838 self
4839 }
4840
4841 /// Sets the value of [authz_extension][crate::model::authz_policy::CustomProvider::authz_extension].
4842 ///
4843 /// # Example
4844 /// ```ignore,no_run
4845 /// # use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
4846 /// use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::AuthzExtension;
4847 /// let x = CustomProvider::new().set_authz_extension(AuthzExtension::default()/* use setters */);
4848 /// ```
4849 pub fn set_authz_extension<T>(mut self, v: T) -> Self
4850 where
4851 T: std::convert::Into<crate::model::authz_policy::custom_provider::AuthzExtension>,
4852 {
4853 self.authz_extension = std::option::Option::Some(v.into());
4854 self
4855 }
4856
4857 /// Sets or clears the value of [authz_extension][crate::model::authz_policy::CustomProvider::authz_extension].
4858 ///
4859 /// # Example
4860 /// ```ignore,no_run
4861 /// # use google_cloud_networksecurity_v1::model::authz_policy::CustomProvider;
4862 /// use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::AuthzExtension;
4863 /// let x = CustomProvider::new().set_or_clear_authz_extension(Some(AuthzExtension::default()/* use setters */));
4864 /// let x = CustomProvider::new().set_or_clear_authz_extension(None::<AuthzExtension>);
4865 /// ```
4866 pub fn set_or_clear_authz_extension<T>(mut self, v: std::option::Option<T>) -> Self
4867 where
4868 T: std::convert::Into<crate::model::authz_policy::custom_provider::AuthzExtension>,
4869 {
4870 self.authz_extension = v.map(|x| x.into());
4871 self
4872 }
4873 }
4874
4875 impl wkt::message::Message for CustomProvider {
4876 fn typename() -> &'static str {
4877 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider"
4878 }
4879 }
4880
4881 /// Defines additional types related to [CustomProvider].
4882 pub mod custom_provider {
4883 #[allow(unused_imports)]
4884 use super::*;
4885
4886 /// Optional. Delegates authorization decisions to Cloud IAP. Applicable
4887 /// only for managed load balancers. Enabling Cloud IAP at the AuthzPolicy
4888 /// level is not compatible with Cloud IAP settings in the BackendService.
4889 /// Enabling IAP in both places will result in request failure. Ensure that
4890 /// IAP is enabled in either the AuthzPolicy or the BackendService but not in
4891 /// both places.
4892 #[derive(Clone, Default, PartialEq)]
4893 #[non_exhaustive]
4894 pub struct CloudIap {
4895 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4896 }
4897
4898 impl CloudIap {
4899 pub fn new() -> Self {
4900 std::default::Default::default()
4901 }
4902 }
4903
4904 impl wkt::message::Message for CloudIap {
4905 fn typename() -> &'static str {
4906 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap"
4907 }
4908 }
4909
4910 /// Optional. Delegate authorization decision to user authored extension.
4911 /// Only one of cloudIap or authzExtension can be specified.
4912 #[derive(Clone, Default, PartialEq)]
4913 #[non_exhaustive]
4914 pub struct AuthzExtension {
4915 /// Required. A list of references to authorization
4916 /// extensions that will be invoked for requests matching this policy.
4917 /// Limited to 1 custom provider.
4918 pub resources: std::vec::Vec<std::string::String>,
4919
4920 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4921 }
4922
4923 impl AuthzExtension {
4924 pub fn new() -> Self {
4925 std::default::Default::default()
4926 }
4927
4928 /// Sets the value of [resources][crate::model::authz_policy::custom_provider::AuthzExtension::resources].
4929 ///
4930 /// # Example
4931 /// ```ignore,no_run
4932 /// # use google_cloud_networksecurity_v1::model::authz_policy::custom_provider::AuthzExtension;
4933 /// let x = AuthzExtension::new().set_resources(["a", "b", "c"]);
4934 /// ```
4935 pub fn set_resources<T, V>(mut self, v: T) -> Self
4936 where
4937 T: std::iter::IntoIterator<Item = V>,
4938 V: std::convert::Into<std::string::String>,
4939 {
4940 use std::iter::Iterator;
4941 self.resources = v.into_iter().map(|i| i.into()).collect();
4942 self
4943 }
4944 }
4945
4946 impl wkt::message::Message for AuthzExtension {
4947 fn typename() -> &'static str {
4948 "type.googleapis.com/google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension"
4949 }
4950 }
4951 }
4952
4953 /// Load balancing schemes supported by the `AuthzPolicy` resource. The valid
4954 /// values are `INTERNAL_MANAGED` and
4955 /// `EXTERNAL_MANAGED`. For more information, refer to [Backend services
4956 /// overview](https://cloud.google.com/load-balancing/docs/backend-service).
4957 ///
4958 /// # Working with unknown values
4959 ///
4960 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4961 /// additional enum variants at any time. Adding new variants is not considered
4962 /// a breaking change. Applications should write their code in anticipation of:
4963 ///
4964 /// - New values appearing in future releases of the client library, **and**
4965 /// - New values received dynamically, without application changes.
4966 ///
4967 /// Please consult the [Working with enums] section in the user guide for some
4968 /// guidelines.
4969 ///
4970 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4971 #[derive(Clone, Debug, PartialEq)]
4972 #[non_exhaustive]
4973 pub enum LoadBalancingScheme {
4974 /// Default value. Do not use.
4975 Unspecified,
4976 /// Signifies that this is used for Regional internal or Cross-region
4977 /// internal Application Load Balancing.
4978 InternalManaged,
4979 /// Signifies that this is used for Global external or Regional external
4980 /// Application Load Balancing.
4981 ExternalManaged,
4982 /// Signifies that this is used for Cloud Service Mesh. Meant for use by
4983 /// CSM GKE controller only.
4984 InternalSelfManaged,
4985 /// If set, the enum was initialized with an unknown value.
4986 ///
4987 /// Applications can examine the value using [LoadBalancingScheme::value] or
4988 /// [LoadBalancingScheme::name].
4989 UnknownValue(load_balancing_scheme::UnknownValue),
4990 }
4991
4992 #[doc(hidden)]
4993 pub mod load_balancing_scheme {
4994 #[allow(unused_imports)]
4995 use super::*;
4996 #[derive(Clone, Debug, PartialEq)]
4997 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4998 }
4999
5000 impl LoadBalancingScheme {
5001 /// Gets the enum value.
5002 ///
5003 /// Returns `None` if the enum contains an unknown value deserialized from
5004 /// the string representation of enums.
5005 pub fn value(&self) -> std::option::Option<i32> {
5006 match self {
5007 Self::Unspecified => std::option::Option::Some(0),
5008 Self::InternalManaged => std::option::Option::Some(1),
5009 Self::ExternalManaged => std::option::Option::Some(2),
5010 Self::InternalSelfManaged => std::option::Option::Some(3),
5011 Self::UnknownValue(u) => u.0.value(),
5012 }
5013 }
5014
5015 /// Gets the enum value as a string.
5016 ///
5017 /// Returns `None` if the enum contains an unknown value deserialized from
5018 /// the integer representation of enums.
5019 pub fn name(&self) -> std::option::Option<&str> {
5020 match self {
5021 Self::Unspecified => std::option::Option::Some("LOAD_BALANCING_SCHEME_UNSPECIFIED"),
5022 Self::InternalManaged => std::option::Option::Some("INTERNAL_MANAGED"),
5023 Self::ExternalManaged => std::option::Option::Some("EXTERNAL_MANAGED"),
5024 Self::InternalSelfManaged => std::option::Option::Some("INTERNAL_SELF_MANAGED"),
5025 Self::UnknownValue(u) => u.0.name(),
5026 }
5027 }
5028 }
5029
5030 impl std::default::Default for LoadBalancingScheme {
5031 fn default() -> Self {
5032 use std::convert::From;
5033 Self::from(0)
5034 }
5035 }
5036
5037 impl std::fmt::Display for LoadBalancingScheme {
5038 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5039 wkt::internal::display_enum(f, self.name(), self.value())
5040 }
5041 }
5042
5043 impl std::convert::From<i32> for LoadBalancingScheme {
5044 fn from(value: i32) -> Self {
5045 match value {
5046 0 => Self::Unspecified,
5047 1 => Self::InternalManaged,
5048 2 => Self::ExternalManaged,
5049 3 => Self::InternalSelfManaged,
5050 _ => Self::UnknownValue(load_balancing_scheme::UnknownValue(
5051 wkt::internal::UnknownEnumValue::Integer(value),
5052 )),
5053 }
5054 }
5055 }
5056
5057 impl std::convert::From<&str> for LoadBalancingScheme {
5058 fn from(value: &str) -> Self {
5059 use std::string::ToString;
5060 match value {
5061 "LOAD_BALANCING_SCHEME_UNSPECIFIED" => Self::Unspecified,
5062 "INTERNAL_MANAGED" => Self::InternalManaged,
5063 "EXTERNAL_MANAGED" => Self::ExternalManaged,
5064 "INTERNAL_SELF_MANAGED" => Self::InternalSelfManaged,
5065 _ => Self::UnknownValue(load_balancing_scheme::UnknownValue(
5066 wkt::internal::UnknownEnumValue::String(value.to_string()),
5067 )),
5068 }
5069 }
5070 }
5071
5072 impl serde::ser::Serialize for LoadBalancingScheme {
5073 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5074 where
5075 S: serde::Serializer,
5076 {
5077 match self {
5078 Self::Unspecified => serializer.serialize_i32(0),
5079 Self::InternalManaged => serializer.serialize_i32(1),
5080 Self::ExternalManaged => serializer.serialize_i32(2),
5081 Self::InternalSelfManaged => serializer.serialize_i32(3),
5082 Self::UnknownValue(u) => u.0.serialize(serializer),
5083 }
5084 }
5085 }
5086
5087 impl<'de> serde::de::Deserialize<'de> for LoadBalancingScheme {
5088 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5089 where
5090 D: serde::Deserializer<'de>,
5091 {
5092 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LoadBalancingScheme>::new(
5093 ".google.cloud.networksecurity.v1.AuthzPolicy.LoadBalancingScheme",
5094 ))
5095 }
5096 }
5097
5098 /// The action to be applied to this policy. Valid values are
5099 /// `ALLOW`, `DENY`, `CUSTOM`.
5100 ///
5101 /// # Working with unknown values
5102 ///
5103 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5104 /// additional enum variants at any time. Adding new variants is not considered
5105 /// a breaking change. Applications should write their code in anticipation of:
5106 ///
5107 /// - New values appearing in future releases of the client library, **and**
5108 /// - New values received dynamically, without application changes.
5109 ///
5110 /// Please consult the [Working with enums] section in the user guide for some
5111 /// guidelines.
5112 ///
5113 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5114 #[derive(Clone, Debug, PartialEq)]
5115 #[non_exhaustive]
5116 pub enum AuthzAction {
5117 /// Unspecified action.
5118 Unspecified,
5119 /// Allow request to pass through to the backend.
5120 Allow,
5121 /// Deny the request and return a HTTP 404 to the client.
5122 Deny,
5123 /// Delegate the authorization decision to an external authorization engine.
5124 Custom,
5125 /// If set, the enum was initialized with an unknown value.
5126 ///
5127 /// Applications can examine the value using [AuthzAction::value] or
5128 /// [AuthzAction::name].
5129 UnknownValue(authz_action::UnknownValue),
5130 }
5131
5132 #[doc(hidden)]
5133 pub mod authz_action {
5134 #[allow(unused_imports)]
5135 use super::*;
5136 #[derive(Clone, Debug, PartialEq)]
5137 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5138 }
5139
5140 impl AuthzAction {
5141 /// Gets the enum value.
5142 ///
5143 /// Returns `None` if the enum contains an unknown value deserialized from
5144 /// the string representation of enums.
5145 pub fn value(&self) -> std::option::Option<i32> {
5146 match self {
5147 Self::Unspecified => std::option::Option::Some(0),
5148 Self::Allow => std::option::Option::Some(1),
5149 Self::Deny => std::option::Option::Some(2),
5150 Self::Custom => std::option::Option::Some(3),
5151 Self::UnknownValue(u) => u.0.value(),
5152 }
5153 }
5154
5155 /// Gets the enum value as a string.
5156 ///
5157 /// Returns `None` if the enum contains an unknown value deserialized from
5158 /// the integer representation of enums.
5159 pub fn name(&self) -> std::option::Option<&str> {
5160 match self {
5161 Self::Unspecified => std::option::Option::Some("AUTHZ_ACTION_UNSPECIFIED"),
5162 Self::Allow => std::option::Option::Some("ALLOW"),
5163 Self::Deny => std::option::Option::Some("DENY"),
5164 Self::Custom => std::option::Option::Some("CUSTOM"),
5165 Self::UnknownValue(u) => u.0.name(),
5166 }
5167 }
5168 }
5169
5170 impl std::default::Default for AuthzAction {
5171 fn default() -> Self {
5172 use std::convert::From;
5173 Self::from(0)
5174 }
5175 }
5176
5177 impl std::fmt::Display for AuthzAction {
5178 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5179 wkt::internal::display_enum(f, self.name(), self.value())
5180 }
5181 }
5182
5183 impl std::convert::From<i32> for AuthzAction {
5184 fn from(value: i32) -> Self {
5185 match value {
5186 0 => Self::Unspecified,
5187 1 => Self::Allow,
5188 2 => Self::Deny,
5189 3 => Self::Custom,
5190 _ => Self::UnknownValue(authz_action::UnknownValue(
5191 wkt::internal::UnknownEnumValue::Integer(value),
5192 )),
5193 }
5194 }
5195 }
5196
5197 impl std::convert::From<&str> for AuthzAction {
5198 fn from(value: &str) -> Self {
5199 use std::string::ToString;
5200 match value {
5201 "AUTHZ_ACTION_UNSPECIFIED" => Self::Unspecified,
5202 "ALLOW" => Self::Allow,
5203 "DENY" => Self::Deny,
5204 "CUSTOM" => Self::Custom,
5205 _ => Self::UnknownValue(authz_action::UnknownValue(
5206 wkt::internal::UnknownEnumValue::String(value.to_string()),
5207 )),
5208 }
5209 }
5210 }
5211
5212 impl serde::ser::Serialize for AuthzAction {
5213 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5214 where
5215 S: serde::Serializer,
5216 {
5217 match self {
5218 Self::Unspecified => serializer.serialize_i32(0),
5219 Self::Allow => serializer.serialize_i32(1),
5220 Self::Deny => serializer.serialize_i32(2),
5221 Self::Custom => serializer.serialize_i32(3),
5222 Self::UnknownValue(u) => u.0.serialize(serializer),
5223 }
5224 }
5225 }
5226
5227 impl<'de> serde::de::Deserialize<'de> for AuthzAction {
5228 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5229 where
5230 D: serde::Deserializer<'de>,
5231 {
5232 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthzAction>::new(
5233 ".google.cloud.networksecurity.v1.AuthzPolicy.AuthzAction",
5234 ))
5235 }
5236 }
5237
5238 /// The type of authorization being performed.
5239 /// New values may be added in the future.
5240 ///
5241 /// # Working with unknown values
5242 ///
5243 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5244 /// additional enum variants at any time. Adding new variants is not considered
5245 /// a breaking change. Applications should write their code in anticipation of:
5246 ///
5247 /// - New values appearing in future releases of the client library, **and**
5248 /// - New values received dynamically, without application changes.
5249 ///
5250 /// Please consult the [Working with enums] section in the user guide for some
5251 /// guidelines.
5252 ///
5253 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5254 #[derive(Clone, Debug, PartialEq)]
5255 #[non_exhaustive]
5256 pub enum PolicyProfile {
5257 /// Unspecified policy profile.
5258 Unspecified,
5259 /// Applies to request authorization. `CUSTOM` authorization
5260 /// policies with Authz extensions will be allowed with `EXT_AUTHZ_GRPC` or
5261 /// `EXT_PROC_GRPC` protocols. Extensions are invoked only for request header
5262 /// events.
5263 RequestAuthz,
5264 /// Applies to content security, sanitization, etc. Only
5265 /// `CUSTOM` action is allowed in this policy profile. AuthzExtensions in the
5266 /// custom provider must support `EXT_PROC_GRPC` protocol only and be capable
5267 /// of receiving all `EXT_PROC_GRPC` events (REQUEST_HEADERS, REQUEST_BODY,
5268 /// REQUEST_TRAILERS, RESPONSE_HEADERS, RESPONSE_BODY, RESPONSE_TRAILERS)
5269 /// with `FULL_DUPLEX_STREAMED` body send mode.
5270 ContentAuthz,
5271 /// If set, the enum was initialized with an unknown value.
5272 ///
5273 /// Applications can examine the value using [PolicyProfile::value] or
5274 /// [PolicyProfile::name].
5275 UnknownValue(policy_profile::UnknownValue),
5276 }
5277
5278 #[doc(hidden)]
5279 pub mod policy_profile {
5280 #[allow(unused_imports)]
5281 use super::*;
5282 #[derive(Clone, Debug, PartialEq)]
5283 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5284 }
5285
5286 impl PolicyProfile {
5287 /// Gets the enum value.
5288 ///
5289 /// Returns `None` if the enum contains an unknown value deserialized from
5290 /// the string representation of enums.
5291 pub fn value(&self) -> std::option::Option<i32> {
5292 match self {
5293 Self::Unspecified => std::option::Option::Some(0),
5294 Self::RequestAuthz => std::option::Option::Some(1),
5295 Self::ContentAuthz => std::option::Option::Some(2),
5296 Self::UnknownValue(u) => u.0.value(),
5297 }
5298 }
5299
5300 /// Gets the enum value as a string.
5301 ///
5302 /// Returns `None` if the enum contains an unknown value deserialized from
5303 /// the integer representation of enums.
5304 pub fn name(&self) -> std::option::Option<&str> {
5305 match self {
5306 Self::Unspecified => std::option::Option::Some("POLICY_PROFILE_UNSPECIFIED"),
5307 Self::RequestAuthz => std::option::Option::Some("REQUEST_AUTHZ"),
5308 Self::ContentAuthz => std::option::Option::Some("CONTENT_AUTHZ"),
5309 Self::UnknownValue(u) => u.0.name(),
5310 }
5311 }
5312 }
5313
5314 impl std::default::Default for PolicyProfile {
5315 fn default() -> Self {
5316 use std::convert::From;
5317 Self::from(0)
5318 }
5319 }
5320
5321 impl std::fmt::Display for PolicyProfile {
5322 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5323 wkt::internal::display_enum(f, self.name(), self.value())
5324 }
5325 }
5326
5327 impl std::convert::From<i32> for PolicyProfile {
5328 fn from(value: i32) -> Self {
5329 match value {
5330 0 => Self::Unspecified,
5331 1 => Self::RequestAuthz,
5332 2 => Self::ContentAuthz,
5333 _ => Self::UnknownValue(policy_profile::UnknownValue(
5334 wkt::internal::UnknownEnumValue::Integer(value),
5335 )),
5336 }
5337 }
5338 }
5339
5340 impl std::convert::From<&str> for PolicyProfile {
5341 fn from(value: &str) -> Self {
5342 use std::string::ToString;
5343 match value {
5344 "POLICY_PROFILE_UNSPECIFIED" => Self::Unspecified,
5345 "REQUEST_AUTHZ" => Self::RequestAuthz,
5346 "CONTENT_AUTHZ" => Self::ContentAuthz,
5347 _ => Self::UnknownValue(policy_profile::UnknownValue(
5348 wkt::internal::UnknownEnumValue::String(value.to_string()),
5349 )),
5350 }
5351 }
5352 }
5353
5354 impl serde::ser::Serialize for PolicyProfile {
5355 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5356 where
5357 S: serde::Serializer,
5358 {
5359 match self {
5360 Self::Unspecified => serializer.serialize_i32(0),
5361 Self::RequestAuthz => serializer.serialize_i32(1),
5362 Self::ContentAuthz => serializer.serialize_i32(2),
5363 Self::UnknownValue(u) => u.0.serialize(serializer),
5364 }
5365 }
5366 }
5367
5368 impl<'de> serde::de::Deserialize<'de> for PolicyProfile {
5369 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5370 where
5371 D: serde::Deserializer<'de>,
5372 {
5373 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyProfile>::new(
5374 ".google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfile",
5375 ))
5376 }
5377 }
5378}
5379
5380/// Message for creating an `AuthzPolicy` resource.
5381#[derive(Clone, Default, PartialEq)]
5382#[non_exhaustive]
5383pub struct CreateAuthzPolicyRequest {
5384 /// Required. The parent resource of the `AuthzPolicy` resource. Must be in
5385 /// the format `projects/{project}/locations/{location}`.
5386 pub parent: std::string::String,
5387
5388 /// Required. User-provided ID of the `AuthzPolicy` resource to be created.
5389 pub authz_policy_id: std::string::String,
5390
5391 /// Required. `AuthzPolicy` resource to be created.
5392 pub authz_policy: std::option::Option<crate::model::AuthzPolicy>,
5393
5394 /// Optional. An optional request ID to identify requests. Specify a unique
5395 /// request ID so that if you must retry your request, the server can ignore
5396 /// the request if it has already been completed. The server guarantees
5397 /// that for at least 60 minutes since the first request.
5398 ///
5399 /// For example, consider a situation where you make an initial request and the
5400 /// request times out. If you make the request again with the same request
5401 /// ID, the server can check if original operation with the same request ID
5402 /// was received, and if so, ignores the second request. This prevents
5403 /// clients from accidentally creating duplicate commitments.
5404 ///
5405 /// The request ID must be a valid UUID with the exception that zero UUID is
5406 /// not supported (00000000-0000-0000-0000-000000000000).
5407 pub request_id: std::string::String,
5408
5409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5410}
5411
5412impl CreateAuthzPolicyRequest {
5413 pub fn new() -> Self {
5414 std::default::Default::default()
5415 }
5416
5417 /// Sets the value of [parent][crate::model::CreateAuthzPolicyRequest::parent].
5418 ///
5419 /// # Example
5420 /// ```ignore,no_run
5421 /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5422 /// let x = CreateAuthzPolicyRequest::new().set_parent("example");
5423 /// ```
5424 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5425 self.parent = v.into();
5426 self
5427 }
5428
5429 /// Sets the value of [authz_policy_id][crate::model::CreateAuthzPolicyRequest::authz_policy_id].
5430 ///
5431 /// # Example
5432 /// ```ignore,no_run
5433 /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5434 /// let x = CreateAuthzPolicyRequest::new().set_authz_policy_id("example");
5435 /// ```
5436 pub fn set_authz_policy_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5437 self.authz_policy_id = v.into();
5438 self
5439 }
5440
5441 /// Sets the value of [authz_policy][crate::model::CreateAuthzPolicyRequest::authz_policy].
5442 ///
5443 /// # Example
5444 /// ```ignore,no_run
5445 /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5446 /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5447 /// let x = CreateAuthzPolicyRequest::new().set_authz_policy(AuthzPolicy::default()/* use setters */);
5448 /// ```
5449 pub fn set_authz_policy<T>(mut self, v: T) -> Self
5450 where
5451 T: std::convert::Into<crate::model::AuthzPolicy>,
5452 {
5453 self.authz_policy = std::option::Option::Some(v.into());
5454 self
5455 }
5456
5457 /// Sets or clears the value of [authz_policy][crate::model::CreateAuthzPolicyRequest::authz_policy].
5458 ///
5459 /// # Example
5460 /// ```ignore,no_run
5461 /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5462 /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5463 /// let x = CreateAuthzPolicyRequest::new().set_or_clear_authz_policy(Some(AuthzPolicy::default()/* use setters */));
5464 /// let x = CreateAuthzPolicyRequest::new().set_or_clear_authz_policy(None::<AuthzPolicy>);
5465 /// ```
5466 pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
5467 where
5468 T: std::convert::Into<crate::model::AuthzPolicy>,
5469 {
5470 self.authz_policy = v.map(|x| x.into());
5471 self
5472 }
5473
5474 /// Sets the value of [request_id][crate::model::CreateAuthzPolicyRequest::request_id].
5475 ///
5476 /// # Example
5477 /// ```ignore,no_run
5478 /// # use google_cloud_networksecurity_v1::model::CreateAuthzPolicyRequest;
5479 /// let x = CreateAuthzPolicyRequest::new().set_request_id("example");
5480 /// ```
5481 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5482 self.request_id = v.into();
5483 self
5484 }
5485}
5486
5487impl wkt::message::Message for CreateAuthzPolicyRequest {
5488 fn typename() -> &'static str {
5489 "type.googleapis.com/google.cloud.networksecurity.v1.CreateAuthzPolicyRequest"
5490 }
5491}
5492
5493/// Message for requesting list of `AuthzPolicy` resources.
5494#[derive(Clone, Default, PartialEq)]
5495#[non_exhaustive]
5496pub struct ListAuthzPoliciesRequest {
5497 /// Required. The project and location from which the `AuthzPolicy` resources
5498 /// are listed, specified in the following format:
5499 /// `projects/{project}/locations/{location}`.
5500 pub parent: std::string::String,
5501
5502 /// Optional. Requested page size. The server might return fewer items than
5503 /// requested. If unspecified, the server picks an appropriate default.
5504 pub page_size: i32,
5505
5506 /// Optional. A token identifying a page of results that the server returns.
5507 pub page_token: std::string::String,
5508
5509 /// Optional. Filtering results.
5510 pub filter: std::string::String,
5511
5512 /// Optional. Hint for how to order the results.
5513 pub order_by: std::string::String,
5514
5515 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5516}
5517
5518impl ListAuthzPoliciesRequest {
5519 pub fn new() -> Self {
5520 std::default::Default::default()
5521 }
5522
5523 /// Sets the value of [parent][crate::model::ListAuthzPoliciesRequest::parent].
5524 ///
5525 /// # Example
5526 /// ```ignore,no_run
5527 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5528 /// let x = ListAuthzPoliciesRequest::new().set_parent("example");
5529 /// ```
5530 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5531 self.parent = v.into();
5532 self
5533 }
5534
5535 /// Sets the value of [page_size][crate::model::ListAuthzPoliciesRequest::page_size].
5536 ///
5537 /// # Example
5538 /// ```ignore,no_run
5539 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5540 /// let x = ListAuthzPoliciesRequest::new().set_page_size(42);
5541 /// ```
5542 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5543 self.page_size = v.into();
5544 self
5545 }
5546
5547 /// Sets the value of [page_token][crate::model::ListAuthzPoliciesRequest::page_token].
5548 ///
5549 /// # Example
5550 /// ```ignore,no_run
5551 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5552 /// let x = ListAuthzPoliciesRequest::new().set_page_token("example");
5553 /// ```
5554 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5555 self.page_token = v.into();
5556 self
5557 }
5558
5559 /// Sets the value of [filter][crate::model::ListAuthzPoliciesRequest::filter].
5560 ///
5561 /// # Example
5562 /// ```ignore,no_run
5563 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5564 /// let x = ListAuthzPoliciesRequest::new().set_filter("example");
5565 /// ```
5566 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5567 self.filter = v.into();
5568 self
5569 }
5570
5571 /// Sets the value of [order_by][crate::model::ListAuthzPoliciesRequest::order_by].
5572 ///
5573 /// # Example
5574 /// ```ignore,no_run
5575 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesRequest;
5576 /// let x = ListAuthzPoliciesRequest::new().set_order_by("example");
5577 /// ```
5578 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5579 self.order_by = v.into();
5580 self
5581 }
5582}
5583
5584impl wkt::message::Message for ListAuthzPoliciesRequest {
5585 fn typename() -> &'static str {
5586 "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthzPoliciesRequest"
5587 }
5588}
5589
5590/// Message for response to listing `AuthzPolicy` resources.
5591#[derive(Clone, Default, PartialEq)]
5592#[non_exhaustive]
5593pub struct ListAuthzPoliciesResponse {
5594 /// The list of `AuthzPolicy` resources.
5595 pub authz_policies: std::vec::Vec<crate::model::AuthzPolicy>,
5596
5597 /// A token identifying a page of results that the server returns.
5598 pub next_page_token: std::string::String,
5599
5600 /// Locations that could not be reached.
5601 pub unreachable: std::vec::Vec<std::string::String>,
5602
5603 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5604}
5605
5606impl ListAuthzPoliciesResponse {
5607 pub fn new() -> Self {
5608 std::default::Default::default()
5609 }
5610
5611 /// Sets the value of [authz_policies][crate::model::ListAuthzPoliciesResponse::authz_policies].
5612 ///
5613 /// # Example
5614 /// ```ignore,no_run
5615 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesResponse;
5616 /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5617 /// let x = ListAuthzPoliciesResponse::new()
5618 /// .set_authz_policies([
5619 /// AuthzPolicy::default()/* use setters */,
5620 /// AuthzPolicy::default()/* use (different) setters */,
5621 /// ]);
5622 /// ```
5623 pub fn set_authz_policies<T, V>(mut self, v: T) -> Self
5624 where
5625 T: std::iter::IntoIterator<Item = V>,
5626 V: std::convert::Into<crate::model::AuthzPolicy>,
5627 {
5628 use std::iter::Iterator;
5629 self.authz_policies = v.into_iter().map(|i| i.into()).collect();
5630 self
5631 }
5632
5633 /// Sets the value of [next_page_token][crate::model::ListAuthzPoliciesResponse::next_page_token].
5634 ///
5635 /// # Example
5636 /// ```ignore,no_run
5637 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesResponse;
5638 /// let x = ListAuthzPoliciesResponse::new().set_next_page_token("example");
5639 /// ```
5640 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5641 self.next_page_token = v.into();
5642 self
5643 }
5644
5645 /// Sets the value of [unreachable][crate::model::ListAuthzPoliciesResponse::unreachable].
5646 ///
5647 /// # Example
5648 /// ```ignore,no_run
5649 /// # use google_cloud_networksecurity_v1::model::ListAuthzPoliciesResponse;
5650 /// let x = ListAuthzPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
5651 /// ```
5652 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5653 where
5654 T: std::iter::IntoIterator<Item = V>,
5655 V: std::convert::Into<std::string::String>,
5656 {
5657 use std::iter::Iterator;
5658 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5659 self
5660 }
5661}
5662
5663impl wkt::message::Message for ListAuthzPoliciesResponse {
5664 fn typename() -> &'static str {
5665 "type.googleapis.com/google.cloud.networksecurity.v1.ListAuthzPoliciesResponse"
5666 }
5667}
5668
5669#[doc(hidden)]
5670impl google_cloud_gax::paginator::internal::PageableResponse for ListAuthzPoliciesResponse {
5671 type PageItem = crate::model::AuthzPolicy;
5672
5673 fn items(self) -> std::vec::Vec<Self::PageItem> {
5674 self.authz_policies
5675 }
5676
5677 fn next_page_token(&self) -> std::string::String {
5678 use std::clone::Clone;
5679 self.next_page_token.clone()
5680 }
5681}
5682
5683/// Message for getting a `AuthzPolicy` resource.
5684#[derive(Clone, Default, PartialEq)]
5685#[non_exhaustive]
5686pub struct GetAuthzPolicyRequest {
5687 /// Required. A name of the `AuthzPolicy` resource to get. Must be in the
5688 /// format
5689 /// `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
5690 pub name: std::string::String,
5691
5692 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5693}
5694
5695impl GetAuthzPolicyRequest {
5696 pub fn new() -> Self {
5697 std::default::Default::default()
5698 }
5699
5700 /// Sets the value of [name][crate::model::GetAuthzPolicyRequest::name].
5701 ///
5702 /// # Example
5703 /// ```ignore,no_run
5704 /// # use google_cloud_networksecurity_v1::model::GetAuthzPolicyRequest;
5705 /// let x = GetAuthzPolicyRequest::new().set_name("example");
5706 /// ```
5707 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5708 self.name = v.into();
5709 self
5710 }
5711}
5712
5713impl wkt::message::Message for GetAuthzPolicyRequest {
5714 fn typename() -> &'static str {
5715 "type.googleapis.com/google.cloud.networksecurity.v1.GetAuthzPolicyRequest"
5716 }
5717}
5718
5719/// Message for updating an `AuthzPolicy` resource.
5720#[derive(Clone, Default, PartialEq)]
5721#[non_exhaustive]
5722pub struct UpdateAuthzPolicyRequest {
5723 /// Required. Used to specify the fields to be overwritten in the
5724 /// `AuthzPolicy` resource by the update.
5725 /// The fields specified in the `update_mask` are relative to the resource, not
5726 /// the full request. A field is overwritten if it is in the mask. If the
5727 /// user does not specify a mask, then all fields are overwritten.
5728 pub update_mask: std::option::Option<wkt::FieldMask>,
5729
5730 /// Required. `AuthzPolicy` resource being updated.
5731 pub authz_policy: std::option::Option<crate::model::AuthzPolicy>,
5732
5733 /// Optional. An optional request ID to identify requests. Specify a unique
5734 /// request ID so that if you must retry your request, the server can ignore
5735 /// the request if it has already been completed. The server guarantees
5736 /// that for at least 60 minutes since the first request.
5737 ///
5738 /// For example, consider a situation where you make an initial request and the
5739 /// request times out. If you make the request again with the same request
5740 /// ID, the server can check if original operation with the same request ID
5741 /// was received, and if so, ignores the second request. This prevents
5742 /// clients from accidentally creating duplicate commitments.
5743 ///
5744 /// The request ID must be a valid UUID with the exception that zero UUID is
5745 /// not supported (00000000-0000-0000-0000-000000000000).
5746 pub request_id: std::string::String,
5747
5748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5749}
5750
5751impl UpdateAuthzPolicyRequest {
5752 pub fn new() -> Self {
5753 std::default::Default::default()
5754 }
5755
5756 /// Sets the value of [update_mask][crate::model::UpdateAuthzPolicyRequest::update_mask].
5757 ///
5758 /// # Example
5759 /// ```ignore,no_run
5760 /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5761 /// use wkt::FieldMask;
5762 /// let x = UpdateAuthzPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5763 /// ```
5764 pub fn set_update_mask<T>(mut self, v: T) -> Self
5765 where
5766 T: std::convert::Into<wkt::FieldMask>,
5767 {
5768 self.update_mask = std::option::Option::Some(v.into());
5769 self
5770 }
5771
5772 /// Sets or clears the value of [update_mask][crate::model::UpdateAuthzPolicyRequest::update_mask].
5773 ///
5774 /// # Example
5775 /// ```ignore,no_run
5776 /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5777 /// use wkt::FieldMask;
5778 /// let x = UpdateAuthzPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5779 /// let x = UpdateAuthzPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5780 /// ```
5781 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5782 where
5783 T: std::convert::Into<wkt::FieldMask>,
5784 {
5785 self.update_mask = v.map(|x| x.into());
5786 self
5787 }
5788
5789 /// Sets the value of [authz_policy][crate::model::UpdateAuthzPolicyRequest::authz_policy].
5790 ///
5791 /// # Example
5792 /// ```ignore,no_run
5793 /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5794 /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5795 /// let x = UpdateAuthzPolicyRequest::new().set_authz_policy(AuthzPolicy::default()/* use setters */);
5796 /// ```
5797 pub fn set_authz_policy<T>(mut self, v: T) -> Self
5798 where
5799 T: std::convert::Into<crate::model::AuthzPolicy>,
5800 {
5801 self.authz_policy = std::option::Option::Some(v.into());
5802 self
5803 }
5804
5805 /// Sets or clears the value of [authz_policy][crate::model::UpdateAuthzPolicyRequest::authz_policy].
5806 ///
5807 /// # Example
5808 /// ```ignore,no_run
5809 /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5810 /// use google_cloud_networksecurity_v1::model::AuthzPolicy;
5811 /// let x = UpdateAuthzPolicyRequest::new().set_or_clear_authz_policy(Some(AuthzPolicy::default()/* use setters */));
5812 /// let x = UpdateAuthzPolicyRequest::new().set_or_clear_authz_policy(None::<AuthzPolicy>);
5813 /// ```
5814 pub fn set_or_clear_authz_policy<T>(mut self, v: std::option::Option<T>) -> Self
5815 where
5816 T: std::convert::Into<crate::model::AuthzPolicy>,
5817 {
5818 self.authz_policy = v.map(|x| x.into());
5819 self
5820 }
5821
5822 /// Sets the value of [request_id][crate::model::UpdateAuthzPolicyRequest::request_id].
5823 ///
5824 /// # Example
5825 /// ```ignore,no_run
5826 /// # use google_cloud_networksecurity_v1::model::UpdateAuthzPolicyRequest;
5827 /// let x = UpdateAuthzPolicyRequest::new().set_request_id("example");
5828 /// ```
5829 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5830 self.request_id = v.into();
5831 self
5832 }
5833}
5834
5835impl wkt::message::Message for UpdateAuthzPolicyRequest {
5836 fn typename() -> &'static str {
5837 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest"
5838 }
5839}
5840
5841/// Message for deleting an `AuthzPolicy` resource.
5842#[derive(Clone, Default, PartialEq)]
5843#[non_exhaustive]
5844pub struct DeleteAuthzPolicyRequest {
5845 /// Required. The name of the `AuthzPolicy` resource to delete. Must be in
5846 /// the format
5847 /// `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
5848 pub name: std::string::String,
5849
5850 /// Optional. An optional request ID to identify requests. Specify a unique
5851 /// request ID so that if you must retry your request, the server can ignore
5852 /// the request if it has already been completed. The server guarantees
5853 /// that for at least 60 minutes after the first request.
5854 ///
5855 /// For example, consider a situation where you make an initial request and the
5856 /// request times out. If you make the request again with the same request
5857 /// ID, the server can check if original operation with the same request ID
5858 /// was received, and if so, ignores the second request. This prevents
5859 /// clients from accidentally creating duplicate commitments.
5860 ///
5861 /// The request ID must be a valid UUID with the exception that zero UUID is
5862 /// not supported (00000000-0000-0000-0000-000000000000).
5863 pub request_id: std::string::String,
5864
5865 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5866}
5867
5868impl DeleteAuthzPolicyRequest {
5869 pub fn new() -> Self {
5870 std::default::Default::default()
5871 }
5872
5873 /// Sets the value of [name][crate::model::DeleteAuthzPolicyRequest::name].
5874 ///
5875 /// # Example
5876 /// ```ignore,no_run
5877 /// # use google_cloud_networksecurity_v1::model::DeleteAuthzPolicyRequest;
5878 /// let x = DeleteAuthzPolicyRequest::new().set_name("example");
5879 /// ```
5880 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5881 self.name = v.into();
5882 self
5883 }
5884
5885 /// Sets the value of [request_id][crate::model::DeleteAuthzPolicyRequest::request_id].
5886 ///
5887 /// # Example
5888 /// ```ignore,no_run
5889 /// # use google_cloud_networksecurity_v1::model::DeleteAuthzPolicyRequest;
5890 /// let x = DeleteAuthzPolicyRequest::new().set_request_id("example");
5891 /// ```
5892 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5893 self.request_id = v.into();
5894 self
5895 }
5896}
5897
5898impl wkt::message::Message for DeleteAuthzPolicyRequest {
5899 fn typename() -> &'static str {
5900 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest"
5901 }
5902}
5903
5904/// BackendAuthenticationConfig message groups the TrustConfig together with
5905/// other settings that control how the load balancer authenticates, and
5906/// expresses its identity to, the backend:
5907///
5908/// * `trustConfig` is the attached TrustConfig.
5909///
5910/// * `wellKnownRoots` indicates whether the load balance should trust backend
5911/// server certificates that are issued by public certificate authorities, in
5912/// addition to certificates trusted by the TrustConfig.
5913///
5914/// * `clientCertificate` is a client certificate that the load balancer uses to
5915/// express its identity to the backend, if the connection to the backend uses
5916/// mTLS.
5917///
5918///
5919/// You can attach the BackendAuthenticationConfig to the load balancer's
5920/// BackendService directly determining how that BackendService negotiates TLS.
5921#[derive(Clone, Default, PartialEq)]
5922#[non_exhaustive]
5923pub struct BackendAuthenticationConfig {
5924 /// Required. Name of the BackendAuthenticationConfig resource. It matches the
5925 /// pattern
5926 /// `projects/*/locations/{location}/backendAuthenticationConfigs/{backend_authentication_config}`
5927 pub name: std::string::String,
5928
5929 /// Optional. Free-text description of the resource.
5930 pub description: std::string::String,
5931
5932 /// Output only. The timestamp when the resource was created.
5933 pub create_time: std::option::Option<wkt::Timestamp>,
5934
5935 /// Output only. The timestamp when the resource was updated.
5936 pub update_time: std::option::Option<wkt::Timestamp>,
5937
5938 /// Set of label tags associated with the resource.
5939 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5940
5941 /// Optional. A reference to a certificatemanager.googleapis.com.Certificate
5942 /// resource. This is a relative resource path following the form
5943 /// "projects/{project}/locations/{location}/certificates/{certificate}".
5944 ///
5945 /// Used by a BackendService to negotiate mTLS when the backend connection uses
5946 /// TLS and the backend requests a client certificate. Must have a CLIENT_AUTH
5947 /// scope.
5948 pub client_certificate: std::string::String,
5949
5950 /// Optional. A reference to a TrustConfig resource from the
5951 /// certificatemanager.googleapis.com namespace. This is a relative resource
5952 /// path following the form
5953 /// "projects/{project}/locations/{location}/trustConfigs/{trust_config}".
5954 ///
5955 /// A BackendService uses the chain of trust represented by this TrustConfig,
5956 /// if specified, to validate the server certificates presented by the backend.
5957 /// Required unless wellKnownRoots is set to PUBLIC_ROOTS.
5958 pub trust_config: std::string::String,
5959
5960 /// Well known roots to use for server certificate validation.
5961 pub well_known_roots: crate::model::backend_authentication_config::WellKnownRoots,
5962
5963 /// Output only. Etag of the resource.
5964 pub etag: std::string::String,
5965
5966 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5967}
5968
5969impl BackendAuthenticationConfig {
5970 pub fn new() -> Self {
5971 std::default::Default::default()
5972 }
5973
5974 /// Sets the value of [name][crate::model::BackendAuthenticationConfig::name].
5975 ///
5976 /// # Example
5977 /// ```ignore,no_run
5978 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
5979 /// let x = BackendAuthenticationConfig::new().set_name("example");
5980 /// ```
5981 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5982 self.name = v.into();
5983 self
5984 }
5985
5986 /// Sets the value of [description][crate::model::BackendAuthenticationConfig::description].
5987 ///
5988 /// # Example
5989 /// ```ignore,no_run
5990 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
5991 /// let x = BackendAuthenticationConfig::new().set_description("example");
5992 /// ```
5993 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5994 self.description = v.into();
5995 self
5996 }
5997
5998 /// Sets the value of [create_time][crate::model::BackendAuthenticationConfig::create_time].
5999 ///
6000 /// # Example
6001 /// ```ignore,no_run
6002 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6003 /// use wkt::Timestamp;
6004 /// let x = BackendAuthenticationConfig::new().set_create_time(Timestamp::default()/* use setters */);
6005 /// ```
6006 pub fn set_create_time<T>(mut self, v: T) -> Self
6007 where
6008 T: std::convert::Into<wkt::Timestamp>,
6009 {
6010 self.create_time = std::option::Option::Some(v.into());
6011 self
6012 }
6013
6014 /// Sets or clears the value of [create_time][crate::model::BackendAuthenticationConfig::create_time].
6015 ///
6016 /// # Example
6017 /// ```ignore,no_run
6018 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6019 /// use wkt::Timestamp;
6020 /// let x = BackendAuthenticationConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6021 /// let x = BackendAuthenticationConfig::new().set_or_clear_create_time(None::<Timestamp>);
6022 /// ```
6023 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6024 where
6025 T: std::convert::Into<wkt::Timestamp>,
6026 {
6027 self.create_time = v.map(|x| x.into());
6028 self
6029 }
6030
6031 /// Sets the value of [update_time][crate::model::BackendAuthenticationConfig::update_time].
6032 ///
6033 /// # Example
6034 /// ```ignore,no_run
6035 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6036 /// use wkt::Timestamp;
6037 /// let x = BackendAuthenticationConfig::new().set_update_time(Timestamp::default()/* use setters */);
6038 /// ```
6039 pub fn set_update_time<T>(mut self, v: T) -> Self
6040 where
6041 T: std::convert::Into<wkt::Timestamp>,
6042 {
6043 self.update_time = std::option::Option::Some(v.into());
6044 self
6045 }
6046
6047 /// Sets or clears the value of [update_time][crate::model::BackendAuthenticationConfig::update_time].
6048 ///
6049 /// # Example
6050 /// ```ignore,no_run
6051 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6052 /// use wkt::Timestamp;
6053 /// let x = BackendAuthenticationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6054 /// let x = BackendAuthenticationConfig::new().set_or_clear_update_time(None::<Timestamp>);
6055 /// ```
6056 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6057 where
6058 T: std::convert::Into<wkt::Timestamp>,
6059 {
6060 self.update_time = v.map(|x| x.into());
6061 self
6062 }
6063
6064 /// Sets the value of [labels][crate::model::BackendAuthenticationConfig::labels].
6065 ///
6066 /// # Example
6067 /// ```ignore,no_run
6068 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6069 /// let x = BackendAuthenticationConfig::new().set_labels([
6070 /// ("key0", "abc"),
6071 /// ("key1", "xyz"),
6072 /// ]);
6073 /// ```
6074 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6075 where
6076 T: std::iter::IntoIterator<Item = (K, V)>,
6077 K: std::convert::Into<std::string::String>,
6078 V: std::convert::Into<std::string::String>,
6079 {
6080 use std::iter::Iterator;
6081 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6082 self
6083 }
6084
6085 /// Sets the value of [client_certificate][crate::model::BackendAuthenticationConfig::client_certificate].
6086 ///
6087 /// # Example
6088 /// ```ignore,no_run
6089 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6090 /// let x = BackendAuthenticationConfig::new().set_client_certificate("example");
6091 /// ```
6092 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6093 mut self,
6094 v: T,
6095 ) -> Self {
6096 self.client_certificate = v.into();
6097 self
6098 }
6099
6100 /// Sets the value of [trust_config][crate::model::BackendAuthenticationConfig::trust_config].
6101 ///
6102 /// # Example
6103 /// ```ignore,no_run
6104 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6105 /// let x = BackendAuthenticationConfig::new().set_trust_config("example");
6106 /// ```
6107 pub fn set_trust_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6108 self.trust_config = v.into();
6109 self
6110 }
6111
6112 /// Sets the value of [well_known_roots][crate::model::BackendAuthenticationConfig::well_known_roots].
6113 ///
6114 /// # Example
6115 /// ```ignore,no_run
6116 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6117 /// use google_cloud_networksecurity_v1::model::backend_authentication_config::WellKnownRoots;
6118 /// let x0 = BackendAuthenticationConfig::new().set_well_known_roots(WellKnownRoots::None);
6119 /// let x1 = BackendAuthenticationConfig::new().set_well_known_roots(WellKnownRoots::PublicRoots);
6120 /// ```
6121 pub fn set_well_known_roots<
6122 T: std::convert::Into<crate::model::backend_authentication_config::WellKnownRoots>,
6123 >(
6124 mut self,
6125 v: T,
6126 ) -> Self {
6127 self.well_known_roots = v.into();
6128 self
6129 }
6130
6131 /// Sets the value of [etag][crate::model::BackendAuthenticationConfig::etag].
6132 ///
6133 /// # Example
6134 /// ```ignore,no_run
6135 /// # use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6136 /// let x = BackendAuthenticationConfig::new().set_etag("example");
6137 /// ```
6138 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6139 self.etag = v.into();
6140 self
6141 }
6142}
6143
6144impl wkt::message::Message for BackendAuthenticationConfig {
6145 fn typename() -> &'static str {
6146 "type.googleapis.com/google.cloud.networksecurity.v1.BackendAuthenticationConfig"
6147 }
6148}
6149
6150/// Defines additional types related to [BackendAuthenticationConfig].
6151pub mod backend_authentication_config {
6152 #[allow(unused_imports)]
6153 use super::*;
6154
6155 /// Enum to specify the well known roots to use for server certificate
6156 /// validation.
6157 ///
6158 /// # Working with unknown values
6159 ///
6160 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6161 /// additional enum variants at any time. Adding new variants is not considered
6162 /// a breaking change. Applications should write their code in anticipation of:
6163 ///
6164 /// - New values appearing in future releases of the client library, **and**
6165 /// - New values received dynamically, without application changes.
6166 ///
6167 /// Please consult the [Working with enums] section in the user guide for some
6168 /// guidelines.
6169 ///
6170 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6171 #[derive(Clone, Debug, PartialEq)]
6172 #[non_exhaustive]
6173 pub enum WellKnownRoots {
6174 /// Equivalent to NONE.
6175 Unspecified,
6176 /// The BackendService will only validate server certificates against roots
6177 /// specified in TrustConfig.
6178 None,
6179 /// The BackendService uses a set of well-known public roots, in addition to
6180 /// any roots specified in the trustConfig field, when validating the server
6181 /// certificates presented by the backend. Validation with these roots is
6182 /// only considered when the TlsSettings.sni field in the BackendService is
6183 /// set.
6184 ///
6185 /// The well-known roots are a set of root CAs managed by Google. CAs in this
6186 /// set can be added or removed without notice.
6187 PublicRoots,
6188 /// If set, the enum was initialized with an unknown value.
6189 ///
6190 /// Applications can examine the value using [WellKnownRoots::value] or
6191 /// [WellKnownRoots::name].
6192 UnknownValue(well_known_roots::UnknownValue),
6193 }
6194
6195 #[doc(hidden)]
6196 pub mod well_known_roots {
6197 #[allow(unused_imports)]
6198 use super::*;
6199 #[derive(Clone, Debug, PartialEq)]
6200 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6201 }
6202
6203 impl WellKnownRoots {
6204 /// Gets the enum value.
6205 ///
6206 /// Returns `None` if the enum contains an unknown value deserialized from
6207 /// the string representation of enums.
6208 pub fn value(&self) -> std::option::Option<i32> {
6209 match self {
6210 Self::Unspecified => std::option::Option::Some(0),
6211 Self::None => std::option::Option::Some(1),
6212 Self::PublicRoots => std::option::Option::Some(2),
6213 Self::UnknownValue(u) => u.0.value(),
6214 }
6215 }
6216
6217 /// Gets the enum value as a string.
6218 ///
6219 /// Returns `None` if the enum contains an unknown value deserialized from
6220 /// the integer representation of enums.
6221 pub fn name(&self) -> std::option::Option<&str> {
6222 match self {
6223 Self::Unspecified => std::option::Option::Some("WELL_KNOWN_ROOTS_UNSPECIFIED"),
6224 Self::None => std::option::Option::Some("NONE"),
6225 Self::PublicRoots => std::option::Option::Some("PUBLIC_ROOTS"),
6226 Self::UnknownValue(u) => u.0.name(),
6227 }
6228 }
6229 }
6230
6231 impl std::default::Default for WellKnownRoots {
6232 fn default() -> Self {
6233 use std::convert::From;
6234 Self::from(0)
6235 }
6236 }
6237
6238 impl std::fmt::Display for WellKnownRoots {
6239 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6240 wkt::internal::display_enum(f, self.name(), self.value())
6241 }
6242 }
6243
6244 impl std::convert::From<i32> for WellKnownRoots {
6245 fn from(value: i32) -> Self {
6246 match value {
6247 0 => Self::Unspecified,
6248 1 => Self::None,
6249 2 => Self::PublicRoots,
6250 _ => Self::UnknownValue(well_known_roots::UnknownValue(
6251 wkt::internal::UnknownEnumValue::Integer(value),
6252 )),
6253 }
6254 }
6255 }
6256
6257 impl std::convert::From<&str> for WellKnownRoots {
6258 fn from(value: &str) -> Self {
6259 use std::string::ToString;
6260 match value {
6261 "WELL_KNOWN_ROOTS_UNSPECIFIED" => Self::Unspecified,
6262 "NONE" => Self::None,
6263 "PUBLIC_ROOTS" => Self::PublicRoots,
6264 _ => Self::UnknownValue(well_known_roots::UnknownValue(
6265 wkt::internal::UnknownEnumValue::String(value.to_string()),
6266 )),
6267 }
6268 }
6269 }
6270
6271 impl serde::ser::Serialize for WellKnownRoots {
6272 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6273 where
6274 S: serde::Serializer,
6275 {
6276 match self {
6277 Self::Unspecified => serializer.serialize_i32(0),
6278 Self::None => serializer.serialize_i32(1),
6279 Self::PublicRoots => serializer.serialize_i32(2),
6280 Self::UnknownValue(u) => u.0.serialize(serializer),
6281 }
6282 }
6283 }
6284
6285 impl<'de> serde::de::Deserialize<'de> for WellKnownRoots {
6286 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6287 where
6288 D: serde::Deserializer<'de>,
6289 {
6290 deserializer.deserialize_any(wkt::internal::EnumVisitor::<WellKnownRoots>::new(
6291 ".google.cloud.networksecurity.v1.BackendAuthenticationConfig.WellKnownRoots",
6292 ))
6293 }
6294 }
6295}
6296
6297/// Request used by the ListBackendAuthenticationConfigs method.
6298#[derive(Clone, Default, PartialEq)]
6299#[non_exhaustive]
6300pub struct ListBackendAuthenticationConfigsRequest {
6301 /// Required. The project and location from which the
6302 /// BackendAuthenticationConfigs should be listed, specified in the format
6303 /// `projects/*/locations/{location}`.
6304 pub parent: std::string::String,
6305
6306 /// Maximum number of BackendAuthenticationConfigs to return per call.
6307 pub page_size: i32,
6308
6309 /// The value returned by the last `ListBackendAuthenticationConfigsResponse`
6310 /// Indicates that this is a continuation of a prior
6311 /// `ListBackendAuthenticationConfigs` call, and that the system
6312 /// should return the next page of data.
6313 pub page_token: std::string::String,
6314
6315 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6316}
6317
6318impl ListBackendAuthenticationConfigsRequest {
6319 pub fn new() -> Self {
6320 std::default::Default::default()
6321 }
6322
6323 /// Sets the value of [parent][crate::model::ListBackendAuthenticationConfigsRequest::parent].
6324 ///
6325 /// # Example
6326 /// ```ignore,no_run
6327 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsRequest;
6328 /// let x = ListBackendAuthenticationConfigsRequest::new().set_parent("example");
6329 /// ```
6330 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6331 self.parent = v.into();
6332 self
6333 }
6334
6335 /// Sets the value of [page_size][crate::model::ListBackendAuthenticationConfigsRequest::page_size].
6336 ///
6337 /// # Example
6338 /// ```ignore,no_run
6339 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsRequest;
6340 /// let x = ListBackendAuthenticationConfigsRequest::new().set_page_size(42);
6341 /// ```
6342 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6343 self.page_size = v.into();
6344 self
6345 }
6346
6347 /// Sets the value of [page_token][crate::model::ListBackendAuthenticationConfigsRequest::page_token].
6348 ///
6349 /// # Example
6350 /// ```ignore,no_run
6351 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsRequest;
6352 /// let x = ListBackendAuthenticationConfigsRequest::new().set_page_token("example");
6353 /// ```
6354 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6355 self.page_token = v.into();
6356 self
6357 }
6358}
6359
6360impl wkt::message::Message for ListBackendAuthenticationConfigsRequest {
6361 fn typename() -> &'static str {
6362 "type.googleapis.com/google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest"
6363 }
6364}
6365
6366/// Response returned by the ListBackendAuthenticationConfigs method.
6367#[derive(Clone, Default, PartialEq)]
6368#[non_exhaustive]
6369pub struct ListBackendAuthenticationConfigsResponse {
6370 /// List of BackendAuthenticationConfig resources.
6371 pub backend_authentication_configs: std::vec::Vec<crate::model::BackendAuthenticationConfig>,
6372
6373 /// If there might be more results than those appearing in this response, then
6374 /// `next_page_token` is included. To get the next set of results, call this
6375 /// method again using the value of `next_page_token` as `page_token`.
6376 pub next_page_token: std::string::String,
6377
6378 /// Locations that could not be reached.
6379 pub unreachable: std::vec::Vec<std::string::String>,
6380
6381 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6382}
6383
6384impl ListBackendAuthenticationConfigsResponse {
6385 pub fn new() -> Self {
6386 std::default::Default::default()
6387 }
6388
6389 /// Sets the value of [backend_authentication_configs][crate::model::ListBackendAuthenticationConfigsResponse::backend_authentication_configs].
6390 ///
6391 /// # Example
6392 /// ```ignore,no_run
6393 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsResponse;
6394 /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6395 /// let x = ListBackendAuthenticationConfigsResponse::new()
6396 /// .set_backend_authentication_configs([
6397 /// BackendAuthenticationConfig::default()/* use setters */,
6398 /// BackendAuthenticationConfig::default()/* use (different) setters */,
6399 /// ]);
6400 /// ```
6401 pub fn set_backend_authentication_configs<T, V>(mut self, v: T) -> Self
6402 where
6403 T: std::iter::IntoIterator<Item = V>,
6404 V: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6405 {
6406 use std::iter::Iterator;
6407 self.backend_authentication_configs = v.into_iter().map(|i| i.into()).collect();
6408 self
6409 }
6410
6411 /// Sets the value of [next_page_token][crate::model::ListBackendAuthenticationConfigsResponse::next_page_token].
6412 ///
6413 /// # Example
6414 /// ```ignore,no_run
6415 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsResponse;
6416 /// let x = ListBackendAuthenticationConfigsResponse::new().set_next_page_token("example");
6417 /// ```
6418 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6419 self.next_page_token = v.into();
6420 self
6421 }
6422
6423 /// Sets the value of [unreachable][crate::model::ListBackendAuthenticationConfigsResponse::unreachable].
6424 ///
6425 /// # Example
6426 /// ```ignore,no_run
6427 /// # use google_cloud_networksecurity_v1::model::ListBackendAuthenticationConfigsResponse;
6428 /// let x = ListBackendAuthenticationConfigsResponse::new().set_unreachable(["a", "b", "c"]);
6429 /// ```
6430 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6431 where
6432 T: std::iter::IntoIterator<Item = V>,
6433 V: std::convert::Into<std::string::String>,
6434 {
6435 use std::iter::Iterator;
6436 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6437 self
6438 }
6439}
6440
6441impl wkt::message::Message for ListBackendAuthenticationConfigsResponse {
6442 fn typename() -> &'static str {
6443 "type.googleapis.com/google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse"
6444 }
6445}
6446
6447#[doc(hidden)]
6448impl google_cloud_gax::paginator::internal::PageableResponse
6449 for ListBackendAuthenticationConfigsResponse
6450{
6451 type PageItem = crate::model::BackendAuthenticationConfig;
6452
6453 fn items(self) -> std::vec::Vec<Self::PageItem> {
6454 self.backend_authentication_configs
6455 }
6456
6457 fn next_page_token(&self) -> std::string::String {
6458 use std::clone::Clone;
6459 self.next_page_token.clone()
6460 }
6461}
6462
6463/// Request used by the GetBackendAuthenticationConfig method.
6464#[derive(Clone, Default, PartialEq)]
6465#[non_exhaustive]
6466pub struct GetBackendAuthenticationConfigRequest {
6467 /// Required. A name of the BackendAuthenticationConfig to get. Must be in the
6468 /// format `projects/*/locations/{location}/backendAuthenticationConfigs/*`.
6469 pub name: std::string::String,
6470
6471 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6472}
6473
6474impl GetBackendAuthenticationConfigRequest {
6475 pub fn new() -> Self {
6476 std::default::Default::default()
6477 }
6478
6479 /// Sets the value of [name][crate::model::GetBackendAuthenticationConfigRequest::name].
6480 ///
6481 /// # Example
6482 /// ```ignore,no_run
6483 /// # use google_cloud_networksecurity_v1::model::GetBackendAuthenticationConfigRequest;
6484 /// let x = GetBackendAuthenticationConfigRequest::new().set_name("example");
6485 /// ```
6486 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6487 self.name = v.into();
6488 self
6489 }
6490}
6491
6492impl wkt::message::Message for GetBackendAuthenticationConfigRequest {
6493 fn typename() -> &'static str {
6494 "type.googleapis.com/google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest"
6495 }
6496}
6497
6498/// Request used by the CreateBackendAuthenticationConfig method.
6499#[derive(Clone, Default, PartialEq)]
6500#[non_exhaustive]
6501pub struct CreateBackendAuthenticationConfigRequest {
6502 /// Required. The parent resource of the BackendAuthenticationConfig. Must be
6503 /// in the format `projects/*/locations/{location}`.
6504 pub parent: std::string::String,
6505
6506 /// Required. Short name of the BackendAuthenticationConfig resource to be
6507 /// created. This value should be 1-63 characters long, containing only
6508 /// letters, numbers, hyphens, and underscores, and should not start with a
6509 /// number. E.g. "backend-auth-config".
6510 pub backend_authentication_config_id: std::string::String,
6511
6512 /// Required. BackendAuthenticationConfig resource to be created.
6513 pub backend_authentication_config:
6514 std::option::Option<crate::model::BackendAuthenticationConfig>,
6515
6516 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6517}
6518
6519impl CreateBackendAuthenticationConfigRequest {
6520 pub fn new() -> Self {
6521 std::default::Default::default()
6522 }
6523
6524 /// Sets the value of [parent][crate::model::CreateBackendAuthenticationConfigRequest::parent].
6525 ///
6526 /// # Example
6527 /// ```ignore,no_run
6528 /// # use google_cloud_networksecurity_v1::model::CreateBackendAuthenticationConfigRequest;
6529 /// let x = CreateBackendAuthenticationConfigRequest::new().set_parent("example");
6530 /// ```
6531 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6532 self.parent = v.into();
6533 self
6534 }
6535
6536 /// Sets the value of [backend_authentication_config_id][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config_id].
6537 ///
6538 /// # Example
6539 /// ```ignore,no_run
6540 /// # use google_cloud_networksecurity_v1::model::CreateBackendAuthenticationConfigRequest;
6541 /// let x = CreateBackendAuthenticationConfigRequest::new().set_backend_authentication_config_id("example");
6542 /// ```
6543 pub fn set_backend_authentication_config_id<T: std::convert::Into<std::string::String>>(
6544 mut self,
6545 v: T,
6546 ) -> Self {
6547 self.backend_authentication_config_id = v.into();
6548 self
6549 }
6550
6551 /// Sets the value of [backend_authentication_config][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config].
6552 ///
6553 /// # Example
6554 /// ```ignore,no_run
6555 /// # use google_cloud_networksecurity_v1::model::CreateBackendAuthenticationConfigRequest;
6556 /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6557 /// let x = CreateBackendAuthenticationConfigRequest::new().set_backend_authentication_config(BackendAuthenticationConfig::default()/* use setters */);
6558 /// ```
6559 pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
6560 where
6561 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6562 {
6563 self.backend_authentication_config = std::option::Option::Some(v.into());
6564 self
6565 }
6566
6567 /// Sets or clears the value of [backend_authentication_config][crate::model::CreateBackendAuthenticationConfigRequest::backend_authentication_config].
6568 ///
6569 /// # Example
6570 /// ```ignore,no_run
6571 /// # use google_cloud_networksecurity_v1::model::CreateBackendAuthenticationConfigRequest;
6572 /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6573 /// let x = CreateBackendAuthenticationConfigRequest::new().set_or_clear_backend_authentication_config(Some(BackendAuthenticationConfig::default()/* use setters */));
6574 /// let x = CreateBackendAuthenticationConfigRequest::new().set_or_clear_backend_authentication_config(None::<BackendAuthenticationConfig>);
6575 /// ```
6576 pub fn set_or_clear_backend_authentication_config<T>(
6577 mut self,
6578 v: std::option::Option<T>,
6579 ) -> Self
6580 where
6581 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6582 {
6583 self.backend_authentication_config = v.map(|x| x.into());
6584 self
6585 }
6586}
6587
6588impl wkt::message::Message for CreateBackendAuthenticationConfigRequest {
6589 fn typename() -> &'static str {
6590 "type.googleapis.com/google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest"
6591 }
6592}
6593
6594/// Request used by UpdateBackendAuthenticationConfig method.
6595#[derive(Clone, Default, PartialEq)]
6596#[non_exhaustive]
6597pub struct UpdateBackendAuthenticationConfigRequest {
6598 /// Optional. Field mask is used to specify the fields to be overwritten in the
6599 /// BackendAuthenticationConfig resource by the update. The fields
6600 /// specified in the update_mask are relative to the resource, not
6601 /// the full request. A field will be overwritten if it is in the
6602 /// mask. If the user does not provide a mask then all fields will be
6603 /// overwritten.
6604 pub update_mask: std::option::Option<wkt::FieldMask>,
6605
6606 /// Required. Updated BackendAuthenticationConfig resource.
6607 pub backend_authentication_config:
6608 std::option::Option<crate::model::BackendAuthenticationConfig>,
6609
6610 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6611}
6612
6613impl UpdateBackendAuthenticationConfigRequest {
6614 pub fn new() -> Self {
6615 std::default::Default::default()
6616 }
6617
6618 /// Sets the value of [update_mask][crate::model::UpdateBackendAuthenticationConfigRequest::update_mask].
6619 ///
6620 /// # Example
6621 /// ```ignore,no_run
6622 /// # use google_cloud_networksecurity_v1::model::UpdateBackendAuthenticationConfigRequest;
6623 /// use wkt::FieldMask;
6624 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6625 /// ```
6626 pub fn set_update_mask<T>(mut self, v: T) -> Self
6627 where
6628 T: std::convert::Into<wkt::FieldMask>,
6629 {
6630 self.update_mask = std::option::Option::Some(v.into());
6631 self
6632 }
6633
6634 /// Sets or clears the value of [update_mask][crate::model::UpdateBackendAuthenticationConfigRequest::update_mask].
6635 ///
6636 /// # Example
6637 /// ```ignore,no_run
6638 /// # use google_cloud_networksecurity_v1::model::UpdateBackendAuthenticationConfigRequest;
6639 /// use wkt::FieldMask;
6640 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6641 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6642 /// ```
6643 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6644 where
6645 T: std::convert::Into<wkt::FieldMask>,
6646 {
6647 self.update_mask = v.map(|x| x.into());
6648 self
6649 }
6650
6651 /// Sets the value of [backend_authentication_config][crate::model::UpdateBackendAuthenticationConfigRequest::backend_authentication_config].
6652 ///
6653 /// # Example
6654 /// ```ignore,no_run
6655 /// # use google_cloud_networksecurity_v1::model::UpdateBackendAuthenticationConfigRequest;
6656 /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6657 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_backend_authentication_config(BackendAuthenticationConfig::default()/* use setters */);
6658 /// ```
6659 pub fn set_backend_authentication_config<T>(mut self, v: T) -> Self
6660 where
6661 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6662 {
6663 self.backend_authentication_config = std::option::Option::Some(v.into());
6664 self
6665 }
6666
6667 /// Sets or clears the value of [backend_authentication_config][crate::model::UpdateBackendAuthenticationConfigRequest::backend_authentication_config].
6668 ///
6669 /// # Example
6670 /// ```ignore,no_run
6671 /// # use google_cloud_networksecurity_v1::model::UpdateBackendAuthenticationConfigRequest;
6672 /// use google_cloud_networksecurity_v1::model::BackendAuthenticationConfig;
6673 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_or_clear_backend_authentication_config(Some(BackendAuthenticationConfig::default()/* use setters */));
6674 /// let x = UpdateBackendAuthenticationConfigRequest::new().set_or_clear_backend_authentication_config(None::<BackendAuthenticationConfig>);
6675 /// ```
6676 pub fn set_or_clear_backend_authentication_config<T>(
6677 mut self,
6678 v: std::option::Option<T>,
6679 ) -> Self
6680 where
6681 T: std::convert::Into<crate::model::BackendAuthenticationConfig>,
6682 {
6683 self.backend_authentication_config = v.map(|x| x.into());
6684 self
6685 }
6686}
6687
6688impl wkt::message::Message for UpdateBackendAuthenticationConfigRequest {
6689 fn typename() -> &'static str {
6690 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest"
6691 }
6692}
6693
6694/// Request used by the DeleteBackendAuthenticationConfig method.
6695#[derive(Clone, Default, PartialEq)]
6696#[non_exhaustive]
6697pub struct DeleteBackendAuthenticationConfigRequest {
6698 /// Required. A name of the BackendAuthenticationConfig to delete. Must be in
6699 /// the format
6700 /// `projects/*/locations/{location}/backendAuthenticationConfigs/*`.
6701 pub name: std::string::String,
6702
6703 /// Optional. Etag of the resource.
6704 /// If this is provided, it must match the server's etag.
6705 pub etag: std::string::String,
6706
6707 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6708}
6709
6710impl DeleteBackendAuthenticationConfigRequest {
6711 pub fn new() -> Self {
6712 std::default::Default::default()
6713 }
6714
6715 /// Sets the value of [name][crate::model::DeleteBackendAuthenticationConfigRequest::name].
6716 ///
6717 /// # Example
6718 /// ```ignore,no_run
6719 /// # use google_cloud_networksecurity_v1::model::DeleteBackendAuthenticationConfigRequest;
6720 /// let x = DeleteBackendAuthenticationConfigRequest::new().set_name("example");
6721 /// ```
6722 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6723 self.name = v.into();
6724 self
6725 }
6726
6727 /// Sets the value of [etag][crate::model::DeleteBackendAuthenticationConfigRequest::etag].
6728 ///
6729 /// # Example
6730 /// ```ignore,no_run
6731 /// # use google_cloud_networksecurity_v1::model::DeleteBackendAuthenticationConfigRequest;
6732 /// let x = DeleteBackendAuthenticationConfigRequest::new().set_etag("example");
6733 /// ```
6734 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6735 self.etag = v.into();
6736 self
6737 }
6738}
6739
6740impl wkt::message::Message for DeleteBackendAuthenticationConfigRequest {
6741 fn typename() -> &'static str {
6742 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest"
6743 }
6744}
6745
6746/// ClientTlsPolicy is a resource that specifies how a client should authenticate
6747/// connections to backends of a service. This resource itself does not affect
6748/// configuration unless it is attached to a backend service resource.
6749#[derive(Clone, Default, PartialEq)]
6750#[non_exhaustive]
6751pub struct ClientTlsPolicy {
6752 /// Required. Name of the ClientTlsPolicy resource. It matches the pattern
6753 /// `projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}`
6754 pub name: std::string::String,
6755
6756 /// Optional. Free-text description of the resource.
6757 pub description: std::string::String,
6758
6759 /// Output only. The timestamp when the resource was created.
6760 pub create_time: std::option::Option<wkt::Timestamp>,
6761
6762 /// Output only. The timestamp when the resource was updated.
6763 pub update_time: std::option::Option<wkt::Timestamp>,
6764
6765 /// Optional. Set of label tags associated with the resource.
6766 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6767
6768 /// Optional. Server Name Indication string to present to the server during TLS
6769 /// handshake. E.g: "secure.example.com".
6770 pub sni: std::string::String,
6771
6772 /// Optional. Defines a mechanism to provision client identity (public and
6773 /// private keys) for peer to peer authentication. The presence of this
6774 /// dictates mTLS.
6775 pub client_certificate: std::option::Option<crate::model::CertificateProvider>,
6776
6777 /// Optional. Defines the mechanism to obtain the Certificate Authority
6778 /// certificate to validate the server certificate. If empty, client does not
6779 /// validate the server certificate.
6780 pub server_validation_ca: std::vec::Vec<crate::model::ValidationCA>,
6781
6782 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6783}
6784
6785impl ClientTlsPolicy {
6786 pub fn new() -> Self {
6787 std::default::Default::default()
6788 }
6789
6790 /// Sets the value of [name][crate::model::ClientTlsPolicy::name].
6791 ///
6792 /// # Example
6793 /// ```ignore,no_run
6794 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6795 /// let x = ClientTlsPolicy::new().set_name("example");
6796 /// ```
6797 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6798 self.name = v.into();
6799 self
6800 }
6801
6802 /// Sets the value of [description][crate::model::ClientTlsPolicy::description].
6803 ///
6804 /// # Example
6805 /// ```ignore,no_run
6806 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6807 /// let x = ClientTlsPolicy::new().set_description("example");
6808 /// ```
6809 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6810 self.description = v.into();
6811 self
6812 }
6813
6814 /// Sets the value of [create_time][crate::model::ClientTlsPolicy::create_time].
6815 ///
6816 /// # Example
6817 /// ```ignore,no_run
6818 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6819 /// use wkt::Timestamp;
6820 /// let x = ClientTlsPolicy::new().set_create_time(Timestamp::default()/* use setters */);
6821 /// ```
6822 pub fn set_create_time<T>(mut self, v: T) -> Self
6823 where
6824 T: std::convert::Into<wkt::Timestamp>,
6825 {
6826 self.create_time = std::option::Option::Some(v.into());
6827 self
6828 }
6829
6830 /// Sets or clears the value of [create_time][crate::model::ClientTlsPolicy::create_time].
6831 ///
6832 /// # Example
6833 /// ```ignore,no_run
6834 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6835 /// use wkt::Timestamp;
6836 /// let x = ClientTlsPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6837 /// let x = ClientTlsPolicy::new().set_or_clear_create_time(None::<Timestamp>);
6838 /// ```
6839 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6840 where
6841 T: std::convert::Into<wkt::Timestamp>,
6842 {
6843 self.create_time = v.map(|x| x.into());
6844 self
6845 }
6846
6847 /// Sets the value of [update_time][crate::model::ClientTlsPolicy::update_time].
6848 ///
6849 /// # Example
6850 /// ```ignore,no_run
6851 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6852 /// use wkt::Timestamp;
6853 /// let x = ClientTlsPolicy::new().set_update_time(Timestamp::default()/* use setters */);
6854 /// ```
6855 pub fn set_update_time<T>(mut self, v: T) -> Self
6856 where
6857 T: std::convert::Into<wkt::Timestamp>,
6858 {
6859 self.update_time = std::option::Option::Some(v.into());
6860 self
6861 }
6862
6863 /// Sets or clears the value of [update_time][crate::model::ClientTlsPolicy::update_time].
6864 ///
6865 /// # Example
6866 /// ```ignore,no_run
6867 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6868 /// use wkt::Timestamp;
6869 /// let x = ClientTlsPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6870 /// let x = ClientTlsPolicy::new().set_or_clear_update_time(None::<Timestamp>);
6871 /// ```
6872 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6873 where
6874 T: std::convert::Into<wkt::Timestamp>,
6875 {
6876 self.update_time = v.map(|x| x.into());
6877 self
6878 }
6879
6880 /// Sets the value of [labels][crate::model::ClientTlsPolicy::labels].
6881 ///
6882 /// # Example
6883 /// ```ignore,no_run
6884 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6885 /// let x = ClientTlsPolicy::new().set_labels([
6886 /// ("key0", "abc"),
6887 /// ("key1", "xyz"),
6888 /// ]);
6889 /// ```
6890 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6891 where
6892 T: std::iter::IntoIterator<Item = (K, V)>,
6893 K: std::convert::Into<std::string::String>,
6894 V: std::convert::Into<std::string::String>,
6895 {
6896 use std::iter::Iterator;
6897 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6898 self
6899 }
6900
6901 /// Sets the value of [sni][crate::model::ClientTlsPolicy::sni].
6902 ///
6903 /// # Example
6904 /// ```ignore,no_run
6905 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6906 /// let x = ClientTlsPolicy::new().set_sni("example");
6907 /// ```
6908 pub fn set_sni<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6909 self.sni = v.into();
6910 self
6911 }
6912
6913 /// Sets the value of [client_certificate][crate::model::ClientTlsPolicy::client_certificate].
6914 ///
6915 /// # Example
6916 /// ```ignore,no_run
6917 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6918 /// use google_cloud_networksecurity_v1::model::CertificateProvider;
6919 /// let x = ClientTlsPolicy::new().set_client_certificate(CertificateProvider::default()/* use setters */);
6920 /// ```
6921 pub fn set_client_certificate<T>(mut self, v: T) -> Self
6922 where
6923 T: std::convert::Into<crate::model::CertificateProvider>,
6924 {
6925 self.client_certificate = std::option::Option::Some(v.into());
6926 self
6927 }
6928
6929 /// Sets or clears the value of [client_certificate][crate::model::ClientTlsPolicy::client_certificate].
6930 ///
6931 /// # Example
6932 /// ```ignore,no_run
6933 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6934 /// use google_cloud_networksecurity_v1::model::CertificateProvider;
6935 /// let x = ClientTlsPolicy::new().set_or_clear_client_certificate(Some(CertificateProvider::default()/* use setters */));
6936 /// let x = ClientTlsPolicy::new().set_or_clear_client_certificate(None::<CertificateProvider>);
6937 /// ```
6938 pub fn set_or_clear_client_certificate<T>(mut self, v: std::option::Option<T>) -> Self
6939 where
6940 T: std::convert::Into<crate::model::CertificateProvider>,
6941 {
6942 self.client_certificate = v.map(|x| x.into());
6943 self
6944 }
6945
6946 /// Sets the value of [server_validation_ca][crate::model::ClientTlsPolicy::server_validation_ca].
6947 ///
6948 /// # Example
6949 /// ```ignore,no_run
6950 /// # use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
6951 /// use google_cloud_networksecurity_v1::model::ValidationCA;
6952 /// let x = ClientTlsPolicy::new()
6953 /// .set_server_validation_ca([
6954 /// ValidationCA::default()/* use setters */,
6955 /// ValidationCA::default()/* use (different) setters */,
6956 /// ]);
6957 /// ```
6958 pub fn set_server_validation_ca<T, V>(mut self, v: T) -> Self
6959 where
6960 T: std::iter::IntoIterator<Item = V>,
6961 V: std::convert::Into<crate::model::ValidationCA>,
6962 {
6963 use std::iter::Iterator;
6964 self.server_validation_ca = v.into_iter().map(|i| i.into()).collect();
6965 self
6966 }
6967}
6968
6969impl wkt::message::Message for ClientTlsPolicy {
6970 fn typename() -> &'static str {
6971 "type.googleapis.com/google.cloud.networksecurity.v1.ClientTlsPolicy"
6972 }
6973}
6974
6975/// Request used by the ListClientTlsPolicies method.
6976#[derive(Clone, Default, PartialEq)]
6977#[non_exhaustive]
6978pub struct ListClientTlsPoliciesRequest {
6979 /// Required. The project and location from which the ClientTlsPolicies should
6980 /// be listed, specified in the format `projects/*/locations/{location}`.
6981 pub parent: std::string::String,
6982
6983 /// Maximum number of ClientTlsPolicies to return per call.
6984 pub page_size: i32,
6985
6986 /// The value returned by the last `ListClientTlsPoliciesResponse`
6987 /// Indicates that this is a continuation of a prior
6988 /// `ListClientTlsPolicies` call, and that the system
6989 /// should return the next page of data.
6990 pub page_token: std::string::String,
6991
6992 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6993}
6994
6995impl ListClientTlsPoliciesRequest {
6996 pub fn new() -> Self {
6997 std::default::Default::default()
6998 }
6999
7000 /// Sets the value of [parent][crate::model::ListClientTlsPoliciesRequest::parent].
7001 ///
7002 /// # Example
7003 /// ```ignore,no_run
7004 /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesRequest;
7005 /// let x = ListClientTlsPoliciesRequest::new().set_parent("example");
7006 /// ```
7007 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7008 self.parent = v.into();
7009 self
7010 }
7011
7012 /// Sets the value of [page_size][crate::model::ListClientTlsPoliciesRequest::page_size].
7013 ///
7014 /// # Example
7015 /// ```ignore,no_run
7016 /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesRequest;
7017 /// let x = ListClientTlsPoliciesRequest::new().set_page_size(42);
7018 /// ```
7019 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7020 self.page_size = v.into();
7021 self
7022 }
7023
7024 /// Sets the value of [page_token][crate::model::ListClientTlsPoliciesRequest::page_token].
7025 ///
7026 /// # Example
7027 /// ```ignore,no_run
7028 /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesRequest;
7029 /// let x = ListClientTlsPoliciesRequest::new().set_page_token("example");
7030 /// ```
7031 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7032 self.page_token = v.into();
7033 self
7034 }
7035}
7036
7037impl wkt::message::Message for ListClientTlsPoliciesRequest {
7038 fn typename() -> &'static str {
7039 "type.googleapis.com/google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest"
7040 }
7041}
7042
7043/// Response returned by the ListClientTlsPolicies method.
7044#[derive(Clone, Default, PartialEq)]
7045#[non_exhaustive]
7046pub struct ListClientTlsPoliciesResponse {
7047 /// List of ClientTlsPolicy resources.
7048 pub client_tls_policies: std::vec::Vec<crate::model::ClientTlsPolicy>,
7049
7050 /// If there might be more results than those appearing in this response, then
7051 /// `next_page_token` is included. To get the next set of results, call this
7052 /// method again using the value of `next_page_token` as `page_token`.
7053 pub next_page_token: std::string::String,
7054
7055 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7056}
7057
7058impl ListClientTlsPoliciesResponse {
7059 pub fn new() -> Self {
7060 std::default::Default::default()
7061 }
7062
7063 /// Sets the value of [client_tls_policies][crate::model::ListClientTlsPoliciesResponse::client_tls_policies].
7064 ///
7065 /// # Example
7066 /// ```ignore,no_run
7067 /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesResponse;
7068 /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7069 /// let x = ListClientTlsPoliciesResponse::new()
7070 /// .set_client_tls_policies([
7071 /// ClientTlsPolicy::default()/* use setters */,
7072 /// ClientTlsPolicy::default()/* use (different) setters */,
7073 /// ]);
7074 /// ```
7075 pub fn set_client_tls_policies<T, V>(mut self, v: T) -> Self
7076 where
7077 T: std::iter::IntoIterator<Item = V>,
7078 V: std::convert::Into<crate::model::ClientTlsPolicy>,
7079 {
7080 use std::iter::Iterator;
7081 self.client_tls_policies = v.into_iter().map(|i| i.into()).collect();
7082 self
7083 }
7084
7085 /// Sets the value of [next_page_token][crate::model::ListClientTlsPoliciesResponse::next_page_token].
7086 ///
7087 /// # Example
7088 /// ```ignore,no_run
7089 /// # use google_cloud_networksecurity_v1::model::ListClientTlsPoliciesResponse;
7090 /// let x = ListClientTlsPoliciesResponse::new().set_next_page_token("example");
7091 /// ```
7092 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7093 self.next_page_token = v.into();
7094 self
7095 }
7096}
7097
7098impl wkt::message::Message for ListClientTlsPoliciesResponse {
7099 fn typename() -> &'static str {
7100 "type.googleapis.com/google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse"
7101 }
7102}
7103
7104#[doc(hidden)]
7105impl google_cloud_gax::paginator::internal::PageableResponse for ListClientTlsPoliciesResponse {
7106 type PageItem = crate::model::ClientTlsPolicy;
7107
7108 fn items(self) -> std::vec::Vec<Self::PageItem> {
7109 self.client_tls_policies
7110 }
7111
7112 fn next_page_token(&self) -> std::string::String {
7113 use std::clone::Clone;
7114 self.next_page_token.clone()
7115 }
7116}
7117
7118/// Request used by the GetClientTlsPolicy method.
7119#[derive(Clone, Default, PartialEq)]
7120#[non_exhaustive]
7121pub struct GetClientTlsPolicyRequest {
7122 /// Required. A name of the ClientTlsPolicy to get. Must be in the format
7123 /// `projects/*/locations/{location}/clientTlsPolicies/*`.
7124 pub name: std::string::String,
7125
7126 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7127}
7128
7129impl GetClientTlsPolicyRequest {
7130 pub fn new() -> Self {
7131 std::default::Default::default()
7132 }
7133
7134 /// Sets the value of [name][crate::model::GetClientTlsPolicyRequest::name].
7135 ///
7136 /// # Example
7137 /// ```ignore,no_run
7138 /// # use google_cloud_networksecurity_v1::model::GetClientTlsPolicyRequest;
7139 /// let x = GetClientTlsPolicyRequest::new().set_name("example");
7140 /// ```
7141 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7142 self.name = v.into();
7143 self
7144 }
7145}
7146
7147impl wkt::message::Message for GetClientTlsPolicyRequest {
7148 fn typename() -> &'static str {
7149 "type.googleapis.com/google.cloud.networksecurity.v1.GetClientTlsPolicyRequest"
7150 }
7151}
7152
7153/// Request used by the CreateClientTlsPolicy method.
7154#[derive(Clone, Default, PartialEq)]
7155#[non_exhaustive]
7156pub struct CreateClientTlsPolicyRequest {
7157 /// Required. The parent resource of the ClientTlsPolicy. Must be in
7158 /// the format `projects/*/locations/{location}`.
7159 pub parent: std::string::String,
7160
7161 /// Required. Short name of the ClientTlsPolicy resource to be created. This
7162 /// value should be 1-63 characters long, containing only letters, numbers,
7163 /// hyphens, and underscores, and should not start with a number. E.g.
7164 /// "client_mtls_policy".
7165 pub client_tls_policy_id: std::string::String,
7166
7167 /// Required. ClientTlsPolicy resource to be created.
7168 pub client_tls_policy: std::option::Option<crate::model::ClientTlsPolicy>,
7169
7170 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7171}
7172
7173impl CreateClientTlsPolicyRequest {
7174 pub fn new() -> Self {
7175 std::default::Default::default()
7176 }
7177
7178 /// Sets the value of [parent][crate::model::CreateClientTlsPolicyRequest::parent].
7179 ///
7180 /// # Example
7181 /// ```ignore,no_run
7182 /// # use google_cloud_networksecurity_v1::model::CreateClientTlsPolicyRequest;
7183 /// let x = CreateClientTlsPolicyRequest::new().set_parent("example");
7184 /// ```
7185 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7186 self.parent = v.into();
7187 self
7188 }
7189
7190 /// Sets the value of [client_tls_policy_id][crate::model::CreateClientTlsPolicyRequest::client_tls_policy_id].
7191 ///
7192 /// # Example
7193 /// ```ignore,no_run
7194 /// # use google_cloud_networksecurity_v1::model::CreateClientTlsPolicyRequest;
7195 /// let x = CreateClientTlsPolicyRequest::new().set_client_tls_policy_id("example");
7196 /// ```
7197 pub fn set_client_tls_policy_id<T: std::convert::Into<std::string::String>>(
7198 mut self,
7199 v: T,
7200 ) -> Self {
7201 self.client_tls_policy_id = v.into();
7202 self
7203 }
7204
7205 /// Sets the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
7206 ///
7207 /// # Example
7208 /// ```ignore,no_run
7209 /// # use google_cloud_networksecurity_v1::model::CreateClientTlsPolicyRequest;
7210 /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7211 /// let x = CreateClientTlsPolicyRequest::new().set_client_tls_policy(ClientTlsPolicy::default()/* use setters */);
7212 /// ```
7213 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
7214 where
7215 T: std::convert::Into<crate::model::ClientTlsPolicy>,
7216 {
7217 self.client_tls_policy = std::option::Option::Some(v.into());
7218 self
7219 }
7220
7221 /// Sets or clears the value of [client_tls_policy][crate::model::CreateClientTlsPolicyRequest::client_tls_policy].
7222 ///
7223 /// # Example
7224 /// ```ignore,no_run
7225 /// # use google_cloud_networksecurity_v1::model::CreateClientTlsPolicyRequest;
7226 /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7227 /// let x = CreateClientTlsPolicyRequest::new().set_or_clear_client_tls_policy(Some(ClientTlsPolicy::default()/* use setters */));
7228 /// let x = CreateClientTlsPolicyRequest::new().set_or_clear_client_tls_policy(None::<ClientTlsPolicy>);
7229 /// ```
7230 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
7231 where
7232 T: std::convert::Into<crate::model::ClientTlsPolicy>,
7233 {
7234 self.client_tls_policy = v.map(|x| x.into());
7235 self
7236 }
7237}
7238
7239impl wkt::message::Message for CreateClientTlsPolicyRequest {
7240 fn typename() -> &'static str {
7241 "type.googleapis.com/google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest"
7242 }
7243}
7244
7245/// Request used by UpdateClientTlsPolicy method.
7246#[derive(Clone, Default, PartialEq)]
7247#[non_exhaustive]
7248pub struct UpdateClientTlsPolicyRequest {
7249 /// Optional. Field mask is used to specify the fields to be overwritten in the
7250 /// ClientTlsPolicy resource by the update. The fields
7251 /// specified in the update_mask are relative to the resource, not
7252 /// the full request. A field will be overwritten if it is in the
7253 /// mask. If the user does not provide a mask then all fields will be
7254 /// overwritten.
7255 pub update_mask: std::option::Option<wkt::FieldMask>,
7256
7257 /// Required. Updated ClientTlsPolicy resource.
7258 pub client_tls_policy: std::option::Option<crate::model::ClientTlsPolicy>,
7259
7260 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7261}
7262
7263impl UpdateClientTlsPolicyRequest {
7264 pub fn new() -> Self {
7265 std::default::Default::default()
7266 }
7267
7268 /// Sets the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
7269 ///
7270 /// # Example
7271 /// ```ignore,no_run
7272 /// # use google_cloud_networksecurity_v1::model::UpdateClientTlsPolicyRequest;
7273 /// use wkt::FieldMask;
7274 /// let x = UpdateClientTlsPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7275 /// ```
7276 pub fn set_update_mask<T>(mut self, v: T) -> Self
7277 where
7278 T: std::convert::Into<wkt::FieldMask>,
7279 {
7280 self.update_mask = std::option::Option::Some(v.into());
7281 self
7282 }
7283
7284 /// Sets or clears the value of [update_mask][crate::model::UpdateClientTlsPolicyRequest::update_mask].
7285 ///
7286 /// # Example
7287 /// ```ignore,no_run
7288 /// # use google_cloud_networksecurity_v1::model::UpdateClientTlsPolicyRequest;
7289 /// use wkt::FieldMask;
7290 /// let x = UpdateClientTlsPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7291 /// let x = UpdateClientTlsPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7292 /// ```
7293 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7294 where
7295 T: std::convert::Into<wkt::FieldMask>,
7296 {
7297 self.update_mask = v.map(|x| x.into());
7298 self
7299 }
7300
7301 /// Sets the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
7302 ///
7303 /// # Example
7304 /// ```ignore,no_run
7305 /// # use google_cloud_networksecurity_v1::model::UpdateClientTlsPolicyRequest;
7306 /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7307 /// let x = UpdateClientTlsPolicyRequest::new().set_client_tls_policy(ClientTlsPolicy::default()/* use setters */);
7308 /// ```
7309 pub fn set_client_tls_policy<T>(mut self, v: T) -> Self
7310 where
7311 T: std::convert::Into<crate::model::ClientTlsPolicy>,
7312 {
7313 self.client_tls_policy = std::option::Option::Some(v.into());
7314 self
7315 }
7316
7317 /// Sets or clears the value of [client_tls_policy][crate::model::UpdateClientTlsPolicyRequest::client_tls_policy].
7318 ///
7319 /// # Example
7320 /// ```ignore,no_run
7321 /// # use google_cloud_networksecurity_v1::model::UpdateClientTlsPolicyRequest;
7322 /// use google_cloud_networksecurity_v1::model::ClientTlsPolicy;
7323 /// let x = UpdateClientTlsPolicyRequest::new().set_or_clear_client_tls_policy(Some(ClientTlsPolicy::default()/* use setters */));
7324 /// let x = UpdateClientTlsPolicyRequest::new().set_or_clear_client_tls_policy(None::<ClientTlsPolicy>);
7325 /// ```
7326 pub fn set_or_clear_client_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
7327 where
7328 T: std::convert::Into<crate::model::ClientTlsPolicy>,
7329 {
7330 self.client_tls_policy = v.map(|x| x.into());
7331 self
7332 }
7333}
7334
7335impl wkt::message::Message for UpdateClientTlsPolicyRequest {
7336 fn typename() -> &'static str {
7337 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest"
7338 }
7339}
7340
7341/// Request used by the DeleteClientTlsPolicy method.
7342#[derive(Clone, Default, PartialEq)]
7343#[non_exhaustive]
7344pub struct DeleteClientTlsPolicyRequest {
7345 /// Required. A name of the ClientTlsPolicy to delete. Must be in
7346 /// the format `projects/*/locations/{location}/clientTlsPolicies/*`.
7347 pub name: std::string::String,
7348
7349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7350}
7351
7352impl DeleteClientTlsPolicyRequest {
7353 pub fn new() -> Self {
7354 std::default::Default::default()
7355 }
7356
7357 /// Sets the value of [name][crate::model::DeleteClientTlsPolicyRequest::name].
7358 ///
7359 /// # Example
7360 /// ```ignore,no_run
7361 /// # use google_cloud_networksecurity_v1::model::DeleteClientTlsPolicyRequest;
7362 /// let x = DeleteClientTlsPolicyRequest::new().set_name("example");
7363 /// ```
7364 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7365 self.name = v.into();
7366 self
7367 }
7368}
7369
7370impl wkt::message::Message for DeleteClientTlsPolicyRequest {
7371 fn typename() -> &'static str {
7372 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest"
7373 }
7374}
7375
7376/// Represents the metadata of the long-running operation.
7377#[derive(Clone, Default, PartialEq)]
7378#[non_exhaustive]
7379pub struct OperationMetadata {
7380 /// Output only. The time the operation was created.
7381 pub create_time: std::option::Option<wkt::Timestamp>,
7382
7383 /// Output only. The time the operation finished running.
7384 pub end_time: std::option::Option<wkt::Timestamp>,
7385
7386 /// Output only. Server-defined resource path for the target of the operation.
7387 pub target: std::string::String,
7388
7389 /// Output only. Name of the verb executed by the operation.
7390 pub verb: std::string::String,
7391
7392 /// Output only. Human-readable status of the operation, if any.
7393 pub status_message: std::string::String,
7394
7395 /// Output only. Identifies whether the user has requested cancellation
7396 /// of the operation. Operations that have successfully been cancelled
7397 /// have [Operation.error][] value with a
7398 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
7399 /// `Code.CANCELLED`.
7400 ///
7401 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
7402 pub requested_cancellation: bool,
7403
7404 /// Output only. API version used to start the operation.
7405 pub api_version: std::string::String,
7406
7407 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7408}
7409
7410impl OperationMetadata {
7411 pub fn new() -> Self {
7412 std::default::Default::default()
7413 }
7414
7415 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
7416 ///
7417 /// # Example
7418 /// ```ignore,no_run
7419 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7420 /// use wkt::Timestamp;
7421 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
7422 /// ```
7423 pub fn set_create_time<T>(mut self, v: T) -> Self
7424 where
7425 T: std::convert::Into<wkt::Timestamp>,
7426 {
7427 self.create_time = std::option::Option::Some(v.into());
7428 self
7429 }
7430
7431 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
7432 ///
7433 /// # Example
7434 /// ```ignore,no_run
7435 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7436 /// use wkt::Timestamp;
7437 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7438 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
7439 /// ```
7440 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7441 where
7442 T: std::convert::Into<wkt::Timestamp>,
7443 {
7444 self.create_time = v.map(|x| x.into());
7445 self
7446 }
7447
7448 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
7449 ///
7450 /// # Example
7451 /// ```ignore,no_run
7452 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7453 /// use wkt::Timestamp;
7454 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7455 /// ```
7456 pub fn set_end_time<T>(mut self, v: T) -> Self
7457 where
7458 T: std::convert::Into<wkt::Timestamp>,
7459 {
7460 self.end_time = std::option::Option::Some(v.into());
7461 self
7462 }
7463
7464 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
7465 ///
7466 /// # Example
7467 /// ```ignore,no_run
7468 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7469 /// use wkt::Timestamp;
7470 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7471 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7472 /// ```
7473 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7474 where
7475 T: std::convert::Into<wkt::Timestamp>,
7476 {
7477 self.end_time = v.map(|x| x.into());
7478 self
7479 }
7480
7481 /// Sets the value of [target][crate::model::OperationMetadata::target].
7482 ///
7483 /// # Example
7484 /// ```ignore,no_run
7485 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7486 /// let x = OperationMetadata::new().set_target("example");
7487 /// ```
7488 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7489 self.target = v.into();
7490 self
7491 }
7492
7493 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
7494 ///
7495 /// # Example
7496 /// ```ignore,no_run
7497 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7498 /// let x = OperationMetadata::new().set_verb("example");
7499 /// ```
7500 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7501 self.verb = v.into();
7502 self
7503 }
7504
7505 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
7506 ///
7507 /// # Example
7508 /// ```ignore,no_run
7509 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7510 /// let x = OperationMetadata::new().set_status_message("example");
7511 /// ```
7512 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7513 self.status_message = v.into();
7514 self
7515 }
7516
7517 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
7518 ///
7519 /// # Example
7520 /// ```ignore,no_run
7521 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7522 /// let x = OperationMetadata::new().set_requested_cancellation(true);
7523 /// ```
7524 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7525 self.requested_cancellation = v.into();
7526 self
7527 }
7528
7529 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
7530 ///
7531 /// # Example
7532 /// ```ignore,no_run
7533 /// # use google_cloud_networksecurity_v1::model::OperationMetadata;
7534 /// let x = OperationMetadata::new().set_api_version("example");
7535 /// ```
7536 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7537 self.api_version = v.into();
7538 self
7539 }
7540}
7541
7542impl wkt::message::Message for OperationMetadata {
7543 fn typename() -> &'static str {
7544 "type.googleapis.com/google.cloud.networksecurity.v1.OperationMetadata"
7545 }
7546}
7547
7548/// A DNS threat detector sends DNS query logs to a _provider_ that then
7549/// analyzes the logs to identify threat events in the DNS queries.
7550/// By default, all VPC networks in your projects are included. You can exclude
7551/// specific networks by supplying `excluded_networks`.
7552#[derive(Clone, Default, PartialEq)]
7553#[non_exhaustive]
7554pub struct DnsThreatDetector {
7555 /// Immutable. Identifier. Name of the DnsThreatDetector resource.
7556 pub name: std::string::String,
7557
7558 /// Output only. Create time stamp.
7559 pub create_time: std::option::Option<wkt::Timestamp>,
7560
7561 /// Output only. Update time stamp.
7562 pub update_time: std::option::Option<wkt::Timestamp>,
7563
7564 /// Optional. Any labels associated with the DnsThreatDetector, listed as key
7565 /// value pairs.
7566 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7567
7568 /// Optional. A list of network resource names which aren't monitored by this
7569 /// DnsThreatDetector.
7570 ///
7571 /// Example:
7572 /// `projects/PROJECT_ID/global/networks/NETWORK_NAME`.
7573 pub excluded_networks: std::vec::Vec<std::string::String>,
7574
7575 /// Required. The provider used for DNS threat analysis.
7576 pub provider: crate::model::dns_threat_detector::Provider,
7577
7578 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7579}
7580
7581impl DnsThreatDetector {
7582 pub fn new() -> Self {
7583 std::default::Default::default()
7584 }
7585
7586 /// Sets the value of [name][crate::model::DnsThreatDetector::name].
7587 ///
7588 /// # Example
7589 /// ```ignore,no_run
7590 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7591 /// let x = DnsThreatDetector::new().set_name("example");
7592 /// ```
7593 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7594 self.name = v.into();
7595 self
7596 }
7597
7598 /// Sets the value of [create_time][crate::model::DnsThreatDetector::create_time].
7599 ///
7600 /// # Example
7601 /// ```ignore,no_run
7602 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7603 /// use wkt::Timestamp;
7604 /// let x = DnsThreatDetector::new().set_create_time(Timestamp::default()/* use setters */);
7605 /// ```
7606 pub fn set_create_time<T>(mut self, v: T) -> Self
7607 where
7608 T: std::convert::Into<wkt::Timestamp>,
7609 {
7610 self.create_time = std::option::Option::Some(v.into());
7611 self
7612 }
7613
7614 /// Sets or clears the value of [create_time][crate::model::DnsThreatDetector::create_time].
7615 ///
7616 /// # Example
7617 /// ```ignore,no_run
7618 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7619 /// use wkt::Timestamp;
7620 /// let x = DnsThreatDetector::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7621 /// let x = DnsThreatDetector::new().set_or_clear_create_time(None::<Timestamp>);
7622 /// ```
7623 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7624 where
7625 T: std::convert::Into<wkt::Timestamp>,
7626 {
7627 self.create_time = v.map(|x| x.into());
7628 self
7629 }
7630
7631 /// Sets the value of [update_time][crate::model::DnsThreatDetector::update_time].
7632 ///
7633 /// # Example
7634 /// ```ignore,no_run
7635 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7636 /// use wkt::Timestamp;
7637 /// let x = DnsThreatDetector::new().set_update_time(Timestamp::default()/* use setters */);
7638 /// ```
7639 pub fn set_update_time<T>(mut self, v: T) -> Self
7640 where
7641 T: std::convert::Into<wkt::Timestamp>,
7642 {
7643 self.update_time = std::option::Option::Some(v.into());
7644 self
7645 }
7646
7647 /// Sets or clears the value of [update_time][crate::model::DnsThreatDetector::update_time].
7648 ///
7649 /// # Example
7650 /// ```ignore,no_run
7651 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7652 /// use wkt::Timestamp;
7653 /// let x = DnsThreatDetector::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7654 /// let x = DnsThreatDetector::new().set_or_clear_update_time(None::<Timestamp>);
7655 /// ```
7656 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7657 where
7658 T: std::convert::Into<wkt::Timestamp>,
7659 {
7660 self.update_time = v.map(|x| x.into());
7661 self
7662 }
7663
7664 /// Sets the value of [labels][crate::model::DnsThreatDetector::labels].
7665 ///
7666 /// # Example
7667 /// ```ignore,no_run
7668 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7669 /// let x = DnsThreatDetector::new().set_labels([
7670 /// ("key0", "abc"),
7671 /// ("key1", "xyz"),
7672 /// ]);
7673 /// ```
7674 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7675 where
7676 T: std::iter::IntoIterator<Item = (K, V)>,
7677 K: std::convert::Into<std::string::String>,
7678 V: std::convert::Into<std::string::String>,
7679 {
7680 use std::iter::Iterator;
7681 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7682 self
7683 }
7684
7685 /// Sets the value of [excluded_networks][crate::model::DnsThreatDetector::excluded_networks].
7686 ///
7687 /// # Example
7688 /// ```ignore,no_run
7689 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7690 /// let x = DnsThreatDetector::new().set_excluded_networks(["a", "b", "c"]);
7691 /// ```
7692 pub fn set_excluded_networks<T, V>(mut self, v: T) -> Self
7693 where
7694 T: std::iter::IntoIterator<Item = V>,
7695 V: std::convert::Into<std::string::String>,
7696 {
7697 use std::iter::Iterator;
7698 self.excluded_networks = v.into_iter().map(|i| i.into()).collect();
7699 self
7700 }
7701
7702 /// Sets the value of [provider][crate::model::DnsThreatDetector::provider].
7703 ///
7704 /// # Example
7705 /// ```ignore,no_run
7706 /// # use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7707 /// use google_cloud_networksecurity_v1::model::dns_threat_detector::Provider;
7708 /// let x0 = DnsThreatDetector::new().set_provider(Provider::Infoblox);
7709 /// ```
7710 pub fn set_provider<T: std::convert::Into<crate::model::dns_threat_detector::Provider>>(
7711 mut self,
7712 v: T,
7713 ) -> Self {
7714 self.provider = v.into();
7715 self
7716 }
7717}
7718
7719impl wkt::message::Message for DnsThreatDetector {
7720 fn typename() -> &'static str {
7721 "type.googleapis.com/google.cloud.networksecurity.v1.DnsThreatDetector"
7722 }
7723}
7724
7725/// Defines additional types related to [DnsThreatDetector].
7726pub mod dns_threat_detector {
7727 #[allow(unused_imports)]
7728 use super::*;
7729
7730 /// Name of the provider used for DNS threat analysis.
7731 ///
7732 /// # Working with unknown values
7733 ///
7734 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7735 /// additional enum variants at any time. Adding new variants is not considered
7736 /// a breaking change. Applications should write their code in anticipation of:
7737 ///
7738 /// - New values appearing in future releases of the client library, **and**
7739 /// - New values received dynamically, without application changes.
7740 ///
7741 /// Please consult the [Working with enums] section in the user guide for some
7742 /// guidelines.
7743 ///
7744 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7745 #[derive(Clone, Debug, PartialEq)]
7746 #[non_exhaustive]
7747 pub enum Provider {
7748 /// An unspecified provider.
7749 Unspecified,
7750 /// The Infoblox DNS threat detector provider.
7751 Infoblox,
7752 /// If set, the enum was initialized with an unknown value.
7753 ///
7754 /// Applications can examine the value using [Provider::value] or
7755 /// [Provider::name].
7756 UnknownValue(provider::UnknownValue),
7757 }
7758
7759 #[doc(hidden)]
7760 pub mod provider {
7761 #[allow(unused_imports)]
7762 use super::*;
7763 #[derive(Clone, Debug, PartialEq)]
7764 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7765 }
7766
7767 impl Provider {
7768 /// Gets the enum value.
7769 ///
7770 /// Returns `None` if the enum contains an unknown value deserialized from
7771 /// the string representation of enums.
7772 pub fn value(&self) -> std::option::Option<i32> {
7773 match self {
7774 Self::Unspecified => std::option::Option::Some(0),
7775 Self::Infoblox => std::option::Option::Some(1),
7776 Self::UnknownValue(u) => u.0.value(),
7777 }
7778 }
7779
7780 /// Gets the enum value as a string.
7781 ///
7782 /// Returns `None` if the enum contains an unknown value deserialized from
7783 /// the integer representation of enums.
7784 pub fn name(&self) -> std::option::Option<&str> {
7785 match self {
7786 Self::Unspecified => std::option::Option::Some("PROVIDER_UNSPECIFIED"),
7787 Self::Infoblox => std::option::Option::Some("INFOBLOX"),
7788 Self::UnknownValue(u) => u.0.name(),
7789 }
7790 }
7791 }
7792
7793 impl std::default::Default for Provider {
7794 fn default() -> Self {
7795 use std::convert::From;
7796 Self::from(0)
7797 }
7798 }
7799
7800 impl std::fmt::Display for Provider {
7801 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7802 wkt::internal::display_enum(f, self.name(), self.value())
7803 }
7804 }
7805
7806 impl std::convert::From<i32> for Provider {
7807 fn from(value: i32) -> Self {
7808 match value {
7809 0 => Self::Unspecified,
7810 1 => Self::Infoblox,
7811 _ => Self::UnknownValue(provider::UnknownValue(
7812 wkt::internal::UnknownEnumValue::Integer(value),
7813 )),
7814 }
7815 }
7816 }
7817
7818 impl std::convert::From<&str> for Provider {
7819 fn from(value: &str) -> Self {
7820 use std::string::ToString;
7821 match value {
7822 "PROVIDER_UNSPECIFIED" => Self::Unspecified,
7823 "INFOBLOX" => Self::Infoblox,
7824 _ => Self::UnknownValue(provider::UnknownValue(
7825 wkt::internal::UnknownEnumValue::String(value.to_string()),
7826 )),
7827 }
7828 }
7829 }
7830
7831 impl serde::ser::Serialize for Provider {
7832 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7833 where
7834 S: serde::Serializer,
7835 {
7836 match self {
7837 Self::Unspecified => serializer.serialize_i32(0),
7838 Self::Infoblox => serializer.serialize_i32(1),
7839 Self::UnknownValue(u) => u.0.serialize(serializer),
7840 }
7841 }
7842 }
7843
7844 impl<'de> serde::de::Deserialize<'de> for Provider {
7845 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7846 where
7847 D: serde::Deserializer<'de>,
7848 {
7849 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Provider>::new(
7850 ".google.cloud.networksecurity.v1.DnsThreatDetector.Provider",
7851 ))
7852 }
7853 }
7854}
7855
7856/// The message for requesting a list of DnsThreatDetectors in the project.
7857#[derive(Clone, Default, PartialEq)]
7858#[non_exhaustive]
7859pub struct ListDnsThreatDetectorsRequest {
7860 /// Required. The parent value for `ListDnsThreatDetectorsRequest`.
7861 pub parent: std::string::String,
7862
7863 /// Optional. The requested page size. The server may return fewer items than
7864 /// requested. If unspecified, the server picks an appropriate default.
7865 pub page_size: i32,
7866
7867 /// Optional. A page token received from a previous
7868 /// `ListDnsThreatDetectorsRequest` call. Provide this to retrieve the
7869 /// subsequent page.
7870 pub page_token: std::string::String,
7871
7872 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7873}
7874
7875impl ListDnsThreatDetectorsRequest {
7876 pub fn new() -> Self {
7877 std::default::Default::default()
7878 }
7879
7880 /// Sets the value of [parent][crate::model::ListDnsThreatDetectorsRequest::parent].
7881 ///
7882 /// # Example
7883 /// ```ignore,no_run
7884 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsRequest;
7885 /// let x = ListDnsThreatDetectorsRequest::new().set_parent("example");
7886 /// ```
7887 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7888 self.parent = v.into();
7889 self
7890 }
7891
7892 /// Sets the value of [page_size][crate::model::ListDnsThreatDetectorsRequest::page_size].
7893 ///
7894 /// # Example
7895 /// ```ignore,no_run
7896 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsRequest;
7897 /// let x = ListDnsThreatDetectorsRequest::new().set_page_size(42);
7898 /// ```
7899 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7900 self.page_size = v.into();
7901 self
7902 }
7903
7904 /// Sets the value of [page_token][crate::model::ListDnsThreatDetectorsRequest::page_token].
7905 ///
7906 /// # Example
7907 /// ```ignore,no_run
7908 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsRequest;
7909 /// let x = ListDnsThreatDetectorsRequest::new().set_page_token("example");
7910 /// ```
7911 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7912 self.page_token = v.into();
7913 self
7914 }
7915}
7916
7917impl wkt::message::Message for ListDnsThreatDetectorsRequest {
7918 fn typename() -> &'static str {
7919 "type.googleapis.com/google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest"
7920 }
7921}
7922
7923/// The response message to requesting a list of DnsThreatDetectors.
7924#[derive(Clone, Default, PartialEq)]
7925#[non_exhaustive]
7926pub struct ListDnsThreatDetectorsResponse {
7927 /// The list of DnsThreatDetector resources.
7928 pub dns_threat_detectors: std::vec::Vec<crate::model::DnsThreatDetector>,
7929
7930 /// A token, which can be sent as `page_token`, to retrieve the next page.
7931 pub next_page_token: std::string::String,
7932
7933 /// Unordered list. Unreachable `DnsThreatDetector` resources.
7934 pub unreachable: std::vec::Vec<std::string::String>,
7935
7936 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7937}
7938
7939impl ListDnsThreatDetectorsResponse {
7940 pub fn new() -> Self {
7941 std::default::Default::default()
7942 }
7943
7944 /// Sets the value of [dns_threat_detectors][crate::model::ListDnsThreatDetectorsResponse::dns_threat_detectors].
7945 ///
7946 /// # Example
7947 /// ```ignore,no_run
7948 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsResponse;
7949 /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
7950 /// let x = ListDnsThreatDetectorsResponse::new()
7951 /// .set_dns_threat_detectors([
7952 /// DnsThreatDetector::default()/* use setters */,
7953 /// DnsThreatDetector::default()/* use (different) setters */,
7954 /// ]);
7955 /// ```
7956 pub fn set_dns_threat_detectors<T, V>(mut self, v: T) -> Self
7957 where
7958 T: std::iter::IntoIterator<Item = V>,
7959 V: std::convert::Into<crate::model::DnsThreatDetector>,
7960 {
7961 use std::iter::Iterator;
7962 self.dns_threat_detectors = v.into_iter().map(|i| i.into()).collect();
7963 self
7964 }
7965
7966 /// Sets the value of [next_page_token][crate::model::ListDnsThreatDetectorsResponse::next_page_token].
7967 ///
7968 /// # Example
7969 /// ```ignore,no_run
7970 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsResponse;
7971 /// let x = ListDnsThreatDetectorsResponse::new().set_next_page_token("example");
7972 /// ```
7973 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7974 self.next_page_token = v.into();
7975 self
7976 }
7977
7978 /// Sets the value of [unreachable][crate::model::ListDnsThreatDetectorsResponse::unreachable].
7979 ///
7980 /// # Example
7981 /// ```ignore,no_run
7982 /// # use google_cloud_networksecurity_v1::model::ListDnsThreatDetectorsResponse;
7983 /// let x = ListDnsThreatDetectorsResponse::new().set_unreachable(["a", "b", "c"]);
7984 /// ```
7985 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7986 where
7987 T: std::iter::IntoIterator<Item = V>,
7988 V: std::convert::Into<std::string::String>,
7989 {
7990 use std::iter::Iterator;
7991 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7992 self
7993 }
7994}
7995
7996impl wkt::message::Message for ListDnsThreatDetectorsResponse {
7997 fn typename() -> &'static str {
7998 "type.googleapis.com/google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse"
7999 }
8000}
8001
8002#[doc(hidden)]
8003impl google_cloud_gax::paginator::internal::PageableResponse for ListDnsThreatDetectorsResponse {
8004 type PageItem = crate::model::DnsThreatDetector;
8005
8006 fn items(self) -> std::vec::Vec<Self::PageItem> {
8007 self.dns_threat_detectors
8008 }
8009
8010 fn next_page_token(&self) -> std::string::String {
8011 use std::clone::Clone;
8012 self.next_page_token.clone()
8013 }
8014}
8015
8016/// The message sent to get a DnsThreatDetector.
8017#[derive(Clone, Default, PartialEq)]
8018#[non_exhaustive]
8019pub struct GetDnsThreatDetectorRequest {
8020 /// Required. Name of the DnsThreatDetector resource.
8021 pub name: std::string::String,
8022
8023 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8024}
8025
8026impl GetDnsThreatDetectorRequest {
8027 pub fn new() -> Self {
8028 std::default::Default::default()
8029 }
8030
8031 /// Sets the value of [name][crate::model::GetDnsThreatDetectorRequest::name].
8032 ///
8033 /// # Example
8034 /// ```ignore,no_run
8035 /// # use google_cloud_networksecurity_v1::model::GetDnsThreatDetectorRequest;
8036 /// let x = GetDnsThreatDetectorRequest::new().set_name("example");
8037 /// ```
8038 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8039 self.name = v.into();
8040 self
8041 }
8042}
8043
8044impl wkt::message::Message for GetDnsThreatDetectorRequest {
8045 fn typename() -> &'static str {
8046 "type.googleapis.com/google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest"
8047 }
8048}
8049
8050/// The message to create a DnsThreatDetector.
8051#[derive(Clone, Default, PartialEq)]
8052#[non_exhaustive]
8053pub struct CreateDnsThreatDetectorRequest {
8054 /// Required. The value for the parent of the DnsThreatDetector resource.
8055 pub parent: std::string::String,
8056
8057 /// Optional. The ID of the requesting DnsThreatDetector object.
8058 /// If this field is not supplied, the service generates an identifier.
8059 pub dns_threat_detector_id: std::string::String,
8060
8061 /// Required. The `DnsThreatDetector` resource to create.
8062 pub dns_threat_detector: std::option::Option<crate::model::DnsThreatDetector>,
8063
8064 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8065}
8066
8067impl CreateDnsThreatDetectorRequest {
8068 pub fn new() -> Self {
8069 std::default::Default::default()
8070 }
8071
8072 /// Sets the value of [parent][crate::model::CreateDnsThreatDetectorRequest::parent].
8073 ///
8074 /// # Example
8075 /// ```ignore,no_run
8076 /// # use google_cloud_networksecurity_v1::model::CreateDnsThreatDetectorRequest;
8077 /// let x = CreateDnsThreatDetectorRequest::new().set_parent("example");
8078 /// ```
8079 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8080 self.parent = v.into();
8081 self
8082 }
8083
8084 /// Sets the value of [dns_threat_detector_id][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector_id].
8085 ///
8086 /// # Example
8087 /// ```ignore,no_run
8088 /// # use google_cloud_networksecurity_v1::model::CreateDnsThreatDetectorRequest;
8089 /// let x = CreateDnsThreatDetectorRequest::new().set_dns_threat_detector_id("example");
8090 /// ```
8091 pub fn set_dns_threat_detector_id<T: std::convert::Into<std::string::String>>(
8092 mut self,
8093 v: T,
8094 ) -> Self {
8095 self.dns_threat_detector_id = v.into();
8096 self
8097 }
8098
8099 /// Sets the value of [dns_threat_detector][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector].
8100 ///
8101 /// # Example
8102 /// ```ignore,no_run
8103 /// # use google_cloud_networksecurity_v1::model::CreateDnsThreatDetectorRequest;
8104 /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8105 /// let x = CreateDnsThreatDetectorRequest::new().set_dns_threat_detector(DnsThreatDetector::default()/* use setters */);
8106 /// ```
8107 pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
8108 where
8109 T: std::convert::Into<crate::model::DnsThreatDetector>,
8110 {
8111 self.dns_threat_detector = std::option::Option::Some(v.into());
8112 self
8113 }
8114
8115 /// Sets or clears the value of [dns_threat_detector][crate::model::CreateDnsThreatDetectorRequest::dns_threat_detector].
8116 ///
8117 /// # Example
8118 /// ```ignore,no_run
8119 /// # use google_cloud_networksecurity_v1::model::CreateDnsThreatDetectorRequest;
8120 /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8121 /// let x = CreateDnsThreatDetectorRequest::new().set_or_clear_dns_threat_detector(Some(DnsThreatDetector::default()/* use setters */));
8122 /// let x = CreateDnsThreatDetectorRequest::new().set_or_clear_dns_threat_detector(None::<DnsThreatDetector>);
8123 /// ```
8124 pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
8125 where
8126 T: std::convert::Into<crate::model::DnsThreatDetector>,
8127 {
8128 self.dns_threat_detector = v.map(|x| x.into());
8129 self
8130 }
8131}
8132
8133impl wkt::message::Message for CreateDnsThreatDetectorRequest {
8134 fn typename() -> &'static str {
8135 "type.googleapis.com/google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest"
8136 }
8137}
8138
8139/// The message for updating a DnsThreatDetector.
8140#[derive(Clone, Default, PartialEq)]
8141#[non_exhaustive]
8142pub struct UpdateDnsThreatDetectorRequest {
8143 /// Optional. The field mask is used to specify the fields to be overwritten in
8144 /// the DnsThreatDetector resource by the update. The fields specified in the
8145 /// update_mask are relative to the resource, not the full request. A field
8146 /// will be overwritten if it is in the mask. If the mask is not provided then
8147 /// all fields present in the request will be overwritten.
8148 pub update_mask: std::option::Option<wkt::FieldMask>,
8149
8150 /// Required. The DnsThreatDetector resource being updated.
8151 pub dns_threat_detector: std::option::Option<crate::model::DnsThreatDetector>,
8152
8153 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8154}
8155
8156impl UpdateDnsThreatDetectorRequest {
8157 pub fn new() -> Self {
8158 std::default::Default::default()
8159 }
8160
8161 /// Sets the value of [update_mask][crate::model::UpdateDnsThreatDetectorRequest::update_mask].
8162 ///
8163 /// # Example
8164 /// ```ignore,no_run
8165 /// # use google_cloud_networksecurity_v1::model::UpdateDnsThreatDetectorRequest;
8166 /// use wkt::FieldMask;
8167 /// let x = UpdateDnsThreatDetectorRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8168 /// ```
8169 pub fn set_update_mask<T>(mut self, v: T) -> Self
8170 where
8171 T: std::convert::Into<wkt::FieldMask>,
8172 {
8173 self.update_mask = std::option::Option::Some(v.into());
8174 self
8175 }
8176
8177 /// Sets or clears the value of [update_mask][crate::model::UpdateDnsThreatDetectorRequest::update_mask].
8178 ///
8179 /// # Example
8180 /// ```ignore,no_run
8181 /// # use google_cloud_networksecurity_v1::model::UpdateDnsThreatDetectorRequest;
8182 /// use wkt::FieldMask;
8183 /// let x = UpdateDnsThreatDetectorRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8184 /// let x = UpdateDnsThreatDetectorRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8185 /// ```
8186 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8187 where
8188 T: std::convert::Into<wkt::FieldMask>,
8189 {
8190 self.update_mask = v.map(|x| x.into());
8191 self
8192 }
8193
8194 /// Sets the value of [dns_threat_detector][crate::model::UpdateDnsThreatDetectorRequest::dns_threat_detector].
8195 ///
8196 /// # Example
8197 /// ```ignore,no_run
8198 /// # use google_cloud_networksecurity_v1::model::UpdateDnsThreatDetectorRequest;
8199 /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8200 /// let x = UpdateDnsThreatDetectorRequest::new().set_dns_threat_detector(DnsThreatDetector::default()/* use setters */);
8201 /// ```
8202 pub fn set_dns_threat_detector<T>(mut self, v: T) -> Self
8203 where
8204 T: std::convert::Into<crate::model::DnsThreatDetector>,
8205 {
8206 self.dns_threat_detector = std::option::Option::Some(v.into());
8207 self
8208 }
8209
8210 /// Sets or clears the value of [dns_threat_detector][crate::model::UpdateDnsThreatDetectorRequest::dns_threat_detector].
8211 ///
8212 /// # Example
8213 /// ```ignore,no_run
8214 /// # use google_cloud_networksecurity_v1::model::UpdateDnsThreatDetectorRequest;
8215 /// use google_cloud_networksecurity_v1::model::DnsThreatDetector;
8216 /// let x = UpdateDnsThreatDetectorRequest::new().set_or_clear_dns_threat_detector(Some(DnsThreatDetector::default()/* use setters */));
8217 /// let x = UpdateDnsThreatDetectorRequest::new().set_or_clear_dns_threat_detector(None::<DnsThreatDetector>);
8218 /// ```
8219 pub fn set_or_clear_dns_threat_detector<T>(mut self, v: std::option::Option<T>) -> Self
8220 where
8221 T: std::convert::Into<crate::model::DnsThreatDetector>,
8222 {
8223 self.dns_threat_detector = v.map(|x| x.into());
8224 self
8225 }
8226}
8227
8228impl wkt::message::Message for UpdateDnsThreatDetectorRequest {
8229 fn typename() -> &'static str {
8230 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest"
8231 }
8232}
8233
8234/// The message for deleting a DnsThreatDetector.
8235#[derive(Clone, Default, PartialEq)]
8236#[non_exhaustive]
8237pub struct DeleteDnsThreatDetectorRequest {
8238 /// Required. Name of the DnsThreatDetector resource.
8239 pub name: std::string::String,
8240
8241 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8242}
8243
8244impl DeleteDnsThreatDetectorRequest {
8245 pub fn new() -> Self {
8246 std::default::Default::default()
8247 }
8248
8249 /// Sets the value of [name][crate::model::DeleteDnsThreatDetectorRequest::name].
8250 ///
8251 /// # Example
8252 /// ```ignore,no_run
8253 /// # use google_cloud_networksecurity_v1::model::DeleteDnsThreatDetectorRequest;
8254 /// let x = DeleteDnsThreatDetectorRequest::new().set_name("example");
8255 /// ```
8256 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8257 self.name = v.into();
8258 self
8259 }
8260}
8261
8262impl wkt::message::Message for DeleteDnsThreatDetectorRequest {
8263 fn typename() -> &'static str {
8264 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest"
8265 }
8266}
8267
8268/// Message describing Endpoint object.
8269#[derive(Clone, Default, PartialEq)]
8270#[non_exhaustive]
8271pub struct FirewallEndpoint {
8272 /// Immutable. Identifier. Name of resource.
8273 pub name: std::string::String,
8274
8275 /// Optional. Description of the firewall endpoint. Max length 2048
8276 /// characters.
8277 pub description: std::string::String,
8278
8279 /// Output only. Create time stamp.
8280 pub create_time: std::option::Option<wkt::Timestamp>,
8281
8282 /// Output only. Update time stamp
8283 pub update_time: std::option::Option<wkt::Timestamp>,
8284
8285 /// Optional. Labels as key value pairs
8286 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8287
8288 /// Output only. Current state of the endpoint.
8289 pub state: crate::model::firewall_endpoint::State,
8290
8291 /// Output only. Whether reconciling is in progress, recommended per
8292 /// <https://google.aip.dev/128>.
8293 pub reconciling: bool,
8294
8295 /// Output only. List of networks that are associated with this endpoint in the
8296 /// local zone. This is a projection of the FirewallEndpointAssociations
8297 /// pointing at this endpoint. A network will only appear in this list after
8298 /// traffic routing is fully configured. Format:
8299 /// projects/{project}/global/networks/{name}.
8300 #[deprecated]
8301 pub associated_networks: std::vec::Vec<std::string::String>,
8302
8303 /// Output only. List of FirewallEndpointAssociations that are associated to
8304 /// this endpoint. An association will only appear in this list after traffic
8305 /// routing is fully configured.
8306 pub associations: std::vec::Vec<crate::model::firewall_endpoint::AssociationReference>,
8307
8308 /// Output only. [Output Only] Reserved for future use.
8309 pub satisfies_pzs: std::option::Option<bool>,
8310
8311 /// Output only. [Output Only] Reserved for future use.
8312 pub satisfies_pzi: std::option::Option<bool>,
8313
8314 /// Optional. Project to charge for the deployed firewall endpoint.
8315 /// This field must be specified when creating the endpoint in the organization
8316 /// scope, and should be omitted otherwise.
8317 pub billing_project_id: std::string::String,
8318
8319 /// Optional. Settings for the endpoint.
8320 pub endpoint_settings: std::option::Option<crate::model::firewall_endpoint::EndpointSettings>,
8321
8322 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8323}
8324
8325impl FirewallEndpoint {
8326 pub fn new() -> Self {
8327 std::default::Default::default()
8328 }
8329
8330 /// Sets the value of [name][crate::model::FirewallEndpoint::name].
8331 ///
8332 /// # Example
8333 /// ```ignore,no_run
8334 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8335 /// let x = FirewallEndpoint::new().set_name("example");
8336 /// ```
8337 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8338 self.name = v.into();
8339 self
8340 }
8341
8342 /// Sets the value of [description][crate::model::FirewallEndpoint::description].
8343 ///
8344 /// # Example
8345 /// ```ignore,no_run
8346 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8347 /// let x = FirewallEndpoint::new().set_description("example");
8348 /// ```
8349 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8350 self.description = v.into();
8351 self
8352 }
8353
8354 /// Sets the value of [create_time][crate::model::FirewallEndpoint::create_time].
8355 ///
8356 /// # Example
8357 /// ```ignore,no_run
8358 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8359 /// use wkt::Timestamp;
8360 /// let x = FirewallEndpoint::new().set_create_time(Timestamp::default()/* use setters */);
8361 /// ```
8362 pub fn set_create_time<T>(mut self, v: T) -> Self
8363 where
8364 T: std::convert::Into<wkt::Timestamp>,
8365 {
8366 self.create_time = std::option::Option::Some(v.into());
8367 self
8368 }
8369
8370 /// Sets or clears the value of [create_time][crate::model::FirewallEndpoint::create_time].
8371 ///
8372 /// # Example
8373 /// ```ignore,no_run
8374 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8375 /// use wkt::Timestamp;
8376 /// let x = FirewallEndpoint::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8377 /// let x = FirewallEndpoint::new().set_or_clear_create_time(None::<Timestamp>);
8378 /// ```
8379 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8380 where
8381 T: std::convert::Into<wkt::Timestamp>,
8382 {
8383 self.create_time = v.map(|x| x.into());
8384 self
8385 }
8386
8387 /// Sets the value of [update_time][crate::model::FirewallEndpoint::update_time].
8388 ///
8389 /// # Example
8390 /// ```ignore,no_run
8391 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8392 /// use wkt::Timestamp;
8393 /// let x = FirewallEndpoint::new().set_update_time(Timestamp::default()/* use setters */);
8394 /// ```
8395 pub fn set_update_time<T>(mut self, v: T) -> Self
8396 where
8397 T: std::convert::Into<wkt::Timestamp>,
8398 {
8399 self.update_time = std::option::Option::Some(v.into());
8400 self
8401 }
8402
8403 /// Sets or clears the value of [update_time][crate::model::FirewallEndpoint::update_time].
8404 ///
8405 /// # Example
8406 /// ```ignore,no_run
8407 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8408 /// use wkt::Timestamp;
8409 /// let x = FirewallEndpoint::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8410 /// let x = FirewallEndpoint::new().set_or_clear_update_time(None::<Timestamp>);
8411 /// ```
8412 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8413 where
8414 T: std::convert::Into<wkt::Timestamp>,
8415 {
8416 self.update_time = v.map(|x| x.into());
8417 self
8418 }
8419
8420 /// Sets the value of [labels][crate::model::FirewallEndpoint::labels].
8421 ///
8422 /// # Example
8423 /// ```ignore,no_run
8424 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8425 /// let x = FirewallEndpoint::new().set_labels([
8426 /// ("key0", "abc"),
8427 /// ("key1", "xyz"),
8428 /// ]);
8429 /// ```
8430 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8431 where
8432 T: std::iter::IntoIterator<Item = (K, V)>,
8433 K: std::convert::Into<std::string::String>,
8434 V: std::convert::Into<std::string::String>,
8435 {
8436 use std::iter::Iterator;
8437 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8438 self
8439 }
8440
8441 /// Sets the value of [state][crate::model::FirewallEndpoint::state].
8442 ///
8443 /// # Example
8444 /// ```ignore,no_run
8445 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8446 /// use google_cloud_networksecurity_v1::model::firewall_endpoint::State;
8447 /// let x0 = FirewallEndpoint::new().set_state(State::Creating);
8448 /// let x1 = FirewallEndpoint::new().set_state(State::Active);
8449 /// let x2 = FirewallEndpoint::new().set_state(State::Deleting);
8450 /// ```
8451 pub fn set_state<T: std::convert::Into<crate::model::firewall_endpoint::State>>(
8452 mut self,
8453 v: T,
8454 ) -> Self {
8455 self.state = v.into();
8456 self
8457 }
8458
8459 /// Sets the value of [reconciling][crate::model::FirewallEndpoint::reconciling].
8460 ///
8461 /// # Example
8462 /// ```ignore,no_run
8463 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8464 /// let x = FirewallEndpoint::new().set_reconciling(true);
8465 /// ```
8466 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8467 self.reconciling = v.into();
8468 self
8469 }
8470
8471 /// Sets the value of [associated_networks][crate::model::FirewallEndpoint::associated_networks].
8472 ///
8473 /// # Example
8474 /// ```ignore,no_run
8475 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8476 /// let x = FirewallEndpoint::new().set_associated_networks(["a", "b", "c"]);
8477 /// ```
8478 #[deprecated]
8479 pub fn set_associated_networks<T, V>(mut self, v: T) -> Self
8480 where
8481 T: std::iter::IntoIterator<Item = V>,
8482 V: std::convert::Into<std::string::String>,
8483 {
8484 use std::iter::Iterator;
8485 self.associated_networks = v.into_iter().map(|i| i.into()).collect();
8486 self
8487 }
8488
8489 /// Sets the value of [associations][crate::model::FirewallEndpoint::associations].
8490 ///
8491 /// # Example
8492 /// ```ignore,no_run
8493 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8494 /// use google_cloud_networksecurity_v1::model::firewall_endpoint::AssociationReference;
8495 /// let x = FirewallEndpoint::new()
8496 /// .set_associations([
8497 /// AssociationReference::default()/* use setters */,
8498 /// AssociationReference::default()/* use (different) setters */,
8499 /// ]);
8500 /// ```
8501 pub fn set_associations<T, V>(mut self, v: T) -> Self
8502 where
8503 T: std::iter::IntoIterator<Item = V>,
8504 V: std::convert::Into<crate::model::firewall_endpoint::AssociationReference>,
8505 {
8506 use std::iter::Iterator;
8507 self.associations = v.into_iter().map(|i| i.into()).collect();
8508 self
8509 }
8510
8511 /// Sets the value of [satisfies_pzs][crate::model::FirewallEndpoint::satisfies_pzs].
8512 ///
8513 /// # Example
8514 /// ```ignore,no_run
8515 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8516 /// let x = FirewallEndpoint::new().set_satisfies_pzs(true);
8517 /// ```
8518 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
8519 where
8520 T: std::convert::Into<bool>,
8521 {
8522 self.satisfies_pzs = std::option::Option::Some(v.into());
8523 self
8524 }
8525
8526 /// Sets or clears the value of [satisfies_pzs][crate::model::FirewallEndpoint::satisfies_pzs].
8527 ///
8528 /// # Example
8529 /// ```ignore,no_run
8530 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8531 /// let x = FirewallEndpoint::new().set_or_clear_satisfies_pzs(Some(false));
8532 /// let x = FirewallEndpoint::new().set_or_clear_satisfies_pzs(None::<bool>);
8533 /// ```
8534 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
8535 where
8536 T: std::convert::Into<bool>,
8537 {
8538 self.satisfies_pzs = v.map(|x| x.into());
8539 self
8540 }
8541
8542 /// Sets the value of [satisfies_pzi][crate::model::FirewallEndpoint::satisfies_pzi].
8543 ///
8544 /// # Example
8545 /// ```ignore,no_run
8546 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8547 /// let x = FirewallEndpoint::new().set_satisfies_pzi(true);
8548 /// ```
8549 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
8550 where
8551 T: std::convert::Into<bool>,
8552 {
8553 self.satisfies_pzi = std::option::Option::Some(v.into());
8554 self
8555 }
8556
8557 /// Sets or clears the value of [satisfies_pzi][crate::model::FirewallEndpoint::satisfies_pzi].
8558 ///
8559 /// # Example
8560 /// ```ignore,no_run
8561 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8562 /// let x = FirewallEndpoint::new().set_or_clear_satisfies_pzi(Some(false));
8563 /// let x = FirewallEndpoint::new().set_or_clear_satisfies_pzi(None::<bool>);
8564 /// ```
8565 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
8566 where
8567 T: std::convert::Into<bool>,
8568 {
8569 self.satisfies_pzi = v.map(|x| x.into());
8570 self
8571 }
8572
8573 /// Sets the value of [billing_project_id][crate::model::FirewallEndpoint::billing_project_id].
8574 ///
8575 /// # Example
8576 /// ```ignore,no_run
8577 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8578 /// let x = FirewallEndpoint::new().set_billing_project_id("example");
8579 /// ```
8580 pub fn set_billing_project_id<T: std::convert::Into<std::string::String>>(
8581 mut self,
8582 v: T,
8583 ) -> Self {
8584 self.billing_project_id = v.into();
8585 self
8586 }
8587
8588 /// Sets the value of [endpoint_settings][crate::model::FirewallEndpoint::endpoint_settings].
8589 ///
8590 /// # Example
8591 /// ```ignore,no_run
8592 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8593 /// use google_cloud_networksecurity_v1::model::firewall_endpoint::EndpointSettings;
8594 /// let x = FirewallEndpoint::new().set_endpoint_settings(EndpointSettings::default()/* use setters */);
8595 /// ```
8596 pub fn set_endpoint_settings<T>(mut self, v: T) -> Self
8597 where
8598 T: std::convert::Into<crate::model::firewall_endpoint::EndpointSettings>,
8599 {
8600 self.endpoint_settings = std::option::Option::Some(v.into());
8601 self
8602 }
8603
8604 /// Sets or clears the value of [endpoint_settings][crate::model::FirewallEndpoint::endpoint_settings].
8605 ///
8606 /// # Example
8607 /// ```ignore,no_run
8608 /// # use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8609 /// use google_cloud_networksecurity_v1::model::firewall_endpoint::EndpointSettings;
8610 /// let x = FirewallEndpoint::new().set_or_clear_endpoint_settings(Some(EndpointSettings::default()/* use setters */));
8611 /// let x = FirewallEndpoint::new().set_or_clear_endpoint_settings(None::<EndpointSettings>);
8612 /// ```
8613 pub fn set_or_clear_endpoint_settings<T>(mut self, v: std::option::Option<T>) -> Self
8614 where
8615 T: std::convert::Into<crate::model::firewall_endpoint::EndpointSettings>,
8616 {
8617 self.endpoint_settings = v.map(|x| x.into());
8618 self
8619 }
8620}
8621
8622impl wkt::message::Message for FirewallEndpoint {
8623 fn typename() -> &'static str {
8624 "type.googleapis.com/google.cloud.networksecurity.v1.FirewallEndpoint"
8625 }
8626}
8627
8628/// Defines additional types related to [FirewallEndpoint].
8629pub mod firewall_endpoint {
8630 #[allow(unused_imports)]
8631 use super::*;
8632
8633 /// This is a subset of the FirewallEndpointAssociation message, containing
8634 /// fields to be used by the consumer.
8635 #[derive(Clone, Default, PartialEq)]
8636 #[non_exhaustive]
8637 pub struct AssociationReference {
8638 /// Output only. The resource name of the FirewallEndpointAssociation.
8639 /// Format:
8640 /// projects/{project}/locations/{location}/firewallEndpointAssociations/{id}
8641 pub name: std::string::String,
8642
8643 /// Output only. The VPC network associated. Format:
8644 /// projects/{project}/global/networks/{name}.
8645 pub network: std::string::String,
8646
8647 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8648 }
8649
8650 impl AssociationReference {
8651 pub fn new() -> Self {
8652 std::default::Default::default()
8653 }
8654
8655 /// Sets the value of [name][crate::model::firewall_endpoint::AssociationReference::name].
8656 ///
8657 /// # Example
8658 /// ```ignore,no_run
8659 /// # use google_cloud_networksecurity_v1::model::firewall_endpoint::AssociationReference;
8660 /// let x = AssociationReference::new().set_name("example");
8661 /// ```
8662 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8663 self.name = v.into();
8664 self
8665 }
8666
8667 /// Sets the value of [network][crate::model::firewall_endpoint::AssociationReference::network].
8668 ///
8669 /// # Example
8670 /// ```ignore,no_run
8671 /// # use google_cloud_networksecurity_v1::model::firewall_endpoint::AssociationReference;
8672 /// let x = AssociationReference::new().set_network("example");
8673 /// ```
8674 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8675 self.network = v.into();
8676 self
8677 }
8678 }
8679
8680 impl wkt::message::Message for AssociationReference {
8681 fn typename() -> &'static str {
8682 "type.googleapis.com/google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference"
8683 }
8684 }
8685
8686 /// Settings for the endpoint.
8687 #[derive(Clone, Default, PartialEq)]
8688 #[non_exhaustive]
8689 pub struct EndpointSettings {
8690 /// Optional. Immutable. Indicates whether Jumbo Frames are enabled.
8691 /// Default value is false.
8692 pub jumbo_frames_enabled: bool,
8693
8694 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8695 }
8696
8697 impl EndpointSettings {
8698 pub fn new() -> Self {
8699 std::default::Default::default()
8700 }
8701
8702 /// Sets the value of [jumbo_frames_enabled][crate::model::firewall_endpoint::EndpointSettings::jumbo_frames_enabled].
8703 ///
8704 /// # Example
8705 /// ```ignore,no_run
8706 /// # use google_cloud_networksecurity_v1::model::firewall_endpoint::EndpointSettings;
8707 /// let x = EndpointSettings::new().set_jumbo_frames_enabled(true);
8708 /// ```
8709 pub fn set_jumbo_frames_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8710 self.jumbo_frames_enabled = v.into();
8711 self
8712 }
8713 }
8714
8715 impl wkt::message::Message for EndpointSettings {
8716 fn typename() -> &'static str {
8717 "type.googleapis.com/google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings"
8718 }
8719 }
8720
8721 /// Endpoint state.
8722 ///
8723 /// # Working with unknown values
8724 ///
8725 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8726 /// additional enum variants at any time. Adding new variants is not considered
8727 /// a breaking change. Applications should write their code in anticipation of:
8728 ///
8729 /// - New values appearing in future releases of the client library, **and**
8730 /// - New values received dynamically, without application changes.
8731 ///
8732 /// Please consult the [Working with enums] section in the user guide for some
8733 /// guidelines.
8734 ///
8735 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8736 #[derive(Clone, Debug, PartialEq)]
8737 #[non_exhaustive]
8738 pub enum State {
8739 /// Not set.
8740 Unspecified,
8741 /// Being created.
8742 Creating,
8743 /// Processing configuration updates.
8744 Active,
8745 /// Being deleted.
8746 Deleting,
8747 /// Down or in an error state.
8748 Inactive,
8749 /// If set, the enum was initialized with an unknown value.
8750 ///
8751 /// Applications can examine the value using [State::value] or
8752 /// [State::name].
8753 UnknownValue(state::UnknownValue),
8754 }
8755
8756 #[doc(hidden)]
8757 pub mod state {
8758 #[allow(unused_imports)]
8759 use super::*;
8760 #[derive(Clone, Debug, PartialEq)]
8761 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8762 }
8763
8764 impl State {
8765 /// Gets the enum value.
8766 ///
8767 /// Returns `None` if the enum contains an unknown value deserialized from
8768 /// the string representation of enums.
8769 pub fn value(&self) -> std::option::Option<i32> {
8770 match self {
8771 Self::Unspecified => std::option::Option::Some(0),
8772 Self::Creating => std::option::Option::Some(1),
8773 Self::Active => std::option::Option::Some(2),
8774 Self::Deleting => std::option::Option::Some(3),
8775 Self::Inactive => std::option::Option::Some(4),
8776 Self::UnknownValue(u) => u.0.value(),
8777 }
8778 }
8779
8780 /// Gets the enum value as a string.
8781 ///
8782 /// Returns `None` if the enum contains an unknown value deserialized from
8783 /// the integer representation of enums.
8784 pub fn name(&self) -> std::option::Option<&str> {
8785 match self {
8786 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8787 Self::Creating => std::option::Option::Some("CREATING"),
8788 Self::Active => std::option::Option::Some("ACTIVE"),
8789 Self::Deleting => std::option::Option::Some("DELETING"),
8790 Self::Inactive => std::option::Option::Some("INACTIVE"),
8791 Self::UnknownValue(u) => u.0.name(),
8792 }
8793 }
8794 }
8795
8796 impl std::default::Default for State {
8797 fn default() -> Self {
8798 use std::convert::From;
8799 Self::from(0)
8800 }
8801 }
8802
8803 impl std::fmt::Display for State {
8804 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8805 wkt::internal::display_enum(f, self.name(), self.value())
8806 }
8807 }
8808
8809 impl std::convert::From<i32> for State {
8810 fn from(value: i32) -> Self {
8811 match value {
8812 0 => Self::Unspecified,
8813 1 => Self::Creating,
8814 2 => Self::Active,
8815 3 => Self::Deleting,
8816 4 => Self::Inactive,
8817 _ => Self::UnknownValue(state::UnknownValue(
8818 wkt::internal::UnknownEnumValue::Integer(value),
8819 )),
8820 }
8821 }
8822 }
8823
8824 impl std::convert::From<&str> for State {
8825 fn from(value: &str) -> Self {
8826 use std::string::ToString;
8827 match value {
8828 "STATE_UNSPECIFIED" => Self::Unspecified,
8829 "CREATING" => Self::Creating,
8830 "ACTIVE" => Self::Active,
8831 "DELETING" => Self::Deleting,
8832 "INACTIVE" => Self::Inactive,
8833 _ => Self::UnknownValue(state::UnknownValue(
8834 wkt::internal::UnknownEnumValue::String(value.to_string()),
8835 )),
8836 }
8837 }
8838 }
8839
8840 impl serde::ser::Serialize for State {
8841 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8842 where
8843 S: serde::Serializer,
8844 {
8845 match self {
8846 Self::Unspecified => serializer.serialize_i32(0),
8847 Self::Creating => serializer.serialize_i32(1),
8848 Self::Active => serializer.serialize_i32(2),
8849 Self::Deleting => serializer.serialize_i32(3),
8850 Self::Inactive => serializer.serialize_i32(4),
8851 Self::UnknownValue(u) => u.0.serialize(serializer),
8852 }
8853 }
8854 }
8855
8856 impl<'de> serde::de::Deserialize<'de> for State {
8857 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8858 where
8859 D: serde::Deserializer<'de>,
8860 {
8861 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8862 ".google.cloud.networksecurity.v1.FirewallEndpoint.State",
8863 ))
8864 }
8865 }
8866}
8867
8868/// Message for requesting list of Endpoints
8869#[derive(Clone, Default, PartialEq)]
8870#[non_exhaustive]
8871pub struct ListFirewallEndpointsRequest {
8872 /// Required. Parent value for ListEndpointsRequest
8873 pub parent: std::string::String,
8874
8875 /// Optional. Requested page size. Server may return fewer items than
8876 /// requested. If unspecified, server will pick an appropriate default.
8877 pub page_size: i32,
8878
8879 /// A token identifying a page of results the server should return.
8880 pub page_token: std::string::String,
8881
8882 /// Optional. Filtering results
8883 pub filter: std::string::String,
8884
8885 /// Hint for how to order the results
8886 pub order_by: std::string::String,
8887
8888 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8889}
8890
8891impl ListFirewallEndpointsRequest {
8892 pub fn new() -> Self {
8893 std::default::Default::default()
8894 }
8895
8896 /// Sets the value of [parent][crate::model::ListFirewallEndpointsRequest::parent].
8897 ///
8898 /// # Example
8899 /// ```ignore,no_run
8900 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
8901 /// let x = ListFirewallEndpointsRequest::new().set_parent("example");
8902 /// ```
8903 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8904 self.parent = v.into();
8905 self
8906 }
8907
8908 /// Sets the value of [page_size][crate::model::ListFirewallEndpointsRequest::page_size].
8909 ///
8910 /// # Example
8911 /// ```ignore,no_run
8912 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
8913 /// let x = ListFirewallEndpointsRequest::new().set_page_size(42);
8914 /// ```
8915 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8916 self.page_size = v.into();
8917 self
8918 }
8919
8920 /// Sets the value of [page_token][crate::model::ListFirewallEndpointsRequest::page_token].
8921 ///
8922 /// # Example
8923 /// ```ignore,no_run
8924 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
8925 /// let x = ListFirewallEndpointsRequest::new().set_page_token("example");
8926 /// ```
8927 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8928 self.page_token = v.into();
8929 self
8930 }
8931
8932 /// Sets the value of [filter][crate::model::ListFirewallEndpointsRequest::filter].
8933 ///
8934 /// # Example
8935 /// ```ignore,no_run
8936 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
8937 /// let x = ListFirewallEndpointsRequest::new().set_filter("example");
8938 /// ```
8939 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8940 self.filter = v.into();
8941 self
8942 }
8943
8944 /// Sets the value of [order_by][crate::model::ListFirewallEndpointsRequest::order_by].
8945 ///
8946 /// # Example
8947 /// ```ignore,no_run
8948 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsRequest;
8949 /// let x = ListFirewallEndpointsRequest::new().set_order_by("example");
8950 /// ```
8951 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8952 self.order_by = v.into();
8953 self
8954 }
8955}
8956
8957impl wkt::message::Message for ListFirewallEndpointsRequest {
8958 fn typename() -> &'static str {
8959 "type.googleapis.com/google.cloud.networksecurity.v1.ListFirewallEndpointsRequest"
8960 }
8961}
8962
8963/// Message for response to listing Endpoints
8964#[derive(Clone, Default, PartialEq)]
8965#[non_exhaustive]
8966pub struct ListFirewallEndpointsResponse {
8967 /// The list of Endpoint
8968 pub firewall_endpoints: std::vec::Vec<crate::model::FirewallEndpoint>,
8969
8970 /// A token identifying a page of results the server should return.
8971 pub next_page_token: std::string::String,
8972
8973 /// Locations that could not be reached.
8974 pub unreachable: std::vec::Vec<std::string::String>,
8975
8976 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8977}
8978
8979impl ListFirewallEndpointsResponse {
8980 pub fn new() -> Self {
8981 std::default::Default::default()
8982 }
8983
8984 /// Sets the value of [firewall_endpoints][crate::model::ListFirewallEndpointsResponse::firewall_endpoints].
8985 ///
8986 /// # Example
8987 /// ```ignore,no_run
8988 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsResponse;
8989 /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
8990 /// let x = ListFirewallEndpointsResponse::new()
8991 /// .set_firewall_endpoints([
8992 /// FirewallEndpoint::default()/* use setters */,
8993 /// FirewallEndpoint::default()/* use (different) setters */,
8994 /// ]);
8995 /// ```
8996 pub fn set_firewall_endpoints<T, V>(mut self, v: T) -> Self
8997 where
8998 T: std::iter::IntoIterator<Item = V>,
8999 V: std::convert::Into<crate::model::FirewallEndpoint>,
9000 {
9001 use std::iter::Iterator;
9002 self.firewall_endpoints = v.into_iter().map(|i| i.into()).collect();
9003 self
9004 }
9005
9006 /// Sets the value of [next_page_token][crate::model::ListFirewallEndpointsResponse::next_page_token].
9007 ///
9008 /// # Example
9009 /// ```ignore,no_run
9010 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsResponse;
9011 /// let x = ListFirewallEndpointsResponse::new().set_next_page_token("example");
9012 /// ```
9013 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9014 self.next_page_token = v.into();
9015 self
9016 }
9017
9018 /// Sets the value of [unreachable][crate::model::ListFirewallEndpointsResponse::unreachable].
9019 ///
9020 /// # Example
9021 /// ```ignore,no_run
9022 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointsResponse;
9023 /// let x = ListFirewallEndpointsResponse::new().set_unreachable(["a", "b", "c"]);
9024 /// ```
9025 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9026 where
9027 T: std::iter::IntoIterator<Item = V>,
9028 V: std::convert::Into<std::string::String>,
9029 {
9030 use std::iter::Iterator;
9031 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9032 self
9033 }
9034}
9035
9036impl wkt::message::Message for ListFirewallEndpointsResponse {
9037 fn typename() -> &'static str {
9038 "type.googleapis.com/google.cloud.networksecurity.v1.ListFirewallEndpointsResponse"
9039 }
9040}
9041
9042#[doc(hidden)]
9043impl google_cloud_gax::paginator::internal::PageableResponse for ListFirewallEndpointsResponse {
9044 type PageItem = crate::model::FirewallEndpoint;
9045
9046 fn items(self) -> std::vec::Vec<Self::PageItem> {
9047 self.firewall_endpoints
9048 }
9049
9050 fn next_page_token(&self) -> std::string::String {
9051 use std::clone::Clone;
9052 self.next_page_token.clone()
9053 }
9054}
9055
9056/// Message for getting a Endpoint
9057#[derive(Clone, Default, PartialEq)]
9058#[non_exhaustive]
9059pub struct GetFirewallEndpointRequest {
9060 /// Required. Name of the resource
9061 pub name: std::string::String,
9062
9063 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9064}
9065
9066impl GetFirewallEndpointRequest {
9067 pub fn new() -> Self {
9068 std::default::Default::default()
9069 }
9070
9071 /// Sets the value of [name][crate::model::GetFirewallEndpointRequest::name].
9072 ///
9073 /// # Example
9074 /// ```ignore,no_run
9075 /// # use google_cloud_networksecurity_v1::model::GetFirewallEndpointRequest;
9076 /// let x = GetFirewallEndpointRequest::new().set_name("example");
9077 /// ```
9078 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9079 self.name = v.into();
9080 self
9081 }
9082}
9083
9084impl wkt::message::Message for GetFirewallEndpointRequest {
9085 fn typename() -> &'static str {
9086 "type.googleapis.com/google.cloud.networksecurity.v1.GetFirewallEndpointRequest"
9087 }
9088}
9089
9090/// Message for creating a Endpoint
9091#[derive(Clone, Default, PartialEq)]
9092#[non_exhaustive]
9093pub struct CreateFirewallEndpointRequest {
9094 /// Required. Value for parent.
9095 pub parent: std::string::String,
9096
9097 /// Required. Id of the requesting object.
9098 /// If auto-generating Id server-side, remove this field and
9099 /// firewall_endpoint_id from the method_signature of Create RPC.
9100 pub firewall_endpoint_id: std::string::String,
9101
9102 /// Required. The resource being created
9103 pub firewall_endpoint: std::option::Option<crate::model::FirewallEndpoint>,
9104
9105 /// Optional. An optional request ID to identify requests. Specify a unique
9106 /// request ID so that if you must retry your request, the server will know to
9107 /// ignore the request if it has already been completed. The server will
9108 /// guarantee that for at least 60 minutes since the first request.
9109 ///
9110 /// For example, consider a situation where you make an initial request and
9111 /// the request times out. If you make the request again with the same request
9112 /// ID, the server can check if original operation with the same request ID
9113 /// was received, and if so, will ignore the second request. This prevents
9114 /// clients from accidentally creating duplicate commitments.
9115 ///
9116 /// The request ID must be a valid UUID with the exception that zero UUID is
9117 /// not supported (00000000-0000-0000-0000-000000000000).
9118 pub request_id: std::string::String,
9119
9120 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9121}
9122
9123impl CreateFirewallEndpointRequest {
9124 pub fn new() -> Self {
9125 std::default::Default::default()
9126 }
9127
9128 /// Sets the value of [parent][crate::model::CreateFirewallEndpointRequest::parent].
9129 ///
9130 /// # Example
9131 /// ```ignore,no_run
9132 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9133 /// let x = CreateFirewallEndpointRequest::new().set_parent("example");
9134 /// ```
9135 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9136 self.parent = v.into();
9137 self
9138 }
9139
9140 /// Sets the value of [firewall_endpoint_id][crate::model::CreateFirewallEndpointRequest::firewall_endpoint_id].
9141 ///
9142 /// # Example
9143 /// ```ignore,no_run
9144 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9145 /// let x = CreateFirewallEndpointRequest::new().set_firewall_endpoint_id("example");
9146 /// ```
9147 pub fn set_firewall_endpoint_id<T: std::convert::Into<std::string::String>>(
9148 mut self,
9149 v: T,
9150 ) -> Self {
9151 self.firewall_endpoint_id = v.into();
9152 self
9153 }
9154
9155 /// Sets the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
9156 ///
9157 /// # Example
9158 /// ```ignore,no_run
9159 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9160 /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9161 /// let x = CreateFirewallEndpointRequest::new().set_firewall_endpoint(FirewallEndpoint::default()/* use setters */);
9162 /// ```
9163 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
9164 where
9165 T: std::convert::Into<crate::model::FirewallEndpoint>,
9166 {
9167 self.firewall_endpoint = std::option::Option::Some(v.into());
9168 self
9169 }
9170
9171 /// Sets or clears the value of [firewall_endpoint][crate::model::CreateFirewallEndpointRequest::firewall_endpoint].
9172 ///
9173 /// # Example
9174 /// ```ignore,no_run
9175 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9176 /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9177 /// let x = CreateFirewallEndpointRequest::new().set_or_clear_firewall_endpoint(Some(FirewallEndpoint::default()/* use setters */));
9178 /// let x = CreateFirewallEndpointRequest::new().set_or_clear_firewall_endpoint(None::<FirewallEndpoint>);
9179 /// ```
9180 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
9181 where
9182 T: std::convert::Into<crate::model::FirewallEndpoint>,
9183 {
9184 self.firewall_endpoint = v.map(|x| x.into());
9185 self
9186 }
9187
9188 /// Sets the value of [request_id][crate::model::CreateFirewallEndpointRequest::request_id].
9189 ///
9190 /// # Example
9191 /// ```ignore,no_run
9192 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointRequest;
9193 /// let x = CreateFirewallEndpointRequest::new().set_request_id("example");
9194 /// ```
9195 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9196 self.request_id = v.into();
9197 self
9198 }
9199}
9200
9201impl wkt::message::Message for CreateFirewallEndpointRequest {
9202 fn typename() -> &'static str {
9203 "type.googleapis.com/google.cloud.networksecurity.v1.CreateFirewallEndpointRequest"
9204 }
9205}
9206
9207/// Message for updating a Endpoint
9208#[derive(Clone, Default, PartialEq)]
9209#[non_exhaustive]
9210pub struct UpdateFirewallEndpointRequest {
9211 /// Required. Field mask is used to specify the fields to be overwritten in the
9212 /// Endpoint resource by the update.
9213 /// The fields specified in the update_mask are relative to the resource, not
9214 /// the full request. A field will be overwritten if it is in the mask. If the
9215 /// user does not provide a mask then all fields will be overwritten.
9216 pub update_mask: std::option::Option<wkt::FieldMask>,
9217
9218 /// Required. The resource being updated
9219 pub firewall_endpoint: std::option::Option<crate::model::FirewallEndpoint>,
9220
9221 /// Optional. An optional request ID to identify requests. Specify a unique
9222 /// request ID so that if you must retry your request, the server will know to
9223 /// ignore the request if it has already been completed. The server will
9224 /// guarantee that for at least 60 minutes since the first request.
9225 ///
9226 /// For example, consider a situation where you make an initial request and
9227 /// the request times out. If you make the request again with the same request
9228 /// ID, the server can check if original operation with the same request ID
9229 /// was received, and if so, will ignore the second request. This prevents
9230 /// clients from accidentally creating duplicate commitments.
9231 ///
9232 /// The request ID must be a valid UUID with the exception that zero UUID is
9233 /// not supported (00000000-0000-0000-0000-000000000000).
9234 pub request_id: std::string::String,
9235
9236 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9237}
9238
9239impl UpdateFirewallEndpointRequest {
9240 pub fn new() -> Self {
9241 std::default::Default::default()
9242 }
9243
9244 /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
9245 ///
9246 /// # Example
9247 /// ```ignore,no_run
9248 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9249 /// use wkt::FieldMask;
9250 /// let x = UpdateFirewallEndpointRequest::new().set_update_mask(FieldMask::default()/* use setters */);
9251 /// ```
9252 pub fn set_update_mask<T>(mut self, v: T) -> Self
9253 where
9254 T: std::convert::Into<wkt::FieldMask>,
9255 {
9256 self.update_mask = std::option::Option::Some(v.into());
9257 self
9258 }
9259
9260 /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointRequest::update_mask].
9261 ///
9262 /// # Example
9263 /// ```ignore,no_run
9264 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9265 /// use wkt::FieldMask;
9266 /// let x = UpdateFirewallEndpointRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
9267 /// let x = UpdateFirewallEndpointRequest::new().set_or_clear_update_mask(None::<FieldMask>);
9268 /// ```
9269 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9270 where
9271 T: std::convert::Into<wkt::FieldMask>,
9272 {
9273 self.update_mask = v.map(|x| x.into());
9274 self
9275 }
9276
9277 /// Sets the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
9278 ///
9279 /// # Example
9280 /// ```ignore,no_run
9281 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9282 /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9283 /// let x = UpdateFirewallEndpointRequest::new().set_firewall_endpoint(FirewallEndpoint::default()/* use setters */);
9284 /// ```
9285 pub fn set_firewall_endpoint<T>(mut self, v: T) -> Self
9286 where
9287 T: std::convert::Into<crate::model::FirewallEndpoint>,
9288 {
9289 self.firewall_endpoint = std::option::Option::Some(v.into());
9290 self
9291 }
9292
9293 /// Sets or clears the value of [firewall_endpoint][crate::model::UpdateFirewallEndpointRequest::firewall_endpoint].
9294 ///
9295 /// # Example
9296 /// ```ignore,no_run
9297 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9298 /// use google_cloud_networksecurity_v1::model::FirewallEndpoint;
9299 /// let x = UpdateFirewallEndpointRequest::new().set_or_clear_firewall_endpoint(Some(FirewallEndpoint::default()/* use setters */));
9300 /// let x = UpdateFirewallEndpointRequest::new().set_or_clear_firewall_endpoint(None::<FirewallEndpoint>);
9301 /// ```
9302 pub fn set_or_clear_firewall_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
9303 where
9304 T: std::convert::Into<crate::model::FirewallEndpoint>,
9305 {
9306 self.firewall_endpoint = v.map(|x| x.into());
9307 self
9308 }
9309
9310 /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointRequest::request_id].
9311 ///
9312 /// # Example
9313 /// ```ignore,no_run
9314 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointRequest;
9315 /// let x = UpdateFirewallEndpointRequest::new().set_request_id("example");
9316 /// ```
9317 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9318 self.request_id = v.into();
9319 self
9320 }
9321}
9322
9323impl wkt::message::Message for UpdateFirewallEndpointRequest {
9324 fn typename() -> &'static str {
9325 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest"
9326 }
9327}
9328
9329/// Message for deleting a Endpoint
9330#[derive(Clone, Default, PartialEq)]
9331#[non_exhaustive]
9332pub struct DeleteFirewallEndpointRequest {
9333 /// Required. Name of the resource
9334 pub name: std::string::String,
9335
9336 /// Optional. An optional request ID to identify requests. Specify a unique
9337 /// request ID so that if you must retry your request, the server will know to
9338 /// ignore the request if it has already been completed. The server will
9339 /// guarantee that for at least 60 minutes after the first request.
9340 ///
9341 /// For example, consider a situation where you make an initial request and
9342 /// the request times out. If you make the request again with the same request
9343 /// ID, the server can check if original operation with the same request ID
9344 /// was received, and if so, will ignore the second request. This prevents
9345 /// clients from accidentally creating duplicate commitments.
9346 ///
9347 /// The request ID must be a valid UUID with the exception that zero UUID is
9348 /// not supported (00000000-0000-0000-0000-000000000000).
9349 pub request_id: std::string::String,
9350
9351 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9352}
9353
9354impl DeleteFirewallEndpointRequest {
9355 pub fn new() -> Self {
9356 std::default::Default::default()
9357 }
9358
9359 /// Sets the value of [name][crate::model::DeleteFirewallEndpointRequest::name].
9360 ///
9361 /// # Example
9362 /// ```ignore,no_run
9363 /// # use google_cloud_networksecurity_v1::model::DeleteFirewallEndpointRequest;
9364 /// let x = DeleteFirewallEndpointRequest::new().set_name("example");
9365 /// ```
9366 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9367 self.name = v.into();
9368 self
9369 }
9370
9371 /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointRequest::request_id].
9372 ///
9373 /// # Example
9374 /// ```ignore,no_run
9375 /// # use google_cloud_networksecurity_v1::model::DeleteFirewallEndpointRequest;
9376 /// let x = DeleteFirewallEndpointRequest::new().set_request_id("example");
9377 /// ```
9378 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9379 self.request_id = v.into();
9380 self
9381 }
9382}
9383
9384impl wkt::message::Message for DeleteFirewallEndpointRequest {
9385 fn typename() -> &'static str {
9386 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest"
9387 }
9388}
9389
9390/// Message describing Association object
9391#[derive(Clone, Default, PartialEq)]
9392#[non_exhaustive]
9393pub struct FirewallEndpointAssociation {
9394 /// Immutable. Identifier. name of resource
9395 pub name: std::string::String,
9396
9397 /// Output only. Create time stamp
9398 pub create_time: std::option::Option<wkt::Timestamp>,
9399
9400 /// Output only. Update time stamp
9401 pub update_time: std::option::Option<wkt::Timestamp>,
9402
9403 /// Optional. Labels as key value pairs
9404 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9405
9406 /// Output only. Current state of the association.
9407 pub state: crate::model::firewall_endpoint_association::State,
9408
9409 /// Required. The URL of the network that is being associated.
9410 pub network: std::string::String,
9411
9412 /// Required. The URL of the FirewallEndpoint that is being associated.
9413 pub firewall_endpoint: std::string::String,
9414
9415 /// Optional. The URL of the TlsInspectionPolicy that is being associated.
9416 pub tls_inspection_policy: std::string::String,
9417
9418 /// Output only. Whether reconciling is in progress, recommended per
9419 /// <https://google.aip.dev/128>.
9420 pub reconciling: bool,
9421
9422 /// Optional. Whether the association is disabled.
9423 /// True indicates that traffic won't be intercepted
9424 pub disabled: bool,
9425
9426 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9427}
9428
9429impl FirewallEndpointAssociation {
9430 pub fn new() -> Self {
9431 std::default::Default::default()
9432 }
9433
9434 /// Sets the value of [name][crate::model::FirewallEndpointAssociation::name].
9435 ///
9436 /// # Example
9437 /// ```ignore,no_run
9438 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9439 /// let x = FirewallEndpointAssociation::new().set_name("example");
9440 /// ```
9441 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9442 self.name = v.into();
9443 self
9444 }
9445
9446 /// Sets the value of [create_time][crate::model::FirewallEndpointAssociation::create_time].
9447 ///
9448 /// # Example
9449 /// ```ignore,no_run
9450 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9451 /// use wkt::Timestamp;
9452 /// let x = FirewallEndpointAssociation::new().set_create_time(Timestamp::default()/* use setters */);
9453 /// ```
9454 pub fn set_create_time<T>(mut self, v: T) -> Self
9455 where
9456 T: std::convert::Into<wkt::Timestamp>,
9457 {
9458 self.create_time = std::option::Option::Some(v.into());
9459 self
9460 }
9461
9462 /// Sets or clears the value of [create_time][crate::model::FirewallEndpointAssociation::create_time].
9463 ///
9464 /// # Example
9465 /// ```ignore,no_run
9466 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9467 /// use wkt::Timestamp;
9468 /// let x = FirewallEndpointAssociation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9469 /// let x = FirewallEndpointAssociation::new().set_or_clear_create_time(None::<Timestamp>);
9470 /// ```
9471 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9472 where
9473 T: std::convert::Into<wkt::Timestamp>,
9474 {
9475 self.create_time = v.map(|x| x.into());
9476 self
9477 }
9478
9479 /// Sets the value of [update_time][crate::model::FirewallEndpointAssociation::update_time].
9480 ///
9481 /// # Example
9482 /// ```ignore,no_run
9483 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9484 /// use wkt::Timestamp;
9485 /// let x = FirewallEndpointAssociation::new().set_update_time(Timestamp::default()/* use setters */);
9486 /// ```
9487 pub fn set_update_time<T>(mut self, v: T) -> Self
9488 where
9489 T: std::convert::Into<wkt::Timestamp>,
9490 {
9491 self.update_time = std::option::Option::Some(v.into());
9492 self
9493 }
9494
9495 /// Sets or clears the value of [update_time][crate::model::FirewallEndpointAssociation::update_time].
9496 ///
9497 /// # Example
9498 /// ```ignore,no_run
9499 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9500 /// use wkt::Timestamp;
9501 /// let x = FirewallEndpointAssociation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9502 /// let x = FirewallEndpointAssociation::new().set_or_clear_update_time(None::<Timestamp>);
9503 /// ```
9504 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9505 where
9506 T: std::convert::Into<wkt::Timestamp>,
9507 {
9508 self.update_time = v.map(|x| x.into());
9509 self
9510 }
9511
9512 /// Sets the value of [labels][crate::model::FirewallEndpointAssociation::labels].
9513 ///
9514 /// # Example
9515 /// ```ignore,no_run
9516 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9517 /// let x = FirewallEndpointAssociation::new().set_labels([
9518 /// ("key0", "abc"),
9519 /// ("key1", "xyz"),
9520 /// ]);
9521 /// ```
9522 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9523 where
9524 T: std::iter::IntoIterator<Item = (K, V)>,
9525 K: std::convert::Into<std::string::String>,
9526 V: std::convert::Into<std::string::String>,
9527 {
9528 use std::iter::Iterator;
9529 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9530 self
9531 }
9532
9533 /// Sets the value of [state][crate::model::FirewallEndpointAssociation::state].
9534 ///
9535 /// # Example
9536 /// ```ignore,no_run
9537 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9538 /// use google_cloud_networksecurity_v1::model::firewall_endpoint_association::State;
9539 /// let x0 = FirewallEndpointAssociation::new().set_state(State::Creating);
9540 /// let x1 = FirewallEndpointAssociation::new().set_state(State::Active);
9541 /// let x2 = FirewallEndpointAssociation::new().set_state(State::Deleting);
9542 /// ```
9543 pub fn set_state<T: std::convert::Into<crate::model::firewall_endpoint_association::State>>(
9544 mut self,
9545 v: T,
9546 ) -> Self {
9547 self.state = v.into();
9548 self
9549 }
9550
9551 /// Sets the value of [network][crate::model::FirewallEndpointAssociation::network].
9552 ///
9553 /// # Example
9554 /// ```ignore,no_run
9555 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9556 /// let x = FirewallEndpointAssociation::new().set_network("example");
9557 /// ```
9558 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9559 self.network = v.into();
9560 self
9561 }
9562
9563 /// Sets the value of [firewall_endpoint][crate::model::FirewallEndpointAssociation::firewall_endpoint].
9564 ///
9565 /// # Example
9566 /// ```ignore,no_run
9567 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9568 /// let x = FirewallEndpointAssociation::new().set_firewall_endpoint("example");
9569 /// ```
9570 pub fn set_firewall_endpoint<T: std::convert::Into<std::string::String>>(
9571 mut self,
9572 v: T,
9573 ) -> Self {
9574 self.firewall_endpoint = v.into();
9575 self
9576 }
9577
9578 /// Sets the value of [tls_inspection_policy][crate::model::FirewallEndpointAssociation::tls_inspection_policy].
9579 ///
9580 /// # Example
9581 /// ```ignore,no_run
9582 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9583 /// let x = FirewallEndpointAssociation::new().set_tls_inspection_policy("example");
9584 /// ```
9585 pub fn set_tls_inspection_policy<T: std::convert::Into<std::string::String>>(
9586 mut self,
9587 v: T,
9588 ) -> Self {
9589 self.tls_inspection_policy = v.into();
9590 self
9591 }
9592
9593 /// Sets the value of [reconciling][crate::model::FirewallEndpointAssociation::reconciling].
9594 ///
9595 /// # Example
9596 /// ```ignore,no_run
9597 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9598 /// let x = FirewallEndpointAssociation::new().set_reconciling(true);
9599 /// ```
9600 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9601 self.reconciling = v.into();
9602 self
9603 }
9604
9605 /// Sets the value of [disabled][crate::model::FirewallEndpointAssociation::disabled].
9606 ///
9607 /// # Example
9608 /// ```ignore,no_run
9609 /// # use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9610 /// let x = FirewallEndpointAssociation::new().set_disabled(true);
9611 /// ```
9612 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9613 self.disabled = v.into();
9614 self
9615 }
9616}
9617
9618impl wkt::message::Message for FirewallEndpointAssociation {
9619 fn typename() -> &'static str {
9620 "type.googleapis.com/google.cloud.networksecurity.v1.FirewallEndpointAssociation"
9621 }
9622}
9623
9624/// Defines additional types related to [FirewallEndpointAssociation].
9625pub mod firewall_endpoint_association {
9626 #[allow(unused_imports)]
9627 use super::*;
9628
9629 /// Association state.
9630 ///
9631 /// # Working with unknown values
9632 ///
9633 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9634 /// additional enum variants at any time. Adding new variants is not considered
9635 /// a breaking change. Applications should write their code in anticipation of:
9636 ///
9637 /// - New values appearing in future releases of the client library, **and**
9638 /// - New values received dynamically, without application changes.
9639 ///
9640 /// Please consult the [Working with enums] section in the user guide for some
9641 /// guidelines.
9642 ///
9643 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9644 #[derive(Clone, Debug, PartialEq)]
9645 #[non_exhaustive]
9646 pub enum State {
9647 /// Not set.
9648 Unspecified,
9649 /// Being created.
9650 Creating,
9651 /// Active and ready for traffic.
9652 Active,
9653 /// Being deleted.
9654 Deleting,
9655 /// Down or in an error state.
9656 Inactive,
9657 /// The project that housed the association has been deleted.
9658 Orphan,
9659 /// If set, the enum was initialized with an unknown value.
9660 ///
9661 /// Applications can examine the value using [State::value] or
9662 /// [State::name].
9663 UnknownValue(state::UnknownValue),
9664 }
9665
9666 #[doc(hidden)]
9667 pub mod state {
9668 #[allow(unused_imports)]
9669 use super::*;
9670 #[derive(Clone, Debug, PartialEq)]
9671 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9672 }
9673
9674 impl State {
9675 /// Gets the enum value.
9676 ///
9677 /// Returns `None` if the enum contains an unknown value deserialized from
9678 /// the string representation of enums.
9679 pub fn value(&self) -> std::option::Option<i32> {
9680 match self {
9681 Self::Unspecified => std::option::Option::Some(0),
9682 Self::Creating => std::option::Option::Some(1),
9683 Self::Active => std::option::Option::Some(2),
9684 Self::Deleting => std::option::Option::Some(3),
9685 Self::Inactive => std::option::Option::Some(4),
9686 Self::Orphan => std::option::Option::Some(5),
9687 Self::UnknownValue(u) => u.0.value(),
9688 }
9689 }
9690
9691 /// Gets the enum value as a string.
9692 ///
9693 /// Returns `None` if the enum contains an unknown value deserialized from
9694 /// the integer representation of enums.
9695 pub fn name(&self) -> std::option::Option<&str> {
9696 match self {
9697 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9698 Self::Creating => std::option::Option::Some("CREATING"),
9699 Self::Active => std::option::Option::Some("ACTIVE"),
9700 Self::Deleting => std::option::Option::Some("DELETING"),
9701 Self::Inactive => std::option::Option::Some("INACTIVE"),
9702 Self::Orphan => std::option::Option::Some("ORPHAN"),
9703 Self::UnknownValue(u) => u.0.name(),
9704 }
9705 }
9706 }
9707
9708 impl std::default::Default for State {
9709 fn default() -> Self {
9710 use std::convert::From;
9711 Self::from(0)
9712 }
9713 }
9714
9715 impl std::fmt::Display for State {
9716 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9717 wkt::internal::display_enum(f, self.name(), self.value())
9718 }
9719 }
9720
9721 impl std::convert::From<i32> for State {
9722 fn from(value: i32) -> Self {
9723 match value {
9724 0 => Self::Unspecified,
9725 1 => Self::Creating,
9726 2 => Self::Active,
9727 3 => Self::Deleting,
9728 4 => Self::Inactive,
9729 5 => Self::Orphan,
9730 _ => Self::UnknownValue(state::UnknownValue(
9731 wkt::internal::UnknownEnumValue::Integer(value),
9732 )),
9733 }
9734 }
9735 }
9736
9737 impl std::convert::From<&str> for State {
9738 fn from(value: &str) -> Self {
9739 use std::string::ToString;
9740 match value {
9741 "STATE_UNSPECIFIED" => Self::Unspecified,
9742 "CREATING" => Self::Creating,
9743 "ACTIVE" => Self::Active,
9744 "DELETING" => Self::Deleting,
9745 "INACTIVE" => Self::Inactive,
9746 "ORPHAN" => Self::Orphan,
9747 _ => Self::UnknownValue(state::UnknownValue(
9748 wkt::internal::UnknownEnumValue::String(value.to_string()),
9749 )),
9750 }
9751 }
9752 }
9753
9754 impl serde::ser::Serialize for State {
9755 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9756 where
9757 S: serde::Serializer,
9758 {
9759 match self {
9760 Self::Unspecified => serializer.serialize_i32(0),
9761 Self::Creating => serializer.serialize_i32(1),
9762 Self::Active => serializer.serialize_i32(2),
9763 Self::Deleting => serializer.serialize_i32(3),
9764 Self::Inactive => serializer.serialize_i32(4),
9765 Self::Orphan => serializer.serialize_i32(5),
9766 Self::UnknownValue(u) => u.0.serialize(serializer),
9767 }
9768 }
9769 }
9770
9771 impl<'de> serde::de::Deserialize<'de> for State {
9772 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9773 where
9774 D: serde::Deserializer<'de>,
9775 {
9776 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9777 ".google.cloud.networksecurity.v1.FirewallEndpointAssociation.State",
9778 ))
9779 }
9780 }
9781}
9782
9783/// Message for requesting list of Associations
9784#[derive(Clone, Default, PartialEq)]
9785#[non_exhaustive]
9786pub struct ListFirewallEndpointAssociationsRequest {
9787 /// Required. Parent value for ListAssociationsRequest
9788 pub parent: std::string::String,
9789
9790 /// Optional. Requested page size. Server may return fewer items than
9791 /// requested. If unspecified, server will pick an appropriate default.
9792 pub page_size: i32,
9793
9794 /// A token identifying a page of results the server should return.
9795 pub page_token: std::string::String,
9796
9797 /// Optional. Filtering results
9798 pub filter: std::string::String,
9799
9800 /// Hint for how to order the results
9801 pub order_by: std::string::String,
9802
9803 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9804}
9805
9806impl ListFirewallEndpointAssociationsRequest {
9807 pub fn new() -> Self {
9808 std::default::Default::default()
9809 }
9810
9811 /// Sets the value of [parent][crate::model::ListFirewallEndpointAssociationsRequest::parent].
9812 ///
9813 /// # Example
9814 /// ```ignore,no_run
9815 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
9816 /// let x = ListFirewallEndpointAssociationsRequest::new().set_parent("example");
9817 /// ```
9818 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9819 self.parent = v.into();
9820 self
9821 }
9822
9823 /// Sets the value of [page_size][crate::model::ListFirewallEndpointAssociationsRequest::page_size].
9824 ///
9825 /// # Example
9826 /// ```ignore,no_run
9827 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
9828 /// let x = ListFirewallEndpointAssociationsRequest::new().set_page_size(42);
9829 /// ```
9830 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9831 self.page_size = v.into();
9832 self
9833 }
9834
9835 /// Sets the value of [page_token][crate::model::ListFirewallEndpointAssociationsRequest::page_token].
9836 ///
9837 /// # Example
9838 /// ```ignore,no_run
9839 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
9840 /// let x = ListFirewallEndpointAssociationsRequest::new().set_page_token("example");
9841 /// ```
9842 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9843 self.page_token = v.into();
9844 self
9845 }
9846
9847 /// Sets the value of [filter][crate::model::ListFirewallEndpointAssociationsRequest::filter].
9848 ///
9849 /// # Example
9850 /// ```ignore,no_run
9851 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
9852 /// let x = ListFirewallEndpointAssociationsRequest::new().set_filter("example");
9853 /// ```
9854 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9855 self.filter = v.into();
9856 self
9857 }
9858
9859 /// Sets the value of [order_by][crate::model::ListFirewallEndpointAssociationsRequest::order_by].
9860 ///
9861 /// # Example
9862 /// ```ignore,no_run
9863 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsRequest;
9864 /// let x = ListFirewallEndpointAssociationsRequest::new().set_order_by("example");
9865 /// ```
9866 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9867 self.order_by = v.into();
9868 self
9869 }
9870}
9871
9872impl wkt::message::Message for ListFirewallEndpointAssociationsRequest {
9873 fn typename() -> &'static str {
9874 "type.googleapis.com/google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest"
9875 }
9876}
9877
9878/// Message for response to listing Associations
9879#[derive(Clone, Default, PartialEq)]
9880#[non_exhaustive]
9881pub struct ListFirewallEndpointAssociationsResponse {
9882 /// The list of Association
9883 pub firewall_endpoint_associations: std::vec::Vec<crate::model::FirewallEndpointAssociation>,
9884
9885 /// A token identifying a page of results the server should return.
9886 pub next_page_token: std::string::String,
9887
9888 /// Locations that could not be reached.
9889 pub unreachable: std::vec::Vec<std::string::String>,
9890
9891 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9892}
9893
9894impl ListFirewallEndpointAssociationsResponse {
9895 pub fn new() -> Self {
9896 std::default::Default::default()
9897 }
9898
9899 /// Sets the value of [firewall_endpoint_associations][crate::model::ListFirewallEndpointAssociationsResponse::firewall_endpoint_associations].
9900 ///
9901 /// # Example
9902 /// ```ignore,no_run
9903 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsResponse;
9904 /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
9905 /// let x = ListFirewallEndpointAssociationsResponse::new()
9906 /// .set_firewall_endpoint_associations([
9907 /// FirewallEndpointAssociation::default()/* use setters */,
9908 /// FirewallEndpointAssociation::default()/* use (different) setters */,
9909 /// ]);
9910 /// ```
9911 pub fn set_firewall_endpoint_associations<T, V>(mut self, v: T) -> Self
9912 where
9913 T: std::iter::IntoIterator<Item = V>,
9914 V: std::convert::Into<crate::model::FirewallEndpointAssociation>,
9915 {
9916 use std::iter::Iterator;
9917 self.firewall_endpoint_associations = v.into_iter().map(|i| i.into()).collect();
9918 self
9919 }
9920
9921 /// Sets the value of [next_page_token][crate::model::ListFirewallEndpointAssociationsResponse::next_page_token].
9922 ///
9923 /// # Example
9924 /// ```ignore,no_run
9925 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsResponse;
9926 /// let x = ListFirewallEndpointAssociationsResponse::new().set_next_page_token("example");
9927 /// ```
9928 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9929 self.next_page_token = v.into();
9930 self
9931 }
9932
9933 /// Sets the value of [unreachable][crate::model::ListFirewallEndpointAssociationsResponse::unreachable].
9934 ///
9935 /// # Example
9936 /// ```ignore,no_run
9937 /// # use google_cloud_networksecurity_v1::model::ListFirewallEndpointAssociationsResponse;
9938 /// let x = ListFirewallEndpointAssociationsResponse::new().set_unreachable(["a", "b", "c"]);
9939 /// ```
9940 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9941 where
9942 T: std::iter::IntoIterator<Item = V>,
9943 V: std::convert::Into<std::string::String>,
9944 {
9945 use std::iter::Iterator;
9946 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9947 self
9948 }
9949}
9950
9951impl wkt::message::Message for ListFirewallEndpointAssociationsResponse {
9952 fn typename() -> &'static str {
9953 "type.googleapis.com/google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse"
9954 }
9955}
9956
9957#[doc(hidden)]
9958impl google_cloud_gax::paginator::internal::PageableResponse
9959 for ListFirewallEndpointAssociationsResponse
9960{
9961 type PageItem = crate::model::FirewallEndpointAssociation;
9962
9963 fn items(self) -> std::vec::Vec<Self::PageItem> {
9964 self.firewall_endpoint_associations
9965 }
9966
9967 fn next_page_token(&self) -> std::string::String {
9968 use std::clone::Clone;
9969 self.next_page_token.clone()
9970 }
9971}
9972
9973/// Message for getting a Association
9974#[derive(Clone, Default, PartialEq)]
9975#[non_exhaustive]
9976pub struct GetFirewallEndpointAssociationRequest {
9977 /// Required. Name of the resource
9978 pub name: std::string::String,
9979
9980 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9981}
9982
9983impl GetFirewallEndpointAssociationRequest {
9984 pub fn new() -> Self {
9985 std::default::Default::default()
9986 }
9987
9988 /// Sets the value of [name][crate::model::GetFirewallEndpointAssociationRequest::name].
9989 ///
9990 /// # Example
9991 /// ```ignore,no_run
9992 /// # use google_cloud_networksecurity_v1::model::GetFirewallEndpointAssociationRequest;
9993 /// let x = GetFirewallEndpointAssociationRequest::new().set_name("example");
9994 /// ```
9995 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9996 self.name = v.into();
9997 self
9998 }
9999}
10000
10001impl wkt::message::Message for GetFirewallEndpointAssociationRequest {
10002 fn typename() -> &'static str {
10003 "type.googleapis.com/google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest"
10004 }
10005}
10006
10007/// Message for creating a Association
10008#[derive(Clone, Default, PartialEq)]
10009#[non_exhaustive]
10010pub struct CreateFirewallEndpointAssociationRequest {
10011 /// Required. Value for parent.
10012 pub parent: std::string::String,
10013
10014 /// Optional. Id of the requesting object.
10015 /// If auto-generating Id server-side, remove this field and
10016 /// firewall_endpoint_association_id from the method_signature of Create RPC.
10017 pub firewall_endpoint_association_id: std::string::String,
10018
10019 /// Required. The resource being created
10020 pub firewall_endpoint_association:
10021 std::option::Option<crate::model::FirewallEndpointAssociation>,
10022
10023 /// Optional. An optional request ID to identify requests. Specify a unique
10024 /// request ID so that if you must retry your request, the server will know to
10025 /// ignore the request if it has already been completed. The server will
10026 /// guarantee that for at least 60 minutes since the first request.
10027 ///
10028 /// For example, consider a situation where you make an initial request and
10029 /// the request times out. If you make the request again with the same request
10030 /// ID, the server can check if original operation with the same request ID
10031 /// was received, and if so, will ignore the second request. This prevents
10032 /// clients from accidentally creating duplicate commitments.
10033 ///
10034 /// The request ID must be a valid UUID with the exception that zero UUID is
10035 /// not supported (00000000-0000-0000-0000-000000000000).
10036 pub request_id: std::string::String,
10037
10038 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10039}
10040
10041impl CreateFirewallEndpointAssociationRequest {
10042 pub fn new() -> Self {
10043 std::default::Default::default()
10044 }
10045
10046 /// Sets the value of [parent][crate::model::CreateFirewallEndpointAssociationRequest::parent].
10047 ///
10048 /// # Example
10049 /// ```ignore,no_run
10050 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10051 /// let x = CreateFirewallEndpointAssociationRequest::new().set_parent("example");
10052 /// ```
10053 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10054 self.parent = v.into();
10055 self
10056 }
10057
10058 /// Sets the value of [firewall_endpoint_association_id][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association_id].
10059 ///
10060 /// # Example
10061 /// ```ignore,no_run
10062 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10063 /// let x = CreateFirewallEndpointAssociationRequest::new().set_firewall_endpoint_association_id("example");
10064 /// ```
10065 pub fn set_firewall_endpoint_association_id<T: std::convert::Into<std::string::String>>(
10066 mut self,
10067 v: T,
10068 ) -> Self {
10069 self.firewall_endpoint_association_id = v.into();
10070 self
10071 }
10072
10073 /// Sets the value of [firewall_endpoint_association][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association].
10074 ///
10075 /// # Example
10076 /// ```ignore,no_run
10077 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10078 /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10079 /// let x = CreateFirewallEndpointAssociationRequest::new().set_firewall_endpoint_association(FirewallEndpointAssociation::default()/* use setters */);
10080 /// ```
10081 pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
10082 where
10083 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10084 {
10085 self.firewall_endpoint_association = std::option::Option::Some(v.into());
10086 self
10087 }
10088
10089 /// Sets or clears the value of [firewall_endpoint_association][crate::model::CreateFirewallEndpointAssociationRequest::firewall_endpoint_association].
10090 ///
10091 /// # Example
10092 /// ```ignore,no_run
10093 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10094 /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10095 /// let x = CreateFirewallEndpointAssociationRequest::new().set_or_clear_firewall_endpoint_association(Some(FirewallEndpointAssociation::default()/* use setters */));
10096 /// let x = CreateFirewallEndpointAssociationRequest::new().set_or_clear_firewall_endpoint_association(None::<FirewallEndpointAssociation>);
10097 /// ```
10098 pub fn set_or_clear_firewall_endpoint_association<T>(
10099 mut self,
10100 v: std::option::Option<T>,
10101 ) -> Self
10102 where
10103 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10104 {
10105 self.firewall_endpoint_association = v.map(|x| x.into());
10106 self
10107 }
10108
10109 /// Sets the value of [request_id][crate::model::CreateFirewallEndpointAssociationRequest::request_id].
10110 ///
10111 /// # Example
10112 /// ```ignore,no_run
10113 /// # use google_cloud_networksecurity_v1::model::CreateFirewallEndpointAssociationRequest;
10114 /// let x = CreateFirewallEndpointAssociationRequest::new().set_request_id("example");
10115 /// ```
10116 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10117 self.request_id = v.into();
10118 self
10119 }
10120}
10121
10122impl wkt::message::Message for CreateFirewallEndpointAssociationRequest {
10123 fn typename() -> &'static str {
10124 "type.googleapis.com/google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest"
10125 }
10126}
10127
10128/// Message for deleting a Association
10129#[derive(Clone, Default, PartialEq)]
10130#[non_exhaustive]
10131pub struct DeleteFirewallEndpointAssociationRequest {
10132 /// Required. Name of the resource
10133 pub name: std::string::String,
10134
10135 /// Optional. An optional request ID to identify requests. Specify a unique
10136 /// request ID so that if you must retry your request, the server will know to
10137 /// ignore the request if it has already been completed. The server will
10138 /// guarantee that for at least 60 minutes after the first request.
10139 ///
10140 /// For example, consider a situation where you make an initial request and
10141 /// the request times out. If you make the request again with the same request
10142 /// ID, the server can check if original operation with the same request ID
10143 /// was received, and if so, will ignore the second request. This prevents
10144 /// clients from accidentally creating duplicate commitments.
10145 ///
10146 /// The request ID must be a valid UUID with the exception that zero UUID is
10147 /// not supported (00000000-0000-0000-0000-000000000000).
10148 pub request_id: std::string::String,
10149
10150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10151}
10152
10153impl DeleteFirewallEndpointAssociationRequest {
10154 pub fn new() -> Self {
10155 std::default::Default::default()
10156 }
10157
10158 /// Sets the value of [name][crate::model::DeleteFirewallEndpointAssociationRequest::name].
10159 ///
10160 /// # Example
10161 /// ```ignore,no_run
10162 /// # use google_cloud_networksecurity_v1::model::DeleteFirewallEndpointAssociationRequest;
10163 /// let x = DeleteFirewallEndpointAssociationRequest::new().set_name("example");
10164 /// ```
10165 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10166 self.name = v.into();
10167 self
10168 }
10169
10170 /// Sets the value of [request_id][crate::model::DeleteFirewallEndpointAssociationRequest::request_id].
10171 ///
10172 /// # Example
10173 /// ```ignore,no_run
10174 /// # use google_cloud_networksecurity_v1::model::DeleteFirewallEndpointAssociationRequest;
10175 /// let x = DeleteFirewallEndpointAssociationRequest::new().set_request_id("example");
10176 /// ```
10177 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10178 self.request_id = v.into();
10179 self
10180 }
10181}
10182
10183impl wkt::message::Message for DeleteFirewallEndpointAssociationRequest {
10184 fn typename() -> &'static str {
10185 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest"
10186 }
10187}
10188
10189/// Message for updating an Association
10190#[derive(Clone, Default, PartialEq)]
10191#[non_exhaustive]
10192pub struct UpdateFirewallEndpointAssociationRequest {
10193 /// Required. Field mask is used to specify the fields to be overwritten in the
10194 /// Association resource by the update.
10195 /// The fields specified in the update_mask are relative to the resource, not
10196 /// the full request. A field will be overwritten if it is in the mask. If the
10197 /// user does not provide a mask then all fields will be overwritten.
10198 pub update_mask: std::option::Option<wkt::FieldMask>,
10199
10200 /// Required. The resource being updated
10201 pub firewall_endpoint_association:
10202 std::option::Option<crate::model::FirewallEndpointAssociation>,
10203
10204 /// Optional. An optional request ID to identify requests. Specify a unique
10205 /// request ID so that if you must retry your request, the server will know to
10206 /// ignore the request if it has already been completed. The server will
10207 /// guarantee that for at least 60 minutes since the first request.
10208 ///
10209 /// For example, consider a situation where you make an initial request and
10210 /// the request times out. If you make the request again with the same request
10211 /// ID, the server can check if original operation with the same request ID
10212 /// was received, and if so, will ignore the second request. This prevents
10213 /// clients from accidentally creating duplicate commitments.
10214 ///
10215 /// The request ID must be a valid UUID with the exception that zero UUID is
10216 /// not supported (00000000-0000-0000-0000-000000000000).
10217 pub request_id: std::string::String,
10218
10219 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10220}
10221
10222impl UpdateFirewallEndpointAssociationRequest {
10223 pub fn new() -> Self {
10224 std::default::Default::default()
10225 }
10226
10227 /// Sets the value of [update_mask][crate::model::UpdateFirewallEndpointAssociationRequest::update_mask].
10228 ///
10229 /// # Example
10230 /// ```ignore,no_run
10231 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10232 /// use wkt::FieldMask;
10233 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10234 /// ```
10235 pub fn set_update_mask<T>(mut self, v: T) -> Self
10236 where
10237 T: std::convert::Into<wkt::FieldMask>,
10238 {
10239 self.update_mask = std::option::Option::Some(v.into());
10240 self
10241 }
10242
10243 /// Sets or clears the value of [update_mask][crate::model::UpdateFirewallEndpointAssociationRequest::update_mask].
10244 ///
10245 /// # Example
10246 /// ```ignore,no_run
10247 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10248 /// use wkt::FieldMask;
10249 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10250 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10251 /// ```
10252 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10253 where
10254 T: std::convert::Into<wkt::FieldMask>,
10255 {
10256 self.update_mask = v.map(|x| x.into());
10257 self
10258 }
10259
10260 /// Sets the value of [firewall_endpoint_association][crate::model::UpdateFirewallEndpointAssociationRequest::firewall_endpoint_association].
10261 ///
10262 /// # Example
10263 /// ```ignore,no_run
10264 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10265 /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10266 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_firewall_endpoint_association(FirewallEndpointAssociation::default()/* use setters */);
10267 /// ```
10268 pub fn set_firewall_endpoint_association<T>(mut self, v: T) -> Self
10269 where
10270 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10271 {
10272 self.firewall_endpoint_association = std::option::Option::Some(v.into());
10273 self
10274 }
10275
10276 /// Sets or clears the value of [firewall_endpoint_association][crate::model::UpdateFirewallEndpointAssociationRequest::firewall_endpoint_association].
10277 ///
10278 /// # Example
10279 /// ```ignore,no_run
10280 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10281 /// use google_cloud_networksecurity_v1::model::FirewallEndpointAssociation;
10282 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_or_clear_firewall_endpoint_association(Some(FirewallEndpointAssociation::default()/* use setters */));
10283 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_or_clear_firewall_endpoint_association(None::<FirewallEndpointAssociation>);
10284 /// ```
10285 pub fn set_or_clear_firewall_endpoint_association<T>(
10286 mut self,
10287 v: std::option::Option<T>,
10288 ) -> Self
10289 where
10290 T: std::convert::Into<crate::model::FirewallEndpointAssociation>,
10291 {
10292 self.firewall_endpoint_association = v.map(|x| x.into());
10293 self
10294 }
10295
10296 /// Sets the value of [request_id][crate::model::UpdateFirewallEndpointAssociationRequest::request_id].
10297 ///
10298 /// # Example
10299 /// ```ignore,no_run
10300 /// # use google_cloud_networksecurity_v1::model::UpdateFirewallEndpointAssociationRequest;
10301 /// let x = UpdateFirewallEndpointAssociationRequest::new().set_request_id("example");
10302 /// ```
10303 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10304 self.request_id = v.into();
10305 self
10306 }
10307}
10308
10309impl wkt::message::Message for UpdateFirewallEndpointAssociationRequest {
10310 fn typename() -> &'static str {
10311 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest"
10312 }
10313}
10314
10315/// The GatewaySecurityPolicy resource contains a collection of
10316/// GatewaySecurityPolicyRules and associated metadata.
10317#[derive(Clone, Default, PartialEq)]
10318#[non_exhaustive]
10319pub struct GatewaySecurityPolicy {
10320 /// Required. Name of the resource. Name is of the form
10321 /// projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}
10322 /// gateway_security_policy should match the
10323 /// pattern:(^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
10324 pub name: std::string::String,
10325
10326 /// Output only. The timestamp when the resource was created.
10327 pub create_time: std::option::Option<wkt::Timestamp>,
10328
10329 /// Output only. The timestamp when the resource was updated.
10330 pub update_time: std::option::Option<wkt::Timestamp>,
10331
10332 /// Optional. Free-text description of the resource.
10333 pub description: std::string::String,
10334
10335 /// Optional. Name of a TLS Inspection Policy resource that defines how TLS
10336 /// inspection will be performed for any rule(s) which enables it.
10337 pub tls_inspection_policy: std::string::String,
10338
10339 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10340}
10341
10342impl GatewaySecurityPolicy {
10343 pub fn new() -> Self {
10344 std::default::Default::default()
10345 }
10346
10347 /// Sets the value of [name][crate::model::GatewaySecurityPolicy::name].
10348 ///
10349 /// # Example
10350 /// ```ignore,no_run
10351 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10352 /// let x = GatewaySecurityPolicy::new().set_name("example");
10353 /// ```
10354 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10355 self.name = v.into();
10356 self
10357 }
10358
10359 /// Sets the value of [create_time][crate::model::GatewaySecurityPolicy::create_time].
10360 ///
10361 /// # Example
10362 /// ```ignore,no_run
10363 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10364 /// use wkt::Timestamp;
10365 /// let x = GatewaySecurityPolicy::new().set_create_time(Timestamp::default()/* use setters */);
10366 /// ```
10367 pub fn set_create_time<T>(mut self, v: T) -> Self
10368 where
10369 T: std::convert::Into<wkt::Timestamp>,
10370 {
10371 self.create_time = std::option::Option::Some(v.into());
10372 self
10373 }
10374
10375 /// Sets or clears the value of [create_time][crate::model::GatewaySecurityPolicy::create_time].
10376 ///
10377 /// # Example
10378 /// ```ignore,no_run
10379 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10380 /// use wkt::Timestamp;
10381 /// let x = GatewaySecurityPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10382 /// let x = GatewaySecurityPolicy::new().set_or_clear_create_time(None::<Timestamp>);
10383 /// ```
10384 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10385 where
10386 T: std::convert::Into<wkt::Timestamp>,
10387 {
10388 self.create_time = v.map(|x| x.into());
10389 self
10390 }
10391
10392 /// Sets the value of [update_time][crate::model::GatewaySecurityPolicy::update_time].
10393 ///
10394 /// # Example
10395 /// ```ignore,no_run
10396 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10397 /// use wkt::Timestamp;
10398 /// let x = GatewaySecurityPolicy::new().set_update_time(Timestamp::default()/* use setters */);
10399 /// ```
10400 pub fn set_update_time<T>(mut self, v: T) -> Self
10401 where
10402 T: std::convert::Into<wkt::Timestamp>,
10403 {
10404 self.update_time = std::option::Option::Some(v.into());
10405 self
10406 }
10407
10408 /// Sets or clears the value of [update_time][crate::model::GatewaySecurityPolicy::update_time].
10409 ///
10410 /// # Example
10411 /// ```ignore,no_run
10412 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10413 /// use wkt::Timestamp;
10414 /// let x = GatewaySecurityPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10415 /// let x = GatewaySecurityPolicy::new().set_or_clear_update_time(None::<Timestamp>);
10416 /// ```
10417 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10418 where
10419 T: std::convert::Into<wkt::Timestamp>,
10420 {
10421 self.update_time = v.map(|x| x.into());
10422 self
10423 }
10424
10425 /// Sets the value of [description][crate::model::GatewaySecurityPolicy::description].
10426 ///
10427 /// # Example
10428 /// ```ignore,no_run
10429 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10430 /// let x = GatewaySecurityPolicy::new().set_description("example");
10431 /// ```
10432 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10433 self.description = v.into();
10434 self
10435 }
10436
10437 /// Sets the value of [tls_inspection_policy][crate::model::GatewaySecurityPolicy::tls_inspection_policy].
10438 ///
10439 /// # Example
10440 /// ```ignore,no_run
10441 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10442 /// let x = GatewaySecurityPolicy::new().set_tls_inspection_policy("example");
10443 /// ```
10444 pub fn set_tls_inspection_policy<T: std::convert::Into<std::string::String>>(
10445 mut self,
10446 v: T,
10447 ) -> Self {
10448 self.tls_inspection_policy = v.into();
10449 self
10450 }
10451}
10452
10453impl wkt::message::Message for GatewaySecurityPolicy {
10454 fn typename() -> &'static str {
10455 "type.googleapis.com/google.cloud.networksecurity.v1.GatewaySecurityPolicy"
10456 }
10457}
10458
10459/// Request used by the CreateGatewaySecurityPolicy method.
10460#[derive(Clone, Default, PartialEq)]
10461#[non_exhaustive]
10462pub struct CreateGatewaySecurityPolicyRequest {
10463 /// Required. The parent resource of the GatewaySecurityPolicy. Must be in the
10464 /// format `projects/{project}/locations/{location}`.
10465 pub parent: std::string::String,
10466
10467 /// Required. Short name of the GatewaySecurityPolicy resource to be created.
10468 /// This value should be 1-63 characters long, containing only
10469 /// letters, numbers, hyphens, and underscores, and should not start
10470 /// with a number. E.g. "gateway_security_policy1".
10471 pub gateway_security_policy_id: std::string::String,
10472
10473 /// Required. GatewaySecurityPolicy resource to be created.
10474 pub gateway_security_policy: std::option::Option<crate::model::GatewaySecurityPolicy>,
10475
10476 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10477}
10478
10479impl CreateGatewaySecurityPolicyRequest {
10480 pub fn new() -> Self {
10481 std::default::Default::default()
10482 }
10483
10484 /// Sets the value of [parent][crate::model::CreateGatewaySecurityPolicyRequest::parent].
10485 ///
10486 /// # Example
10487 /// ```ignore,no_run
10488 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRequest;
10489 /// let x = CreateGatewaySecurityPolicyRequest::new().set_parent("example");
10490 /// ```
10491 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10492 self.parent = v.into();
10493 self
10494 }
10495
10496 /// Sets the value of [gateway_security_policy_id][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy_id].
10497 ///
10498 /// # Example
10499 /// ```ignore,no_run
10500 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRequest;
10501 /// let x = CreateGatewaySecurityPolicyRequest::new().set_gateway_security_policy_id("example");
10502 /// ```
10503 pub fn set_gateway_security_policy_id<T: std::convert::Into<std::string::String>>(
10504 mut self,
10505 v: T,
10506 ) -> Self {
10507 self.gateway_security_policy_id = v.into();
10508 self
10509 }
10510
10511 /// Sets the value of [gateway_security_policy][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy].
10512 ///
10513 /// # Example
10514 /// ```ignore,no_run
10515 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRequest;
10516 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10517 /// let x = CreateGatewaySecurityPolicyRequest::new().set_gateway_security_policy(GatewaySecurityPolicy::default()/* use setters */);
10518 /// ```
10519 pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
10520 where
10521 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
10522 {
10523 self.gateway_security_policy = std::option::Option::Some(v.into());
10524 self
10525 }
10526
10527 /// Sets or clears the value of [gateway_security_policy][crate::model::CreateGatewaySecurityPolicyRequest::gateway_security_policy].
10528 ///
10529 /// # Example
10530 /// ```ignore,no_run
10531 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRequest;
10532 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10533 /// let x = CreateGatewaySecurityPolicyRequest::new().set_or_clear_gateway_security_policy(Some(GatewaySecurityPolicy::default()/* use setters */));
10534 /// let x = CreateGatewaySecurityPolicyRequest::new().set_or_clear_gateway_security_policy(None::<GatewaySecurityPolicy>);
10535 /// ```
10536 pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
10537 where
10538 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
10539 {
10540 self.gateway_security_policy = v.map(|x| x.into());
10541 self
10542 }
10543}
10544
10545impl wkt::message::Message for CreateGatewaySecurityPolicyRequest {
10546 fn typename() -> &'static str {
10547 "type.googleapis.com/google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest"
10548 }
10549}
10550
10551/// Request used with the ListGatewaySecurityPolicies method.
10552#[derive(Clone, Default, PartialEq)]
10553#[non_exhaustive]
10554pub struct ListGatewaySecurityPoliciesRequest {
10555 /// Required. The project and location from which the GatewaySecurityPolicies
10556 /// should be listed, specified in the format
10557 /// `projects/{project}/locations/{location}`.
10558 pub parent: std::string::String,
10559
10560 /// Maximum number of GatewaySecurityPolicies to return per call.
10561 pub page_size: i32,
10562
10563 /// The value returned by the last
10564 /// 'ListGatewaySecurityPoliciesResponse' Indicates that this is a
10565 /// continuation of a prior 'ListGatewaySecurityPolicies' call, and
10566 /// that the system should return the next page of data.
10567 pub page_token: std::string::String,
10568
10569 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10570}
10571
10572impl ListGatewaySecurityPoliciesRequest {
10573 pub fn new() -> Self {
10574 std::default::Default::default()
10575 }
10576
10577 /// Sets the value of [parent][crate::model::ListGatewaySecurityPoliciesRequest::parent].
10578 ///
10579 /// # Example
10580 /// ```ignore,no_run
10581 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesRequest;
10582 /// let x = ListGatewaySecurityPoliciesRequest::new().set_parent("example");
10583 /// ```
10584 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10585 self.parent = v.into();
10586 self
10587 }
10588
10589 /// Sets the value of [page_size][crate::model::ListGatewaySecurityPoliciesRequest::page_size].
10590 ///
10591 /// # Example
10592 /// ```ignore,no_run
10593 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesRequest;
10594 /// let x = ListGatewaySecurityPoliciesRequest::new().set_page_size(42);
10595 /// ```
10596 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10597 self.page_size = v.into();
10598 self
10599 }
10600
10601 /// Sets the value of [page_token][crate::model::ListGatewaySecurityPoliciesRequest::page_token].
10602 ///
10603 /// # Example
10604 /// ```ignore,no_run
10605 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesRequest;
10606 /// let x = ListGatewaySecurityPoliciesRequest::new().set_page_token("example");
10607 /// ```
10608 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10609 self.page_token = v.into();
10610 self
10611 }
10612}
10613
10614impl wkt::message::Message for ListGatewaySecurityPoliciesRequest {
10615 fn typename() -> &'static str {
10616 "type.googleapis.com/google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest"
10617 }
10618}
10619
10620/// Response returned by the ListGatewaySecurityPolicies method.
10621#[derive(Clone, Default, PartialEq)]
10622#[non_exhaustive]
10623pub struct ListGatewaySecurityPoliciesResponse {
10624 /// List of GatewaySecurityPolicies resources.
10625 pub gateway_security_policies: std::vec::Vec<crate::model::GatewaySecurityPolicy>,
10626
10627 /// If there might be more results than those appearing in this response, then
10628 /// 'next_page_token' is included. To get the next set of results, call this
10629 /// method again using the value of 'next_page_token' as 'page_token'.
10630 pub next_page_token: std::string::String,
10631
10632 /// Locations that could not be reached.
10633 pub unreachable: std::vec::Vec<std::string::String>,
10634
10635 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10636}
10637
10638impl ListGatewaySecurityPoliciesResponse {
10639 pub fn new() -> Self {
10640 std::default::Default::default()
10641 }
10642
10643 /// Sets the value of [gateway_security_policies][crate::model::ListGatewaySecurityPoliciesResponse::gateway_security_policies].
10644 ///
10645 /// # Example
10646 /// ```ignore,no_run
10647 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesResponse;
10648 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10649 /// let x = ListGatewaySecurityPoliciesResponse::new()
10650 /// .set_gateway_security_policies([
10651 /// GatewaySecurityPolicy::default()/* use setters */,
10652 /// GatewaySecurityPolicy::default()/* use (different) setters */,
10653 /// ]);
10654 /// ```
10655 pub fn set_gateway_security_policies<T, V>(mut self, v: T) -> Self
10656 where
10657 T: std::iter::IntoIterator<Item = V>,
10658 V: std::convert::Into<crate::model::GatewaySecurityPolicy>,
10659 {
10660 use std::iter::Iterator;
10661 self.gateway_security_policies = v.into_iter().map(|i| i.into()).collect();
10662 self
10663 }
10664
10665 /// Sets the value of [next_page_token][crate::model::ListGatewaySecurityPoliciesResponse::next_page_token].
10666 ///
10667 /// # Example
10668 /// ```ignore,no_run
10669 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesResponse;
10670 /// let x = ListGatewaySecurityPoliciesResponse::new().set_next_page_token("example");
10671 /// ```
10672 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10673 self.next_page_token = v.into();
10674 self
10675 }
10676
10677 /// Sets the value of [unreachable][crate::model::ListGatewaySecurityPoliciesResponse::unreachable].
10678 ///
10679 /// # Example
10680 /// ```ignore,no_run
10681 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPoliciesResponse;
10682 /// let x = ListGatewaySecurityPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
10683 /// ```
10684 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10685 where
10686 T: std::iter::IntoIterator<Item = V>,
10687 V: std::convert::Into<std::string::String>,
10688 {
10689 use std::iter::Iterator;
10690 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10691 self
10692 }
10693}
10694
10695impl wkt::message::Message for ListGatewaySecurityPoliciesResponse {
10696 fn typename() -> &'static str {
10697 "type.googleapis.com/google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse"
10698 }
10699}
10700
10701#[doc(hidden)]
10702impl google_cloud_gax::paginator::internal::PageableResponse
10703 for ListGatewaySecurityPoliciesResponse
10704{
10705 type PageItem = crate::model::GatewaySecurityPolicy;
10706
10707 fn items(self) -> std::vec::Vec<Self::PageItem> {
10708 self.gateway_security_policies
10709 }
10710
10711 fn next_page_token(&self) -> std::string::String {
10712 use std::clone::Clone;
10713 self.next_page_token.clone()
10714 }
10715}
10716
10717/// Request used by the GetGatewaySecurityPolicy method.
10718#[derive(Clone, Default, PartialEq)]
10719#[non_exhaustive]
10720pub struct GetGatewaySecurityPolicyRequest {
10721 /// Required. A name of the GatewaySecurityPolicy to get. Must be in the format
10722 /// `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`.
10723 pub name: std::string::String,
10724
10725 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10726}
10727
10728impl GetGatewaySecurityPolicyRequest {
10729 pub fn new() -> Self {
10730 std::default::Default::default()
10731 }
10732
10733 /// Sets the value of [name][crate::model::GetGatewaySecurityPolicyRequest::name].
10734 ///
10735 /// # Example
10736 /// ```ignore,no_run
10737 /// # use google_cloud_networksecurity_v1::model::GetGatewaySecurityPolicyRequest;
10738 /// let x = GetGatewaySecurityPolicyRequest::new().set_name("example");
10739 /// ```
10740 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10741 self.name = v.into();
10742 self
10743 }
10744}
10745
10746impl wkt::message::Message for GetGatewaySecurityPolicyRequest {
10747 fn typename() -> &'static str {
10748 "type.googleapis.com/google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest"
10749 }
10750}
10751
10752/// Request used by the DeleteGatewaySecurityPolicy method.
10753#[derive(Clone, Default, PartialEq)]
10754#[non_exhaustive]
10755pub struct DeleteGatewaySecurityPolicyRequest {
10756 /// Required. A name of the GatewaySecurityPolicy to delete. Must be in the
10757 /// format `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`.
10758 pub name: std::string::String,
10759
10760 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10761}
10762
10763impl DeleteGatewaySecurityPolicyRequest {
10764 pub fn new() -> Self {
10765 std::default::Default::default()
10766 }
10767
10768 /// Sets the value of [name][crate::model::DeleteGatewaySecurityPolicyRequest::name].
10769 ///
10770 /// # Example
10771 /// ```ignore,no_run
10772 /// # use google_cloud_networksecurity_v1::model::DeleteGatewaySecurityPolicyRequest;
10773 /// let x = DeleteGatewaySecurityPolicyRequest::new().set_name("example");
10774 /// ```
10775 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10776 self.name = v.into();
10777 self
10778 }
10779}
10780
10781impl wkt::message::Message for DeleteGatewaySecurityPolicyRequest {
10782 fn typename() -> &'static str {
10783 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest"
10784 }
10785}
10786
10787/// Request used by the UpdateGatewaySecurityPolicy method.
10788#[derive(Clone, Default, PartialEq)]
10789#[non_exhaustive]
10790pub struct UpdateGatewaySecurityPolicyRequest {
10791 /// Optional. Field mask is used to specify the fields to be overwritten in the
10792 /// GatewaySecurityPolicy resource by the update.
10793 /// The fields specified in the update_mask are relative to the resource, not
10794 /// the full request. A field will be overwritten if it is in the mask. If the
10795 /// user does not provide a mask then all fields will be overwritten.
10796 pub update_mask: std::option::Option<wkt::FieldMask>,
10797
10798 /// Required. Updated GatewaySecurityPolicy resource.
10799 pub gateway_security_policy: std::option::Option<crate::model::GatewaySecurityPolicy>,
10800
10801 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10802}
10803
10804impl UpdateGatewaySecurityPolicyRequest {
10805 pub fn new() -> Self {
10806 std::default::Default::default()
10807 }
10808
10809 /// Sets the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRequest::update_mask].
10810 ///
10811 /// # Example
10812 /// ```ignore,no_run
10813 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRequest;
10814 /// use wkt::FieldMask;
10815 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10816 /// ```
10817 pub fn set_update_mask<T>(mut self, v: T) -> Self
10818 where
10819 T: std::convert::Into<wkt::FieldMask>,
10820 {
10821 self.update_mask = std::option::Option::Some(v.into());
10822 self
10823 }
10824
10825 /// Sets or clears the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRequest::update_mask].
10826 ///
10827 /// # Example
10828 /// ```ignore,no_run
10829 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRequest;
10830 /// use wkt::FieldMask;
10831 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10832 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10833 /// ```
10834 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10835 where
10836 T: std::convert::Into<wkt::FieldMask>,
10837 {
10838 self.update_mask = v.map(|x| x.into());
10839 self
10840 }
10841
10842 /// Sets the value of [gateway_security_policy][crate::model::UpdateGatewaySecurityPolicyRequest::gateway_security_policy].
10843 ///
10844 /// # Example
10845 /// ```ignore,no_run
10846 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRequest;
10847 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10848 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_gateway_security_policy(GatewaySecurityPolicy::default()/* use setters */);
10849 /// ```
10850 pub fn set_gateway_security_policy<T>(mut self, v: T) -> Self
10851 where
10852 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
10853 {
10854 self.gateway_security_policy = std::option::Option::Some(v.into());
10855 self
10856 }
10857
10858 /// Sets or clears the value of [gateway_security_policy][crate::model::UpdateGatewaySecurityPolicyRequest::gateway_security_policy].
10859 ///
10860 /// # Example
10861 /// ```ignore,no_run
10862 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRequest;
10863 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicy;
10864 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_or_clear_gateway_security_policy(Some(GatewaySecurityPolicy::default()/* use setters */));
10865 /// let x = UpdateGatewaySecurityPolicyRequest::new().set_or_clear_gateway_security_policy(None::<GatewaySecurityPolicy>);
10866 /// ```
10867 pub fn set_or_clear_gateway_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
10868 where
10869 T: std::convert::Into<crate::model::GatewaySecurityPolicy>,
10870 {
10871 self.gateway_security_policy = v.map(|x| x.into());
10872 self
10873 }
10874}
10875
10876impl wkt::message::Message for UpdateGatewaySecurityPolicyRequest {
10877 fn typename() -> &'static str {
10878 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest"
10879 }
10880}
10881
10882/// The GatewaySecurityPolicyRule resource is in a nested collection within a
10883/// GatewaySecurityPolicy and represents a traffic matching condition and
10884/// associated action to perform.
10885#[derive(Clone, Default, PartialEq)]
10886#[non_exhaustive]
10887pub struct GatewaySecurityPolicyRule {
10888 /// Required. Immutable. Name of the resource. ame is the full resource name so
10889 /// projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule}
10890 /// rule should match the
10891 /// pattern: (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
10892 pub name: std::string::String,
10893
10894 /// Output only. Time when the rule was created.
10895 pub create_time: std::option::Option<wkt::Timestamp>,
10896
10897 /// Output only. Time when the rule was updated.
10898 pub update_time: std::option::Option<wkt::Timestamp>,
10899
10900 /// Required. Whether the rule is enforced.
10901 pub enabled: bool,
10902
10903 /// Required. Priority of the rule.
10904 /// Lower number corresponds to higher precedence.
10905 pub priority: i32,
10906
10907 /// Optional. Free-text description of the resource.
10908 pub description: std::string::String,
10909
10910 /// Required. CEL expression for matching on session criteria.
10911 pub session_matcher: std::string::String,
10912
10913 /// Optional. CEL expression for matching on L7/application level criteria.
10914 pub application_matcher: std::string::String,
10915
10916 /// Optional. Flag to enable TLS inspection of traffic matching on
10917 /// <session_matcher>, can only be true if the parent GatewaySecurityPolicy
10918 /// references a TLSInspectionConfig.
10919 pub tls_inspection_enabled: bool,
10920
10921 pub profile: std::option::Option<crate::model::gateway_security_policy_rule::Profile>,
10922
10923 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10924}
10925
10926impl GatewaySecurityPolicyRule {
10927 pub fn new() -> Self {
10928 std::default::Default::default()
10929 }
10930
10931 /// Sets the value of [name][crate::model::GatewaySecurityPolicyRule::name].
10932 ///
10933 /// # Example
10934 /// ```ignore,no_run
10935 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
10936 /// let x = GatewaySecurityPolicyRule::new().set_name("example");
10937 /// ```
10938 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10939 self.name = v.into();
10940 self
10941 }
10942
10943 /// Sets the value of [create_time][crate::model::GatewaySecurityPolicyRule::create_time].
10944 ///
10945 /// # Example
10946 /// ```ignore,no_run
10947 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
10948 /// use wkt::Timestamp;
10949 /// let x = GatewaySecurityPolicyRule::new().set_create_time(Timestamp::default()/* use setters */);
10950 /// ```
10951 pub fn set_create_time<T>(mut self, v: T) -> Self
10952 where
10953 T: std::convert::Into<wkt::Timestamp>,
10954 {
10955 self.create_time = std::option::Option::Some(v.into());
10956 self
10957 }
10958
10959 /// Sets or clears the value of [create_time][crate::model::GatewaySecurityPolicyRule::create_time].
10960 ///
10961 /// # Example
10962 /// ```ignore,no_run
10963 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
10964 /// use wkt::Timestamp;
10965 /// let x = GatewaySecurityPolicyRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10966 /// let x = GatewaySecurityPolicyRule::new().set_or_clear_create_time(None::<Timestamp>);
10967 /// ```
10968 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10969 where
10970 T: std::convert::Into<wkt::Timestamp>,
10971 {
10972 self.create_time = v.map(|x| x.into());
10973 self
10974 }
10975
10976 /// Sets the value of [update_time][crate::model::GatewaySecurityPolicyRule::update_time].
10977 ///
10978 /// # Example
10979 /// ```ignore,no_run
10980 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
10981 /// use wkt::Timestamp;
10982 /// let x = GatewaySecurityPolicyRule::new().set_update_time(Timestamp::default()/* use setters */);
10983 /// ```
10984 pub fn set_update_time<T>(mut self, v: T) -> Self
10985 where
10986 T: std::convert::Into<wkt::Timestamp>,
10987 {
10988 self.update_time = std::option::Option::Some(v.into());
10989 self
10990 }
10991
10992 /// Sets or clears the value of [update_time][crate::model::GatewaySecurityPolicyRule::update_time].
10993 ///
10994 /// # Example
10995 /// ```ignore,no_run
10996 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
10997 /// use wkt::Timestamp;
10998 /// let x = GatewaySecurityPolicyRule::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10999 /// let x = GatewaySecurityPolicyRule::new().set_or_clear_update_time(None::<Timestamp>);
11000 /// ```
11001 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11002 where
11003 T: std::convert::Into<wkt::Timestamp>,
11004 {
11005 self.update_time = v.map(|x| x.into());
11006 self
11007 }
11008
11009 /// Sets the value of [enabled][crate::model::GatewaySecurityPolicyRule::enabled].
11010 ///
11011 /// # Example
11012 /// ```ignore,no_run
11013 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11014 /// let x = GatewaySecurityPolicyRule::new().set_enabled(true);
11015 /// ```
11016 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11017 self.enabled = v.into();
11018 self
11019 }
11020
11021 /// Sets the value of [priority][crate::model::GatewaySecurityPolicyRule::priority].
11022 ///
11023 /// # Example
11024 /// ```ignore,no_run
11025 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11026 /// let x = GatewaySecurityPolicyRule::new().set_priority(42);
11027 /// ```
11028 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11029 self.priority = v.into();
11030 self
11031 }
11032
11033 /// Sets the value of [description][crate::model::GatewaySecurityPolicyRule::description].
11034 ///
11035 /// # Example
11036 /// ```ignore,no_run
11037 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11038 /// let x = GatewaySecurityPolicyRule::new().set_description("example");
11039 /// ```
11040 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11041 self.description = v.into();
11042 self
11043 }
11044
11045 /// Sets the value of [session_matcher][crate::model::GatewaySecurityPolicyRule::session_matcher].
11046 ///
11047 /// # Example
11048 /// ```ignore,no_run
11049 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11050 /// let x = GatewaySecurityPolicyRule::new().set_session_matcher("example");
11051 /// ```
11052 pub fn set_session_matcher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11053 self.session_matcher = v.into();
11054 self
11055 }
11056
11057 /// Sets the value of [application_matcher][crate::model::GatewaySecurityPolicyRule::application_matcher].
11058 ///
11059 /// # Example
11060 /// ```ignore,no_run
11061 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11062 /// let x = GatewaySecurityPolicyRule::new().set_application_matcher("example");
11063 /// ```
11064 pub fn set_application_matcher<T: std::convert::Into<std::string::String>>(
11065 mut self,
11066 v: T,
11067 ) -> Self {
11068 self.application_matcher = v.into();
11069 self
11070 }
11071
11072 /// Sets the value of [tls_inspection_enabled][crate::model::GatewaySecurityPolicyRule::tls_inspection_enabled].
11073 ///
11074 /// # Example
11075 /// ```ignore,no_run
11076 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11077 /// let x = GatewaySecurityPolicyRule::new().set_tls_inspection_enabled(true);
11078 /// ```
11079 pub fn set_tls_inspection_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11080 self.tls_inspection_enabled = v.into();
11081 self
11082 }
11083
11084 /// Sets the value of [profile][crate::model::GatewaySecurityPolicyRule::profile].
11085 ///
11086 /// Note that all the setters affecting `profile` are mutually
11087 /// exclusive.
11088 ///
11089 /// # Example
11090 /// ```ignore,no_run
11091 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11092 /// use google_cloud_networksecurity_v1::model::gateway_security_policy_rule::BasicProfile;
11093 /// let x0 = GatewaySecurityPolicyRule::new().set_profile(Some(
11094 /// google_cloud_networksecurity_v1::model::gateway_security_policy_rule::Profile::BasicProfile(BasicProfile::Allow)));
11095 /// let x1 = GatewaySecurityPolicyRule::new().set_profile(Some(
11096 /// google_cloud_networksecurity_v1::model::gateway_security_policy_rule::Profile::BasicProfile(BasicProfile::Deny)));
11097 /// ```
11098 pub fn set_profile<
11099 T: std::convert::Into<
11100 std::option::Option<crate::model::gateway_security_policy_rule::Profile>,
11101 >,
11102 >(
11103 mut self,
11104 v: T,
11105 ) -> Self {
11106 self.profile = v.into();
11107 self
11108 }
11109
11110 /// The value of [profile][crate::model::GatewaySecurityPolicyRule::profile]
11111 /// if it holds a `BasicProfile`, `None` if the field is not set or
11112 /// holds a different branch.
11113 pub fn basic_profile(
11114 &self,
11115 ) -> std::option::Option<&crate::model::gateway_security_policy_rule::BasicProfile> {
11116 #[allow(unreachable_patterns)]
11117 self.profile.as_ref().and_then(|v| match v {
11118 crate::model::gateway_security_policy_rule::Profile::BasicProfile(v) => {
11119 std::option::Option::Some(v)
11120 }
11121 _ => std::option::Option::None,
11122 })
11123 }
11124
11125 /// Sets the value of [profile][crate::model::GatewaySecurityPolicyRule::profile]
11126 /// to hold a `BasicProfile`.
11127 ///
11128 /// Note that all the setters affecting `profile` are
11129 /// mutually exclusive.
11130 ///
11131 /// # Example
11132 /// ```ignore,no_run
11133 /// # use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11134 /// use google_cloud_networksecurity_v1::model::gateway_security_policy_rule::BasicProfile;
11135 /// let x0 = GatewaySecurityPolicyRule::new().set_basic_profile(BasicProfile::Allow);
11136 /// let x1 = GatewaySecurityPolicyRule::new().set_basic_profile(BasicProfile::Deny);
11137 /// assert!(x0.basic_profile().is_some());
11138 /// assert!(x1.basic_profile().is_some());
11139 /// ```
11140 pub fn set_basic_profile<
11141 T: std::convert::Into<crate::model::gateway_security_policy_rule::BasicProfile>,
11142 >(
11143 mut self,
11144 v: T,
11145 ) -> Self {
11146 self.profile = std::option::Option::Some(
11147 crate::model::gateway_security_policy_rule::Profile::BasicProfile(v.into()),
11148 );
11149 self
11150 }
11151}
11152
11153impl wkt::message::Message for GatewaySecurityPolicyRule {
11154 fn typename() -> &'static str {
11155 "type.googleapis.com/google.cloud.networksecurity.v1.GatewaySecurityPolicyRule"
11156 }
11157}
11158
11159/// Defines additional types related to [GatewaySecurityPolicyRule].
11160pub mod gateway_security_policy_rule {
11161 #[allow(unused_imports)]
11162 use super::*;
11163
11164 /// enum to define the primitive action.
11165 ///
11166 /// # Working with unknown values
11167 ///
11168 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11169 /// additional enum variants at any time. Adding new variants is not considered
11170 /// a breaking change. Applications should write their code in anticipation of:
11171 ///
11172 /// - New values appearing in future releases of the client library, **and**
11173 /// - New values received dynamically, without application changes.
11174 ///
11175 /// Please consult the [Working with enums] section in the user guide for some
11176 /// guidelines.
11177 ///
11178 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11179 #[derive(Clone, Debug, PartialEq)]
11180 #[non_exhaustive]
11181 pub enum BasicProfile {
11182 /// If there is not a mentioned action for the target.
11183 Unspecified,
11184 /// Allow the matched traffic.
11185 Allow,
11186 /// Deny the matched traffic.
11187 Deny,
11188 /// If set, the enum was initialized with an unknown value.
11189 ///
11190 /// Applications can examine the value using [BasicProfile::value] or
11191 /// [BasicProfile::name].
11192 UnknownValue(basic_profile::UnknownValue),
11193 }
11194
11195 #[doc(hidden)]
11196 pub mod basic_profile {
11197 #[allow(unused_imports)]
11198 use super::*;
11199 #[derive(Clone, Debug, PartialEq)]
11200 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11201 }
11202
11203 impl BasicProfile {
11204 /// Gets the enum value.
11205 ///
11206 /// Returns `None` if the enum contains an unknown value deserialized from
11207 /// the string representation of enums.
11208 pub fn value(&self) -> std::option::Option<i32> {
11209 match self {
11210 Self::Unspecified => std::option::Option::Some(0),
11211 Self::Allow => std::option::Option::Some(1),
11212 Self::Deny => std::option::Option::Some(2),
11213 Self::UnknownValue(u) => u.0.value(),
11214 }
11215 }
11216
11217 /// Gets the enum value as a string.
11218 ///
11219 /// Returns `None` if the enum contains an unknown value deserialized from
11220 /// the integer representation of enums.
11221 pub fn name(&self) -> std::option::Option<&str> {
11222 match self {
11223 Self::Unspecified => std::option::Option::Some("BASIC_PROFILE_UNSPECIFIED"),
11224 Self::Allow => std::option::Option::Some("ALLOW"),
11225 Self::Deny => std::option::Option::Some("DENY"),
11226 Self::UnknownValue(u) => u.0.name(),
11227 }
11228 }
11229 }
11230
11231 impl std::default::Default for BasicProfile {
11232 fn default() -> Self {
11233 use std::convert::From;
11234 Self::from(0)
11235 }
11236 }
11237
11238 impl std::fmt::Display for BasicProfile {
11239 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11240 wkt::internal::display_enum(f, self.name(), self.value())
11241 }
11242 }
11243
11244 impl std::convert::From<i32> for BasicProfile {
11245 fn from(value: i32) -> Self {
11246 match value {
11247 0 => Self::Unspecified,
11248 1 => Self::Allow,
11249 2 => Self::Deny,
11250 _ => Self::UnknownValue(basic_profile::UnknownValue(
11251 wkt::internal::UnknownEnumValue::Integer(value),
11252 )),
11253 }
11254 }
11255 }
11256
11257 impl std::convert::From<&str> for BasicProfile {
11258 fn from(value: &str) -> Self {
11259 use std::string::ToString;
11260 match value {
11261 "BASIC_PROFILE_UNSPECIFIED" => Self::Unspecified,
11262 "ALLOW" => Self::Allow,
11263 "DENY" => Self::Deny,
11264 _ => Self::UnknownValue(basic_profile::UnknownValue(
11265 wkt::internal::UnknownEnumValue::String(value.to_string()),
11266 )),
11267 }
11268 }
11269 }
11270
11271 impl serde::ser::Serialize for BasicProfile {
11272 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11273 where
11274 S: serde::Serializer,
11275 {
11276 match self {
11277 Self::Unspecified => serializer.serialize_i32(0),
11278 Self::Allow => serializer.serialize_i32(1),
11279 Self::Deny => serializer.serialize_i32(2),
11280 Self::UnknownValue(u) => u.0.serialize(serializer),
11281 }
11282 }
11283 }
11284
11285 impl<'de> serde::de::Deserialize<'de> for BasicProfile {
11286 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11287 where
11288 D: serde::Deserializer<'de>,
11289 {
11290 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BasicProfile>::new(
11291 ".google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.BasicProfile",
11292 ))
11293 }
11294 }
11295
11296 #[derive(Clone, Debug, PartialEq)]
11297 #[non_exhaustive]
11298 pub enum Profile {
11299 /// Required. Profile which tells what the primitive action should be.
11300 BasicProfile(crate::model::gateway_security_policy_rule::BasicProfile),
11301 }
11302}
11303
11304/// Methods for GatewaySecurityPolicy RULES/GatewaySecurityPolicyRules.
11305/// Request used by the CreateGatewaySecurityPolicyRule method.
11306#[derive(Clone, Default, PartialEq)]
11307#[non_exhaustive]
11308pub struct CreateGatewaySecurityPolicyRuleRequest {
11309 /// Required. The parent where this rule will be created.
11310 /// Format :
11311 /// projects/{project}/location/{location}/gatewaySecurityPolicies/*
11312 pub parent: std::string::String,
11313
11314 /// Required. The rule to be created.
11315 pub gateway_security_policy_rule: std::option::Option<crate::model::GatewaySecurityPolicyRule>,
11316
11317 /// The ID to use for the rule, which will become the final component of
11318 /// the rule's resource name.
11319 /// This value should be 4-63 characters, and valid characters
11320 /// are /[a-z][0-9]-/.
11321 pub gateway_security_policy_rule_id: std::string::String,
11322
11323 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11324}
11325
11326impl CreateGatewaySecurityPolicyRuleRequest {
11327 pub fn new() -> Self {
11328 std::default::Default::default()
11329 }
11330
11331 /// Sets the value of [parent][crate::model::CreateGatewaySecurityPolicyRuleRequest::parent].
11332 ///
11333 /// # Example
11334 /// ```ignore,no_run
11335 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRuleRequest;
11336 /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_parent("example");
11337 /// ```
11338 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11339 self.parent = v.into();
11340 self
11341 }
11342
11343 /// Sets the value of [gateway_security_policy_rule][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
11344 ///
11345 /// # Example
11346 /// ```ignore,no_run
11347 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRuleRequest;
11348 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11349 /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_gateway_security_policy_rule(GatewaySecurityPolicyRule::default()/* use setters */);
11350 /// ```
11351 pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
11352 where
11353 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11354 {
11355 self.gateway_security_policy_rule = std::option::Option::Some(v.into());
11356 self
11357 }
11358
11359 /// Sets or clears the value of [gateway_security_policy_rule][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
11360 ///
11361 /// # Example
11362 /// ```ignore,no_run
11363 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRuleRequest;
11364 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11365 /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_or_clear_gateway_security_policy_rule(Some(GatewaySecurityPolicyRule::default()/* use setters */));
11366 /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_or_clear_gateway_security_policy_rule(None::<GatewaySecurityPolicyRule>);
11367 /// ```
11368 pub fn set_or_clear_gateway_security_policy_rule<T>(mut self, v: std::option::Option<T>) -> Self
11369 where
11370 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11371 {
11372 self.gateway_security_policy_rule = v.map(|x| x.into());
11373 self
11374 }
11375
11376 /// Sets the value of [gateway_security_policy_rule_id][crate::model::CreateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule_id].
11377 ///
11378 /// # Example
11379 /// ```ignore,no_run
11380 /// # use google_cloud_networksecurity_v1::model::CreateGatewaySecurityPolicyRuleRequest;
11381 /// let x = CreateGatewaySecurityPolicyRuleRequest::new().set_gateway_security_policy_rule_id("example");
11382 /// ```
11383 pub fn set_gateway_security_policy_rule_id<T: std::convert::Into<std::string::String>>(
11384 mut self,
11385 v: T,
11386 ) -> Self {
11387 self.gateway_security_policy_rule_id = v.into();
11388 self
11389 }
11390}
11391
11392impl wkt::message::Message for CreateGatewaySecurityPolicyRuleRequest {
11393 fn typename() -> &'static str {
11394 "type.googleapis.com/google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest"
11395 }
11396}
11397
11398/// Request used by the GetGatewaySecurityPolicyRule method.
11399#[derive(Clone, Default, PartialEq)]
11400#[non_exhaustive]
11401pub struct GetGatewaySecurityPolicyRuleRequest {
11402 /// Required. The name of the GatewaySecurityPolicyRule to retrieve.
11403 /// Format:
11404 /// projects/{project}/location/{location}/gatewaySecurityPolicies/*/rules/*
11405 pub name: std::string::String,
11406
11407 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11408}
11409
11410impl GetGatewaySecurityPolicyRuleRequest {
11411 pub fn new() -> Self {
11412 std::default::Default::default()
11413 }
11414
11415 /// Sets the value of [name][crate::model::GetGatewaySecurityPolicyRuleRequest::name].
11416 ///
11417 /// # Example
11418 /// ```ignore,no_run
11419 /// # use google_cloud_networksecurity_v1::model::GetGatewaySecurityPolicyRuleRequest;
11420 /// let x = GetGatewaySecurityPolicyRuleRequest::new().set_name("example");
11421 /// ```
11422 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11423 self.name = v.into();
11424 self
11425 }
11426}
11427
11428impl wkt::message::Message for GetGatewaySecurityPolicyRuleRequest {
11429 fn typename() -> &'static str {
11430 "type.googleapis.com/google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest"
11431 }
11432}
11433
11434/// Request used by the UpdateGatewaySecurityPolicyRule method.
11435#[derive(Clone, Default, PartialEq)]
11436#[non_exhaustive]
11437pub struct UpdateGatewaySecurityPolicyRuleRequest {
11438 /// Optional. Field mask is used to specify the fields to be overwritten in the
11439 /// GatewaySecurityPolicy resource by the update.
11440 /// The fields specified in the update_mask are relative to the resource, not
11441 /// the full request. A field will be overwritten if it is in the mask. If the
11442 /// user does not provide a mask then all fields will be overwritten.
11443 pub update_mask: std::option::Option<wkt::FieldMask>,
11444
11445 /// Required. Updated GatewaySecurityPolicyRule resource.
11446 pub gateway_security_policy_rule: std::option::Option<crate::model::GatewaySecurityPolicyRule>,
11447
11448 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11449}
11450
11451impl UpdateGatewaySecurityPolicyRuleRequest {
11452 pub fn new() -> Self {
11453 std::default::Default::default()
11454 }
11455
11456 /// Sets the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRuleRequest::update_mask].
11457 ///
11458 /// # Example
11459 /// ```ignore,no_run
11460 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRuleRequest;
11461 /// use wkt::FieldMask;
11462 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11463 /// ```
11464 pub fn set_update_mask<T>(mut self, v: T) -> Self
11465 where
11466 T: std::convert::Into<wkt::FieldMask>,
11467 {
11468 self.update_mask = std::option::Option::Some(v.into());
11469 self
11470 }
11471
11472 /// Sets or clears the value of [update_mask][crate::model::UpdateGatewaySecurityPolicyRuleRequest::update_mask].
11473 ///
11474 /// # Example
11475 /// ```ignore,no_run
11476 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRuleRequest;
11477 /// use wkt::FieldMask;
11478 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11479 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11480 /// ```
11481 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11482 where
11483 T: std::convert::Into<wkt::FieldMask>,
11484 {
11485 self.update_mask = v.map(|x| x.into());
11486 self
11487 }
11488
11489 /// Sets the value of [gateway_security_policy_rule][crate::model::UpdateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
11490 ///
11491 /// # Example
11492 /// ```ignore,no_run
11493 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRuleRequest;
11494 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11495 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_gateway_security_policy_rule(GatewaySecurityPolicyRule::default()/* use setters */);
11496 /// ```
11497 pub fn set_gateway_security_policy_rule<T>(mut self, v: T) -> Self
11498 where
11499 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11500 {
11501 self.gateway_security_policy_rule = std::option::Option::Some(v.into());
11502 self
11503 }
11504
11505 /// Sets or clears the value of [gateway_security_policy_rule][crate::model::UpdateGatewaySecurityPolicyRuleRequest::gateway_security_policy_rule].
11506 ///
11507 /// # Example
11508 /// ```ignore,no_run
11509 /// # use google_cloud_networksecurity_v1::model::UpdateGatewaySecurityPolicyRuleRequest;
11510 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11511 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_or_clear_gateway_security_policy_rule(Some(GatewaySecurityPolicyRule::default()/* use setters */));
11512 /// let x = UpdateGatewaySecurityPolicyRuleRequest::new().set_or_clear_gateway_security_policy_rule(None::<GatewaySecurityPolicyRule>);
11513 /// ```
11514 pub fn set_or_clear_gateway_security_policy_rule<T>(mut self, v: std::option::Option<T>) -> Self
11515 where
11516 T: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11517 {
11518 self.gateway_security_policy_rule = v.map(|x| x.into());
11519 self
11520 }
11521}
11522
11523impl wkt::message::Message for UpdateGatewaySecurityPolicyRuleRequest {
11524 fn typename() -> &'static str {
11525 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest"
11526 }
11527}
11528
11529/// Request used with the ListGatewaySecurityPolicyRules method.
11530#[derive(Clone, Default, PartialEq)]
11531#[non_exhaustive]
11532pub struct ListGatewaySecurityPolicyRulesRequest {
11533 /// Required. The project, location and GatewaySecurityPolicy from which the
11534 /// GatewaySecurityPolicyRules should be listed, specified in the format
11535 /// `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}`.
11536 pub parent: std::string::String,
11537
11538 /// Maximum number of GatewaySecurityPolicyRules to return per call.
11539 pub page_size: i32,
11540
11541 /// The value returned by the last
11542 /// 'ListGatewaySecurityPolicyRulesResponse' Indicates that this is a
11543 /// continuation of a prior 'ListGatewaySecurityPolicyRules' call, and
11544 /// that the system should return the next page of data.
11545 pub page_token: std::string::String,
11546
11547 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11548}
11549
11550impl ListGatewaySecurityPolicyRulesRequest {
11551 pub fn new() -> Self {
11552 std::default::Default::default()
11553 }
11554
11555 /// Sets the value of [parent][crate::model::ListGatewaySecurityPolicyRulesRequest::parent].
11556 ///
11557 /// # Example
11558 /// ```ignore,no_run
11559 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesRequest;
11560 /// let x = ListGatewaySecurityPolicyRulesRequest::new().set_parent("example");
11561 /// ```
11562 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11563 self.parent = v.into();
11564 self
11565 }
11566
11567 /// Sets the value of [page_size][crate::model::ListGatewaySecurityPolicyRulesRequest::page_size].
11568 ///
11569 /// # Example
11570 /// ```ignore,no_run
11571 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesRequest;
11572 /// let x = ListGatewaySecurityPolicyRulesRequest::new().set_page_size(42);
11573 /// ```
11574 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11575 self.page_size = v.into();
11576 self
11577 }
11578
11579 /// Sets the value of [page_token][crate::model::ListGatewaySecurityPolicyRulesRequest::page_token].
11580 ///
11581 /// # Example
11582 /// ```ignore,no_run
11583 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesRequest;
11584 /// let x = ListGatewaySecurityPolicyRulesRequest::new().set_page_token("example");
11585 /// ```
11586 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11587 self.page_token = v.into();
11588 self
11589 }
11590}
11591
11592impl wkt::message::Message for ListGatewaySecurityPolicyRulesRequest {
11593 fn typename() -> &'static str {
11594 "type.googleapis.com/google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest"
11595 }
11596}
11597
11598/// Response returned by the ListGatewaySecurityPolicyRules method.
11599#[derive(Clone, Default, PartialEq)]
11600#[non_exhaustive]
11601pub struct ListGatewaySecurityPolicyRulesResponse {
11602 /// List of GatewaySecurityPolicyRule resources.
11603 pub gateway_security_policy_rules: std::vec::Vec<crate::model::GatewaySecurityPolicyRule>,
11604
11605 /// If there might be more results than those appearing in this response, then
11606 /// 'next_page_token' is included. To get the next set of results, call this
11607 /// method again using the value of 'next_page_token' as 'page_token'.
11608 pub next_page_token: std::string::String,
11609
11610 /// Locations that could not be reached.
11611 pub unreachable: std::vec::Vec<std::string::String>,
11612
11613 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11614}
11615
11616impl ListGatewaySecurityPolicyRulesResponse {
11617 pub fn new() -> Self {
11618 std::default::Default::default()
11619 }
11620
11621 /// Sets the value of [gateway_security_policy_rules][crate::model::ListGatewaySecurityPolicyRulesResponse::gateway_security_policy_rules].
11622 ///
11623 /// # Example
11624 /// ```ignore,no_run
11625 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesResponse;
11626 /// use google_cloud_networksecurity_v1::model::GatewaySecurityPolicyRule;
11627 /// let x = ListGatewaySecurityPolicyRulesResponse::new()
11628 /// .set_gateway_security_policy_rules([
11629 /// GatewaySecurityPolicyRule::default()/* use setters */,
11630 /// GatewaySecurityPolicyRule::default()/* use (different) setters */,
11631 /// ]);
11632 /// ```
11633 pub fn set_gateway_security_policy_rules<T, V>(mut self, v: T) -> Self
11634 where
11635 T: std::iter::IntoIterator<Item = V>,
11636 V: std::convert::Into<crate::model::GatewaySecurityPolicyRule>,
11637 {
11638 use std::iter::Iterator;
11639 self.gateway_security_policy_rules = v.into_iter().map(|i| i.into()).collect();
11640 self
11641 }
11642
11643 /// Sets the value of [next_page_token][crate::model::ListGatewaySecurityPolicyRulesResponse::next_page_token].
11644 ///
11645 /// # Example
11646 /// ```ignore,no_run
11647 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesResponse;
11648 /// let x = ListGatewaySecurityPolicyRulesResponse::new().set_next_page_token("example");
11649 /// ```
11650 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11651 self.next_page_token = v.into();
11652 self
11653 }
11654
11655 /// Sets the value of [unreachable][crate::model::ListGatewaySecurityPolicyRulesResponse::unreachable].
11656 ///
11657 /// # Example
11658 /// ```ignore,no_run
11659 /// # use google_cloud_networksecurity_v1::model::ListGatewaySecurityPolicyRulesResponse;
11660 /// let x = ListGatewaySecurityPolicyRulesResponse::new().set_unreachable(["a", "b", "c"]);
11661 /// ```
11662 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11663 where
11664 T: std::iter::IntoIterator<Item = V>,
11665 V: std::convert::Into<std::string::String>,
11666 {
11667 use std::iter::Iterator;
11668 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11669 self
11670 }
11671}
11672
11673impl wkt::message::Message for ListGatewaySecurityPolicyRulesResponse {
11674 fn typename() -> &'static str {
11675 "type.googleapis.com/google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse"
11676 }
11677}
11678
11679#[doc(hidden)]
11680impl google_cloud_gax::paginator::internal::PageableResponse
11681 for ListGatewaySecurityPolicyRulesResponse
11682{
11683 type PageItem = crate::model::GatewaySecurityPolicyRule;
11684
11685 fn items(self) -> std::vec::Vec<Self::PageItem> {
11686 self.gateway_security_policy_rules
11687 }
11688
11689 fn next_page_token(&self) -> std::string::String {
11690 use std::clone::Clone;
11691 self.next_page_token.clone()
11692 }
11693}
11694
11695/// Request used by the DeleteGatewaySecurityPolicyRule method.
11696#[derive(Clone, Default, PartialEq)]
11697#[non_exhaustive]
11698pub struct DeleteGatewaySecurityPolicyRuleRequest {
11699 /// Required. A name of the GatewaySecurityPolicyRule to delete. Must be in the
11700 /// format
11701 /// `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}/rules/*`.
11702 pub name: std::string::String,
11703
11704 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11705}
11706
11707impl DeleteGatewaySecurityPolicyRuleRequest {
11708 pub fn new() -> Self {
11709 std::default::Default::default()
11710 }
11711
11712 /// Sets the value of [name][crate::model::DeleteGatewaySecurityPolicyRuleRequest::name].
11713 ///
11714 /// # Example
11715 /// ```ignore,no_run
11716 /// # use google_cloud_networksecurity_v1::model::DeleteGatewaySecurityPolicyRuleRequest;
11717 /// let x = DeleteGatewaySecurityPolicyRuleRequest::new().set_name("example");
11718 /// ```
11719 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11720 self.name = v.into();
11721 self
11722 }
11723}
11724
11725impl wkt::message::Message for DeleteGatewaySecurityPolicyRuleRequest {
11726 fn typename() -> &'static str {
11727 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest"
11728 }
11729}
11730
11731/// An endpoint group is a consumer frontend for a deployment group (backend).
11732/// In order to configure intercept for a network, consumers must create:
11733///
11734/// - An association between their network and the endpoint group.
11735/// - A security profile that points to the endpoint group.
11736/// - A firewall rule that references the security profile (group).
11737#[derive(Clone, Default, PartialEq)]
11738#[non_exhaustive]
11739pub struct InterceptEndpointGroup {
11740 /// Immutable. Identifier. The resource name of this endpoint group, for
11741 /// example:
11742 /// `projects/123456789/locations/global/interceptEndpointGroups/my-eg`.
11743 /// See <https://google.aip.dev/122> for more details.
11744 pub name: std::string::String,
11745
11746 /// Output only. The timestamp when the resource was created.
11747 /// See <https://google.aip.dev/148#timestamps>.
11748 pub create_time: std::option::Option<wkt::Timestamp>,
11749
11750 /// Output only. The timestamp when the resource was most recently updated.
11751 /// See <https://google.aip.dev/148#timestamps>.
11752 pub update_time: std::option::Option<wkt::Timestamp>,
11753
11754 /// Optional. Labels are key/value pairs that help to organize and filter
11755 /// resources.
11756 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11757
11758 /// Required. Immutable. The deployment group that this endpoint group is
11759 /// connected to, for example:
11760 /// `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`.
11761 /// See <https://google.aip.dev/124>.
11762 pub intercept_deployment_group: std::string::String,
11763
11764 /// Output only. Details about the connected deployment group to this endpoint
11765 /// group.
11766 pub connected_deployment_group:
11767 std::option::Option<crate::model::intercept_endpoint_group::ConnectedDeploymentGroup>,
11768
11769 /// Output only. The current state of the endpoint group.
11770 /// See <https://google.aip.dev/216>.
11771 pub state: crate::model::intercept_endpoint_group::State,
11772
11773 /// Output only. The current state of the resource does not match the user's
11774 /// intended state, and the system is working to reconcile them. This is part
11775 /// of the normal operation (e.g. adding a new association to the group). See
11776 /// <https://google.aip.dev/128>.
11777 pub reconciling: bool,
11778
11779 /// Output only. List of associations to this endpoint group.
11780 pub associations: std::vec::Vec<crate::model::intercept_endpoint_group::AssociationDetails>,
11781
11782 /// Optional. User-provided description of the endpoint group.
11783 /// Used as additional context for the endpoint group.
11784 pub description: std::string::String,
11785
11786 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11787}
11788
11789impl InterceptEndpointGroup {
11790 pub fn new() -> Self {
11791 std::default::Default::default()
11792 }
11793
11794 /// Sets the value of [name][crate::model::InterceptEndpointGroup::name].
11795 ///
11796 /// # Example
11797 /// ```ignore,no_run
11798 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11799 /// let x = InterceptEndpointGroup::new().set_name("example");
11800 /// ```
11801 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11802 self.name = v.into();
11803 self
11804 }
11805
11806 /// Sets the value of [create_time][crate::model::InterceptEndpointGroup::create_time].
11807 ///
11808 /// # Example
11809 /// ```ignore,no_run
11810 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11811 /// use wkt::Timestamp;
11812 /// let x = InterceptEndpointGroup::new().set_create_time(Timestamp::default()/* use setters */);
11813 /// ```
11814 pub fn set_create_time<T>(mut self, v: T) -> Self
11815 where
11816 T: std::convert::Into<wkt::Timestamp>,
11817 {
11818 self.create_time = std::option::Option::Some(v.into());
11819 self
11820 }
11821
11822 /// Sets or clears the value of [create_time][crate::model::InterceptEndpointGroup::create_time].
11823 ///
11824 /// # Example
11825 /// ```ignore,no_run
11826 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11827 /// use wkt::Timestamp;
11828 /// let x = InterceptEndpointGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11829 /// let x = InterceptEndpointGroup::new().set_or_clear_create_time(None::<Timestamp>);
11830 /// ```
11831 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11832 where
11833 T: std::convert::Into<wkt::Timestamp>,
11834 {
11835 self.create_time = v.map(|x| x.into());
11836 self
11837 }
11838
11839 /// Sets the value of [update_time][crate::model::InterceptEndpointGroup::update_time].
11840 ///
11841 /// # Example
11842 /// ```ignore,no_run
11843 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11844 /// use wkt::Timestamp;
11845 /// let x = InterceptEndpointGroup::new().set_update_time(Timestamp::default()/* use setters */);
11846 /// ```
11847 pub fn set_update_time<T>(mut self, v: T) -> Self
11848 where
11849 T: std::convert::Into<wkt::Timestamp>,
11850 {
11851 self.update_time = std::option::Option::Some(v.into());
11852 self
11853 }
11854
11855 /// Sets or clears the value of [update_time][crate::model::InterceptEndpointGroup::update_time].
11856 ///
11857 /// # Example
11858 /// ```ignore,no_run
11859 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11860 /// use wkt::Timestamp;
11861 /// let x = InterceptEndpointGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
11862 /// let x = InterceptEndpointGroup::new().set_or_clear_update_time(None::<Timestamp>);
11863 /// ```
11864 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11865 where
11866 T: std::convert::Into<wkt::Timestamp>,
11867 {
11868 self.update_time = v.map(|x| x.into());
11869 self
11870 }
11871
11872 /// Sets the value of [labels][crate::model::InterceptEndpointGroup::labels].
11873 ///
11874 /// # Example
11875 /// ```ignore,no_run
11876 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11877 /// let x = InterceptEndpointGroup::new().set_labels([
11878 /// ("key0", "abc"),
11879 /// ("key1", "xyz"),
11880 /// ]);
11881 /// ```
11882 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11883 where
11884 T: std::iter::IntoIterator<Item = (K, V)>,
11885 K: std::convert::Into<std::string::String>,
11886 V: std::convert::Into<std::string::String>,
11887 {
11888 use std::iter::Iterator;
11889 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11890 self
11891 }
11892
11893 /// Sets the value of [intercept_deployment_group][crate::model::InterceptEndpointGroup::intercept_deployment_group].
11894 ///
11895 /// # Example
11896 /// ```ignore,no_run
11897 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11898 /// let x = InterceptEndpointGroup::new().set_intercept_deployment_group("example");
11899 /// ```
11900 pub fn set_intercept_deployment_group<T: std::convert::Into<std::string::String>>(
11901 mut self,
11902 v: T,
11903 ) -> Self {
11904 self.intercept_deployment_group = v.into();
11905 self
11906 }
11907
11908 /// Sets the value of [connected_deployment_group][crate::model::InterceptEndpointGroup::connected_deployment_group].
11909 ///
11910 /// # Example
11911 /// ```ignore,no_run
11912 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11913 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group::ConnectedDeploymentGroup;
11914 /// let x = InterceptEndpointGroup::new().set_connected_deployment_group(ConnectedDeploymentGroup::default()/* use setters */);
11915 /// ```
11916 pub fn set_connected_deployment_group<T>(mut self, v: T) -> Self
11917 where
11918 T: std::convert::Into<crate::model::intercept_endpoint_group::ConnectedDeploymentGroup>,
11919 {
11920 self.connected_deployment_group = std::option::Option::Some(v.into());
11921 self
11922 }
11923
11924 /// Sets or clears the value of [connected_deployment_group][crate::model::InterceptEndpointGroup::connected_deployment_group].
11925 ///
11926 /// # Example
11927 /// ```ignore,no_run
11928 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11929 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group::ConnectedDeploymentGroup;
11930 /// let x = InterceptEndpointGroup::new().set_or_clear_connected_deployment_group(Some(ConnectedDeploymentGroup::default()/* use setters */));
11931 /// let x = InterceptEndpointGroup::new().set_or_clear_connected_deployment_group(None::<ConnectedDeploymentGroup>);
11932 /// ```
11933 pub fn set_or_clear_connected_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
11934 where
11935 T: std::convert::Into<crate::model::intercept_endpoint_group::ConnectedDeploymentGroup>,
11936 {
11937 self.connected_deployment_group = v.map(|x| x.into());
11938 self
11939 }
11940
11941 /// Sets the value of [state][crate::model::InterceptEndpointGroup::state].
11942 ///
11943 /// # Example
11944 /// ```ignore,no_run
11945 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11946 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group::State;
11947 /// let x0 = InterceptEndpointGroup::new().set_state(State::Active);
11948 /// let x1 = InterceptEndpointGroup::new().set_state(State::Closed);
11949 /// let x2 = InterceptEndpointGroup::new().set_state(State::Creating);
11950 /// ```
11951 pub fn set_state<T: std::convert::Into<crate::model::intercept_endpoint_group::State>>(
11952 mut self,
11953 v: T,
11954 ) -> Self {
11955 self.state = v.into();
11956 self
11957 }
11958
11959 /// Sets the value of [reconciling][crate::model::InterceptEndpointGroup::reconciling].
11960 ///
11961 /// # Example
11962 /// ```ignore,no_run
11963 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11964 /// let x = InterceptEndpointGroup::new().set_reconciling(true);
11965 /// ```
11966 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11967 self.reconciling = v.into();
11968 self
11969 }
11970
11971 /// Sets the value of [associations][crate::model::InterceptEndpointGroup::associations].
11972 ///
11973 /// # Example
11974 /// ```ignore,no_run
11975 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11976 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group::AssociationDetails;
11977 /// let x = InterceptEndpointGroup::new()
11978 /// .set_associations([
11979 /// AssociationDetails::default()/* use setters */,
11980 /// AssociationDetails::default()/* use (different) setters */,
11981 /// ]);
11982 /// ```
11983 pub fn set_associations<T, V>(mut self, v: T) -> Self
11984 where
11985 T: std::iter::IntoIterator<Item = V>,
11986 V: std::convert::Into<crate::model::intercept_endpoint_group::AssociationDetails>,
11987 {
11988 use std::iter::Iterator;
11989 self.associations = v.into_iter().map(|i| i.into()).collect();
11990 self
11991 }
11992
11993 /// Sets the value of [description][crate::model::InterceptEndpointGroup::description].
11994 ///
11995 /// # Example
11996 /// ```ignore,no_run
11997 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
11998 /// let x = InterceptEndpointGroup::new().set_description("example");
11999 /// ```
12000 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12001 self.description = v.into();
12002 self
12003 }
12004}
12005
12006impl wkt::message::Message for InterceptEndpointGroup {
12007 fn typename() -> &'static str {
12008 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroup"
12009 }
12010}
12011
12012/// Defines additional types related to [InterceptEndpointGroup].
12013pub mod intercept_endpoint_group {
12014 #[allow(unused_imports)]
12015 use super::*;
12016
12017 /// The endpoint group's view of a connected deployment group.
12018 #[derive(Clone, Default, PartialEq)]
12019 #[non_exhaustive]
12020 pub struct ConnectedDeploymentGroup {
12021 /// Output only. The connected deployment group's resource name, for example:
12022 /// `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`.
12023 /// See <https://google.aip.dev/124>.
12024 pub name: std::string::String,
12025
12026 /// Output only. The list of locations where the deployment group is present.
12027 pub locations: std::vec::Vec<crate::model::InterceptLocation>,
12028
12029 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12030 }
12031
12032 impl ConnectedDeploymentGroup {
12033 pub fn new() -> Self {
12034 std::default::Default::default()
12035 }
12036
12037 /// Sets the value of [name][crate::model::intercept_endpoint_group::ConnectedDeploymentGroup::name].
12038 ///
12039 /// # Example
12040 /// ```ignore,no_run
12041 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::ConnectedDeploymentGroup;
12042 /// let x = ConnectedDeploymentGroup::new().set_name("example");
12043 /// ```
12044 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12045 self.name = v.into();
12046 self
12047 }
12048
12049 /// Sets the value of [locations][crate::model::intercept_endpoint_group::ConnectedDeploymentGroup::locations].
12050 ///
12051 /// # Example
12052 /// ```ignore,no_run
12053 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::ConnectedDeploymentGroup;
12054 /// use google_cloud_networksecurity_v1::model::InterceptLocation;
12055 /// let x = ConnectedDeploymentGroup::new()
12056 /// .set_locations([
12057 /// InterceptLocation::default()/* use setters */,
12058 /// InterceptLocation::default()/* use (different) setters */,
12059 /// ]);
12060 /// ```
12061 pub fn set_locations<T, V>(mut self, v: T) -> Self
12062 where
12063 T: std::iter::IntoIterator<Item = V>,
12064 V: std::convert::Into<crate::model::InterceptLocation>,
12065 {
12066 use std::iter::Iterator;
12067 self.locations = v.into_iter().map(|i| i.into()).collect();
12068 self
12069 }
12070 }
12071
12072 impl wkt::message::Message for ConnectedDeploymentGroup {
12073 fn typename() -> &'static str {
12074 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup"
12075 }
12076 }
12077
12078 /// The endpoint group's view of a connected association.
12079 #[derive(Clone, Default, PartialEq)]
12080 #[non_exhaustive]
12081 pub struct AssociationDetails {
12082 /// Output only. The connected association's resource name, for example:
12083 /// `projects/123456789/locations/global/interceptEndpointGroupAssociations/my-ega`.
12084 /// See <https://google.aip.dev/124>.
12085 pub name: std::string::String,
12086
12087 /// Output only. The associated network, for example:
12088 /// projects/123456789/global/networks/my-network.
12089 /// See <https://google.aip.dev/124>.
12090 pub network: std::string::String,
12091
12092 /// Output only. Most recent known state of the association.
12093 pub state: crate::model::intercept_endpoint_group_association::State,
12094
12095 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12096 }
12097
12098 impl AssociationDetails {
12099 pub fn new() -> Self {
12100 std::default::Default::default()
12101 }
12102
12103 /// Sets the value of [name][crate::model::intercept_endpoint_group::AssociationDetails::name].
12104 ///
12105 /// # Example
12106 /// ```ignore,no_run
12107 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::AssociationDetails;
12108 /// let x = AssociationDetails::new().set_name("example");
12109 /// ```
12110 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12111 self.name = v.into();
12112 self
12113 }
12114
12115 /// Sets the value of [network][crate::model::intercept_endpoint_group::AssociationDetails::network].
12116 ///
12117 /// # Example
12118 /// ```ignore,no_run
12119 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::AssociationDetails;
12120 /// let x = AssociationDetails::new().set_network("example");
12121 /// ```
12122 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12123 self.network = v.into();
12124 self
12125 }
12126
12127 /// Sets the value of [state][crate::model::intercept_endpoint_group::AssociationDetails::state].
12128 ///
12129 /// # Example
12130 /// ```ignore,no_run
12131 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group::AssociationDetails;
12132 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::State;
12133 /// let x0 = AssociationDetails::new().set_state(State::Active);
12134 /// let x1 = AssociationDetails::new().set_state(State::Creating);
12135 /// let x2 = AssociationDetails::new().set_state(State::Deleting);
12136 /// ```
12137 pub fn set_state<
12138 T: std::convert::Into<crate::model::intercept_endpoint_group_association::State>,
12139 >(
12140 mut self,
12141 v: T,
12142 ) -> Self {
12143 self.state = v.into();
12144 self
12145 }
12146 }
12147
12148 impl wkt::message::Message for AssociationDetails {
12149 fn typename() -> &'static str {
12150 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails"
12151 }
12152 }
12153
12154 /// Endpoint group state.
12155 ///
12156 /// # Working with unknown values
12157 ///
12158 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12159 /// additional enum variants at any time. Adding new variants is not considered
12160 /// a breaking change. Applications should write their code in anticipation of:
12161 ///
12162 /// - New values appearing in future releases of the client library, **and**
12163 /// - New values received dynamically, without application changes.
12164 ///
12165 /// Please consult the [Working with enums] section in the user guide for some
12166 /// guidelines.
12167 ///
12168 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12169 #[derive(Clone, Debug, PartialEq)]
12170 #[non_exhaustive]
12171 pub enum State {
12172 /// State not set (this is not a valid state).
12173 Unspecified,
12174 /// The endpoint group is ready and in sync with the target deployment group.
12175 Active,
12176 /// The deployment group backing this endpoint group has been force-deleted.
12177 /// This endpoint group cannot be used and interception is effectively
12178 /// disabled.
12179 Closed,
12180 /// The endpoint group is being created.
12181 Creating,
12182 /// The endpoint group is being deleted.
12183 Deleting,
12184 /// The endpoint group is out of sync with the backing deployment group.
12185 /// In most cases, this is a result of a transient issue within the system
12186 /// (e.g. an inaccessible location) and the system is expected to recover
12187 /// automatically. See the associations field for details per network and
12188 /// location.
12189 OutOfSync,
12190 /// An attempt to delete the endpoint group has failed. This is a terminal
12191 /// state and the endpoint group is not expected to recover.
12192 /// The only permitted operation is to retry deleting the endpoint group.
12193 DeleteFailed,
12194 /// If set, the enum was initialized with an unknown value.
12195 ///
12196 /// Applications can examine the value using [State::value] or
12197 /// [State::name].
12198 UnknownValue(state::UnknownValue),
12199 }
12200
12201 #[doc(hidden)]
12202 pub mod state {
12203 #[allow(unused_imports)]
12204 use super::*;
12205 #[derive(Clone, Debug, PartialEq)]
12206 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12207 }
12208
12209 impl State {
12210 /// Gets the enum value.
12211 ///
12212 /// Returns `None` if the enum contains an unknown value deserialized from
12213 /// the string representation of enums.
12214 pub fn value(&self) -> std::option::Option<i32> {
12215 match self {
12216 Self::Unspecified => std::option::Option::Some(0),
12217 Self::Active => std::option::Option::Some(1),
12218 Self::Closed => std::option::Option::Some(2),
12219 Self::Creating => std::option::Option::Some(3),
12220 Self::Deleting => std::option::Option::Some(4),
12221 Self::OutOfSync => std::option::Option::Some(5),
12222 Self::DeleteFailed => std::option::Option::Some(6),
12223 Self::UnknownValue(u) => u.0.value(),
12224 }
12225 }
12226
12227 /// Gets the enum value as a string.
12228 ///
12229 /// Returns `None` if the enum contains an unknown value deserialized from
12230 /// the integer representation of enums.
12231 pub fn name(&self) -> std::option::Option<&str> {
12232 match self {
12233 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12234 Self::Active => std::option::Option::Some("ACTIVE"),
12235 Self::Closed => std::option::Option::Some("CLOSED"),
12236 Self::Creating => std::option::Option::Some("CREATING"),
12237 Self::Deleting => std::option::Option::Some("DELETING"),
12238 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
12239 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
12240 Self::UnknownValue(u) => u.0.name(),
12241 }
12242 }
12243 }
12244
12245 impl std::default::Default for State {
12246 fn default() -> Self {
12247 use std::convert::From;
12248 Self::from(0)
12249 }
12250 }
12251
12252 impl std::fmt::Display for State {
12253 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12254 wkt::internal::display_enum(f, self.name(), self.value())
12255 }
12256 }
12257
12258 impl std::convert::From<i32> for State {
12259 fn from(value: i32) -> Self {
12260 match value {
12261 0 => Self::Unspecified,
12262 1 => Self::Active,
12263 2 => Self::Closed,
12264 3 => Self::Creating,
12265 4 => Self::Deleting,
12266 5 => Self::OutOfSync,
12267 6 => Self::DeleteFailed,
12268 _ => Self::UnknownValue(state::UnknownValue(
12269 wkt::internal::UnknownEnumValue::Integer(value),
12270 )),
12271 }
12272 }
12273 }
12274
12275 impl std::convert::From<&str> for State {
12276 fn from(value: &str) -> Self {
12277 use std::string::ToString;
12278 match value {
12279 "STATE_UNSPECIFIED" => Self::Unspecified,
12280 "ACTIVE" => Self::Active,
12281 "CLOSED" => Self::Closed,
12282 "CREATING" => Self::Creating,
12283 "DELETING" => Self::Deleting,
12284 "OUT_OF_SYNC" => Self::OutOfSync,
12285 "DELETE_FAILED" => Self::DeleteFailed,
12286 _ => Self::UnknownValue(state::UnknownValue(
12287 wkt::internal::UnknownEnumValue::String(value.to_string()),
12288 )),
12289 }
12290 }
12291 }
12292
12293 impl serde::ser::Serialize for State {
12294 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12295 where
12296 S: serde::Serializer,
12297 {
12298 match self {
12299 Self::Unspecified => serializer.serialize_i32(0),
12300 Self::Active => serializer.serialize_i32(1),
12301 Self::Closed => serializer.serialize_i32(2),
12302 Self::Creating => serializer.serialize_i32(3),
12303 Self::Deleting => serializer.serialize_i32(4),
12304 Self::OutOfSync => serializer.serialize_i32(5),
12305 Self::DeleteFailed => serializer.serialize_i32(6),
12306 Self::UnknownValue(u) => u.0.serialize(serializer),
12307 }
12308 }
12309 }
12310
12311 impl<'de> serde::de::Deserialize<'de> for State {
12312 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12313 where
12314 D: serde::Deserializer<'de>,
12315 {
12316 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12317 ".google.cloud.networksecurity.v1.InterceptEndpointGroup.State",
12318 ))
12319 }
12320 }
12321}
12322
12323/// Request message for ListInterceptEndpointGroups.
12324#[derive(Clone, Default, PartialEq)]
12325#[non_exhaustive]
12326pub struct ListInterceptEndpointGroupsRequest {
12327 /// Required. The parent, which owns this collection of endpoint groups.
12328 /// Example: `projects/123456789/locations/global`.
12329 /// See <https://google.aip.dev/132> for more details.
12330 pub parent: std::string::String,
12331
12332 /// Optional. Requested page size. Server may return fewer items than
12333 /// requested. If unspecified, server will pick an appropriate default. See
12334 /// <https://google.aip.dev/158> for more details.
12335 pub page_size: i32,
12336
12337 /// Optional. A page token, received from a previous
12338 /// `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent
12339 /// page. When paginating, all other parameters provided to
12340 /// `ListInterceptEndpointGroups` must match the call that provided the page
12341 /// token.
12342 /// See <https://google.aip.dev/158> for more details.
12343 pub page_token: std::string::String,
12344
12345 /// Optional. Filter expression.
12346 /// See <https://google.aip.dev/160#filtering> for more details.
12347 pub filter: std::string::String,
12348
12349 /// Optional. Sort expression.
12350 /// See <https://google.aip.dev/132#ordering> for more details.
12351 pub order_by: std::string::String,
12352
12353 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12354}
12355
12356impl ListInterceptEndpointGroupsRequest {
12357 pub fn new() -> Self {
12358 std::default::Default::default()
12359 }
12360
12361 /// Sets the value of [parent][crate::model::ListInterceptEndpointGroupsRequest::parent].
12362 ///
12363 /// # Example
12364 /// ```ignore,no_run
12365 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12366 /// let x = ListInterceptEndpointGroupsRequest::new().set_parent("example");
12367 /// ```
12368 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12369 self.parent = v.into();
12370 self
12371 }
12372
12373 /// Sets the value of [page_size][crate::model::ListInterceptEndpointGroupsRequest::page_size].
12374 ///
12375 /// # Example
12376 /// ```ignore,no_run
12377 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12378 /// let x = ListInterceptEndpointGroupsRequest::new().set_page_size(42);
12379 /// ```
12380 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12381 self.page_size = v.into();
12382 self
12383 }
12384
12385 /// Sets the value of [page_token][crate::model::ListInterceptEndpointGroupsRequest::page_token].
12386 ///
12387 /// # Example
12388 /// ```ignore,no_run
12389 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12390 /// let x = ListInterceptEndpointGroupsRequest::new().set_page_token("example");
12391 /// ```
12392 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12393 self.page_token = v.into();
12394 self
12395 }
12396
12397 /// Sets the value of [filter][crate::model::ListInterceptEndpointGroupsRequest::filter].
12398 ///
12399 /// # Example
12400 /// ```ignore,no_run
12401 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12402 /// let x = ListInterceptEndpointGroupsRequest::new().set_filter("example");
12403 /// ```
12404 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12405 self.filter = v.into();
12406 self
12407 }
12408
12409 /// Sets the value of [order_by][crate::model::ListInterceptEndpointGroupsRequest::order_by].
12410 ///
12411 /// # Example
12412 /// ```ignore,no_run
12413 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsRequest;
12414 /// let x = ListInterceptEndpointGroupsRequest::new().set_order_by("example");
12415 /// ```
12416 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12417 self.order_by = v.into();
12418 self
12419 }
12420}
12421
12422impl wkt::message::Message for ListInterceptEndpointGroupsRequest {
12423 fn typename() -> &'static str {
12424 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest"
12425 }
12426}
12427
12428/// Response message for ListInterceptEndpointGroups.
12429#[derive(Clone, Default, PartialEq)]
12430#[non_exhaustive]
12431pub struct ListInterceptEndpointGroupsResponse {
12432 /// The endpoint groups from the specified parent.
12433 pub intercept_endpoint_groups: std::vec::Vec<crate::model::InterceptEndpointGroup>,
12434
12435 /// A token that can be sent as `page_token` to retrieve the next page.
12436 /// If this field is omitted, there are no subsequent pages.
12437 /// See <https://google.aip.dev/158> for more details.
12438 pub next_page_token: std::string::String,
12439
12440 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12441}
12442
12443impl ListInterceptEndpointGroupsResponse {
12444 pub fn new() -> Self {
12445 std::default::Default::default()
12446 }
12447
12448 /// Sets the value of [intercept_endpoint_groups][crate::model::ListInterceptEndpointGroupsResponse::intercept_endpoint_groups].
12449 ///
12450 /// # Example
12451 /// ```ignore,no_run
12452 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsResponse;
12453 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12454 /// let x = ListInterceptEndpointGroupsResponse::new()
12455 /// .set_intercept_endpoint_groups([
12456 /// InterceptEndpointGroup::default()/* use setters */,
12457 /// InterceptEndpointGroup::default()/* use (different) setters */,
12458 /// ]);
12459 /// ```
12460 pub fn set_intercept_endpoint_groups<T, V>(mut self, v: T) -> Self
12461 where
12462 T: std::iter::IntoIterator<Item = V>,
12463 V: std::convert::Into<crate::model::InterceptEndpointGroup>,
12464 {
12465 use std::iter::Iterator;
12466 self.intercept_endpoint_groups = v.into_iter().map(|i| i.into()).collect();
12467 self
12468 }
12469
12470 /// Sets the value of [next_page_token][crate::model::ListInterceptEndpointGroupsResponse::next_page_token].
12471 ///
12472 /// # Example
12473 /// ```ignore,no_run
12474 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupsResponse;
12475 /// let x = ListInterceptEndpointGroupsResponse::new().set_next_page_token("example");
12476 /// ```
12477 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12478 self.next_page_token = v.into();
12479 self
12480 }
12481}
12482
12483impl wkt::message::Message for ListInterceptEndpointGroupsResponse {
12484 fn typename() -> &'static str {
12485 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse"
12486 }
12487}
12488
12489#[doc(hidden)]
12490impl google_cloud_gax::paginator::internal::PageableResponse
12491 for ListInterceptEndpointGroupsResponse
12492{
12493 type PageItem = crate::model::InterceptEndpointGroup;
12494
12495 fn items(self) -> std::vec::Vec<Self::PageItem> {
12496 self.intercept_endpoint_groups
12497 }
12498
12499 fn next_page_token(&self) -> std::string::String {
12500 use std::clone::Clone;
12501 self.next_page_token.clone()
12502 }
12503}
12504
12505/// Request message for GetInterceptEndpointGroup.
12506#[derive(Clone, Default, PartialEq)]
12507#[non_exhaustive]
12508pub struct GetInterceptEndpointGroupRequest {
12509 /// Required. The name of the endpoint group to retrieve.
12510 /// Format:
12511 /// projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group}
12512 pub name: std::string::String,
12513
12514 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12515}
12516
12517impl GetInterceptEndpointGroupRequest {
12518 pub fn new() -> Self {
12519 std::default::Default::default()
12520 }
12521
12522 /// Sets the value of [name][crate::model::GetInterceptEndpointGroupRequest::name].
12523 ///
12524 /// # Example
12525 /// ```ignore,no_run
12526 /// # use google_cloud_networksecurity_v1::model::GetInterceptEndpointGroupRequest;
12527 /// let x = GetInterceptEndpointGroupRequest::new().set_name("example");
12528 /// ```
12529 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12530 self.name = v.into();
12531 self
12532 }
12533}
12534
12535impl wkt::message::Message for GetInterceptEndpointGroupRequest {
12536 fn typename() -> &'static str {
12537 "type.googleapis.com/google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest"
12538 }
12539}
12540
12541/// Request message for CreateInterceptEndpointGroup.
12542#[derive(Clone, Default, PartialEq)]
12543#[non_exhaustive]
12544pub struct CreateInterceptEndpointGroupRequest {
12545 /// Required. The parent resource where this endpoint group will be created.
12546 /// Format: projects/{project}/locations/{location}
12547 pub parent: std::string::String,
12548
12549 /// Required. The ID to use for the endpoint group, which will become the final
12550 /// component of the endpoint group's resource name.
12551 pub intercept_endpoint_group_id: std::string::String,
12552
12553 /// Required. The endpoint group to create.
12554 pub intercept_endpoint_group: std::option::Option<crate::model::InterceptEndpointGroup>,
12555
12556 /// Optional. A unique identifier for this request. Must be a UUID4.
12557 /// This request is only idempotent if a `request_id` is provided.
12558 /// See <https://google.aip.dev/155> for more details.
12559 pub request_id: std::string::String,
12560
12561 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12562}
12563
12564impl CreateInterceptEndpointGroupRequest {
12565 pub fn new() -> Self {
12566 std::default::Default::default()
12567 }
12568
12569 /// Sets the value of [parent][crate::model::CreateInterceptEndpointGroupRequest::parent].
12570 ///
12571 /// # Example
12572 /// ```ignore,no_run
12573 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12574 /// let x = CreateInterceptEndpointGroupRequest::new().set_parent("example");
12575 /// ```
12576 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12577 self.parent = v.into();
12578 self
12579 }
12580
12581 /// Sets the value of [intercept_endpoint_group_id][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group_id].
12582 ///
12583 /// # Example
12584 /// ```ignore,no_run
12585 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12586 /// let x = CreateInterceptEndpointGroupRequest::new().set_intercept_endpoint_group_id("example");
12587 /// ```
12588 pub fn set_intercept_endpoint_group_id<T: std::convert::Into<std::string::String>>(
12589 mut self,
12590 v: T,
12591 ) -> Self {
12592 self.intercept_endpoint_group_id = v.into();
12593 self
12594 }
12595
12596 /// Sets the value of [intercept_endpoint_group][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group].
12597 ///
12598 /// # Example
12599 /// ```ignore,no_run
12600 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12601 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12602 /// let x = CreateInterceptEndpointGroupRequest::new().set_intercept_endpoint_group(InterceptEndpointGroup::default()/* use setters */);
12603 /// ```
12604 pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
12605 where
12606 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
12607 {
12608 self.intercept_endpoint_group = std::option::Option::Some(v.into());
12609 self
12610 }
12611
12612 /// Sets or clears the value of [intercept_endpoint_group][crate::model::CreateInterceptEndpointGroupRequest::intercept_endpoint_group].
12613 ///
12614 /// # Example
12615 /// ```ignore,no_run
12616 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12617 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12618 /// let x = CreateInterceptEndpointGroupRequest::new().set_or_clear_intercept_endpoint_group(Some(InterceptEndpointGroup::default()/* use setters */));
12619 /// let x = CreateInterceptEndpointGroupRequest::new().set_or_clear_intercept_endpoint_group(None::<InterceptEndpointGroup>);
12620 /// ```
12621 pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
12622 where
12623 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
12624 {
12625 self.intercept_endpoint_group = v.map(|x| x.into());
12626 self
12627 }
12628
12629 /// Sets the value of [request_id][crate::model::CreateInterceptEndpointGroupRequest::request_id].
12630 ///
12631 /// # Example
12632 /// ```ignore,no_run
12633 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupRequest;
12634 /// let x = CreateInterceptEndpointGroupRequest::new().set_request_id("example");
12635 /// ```
12636 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12637 self.request_id = v.into();
12638 self
12639 }
12640}
12641
12642impl wkt::message::Message for CreateInterceptEndpointGroupRequest {
12643 fn typename() -> &'static str {
12644 "type.googleapis.com/google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest"
12645 }
12646}
12647
12648/// Request message for UpdateInterceptEndpointGroup.
12649#[derive(Clone, Default, PartialEq)]
12650#[non_exhaustive]
12651pub struct UpdateInterceptEndpointGroupRequest {
12652 /// Optional. The list of fields to update.
12653 /// Fields are specified relative to the endpoint group
12654 /// (e.g. `description`; *not* `intercept_endpoint_group.description`).
12655 /// See <https://google.aip.dev/161> for more details.
12656 pub update_mask: std::option::Option<wkt::FieldMask>,
12657
12658 /// Required. The endpoint group to update.
12659 pub intercept_endpoint_group: std::option::Option<crate::model::InterceptEndpointGroup>,
12660
12661 /// Optional. A unique identifier for this request. Must be a UUID4.
12662 /// This request is only idempotent if a `request_id` is provided.
12663 /// See <https://google.aip.dev/155> for more details.
12664 pub request_id: std::string::String,
12665
12666 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12667}
12668
12669impl UpdateInterceptEndpointGroupRequest {
12670 pub fn new() -> Self {
12671 std::default::Default::default()
12672 }
12673
12674 /// Sets the value of [update_mask][crate::model::UpdateInterceptEndpointGroupRequest::update_mask].
12675 ///
12676 /// # Example
12677 /// ```ignore,no_run
12678 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
12679 /// use wkt::FieldMask;
12680 /// let x = UpdateInterceptEndpointGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
12681 /// ```
12682 pub fn set_update_mask<T>(mut self, v: T) -> Self
12683 where
12684 T: std::convert::Into<wkt::FieldMask>,
12685 {
12686 self.update_mask = std::option::Option::Some(v.into());
12687 self
12688 }
12689
12690 /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptEndpointGroupRequest::update_mask].
12691 ///
12692 /// # Example
12693 /// ```ignore,no_run
12694 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
12695 /// use wkt::FieldMask;
12696 /// let x = UpdateInterceptEndpointGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
12697 /// let x = UpdateInterceptEndpointGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
12698 /// ```
12699 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12700 where
12701 T: std::convert::Into<wkt::FieldMask>,
12702 {
12703 self.update_mask = v.map(|x| x.into());
12704 self
12705 }
12706
12707 /// Sets the value of [intercept_endpoint_group][crate::model::UpdateInterceptEndpointGroupRequest::intercept_endpoint_group].
12708 ///
12709 /// # Example
12710 /// ```ignore,no_run
12711 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
12712 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12713 /// let x = UpdateInterceptEndpointGroupRequest::new().set_intercept_endpoint_group(InterceptEndpointGroup::default()/* use setters */);
12714 /// ```
12715 pub fn set_intercept_endpoint_group<T>(mut self, v: T) -> Self
12716 where
12717 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
12718 {
12719 self.intercept_endpoint_group = std::option::Option::Some(v.into());
12720 self
12721 }
12722
12723 /// Sets or clears the value of [intercept_endpoint_group][crate::model::UpdateInterceptEndpointGroupRequest::intercept_endpoint_group].
12724 ///
12725 /// # Example
12726 /// ```ignore,no_run
12727 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
12728 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroup;
12729 /// let x = UpdateInterceptEndpointGroupRequest::new().set_or_clear_intercept_endpoint_group(Some(InterceptEndpointGroup::default()/* use setters */));
12730 /// let x = UpdateInterceptEndpointGroupRequest::new().set_or_clear_intercept_endpoint_group(None::<InterceptEndpointGroup>);
12731 /// ```
12732 pub fn set_or_clear_intercept_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
12733 where
12734 T: std::convert::Into<crate::model::InterceptEndpointGroup>,
12735 {
12736 self.intercept_endpoint_group = v.map(|x| x.into());
12737 self
12738 }
12739
12740 /// Sets the value of [request_id][crate::model::UpdateInterceptEndpointGroupRequest::request_id].
12741 ///
12742 /// # Example
12743 /// ```ignore,no_run
12744 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupRequest;
12745 /// let x = UpdateInterceptEndpointGroupRequest::new().set_request_id("example");
12746 /// ```
12747 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12748 self.request_id = v.into();
12749 self
12750 }
12751}
12752
12753impl wkt::message::Message for UpdateInterceptEndpointGroupRequest {
12754 fn typename() -> &'static str {
12755 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest"
12756 }
12757}
12758
12759/// Request message for DeleteInterceptEndpointGroup.
12760#[derive(Clone, Default, PartialEq)]
12761#[non_exhaustive]
12762pub struct DeleteInterceptEndpointGroupRequest {
12763 /// Required. The endpoint group to delete.
12764 pub name: std::string::String,
12765
12766 /// Optional. A unique identifier for this request. Must be a UUID4.
12767 /// This request is only idempotent if a `request_id` is provided.
12768 /// See <https://google.aip.dev/155> for more details.
12769 pub request_id: std::string::String,
12770
12771 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12772}
12773
12774impl DeleteInterceptEndpointGroupRequest {
12775 pub fn new() -> Self {
12776 std::default::Default::default()
12777 }
12778
12779 /// Sets the value of [name][crate::model::DeleteInterceptEndpointGroupRequest::name].
12780 ///
12781 /// # Example
12782 /// ```ignore,no_run
12783 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptEndpointGroupRequest;
12784 /// let x = DeleteInterceptEndpointGroupRequest::new().set_name("example");
12785 /// ```
12786 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12787 self.name = v.into();
12788 self
12789 }
12790
12791 /// Sets the value of [request_id][crate::model::DeleteInterceptEndpointGroupRequest::request_id].
12792 ///
12793 /// # Example
12794 /// ```ignore,no_run
12795 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptEndpointGroupRequest;
12796 /// let x = DeleteInterceptEndpointGroupRequest::new().set_request_id("example");
12797 /// ```
12798 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12799 self.request_id = v.into();
12800 self
12801 }
12802}
12803
12804impl wkt::message::Message for DeleteInterceptEndpointGroupRequest {
12805 fn typename() -> &'static str {
12806 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest"
12807 }
12808}
12809
12810/// An endpoint group association represents a link between a network and an
12811/// endpoint group in the organization.
12812///
12813/// Creating an association creates the networking infrastructure linking the
12814/// network to the endpoint group, but does not enable intercept by itself.
12815/// To enable intercept, the user must also create a network firewall policy
12816/// containing intercept rules and associate it with the network.
12817#[derive(Clone, Default, PartialEq)]
12818#[non_exhaustive]
12819pub struct InterceptEndpointGroupAssociation {
12820 /// Immutable. Identifier. The resource name of this endpoint group
12821 /// association, for example:
12822 /// `projects/123456789/locations/global/interceptEndpointGroupAssociations/my-eg-association`.
12823 /// See <https://google.aip.dev/122> for more details.
12824 pub name: std::string::String,
12825
12826 /// Output only. The timestamp when the resource was created.
12827 /// See <https://google.aip.dev/148#timestamps>.
12828 pub create_time: std::option::Option<wkt::Timestamp>,
12829
12830 /// Output only. The timestamp when the resource was most recently updated.
12831 /// See <https://google.aip.dev/148#timestamps>.
12832 pub update_time: std::option::Option<wkt::Timestamp>,
12833
12834 /// Optional. Labels are key/value pairs that help to organize and filter
12835 /// resources.
12836 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12837
12838 /// Required. Immutable. The endpoint group that this association is connected
12839 /// to, for example:
12840 /// `projects/123456789/locations/global/interceptEndpointGroups/my-eg`.
12841 /// See <https://google.aip.dev/124>.
12842 pub intercept_endpoint_group: std::string::String,
12843
12844 /// Required. Immutable. The VPC network that is associated. for example:
12845 /// `projects/123456789/global/networks/my-network`.
12846 /// See <https://google.aip.dev/124>.
12847 pub network: std::string::String,
12848
12849 /// Output only. The list of locations where the association is present. This
12850 /// information is retrieved from the linked endpoint group, and not configured
12851 /// as part of the association itself.
12852 #[deprecated]
12853 pub locations_details:
12854 std::vec::Vec<crate::model::intercept_endpoint_group_association::LocationDetails>,
12855
12856 /// Output only. Current state of the endpoint group association.
12857 pub state: crate::model::intercept_endpoint_group_association::State,
12858
12859 /// Output only. The current state of the resource does not match the user's
12860 /// intended state, and the system is working to reconcile them. This part of
12861 /// the normal operation (e.g. adding a new location to the target deployment
12862 /// group). See <https://google.aip.dev/128>.
12863 pub reconciling: bool,
12864
12865 /// Output only. The list of locations where the association is configured.
12866 /// This information is retrieved from the linked endpoint group.
12867 pub locations: std::vec::Vec<crate::model::InterceptLocation>,
12868
12869 /// Output only. Identifier used by the data-path.
12870 /// See the NSI GENEVE format for more details:
12871 /// <https://docs.cloud.google.com/network-security-integration/docs/understand-geneve#network_id>
12872 pub network_cookie: u32,
12873
12874 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12875}
12876
12877impl InterceptEndpointGroupAssociation {
12878 pub fn new() -> Self {
12879 std::default::Default::default()
12880 }
12881
12882 /// Sets the value of [name][crate::model::InterceptEndpointGroupAssociation::name].
12883 ///
12884 /// # Example
12885 /// ```ignore,no_run
12886 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
12887 /// let x = InterceptEndpointGroupAssociation::new().set_name("example");
12888 /// ```
12889 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12890 self.name = v.into();
12891 self
12892 }
12893
12894 /// Sets the value of [create_time][crate::model::InterceptEndpointGroupAssociation::create_time].
12895 ///
12896 /// # Example
12897 /// ```ignore,no_run
12898 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
12899 /// use wkt::Timestamp;
12900 /// let x = InterceptEndpointGroupAssociation::new().set_create_time(Timestamp::default()/* use setters */);
12901 /// ```
12902 pub fn set_create_time<T>(mut self, v: T) -> Self
12903 where
12904 T: std::convert::Into<wkt::Timestamp>,
12905 {
12906 self.create_time = std::option::Option::Some(v.into());
12907 self
12908 }
12909
12910 /// Sets or clears the value of [create_time][crate::model::InterceptEndpointGroupAssociation::create_time].
12911 ///
12912 /// # Example
12913 /// ```ignore,no_run
12914 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
12915 /// use wkt::Timestamp;
12916 /// let x = InterceptEndpointGroupAssociation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12917 /// let x = InterceptEndpointGroupAssociation::new().set_or_clear_create_time(None::<Timestamp>);
12918 /// ```
12919 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12920 where
12921 T: std::convert::Into<wkt::Timestamp>,
12922 {
12923 self.create_time = v.map(|x| x.into());
12924 self
12925 }
12926
12927 /// Sets the value of [update_time][crate::model::InterceptEndpointGroupAssociation::update_time].
12928 ///
12929 /// # Example
12930 /// ```ignore,no_run
12931 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
12932 /// use wkt::Timestamp;
12933 /// let x = InterceptEndpointGroupAssociation::new().set_update_time(Timestamp::default()/* use setters */);
12934 /// ```
12935 pub fn set_update_time<T>(mut self, v: T) -> Self
12936 where
12937 T: std::convert::Into<wkt::Timestamp>,
12938 {
12939 self.update_time = std::option::Option::Some(v.into());
12940 self
12941 }
12942
12943 /// Sets or clears the value of [update_time][crate::model::InterceptEndpointGroupAssociation::update_time].
12944 ///
12945 /// # Example
12946 /// ```ignore,no_run
12947 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
12948 /// use wkt::Timestamp;
12949 /// let x = InterceptEndpointGroupAssociation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
12950 /// let x = InterceptEndpointGroupAssociation::new().set_or_clear_update_time(None::<Timestamp>);
12951 /// ```
12952 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12953 where
12954 T: std::convert::Into<wkt::Timestamp>,
12955 {
12956 self.update_time = v.map(|x| x.into());
12957 self
12958 }
12959
12960 /// Sets the value of [labels][crate::model::InterceptEndpointGroupAssociation::labels].
12961 ///
12962 /// # Example
12963 /// ```ignore,no_run
12964 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
12965 /// let x = InterceptEndpointGroupAssociation::new().set_labels([
12966 /// ("key0", "abc"),
12967 /// ("key1", "xyz"),
12968 /// ]);
12969 /// ```
12970 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12971 where
12972 T: std::iter::IntoIterator<Item = (K, V)>,
12973 K: std::convert::Into<std::string::String>,
12974 V: std::convert::Into<std::string::String>,
12975 {
12976 use std::iter::Iterator;
12977 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12978 self
12979 }
12980
12981 /// Sets the value of [intercept_endpoint_group][crate::model::InterceptEndpointGroupAssociation::intercept_endpoint_group].
12982 ///
12983 /// # Example
12984 /// ```ignore,no_run
12985 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
12986 /// let x = InterceptEndpointGroupAssociation::new().set_intercept_endpoint_group("example");
12987 /// ```
12988 pub fn set_intercept_endpoint_group<T: std::convert::Into<std::string::String>>(
12989 mut self,
12990 v: T,
12991 ) -> Self {
12992 self.intercept_endpoint_group = v.into();
12993 self
12994 }
12995
12996 /// Sets the value of [network][crate::model::InterceptEndpointGroupAssociation::network].
12997 ///
12998 /// # Example
12999 /// ```ignore,no_run
13000 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13001 /// let x = InterceptEndpointGroupAssociation::new().set_network("example");
13002 /// ```
13003 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13004 self.network = v.into();
13005 self
13006 }
13007
13008 /// Sets the value of [locations_details][crate::model::InterceptEndpointGroupAssociation::locations_details].
13009 ///
13010 /// # Example
13011 /// ```ignore,no_run
13012 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13013 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::LocationDetails;
13014 /// let x = InterceptEndpointGroupAssociation::new()
13015 /// .set_locations_details([
13016 /// LocationDetails::default()/* use setters */,
13017 /// LocationDetails::default()/* use (different) setters */,
13018 /// ]);
13019 /// ```
13020 #[deprecated]
13021 pub fn set_locations_details<T, V>(mut self, v: T) -> Self
13022 where
13023 T: std::iter::IntoIterator<Item = V>,
13024 V: std::convert::Into<crate::model::intercept_endpoint_group_association::LocationDetails>,
13025 {
13026 use std::iter::Iterator;
13027 self.locations_details = v.into_iter().map(|i| i.into()).collect();
13028 self
13029 }
13030
13031 /// Sets the value of [state][crate::model::InterceptEndpointGroupAssociation::state].
13032 ///
13033 /// # Example
13034 /// ```ignore,no_run
13035 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13036 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::State;
13037 /// let x0 = InterceptEndpointGroupAssociation::new().set_state(State::Active);
13038 /// let x1 = InterceptEndpointGroupAssociation::new().set_state(State::Creating);
13039 /// let x2 = InterceptEndpointGroupAssociation::new().set_state(State::Deleting);
13040 /// ```
13041 pub fn set_state<
13042 T: std::convert::Into<crate::model::intercept_endpoint_group_association::State>,
13043 >(
13044 mut self,
13045 v: T,
13046 ) -> Self {
13047 self.state = v.into();
13048 self
13049 }
13050
13051 /// Sets the value of [reconciling][crate::model::InterceptEndpointGroupAssociation::reconciling].
13052 ///
13053 /// # Example
13054 /// ```ignore,no_run
13055 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13056 /// let x = InterceptEndpointGroupAssociation::new().set_reconciling(true);
13057 /// ```
13058 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13059 self.reconciling = v.into();
13060 self
13061 }
13062
13063 /// Sets the value of [locations][crate::model::InterceptEndpointGroupAssociation::locations].
13064 ///
13065 /// # Example
13066 /// ```ignore,no_run
13067 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13068 /// use google_cloud_networksecurity_v1::model::InterceptLocation;
13069 /// let x = InterceptEndpointGroupAssociation::new()
13070 /// .set_locations([
13071 /// InterceptLocation::default()/* use setters */,
13072 /// InterceptLocation::default()/* use (different) setters */,
13073 /// ]);
13074 /// ```
13075 pub fn set_locations<T, V>(mut self, v: T) -> Self
13076 where
13077 T: std::iter::IntoIterator<Item = V>,
13078 V: std::convert::Into<crate::model::InterceptLocation>,
13079 {
13080 use std::iter::Iterator;
13081 self.locations = v.into_iter().map(|i| i.into()).collect();
13082 self
13083 }
13084
13085 /// Sets the value of [network_cookie][crate::model::InterceptEndpointGroupAssociation::network_cookie].
13086 ///
13087 /// # Example
13088 /// ```ignore,no_run
13089 /// # use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13090 /// let x = InterceptEndpointGroupAssociation::new().set_network_cookie(42_u32);
13091 /// ```
13092 pub fn set_network_cookie<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
13093 self.network_cookie = v.into();
13094 self
13095 }
13096}
13097
13098impl wkt::message::Message for InterceptEndpointGroupAssociation {
13099 fn typename() -> &'static str {
13100 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation"
13101 }
13102}
13103
13104/// Defines additional types related to [InterceptEndpointGroupAssociation].
13105pub mod intercept_endpoint_group_association {
13106 #[allow(unused_imports)]
13107 use super::*;
13108
13109 /// Contains details about the state of an association in a specific cloud
13110 /// location.
13111 #[derive(Clone, Default, PartialEq)]
13112 #[non_exhaustive]
13113 pub struct LocationDetails {
13114 /// Output only. The cloud location, e.g. "us-central1-a" or "asia-south1".
13115 pub location: std::string::String,
13116
13117 /// Output only. The current state of the association in this location.
13118 pub state: crate::model::intercept_endpoint_group_association::location_details::State,
13119
13120 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13121 }
13122
13123 impl LocationDetails {
13124 pub fn new() -> Self {
13125 std::default::Default::default()
13126 }
13127
13128 /// Sets the value of [location][crate::model::intercept_endpoint_group_association::LocationDetails::location].
13129 ///
13130 /// # Example
13131 /// ```ignore,no_run
13132 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::LocationDetails;
13133 /// let x = LocationDetails::new().set_location("example");
13134 /// ```
13135 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13136 self.location = v.into();
13137 self
13138 }
13139
13140 /// Sets the value of [state][crate::model::intercept_endpoint_group_association::LocationDetails::state].
13141 ///
13142 /// # Example
13143 /// ```ignore,no_run
13144 /// # use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::LocationDetails;
13145 /// use google_cloud_networksecurity_v1::model::intercept_endpoint_group_association::location_details::State;
13146 /// let x0 = LocationDetails::new().set_state(State::Active);
13147 /// let x1 = LocationDetails::new().set_state(State::OutOfSync);
13148 /// ```
13149 pub fn set_state<
13150 T: std::convert::Into<
13151 crate::model::intercept_endpoint_group_association::location_details::State,
13152 >,
13153 >(
13154 mut self,
13155 v: T,
13156 ) -> Self {
13157 self.state = v.into();
13158 self
13159 }
13160 }
13161
13162 impl wkt::message::Message for LocationDetails {
13163 fn typename() -> &'static str {
13164 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails"
13165 }
13166 }
13167
13168 /// Defines additional types related to [LocationDetails].
13169 pub mod location_details {
13170 #[allow(unused_imports)]
13171 use super::*;
13172
13173 /// The state of association.
13174 ///
13175 /// # Working with unknown values
13176 ///
13177 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13178 /// additional enum variants at any time. Adding new variants is not considered
13179 /// a breaking change. Applications should write their code in anticipation of:
13180 ///
13181 /// - New values appearing in future releases of the client library, **and**
13182 /// - New values received dynamically, without application changes.
13183 ///
13184 /// Please consult the [Working with enums] section in the user guide for some
13185 /// guidelines.
13186 ///
13187 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13188 #[derive(Clone, Debug, PartialEq)]
13189 #[non_exhaustive]
13190 pub enum State {
13191 /// Not set.
13192 Unspecified,
13193 /// The association is ready and in sync with the linked endpoint group.
13194 Active,
13195 /// The association is out of sync with the linked endpoint group.
13196 /// In most cases, this is a result of a transient issue within the system
13197 /// (e.g. an inaccessible location) and the system is expected to recover
13198 /// automatically.
13199 OutOfSync,
13200 /// If set, the enum was initialized with an unknown value.
13201 ///
13202 /// Applications can examine the value using [State::value] or
13203 /// [State::name].
13204 UnknownValue(state::UnknownValue),
13205 }
13206
13207 #[doc(hidden)]
13208 pub mod state {
13209 #[allow(unused_imports)]
13210 use super::*;
13211 #[derive(Clone, Debug, PartialEq)]
13212 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13213 }
13214
13215 impl State {
13216 /// Gets the enum value.
13217 ///
13218 /// Returns `None` if the enum contains an unknown value deserialized from
13219 /// the string representation of enums.
13220 pub fn value(&self) -> std::option::Option<i32> {
13221 match self {
13222 Self::Unspecified => std::option::Option::Some(0),
13223 Self::Active => std::option::Option::Some(1),
13224 Self::OutOfSync => std::option::Option::Some(2),
13225 Self::UnknownValue(u) => u.0.value(),
13226 }
13227 }
13228
13229 /// Gets the enum value as a string.
13230 ///
13231 /// Returns `None` if the enum contains an unknown value deserialized from
13232 /// the integer representation of enums.
13233 pub fn name(&self) -> std::option::Option<&str> {
13234 match self {
13235 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13236 Self::Active => std::option::Option::Some("ACTIVE"),
13237 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
13238 Self::UnknownValue(u) => u.0.name(),
13239 }
13240 }
13241 }
13242
13243 impl std::default::Default for State {
13244 fn default() -> Self {
13245 use std::convert::From;
13246 Self::from(0)
13247 }
13248 }
13249
13250 impl std::fmt::Display for State {
13251 fn fmt(
13252 &self,
13253 f: &mut std::fmt::Formatter<'_>,
13254 ) -> std::result::Result<(), std::fmt::Error> {
13255 wkt::internal::display_enum(f, self.name(), self.value())
13256 }
13257 }
13258
13259 impl std::convert::From<i32> for State {
13260 fn from(value: i32) -> Self {
13261 match value {
13262 0 => Self::Unspecified,
13263 1 => Self::Active,
13264 2 => Self::OutOfSync,
13265 _ => Self::UnknownValue(state::UnknownValue(
13266 wkt::internal::UnknownEnumValue::Integer(value),
13267 )),
13268 }
13269 }
13270 }
13271
13272 impl std::convert::From<&str> for State {
13273 fn from(value: &str) -> Self {
13274 use std::string::ToString;
13275 match value {
13276 "STATE_UNSPECIFIED" => Self::Unspecified,
13277 "ACTIVE" => Self::Active,
13278 "OUT_OF_SYNC" => Self::OutOfSync,
13279 _ => Self::UnknownValue(state::UnknownValue(
13280 wkt::internal::UnknownEnumValue::String(value.to_string()),
13281 )),
13282 }
13283 }
13284 }
13285
13286 impl serde::ser::Serialize for State {
13287 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13288 where
13289 S: serde::Serializer,
13290 {
13291 match self {
13292 Self::Unspecified => serializer.serialize_i32(0),
13293 Self::Active => serializer.serialize_i32(1),
13294 Self::OutOfSync => serializer.serialize_i32(2),
13295 Self::UnknownValue(u) => u.0.serialize(serializer),
13296 }
13297 }
13298 }
13299
13300 impl<'de> serde::de::Deserialize<'de> for State {
13301 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13302 where
13303 D: serde::Deserializer<'de>,
13304 {
13305 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13306 ".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.State"))
13307 }
13308 }
13309 }
13310
13311 /// The state of the association.
13312 ///
13313 /// # Working with unknown values
13314 ///
13315 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13316 /// additional enum variants at any time. Adding new variants is not considered
13317 /// a breaking change. Applications should write their code in anticipation of:
13318 ///
13319 /// - New values appearing in future releases of the client library, **and**
13320 /// - New values received dynamically, without application changes.
13321 ///
13322 /// Please consult the [Working with enums] section in the user guide for some
13323 /// guidelines.
13324 ///
13325 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13326 #[derive(Clone, Debug, PartialEq)]
13327 #[non_exhaustive]
13328 pub enum State {
13329 /// Not set.
13330 Unspecified,
13331 /// The association is ready and in sync with the linked endpoint group.
13332 Active,
13333 /// The association is being created.
13334 Creating,
13335 /// The association is being deleted.
13336 Deleting,
13337 /// The association is disabled due to a breaking change in another resource.
13338 Closed,
13339 /// The association is out of sync with the linked endpoint group.
13340 /// In most cases, this is a result of a transient issue within the system
13341 /// (e.g. an inaccessible location) and the system is expected to recover
13342 /// automatically. Check the `locations_details` field for more details.
13343 OutOfSync,
13344 /// An attempt to delete the association has failed. This is a terminal state
13345 /// and the association is not expected to be usable as some of its resources
13346 /// have been deleted.
13347 /// The only permitted operation is to retry deleting the association.
13348 DeleteFailed,
13349 /// If set, the enum was initialized with an unknown value.
13350 ///
13351 /// Applications can examine the value using [State::value] or
13352 /// [State::name].
13353 UnknownValue(state::UnknownValue),
13354 }
13355
13356 #[doc(hidden)]
13357 pub mod state {
13358 #[allow(unused_imports)]
13359 use super::*;
13360 #[derive(Clone, Debug, PartialEq)]
13361 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13362 }
13363
13364 impl State {
13365 /// Gets the enum value.
13366 ///
13367 /// Returns `None` if the enum contains an unknown value deserialized from
13368 /// the string representation of enums.
13369 pub fn value(&self) -> std::option::Option<i32> {
13370 match self {
13371 Self::Unspecified => std::option::Option::Some(0),
13372 Self::Active => std::option::Option::Some(1),
13373 Self::Creating => std::option::Option::Some(2),
13374 Self::Deleting => std::option::Option::Some(3),
13375 Self::Closed => std::option::Option::Some(4),
13376 Self::OutOfSync => std::option::Option::Some(5),
13377 Self::DeleteFailed => std::option::Option::Some(6),
13378 Self::UnknownValue(u) => u.0.value(),
13379 }
13380 }
13381
13382 /// Gets the enum value as a string.
13383 ///
13384 /// Returns `None` if the enum contains an unknown value deserialized from
13385 /// the integer representation of enums.
13386 pub fn name(&self) -> std::option::Option<&str> {
13387 match self {
13388 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13389 Self::Active => std::option::Option::Some("ACTIVE"),
13390 Self::Creating => std::option::Option::Some("CREATING"),
13391 Self::Deleting => std::option::Option::Some("DELETING"),
13392 Self::Closed => std::option::Option::Some("CLOSED"),
13393 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
13394 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
13395 Self::UnknownValue(u) => u.0.name(),
13396 }
13397 }
13398 }
13399
13400 impl std::default::Default for State {
13401 fn default() -> Self {
13402 use std::convert::From;
13403 Self::from(0)
13404 }
13405 }
13406
13407 impl std::fmt::Display for State {
13408 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13409 wkt::internal::display_enum(f, self.name(), self.value())
13410 }
13411 }
13412
13413 impl std::convert::From<i32> for State {
13414 fn from(value: i32) -> Self {
13415 match value {
13416 0 => Self::Unspecified,
13417 1 => Self::Active,
13418 2 => Self::Creating,
13419 3 => Self::Deleting,
13420 4 => Self::Closed,
13421 5 => Self::OutOfSync,
13422 6 => Self::DeleteFailed,
13423 _ => Self::UnknownValue(state::UnknownValue(
13424 wkt::internal::UnknownEnumValue::Integer(value),
13425 )),
13426 }
13427 }
13428 }
13429
13430 impl std::convert::From<&str> for State {
13431 fn from(value: &str) -> Self {
13432 use std::string::ToString;
13433 match value {
13434 "STATE_UNSPECIFIED" => Self::Unspecified,
13435 "ACTIVE" => Self::Active,
13436 "CREATING" => Self::Creating,
13437 "DELETING" => Self::Deleting,
13438 "CLOSED" => Self::Closed,
13439 "OUT_OF_SYNC" => Self::OutOfSync,
13440 "DELETE_FAILED" => Self::DeleteFailed,
13441 _ => Self::UnknownValue(state::UnknownValue(
13442 wkt::internal::UnknownEnumValue::String(value.to_string()),
13443 )),
13444 }
13445 }
13446 }
13447
13448 impl serde::ser::Serialize for State {
13449 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13450 where
13451 S: serde::Serializer,
13452 {
13453 match self {
13454 Self::Unspecified => serializer.serialize_i32(0),
13455 Self::Active => serializer.serialize_i32(1),
13456 Self::Creating => serializer.serialize_i32(2),
13457 Self::Deleting => serializer.serialize_i32(3),
13458 Self::Closed => serializer.serialize_i32(4),
13459 Self::OutOfSync => serializer.serialize_i32(5),
13460 Self::DeleteFailed => serializer.serialize_i32(6),
13461 Self::UnknownValue(u) => u.0.serialize(serializer),
13462 }
13463 }
13464 }
13465
13466 impl<'de> serde::de::Deserialize<'de> for State {
13467 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13468 where
13469 D: serde::Deserializer<'de>,
13470 {
13471 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13472 ".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State",
13473 ))
13474 }
13475 }
13476}
13477
13478/// Request message for ListInterceptEndpointGroupAssociations.
13479#[derive(Clone, Default, PartialEq)]
13480#[non_exhaustive]
13481pub struct ListInterceptEndpointGroupAssociationsRequest {
13482 /// Required. The parent, which owns this collection of associations.
13483 /// Example: `projects/123456789/locations/global`.
13484 /// See <https://google.aip.dev/132> for more details.
13485 pub parent: std::string::String,
13486
13487 /// Optional. Requested page size. Server may return fewer items than
13488 /// requested. If unspecified, server will pick an appropriate default. See
13489 /// <https://google.aip.dev/158> for more details.
13490 pub page_size: i32,
13491
13492 /// Optional. A page token, received from a previous
13493 /// `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent
13494 /// page. When paginating, all other parameters provided to
13495 /// `ListInterceptEndpointGroups` must match the call that provided the page
13496 /// token. See <https://google.aip.dev/158> for more details.
13497 pub page_token: std::string::String,
13498
13499 /// Optional. Filter expression.
13500 /// See <https://google.aip.dev/160#filtering> for more details.
13501 pub filter: std::string::String,
13502
13503 /// Optional. Sort expression.
13504 /// See <https://google.aip.dev/132#ordering> for more details.
13505 pub order_by: std::string::String,
13506
13507 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13508}
13509
13510impl ListInterceptEndpointGroupAssociationsRequest {
13511 pub fn new() -> Self {
13512 std::default::Default::default()
13513 }
13514
13515 /// Sets the value of [parent][crate::model::ListInterceptEndpointGroupAssociationsRequest::parent].
13516 ///
13517 /// # Example
13518 /// ```ignore,no_run
13519 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13520 /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_parent("example");
13521 /// ```
13522 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13523 self.parent = v.into();
13524 self
13525 }
13526
13527 /// Sets the value of [page_size][crate::model::ListInterceptEndpointGroupAssociationsRequest::page_size].
13528 ///
13529 /// # Example
13530 /// ```ignore,no_run
13531 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13532 /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_page_size(42);
13533 /// ```
13534 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13535 self.page_size = v.into();
13536 self
13537 }
13538
13539 /// Sets the value of [page_token][crate::model::ListInterceptEndpointGroupAssociationsRequest::page_token].
13540 ///
13541 /// # Example
13542 /// ```ignore,no_run
13543 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13544 /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_page_token("example");
13545 /// ```
13546 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13547 self.page_token = v.into();
13548 self
13549 }
13550
13551 /// Sets the value of [filter][crate::model::ListInterceptEndpointGroupAssociationsRequest::filter].
13552 ///
13553 /// # Example
13554 /// ```ignore,no_run
13555 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13556 /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_filter("example");
13557 /// ```
13558 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13559 self.filter = v.into();
13560 self
13561 }
13562
13563 /// Sets the value of [order_by][crate::model::ListInterceptEndpointGroupAssociationsRequest::order_by].
13564 ///
13565 /// # Example
13566 /// ```ignore,no_run
13567 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsRequest;
13568 /// let x = ListInterceptEndpointGroupAssociationsRequest::new().set_order_by("example");
13569 /// ```
13570 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13571 self.order_by = v.into();
13572 self
13573 }
13574}
13575
13576impl wkt::message::Message for ListInterceptEndpointGroupAssociationsRequest {
13577 fn typename() -> &'static str {
13578 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest"
13579 }
13580}
13581
13582/// Response message for ListInterceptEndpointGroupAssociations.
13583#[derive(Clone, Default, PartialEq)]
13584#[non_exhaustive]
13585pub struct ListInterceptEndpointGroupAssociationsResponse {
13586 /// The associations from the specified parent.
13587 pub intercept_endpoint_group_associations:
13588 std::vec::Vec<crate::model::InterceptEndpointGroupAssociation>,
13589
13590 /// A token that can be sent as `page_token` to retrieve the next page.
13591 /// If this field is omitted, there are no subsequent pages.
13592 /// See <https://google.aip.dev/158> for more details.
13593 pub next_page_token: std::string::String,
13594
13595 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13596}
13597
13598impl ListInterceptEndpointGroupAssociationsResponse {
13599 pub fn new() -> Self {
13600 std::default::Default::default()
13601 }
13602
13603 /// Sets the value of [intercept_endpoint_group_associations][crate::model::ListInterceptEndpointGroupAssociationsResponse::intercept_endpoint_group_associations].
13604 ///
13605 /// # Example
13606 /// ```ignore,no_run
13607 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsResponse;
13608 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13609 /// let x = ListInterceptEndpointGroupAssociationsResponse::new()
13610 /// .set_intercept_endpoint_group_associations([
13611 /// InterceptEndpointGroupAssociation::default()/* use setters */,
13612 /// InterceptEndpointGroupAssociation::default()/* use (different) setters */,
13613 /// ]);
13614 /// ```
13615 pub fn set_intercept_endpoint_group_associations<T, V>(mut self, v: T) -> Self
13616 where
13617 T: std::iter::IntoIterator<Item = V>,
13618 V: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
13619 {
13620 use std::iter::Iterator;
13621 self.intercept_endpoint_group_associations = v.into_iter().map(|i| i.into()).collect();
13622 self
13623 }
13624
13625 /// Sets the value of [next_page_token][crate::model::ListInterceptEndpointGroupAssociationsResponse::next_page_token].
13626 ///
13627 /// # Example
13628 /// ```ignore,no_run
13629 /// # use google_cloud_networksecurity_v1::model::ListInterceptEndpointGroupAssociationsResponse;
13630 /// let x = ListInterceptEndpointGroupAssociationsResponse::new().set_next_page_token("example");
13631 /// ```
13632 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13633 self.next_page_token = v.into();
13634 self
13635 }
13636}
13637
13638impl wkt::message::Message for ListInterceptEndpointGroupAssociationsResponse {
13639 fn typename() -> &'static str {
13640 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse"
13641 }
13642}
13643
13644#[doc(hidden)]
13645impl google_cloud_gax::paginator::internal::PageableResponse
13646 for ListInterceptEndpointGroupAssociationsResponse
13647{
13648 type PageItem = crate::model::InterceptEndpointGroupAssociation;
13649
13650 fn items(self) -> std::vec::Vec<Self::PageItem> {
13651 self.intercept_endpoint_group_associations
13652 }
13653
13654 fn next_page_token(&self) -> std::string::String {
13655 use std::clone::Clone;
13656 self.next_page_token.clone()
13657 }
13658}
13659
13660/// Request message for GetInterceptEndpointGroupAssociation.
13661#[derive(Clone, Default, PartialEq)]
13662#[non_exhaustive]
13663pub struct GetInterceptEndpointGroupAssociationRequest {
13664 /// Required. The name of the association to retrieve.
13665 /// Format:
13666 /// projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association}
13667 pub name: std::string::String,
13668
13669 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13670}
13671
13672impl GetInterceptEndpointGroupAssociationRequest {
13673 pub fn new() -> Self {
13674 std::default::Default::default()
13675 }
13676
13677 /// Sets the value of [name][crate::model::GetInterceptEndpointGroupAssociationRequest::name].
13678 ///
13679 /// # Example
13680 /// ```ignore,no_run
13681 /// # use google_cloud_networksecurity_v1::model::GetInterceptEndpointGroupAssociationRequest;
13682 /// let x = GetInterceptEndpointGroupAssociationRequest::new().set_name("example");
13683 /// ```
13684 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13685 self.name = v.into();
13686 self
13687 }
13688}
13689
13690impl wkt::message::Message for GetInterceptEndpointGroupAssociationRequest {
13691 fn typename() -> &'static str {
13692 "type.googleapis.com/google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest"
13693 }
13694}
13695
13696/// Request message for CreateInterceptEndpointGroupAssociation.
13697#[derive(Clone, Default, PartialEq)]
13698#[non_exhaustive]
13699pub struct CreateInterceptEndpointGroupAssociationRequest {
13700 /// Required. The parent resource where this association will be created.
13701 /// Format: projects/{project}/locations/{location}
13702 pub parent: std::string::String,
13703
13704 /// Optional. The ID to use for the new association, which will become the
13705 /// final component of the endpoint group's resource name. If not provided, the
13706 /// server will generate a unique ID.
13707 pub intercept_endpoint_group_association_id: std::string::String,
13708
13709 /// Required. The association to create.
13710 pub intercept_endpoint_group_association:
13711 std::option::Option<crate::model::InterceptEndpointGroupAssociation>,
13712
13713 /// Optional. A unique identifier for this request. Must be a UUID4.
13714 /// This request is only idempotent if a `request_id` is provided.
13715 /// See <https://google.aip.dev/155> for more details.
13716 pub request_id: std::string::String,
13717
13718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13719}
13720
13721impl CreateInterceptEndpointGroupAssociationRequest {
13722 pub fn new() -> Self {
13723 std::default::Default::default()
13724 }
13725
13726 /// Sets the value of [parent][crate::model::CreateInterceptEndpointGroupAssociationRequest::parent].
13727 ///
13728 /// # Example
13729 /// ```ignore,no_run
13730 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
13731 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_parent("example");
13732 /// ```
13733 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13734 self.parent = v.into();
13735 self
13736 }
13737
13738 /// Sets the value of [intercept_endpoint_group_association_id][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association_id].
13739 ///
13740 /// # Example
13741 /// ```ignore,no_run
13742 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
13743 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_intercept_endpoint_group_association_id("example");
13744 /// ```
13745 pub fn set_intercept_endpoint_group_association_id<
13746 T: std::convert::Into<std::string::String>,
13747 >(
13748 mut self,
13749 v: T,
13750 ) -> Self {
13751 self.intercept_endpoint_group_association_id = v.into();
13752 self
13753 }
13754
13755 /// Sets the value of [intercept_endpoint_group_association][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
13756 ///
13757 /// # Example
13758 /// ```ignore,no_run
13759 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
13760 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13761 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_intercept_endpoint_group_association(InterceptEndpointGroupAssociation::default()/* use setters */);
13762 /// ```
13763 pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
13764 where
13765 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
13766 {
13767 self.intercept_endpoint_group_association = std::option::Option::Some(v.into());
13768 self
13769 }
13770
13771 /// Sets or clears the value of [intercept_endpoint_group_association][crate::model::CreateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
13772 ///
13773 /// # Example
13774 /// ```ignore,no_run
13775 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
13776 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13777 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_or_clear_intercept_endpoint_group_association(Some(InterceptEndpointGroupAssociation::default()/* use setters */));
13778 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_or_clear_intercept_endpoint_group_association(None::<InterceptEndpointGroupAssociation>);
13779 /// ```
13780 pub fn set_or_clear_intercept_endpoint_group_association<T>(
13781 mut self,
13782 v: std::option::Option<T>,
13783 ) -> Self
13784 where
13785 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
13786 {
13787 self.intercept_endpoint_group_association = v.map(|x| x.into());
13788 self
13789 }
13790
13791 /// Sets the value of [request_id][crate::model::CreateInterceptEndpointGroupAssociationRequest::request_id].
13792 ///
13793 /// # Example
13794 /// ```ignore,no_run
13795 /// # use google_cloud_networksecurity_v1::model::CreateInterceptEndpointGroupAssociationRequest;
13796 /// let x = CreateInterceptEndpointGroupAssociationRequest::new().set_request_id("example");
13797 /// ```
13798 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13799 self.request_id = v.into();
13800 self
13801 }
13802}
13803
13804impl wkt::message::Message for CreateInterceptEndpointGroupAssociationRequest {
13805 fn typename() -> &'static str {
13806 "type.googleapis.com/google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest"
13807 }
13808}
13809
13810/// Request message for UpdateInterceptEndpointGroupAssociation.
13811#[derive(Clone, Default, PartialEq)]
13812#[non_exhaustive]
13813pub struct UpdateInterceptEndpointGroupAssociationRequest {
13814 /// Optional. The list of fields to update.
13815 /// Fields are specified relative to the association
13816 /// (e.g. `description`; *not*
13817 /// `intercept_endpoint_group_association.description`). See
13818 /// <https://google.aip.dev/161> for more details.
13819 pub update_mask: std::option::Option<wkt::FieldMask>,
13820
13821 /// Required. The association to update.
13822 pub intercept_endpoint_group_association:
13823 std::option::Option<crate::model::InterceptEndpointGroupAssociation>,
13824
13825 /// Optional. A unique identifier for this request. Must be a UUID4.
13826 /// This request is only idempotent if a `request_id` is provided.
13827 /// See <https://google.aip.dev/155> for more details.
13828 pub request_id: std::string::String,
13829
13830 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13831}
13832
13833impl UpdateInterceptEndpointGroupAssociationRequest {
13834 pub fn new() -> Self {
13835 std::default::Default::default()
13836 }
13837
13838 /// Sets the value of [update_mask][crate::model::UpdateInterceptEndpointGroupAssociationRequest::update_mask].
13839 ///
13840 /// # Example
13841 /// ```ignore,no_run
13842 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
13843 /// use wkt::FieldMask;
13844 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
13845 /// ```
13846 pub fn set_update_mask<T>(mut self, v: T) -> Self
13847 where
13848 T: std::convert::Into<wkt::FieldMask>,
13849 {
13850 self.update_mask = std::option::Option::Some(v.into());
13851 self
13852 }
13853
13854 /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptEndpointGroupAssociationRequest::update_mask].
13855 ///
13856 /// # Example
13857 /// ```ignore,no_run
13858 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
13859 /// use wkt::FieldMask;
13860 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
13861 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
13862 /// ```
13863 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13864 where
13865 T: std::convert::Into<wkt::FieldMask>,
13866 {
13867 self.update_mask = v.map(|x| x.into());
13868 self
13869 }
13870
13871 /// Sets the value of [intercept_endpoint_group_association][crate::model::UpdateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
13872 ///
13873 /// # Example
13874 /// ```ignore,no_run
13875 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
13876 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13877 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_intercept_endpoint_group_association(InterceptEndpointGroupAssociation::default()/* use setters */);
13878 /// ```
13879 pub fn set_intercept_endpoint_group_association<T>(mut self, v: T) -> Self
13880 where
13881 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
13882 {
13883 self.intercept_endpoint_group_association = std::option::Option::Some(v.into());
13884 self
13885 }
13886
13887 /// Sets or clears the value of [intercept_endpoint_group_association][crate::model::UpdateInterceptEndpointGroupAssociationRequest::intercept_endpoint_group_association].
13888 ///
13889 /// # Example
13890 /// ```ignore,no_run
13891 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
13892 /// use google_cloud_networksecurity_v1::model::InterceptEndpointGroupAssociation;
13893 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_or_clear_intercept_endpoint_group_association(Some(InterceptEndpointGroupAssociation::default()/* use setters */));
13894 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_or_clear_intercept_endpoint_group_association(None::<InterceptEndpointGroupAssociation>);
13895 /// ```
13896 pub fn set_or_clear_intercept_endpoint_group_association<T>(
13897 mut self,
13898 v: std::option::Option<T>,
13899 ) -> Self
13900 where
13901 T: std::convert::Into<crate::model::InterceptEndpointGroupAssociation>,
13902 {
13903 self.intercept_endpoint_group_association = v.map(|x| x.into());
13904 self
13905 }
13906
13907 /// Sets the value of [request_id][crate::model::UpdateInterceptEndpointGroupAssociationRequest::request_id].
13908 ///
13909 /// # Example
13910 /// ```ignore,no_run
13911 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptEndpointGroupAssociationRequest;
13912 /// let x = UpdateInterceptEndpointGroupAssociationRequest::new().set_request_id("example");
13913 /// ```
13914 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13915 self.request_id = v.into();
13916 self
13917 }
13918}
13919
13920impl wkt::message::Message for UpdateInterceptEndpointGroupAssociationRequest {
13921 fn typename() -> &'static str {
13922 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest"
13923 }
13924}
13925
13926/// Request message for DeleteInterceptEndpointGroupAssociation.
13927#[derive(Clone, Default, PartialEq)]
13928#[non_exhaustive]
13929pub struct DeleteInterceptEndpointGroupAssociationRequest {
13930 /// Required. The association to delete.
13931 pub name: std::string::String,
13932
13933 /// Optional. A unique identifier for this request. Must be a UUID4.
13934 /// This request is only idempotent if a `request_id` is provided.
13935 /// See <https://google.aip.dev/155> for more details.
13936 pub request_id: std::string::String,
13937
13938 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13939}
13940
13941impl DeleteInterceptEndpointGroupAssociationRequest {
13942 pub fn new() -> Self {
13943 std::default::Default::default()
13944 }
13945
13946 /// Sets the value of [name][crate::model::DeleteInterceptEndpointGroupAssociationRequest::name].
13947 ///
13948 /// # Example
13949 /// ```ignore,no_run
13950 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptEndpointGroupAssociationRequest;
13951 /// let x = DeleteInterceptEndpointGroupAssociationRequest::new().set_name("example");
13952 /// ```
13953 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13954 self.name = v.into();
13955 self
13956 }
13957
13958 /// Sets the value of [request_id][crate::model::DeleteInterceptEndpointGroupAssociationRequest::request_id].
13959 ///
13960 /// # Example
13961 /// ```ignore,no_run
13962 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptEndpointGroupAssociationRequest;
13963 /// let x = DeleteInterceptEndpointGroupAssociationRequest::new().set_request_id("example");
13964 /// ```
13965 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13966 self.request_id = v.into();
13967 self
13968 }
13969}
13970
13971impl wkt::message::Message for DeleteInterceptEndpointGroupAssociationRequest {
13972 fn typename() -> &'static str {
13973 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest"
13974 }
13975}
13976
13977/// A deployment group aggregates many zonal intercept backends (deployments)
13978/// into a single global intercept service. Consumers can connect this service
13979/// using an endpoint group.
13980#[derive(Clone, Default, PartialEq)]
13981#[non_exhaustive]
13982pub struct InterceptDeploymentGroup {
13983 /// Immutable. Identifier. The resource name of this deployment group, for
13984 /// example:
13985 /// `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`.
13986 /// See <https://google.aip.dev/122> for more details.
13987 pub name: std::string::String,
13988
13989 /// Output only. The timestamp when the resource was created.
13990 /// See <https://google.aip.dev/148#timestamps>.
13991 pub create_time: std::option::Option<wkt::Timestamp>,
13992
13993 /// Output only. The timestamp when the resource was most recently updated.
13994 /// See <https://google.aip.dev/148#timestamps>.
13995 pub update_time: std::option::Option<wkt::Timestamp>,
13996
13997 /// Optional. Labels are key/value pairs that help to organize and filter
13998 /// resources.
13999 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
14000
14001 /// Required. Immutable. The network that will be used for all child
14002 /// deployments, for example: `projects/{project}/global/networks/{network}`.
14003 /// See <https://google.aip.dev/124>.
14004 pub network: std::string::String,
14005
14006 /// Output only. The list of endpoint groups that are connected to this
14007 /// resource.
14008 pub connected_endpoint_groups:
14009 std::vec::Vec<crate::model::intercept_deployment_group::ConnectedEndpointGroup>,
14010
14011 /// Output only. The list of Intercept Deployments that belong to this group.
14012 #[deprecated]
14013 pub nested_deployments: std::vec::Vec<crate::model::intercept_deployment_group::Deployment>,
14014
14015 /// Output only. The current state of the deployment group.
14016 /// See <https://google.aip.dev/216>.
14017 pub state: crate::model::intercept_deployment_group::State,
14018
14019 /// Output only. The current state of the resource does not match the user's
14020 /// intended state, and the system is working to reconcile them. This is part
14021 /// of the normal operation (e.g. adding a new deployment to the group) See
14022 /// <https://google.aip.dev/128>.
14023 pub reconciling: bool,
14024
14025 /// Optional. User-provided description of the deployment group.
14026 /// Used as additional context for the deployment group.
14027 pub description: std::string::String,
14028
14029 /// Output only. The list of locations where the deployment group is present.
14030 pub locations: std::vec::Vec<crate::model::InterceptLocation>,
14031
14032 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14033}
14034
14035impl InterceptDeploymentGroup {
14036 pub fn new() -> Self {
14037 std::default::Default::default()
14038 }
14039
14040 /// Sets the value of [name][crate::model::InterceptDeploymentGroup::name].
14041 ///
14042 /// # Example
14043 /// ```ignore,no_run
14044 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14045 /// let x = InterceptDeploymentGroup::new().set_name("example");
14046 /// ```
14047 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14048 self.name = v.into();
14049 self
14050 }
14051
14052 /// Sets the value of [create_time][crate::model::InterceptDeploymentGroup::create_time].
14053 ///
14054 /// # Example
14055 /// ```ignore,no_run
14056 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14057 /// use wkt::Timestamp;
14058 /// let x = InterceptDeploymentGroup::new().set_create_time(Timestamp::default()/* use setters */);
14059 /// ```
14060 pub fn set_create_time<T>(mut self, v: T) -> Self
14061 where
14062 T: std::convert::Into<wkt::Timestamp>,
14063 {
14064 self.create_time = std::option::Option::Some(v.into());
14065 self
14066 }
14067
14068 /// Sets or clears the value of [create_time][crate::model::InterceptDeploymentGroup::create_time].
14069 ///
14070 /// # Example
14071 /// ```ignore,no_run
14072 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14073 /// use wkt::Timestamp;
14074 /// let x = InterceptDeploymentGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14075 /// let x = InterceptDeploymentGroup::new().set_or_clear_create_time(None::<Timestamp>);
14076 /// ```
14077 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14078 where
14079 T: std::convert::Into<wkt::Timestamp>,
14080 {
14081 self.create_time = v.map(|x| x.into());
14082 self
14083 }
14084
14085 /// Sets the value of [update_time][crate::model::InterceptDeploymentGroup::update_time].
14086 ///
14087 /// # Example
14088 /// ```ignore,no_run
14089 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14090 /// use wkt::Timestamp;
14091 /// let x = InterceptDeploymentGroup::new().set_update_time(Timestamp::default()/* use setters */);
14092 /// ```
14093 pub fn set_update_time<T>(mut self, v: T) -> Self
14094 where
14095 T: std::convert::Into<wkt::Timestamp>,
14096 {
14097 self.update_time = std::option::Option::Some(v.into());
14098 self
14099 }
14100
14101 /// Sets or clears the value of [update_time][crate::model::InterceptDeploymentGroup::update_time].
14102 ///
14103 /// # Example
14104 /// ```ignore,no_run
14105 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14106 /// use wkt::Timestamp;
14107 /// let x = InterceptDeploymentGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14108 /// let x = InterceptDeploymentGroup::new().set_or_clear_update_time(None::<Timestamp>);
14109 /// ```
14110 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14111 where
14112 T: std::convert::Into<wkt::Timestamp>,
14113 {
14114 self.update_time = v.map(|x| x.into());
14115 self
14116 }
14117
14118 /// Sets the value of [labels][crate::model::InterceptDeploymentGroup::labels].
14119 ///
14120 /// # Example
14121 /// ```ignore,no_run
14122 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14123 /// let x = InterceptDeploymentGroup::new().set_labels([
14124 /// ("key0", "abc"),
14125 /// ("key1", "xyz"),
14126 /// ]);
14127 /// ```
14128 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14129 where
14130 T: std::iter::IntoIterator<Item = (K, V)>,
14131 K: std::convert::Into<std::string::String>,
14132 V: std::convert::Into<std::string::String>,
14133 {
14134 use std::iter::Iterator;
14135 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14136 self
14137 }
14138
14139 /// Sets the value of [network][crate::model::InterceptDeploymentGroup::network].
14140 ///
14141 /// # Example
14142 /// ```ignore,no_run
14143 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14144 /// let x = InterceptDeploymentGroup::new().set_network("example");
14145 /// ```
14146 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14147 self.network = v.into();
14148 self
14149 }
14150
14151 /// Sets the value of [connected_endpoint_groups][crate::model::InterceptDeploymentGroup::connected_endpoint_groups].
14152 ///
14153 /// # Example
14154 /// ```ignore,no_run
14155 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14156 /// use google_cloud_networksecurity_v1::model::intercept_deployment_group::ConnectedEndpointGroup;
14157 /// let x = InterceptDeploymentGroup::new()
14158 /// .set_connected_endpoint_groups([
14159 /// ConnectedEndpointGroup::default()/* use setters */,
14160 /// ConnectedEndpointGroup::default()/* use (different) setters */,
14161 /// ]);
14162 /// ```
14163 pub fn set_connected_endpoint_groups<T, V>(mut self, v: T) -> Self
14164 where
14165 T: std::iter::IntoIterator<Item = V>,
14166 V: std::convert::Into<crate::model::intercept_deployment_group::ConnectedEndpointGroup>,
14167 {
14168 use std::iter::Iterator;
14169 self.connected_endpoint_groups = v.into_iter().map(|i| i.into()).collect();
14170 self
14171 }
14172
14173 /// Sets the value of [nested_deployments][crate::model::InterceptDeploymentGroup::nested_deployments].
14174 ///
14175 /// # Example
14176 /// ```ignore,no_run
14177 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14178 /// use google_cloud_networksecurity_v1::model::intercept_deployment_group::Deployment;
14179 /// let x = InterceptDeploymentGroup::new()
14180 /// .set_nested_deployments([
14181 /// Deployment::default()/* use setters */,
14182 /// Deployment::default()/* use (different) setters */,
14183 /// ]);
14184 /// ```
14185 #[deprecated]
14186 pub fn set_nested_deployments<T, V>(mut self, v: T) -> Self
14187 where
14188 T: std::iter::IntoIterator<Item = V>,
14189 V: std::convert::Into<crate::model::intercept_deployment_group::Deployment>,
14190 {
14191 use std::iter::Iterator;
14192 self.nested_deployments = v.into_iter().map(|i| i.into()).collect();
14193 self
14194 }
14195
14196 /// Sets the value of [state][crate::model::InterceptDeploymentGroup::state].
14197 ///
14198 /// # Example
14199 /// ```ignore,no_run
14200 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14201 /// use google_cloud_networksecurity_v1::model::intercept_deployment_group::State;
14202 /// let x0 = InterceptDeploymentGroup::new().set_state(State::Active);
14203 /// let x1 = InterceptDeploymentGroup::new().set_state(State::Creating);
14204 /// let x2 = InterceptDeploymentGroup::new().set_state(State::Deleting);
14205 /// ```
14206 pub fn set_state<T: std::convert::Into<crate::model::intercept_deployment_group::State>>(
14207 mut self,
14208 v: T,
14209 ) -> Self {
14210 self.state = v.into();
14211 self
14212 }
14213
14214 /// Sets the value of [reconciling][crate::model::InterceptDeploymentGroup::reconciling].
14215 ///
14216 /// # Example
14217 /// ```ignore,no_run
14218 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14219 /// let x = InterceptDeploymentGroup::new().set_reconciling(true);
14220 /// ```
14221 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14222 self.reconciling = v.into();
14223 self
14224 }
14225
14226 /// Sets the value of [description][crate::model::InterceptDeploymentGroup::description].
14227 ///
14228 /// # Example
14229 /// ```ignore,no_run
14230 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14231 /// let x = InterceptDeploymentGroup::new().set_description("example");
14232 /// ```
14233 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14234 self.description = v.into();
14235 self
14236 }
14237
14238 /// Sets the value of [locations][crate::model::InterceptDeploymentGroup::locations].
14239 ///
14240 /// # Example
14241 /// ```ignore,no_run
14242 /// # use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14243 /// use google_cloud_networksecurity_v1::model::InterceptLocation;
14244 /// let x = InterceptDeploymentGroup::new()
14245 /// .set_locations([
14246 /// InterceptLocation::default()/* use setters */,
14247 /// InterceptLocation::default()/* use (different) setters */,
14248 /// ]);
14249 /// ```
14250 pub fn set_locations<T, V>(mut self, v: T) -> Self
14251 where
14252 T: std::iter::IntoIterator<Item = V>,
14253 V: std::convert::Into<crate::model::InterceptLocation>,
14254 {
14255 use std::iter::Iterator;
14256 self.locations = v.into_iter().map(|i| i.into()).collect();
14257 self
14258 }
14259}
14260
14261impl wkt::message::Message for InterceptDeploymentGroup {
14262 fn typename() -> &'static str {
14263 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptDeploymentGroup"
14264 }
14265}
14266
14267/// Defines additional types related to [InterceptDeploymentGroup].
14268pub mod intercept_deployment_group {
14269 #[allow(unused_imports)]
14270 use super::*;
14271
14272 /// An endpoint group connected to this deployment group.
14273 #[derive(Clone, Default, PartialEq)]
14274 #[non_exhaustive]
14275 pub struct ConnectedEndpointGroup {
14276 /// Output only. The connected endpoint group's resource name, for example:
14277 /// `projects/123456789/locations/global/interceptEndpointGroups/my-eg`.
14278 /// See <https://google.aip.dev/124>.
14279 pub name: std::string::String,
14280
14281 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14282 }
14283
14284 impl ConnectedEndpointGroup {
14285 pub fn new() -> Self {
14286 std::default::Default::default()
14287 }
14288
14289 /// Sets the value of [name][crate::model::intercept_deployment_group::ConnectedEndpointGroup::name].
14290 ///
14291 /// # Example
14292 /// ```ignore,no_run
14293 /// # use google_cloud_networksecurity_v1::model::intercept_deployment_group::ConnectedEndpointGroup;
14294 /// let x = ConnectedEndpointGroup::new().set_name("example");
14295 /// ```
14296 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14297 self.name = v.into();
14298 self
14299 }
14300 }
14301
14302 impl wkt::message::Message for ConnectedEndpointGroup {
14303 fn typename() -> &'static str {
14304 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup"
14305 }
14306 }
14307
14308 /// A deployment belonging to this deployment group.
14309 #[derive(Clone, Default, PartialEq)]
14310 #[non_exhaustive]
14311 pub struct Deployment {
14312 /// Output only. The name of the Intercept Deployment, in the format:
14313 /// `projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}`.
14314 pub name: std::string::String,
14315
14316 /// Output only. Most recent known state of the deployment.
14317 pub state: crate::model::intercept_deployment::State,
14318
14319 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14320 }
14321
14322 impl Deployment {
14323 pub fn new() -> Self {
14324 std::default::Default::default()
14325 }
14326
14327 /// Sets the value of [name][crate::model::intercept_deployment_group::Deployment::name].
14328 ///
14329 /// # Example
14330 /// ```ignore,no_run
14331 /// # use google_cloud_networksecurity_v1::model::intercept_deployment_group::Deployment;
14332 /// let x = Deployment::new().set_name("example");
14333 /// ```
14334 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14335 self.name = v.into();
14336 self
14337 }
14338
14339 /// Sets the value of [state][crate::model::intercept_deployment_group::Deployment::state].
14340 ///
14341 /// # Example
14342 /// ```ignore,no_run
14343 /// # use google_cloud_networksecurity_v1::model::intercept_deployment_group::Deployment;
14344 /// use google_cloud_networksecurity_v1::model::intercept_deployment::State;
14345 /// let x0 = Deployment::new().set_state(State::Active);
14346 /// let x1 = Deployment::new().set_state(State::Creating);
14347 /// let x2 = Deployment::new().set_state(State::Deleting);
14348 /// ```
14349 pub fn set_state<T: std::convert::Into<crate::model::intercept_deployment::State>>(
14350 mut self,
14351 v: T,
14352 ) -> Self {
14353 self.state = v.into();
14354 self
14355 }
14356 }
14357
14358 impl wkt::message::Message for Deployment {
14359 fn typename() -> &'static str {
14360 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment"
14361 }
14362 }
14363
14364 /// The current state of the deployment group.
14365 ///
14366 /// # Working with unknown values
14367 ///
14368 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14369 /// additional enum variants at any time. Adding new variants is not considered
14370 /// a breaking change. Applications should write their code in anticipation of:
14371 ///
14372 /// - New values appearing in future releases of the client library, **and**
14373 /// - New values received dynamically, without application changes.
14374 ///
14375 /// Please consult the [Working with enums] section in the user guide for some
14376 /// guidelines.
14377 ///
14378 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14379 #[derive(Clone, Debug, PartialEq)]
14380 #[non_exhaustive]
14381 pub enum State {
14382 /// State not set (this is not a valid state).
14383 Unspecified,
14384 /// The deployment group is ready.
14385 Active,
14386 /// The deployment group is being created.
14387 Creating,
14388 /// The deployment group is being deleted.
14389 Deleting,
14390 /// If set, the enum was initialized with an unknown value.
14391 ///
14392 /// Applications can examine the value using [State::value] or
14393 /// [State::name].
14394 UnknownValue(state::UnknownValue),
14395 }
14396
14397 #[doc(hidden)]
14398 pub mod state {
14399 #[allow(unused_imports)]
14400 use super::*;
14401 #[derive(Clone, Debug, PartialEq)]
14402 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14403 }
14404
14405 impl State {
14406 /// Gets the enum value.
14407 ///
14408 /// Returns `None` if the enum contains an unknown value deserialized from
14409 /// the string representation of enums.
14410 pub fn value(&self) -> std::option::Option<i32> {
14411 match self {
14412 Self::Unspecified => std::option::Option::Some(0),
14413 Self::Active => std::option::Option::Some(1),
14414 Self::Creating => std::option::Option::Some(2),
14415 Self::Deleting => std::option::Option::Some(3),
14416 Self::UnknownValue(u) => u.0.value(),
14417 }
14418 }
14419
14420 /// Gets the enum value as a string.
14421 ///
14422 /// Returns `None` if the enum contains an unknown value deserialized from
14423 /// the integer representation of enums.
14424 pub fn name(&self) -> std::option::Option<&str> {
14425 match self {
14426 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14427 Self::Active => std::option::Option::Some("ACTIVE"),
14428 Self::Creating => std::option::Option::Some("CREATING"),
14429 Self::Deleting => std::option::Option::Some("DELETING"),
14430 Self::UnknownValue(u) => u.0.name(),
14431 }
14432 }
14433 }
14434
14435 impl std::default::Default for State {
14436 fn default() -> Self {
14437 use std::convert::From;
14438 Self::from(0)
14439 }
14440 }
14441
14442 impl std::fmt::Display for State {
14443 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14444 wkt::internal::display_enum(f, self.name(), self.value())
14445 }
14446 }
14447
14448 impl std::convert::From<i32> for State {
14449 fn from(value: i32) -> Self {
14450 match value {
14451 0 => Self::Unspecified,
14452 1 => Self::Active,
14453 2 => Self::Creating,
14454 3 => Self::Deleting,
14455 _ => Self::UnknownValue(state::UnknownValue(
14456 wkt::internal::UnknownEnumValue::Integer(value),
14457 )),
14458 }
14459 }
14460 }
14461
14462 impl std::convert::From<&str> for State {
14463 fn from(value: &str) -> Self {
14464 use std::string::ToString;
14465 match value {
14466 "STATE_UNSPECIFIED" => Self::Unspecified,
14467 "ACTIVE" => Self::Active,
14468 "CREATING" => Self::Creating,
14469 "DELETING" => Self::Deleting,
14470 _ => Self::UnknownValue(state::UnknownValue(
14471 wkt::internal::UnknownEnumValue::String(value.to_string()),
14472 )),
14473 }
14474 }
14475 }
14476
14477 impl serde::ser::Serialize for State {
14478 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14479 where
14480 S: serde::Serializer,
14481 {
14482 match self {
14483 Self::Unspecified => serializer.serialize_i32(0),
14484 Self::Active => serializer.serialize_i32(1),
14485 Self::Creating => serializer.serialize_i32(2),
14486 Self::Deleting => serializer.serialize_i32(3),
14487 Self::UnknownValue(u) => u.0.serialize(serializer),
14488 }
14489 }
14490 }
14491
14492 impl<'de> serde::de::Deserialize<'de> for State {
14493 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14494 where
14495 D: serde::Deserializer<'de>,
14496 {
14497 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14498 ".google.cloud.networksecurity.v1.InterceptDeploymentGroup.State",
14499 ))
14500 }
14501 }
14502}
14503
14504/// Request message for ListInterceptDeploymentGroups.
14505#[derive(Clone, Default, PartialEq)]
14506#[non_exhaustive]
14507pub struct ListInterceptDeploymentGroupsRequest {
14508 /// Required. The parent, which owns this collection of deployment groups.
14509 /// Example: `projects/123456789/locations/global`.
14510 /// See <https://google.aip.dev/132> for more details.
14511 pub parent: std::string::String,
14512
14513 /// Optional. Requested page size. Server may return fewer items than
14514 /// requested. If unspecified, server will pick an appropriate default. See
14515 /// <https://google.aip.dev/158> for more details.
14516 pub page_size: i32,
14517
14518 /// Optional. A page token, received from a previous
14519 /// `ListInterceptDeploymentGroups` call. Provide this to retrieve the
14520 /// subsequent page. When paginating, all other parameters provided to
14521 /// `ListInterceptDeploymentGroups` must match the call that provided the page
14522 /// token. See <https://google.aip.dev/158> for more details.
14523 pub page_token: std::string::String,
14524
14525 /// Optional. Filter expression.
14526 /// See <https://google.aip.dev/160#filtering> for more details.
14527 pub filter: std::string::String,
14528
14529 /// Optional. Sort expression.
14530 /// See <https://google.aip.dev/132#ordering> for more details.
14531 pub order_by: std::string::String,
14532
14533 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14534}
14535
14536impl ListInterceptDeploymentGroupsRequest {
14537 pub fn new() -> Self {
14538 std::default::Default::default()
14539 }
14540
14541 /// Sets the value of [parent][crate::model::ListInterceptDeploymentGroupsRequest::parent].
14542 ///
14543 /// # Example
14544 /// ```ignore,no_run
14545 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14546 /// let x = ListInterceptDeploymentGroupsRequest::new().set_parent("example");
14547 /// ```
14548 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14549 self.parent = v.into();
14550 self
14551 }
14552
14553 /// Sets the value of [page_size][crate::model::ListInterceptDeploymentGroupsRequest::page_size].
14554 ///
14555 /// # Example
14556 /// ```ignore,no_run
14557 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14558 /// let x = ListInterceptDeploymentGroupsRequest::new().set_page_size(42);
14559 /// ```
14560 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14561 self.page_size = v.into();
14562 self
14563 }
14564
14565 /// Sets the value of [page_token][crate::model::ListInterceptDeploymentGroupsRequest::page_token].
14566 ///
14567 /// # Example
14568 /// ```ignore,no_run
14569 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14570 /// let x = ListInterceptDeploymentGroupsRequest::new().set_page_token("example");
14571 /// ```
14572 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14573 self.page_token = v.into();
14574 self
14575 }
14576
14577 /// Sets the value of [filter][crate::model::ListInterceptDeploymentGroupsRequest::filter].
14578 ///
14579 /// # Example
14580 /// ```ignore,no_run
14581 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14582 /// let x = ListInterceptDeploymentGroupsRequest::new().set_filter("example");
14583 /// ```
14584 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14585 self.filter = v.into();
14586 self
14587 }
14588
14589 /// Sets the value of [order_by][crate::model::ListInterceptDeploymentGroupsRequest::order_by].
14590 ///
14591 /// # Example
14592 /// ```ignore,no_run
14593 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsRequest;
14594 /// let x = ListInterceptDeploymentGroupsRequest::new().set_order_by("example");
14595 /// ```
14596 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14597 self.order_by = v.into();
14598 self
14599 }
14600}
14601
14602impl wkt::message::Message for ListInterceptDeploymentGroupsRequest {
14603 fn typename() -> &'static str {
14604 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest"
14605 }
14606}
14607
14608/// Response message for ListInterceptDeploymentGroups.
14609#[derive(Clone, Default, PartialEq)]
14610#[non_exhaustive]
14611pub struct ListInterceptDeploymentGroupsResponse {
14612 /// The deployment groups from the specified parent.
14613 pub intercept_deployment_groups: std::vec::Vec<crate::model::InterceptDeploymentGroup>,
14614
14615 /// A token that can be sent as `page_token` to retrieve the next page.
14616 /// If this field is omitted, there are no subsequent pages.
14617 /// See <https://google.aip.dev/158> for more details.
14618 pub next_page_token: std::string::String,
14619
14620 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14621}
14622
14623impl ListInterceptDeploymentGroupsResponse {
14624 pub fn new() -> Self {
14625 std::default::Default::default()
14626 }
14627
14628 /// Sets the value of [intercept_deployment_groups][crate::model::ListInterceptDeploymentGroupsResponse::intercept_deployment_groups].
14629 ///
14630 /// # Example
14631 /// ```ignore,no_run
14632 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsResponse;
14633 /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14634 /// let x = ListInterceptDeploymentGroupsResponse::new()
14635 /// .set_intercept_deployment_groups([
14636 /// InterceptDeploymentGroup::default()/* use setters */,
14637 /// InterceptDeploymentGroup::default()/* use (different) setters */,
14638 /// ]);
14639 /// ```
14640 pub fn set_intercept_deployment_groups<T, V>(mut self, v: T) -> Self
14641 where
14642 T: std::iter::IntoIterator<Item = V>,
14643 V: std::convert::Into<crate::model::InterceptDeploymentGroup>,
14644 {
14645 use std::iter::Iterator;
14646 self.intercept_deployment_groups = v.into_iter().map(|i| i.into()).collect();
14647 self
14648 }
14649
14650 /// Sets the value of [next_page_token][crate::model::ListInterceptDeploymentGroupsResponse::next_page_token].
14651 ///
14652 /// # Example
14653 /// ```ignore,no_run
14654 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentGroupsResponse;
14655 /// let x = ListInterceptDeploymentGroupsResponse::new().set_next_page_token("example");
14656 /// ```
14657 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14658 self.next_page_token = v.into();
14659 self
14660 }
14661}
14662
14663impl wkt::message::Message for ListInterceptDeploymentGroupsResponse {
14664 fn typename() -> &'static str {
14665 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse"
14666 }
14667}
14668
14669#[doc(hidden)]
14670impl google_cloud_gax::paginator::internal::PageableResponse
14671 for ListInterceptDeploymentGroupsResponse
14672{
14673 type PageItem = crate::model::InterceptDeploymentGroup;
14674
14675 fn items(self) -> std::vec::Vec<Self::PageItem> {
14676 self.intercept_deployment_groups
14677 }
14678
14679 fn next_page_token(&self) -> std::string::String {
14680 use std::clone::Clone;
14681 self.next_page_token.clone()
14682 }
14683}
14684
14685/// Request message for GetInterceptDeploymentGroup.
14686#[derive(Clone, Default, PartialEq)]
14687#[non_exhaustive]
14688pub struct GetInterceptDeploymentGroupRequest {
14689 /// Required. The name of the deployment group to retrieve.
14690 /// Format:
14691 /// projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group}
14692 pub name: std::string::String,
14693
14694 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14695}
14696
14697impl GetInterceptDeploymentGroupRequest {
14698 pub fn new() -> Self {
14699 std::default::Default::default()
14700 }
14701
14702 /// Sets the value of [name][crate::model::GetInterceptDeploymentGroupRequest::name].
14703 ///
14704 /// # Example
14705 /// ```ignore,no_run
14706 /// # use google_cloud_networksecurity_v1::model::GetInterceptDeploymentGroupRequest;
14707 /// let x = GetInterceptDeploymentGroupRequest::new().set_name("example");
14708 /// ```
14709 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14710 self.name = v.into();
14711 self
14712 }
14713}
14714
14715impl wkt::message::Message for GetInterceptDeploymentGroupRequest {
14716 fn typename() -> &'static str {
14717 "type.googleapis.com/google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest"
14718 }
14719}
14720
14721/// Request message for CreateInterceptDeploymentGroup.
14722#[derive(Clone, Default, PartialEq)]
14723#[non_exhaustive]
14724pub struct CreateInterceptDeploymentGroupRequest {
14725 /// Required. The parent resource where this deployment group will be created.
14726 /// Format: projects/{project}/locations/{location}
14727 pub parent: std::string::String,
14728
14729 /// Required. The ID to use for the new deployment group, which will become the
14730 /// final component of the deployment group's resource name.
14731 pub intercept_deployment_group_id: std::string::String,
14732
14733 /// Required. The deployment group to create.
14734 pub intercept_deployment_group: std::option::Option<crate::model::InterceptDeploymentGroup>,
14735
14736 /// Optional. A unique identifier for this request. Must be a UUID4.
14737 /// This request is only idempotent if a `request_id` is provided.
14738 /// See <https://google.aip.dev/155> for more details.
14739 pub request_id: std::string::String,
14740
14741 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14742}
14743
14744impl CreateInterceptDeploymentGroupRequest {
14745 pub fn new() -> Self {
14746 std::default::Default::default()
14747 }
14748
14749 /// Sets the value of [parent][crate::model::CreateInterceptDeploymentGroupRequest::parent].
14750 ///
14751 /// # Example
14752 /// ```ignore,no_run
14753 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
14754 /// let x = CreateInterceptDeploymentGroupRequest::new().set_parent("example");
14755 /// ```
14756 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14757 self.parent = v.into();
14758 self
14759 }
14760
14761 /// Sets the value of [intercept_deployment_group_id][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group_id].
14762 ///
14763 /// # Example
14764 /// ```ignore,no_run
14765 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
14766 /// let x = CreateInterceptDeploymentGroupRequest::new().set_intercept_deployment_group_id("example");
14767 /// ```
14768 pub fn set_intercept_deployment_group_id<T: std::convert::Into<std::string::String>>(
14769 mut self,
14770 v: T,
14771 ) -> Self {
14772 self.intercept_deployment_group_id = v.into();
14773 self
14774 }
14775
14776 /// Sets the value of [intercept_deployment_group][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group].
14777 ///
14778 /// # Example
14779 /// ```ignore,no_run
14780 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
14781 /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14782 /// let x = CreateInterceptDeploymentGroupRequest::new().set_intercept_deployment_group(InterceptDeploymentGroup::default()/* use setters */);
14783 /// ```
14784 pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
14785 where
14786 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
14787 {
14788 self.intercept_deployment_group = std::option::Option::Some(v.into());
14789 self
14790 }
14791
14792 /// Sets or clears the value of [intercept_deployment_group][crate::model::CreateInterceptDeploymentGroupRequest::intercept_deployment_group].
14793 ///
14794 /// # Example
14795 /// ```ignore,no_run
14796 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
14797 /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14798 /// let x = CreateInterceptDeploymentGroupRequest::new().set_or_clear_intercept_deployment_group(Some(InterceptDeploymentGroup::default()/* use setters */));
14799 /// let x = CreateInterceptDeploymentGroupRequest::new().set_or_clear_intercept_deployment_group(None::<InterceptDeploymentGroup>);
14800 /// ```
14801 pub fn set_or_clear_intercept_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
14802 where
14803 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
14804 {
14805 self.intercept_deployment_group = v.map(|x| x.into());
14806 self
14807 }
14808
14809 /// Sets the value of [request_id][crate::model::CreateInterceptDeploymentGroupRequest::request_id].
14810 ///
14811 /// # Example
14812 /// ```ignore,no_run
14813 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentGroupRequest;
14814 /// let x = CreateInterceptDeploymentGroupRequest::new().set_request_id("example");
14815 /// ```
14816 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14817 self.request_id = v.into();
14818 self
14819 }
14820}
14821
14822impl wkt::message::Message for CreateInterceptDeploymentGroupRequest {
14823 fn typename() -> &'static str {
14824 "type.googleapis.com/google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest"
14825 }
14826}
14827
14828/// Request message for UpdateInterceptDeploymentGroup.
14829#[derive(Clone, Default, PartialEq)]
14830#[non_exhaustive]
14831pub struct UpdateInterceptDeploymentGroupRequest {
14832 /// Optional. The list of fields to update.
14833 /// Fields are specified relative to the deployment group
14834 /// (e.g. `description`; *not*
14835 /// `intercept_deployment_group.description`). See
14836 /// <https://google.aip.dev/161> for more details.
14837 pub update_mask: std::option::Option<wkt::FieldMask>,
14838
14839 /// Required. The deployment group to update.
14840 pub intercept_deployment_group: std::option::Option<crate::model::InterceptDeploymentGroup>,
14841
14842 /// Optional. A unique identifier for this request. Must be a UUID4.
14843 /// This request is only idempotent if a `request_id` is provided.
14844 /// See <https://google.aip.dev/155> for more details.
14845 pub request_id: std::string::String,
14846
14847 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14848}
14849
14850impl UpdateInterceptDeploymentGroupRequest {
14851 pub fn new() -> Self {
14852 std::default::Default::default()
14853 }
14854
14855 /// Sets the value of [update_mask][crate::model::UpdateInterceptDeploymentGroupRequest::update_mask].
14856 ///
14857 /// # Example
14858 /// ```ignore,no_run
14859 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
14860 /// use wkt::FieldMask;
14861 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
14862 /// ```
14863 pub fn set_update_mask<T>(mut self, v: T) -> Self
14864 where
14865 T: std::convert::Into<wkt::FieldMask>,
14866 {
14867 self.update_mask = std::option::Option::Some(v.into());
14868 self
14869 }
14870
14871 /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptDeploymentGroupRequest::update_mask].
14872 ///
14873 /// # Example
14874 /// ```ignore,no_run
14875 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
14876 /// use wkt::FieldMask;
14877 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
14878 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
14879 /// ```
14880 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14881 where
14882 T: std::convert::Into<wkt::FieldMask>,
14883 {
14884 self.update_mask = v.map(|x| x.into());
14885 self
14886 }
14887
14888 /// Sets the value of [intercept_deployment_group][crate::model::UpdateInterceptDeploymentGroupRequest::intercept_deployment_group].
14889 ///
14890 /// # Example
14891 /// ```ignore,no_run
14892 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
14893 /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14894 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_intercept_deployment_group(InterceptDeploymentGroup::default()/* use setters */);
14895 /// ```
14896 pub fn set_intercept_deployment_group<T>(mut self, v: T) -> Self
14897 where
14898 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
14899 {
14900 self.intercept_deployment_group = std::option::Option::Some(v.into());
14901 self
14902 }
14903
14904 /// Sets or clears the value of [intercept_deployment_group][crate::model::UpdateInterceptDeploymentGroupRequest::intercept_deployment_group].
14905 ///
14906 /// # Example
14907 /// ```ignore,no_run
14908 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
14909 /// use google_cloud_networksecurity_v1::model::InterceptDeploymentGroup;
14910 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_or_clear_intercept_deployment_group(Some(InterceptDeploymentGroup::default()/* use setters */));
14911 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_or_clear_intercept_deployment_group(None::<InterceptDeploymentGroup>);
14912 /// ```
14913 pub fn set_or_clear_intercept_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
14914 where
14915 T: std::convert::Into<crate::model::InterceptDeploymentGroup>,
14916 {
14917 self.intercept_deployment_group = v.map(|x| x.into());
14918 self
14919 }
14920
14921 /// Sets the value of [request_id][crate::model::UpdateInterceptDeploymentGroupRequest::request_id].
14922 ///
14923 /// # Example
14924 /// ```ignore,no_run
14925 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentGroupRequest;
14926 /// let x = UpdateInterceptDeploymentGroupRequest::new().set_request_id("example");
14927 /// ```
14928 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14929 self.request_id = v.into();
14930 self
14931 }
14932}
14933
14934impl wkt::message::Message for UpdateInterceptDeploymentGroupRequest {
14935 fn typename() -> &'static str {
14936 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest"
14937 }
14938}
14939
14940/// Request message for DeleteInterceptDeploymentGroup.
14941#[derive(Clone, Default, PartialEq)]
14942#[non_exhaustive]
14943pub struct DeleteInterceptDeploymentGroupRequest {
14944 /// Required. The deployment group to delete.
14945 pub name: std::string::String,
14946
14947 /// Optional. A unique identifier for this request. Must be a UUID4.
14948 /// This request is only idempotent if a `request_id` is provided.
14949 /// See <https://google.aip.dev/155> for more details.
14950 pub request_id: std::string::String,
14951
14952 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14953}
14954
14955impl DeleteInterceptDeploymentGroupRequest {
14956 pub fn new() -> Self {
14957 std::default::Default::default()
14958 }
14959
14960 /// Sets the value of [name][crate::model::DeleteInterceptDeploymentGroupRequest::name].
14961 ///
14962 /// # Example
14963 /// ```ignore,no_run
14964 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptDeploymentGroupRequest;
14965 /// let x = DeleteInterceptDeploymentGroupRequest::new().set_name("example");
14966 /// ```
14967 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14968 self.name = v.into();
14969 self
14970 }
14971
14972 /// Sets the value of [request_id][crate::model::DeleteInterceptDeploymentGroupRequest::request_id].
14973 ///
14974 /// # Example
14975 /// ```ignore,no_run
14976 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptDeploymentGroupRequest;
14977 /// let x = DeleteInterceptDeploymentGroupRequest::new().set_request_id("example");
14978 /// ```
14979 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14980 self.request_id = v.into();
14981 self
14982 }
14983}
14984
14985impl wkt::message::Message for DeleteInterceptDeploymentGroupRequest {
14986 fn typename() -> &'static str {
14987 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest"
14988 }
14989}
14990
14991/// A deployment represents a zonal intercept backend ready to accept
14992/// GENEVE-encapsulated traffic, e.g. a zonal instance group fronted by an
14993/// internal passthrough load balancer. Deployments are always part of a
14994/// global deployment group which represents a global intercept service.
14995#[derive(Clone, Default, PartialEq)]
14996#[non_exhaustive]
14997pub struct InterceptDeployment {
14998 /// Immutable. Identifier. The resource name of this deployment, for example:
14999 /// `projects/123456789/locations/us-central1-a/interceptDeployments/my-dep`.
15000 /// See <https://google.aip.dev/122> for more details.
15001 pub name: std::string::String,
15002
15003 /// Output only. The timestamp when the resource was created.
15004 /// See <https://google.aip.dev/148#timestamps>.
15005 pub create_time: std::option::Option<wkt::Timestamp>,
15006
15007 /// Output only. The timestamp when the resource was most recently updated.
15008 /// See <https://google.aip.dev/148#timestamps>.
15009 pub update_time: std::option::Option<wkt::Timestamp>,
15010
15011 /// Optional. Labels are key/value pairs that help to organize and filter
15012 /// resources.
15013 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
15014
15015 /// Required. Immutable. The regional forwarding rule that fronts the
15016 /// interceptors, for example:
15017 /// `projects/123456789/regions/us-central1/forwardingRules/my-rule`.
15018 /// See <https://google.aip.dev/124>.
15019 pub forwarding_rule: std::string::String,
15020
15021 /// Required. Immutable. The deployment group that this deployment is a part
15022 /// of, for example:
15023 /// `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`.
15024 /// See <https://google.aip.dev/124>.
15025 pub intercept_deployment_group: std::string::String,
15026
15027 /// Output only. The current state of the deployment.
15028 /// See <https://google.aip.dev/216>.
15029 pub state: crate::model::intercept_deployment::State,
15030
15031 /// Output only. The current state of the resource does not match the user's
15032 /// intended state, and the system is working to reconcile them. This part of
15033 /// the normal operation (e.g. linking a new association to the parent group).
15034 /// See <https://google.aip.dev/128>.
15035 pub reconciling: bool,
15036
15037 /// Optional. User-provided description of the deployment.
15038 /// Used as additional context for the deployment.
15039 pub description: std::string::String,
15040
15041 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15042}
15043
15044impl InterceptDeployment {
15045 pub fn new() -> Self {
15046 std::default::Default::default()
15047 }
15048
15049 /// Sets the value of [name][crate::model::InterceptDeployment::name].
15050 ///
15051 /// # Example
15052 /// ```ignore,no_run
15053 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15054 /// let x = InterceptDeployment::new().set_name("example");
15055 /// ```
15056 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15057 self.name = v.into();
15058 self
15059 }
15060
15061 /// Sets the value of [create_time][crate::model::InterceptDeployment::create_time].
15062 ///
15063 /// # Example
15064 /// ```ignore,no_run
15065 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15066 /// use wkt::Timestamp;
15067 /// let x = InterceptDeployment::new().set_create_time(Timestamp::default()/* use setters */);
15068 /// ```
15069 pub fn set_create_time<T>(mut self, v: T) -> Self
15070 where
15071 T: std::convert::Into<wkt::Timestamp>,
15072 {
15073 self.create_time = std::option::Option::Some(v.into());
15074 self
15075 }
15076
15077 /// Sets or clears the value of [create_time][crate::model::InterceptDeployment::create_time].
15078 ///
15079 /// # Example
15080 /// ```ignore,no_run
15081 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15082 /// use wkt::Timestamp;
15083 /// let x = InterceptDeployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15084 /// let x = InterceptDeployment::new().set_or_clear_create_time(None::<Timestamp>);
15085 /// ```
15086 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15087 where
15088 T: std::convert::Into<wkt::Timestamp>,
15089 {
15090 self.create_time = v.map(|x| x.into());
15091 self
15092 }
15093
15094 /// Sets the value of [update_time][crate::model::InterceptDeployment::update_time].
15095 ///
15096 /// # Example
15097 /// ```ignore,no_run
15098 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15099 /// use wkt::Timestamp;
15100 /// let x = InterceptDeployment::new().set_update_time(Timestamp::default()/* use setters */);
15101 /// ```
15102 pub fn set_update_time<T>(mut self, v: T) -> Self
15103 where
15104 T: std::convert::Into<wkt::Timestamp>,
15105 {
15106 self.update_time = std::option::Option::Some(v.into());
15107 self
15108 }
15109
15110 /// Sets or clears the value of [update_time][crate::model::InterceptDeployment::update_time].
15111 ///
15112 /// # Example
15113 /// ```ignore,no_run
15114 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15115 /// use wkt::Timestamp;
15116 /// let x = InterceptDeployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
15117 /// let x = InterceptDeployment::new().set_or_clear_update_time(None::<Timestamp>);
15118 /// ```
15119 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15120 where
15121 T: std::convert::Into<wkt::Timestamp>,
15122 {
15123 self.update_time = v.map(|x| x.into());
15124 self
15125 }
15126
15127 /// Sets the value of [labels][crate::model::InterceptDeployment::labels].
15128 ///
15129 /// # Example
15130 /// ```ignore,no_run
15131 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15132 /// let x = InterceptDeployment::new().set_labels([
15133 /// ("key0", "abc"),
15134 /// ("key1", "xyz"),
15135 /// ]);
15136 /// ```
15137 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
15138 where
15139 T: std::iter::IntoIterator<Item = (K, V)>,
15140 K: std::convert::Into<std::string::String>,
15141 V: std::convert::Into<std::string::String>,
15142 {
15143 use std::iter::Iterator;
15144 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15145 self
15146 }
15147
15148 /// Sets the value of [forwarding_rule][crate::model::InterceptDeployment::forwarding_rule].
15149 ///
15150 /// # Example
15151 /// ```ignore,no_run
15152 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15153 /// let x = InterceptDeployment::new().set_forwarding_rule("example");
15154 /// ```
15155 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15156 self.forwarding_rule = v.into();
15157 self
15158 }
15159
15160 /// Sets the value of [intercept_deployment_group][crate::model::InterceptDeployment::intercept_deployment_group].
15161 ///
15162 /// # Example
15163 /// ```ignore,no_run
15164 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15165 /// let x = InterceptDeployment::new().set_intercept_deployment_group("example");
15166 /// ```
15167 pub fn set_intercept_deployment_group<T: std::convert::Into<std::string::String>>(
15168 mut self,
15169 v: T,
15170 ) -> Self {
15171 self.intercept_deployment_group = v.into();
15172 self
15173 }
15174
15175 /// Sets the value of [state][crate::model::InterceptDeployment::state].
15176 ///
15177 /// # Example
15178 /// ```ignore,no_run
15179 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15180 /// use google_cloud_networksecurity_v1::model::intercept_deployment::State;
15181 /// let x0 = InterceptDeployment::new().set_state(State::Active);
15182 /// let x1 = InterceptDeployment::new().set_state(State::Creating);
15183 /// let x2 = InterceptDeployment::new().set_state(State::Deleting);
15184 /// ```
15185 pub fn set_state<T: std::convert::Into<crate::model::intercept_deployment::State>>(
15186 mut self,
15187 v: T,
15188 ) -> Self {
15189 self.state = v.into();
15190 self
15191 }
15192
15193 /// Sets the value of [reconciling][crate::model::InterceptDeployment::reconciling].
15194 ///
15195 /// # Example
15196 /// ```ignore,no_run
15197 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15198 /// let x = InterceptDeployment::new().set_reconciling(true);
15199 /// ```
15200 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15201 self.reconciling = v.into();
15202 self
15203 }
15204
15205 /// Sets the value of [description][crate::model::InterceptDeployment::description].
15206 ///
15207 /// # Example
15208 /// ```ignore,no_run
15209 /// # use google_cloud_networksecurity_v1::model::InterceptDeployment;
15210 /// let x = InterceptDeployment::new().set_description("example");
15211 /// ```
15212 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15213 self.description = v.into();
15214 self
15215 }
15216}
15217
15218impl wkt::message::Message for InterceptDeployment {
15219 fn typename() -> &'static str {
15220 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptDeployment"
15221 }
15222}
15223
15224/// Defines additional types related to [InterceptDeployment].
15225pub mod intercept_deployment {
15226 #[allow(unused_imports)]
15227 use super::*;
15228
15229 /// The current state of the deployment.
15230 ///
15231 /// # Working with unknown values
15232 ///
15233 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15234 /// additional enum variants at any time. Adding new variants is not considered
15235 /// a breaking change. Applications should write their code in anticipation of:
15236 ///
15237 /// - New values appearing in future releases of the client library, **and**
15238 /// - New values received dynamically, without application changes.
15239 ///
15240 /// Please consult the [Working with enums] section in the user guide for some
15241 /// guidelines.
15242 ///
15243 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15244 #[derive(Clone, Debug, PartialEq)]
15245 #[non_exhaustive]
15246 pub enum State {
15247 /// State not set (this is not a valid state).
15248 Unspecified,
15249 /// The deployment is ready and in sync with the parent group.
15250 Active,
15251 /// The deployment is being created.
15252 Creating,
15253 /// The deployment is being deleted.
15254 Deleting,
15255 /// The deployment is out of sync with the parent group.
15256 /// In most cases, this is a result of a transient issue within the system
15257 /// (e.g. a delayed data-path config) and the system is expected to recover
15258 /// automatically. See the parent deployment group's state for more details.
15259 OutOfSync,
15260 /// An attempt to delete the deployment has failed. This is a terminal state
15261 /// and the deployment is not expected to recover. The only permitted
15262 /// operation is to retry deleting the deployment.
15263 DeleteFailed,
15264 /// If set, the enum was initialized with an unknown value.
15265 ///
15266 /// Applications can examine the value using [State::value] or
15267 /// [State::name].
15268 UnknownValue(state::UnknownValue),
15269 }
15270
15271 #[doc(hidden)]
15272 pub mod state {
15273 #[allow(unused_imports)]
15274 use super::*;
15275 #[derive(Clone, Debug, PartialEq)]
15276 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15277 }
15278
15279 impl State {
15280 /// Gets the enum value.
15281 ///
15282 /// Returns `None` if the enum contains an unknown value deserialized from
15283 /// the string representation of enums.
15284 pub fn value(&self) -> std::option::Option<i32> {
15285 match self {
15286 Self::Unspecified => std::option::Option::Some(0),
15287 Self::Active => std::option::Option::Some(1),
15288 Self::Creating => std::option::Option::Some(2),
15289 Self::Deleting => std::option::Option::Some(3),
15290 Self::OutOfSync => std::option::Option::Some(4),
15291 Self::DeleteFailed => std::option::Option::Some(5),
15292 Self::UnknownValue(u) => u.0.value(),
15293 }
15294 }
15295
15296 /// Gets the enum value as a string.
15297 ///
15298 /// Returns `None` if the enum contains an unknown value deserialized from
15299 /// the integer representation of enums.
15300 pub fn name(&self) -> std::option::Option<&str> {
15301 match self {
15302 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15303 Self::Active => std::option::Option::Some("ACTIVE"),
15304 Self::Creating => std::option::Option::Some("CREATING"),
15305 Self::Deleting => std::option::Option::Some("DELETING"),
15306 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
15307 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
15308 Self::UnknownValue(u) => u.0.name(),
15309 }
15310 }
15311 }
15312
15313 impl std::default::Default for State {
15314 fn default() -> Self {
15315 use std::convert::From;
15316 Self::from(0)
15317 }
15318 }
15319
15320 impl std::fmt::Display for State {
15321 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15322 wkt::internal::display_enum(f, self.name(), self.value())
15323 }
15324 }
15325
15326 impl std::convert::From<i32> for State {
15327 fn from(value: i32) -> Self {
15328 match value {
15329 0 => Self::Unspecified,
15330 1 => Self::Active,
15331 2 => Self::Creating,
15332 3 => Self::Deleting,
15333 4 => Self::OutOfSync,
15334 5 => Self::DeleteFailed,
15335 _ => Self::UnknownValue(state::UnknownValue(
15336 wkt::internal::UnknownEnumValue::Integer(value),
15337 )),
15338 }
15339 }
15340 }
15341
15342 impl std::convert::From<&str> for State {
15343 fn from(value: &str) -> Self {
15344 use std::string::ToString;
15345 match value {
15346 "STATE_UNSPECIFIED" => Self::Unspecified,
15347 "ACTIVE" => Self::Active,
15348 "CREATING" => Self::Creating,
15349 "DELETING" => Self::Deleting,
15350 "OUT_OF_SYNC" => Self::OutOfSync,
15351 "DELETE_FAILED" => Self::DeleteFailed,
15352 _ => Self::UnknownValue(state::UnknownValue(
15353 wkt::internal::UnknownEnumValue::String(value.to_string()),
15354 )),
15355 }
15356 }
15357 }
15358
15359 impl serde::ser::Serialize for State {
15360 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15361 where
15362 S: serde::Serializer,
15363 {
15364 match self {
15365 Self::Unspecified => serializer.serialize_i32(0),
15366 Self::Active => serializer.serialize_i32(1),
15367 Self::Creating => serializer.serialize_i32(2),
15368 Self::Deleting => serializer.serialize_i32(3),
15369 Self::OutOfSync => serializer.serialize_i32(4),
15370 Self::DeleteFailed => serializer.serialize_i32(5),
15371 Self::UnknownValue(u) => u.0.serialize(serializer),
15372 }
15373 }
15374 }
15375
15376 impl<'de> serde::de::Deserialize<'de> for State {
15377 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15378 where
15379 D: serde::Deserializer<'de>,
15380 {
15381 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15382 ".google.cloud.networksecurity.v1.InterceptDeployment.State",
15383 ))
15384 }
15385 }
15386}
15387
15388/// Request message for ListInterceptDeployments.
15389#[derive(Clone, Default, PartialEq)]
15390#[non_exhaustive]
15391pub struct ListInterceptDeploymentsRequest {
15392 /// Required. The parent, which owns this collection of deployments.
15393 /// Example: `projects/123456789/locations/us-central1-a`.
15394 /// See <https://google.aip.dev/132> for more details.
15395 pub parent: std::string::String,
15396
15397 /// Optional. Requested page size. Server may return fewer items than
15398 /// requested. If unspecified, server will pick an appropriate default. See
15399 /// <https://google.aip.dev/158> for more details.
15400 pub page_size: i32,
15401
15402 /// Optional. A page token, received from a previous `ListInterceptDeployments`
15403 /// call. Provide this to retrieve the subsequent page. When paginating, all
15404 /// other parameters provided to `ListInterceptDeployments` must match the call
15405 /// that provided the page token. See <https://google.aip.dev/158> for more
15406 /// details.
15407 pub page_token: std::string::String,
15408
15409 /// Optional. Filter expression.
15410 /// See <https://google.aip.dev/160#filtering> for more details.
15411 pub filter: std::string::String,
15412
15413 /// Optional. Sort expression.
15414 /// See <https://google.aip.dev/132#ordering> for more details.
15415 pub order_by: std::string::String,
15416
15417 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15418}
15419
15420impl ListInterceptDeploymentsRequest {
15421 pub fn new() -> Self {
15422 std::default::Default::default()
15423 }
15424
15425 /// Sets the value of [parent][crate::model::ListInterceptDeploymentsRequest::parent].
15426 ///
15427 /// # Example
15428 /// ```ignore,no_run
15429 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15430 /// let x = ListInterceptDeploymentsRequest::new().set_parent("example");
15431 /// ```
15432 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15433 self.parent = v.into();
15434 self
15435 }
15436
15437 /// Sets the value of [page_size][crate::model::ListInterceptDeploymentsRequest::page_size].
15438 ///
15439 /// # Example
15440 /// ```ignore,no_run
15441 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15442 /// let x = ListInterceptDeploymentsRequest::new().set_page_size(42);
15443 /// ```
15444 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15445 self.page_size = v.into();
15446 self
15447 }
15448
15449 /// Sets the value of [page_token][crate::model::ListInterceptDeploymentsRequest::page_token].
15450 ///
15451 /// # Example
15452 /// ```ignore,no_run
15453 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15454 /// let x = ListInterceptDeploymentsRequest::new().set_page_token("example");
15455 /// ```
15456 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15457 self.page_token = v.into();
15458 self
15459 }
15460
15461 /// Sets the value of [filter][crate::model::ListInterceptDeploymentsRequest::filter].
15462 ///
15463 /// # Example
15464 /// ```ignore,no_run
15465 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15466 /// let x = ListInterceptDeploymentsRequest::new().set_filter("example");
15467 /// ```
15468 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15469 self.filter = v.into();
15470 self
15471 }
15472
15473 /// Sets the value of [order_by][crate::model::ListInterceptDeploymentsRequest::order_by].
15474 ///
15475 /// # Example
15476 /// ```ignore,no_run
15477 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsRequest;
15478 /// let x = ListInterceptDeploymentsRequest::new().set_order_by("example");
15479 /// ```
15480 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15481 self.order_by = v.into();
15482 self
15483 }
15484}
15485
15486impl wkt::message::Message for ListInterceptDeploymentsRequest {
15487 fn typename() -> &'static str {
15488 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest"
15489 }
15490}
15491
15492/// Response message for ListInterceptDeployments.
15493#[derive(Clone, Default, PartialEq)]
15494#[non_exhaustive]
15495pub struct ListInterceptDeploymentsResponse {
15496 /// The deployments from the specified parent.
15497 pub intercept_deployments: std::vec::Vec<crate::model::InterceptDeployment>,
15498
15499 /// A token that can be sent as `page_token` to retrieve the next page.
15500 /// If this field is omitted, there are no subsequent pages.
15501 /// See <https://google.aip.dev/158> for more details.
15502 pub next_page_token: std::string::String,
15503
15504 /// Locations that could not be reached.
15505 pub unreachable: std::vec::Vec<std::string::String>,
15506
15507 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15508}
15509
15510impl ListInterceptDeploymentsResponse {
15511 pub fn new() -> Self {
15512 std::default::Default::default()
15513 }
15514
15515 /// Sets the value of [intercept_deployments][crate::model::ListInterceptDeploymentsResponse::intercept_deployments].
15516 ///
15517 /// # Example
15518 /// ```ignore,no_run
15519 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsResponse;
15520 /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
15521 /// let x = ListInterceptDeploymentsResponse::new()
15522 /// .set_intercept_deployments([
15523 /// InterceptDeployment::default()/* use setters */,
15524 /// InterceptDeployment::default()/* use (different) setters */,
15525 /// ]);
15526 /// ```
15527 pub fn set_intercept_deployments<T, V>(mut self, v: T) -> Self
15528 where
15529 T: std::iter::IntoIterator<Item = V>,
15530 V: std::convert::Into<crate::model::InterceptDeployment>,
15531 {
15532 use std::iter::Iterator;
15533 self.intercept_deployments = v.into_iter().map(|i| i.into()).collect();
15534 self
15535 }
15536
15537 /// Sets the value of [next_page_token][crate::model::ListInterceptDeploymentsResponse::next_page_token].
15538 ///
15539 /// # Example
15540 /// ```ignore,no_run
15541 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsResponse;
15542 /// let x = ListInterceptDeploymentsResponse::new().set_next_page_token("example");
15543 /// ```
15544 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15545 self.next_page_token = v.into();
15546 self
15547 }
15548
15549 /// Sets the value of [unreachable][crate::model::ListInterceptDeploymentsResponse::unreachable].
15550 ///
15551 /// # Example
15552 /// ```ignore,no_run
15553 /// # use google_cloud_networksecurity_v1::model::ListInterceptDeploymentsResponse;
15554 /// let x = ListInterceptDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
15555 /// ```
15556 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
15557 where
15558 T: std::iter::IntoIterator<Item = V>,
15559 V: std::convert::Into<std::string::String>,
15560 {
15561 use std::iter::Iterator;
15562 self.unreachable = v.into_iter().map(|i| i.into()).collect();
15563 self
15564 }
15565}
15566
15567impl wkt::message::Message for ListInterceptDeploymentsResponse {
15568 fn typename() -> &'static str {
15569 "type.googleapis.com/google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse"
15570 }
15571}
15572
15573#[doc(hidden)]
15574impl google_cloud_gax::paginator::internal::PageableResponse for ListInterceptDeploymentsResponse {
15575 type PageItem = crate::model::InterceptDeployment;
15576
15577 fn items(self) -> std::vec::Vec<Self::PageItem> {
15578 self.intercept_deployments
15579 }
15580
15581 fn next_page_token(&self) -> std::string::String {
15582 use std::clone::Clone;
15583 self.next_page_token.clone()
15584 }
15585}
15586
15587/// Request message for GetInterceptDeployment.
15588#[derive(Clone, Default, PartialEq)]
15589#[non_exhaustive]
15590pub struct GetInterceptDeploymentRequest {
15591 /// Required. The name of the deployment to retrieve.
15592 /// Format:
15593 /// projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}
15594 pub name: std::string::String,
15595
15596 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15597}
15598
15599impl GetInterceptDeploymentRequest {
15600 pub fn new() -> Self {
15601 std::default::Default::default()
15602 }
15603
15604 /// Sets the value of [name][crate::model::GetInterceptDeploymentRequest::name].
15605 ///
15606 /// # Example
15607 /// ```ignore,no_run
15608 /// # use google_cloud_networksecurity_v1::model::GetInterceptDeploymentRequest;
15609 /// let x = GetInterceptDeploymentRequest::new().set_name("example");
15610 /// ```
15611 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15612 self.name = v.into();
15613 self
15614 }
15615}
15616
15617impl wkt::message::Message for GetInterceptDeploymentRequest {
15618 fn typename() -> &'static str {
15619 "type.googleapis.com/google.cloud.networksecurity.v1.GetInterceptDeploymentRequest"
15620 }
15621}
15622
15623/// Request message for CreateInterceptDeployment.
15624#[derive(Clone, Default, PartialEq)]
15625#[non_exhaustive]
15626pub struct CreateInterceptDeploymentRequest {
15627 /// Required. The parent resource where this deployment will be created.
15628 /// Format: projects/{project}/locations/{location}
15629 pub parent: std::string::String,
15630
15631 /// Required. The ID to use for the new deployment, which will become the final
15632 /// component of the deployment's resource name.
15633 pub intercept_deployment_id: std::string::String,
15634
15635 /// Required. The deployment to create.
15636 pub intercept_deployment: std::option::Option<crate::model::InterceptDeployment>,
15637
15638 /// Optional. A unique identifier for this request. Must be a UUID4.
15639 /// This request is only idempotent if a `request_id` is provided.
15640 /// See <https://google.aip.dev/155> for more details.
15641 pub request_id: std::string::String,
15642
15643 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15644}
15645
15646impl CreateInterceptDeploymentRequest {
15647 pub fn new() -> Self {
15648 std::default::Default::default()
15649 }
15650
15651 /// Sets the value of [parent][crate::model::CreateInterceptDeploymentRequest::parent].
15652 ///
15653 /// # Example
15654 /// ```ignore,no_run
15655 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
15656 /// let x = CreateInterceptDeploymentRequest::new().set_parent("example");
15657 /// ```
15658 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15659 self.parent = v.into();
15660 self
15661 }
15662
15663 /// Sets the value of [intercept_deployment_id][crate::model::CreateInterceptDeploymentRequest::intercept_deployment_id].
15664 ///
15665 /// # Example
15666 /// ```ignore,no_run
15667 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
15668 /// let x = CreateInterceptDeploymentRequest::new().set_intercept_deployment_id("example");
15669 /// ```
15670 pub fn set_intercept_deployment_id<T: std::convert::Into<std::string::String>>(
15671 mut self,
15672 v: T,
15673 ) -> Self {
15674 self.intercept_deployment_id = v.into();
15675 self
15676 }
15677
15678 /// Sets the value of [intercept_deployment][crate::model::CreateInterceptDeploymentRequest::intercept_deployment].
15679 ///
15680 /// # Example
15681 /// ```ignore,no_run
15682 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
15683 /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
15684 /// let x = CreateInterceptDeploymentRequest::new().set_intercept_deployment(InterceptDeployment::default()/* use setters */);
15685 /// ```
15686 pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
15687 where
15688 T: std::convert::Into<crate::model::InterceptDeployment>,
15689 {
15690 self.intercept_deployment = std::option::Option::Some(v.into());
15691 self
15692 }
15693
15694 /// Sets or clears the value of [intercept_deployment][crate::model::CreateInterceptDeploymentRequest::intercept_deployment].
15695 ///
15696 /// # Example
15697 /// ```ignore,no_run
15698 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
15699 /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
15700 /// let x = CreateInterceptDeploymentRequest::new().set_or_clear_intercept_deployment(Some(InterceptDeployment::default()/* use setters */));
15701 /// let x = CreateInterceptDeploymentRequest::new().set_or_clear_intercept_deployment(None::<InterceptDeployment>);
15702 /// ```
15703 pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
15704 where
15705 T: std::convert::Into<crate::model::InterceptDeployment>,
15706 {
15707 self.intercept_deployment = v.map(|x| x.into());
15708 self
15709 }
15710
15711 /// Sets the value of [request_id][crate::model::CreateInterceptDeploymentRequest::request_id].
15712 ///
15713 /// # Example
15714 /// ```ignore,no_run
15715 /// # use google_cloud_networksecurity_v1::model::CreateInterceptDeploymentRequest;
15716 /// let x = CreateInterceptDeploymentRequest::new().set_request_id("example");
15717 /// ```
15718 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15719 self.request_id = v.into();
15720 self
15721 }
15722}
15723
15724impl wkt::message::Message for CreateInterceptDeploymentRequest {
15725 fn typename() -> &'static str {
15726 "type.googleapis.com/google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest"
15727 }
15728}
15729
15730/// Request message for UpdateInterceptDeployment.
15731#[derive(Clone, Default, PartialEq)]
15732#[non_exhaustive]
15733pub struct UpdateInterceptDeploymentRequest {
15734 /// Optional. The list of fields to update.
15735 /// Fields are specified relative to the deployment
15736 /// (e.g. `description`; *not* `intercept_deployment.description`).
15737 /// See <https://google.aip.dev/161> for more details.
15738 pub update_mask: std::option::Option<wkt::FieldMask>,
15739
15740 /// Required. The deployment to update.
15741 pub intercept_deployment: std::option::Option<crate::model::InterceptDeployment>,
15742
15743 /// Optional. A unique identifier for this request. Must be a UUID4.
15744 /// This request is only idempotent if a `request_id` is provided.
15745 /// See <https://google.aip.dev/155> for more details.
15746 pub request_id: std::string::String,
15747
15748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15749}
15750
15751impl UpdateInterceptDeploymentRequest {
15752 pub fn new() -> Self {
15753 std::default::Default::default()
15754 }
15755
15756 /// Sets the value of [update_mask][crate::model::UpdateInterceptDeploymentRequest::update_mask].
15757 ///
15758 /// # Example
15759 /// ```ignore,no_run
15760 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
15761 /// use wkt::FieldMask;
15762 /// let x = UpdateInterceptDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
15763 /// ```
15764 pub fn set_update_mask<T>(mut self, v: T) -> Self
15765 where
15766 T: std::convert::Into<wkt::FieldMask>,
15767 {
15768 self.update_mask = std::option::Option::Some(v.into());
15769 self
15770 }
15771
15772 /// Sets or clears the value of [update_mask][crate::model::UpdateInterceptDeploymentRequest::update_mask].
15773 ///
15774 /// # Example
15775 /// ```ignore,no_run
15776 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
15777 /// use wkt::FieldMask;
15778 /// let x = UpdateInterceptDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
15779 /// let x = UpdateInterceptDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
15780 /// ```
15781 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15782 where
15783 T: std::convert::Into<wkt::FieldMask>,
15784 {
15785 self.update_mask = v.map(|x| x.into());
15786 self
15787 }
15788
15789 /// Sets the value of [intercept_deployment][crate::model::UpdateInterceptDeploymentRequest::intercept_deployment].
15790 ///
15791 /// # Example
15792 /// ```ignore,no_run
15793 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
15794 /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
15795 /// let x = UpdateInterceptDeploymentRequest::new().set_intercept_deployment(InterceptDeployment::default()/* use setters */);
15796 /// ```
15797 pub fn set_intercept_deployment<T>(mut self, v: T) -> Self
15798 where
15799 T: std::convert::Into<crate::model::InterceptDeployment>,
15800 {
15801 self.intercept_deployment = std::option::Option::Some(v.into());
15802 self
15803 }
15804
15805 /// Sets or clears the value of [intercept_deployment][crate::model::UpdateInterceptDeploymentRequest::intercept_deployment].
15806 ///
15807 /// # Example
15808 /// ```ignore,no_run
15809 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
15810 /// use google_cloud_networksecurity_v1::model::InterceptDeployment;
15811 /// let x = UpdateInterceptDeploymentRequest::new().set_or_clear_intercept_deployment(Some(InterceptDeployment::default()/* use setters */));
15812 /// let x = UpdateInterceptDeploymentRequest::new().set_or_clear_intercept_deployment(None::<InterceptDeployment>);
15813 /// ```
15814 pub fn set_or_clear_intercept_deployment<T>(mut self, v: std::option::Option<T>) -> Self
15815 where
15816 T: std::convert::Into<crate::model::InterceptDeployment>,
15817 {
15818 self.intercept_deployment = v.map(|x| x.into());
15819 self
15820 }
15821
15822 /// Sets the value of [request_id][crate::model::UpdateInterceptDeploymentRequest::request_id].
15823 ///
15824 /// # Example
15825 /// ```ignore,no_run
15826 /// # use google_cloud_networksecurity_v1::model::UpdateInterceptDeploymentRequest;
15827 /// let x = UpdateInterceptDeploymentRequest::new().set_request_id("example");
15828 /// ```
15829 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15830 self.request_id = v.into();
15831 self
15832 }
15833}
15834
15835impl wkt::message::Message for UpdateInterceptDeploymentRequest {
15836 fn typename() -> &'static str {
15837 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest"
15838 }
15839}
15840
15841/// Request message for DeleteInterceptDeployment.
15842#[derive(Clone, Default, PartialEq)]
15843#[non_exhaustive]
15844pub struct DeleteInterceptDeploymentRequest {
15845 /// Required. Name of the resource
15846 pub name: std::string::String,
15847
15848 /// Optional. A unique identifier for this request. Must be a UUID4.
15849 /// This request is only idempotent if a `request_id` is provided.
15850 /// See <https://google.aip.dev/155> for more details.
15851 pub request_id: std::string::String,
15852
15853 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15854}
15855
15856impl DeleteInterceptDeploymentRequest {
15857 pub fn new() -> Self {
15858 std::default::Default::default()
15859 }
15860
15861 /// Sets the value of [name][crate::model::DeleteInterceptDeploymentRequest::name].
15862 ///
15863 /// # Example
15864 /// ```ignore,no_run
15865 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptDeploymentRequest;
15866 /// let x = DeleteInterceptDeploymentRequest::new().set_name("example");
15867 /// ```
15868 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15869 self.name = v.into();
15870 self
15871 }
15872
15873 /// Sets the value of [request_id][crate::model::DeleteInterceptDeploymentRequest::request_id].
15874 ///
15875 /// # Example
15876 /// ```ignore,no_run
15877 /// # use google_cloud_networksecurity_v1::model::DeleteInterceptDeploymentRequest;
15878 /// let x = DeleteInterceptDeploymentRequest::new().set_request_id("example");
15879 /// ```
15880 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15881 self.request_id = v.into();
15882 self
15883 }
15884}
15885
15886impl wkt::message::Message for DeleteInterceptDeploymentRequest {
15887 fn typename() -> &'static str {
15888 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest"
15889 }
15890}
15891
15892/// Details about intercept in a specific cloud location.
15893#[derive(Clone, Default, PartialEq)]
15894#[non_exhaustive]
15895pub struct InterceptLocation {
15896 /// Output only. The cloud location, e.g. "us-central1-a" or "asia-south1".
15897 pub location: std::string::String,
15898
15899 /// Output only. The current state of the association in this location.
15900 pub state: crate::model::intercept_location::State,
15901
15902 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15903}
15904
15905impl InterceptLocation {
15906 pub fn new() -> Self {
15907 std::default::Default::default()
15908 }
15909
15910 /// Sets the value of [location][crate::model::InterceptLocation::location].
15911 ///
15912 /// # Example
15913 /// ```ignore,no_run
15914 /// # use google_cloud_networksecurity_v1::model::InterceptLocation;
15915 /// let x = InterceptLocation::new().set_location("example");
15916 /// ```
15917 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15918 self.location = v.into();
15919 self
15920 }
15921
15922 /// Sets the value of [state][crate::model::InterceptLocation::state].
15923 ///
15924 /// # Example
15925 /// ```ignore,no_run
15926 /// # use google_cloud_networksecurity_v1::model::InterceptLocation;
15927 /// use google_cloud_networksecurity_v1::model::intercept_location::State;
15928 /// let x0 = InterceptLocation::new().set_state(State::Active);
15929 /// let x1 = InterceptLocation::new().set_state(State::OutOfSync);
15930 /// ```
15931 pub fn set_state<T: std::convert::Into<crate::model::intercept_location::State>>(
15932 mut self,
15933 v: T,
15934 ) -> Self {
15935 self.state = v.into();
15936 self
15937 }
15938}
15939
15940impl wkt::message::Message for InterceptLocation {
15941 fn typename() -> &'static str {
15942 "type.googleapis.com/google.cloud.networksecurity.v1.InterceptLocation"
15943 }
15944}
15945
15946/// Defines additional types related to [InterceptLocation].
15947pub mod intercept_location {
15948 #[allow(unused_imports)]
15949 use super::*;
15950
15951 /// The current state of a resource in the location.
15952 ///
15953 /// # Working with unknown values
15954 ///
15955 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15956 /// additional enum variants at any time. Adding new variants is not considered
15957 /// a breaking change. Applications should write their code in anticipation of:
15958 ///
15959 /// - New values appearing in future releases of the client library, **and**
15960 /// - New values received dynamically, without application changes.
15961 ///
15962 /// Please consult the [Working with enums] section in the user guide for some
15963 /// guidelines.
15964 ///
15965 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15966 #[derive(Clone, Debug, PartialEq)]
15967 #[non_exhaustive]
15968 pub enum State {
15969 /// State not set (this is not a valid state).
15970 Unspecified,
15971 /// The resource is ready and in sync in the location.
15972 Active,
15973 /// The resource is out of sync in the location.
15974 /// In most cases, this is a result of a transient issue within the system
15975 /// (e.g. an inaccessible location) and the system is expected to recover
15976 /// automatically.
15977 OutOfSync,
15978 /// If set, the enum was initialized with an unknown value.
15979 ///
15980 /// Applications can examine the value using [State::value] or
15981 /// [State::name].
15982 UnknownValue(state::UnknownValue),
15983 }
15984
15985 #[doc(hidden)]
15986 pub mod state {
15987 #[allow(unused_imports)]
15988 use super::*;
15989 #[derive(Clone, Debug, PartialEq)]
15990 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15991 }
15992
15993 impl State {
15994 /// Gets the enum value.
15995 ///
15996 /// Returns `None` if the enum contains an unknown value deserialized from
15997 /// the string representation of enums.
15998 pub fn value(&self) -> std::option::Option<i32> {
15999 match self {
16000 Self::Unspecified => std::option::Option::Some(0),
16001 Self::Active => std::option::Option::Some(1),
16002 Self::OutOfSync => std::option::Option::Some(2),
16003 Self::UnknownValue(u) => u.0.value(),
16004 }
16005 }
16006
16007 /// Gets the enum value as a string.
16008 ///
16009 /// Returns `None` if the enum contains an unknown value deserialized from
16010 /// the integer representation of enums.
16011 pub fn name(&self) -> std::option::Option<&str> {
16012 match self {
16013 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16014 Self::Active => std::option::Option::Some("ACTIVE"),
16015 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
16016 Self::UnknownValue(u) => u.0.name(),
16017 }
16018 }
16019 }
16020
16021 impl std::default::Default for State {
16022 fn default() -> Self {
16023 use std::convert::From;
16024 Self::from(0)
16025 }
16026 }
16027
16028 impl std::fmt::Display for State {
16029 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16030 wkt::internal::display_enum(f, self.name(), self.value())
16031 }
16032 }
16033
16034 impl std::convert::From<i32> for State {
16035 fn from(value: i32) -> Self {
16036 match value {
16037 0 => Self::Unspecified,
16038 1 => Self::Active,
16039 2 => Self::OutOfSync,
16040 _ => Self::UnknownValue(state::UnknownValue(
16041 wkt::internal::UnknownEnumValue::Integer(value),
16042 )),
16043 }
16044 }
16045 }
16046
16047 impl std::convert::From<&str> for State {
16048 fn from(value: &str) -> Self {
16049 use std::string::ToString;
16050 match value {
16051 "STATE_UNSPECIFIED" => Self::Unspecified,
16052 "ACTIVE" => Self::Active,
16053 "OUT_OF_SYNC" => Self::OutOfSync,
16054 _ => Self::UnknownValue(state::UnknownValue(
16055 wkt::internal::UnknownEnumValue::String(value.to_string()),
16056 )),
16057 }
16058 }
16059 }
16060
16061 impl serde::ser::Serialize for State {
16062 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16063 where
16064 S: serde::Serializer,
16065 {
16066 match self {
16067 Self::Unspecified => serializer.serialize_i32(0),
16068 Self::Active => serializer.serialize_i32(1),
16069 Self::OutOfSync => serializer.serialize_i32(2),
16070 Self::UnknownValue(u) => u.0.serialize(serializer),
16071 }
16072 }
16073 }
16074
16075 impl<'de> serde::de::Deserialize<'de> for State {
16076 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16077 where
16078 D: serde::Deserializer<'de>,
16079 {
16080 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16081 ".google.cloud.networksecurity.v1.InterceptLocation.State",
16082 ))
16083 }
16084 }
16085}
16086
16087/// An endpoint group is a consumer frontend for a deployment group (backend).
16088/// In order to configure mirroring for a network, consumers must create:
16089///
16090/// - An association between their network and the endpoint group.
16091/// - A security profile that points to the endpoint group.
16092/// - A mirroring rule that references the security profile (group).
16093#[derive(Clone, Default, PartialEq)]
16094#[non_exhaustive]
16095pub struct MirroringEndpointGroup {
16096 /// Immutable. Identifier. The resource name of this endpoint group, for
16097 /// example:
16098 /// `projects/123456789/locations/global/mirroringEndpointGroups/my-eg`.
16099 /// See <https://google.aip.dev/122> for more details.
16100 pub name: std::string::String,
16101
16102 /// Output only. The timestamp when the resource was created.
16103 /// See <https://google.aip.dev/148#timestamps>.
16104 pub create_time: std::option::Option<wkt::Timestamp>,
16105
16106 /// Output only. The timestamp when the resource was most recently updated.
16107 /// See <https://google.aip.dev/148#timestamps>.
16108 pub update_time: std::option::Option<wkt::Timestamp>,
16109
16110 /// Optional. Labels are key/value pairs that help to organize and filter
16111 /// resources.
16112 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16113
16114 /// Immutable. The deployment group that this DIRECT endpoint group is
16115 /// connected to, for example:
16116 /// `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
16117 /// See <https://google.aip.dev/124>.
16118 pub mirroring_deployment_group: std::string::String,
16119
16120 /// Output only. List of details about the connected deployment groups to this
16121 /// endpoint group.
16122 pub connected_deployment_groups:
16123 std::vec::Vec<crate::model::mirroring_endpoint_group::ConnectedDeploymentGroup>,
16124
16125 /// Output only. The current state of the endpoint group.
16126 /// See <https://google.aip.dev/216>.
16127 pub state: crate::model::mirroring_endpoint_group::State,
16128
16129 /// Output only. The current state of the resource does not match the user's
16130 /// intended state, and the system is working to reconcile them. This is part
16131 /// of the normal operation (e.g. adding a new association to the group). See
16132 /// <https://google.aip.dev/128>.
16133 pub reconciling: bool,
16134
16135 /// Immutable. The type of the endpoint group.
16136 /// If left unspecified, defaults to DIRECT.
16137 pub r#type: crate::model::mirroring_endpoint_group::Type,
16138
16139 /// Output only. List of associations to this endpoint group.
16140 pub associations: std::vec::Vec<crate::model::mirroring_endpoint_group::AssociationDetails>,
16141
16142 /// Optional. User-provided description of the endpoint group.
16143 /// Used as additional context for the endpoint group.
16144 pub description: std::string::String,
16145
16146 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16147}
16148
16149impl MirroringEndpointGroup {
16150 pub fn new() -> Self {
16151 std::default::Default::default()
16152 }
16153
16154 /// Sets the value of [name][crate::model::MirroringEndpointGroup::name].
16155 ///
16156 /// # Example
16157 /// ```ignore,no_run
16158 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16159 /// let x = MirroringEndpointGroup::new().set_name("example");
16160 /// ```
16161 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16162 self.name = v.into();
16163 self
16164 }
16165
16166 /// Sets the value of [create_time][crate::model::MirroringEndpointGroup::create_time].
16167 ///
16168 /// # Example
16169 /// ```ignore,no_run
16170 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16171 /// use wkt::Timestamp;
16172 /// let x = MirroringEndpointGroup::new().set_create_time(Timestamp::default()/* use setters */);
16173 /// ```
16174 pub fn set_create_time<T>(mut self, v: T) -> Self
16175 where
16176 T: std::convert::Into<wkt::Timestamp>,
16177 {
16178 self.create_time = std::option::Option::Some(v.into());
16179 self
16180 }
16181
16182 /// Sets or clears the value of [create_time][crate::model::MirroringEndpointGroup::create_time].
16183 ///
16184 /// # Example
16185 /// ```ignore,no_run
16186 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16187 /// use wkt::Timestamp;
16188 /// let x = MirroringEndpointGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16189 /// let x = MirroringEndpointGroup::new().set_or_clear_create_time(None::<Timestamp>);
16190 /// ```
16191 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16192 where
16193 T: std::convert::Into<wkt::Timestamp>,
16194 {
16195 self.create_time = v.map(|x| x.into());
16196 self
16197 }
16198
16199 /// Sets the value of [update_time][crate::model::MirroringEndpointGroup::update_time].
16200 ///
16201 /// # Example
16202 /// ```ignore,no_run
16203 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16204 /// use wkt::Timestamp;
16205 /// let x = MirroringEndpointGroup::new().set_update_time(Timestamp::default()/* use setters */);
16206 /// ```
16207 pub fn set_update_time<T>(mut self, v: T) -> Self
16208 where
16209 T: std::convert::Into<wkt::Timestamp>,
16210 {
16211 self.update_time = std::option::Option::Some(v.into());
16212 self
16213 }
16214
16215 /// Sets or clears the value of [update_time][crate::model::MirroringEndpointGroup::update_time].
16216 ///
16217 /// # Example
16218 /// ```ignore,no_run
16219 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16220 /// use wkt::Timestamp;
16221 /// let x = MirroringEndpointGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16222 /// let x = MirroringEndpointGroup::new().set_or_clear_update_time(None::<Timestamp>);
16223 /// ```
16224 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16225 where
16226 T: std::convert::Into<wkt::Timestamp>,
16227 {
16228 self.update_time = v.map(|x| x.into());
16229 self
16230 }
16231
16232 /// Sets the value of [labels][crate::model::MirroringEndpointGroup::labels].
16233 ///
16234 /// # Example
16235 /// ```ignore,no_run
16236 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16237 /// let x = MirroringEndpointGroup::new().set_labels([
16238 /// ("key0", "abc"),
16239 /// ("key1", "xyz"),
16240 /// ]);
16241 /// ```
16242 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16243 where
16244 T: std::iter::IntoIterator<Item = (K, V)>,
16245 K: std::convert::Into<std::string::String>,
16246 V: std::convert::Into<std::string::String>,
16247 {
16248 use std::iter::Iterator;
16249 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16250 self
16251 }
16252
16253 /// Sets the value of [mirroring_deployment_group][crate::model::MirroringEndpointGroup::mirroring_deployment_group].
16254 ///
16255 /// # Example
16256 /// ```ignore,no_run
16257 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16258 /// let x = MirroringEndpointGroup::new().set_mirroring_deployment_group("example");
16259 /// ```
16260 pub fn set_mirroring_deployment_group<T: std::convert::Into<std::string::String>>(
16261 mut self,
16262 v: T,
16263 ) -> Self {
16264 self.mirroring_deployment_group = v.into();
16265 self
16266 }
16267
16268 /// Sets the value of [connected_deployment_groups][crate::model::MirroringEndpointGroup::connected_deployment_groups].
16269 ///
16270 /// # Example
16271 /// ```ignore,no_run
16272 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16273 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::ConnectedDeploymentGroup;
16274 /// let x = MirroringEndpointGroup::new()
16275 /// .set_connected_deployment_groups([
16276 /// ConnectedDeploymentGroup::default()/* use setters */,
16277 /// ConnectedDeploymentGroup::default()/* use (different) setters */,
16278 /// ]);
16279 /// ```
16280 pub fn set_connected_deployment_groups<T, V>(mut self, v: T) -> Self
16281 where
16282 T: std::iter::IntoIterator<Item = V>,
16283 V: std::convert::Into<crate::model::mirroring_endpoint_group::ConnectedDeploymentGroup>,
16284 {
16285 use std::iter::Iterator;
16286 self.connected_deployment_groups = v.into_iter().map(|i| i.into()).collect();
16287 self
16288 }
16289
16290 /// Sets the value of [state][crate::model::MirroringEndpointGroup::state].
16291 ///
16292 /// # Example
16293 /// ```ignore,no_run
16294 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16295 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::State;
16296 /// let x0 = MirroringEndpointGroup::new().set_state(State::Active);
16297 /// let x1 = MirroringEndpointGroup::new().set_state(State::Closed);
16298 /// let x2 = MirroringEndpointGroup::new().set_state(State::Creating);
16299 /// ```
16300 pub fn set_state<T: std::convert::Into<crate::model::mirroring_endpoint_group::State>>(
16301 mut self,
16302 v: T,
16303 ) -> Self {
16304 self.state = v.into();
16305 self
16306 }
16307
16308 /// Sets the value of [reconciling][crate::model::MirroringEndpointGroup::reconciling].
16309 ///
16310 /// # Example
16311 /// ```ignore,no_run
16312 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16313 /// let x = MirroringEndpointGroup::new().set_reconciling(true);
16314 /// ```
16315 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16316 self.reconciling = v.into();
16317 self
16318 }
16319
16320 /// Sets the value of [r#type][crate::model::MirroringEndpointGroup::type].
16321 ///
16322 /// # Example
16323 /// ```ignore,no_run
16324 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16325 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::Type;
16326 /// let x0 = MirroringEndpointGroup::new().set_type(Type::Direct);
16327 /// ```
16328 pub fn set_type<T: std::convert::Into<crate::model::mirroring_endpoint_group::Type>>(
16329 mut self,
16330 v: T,
16331 ) -> Self {
16332 self.r#type = v.into();
16333 self
16334 }
16335
16336 /// Sets the value of [associations][crate::model::MirroringEndpointGroup::associations].
16337 ///
16338 /// # Example
16339 /// ```ignore,no_run
16340 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16341 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::AssociationDetails;
16342 /// let x = MirroringEndpointGroup::new()
16343 /// .set_associations([
16344 /// AssociationDetails::default()/* use setters */,
16345 /// AssociationDetails::default()/* use (different) setters */,
16346 /// ]);
16347 /// ```
16348 pub fn set_associations<T, V>(mut self, v: T) -> Self
16349 where
16350 T: std::iter::IntoIterator<Item = V>,
16351 V: std::convert::Into<crate::model::mirroring_endpoint_group::AssociationDetails>,
16352 {
16353 use std::iter::Iterator;
16354 self.associations = v.into_iter().map(|i| i.into()).collect();
16355 self
16356 }
16357
16358 /// Sets the value of [description][crate::model::MirroringEndpointGroup::description].
16359 ///
16360 /// # Example
16361 /// ```ignore,no_run
16362 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16363 /// let x = MirroringEndpointGroup::new().set_description("example");
16364 /// ```
16365 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16366 self.description = v.into();
16367 self
16368 }
16369}
16370
16371impl wkt::message::Message for MirroringEndpointGroup {
16372 fn typename() -> &'static str {
16373 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroup"
16374 }
16375}
16376
16377/// Defines additional types related to [MirroringEndpointGroup].
16378pub mod mirroring_endpoint_group {
16379 #[allow(unused_imports)]
16380 use super::*;
16381
16382 /// The endpoint group's view of a connected deployment group.
16383 #[derive(Clone, Default, PartialEq)]
16384 #[non_exhaustive]
16385 pub struct ConnectedDeploymentGroup {
16386 /// Output only. The connected deployment group's resource name, for example:
16387 /// `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
16388 /// See <https://google.aip.dev/124>.
16389 pub name: std::string::String,
16390
16391 /// Output only. The list of locations where the deployment group is present.
16392 pub locations: std::vec::Vec<crate::model::MirroringLocation>,
16393
16394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16395 }
16396
16397 impl ConnectedDeploymentGroup {
16398 pub fn new() -> Self {
16399 std::default::Default::default()
16400 }
16401
16402 /// Sets the value of [name][crate::model::mirroring_endpoint_group::ConnectedDeploymentGroup::name].
16403 ///
16404 /// # Example
16405 /// ```ignore,no_run
16406 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::ConnectedDeploymentGroup;
16407 /// let x = ConnectedDeploymentGroup::new().set_name("example");
16408 /// ```
16409 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16410 self.name = v.into();
16411 self
16412 }
16413
16414 /// Sets the value of [locations][crate::model::mirroring_endpoint_group::ConnectedDeploymentGroup::locations].
16415 ///
16416 /// # Example
16417 /// ```ignore,no_run
16418 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::ConnectedDeploymentGroup;
16419 /// use google_cloud_networksecurity_v1::model::MirroringLocation;
16420 /// let x = ConnectedDeploymentGroup::new()
16421 /// .set_locations([
16422 /// MirroringLocation::default()/* use setters */,
16423 /// MirroringLocation::default()/* use (different) setters */,
16424 /// ]);
16425 /// ```
16426 pub fn set_locations<T, V>(mut self, v: T) -> Self
16427 where
16428 T: std::iter::IntoIterator<Item = V>,
16429 V: std::convert::Into<crate::model::MirroringLocation>,
16430 {
16431 use std::iter::Iterator;
16432 self.locations = v.into_iter().map(|i| i.into()).collect();
16433 self
16434 }
16435 }
16436
16437 impl wkt::message::Message for ConnectedDeploymentGroup {
16438 fn typename() -> &'static str {
16439 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup"
16440 }
16441 }
16442
16443 /// The endpoint group's view of a connected association.
16444 #[derive(Clone, Default, PartialEq)]
16445 #[non_exhaustive]
16446 pub struct AssociationDetails {
16447 /// Output only. The connected association's resource name, for example:
16448 /// `projects/123456789/locations/global/mirroringEndpointGroupAssociations/my-ega`.
16449 /// See <https://google.aip.dev/124>.
16450 pub name: std::string::String,
16451
16452 /// Output only. The associated network, for example:
16453 /// projects/123456789/global/networks/my-network.
16454 /// See <https://google.aip.dev/124>.
16455 pub network: std::string::String,
16456
16457 /// Output only. Most recent known state of the association.
16458 pub state: crate::model::mirroring_endpoint_group_association::State,
16459
16460 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16461 }
16462
16463 impl AssociationDetails {
16464 pub fn new() -> Self {
16465 std::default::Default::default()
16466 }
16467
16468 /// Sets the value of [name][crate::model::mirroring_endpoint_group::AssociationDetails::name].
16469 ///
16470 /// # Example
16471 /// ```ignore,no_run
16472 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::AssociationDetails;
16473 /// let x = AssociationDetails::new().set_name("example");
16474 /// ```
16475 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16476 self.name = v.into();
16477 self
16478 }
16479
16480 /// Sets the value of [network][crate::model::mirroring_endpoint_group::AssociationDetails::network].
16481 ///
16482 /// # Example
16483 /// ```ignore,no_run
16484 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::AssociationDetails;
16485 /// let x = AssociationDetails::new().set_network("example");
16486 /// ```
16487 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16488 self.network = v.into();
16489 self
16490 }
16491
16492 /// Sets the value of [state][crate::model::mirroring_endpoint_group::AssociationDetails::state].
16493 ///
16494 /// # Example
16495 /// ```ignore,no_run
16496 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group::AssociationDetails;
16497 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::State;
16498 /// let x0 = AssociationDetails::new().set_state(State::Active);
16499 /// let x1 = AssociationDetails::new().set_state(State::Creating);
16500 /// let x2 = AssociationDetails::new().set_state(State::Deleting);
16501 /// ```
16502 pub fn set_state<
16503 T: std::convert::Into<crate::model::mirroring_endpoint_group_association::State>,
16504 >(
16505 mut self,
16506 v: T,
16507 ) -> Self {
16508 self.state = v.into();
16509 self
16510 }
16511 }
16512
16513 impl wkt::message::Message for AssociationDetails {
16514 fn typename() -> &'static str {
16515 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails"
16516 }
16517 }
16518
16519 /// The current state of the endpoint group.
16520 ///
16521 /// # Working with unknown values
16522 ///
16523 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16524 /// additional enum variants at any time. Adding new variants is not considered
16525 /// a breaking change. Applications should write their code in anticipation of:
16526 ///
16527 /// - New values appearing in future releases of the client library, **and**
16528 /// - New values received dynamically, without application changes.
16529 ///
16530 /// Please consult the [Working with enums] section in the user guide for some
16531 /// guidelines.
16532 ///
16533 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16534 #[derive(Clone, Debug, PartialEq)]
16535 #[non_exhaustive]
16536 pub enum State {
16537 /// State not set (this is not a valid state).
16538 Unspecified,
16539 /// The endpoint group is ready and in sync with the target deployment group.
16540 Active,
16541 /// The deployment group backing this endpoint group has been force-deleted.
16542 /// This endpoint group cannot be used and mirroring is effectively disabled.
16543 Closed,
16544 /// The endpoint group is being created.
16545 Creating,
16546 /// The endpoint group is being deleted.
16547 Deleting,
16548 /// The endpoint group is out of sync with the backing deployment group.
16549 /// In most cases, this is a result of a transient issue within the system
16550 /// (e.g. an inaccessible location) and the system is expected to recover
16551 /// automatically. See the associations field for details per network and
16552 /// location.
16553 OutOfSync,
16554 /// An attempt to delete the endpoint group has failed. This is a terminal
16555 /// state and the endpoint group is not expected to recover.
16556 /// The only permitted operation is to retry deleting the endpoint group.
16557 DeleteFailed,
16558 /// If set, the enum was initialized with an unknown value.
16559 ///
16560 /// Applications can examine the value using [State::value] or
16561 /// [State::name].
16562 UnknownValue(state::UnknownValue),
16563 }
16564
16565 #[doc(hidden)]
16566 pub mod state {
16567 #[allow(unused_imports)]
16568 use super::*;
16569 #[derive(Clone, Debug, PartialEq)]
16570 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16571 }
16572
16573 impl State {
16574 /// Gets the enum value.
16575 ///
16576 /// Returns `None` if the enum contains an unknown value deserialized from
16577 /// the string representation of enums.
16578 pub fn value(&self) -> std::option::Option<i32> {
16579 match self {
16580 Self::Unspecified => std::option::Option::Some(0),
16581 Self::Active => std::option::Option::Some(1),
16582 Self::Closed => std::option::Option::Some(2),
16583 Self::Creating => std::option::Option::Some(3),
16584 Self::Deleting => std::option::Option::Some(4),
16585 Self::OutOfSync => std::option::Option::Some(5),
16586 Self::DeleteFailed => std::option::Option::Some(6),
16587 Self::UnknownValue(u) => u.0.value(),
16588 }
16589 }
16590
16591 /// Gets the enum value as a string.
16592 ///
16593 /// Returns `None` if the enum contains an unknown value deserialized from
16594 /// the integer representation of enums.
16595 pub fn name(&self) -> std::option::Option<&str> {
16596 match self {
16597 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16598 Self::Active => std::option::Option::Some("ACTIVE"),
16599 Self::Closed => std::option::Option::Some("CLOSED"),
16600 Self::Creating => std::option::Option::Some("CREATING"),
16601 Self::Deleting => std::option::Option::Some("DELETING"),
16602 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
16603 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
16604 Self::UnknownValue(u) => u.0.name(),
16605 }
16606 }
16607 }
16608
16609 impl std::default::Default for State {
16610 fn default() -> Self {
16611 use std::convert::From;
16612 Self::from(0)
16613 }
16614 }
16615
16616 impl std::fmt::Display for State {
16617 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16618 wkt::internal::display_enum(f, self.name(), self.value())
16619 }
16620 }
16621
16622 impl std::convert::From<i32> for State {
16623 fn from(value: i32) -> Self {
16624 match value {
16625 0 => Self::Unspecified,
16626 1 => Self::Active,
16627 2 => Self::Closed,
16628 3 => Self::Creating,
16629 4 => Self::Deleting,
16630 5 => Self::OutOfSync,
16631 6 => Self::DeleteFailed,
16632 _ => Self::UnknownValue(state::UnknownValue(
16633 wkt::internal::UnknownEnumValue::Integer(value),
16634 )),
16635 }
16636 }
16637 }
16638
16639 impl std::convert::From<&str> for State {
16640 fn from(value: &str) -> Self {
16641 use std::string::ToString;
16642 match value {
16643 "STATE_UNSPECIFIED" => Self::Unspecified,
16644 "ACTIVE" => Self::Active,
16645 "CLOSED" => Self::Closed,
16646 "CREATING" => Self::Creating,
16647 "DELETING" => Self::Deleting,
16648 "OUT_OF_SYNC" => Self::OutOfSync,
16649 "DELETE_FAILED" => Self::DeleteFailed,
16650 _ => Self::UnknownValue(state::UnknownValue(
16651 wkt::internal::UnknownEnumValue::String(value.to_string()),
16652 )),
16653 }
16654 }
16655 }
16656
16657 impl serde::ser::Serialize for State {
16658 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16659 where
16660 S: serde::Serializer,
16661 {
16662 match self {
16663 Self::Unspecified => serializer.serialize_i32(0),
16664 Self::Active => serializer.serialize_i32(1),
16665 Self::Closed => serializer.serialize_i32(2),
16666 Self::Creating => serializer.serialize_i32(3),
16667 Self::Deleting => serializer.serialize_i32(4),
16668 Self::OutOfSync => serializer.serialize_i32(5),
16669 Self::DeleteFailed => serializer.serialize_i32(6),
16670 Self::UnknownValue(u) => u.0.serialize(serializer),
16671 }
16672 }
16673 }
16674
16675 impl<'de> serde::de::Deserialize<'de> for State {
16676 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16677 where
16678 D: serde::Deserializer<'de>,
16679 {
16680 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16681 ".google.cloud.networksecurity.v1.MirroringEndpointGroup.State",
16682 ))
16683 }
16684 }
16685
16686 /// The type of the endpoint group.
16687 ///
16688 /// # Working with unknown values
16689 ///
16690 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16691 /// additional enum variants at any time. Adding new variants is not considered
16692 /// a breaking change. Applications should write their code in anticipation of:
16693 ///
16694 /// - New values appearing in future releases of the client library, **and**
16695 /// - New values received dynamically, without application changes.
16696 ///
16697 /// Please consult the [Working with enums] section in the user guide for some
16698 /// guidelines.
16699 ///
16700 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16701 #[derive(Clone, Debug, PartialEq)]
16702 #[non_exhaustive]
16703 pub enum Type {
16704 /// Not set.
16705 Unspecified,
16706 /// An endpoint group that sends packets to a single deployment group.
16707 Direct,
16708 /// If set, the enum was initialized with an unknown value.
16709 ///
16710 /// Applications can examine the value using [Type::value] or
16711 /// [Type::name].
16712 UnknownValue(r#type::UnknownValue),
16713 }
16714
16715 #[doc(hidden)]
16716 pub mod r#type {
16717 #[allow(unused_imports)]
16718 use super::*;
16719 #[derive(Clone, Debug, PartialEq)]
16720 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16721 }
16722
16723 impl Type {
16724 /// Gets the enum value.
16725 ///
16726 /// Returns `None` if the enum contains an unknown value deserialized from
16727 /// the string representation of enums.
16728 pub fn value(&self) -> std::option::Option<i32> {
16729 match self {
16730 Self::Unspecified => std::option::Option::Some(0),
16731 Self::Direct => std::option::Option::Some(1),
16732 Self::UnknownValue(u) => u.0.value(),
16733 }
16734 }
16735
16736 /// Gets the enum value as a string.
16737 ///
16738 /// Returns `None` if the enum contains an unknown value deserialized from
16739 /// the integer representation of enums.
16740 pub fn name(&self) -> std::option::Option<&str> {
16741 match self {
16742 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
16743 Self::Direct => std::option::Option::Some("DIRECT"),
16744 Self::UnknownValue(u) => u.0.name(),
16745 }
16746 }
16747 }
16748
16749 impl std::default::Default for Type {
16750 fn default() -> Self {
16751 use std::convert::From;
16752 Self::from(0)
16753 }
16754 }
16755
16756 impl std::fmt::Display for Type {
16757 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16758 wkt::internal::display_enum(f, self.name(), self.value())
16759 }
16760 }
16761
16762 impl std::convert::From<i32> for Type {
16763 fn from(value: i32) -> Self {
16764 match value {
16765 0 => Self::Unspecified,
16766 1 => Self::Direct,
16767 _ => Self::UnknownValue(r#type::UnknownValue(
16768 wkt::internal::UnknownEnumValue::Integer(value),
16769 )),
16770 }
16771 }
16772 }
16773
16774 impl std::convert::From<&str> for Type {
16775 fn from(value: &str) -> Self {
16776 use std::string::ToString;
16777 match value {
16778 "TYPE_UNSPECIFIED" => Self::Unspecified,
16779 "DIRECT" => Self::Direct,
16780 _ => Self::UnknownValue(r#type::UnknownValue(
16781 wkt::internal::UnknownEnumValue::String(value.to_string()),
16782 )),
16783 }
16784 }
16785 }
16786
16787 impl serde::ser::Serialize for Type {
16788 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16789 where
16790 S: serde::Serializer,
16791 {
16792 match self {
16793 Self::Unspecified => serializer.serialize_i32(0),
16794 Self::Direct => serializer.serialize_i32(1),
16795 Self::UnknownValue(u) => u.0.serialize(serializer),
16796 }
16797 }
16798 }
16799
16800 impl<'de> serde::de::Deserialize<'de> for Type {
16801 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16802 where
16803 D: serde::Deserializer<'de>,
16804 {
16805 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
16806 ".google.cloud.networksecurity.v1.MirroringEndpointGroup.Type",
16807 ))
16808 }
16809 }
16810}
16811
16812/// Request message for ListMirroringEndpointGroups.
16813#[derive(Clone, Default, PartialEq)]
16814#[non_exhaustive]
16815pub struct ListMirroringEndpointGroupsRequest {
16816 /// Required. The parent, which owns this collection of endpoint groups.
16817 /// Example: `projects/123456789/locations/global`.
16818 /// See <https://google.aip.dev/132> for more details.
16819 pub parent: std::string::String,
16820
16821 /// Optional. Requested page size. Server may return fewer items than
16822 /// requested. If unspecified, server will pick an appropriate default. See
16823 /// <https://google.aip.dev/158> for more details.
16824 pub page_size: i32,
16825
16826 /// Optional. A page token, received from a previous
16827 /// `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent
16828 /// page. When paginating, all other parameters provided to
16829 /// `ListMirroringEndpointGroups` must match the call that provided the page
16830 /// token.
16831 /// See <https://google.aip.dev/158> for more details.
16832 pub page_token: std::string::String,
16833
16834 /// Optional. Filter expression.
16835 /// See <https://google.aip.dev/160#filtering> for more details.
16836 pub filter: std::string::String,
16837
16838 /// Optional. Sort expression.
16839 /// See <https://google.aip.dev/132#ordering> for more details.
16840 pub order_by: std::string::String,
16841
16842 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16843}
16844
16845impl ListMirroringEndpointGroupsRequest {
16846 pub fn new() -> Self {
16847 std::default::Default::default()
16848 }
16849
16850 /// Sets the value of [parent][crate::model::ListMirroringEndpointGroupsRequest::parent].
16851 ///
16852 /// # Example
16853 /// ```ignore,no_run
16854 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
16855 /// let x = ListMirroringEndpointGroupsRequest::new().set_parent("example");
16856 /// ```
16857 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16858 self.parent = v.into();
16859 self
16860 }
16861
16862 /// Sets the value of [page_size][crate::model::ListMirroringEndpointGroupsRequest::page_size].
16863 ///
16864 /// # Example
16865 /// ```ignore,no_run
16866 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
16867 /// let x = ListMirroringEndpointGroupsRequest::new().set_page_size(42);
16868 /// ```
16869 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16870 self.page_size = v.into();
16871 self
16872 }
16873
16874 /// Sets the value of [page_token][crate::model::ListMirroringEndpointGroupsRequest::page_token].
16875 ///
16876 /// # Example
16877 /// ```ignore,no_run
16878 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
16879 /// let x = ListMirroringEndpointGroupsRequest::new().set_page_token("example");
16880 /// ```
16881 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16882 self.page_token = v.into();
16883 self
16884 }
16885
16886 /// Sets the value of [filter][crate::model::ListMirroringEndpointGroupsRequest::filter].
16887 ///
16888 /// # Example
16889 /// ```ignore,no_run
16890 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
16891 /// let x = ListMirroringEndpointGroupsRequest::new().set_filter("example");
16892 /// ```
16893 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16894 self.filter = v.into();
16895 self
16896 }
16897
16898 /// Sets the value of [order_by][crate::model::ListMirroringEndpointGroupsRequest::order_by].
16899 ///
16900 /// # Example
16901 /// ```ignore,no_run
16902 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsRequest;
16903 /// let x = ListMirroringEndpointGroupsRequest::new().set_order_by("example");
16904 /// ```
16905 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16906 self.order_by = v.into();
16907 self
16908 }
16909}
16910
16911impl wkt::message::Message for ListMirroringEndpointGroupsRequest {
16912 fn typename() -> &'static str {
16913 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest"
16914 }
16915}
16916
16917/// Response message for ListMirroringEndpointGroups.
16918#[derive(Clone, Default, PartialEq)]
16919#[non_exhaustive]
16920pub struct ListMirroringEndpointGroupsResponse {
16921 /// The endpoint groups from the specified parent.
16922 pub mirroring_endpoint_groups: std::vec::Vec<crate::model::MirroringEndpointGroup>,
16923
16924 /// A token that can be sent as `page_token` to retrieve the next page.
16925 /// If this field is omitted, there are no subsequent pages.
16926 /// See <https://google.aip.dev/158> for more details.
16927 pub next_page_token: std::string::String,
16928
16929 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16930}
16931
16932impl ListMirroringEndpointGroupsResponse {
16933 pub fn new() -> Self {
16934 std::default::Default::default()
16935 }
16936
16937 /// Sets the value of [mirroring_endpoint_groups][crate::model::ListMirroringEndpointGroupsResponse::mirroring_endpoint_groups].
16938 ///
16939 /// # Example
16940 /// ```ignore,no_run
16941 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsResponse;
16942 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
16943 /// let x = ListMirroringEndpointGroupsResponse::new()
16944 /// .set_mirroring_endpoint_groups([
16945 /// MirroringEndpointGroup::default()/* use setters */,
16946 /// MirroringEndpointGroup::default()/* use (different) setters */,
16947 /// ]);
16948 /// ```
16949 pub fn set_mirroring_endpoint_groups<T, V>(mut self, v: T) -> Self
16950 where
16951 T: std::iter::IntoIterator<Item = V>,
16952 V: std::convert::Into<crate::model::MirroringEndpointGroup>,
16953 {
16954 use std::iter::Iterator;
16955 self.mirroring_endpoint_groups = v.into_iter().map(|i| i.into()).collect();
16956 self
16957 }
16958
16959 /// Sets the value of [next_page_token][crate::model::ListMirroringEndpointGroupsResponse::next_page_token].
16960 ///
16961 /// # Example
16962 /// ```ignore,no_run
16963 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupsResponse;
16964 /// let x = ListMirroringEndpointGroupsResponse::new().set_next_page_token("example");
16965 /// ```
16966 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16967 self.next_page_token = v.into();
16968 self
16969 }
16970}
16971
16972impl wkt::message::Message for ListMirroringEndpointGroupsResponse {
16973 fn typename() -> &'static str {
16974 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse"
16975 }
16976}
16977
16978#[doc(hidden)]
16979impl google_cloud_gax::paginator::internal::PageableResponse
16980 for ListMirroringEndpointGroupsResponse
16981{
16982 type PageItem = crate::model::MirroringEndpointGroup;
16983
16984 fn items(self) -> std::vec::Vec<Self::PageItem> {
16985 self.mirroring_endpoint_groups
16986 }
16987
16988 fn next_page_token(&self) -> std::string::String {
16989 use std::clone::Clone;
16990 self.next_page_token.clone()
16991 }
16992}
16993
16994/// Request message for GetMirroringEndpointGroup.
16995#[derive(Clone, Default, PartialEq)]
16996#[non_exhaustive]
16997pub struct GetMirroringEndpointGroupRequest {
16998 /// Required. The name of the endpoint group to retrieve.
16999 /// Format:
17000 /// projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group}
17001 pub name: std::string::String,
17002
17003 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17004}
17005
17006impl GetMirroringEndpointGroupRequest {
17007 pub fn new() -> Self {
17008 std::default::Default::default()
17009 }
17010
17011 /// Sets the value of [name][crate::model::GetMirroringEndpointGroupRequest::name].
17012 ///
17013 /// # Example
17014 /// ```ignore,no_run
17015 /// # use google_cloud_networksecurity_v1::model::GetMirroringEndpointGroupRequest;
17016 /// let x = GetMirroringEndpointGroupRequest::new().set_name("example");
17017 /// ```
17018 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17019 self.name = v.into();
17020 self
17021 }
17022}
17023
17024impl wkt::message::Message for GetMirroringEndpointGroupRequest {
17025 fn typename() -> &'static str {
17026 "type.googleapis.com/google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest"
17027 }
17028}
17029
17030/// Request message for CreateMirroringEndpointGroup.
17031#[derive(Clone, Default, PartialEq)]
17032#[non_exhaustive]
17033pub struct CreateMirroringEndpointGroupRequest {
17034 /// Required. The parent resource where this endpoint group will be created.
17035 /// Format: projects/{project}/locations/{location}
17036 pub parent: std::string::String,
17037
17038 /// Required. The ID to use for the endpoint group, which will become the final
17039 /// component of the endpoint group's resource name.
17040 pub mirroring_endpoint_group_id: std::string::String,
17041
17042 /// Required. The endpoint group to create.
17043 pub mirroring_endpoint_group: std::option::Option<crate::model::MirroringEndpointGroup>,
17044
17045 /// Optional. A unique identifier for this request. Must be a UUID4.
17046 /// This request is only idempotent if a `request_id` is provided.
17047 /// See <https://google.aip.dev/155> for more details.
17048 pub request_id: std::string::String,
17049
17050 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17051}
17052
17053impl CreateMirroringEndpointGroupRequest {
17054 pub fn new() -> Self {
17055 std::default::Default::default()
17056 }
17057
17058 /// Sets the value of [parent][crate::model::CreateMirroringEndpointGroupRequest::parent].
17059 ///
17060 /// # Example
17061 /// ```ignore,no_run
17062 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17063 /// let x = CreateMirroringEndpointGroupRequest::new().set_parent("example");
17064 /// ```
17065 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17066 self.parent = v.into();
17067 self
17068 }
17069
17070 /// Sets the value of [mirroring_endpoint_group_id][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group_id].
17071 ///
17072 /// # Example
17073 /// ```ignore,no_run
17074 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17075 /// let x = CreateMirroringEndpointGroupRequest::new().set_mirroring_endpoint_group_id("example");
17076 /// ```
17077 pub fn set_mirroring_endpoint_group_id<T: std::convert::Into<std::string::String>>(
17078 mut self,
17079 v: T,
17080 ) -> Self {
17081 self.mirroring_endpoint_group_id = v.into();
17082 self
17083 }
17084
17085 /// Sets the value of [mirroring_endpoint_group][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group].
17086 ///
17087 /// # Example
17088 /// ```ignore,no_run
17089 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17090 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17091 /// let x = CreateMirroringEndpointGroupRequest::new().set_mirroring_endpoint_group(MirroringEndpointGroup::default()/* use setters */);
17092 /// ```
17093 pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
17094 where
17095 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
17096 {
17097 self.mirroring_endpoint_group = std::option::Option::Some(v.into());
17098 self
17099 }
17100
17101 /// Sets or clears the value of [mirroring_endpoint_group][crate::model::CreateMirroringEndpointGroupRequest::mirroring_endpoint_group].
17102 ///
17103 /// # Example
17104 /// ```ignore,no_run
17105 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17106 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17107 /// let x = CreateMirroringEndpointGroupRequest::new().set_or_clear_mirroring_endpoint_group(Some(MirroringEndpointGroup::default()/* use setters */));
17108 /// let x = CreateMirroringEndpointGroupRequest::new().set_or_clear_mirroring_endpoint_group(None::<MirroringEndpointGroup>);
17109 /// ```
17110 pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
17111 where
17112 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
17113 {
17114 self.mirroring_endpoint_group = v.map(|x| x.into());
17115 self
17116 }
17117
17118 /// Sets the value of [request_id][crate::model::CreateMirroringEndpointGroupRequest::request_id].
17119 ///
17120 /// # Example
17121 /// ```ignore,no_run
17122 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupRequest;
17123 /// let x = CreateMirroringEndpointGroupRequest::new().set_request_id("example");
17124 /// ```
17125 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17126 self.request_id = v.into();
17127 self
17128 }
17129}
17130
17131impl wkt::message::Message for CreateMirroringEndpointGroupRequest {
17132 fn typename() -> &'static str {
17133 "type.googleapis.com/google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest"
17134 }
17135}
17136
17137/// Request message for UpdateMirroringEndpointGroup.
17138#[derive(Clone, Default, PartialEq)]
17139#[non_exhaustive]
17140pub struct UpdateMirroringEndpointGroupRequest {
17141 /// Optional. The list of fields to update.
17142 /// Fields are specified relative to the endpoint group
17143 /// (e.g. `description`; *not* `mirroring_endpoint_group.description`).
17144 /// See <https://google.aip.dev/161> for more details.
17145 pub update_mask: std::option::Option<wkt::FieldMask>,
17146
17147 /// Required. The endpoint group to update.
17148 pub mirroring_endpoint_group: std::option::Option<crate::model::MirroringEndpointGroup>,
17149
17150 /// Optional. A unique identifier for this request. Must be a UUID4.
17151 /// This request is only idempotent if a `request_id` is provided.
17152 /// See <https://google.aip.dev/155> for more details.
17153 pub request_id: std::string::String,
17154
17155 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17156}
17157
17158impl UpdateMirroringEndpointGroupRequest {
17159 pub fn new() -> Self {
17160 std::default::Default::default()
17161 }
17162
17163 /// Sets the value of [update_mask][crate::model::UpdateMirroringEndpointGroupRequest::update_mask].
17164 ///
17165 /// # Example
17166 /// ```ignore,no_run
17167 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17168 /// use wkt::FieldMask;
17169 /// let x = UpdateMirroringEndpointGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
17170 /// ```
17171 pub fn set_update_mask<T>(mut self, v: T) -> Self
17172 where
17173 T: std::convert::Into<wkt::FieldMask>,
17174 {
17175 self.update_mask = std::option::Option::Some(v.into());
17176 self
17177 }
17178
17179 /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringEndpointGroupRequest::update_mask].
17180 ///
17181 /// # Example
17182 /// ```ignore,no_run
17183 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17184 /// use wkt::FieldMask;
17185 /// let x = UpdateMirroringEndpointGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
17186 /// let x = UpdateMirroringEndpointGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
17187 /// ```
17188 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17189 where
17190 T: std::convert::Into<wkt::FieldMask>,
17191 {
17192 self.update_mask = v.map(|x| x.into());
17193 self
17194 }
17195
17196 /// Sets the value of [mirroring_endpoint_group][crate::model::UpdateMirroringEndpointGroupRequest::mirroring_endpoint_group].
17197 ///
17198 /// # Example
17199 /// ```ignore,no_run
17200 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17201 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17202 /// let x = UpdateMirroringEndpointGroupRequest::new().set_mirroring_endpoint_group(MirroringEndpointGroup::default()/* use setters */);
17203 /// ```
17204 pub fn set_mirroring_endpoint_group<T>(mut self, v: T) -> Self
17205 where
17206 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
17207 {
17208 self.mirroring_endpoint_group = std::option::Option::Some(v.into());
17209 self
17210 }
17211
17212 /// Sets or clears the value of [mirroring_endpoint_group][crate::model::UpdateMirroringEndpointGroupRequest::mirroring_endpoint_group].
17213 ///
17214 /// # Example
17215 /// ```ignore,no_run
17216 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17217 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroup;
17218 /// let x = UpdateMirroringEndpointGroupRequest::new().set_or_clear_mirroring_endpoint_group(Some(MirroringEndpointGroup::default()/* use setters */));
17219 /// let x = UpdateMirroringEndpointGroupRequest::new().set_or_clear_mirroring_endpoint_group(None::<MirroringEndpointGroup>);
17220 /// ```
17221 pub fn set_or_clear_mirroring_endpoint_group<T>(mut self, v: std::option::Option<T>) -> Self
17222 where
17223 T: std::convert::Into<crate::model::MirroringEndpointGroup>,
17224 {
17225 self.mirroring_endpoint_group = v.map(|x| x.into());
17226 self
17227 }
17228
17229 /// Sets the value of [request_id][crate::model::UpdateMirroringEndpointGroupRequest::request_id].
17230 ///
17231 /// # Example
17232 /// ```ignore,no_run
17233 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupRequest;
17234 /// let x = UpdateMirroringEndpointGroupRequest::new().set_request_id("example");
17235 /// ```
17236 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17237 self.request_id = v.into();
17238 self
17239 }
17240}
17241
17242impl wkt::message::Message for UpdateMirroringEndpointGroupRequest {
17243 fn typename() -> &'static str {
17244 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest"
17245 }
17246}
17247
17248/// Request message for DeleteMirroringEndpointGroup.
17249#[derive(Clone, Default, PartialEq)]
17250#[non_exhaustive]
17251pub struct DeleteMirroringEndpointGroupRequest {
17252 /// Required. The endpoint group to delete.
17253 pub name: std::string::String,
17254
17255 /// Optional. A unique identifier for this request. Must be a UUID4.
17256 /// This request is only idempotent if a `request_id` is provided.
17257 /// See <https://google.aip.dev/155> for more details.
17258 pub request_id: std::string::String,
17259
17260 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17261}
17262
17263impl DeleteMirroringEndpointGroupRequest {
17264 pub fn new() -> Self {
17265 std::default::Default::default()
17266 }
17267
17268 /// Sets the value of [name][crate::model::DeleteMirroringEndpointGroupRequest::name].
17269 ///
17270 /// # Example
17271 /// ```ignore,no_run
17272 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringEndpointGroupRequest;
17273 /// let x = DeleteMirroringEndpointGroupRequest::new().set_name("example");
17274 /// ```
17275 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17276 self.name = v.into();
17277 self
17278 }
17279
17280 /// Sets the value of [request_id][crate::model::DeleteMirroringEndpointGroupRequest::request_id].
17281 ///
17282 /// # Example
17283 /// ```ignore,no_run
17284 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringEndpointGroupRequest;
17285 /// let x = DeleteMirroringEndpointGroupRequest::new().set_request_id("example");
17286 /// ```
17287 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17288 self.request_id = v.into();
17289 self
17290 }
17291}
17292
17293impl wkt::message::Message for DeleteMirroringEndpointGroupRequest {
17294 fn typename() -> &'static str {
17295 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest"
17296 }
17297}
17298
17299/// An endpoint group association represents a link between a network and an
17300/// endpoint group in the organization.
17301///
17302/// Creating an association creates the networking infrastructure linking the
17303/// network to the endpoint group, but does not enable mirroring by itself.
17304/// To enable mirroring, the user must also create a network firewall policy
17305/// containing mirroring rules and associate it with the network.
17306#[derive(Clone, Default, PartialEq)]
17307#[non_exhaustive]
17308pub struct MirroringEndpointGroupAssociation {
17309 /// Immutable. Identifier. The resource name of this endpoint group
17310 /// association, for example:
17311 /// `projects/123456789/locations/global/mirroringEndpointGroupAssociations/my-eg-association`.
17312 /// See <https://google.aip.dev/122> for more details.
17313 pub name: std::string::String,
17314
17315 /// Output only. The timestamp when the resource was created.
17316 /// See <https://google.aip.dev/148#timestamps>.
17317 pub create_time: std::option::Option<wkt::Timestamp>,
17318
17319 /// Output only. The timestamp when the resource was most recently updated.
17320 /// See <https://google.aip.dev/148#timestamps>.
17321 pub update_time: std::option::Option<wkt::Timestamp>,
17322
17323 /// Optional. Labels are key/value pairs that help to organize and filter
17324 /// resources.
17325 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
17326
17327 /// Immutable. The endpoint group that this association is connected to, for
17328 /// example:
17329 /// `projects/123456789/locations/global/mirroringEndpointGroups/my-eg`.
17330 /// See <https://google.aip.dev/124>.
17331 pub mirroring_endpoint_group: std::string::String,
17332
17333 /// Immutable. The VPC network that is associated. for example:
17334 /// `projects/123456789/global/networks/my-network`.
17335 /// See <https://google.aip.dev/124>.
17336 pub network: std::string::String,
17337
17338 /// Output only. The list of locations where the association is present. This
17339 /// information is retrieved from the linked endpoint group, and not configured
17340 /// as part of the association itself.
17341 #[deprecated]
17342 pub locations_details:
17343 std::vec::Vec<crate::model::mirroring_endpoint_group_association::LocationDetails>,
17344
17345 /// Output only. Current state of the endpoint group association.
17346 pub state: crate::model::mirroring_endpoint_group_association::State,
17347
17348 /// Output only. The current state of the resource does not match the user's
17349 /// intended state, and the system is working to reconcile them. This part of
17350 /// the normal operation (e.g. adding a new location to the target deployment
17351 /// group). See <https://google.aip.dev/128>.
17352 pub reconciling: bool,
17353
17354 /// Output only. The list of locations where the association is configured.
17355 /// This information is retrieved from the linked endpoint group.
17356 pub locations: std::vec::Vec<crate::model::MirroringLocation>,
17357
17358 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17359}
17360
17361impl MirroringEndpointGroupAssociation {
17362 pub fn new() -> Self {
17363 std::default::Default::default()
17364 }
17365
17366 /// Sets the value of [name][crate::model::MirroringEndpointGroupAssociation::name].
17367 ///
17368 /// # Example
17369 /// ```ignore,no_run
17370 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17371 /// let x = MirroringEndpointGroupAssociation::new().set_name("example");
17372 /// ```
17373 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17374 self.name = v.into();
17375 self
17376 }
17377
17378 /// Sets the value of [create_time][crate::model::MirroringEndpointGroupAssociation::create_time].
17379 ///
17380 /// # Example
17381 /// ```ignore,no_run
17382 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17383 /// use wkt::Timestamp;
17384 /// let x = MirroringEndpointGroupAssociation::new().set_create_time(Timestamp::default()/* use setters */);
17385 /// ```
17386 pub fn set_create_time<T>(mut self, v: T) -> Self
17387 where
17388 T: std::convert::Into<wkt::Timestamp>,
17389 {
17390 self.create_time = std::option::Option::Some(v.into());
17391 self
17392 }
17393
17394 /// Sets or clears the value of [create_time][crate::model::MirroringEndpointGroupAssociation::create_time].
17395 ///
17396 /// # Example
17397 /// ```ignore,no_run
17398 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17399 /// use wkt::Timestamp;
17400 /// let x = MirroringEndpointGroupAssociation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
17401 /// let x = MirroringEndpointGroupAssociation::new().set_or_clear_create_time(None::<Timestamp>);
17402 /// ```
17403 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
17404 where
17405 T: std::convert::Into<wkt::Timestamp>,
17406 {
17407 self.create_time = v.map(|x| x.into());
17408 self
17409 }
17410
17411 /// Sets the value of [update_time][crate::model::MirroringEndpointGroupAssociation::update_time].
17412 ///
17413 /// # Example
17414 /// ```ignore,no_run
17415 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17416 /// use wkt::Timestamp;
17417 /// let x = MirroringEndpointGroupAssociation::new().set_update_time(Timestamp::default()/* use setters */);
17418 /// ```
17419 pub fn set_update_time<T>(mut self, v: T) -> Self
17420 where
17421 T: std::convert::Into<wkt::Timestamp>,
17422 {
17423 self.update_time = std::option::Option::Some(v.into());
17424 self
17425 }
17426
17427 /// Sets or clears the value of [update_time][crate::model::MirroringEndpointGroupAssociation::update_time].
17428 ///
17429 /// # Example
17430 /// ```ignore,no_run
17431 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17432 /// use wkt::Timestamp;
17433 /// let x = MirroringEndpointGroupAssociation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
17434 /// let x = MirroringEndpointGroupAssociation::new().set_or_clear_update_time(None::<Timestamp>);
17435 /// ```
17436 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
17437 where
17438 T: std::convert::Into<wkt::Timestamp>,
17439 {
17440 self.update_time = v.map(|x| x.into());
17441 self
17442 }
17443
17444 /// Sets the value of [labels][crate::model::MirroringEndpointGroupAssociation::labels].
17445 ///
17446 /// # Example
17447 /// ```ignore,no_run
17448 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17449 /// let x = MirroringEndpointGroupAssociation::new().set_labels([
17450 /// ("key0", "abc"),
17451 /// ("key1", "xyz"),
17452 /// ]);
17453 /// ```
17454 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
17455 where
17456 T: std::iter::IntoIterator<Item = (K, V)>,
17457 K: std::convert::Into<std::string::String>,
17458 V: std::convert::Into<std::string::String>,
17459 {
17460 use std::iter::Iterator;
17461 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17462 self
17463 }
17464
17465 /// Sets the value of [mirroring_endpoint_group][crate::model::MirroringEndpointGroupAssociation::mirroring_endpoint_group].
17466 ///
17467 /// # Example
17468 /// ```ignore,no_run
17469 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17470 /// let x = MirroringEndpointGroupAssociation::new().set_mirroring_endpoint_group("example");
17471 /// ```
17472 pub fn set_mirroring_endpoint_group<T: std::convert::Into<std::string::String>>(
17473 mut self,
17474 v: T,
17475 ) -> Self {
17476 self.mirroring_endpoint_group = v.into();
17477 self
17478 }
17479
17480 /// Sets the value of [network][crate::model::MirroringEndpointGroupAssociation::network].
17481 ///
17482 /// # Example
17483 /// ```ignore,no_run
17484 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17485 /// let x = MirroringEndpointGroupAssociation::new().set_network("example");
17486 /// ```
17487 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17488 self.network = v.into();
17489 self
17490 }
17491
17492 /// Sets the value of [locations_details][crate::model::MirroringEndpointGroupAssociation::locations_details].
17493 ///
17494 /// # Example
17495 /// ```ignore,no_run
17496 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17497 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::LocationDetails;
17498 /// let x = MirroringEndpointGroupAssociation::new()
17499 /// .set_locations_details([
17500 /// LocationDetails::default()/* use setters */,
17501 /// LocationDetails::default()/* use (different) setters */,
17502 /// ]);
17503 /// ```
17504 #[deprecated]
17505 pub fn set_locations_details<T, V>(mut self, v: T) -> Self
17506 where
17507 T: std::iter::IntoIterator<Item = V>,
17508 V: std::convert::Into<crate::model::mirroring_endpoint_group_association::LocationDetails>,
17509 {
17510 use std::iter::Iterator;
17511 self.locations_details = v.into_iter().map(|i| i.into()).collect();
17512 self
17513 }
17514
17515 /// Sets the value of [state][crate::model::MirroringEndpointGroupAssociation::state].
17516 ///
17517 /// # Example
17518 /// ```ignore,no_run
17519 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17520 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::State;
17521 /// let x0 = MirroringEndpointGroupAssociation::new().set_state(State::Active);
17522 /// let x1 = MirroringEndpointGroupAssociation::new().set_state(State::Creating);
17523 /// let x2 = MirroringEndpointGroupAssociation::new().set_state(State::Deleting);
17524 /// ```
17525 pub fn set_state<
17526 T: std::convert::Into<crate::model::mirroring_endpoint_group_association::State>,
17527 >(
17528 mut self,
17529 v: T,
17530 ) -> Self {
17531 self.state = v.into();
17532 self
17533 }
17534
17535 /// Sets the value of [reconciling][crate::model::MirroringEndpointGroupAssociation::reconciling].
17536 ///
17537 /// # Example
17538 /// ```ignore,no_run
17539 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17540 /// let x = MirroringEndpointGroupAssociation::new().set_reconciling(true);
17541 /// ```
17542 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17543 self.reconciling = v.into();
17544 self
17545 }
17546
17547 /// Sets the value of [locations][crate::model::MirroringEndpointGroupAssociation::locations].
17548 ///
17549 /// # Example
17550 /// ```ignore,no_run
17551 /// # use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
17552 /// use google_cloud_networksecurity_v1::model::MirroringLocation;
17553 /// let x = MirroringEndpointGroupAssociation::new()
17554 /// .set_locations([
17555 /// MirroringLocation::default()/* use setters */,
17556 /// MirroringLocation::default()/* use (different) setters */,
17557 /// ]);
17558 /// ```
17559 pub fn set_locations<T, V>(mut self, v: T) -> Self
17560 where
17561 T: std::iter::IntoIterator<Item = V>,
17562 V: std::convert::Into<crate::model::MirroringLocation>,
17563 {
17564 use std::iter::Iterator;
17565 self.locations = v.into_iter().map(|i| i.into()).collect();
17566 self
17567 }
17568}
17569
17570impl wkt::message::Message for MirroringEndpointGroupAssociation {
17571 fn typename() -> &'static str {
17572 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation"
17573 }
17574}
17575
17576/// Defines additional types related to [MirroringEndpointGroupAssociation].
17577pub mod mirroring_endpoint_group_association {
17578 #[allow(unused_imports)]
17579 use super::*;
17580
17581 /// Contains details about the state of an association in a specific cloud
17582 /// location.
17583 #[derive(Clone, Default, PartialEq)]
17584 #[non_exhaustive]
17585 pub struct LocationDetails {
17586 /// Output only. The cloud location, e.g. "us-central1-a" or "asia-south1".
17587 pub location: std::string::String,
17588
17589 /// Output only. The current state of the association in this location.
17590 pub state: crate::model::mirroring_endpoint_group_association::location_details::State,
17591
17592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17593 }
17594
17595 impl LocationDetails {
17596 pub fn new() -> Self {
17597 std::default::Default::default()
17598 }
17599
17600 /// Sets the value of [location][crate::model::mirroring_endpoint_group_association::LocationDetails::location].
17601 ///
17602 /// # Example
17603 /// ```ignore,no_run
17604 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::LocationDetails;
17605 /// let x = LocationDetails::new().set_location("example");
17606 /// ```
17607 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17608 self.location = v.into();
17609 self
17610 }
17611
17612 /// Sets the value of [state][crate::model::mirroring_endpoint_group_association::LocationDetails::state].
17613 ///
17614 /// # Example
17615 /// ```ignore,no_run
17616 /// # use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::LocationDetails;
17617 /// use google_cloud_networksecurity_v1::model::mirroring_endpoint_group_association::location_details::State;
17618 /// let x0 = LocationDetails::new().set_state(State::Active);
17619 /// let x1 = LocationDetails::new().set_state(State::OutOfSync);
17620 /// ```
17621 pub fn set_state<
17622 T: std::convert::Into<
17623 crate::model::mirroring_endpoint_group_association::location_details::State,
17624 >,
17625 >(
17626 mut self,
17627 v: T,
17628 ) -> Self {
17629 self.state = v.into();
17630 self
17631 }
17632 }
17633
17634 impl wkt::message::Message for LocationDetails {
17635 fn typename() -> &'static str {
17636 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails"
17637 }
17638 }
17639
17640 /// Defines additional types related to [LocationDetails].
17641 pub mod location_details {
17642 #[allow(unused_imports)]
17643 use super::*;
17644
17645 /// The state of association.
17646 ///
17647 /// # Working with unknown values
17648 ///
17649 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17650 /// additional enum variants at any time. Adding new variants is not considered
17651 /// a breaking change. Applications should write their code in anticipation of:
17652 ///
17653 /// - New values appearing in future releases of the client library, **and**
17654 /// - New values received dynamically, without application changes.
17655 ///
17656 /// Please consult the [Working with enums] section in the user guide for some
17657 /// guidelines.
17658 ///
17659 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17660 #[derive(Clone, Debug, PartialEq)]
17661 #[non_exhaustive]
17662 pub enum State {
17663 /// Not set.
17664 Unspecified,
17665 /// The association is ready and in sync with the linked endpoint group.
17666 Active,
17667 /// The association is out of sync with the linked endpoint group.
17668 /// In most cases, this is a result of a transient issue within the system
17669 /// (e.g. an inaccessible location) and the system is expected to recover
17670 /// automatically.
17671 OutOfSync,
17672 /// If set, the enum was initialized with an unknown value.
17673 ///
17674 /// Applications can examine the value using [State::value] or
17675 /// [State::name].
17676 UnknownValue(state::UnknownValue),
17677 }
17678
17679 #[doc(hidden)]
17680 pub mod state {
17681 #[allow(unused_imports)]
17682 use super::*;
17683 #[derive(Clone, Debug, PartialEq)]
17684 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17685 }
17686
17687 impl State {
17688 /// Gets the enum value.
17689 ///
17690 /// Returns `None` if the enum contains an unknown value deserialized from
17691 /// the string representation of enums.
17692 pub fn value(&self) -> std::option::Option<i32> {
17693 match self {
17694 Self::Unspecified => std::option::Option::Some(0),
17695 Self::Active => std::option::Option::Some(1),
17696 Self::OutOfSync => std::option::Option::Some(2),
17697 Self::UnknownValue(u) => u.0.value(),
17698 }
17699 }
17700
17701 /// Gets the enum value as a string.
17702 ///
17703 /// Returns `None` if the enum contains an unknown value deserialized from
17704 /// the integer representation of enums.
17705 pub fn name(&self) -> std::option::Option<&str> {
17706 match self {
17707 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17708 Self::Active => std::option::Option::Some("ACTIVE"),
17709 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
17710 Self::UnknownValue(u) => u.0.name(),
17711 }
17712 }
17713 }
17714
17715 impl std::default::Default for State {
17716 fn default() -> Self {
17717 use std::convert::From;
17718 Self::from(0)
17719 }
17720 }
17721
17722 impl std::fmt::Display for State {
17723 fn fmt(
17724 &self,
17725 f: &mut std::fmt::Formatter<'_>,
17726 ) -> std::result::Result<(), std::fmt::Error> {
17727 wkt::internal::display_enum(f, self.name(), self.value())
17728 }
17729 }
17730
17731 impl std::convert::From<i32> for State {
17732 fn from(value: i32) -> Self {
17733 match value {
17734 0 => Self::Unspecified,
17735 1 => Self::Active,
17736 2 => Self::OutOfSync,
17737 _ => Self::UnknownValue(state::UnknownValue(
17738 wkt::internal::UnknownEnumValue::Integer(value),
17739 )),
17740 }
17741 }
17742 }
17743
17744 impl std::convert::From<&str> for State {
17745 fn from(value: &str) -> Self {
17746 use std::string::ToString;
17747 match value {
17748 "STATE_UNSPECIFIED" => Self::Unspecified,
17749 "ACTIVE" => Self::Active,
17750 "OUT_OF_SYNC" => Self::OutOfSync,
17751 _ => Self::UnknownValue(state::UnknownValue(
17752 wkt::internal::UnknownEnumValue::String(value.to_string()),
17753 )),
17754 }
17755 }
17756 }
17757
17758 impl serde::ser::Serialize for State {
17759 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17760 where
17761 S: serde::Serializer,
17762 {
17763 match self {
17764 Self::Unspecified => serializer.serialize_i32(0),
17765 Self::Active => serializer.serialize_i32(1),
17766 Self::OutOfSync => serializer.serialize_i32(2),
17767 Self::UnknownValue(u) => u.0.serialize(serializer),
17768 }
17769 }
17770 }
17771
17772 impl<'de> serde::de::Deserialize<'de> for State {
17773 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17774 where
17775 D: serde::Deserializer<'de>,
17776 {
17777 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
17778 ".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.State"))
17779 }
17780 }
17781 }
17782
17783 /// The state of the association.
17784 ///
17785 /// # Working with unknown values
17786 ///
17787 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17788 /// additional enum variants at any time. Adding new variants is not considered
17789 /// a breaking change. Applications should write their code in anticipation of:
17790 ///
17791 /// - New values appearing in future releases of the client library, **and**
17792 /// - New values received dynamically, without application changes.
17793 ///
17794 /// Please consult the [Working with enums] section in the user guide for some
17795 /// guidelines.
17796 ///
17797 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17798 #[derive(Clone, Debug, PartialEq)]
17799 #[non_exhaustive]
17800 pub enum State {
17801 /// Not set.
17802 Unspecified,
17803 /// The association is ready and in sync with the linked endpoint group.
17804 Active,
17805 /// The association is being created.
17806 Creating,
17807 /// The association is being deleted.
17808 Deleting,
17809 /// The association is disabled due to a breaking change in another resource.
17810 Closed,
17811 /// The association is out of sync with the linked endpoint group.
17812 /// In most cases, this is a result of a transient issue within the system
17813 /// (e.g. an inaccessible location) and the system is expected to recover
17814 /// automatically. Check the `locations_details` field for more details.
17815 OutOfSync,
17816 /// An attempt to delete the association has failed. This is a terminal state
17817 /// and the association is not expected to be usable as some of its resources
17818 /// have been deleted.
17819 /// The only permitted operation is to retry deleting the association.
17820 DeleteFailed,
17821 /// If set, the enum was initialized with an unknown value.
17822 ///
17823 /// Applications can examine the value using [State::value] or
17824 /// [State::name].
17825 UnknownValue(state::UnknownValue),
17826 }
17827
17828 #[doc(hidden)]
17829 pub mod state {
17830 #[allow(unused_imports)]
17831 use super::*;
17832 #[derive(Clone, Debug, PartialEq)]
17833 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17834 }
17835
17836 impl State {
17837 /// Gets the enum value.
17838 ///
17839 /// Returns `None` if the enum contains an unknown value deserialized from
17840 /// the string representation of enums.
17841 pub fn value(&self) -> std::option::Option<i32> {
17842 match self {
17843 Self::Unspecified => std::option::Option::Some(0),
17844 Self::Active => std::option::Option::Some(1),
17845 Self::Creating => std::option::Option::Some(3),
17846 Self::Deleting => std::option::Option::Some(4),
17847 Self::Closed => std::option::Option::Some(5),
17848 Self::OutOfSync => std::option::Option::Some(6),
17849 Self::DeleteFailed => std::option::Option::Some(7),
17850 Self::UnknownValue(u) => u.0.value(),
17851 }
17852 }
17853
17854 /// Gets the enum value as a string.
17855 ///
17856 /// Returns `None` if the enum contains an unknown value deserialized from
17857 /// the integer representation of enums.
17858 pub fn name(&self) -> std::option::Option<&str> {
17859 match self {
17860 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
17861 Self::Active => std::option::Option::Some("ACTIVE"),
17862 Self::Creating => std::option::Option::Some("CREATING"),
17863 Self::Deleting => std::option::Option::Some("DELETING"),
17864 Self::Closed => std::option::Option::Some("CLOSED"),
17865 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
17866 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
17867 Self::UnknownValue(u) => u.0.name(),
17868 }
17869 }
17870 }
17871
17872 impl std::default::Default for State {
17873 fn default() -> Self {
17874 use std::convert::From;
17875 Self::from(0)
17876 }
17877 }
17878
17879 impl std::fmt::Display for State {
17880 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17881 wkt::internal::display_enum(f, self.name(), self.value())
17882 }
17883 }
17884
17885 impl std::convert::From<i32> for State {
17886 fn from(value: i32) -> Self {
17887 match value {
17888 0 => Self::Unspecified,
17889 1 => Self::Active,
17890 3 => Self::Creating,
17891 4 => Self::Deleting,
17892 5 => Self::Closed,
17893 6 => Self::OutOfSync,
17894 7 => Self::DeleteFailed,
17895 _ => Self::UnknownValue(state::UnknownValue(
17896 wkt::internal::UnknownEnumValue::Integer(value),
17897 )),
17898 }
17899 }
17900 }
17901
17902 impl std::convert::From<&str> for State {
17903 fn from(value: &str) -> Self {
17904 use std::string::ToString;
17905 match value {
17906 "STATE_UNSPECIFIED" => Self::Unspecified,
17907 "ACTIVE" => Self::Active,
17908 "CREATING" => Self::Creating,
17909 "DELETING" => Self::Deleting,
17910 "CLOSED" => Self::Closed,
17911 "OUT_OF_SYNC" => Self::OutOfSync,
17912 "DELETE_FAILED" => Self::DeleteFailed,
17913 _ => Self::UnknownValue(state::UnknownValue(
17914 wkt::internal::UnknownEnumValue::String(value.to_string()),
17915 )),
17916 }
17917 }
17918 }
17919
17920 impl serde::ser::Serialize for State {
17921 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17922 where
17923 S: serde::Serializer,
17924 {
17925 match self {
17926 Self::Unspecified => serializer.serialize_i32(0),
17927 Self::Active => serializer.serialize_i32(1),
17928 Self::Creating => serializer.serialize_i32(3),
17929 Self::Deleting => serializer.serialize_i32(4),
17930 Self::Closed => serializer.serialize_i32(5),
17931 Self::OutOfSync => serializer.serialize_i32(6),
17932 Self::DeleteFailed => serializer.serialize_i32(7),
17933 Self::UnknownValue(u) => u.0.serialize(serializer),
17934 }
17935 }
17936 }
17937
17938 impl<'de> serde::de::Deserialize<'de> for State {
17939 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17940 where
17941 D: serde::Deserializer<'de>,
17942 {
17943 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
17944 ".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State",
17945 ))
17946 }
17947 }
17948}
17949
17950/// Request message for ListMirroringEndpointGroupAssociations.
17951#[derive(Clone, Default, PartialEq)]
17952#[non_exhaustive]
17953pub struct ListMirroringEndpointGroupAssociationsRequest {
17954 /// Required. The parent, which owns this collection of associations.
17955 /// Example: `projects/123456789/locations/global`.
17956 /// See <https://google.aip.dev/132> for more details.
17957 pub parent: std::string::String,
17958
17959 /// Optional. Requested page size. Server may return fewer items than
17960 /// requested. If unspecified, server will pick an appropriate default. See
17961 /// <https://google.aip.dev/158> for more details.
17962 pub page_size: i32,
17963
17964 /// Optional. A page token, received from a previous
17965 /// `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent
17966 /// page. When paginating, all other parameters provided to
17967 /// `ListMirroringEndpointGroups` must match the call that provided the page
17968 /// token. See <https://google.aip.dev/158> for more details.
17969 pub page_token: std::string::String,
17970
17971 /// Optional. Filter expression.
17972 /// See <https://google.aip.dev/160#filtering> for more details.
17973 pub filter: std::string::String,
17974
17975 /// Optional. Sort expression.
17976 /// See <https://google.aip.dev/132#ordering> for more details.
17977 pub order_by: std::string::String,
17978
17979 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17980}
17981
17982impl ListMirroringEndpointGroupAssociationsRequest {
17983 pub fn new() -> Self {
17984 std::default::Default::default()
17985 }
17986
17987 /// Sets the value of [parent][crate::model::ListMirroringEndpointGroupAssociationsRequest::parent].
17988 ///
17989 /// # Example
17990 /// ```ignore,no_run
17991 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
17992 /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_parent("example");
17993 /// ```
17994 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17995 self.parent = v.into();
17996 self
17997 }
17998
17999 /// Sets the value of [page_size][crate::model::ListMirroringEndpointGroupAssociationsRequest::page_size].
18000 ///
18001 /// # Example
18002 /// ```ignore,no_run
18003 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18004 /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_page_size(42);
18005 /// ```
18006 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18007 self.page_size = v.into();
18008 self
18009 }
18010
18011 /// Sets the value of [page_token][crate::model::ListMirroringEndpointGroupAssociationsRequest::page_token].
18012 ///
18013 /// # Example
18014 /// ```ignore,no_run
18015 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18016 /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_page_token("example");
18017 /// ```
18018 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18019 self.page_token = v.into();
18020 self
18021 }
18022
18023 /// Sets the value of [filter][crate::model::ListMirroringEndpointGroupAssociationsRequest::filter].
18024 ///
18025 /// # Example
18026 /// ```ignore,no_run
18027 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18028 /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_filter("example");
18029 /// ```
18030 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18031 self.filter = v.into();
18032 self
18033 }
18034
18035 /// Sets the value of [order_by][crate::model::ListMirroringEndpointGroupAssociationsRequest::order_by].
18036 ///
18037 /// # Example
18038 /// ```ignore,no_run
18039 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsRequest;
18040 /// let x = ListMirroringEndpointGroupAssociationsRequest::new().set_order_by("example");
18041 /// ```
18042 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18043 self.order_by = v.into();
18044 self
18045 }
18046}
18047
18048impl wkt::message::Message for ListMirroringEndpointGroupAssociationsRequest {
18049 fn typename() -> &'static str {
18050 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest"
18051 }
18052}
18053
18054/// Response message for ListMirroringEndpointGroupAssociations.
18055#[derive(Clone, Default, PartialEq)]
18056#[non_exhaustive]
18057pub struct ListMirroringEndpointGroupAssociationsResponse {
18058 /// The associations from the specified parent.
18059 pub mirroring_endpoint_group_associations:
18060 std::vec::Vec<crate::model::MirroringEndpointGroupAssociation>,
18061
18062 /// A token that can be sent as `page_token` to retrieve the next page.
18063 /// If this field is omitted, there are no subsequent pages.
18064 /// See <https://google.aip.dev/158> for more details.
18065 pub next_page_token: std::string::String,
18066
18067 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18068}
18069
18070impl ListMirroringEndpointGroupAssociationsResponse {
18071 pub fn new() -> Self {
18072 std::default::Default::default()
18073 }
18074
18075 /// Sets the value of [mirroring_endpoint_group_associations][crate::model::ListMirroringEndpointGroupAssociationsResponse::mirroring_endpoint_group_associations].
18076 ///
18077 /// # Example
18078 /// ```ignore,no_run
18079 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsResponse;
18080 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18081 /// let x = ListMirroringEndpointGroupAssociationsResponse::new()
18082 /// .set_mirroring_endpoint_group_associations([
18083 /// MirroringEndpointGroupAssociation::default()/* use setters */,
18084 /// MirroringEndpointGroupAssociation::default()/* use (different) setters */,
18085 /// ]);
18086 /// ```
18087 pub fn set_mirroring_endpoint_group_associations<T, V>(mut self, v: T) -> Self
18088 where
18089 T: std::iter::IntoIterator<Item = V>,
18090 V: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18091 {
18092 use std::iter::Iterator;
18093 self.mirroring_endpoint_group_associations = v.into_iter().map(|i| i.into()).collect();
18094 self
18095 }
18096
18097 /// Sets the value of [next_page_token][crate::model::ListMirroringEndpointGroupAssociationsResponse::next_page_token].
18098 ///
18099 /// # Example
18100 /// ```ignore,no_run
18101 /// # use google_cloud_networksecurity_v1::model::ListMirroringEndpointGroupAssociationsResponse;
18102 /// let x = ListMirroringEndpointGroupAssociationsResponse::new().set_next_page_token("example");
18103 /// ```
18104 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18105 self.next_page_token = v.into();
18106 self
18107 }
18108}
18109
18110impl wkt::message::Message for ListMirroringEndpointGroupAssociationsResponse {
18111 fn typename() -> &'static str {
18112 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse"
18113 }
18114}
18115
18116#[doc(hidden)]
18117impl google_cloud_gax::paginator::internal::PageableResponse
18118 for ListMirroringEndpointGroupAssociationsResponse
18119{
18120 type PageItem = crate::model::MirroringEndpointGroupAssociation;
18121
18122 fn items(self) -> std::vec::Vec<Self::PageItem> {
18123 self.mirroring_endpoint_group_associations
18124 }
18125
18126 fn next_page_token(&self) -> std::string::String {
18127 use std::clone::Clone;
18128 self.next_page_token.clone()
18129 }
18130}
18131
18132/// Request message for GetMirroringEndpointGroupAssociation.
18133#[derive(Clone, Default, PartialEq)]
18134#[non_exhaustive]
18135pub struct GetMirroringEndpointGroupAssociationRequest {
18136 /// Required. The name of the association to retrieve.
18137 /// Format:
18138 /// projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association}
18139 pub name: std::string::String,
18140
18141 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18142}
18143
18144impl GetMirroringEndpointGroupAssociationRequest {
18145 pub fn new() -> Self {
18146 std::default::Default::default()
18147 }
18148
18149 /// Sets the value of [name][crate::model::GetMirroringEndpointGroupAssociationRequest::name].
18150 ///
18151 /// # Example
18152 /// ```ignore,no_run
18153 /// # use google_cloud_networksecurity_v1::model::GetMirroringEndpointGroupAssociationRequest;
18154 /// let x = GetMirroringEndpointGroupAssociationRequest::new().set_name("example");
18155 /// ```
18156 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18157 self.name = v.into();
18158 self
18159 }
18160}
18161
18162impl wkt::message::Message for GetMirroringEndpointGroupAssociationRequest {
18163 fn typename() -> &'static str {
18164 "type.googleapis.com/google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest"
18165 }
18166}
18167
18168/// Request message for CreateMirroringEndpointGroupAssociation.
18169#[derive(Clone, Default, PartialEq)]
18170#[non_exhaustive]
18171pub struct CreateMirroringEndpointGroupAssociationRequest {
18172 /// Required. The parent resource where this association will be created.
18173 /// Format: projects/{project}/locations/{location}
18174 pub parent: std::string::String,
18175
18176 /// Optional. The ID to use for the new association, which will become the
18177 /// final component of the endpoint group's resource name. If not provided, the
18178 /// server will generate a unique ID.
18179 pub mirroring_endpoint_group_association_id: std::string::String,
18180
18181 /// Required. The association to create.
18182 pub mirroring_endpoint_group_association:
18183 std::option::Option<crate::model::MirroringEndpointGroupAssociation>,
18184
18185 /// Optional. A unique identifier for this request. Must be a UUID4.
18186 /// This request is only idempotent if a `request_id` is provided.
18187 /// See <https://google.aip.dev/155> for more details.
18188 pub request_id: std::string::String,
18189
18190 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18191}
18192
18193impl CreateMirroringEndpointGroupAssociationRequest {
18194 pub fn new() -> Self {
18195 std::default::Default::default()
18196 }
18197
18198 /// Sets the value of [parent][crate::model::CreateMirroringEndpointGroupAssociationRequest::parent].
18199 ///
18200 /// # Example
18201 /// ```ignore,no_run
18202 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18203 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_parent("example");
18204 /// ```
18205 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18206 self.parent = v.into();
18207 self
18208 }
18209
18210 /// Sets the value of [mirroring_endpoint_group_association_id][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association_id].
18211 ///
18212 /// # Example
18213 /// ```ignore,no_run
18214 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18215 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_mirroring_endpoint_group_association_id("example");
18216 /// ```
18217 pub fn set_mirroring_endpoint_group_association_id<
18218 T: std::convert::Into<std::string::String>,
18219 >(
18220 mut self,
18221 v: T,
18222 ) -> Self {
18223 self.mirroring_endpoint_group_association_id = v.into();
18224 self
18225 }
18226
18227 /// Sets the value of [mirroring_endpoint_group_association][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
18228 ///
18229 /// # Example
18230 /// ```ignore,no_run
18231 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18232 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18233 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_mirroring_endpoint_group_association(MirroringEndpointGroupAssociation::default()/* use setters */);
18234 /// ```
18235 pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
18236 where
18237 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18238 {
18239 self.mirroring_endpoint_group_association = std::option::Option::Some(v.into());
18240 self
18241 }
18242
18243 /// Sets or clears the value of [mirroring_endpoint_group_association][crate::model::CreateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
18244 ///
18245 /// # Example
18246 /// ```ignore,no_run
18247 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18248 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18249 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_or_clear_mirroring_endpoint_group_association(Some(MirroringEndpointGroupAssociation::default()/* use setters */));
18250 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_or_clear_mirroring_endpoint_group_association(None::<MirroringEndpointGroupAssociation>);
18251 /// ```
18252 pub fn set_or_clear_mirroring_endpoint_group_association<T>(
18253 mut self,
18254 v: std::option::Option<T>,
18255 ) -> Self
18256 where
18257 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18258 {
18259 self.mirroring_endpoint_group_association = v.map(|x| x.into());
18260 self
18261 }
18262
18263 /// Sets the value of [request_id][crate::model::CreateMirroringEndpointGroupAssociationRequest::request_id].
18264 ///
18265 /// # Example
18266 /// ```ignore,no_run
18267 /// # use google_cloud_networksecurity_v1::model::CreateMirroringEndpointGroupAssociationRequest;
18268 /// let x = CreateMirroringEndpointGroupAssociationRequest::new().set_request_id("example");
18269 /// ```
18270 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18271 self.request_id = v.into();
18272 self
18273 }
18274}
18275
18276impl wkt::message::Message for CreateMirroringEndpointGroupAssociationRequest {
18277 fn typename() -> &'static str {
18278 "type.googleapis.com/google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest"
18279 }
18280}
18281
18282/// Request message for UpdateMirroringEndpointGroupAssociation.
18283#[derive(Clone, Default, PartialEq)]
18284#[non_exhaustive]
18285pub struct UpdateMirroringEndpointGroupAssociationRequest {
18286 /// Optional. The list of fields to update.
18287 /// Fields are specified relative to the association
18288 /// (e.g. `description`; *not*
18289 /// `mirroring_endpoint_group_association.description`). See
18290 /// <https://google.aip.dev/161> for more details.
18291 pub update_mask: std::option::Option<wkt::FieldMask>,
18292
18293 /// Required. The association to update.
18294 pub mirroring_endpoint_group_association:
18295 std::option::Option<crate::model::MirroringEndpointGroupAssociation>,
18296
18297 /// Optional. A unique identifier for this request. Must be a UUID4.
18298 /// This request is only idempotent if a `request_id` is provided.
18299 /// See <https://google.aip.dev/155> for more details.
18300 pub request_id: std::string::String,
18301
18302 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18303}
18304
18305impl UpdateMirroringEndpointGroupAssociationRequest {
18306 pub fn new() -> Self {
18307 std::default::Default::default()
18308 }
18309
18310 /// Sets the value of [update_mask][crate::model::UpdateMirroringEndpointGroupAssociationRequest::update_mask].
18311 ///
18312 /// # Example
18313 /// ```ignore,no_run
18314 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18315 /// use wkt::FieldMask;
18316 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
18317 /// ```
18318 pub fn set_update_mask<T>(mut self, v: T) -> Self
18319 where
18320 T: std::convert::Into<wkt::FieldMask>,
18321 {
18322 self.update_mask = std::option::Option::Some(v.into());
18323 self
18324 }
18325
18326 /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringEndpointGroupAssociationRequest::update_mask].
18327 ///
18328 /// # Example
18329 /// ```ignore,no_run
18330 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18331 /// use wkt::FieldMask;
18332 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
18333 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
18334 /// ```
18335 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18336 where
18337 T: std::convert::Into<wkt::FieldMask>,
18338 {
18339 self.update_mask = v.map(|x| x.into());
18340 self
18341 }
18342
18343 /// Sets the value of [mirroring_endpoint_group_association][crate::model::UpdateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
18344 ///
18345 /// # Example
18346 /// ```ignore,no_run
18347 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18348 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18349 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_mirroring_endpoint_group_association(MirroringEndpointGroupAssociation::default()/* use setters */);
18350 /// ```
18351 pub fn set_mirroring_endpoint_group_association<T>(mut self, v: T) -> Self
18352 where
18353 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18354 {
18355 self.mirroring_endpoint_group_association = std::option::Option::Some(v.into());
18356 self
18357 }
18358
18359 /// Sets or clears the value of [mirroring_endpoint_group_association][crate::model::UpdateMirroringEndpointGroupAssociationRequest::mirroring_endpoint_group_association].
18360 ///
18361 /// # Example
18362 /// ```ignore,no_run
18363 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18364 /// use google_cloud_networksecurity_v1::model::MirroringEndpointGroupAssociation;
18365 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_or_clear_mirroring_endpoint_group_association(Some(MirroringEndpointGroupAssociation::default()/* use setters */));
18366 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_or_clear_mirroring_endpoint_group_association(None::<MirroringEndpointGroupAssociation>);
18367 /// ```
18368 pub fn set_or_clear_mirroring_endpoint_group_association<T>(
18369 mut self,
18370 v: std::option::Option<T>,
18371 ) -> Self
18372 where
18373 T: std::convert::Into<crate::model::MirroringEndpointGroupAssociation>,
18374 {
18375 self.mirroring_endpoint_group_association = v.map(|x| x.into());
18376 self
18377 }
18378
18379 /// Sets the value of [request_id][crate::model::UpdateMirroringEndpointGroupAssociationRequest::request_id].
18380 ///
18381 /// # Example
18382 /// ```ignore,no_run
18383 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringEndpointGroupAssociationRequest;
18384 /// let x = UpdateMirroringEndpointGroupAssociationRequest::new().set_request_id("example");
18385 /// ```
18386 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18387 self.request_id = v.into();
18388 self
18389 }
18390}
18391
18392impl wkt::message::Message for UpdateMirroringEndpointGroupAssociationRequest {
18393 fn typename() -> &'static str {
18394 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest"
18395 }
18396}
18397
18398/// Request message for DeleteMirroringEndpointGroupAssociation.
18399#[derive(Clone, Default, PartialEq)]
18400#[non_exhaustive]
18401pub struct DeleteMirroringEndpointGroupAssociationRequest {
18402 /// Required. The association to delete.
18403 pub name: std::string::String,
18404
18405 /// Optional. A unique identifier for this request. Must be a UUID4.
18406 /// This request is only idempotent if a `request_id` is provided.
18407 /// See <https://google.aip.dev/155> for more details.
18408 pub request_id: std::string::String,
18409
18410 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18411}
18412
18413impl DeleteMirroringEndpointGroupAssociationRequest {
18414 pub fn new() -> Self {
18415 std::default::Default::default()
18416 }
18417
18418 /// Sets the value of [name][crate::model::DeleteMirroringEndpointGroupAssociationRequest::name].
18419 ///
18420 /// # Example
18421 /// ```ignore,no_run
18422 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringEndpointGroupAssociationRequest;
18423 /// let x = DeleteMirroringEndpointGroupAssociationRequest::new().set_name("example");
18424 /// ```
18425 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18426 self.name = v.into();
18427 self
18428 }
18429
18430 /// Sets the value of [request_id][crate::model::DeleteMirroringEndpointGroupAssociationRequest::request_id].
18431 ///
18432 /// # Example
18433 /// ```ignore,no_run
18434 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringEndpointGroupAssociationRequest;
18435 /// let x = DeleteMirroringEndpointGroupAssociationRequest::new().set_request_id("example");
18436 /// ```
18437 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18438 self.request_id = v.into();
18439 self
18440 }
18441}
18442
18443impl wkt::message::Message for DeleteMirroringEndpointGroupAssociationRequest {
18444 fn typename() -> &'static str {
18445 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest"
18446 }
18447}
18448
18449/// A deployment group aggregates many zonal mirroring backends (deployments)
18450/// into a single global mirroring service. Consumers can connect this service
18451/// using an endpoint group.
18452#[derive(Clone, Default, PartialEq)]
18453#[non_exhaustive]
18454pub struct MirroringDeploymentGroup {
18455 /// Immutable. Identifier. The resource name of this deployment group, for
18456 /// example:
18457 /// `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
18458 /// See <https://google.aip.dev/122> for more details.
18459 pub name: std::string::String,
18460
18461 /// Output only. The timestamp when the resource was created.
18462 /// See <https://google.aip.dev/148#timestamps>.
18463 pub create_time: std::option::Option<wkt::Timestamp>,
18464
18465 /// Output only. The timestamp when the resource was most recently updated.
18466 /// See <https://google.aip.dev/148#timestamps>.
18467 pub update_time: std::option::Option<wkt::Timestamp>,
18468
18469 /// Optional. Labels are key/value pairs that help to organize and filter
18470 /// resources.
18471 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
18472
18473 /// Required. Immutable. The network that will be used for all child
18474 /// deployments, for example: `projects/{project}/global/networks/{network}`.
18475 /// See <https://google.aip.dev/124>.
18476 pub network: std::string::String,
18477
18478 /// Output only. The list of endpoint groups that are connected to this
18479 /// resource.
18480 pub connected_endpoint_groups:
18481 std::vec::Vec<crate::model::mirroring_deployment_group::ConnectedEndpointGroup>,
18482
18483 /// Output only. The list of Mirroring Deployments that belong to this group.
18484 #[deprecated]
18485 pub nested_deployments: std::vec::Vec<crate::model::mirroring_deployment_group::Deployment>,
18486
18487 /// Output only. The current state of the deployment group.
18488 /// See <https://google.aip.dev/216>.
18489 pub state: crate::model::mirroring_deployment_group::State,
18490
18491 /// Output only. The current state of the resource does not match the user's
18492 /// intended state, and the system is working to reconcile them. This is part
18493 /// of the normal operation (e.g. adding a new deployment to the group) See
18494 /// <https://google.aip.dev/128>.
18495 pub reconciling: bool,
18496
18497 /// Optional. User-provided description of the deployment group.
18498 /// Used as additional context for the deployment group.
18499 pub description: std::string::String,
18500
18501 /// Output only. The list of locations where the deployment group is present.
18502 pub locations: std::vec::Vec<crate::model::MirroringLocation>,
18503
18504 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18505}
18506
18507impl MirroringDeploymentGroup {
18508 pub fn new() -> Self {
18509 std::default::Default::default()
18510 }
18511
18512 /// Sets the value of [name][crate::model::MirroringDeploymentGroup::name].
18513 ///
18514 /// # Example
18515 /// ```ignore,no_run
18516 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18517 /// let x = MirroringDeploymentGroup::new().set_name("example");
18518 /// ```
18519 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18520 self.name = v.into();
18521 self
18522 }
18523
18524 /// Sets the value of [create_time][crate::model::MirroringDeploymentGroup::create_time].
18525 ///
18526 /// # Example
18527 /// ```ignore,no_run
18528 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18529 /// use wkt::Timestamp;
18530 /// let x = MirroringDeploymentGroup::new().set_create_time(Timestamp::default()/* use setters */);
18531 /// ```
18532 pub fn set_create_time<T>(mut self, v: T) -> Self
18533 where
18534 T: std::convert::Into<wkt::Timestamp>,
18535 {
18536 self.create_time = std::option::Option::Some(v.into());
18537 self
18538 }
18539
18540 /// Sets or clears the value of [create_time][crate::model::MirroringDeploymentGroup::create_time].
18541 ///
18542 /// # Example
18543 /// ```ignore,no_run
18544 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18545 /// use wkt::Timestamp;
18546 /// let x = MirroringDeploymentGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
18547 /// let x = MirroringDeploymentGroup::new().set_or_clear_create_time(None::<Timestamp>);
18548 /// ```
18549 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
18550 where
18551 T: std::convert::Into<wkt::Timestamp>,
18552 {
18553 self.create_time = v.map(|x| x.into());
18554 self
18555 }
18556
18557 /// Sets the value of [update_time][crate::model::MirroringDeploymentGroup::update_time].
18558 ///
18559 /// # Example
18560 /// ```ignore,no_run
18561 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18562 /// use wkt::Timestamp;
18563 /// let x = MirroringDeploymentGroup::new().set_update_time(Timestamp::default()/* use setters */);
18564 /// ```
18565 pub fn set_update_time<T>(mut self, v: T) -> Self
18566 where
18567 T: std::convert::Into<wkt::Timestamp>,
18568 {
18569 self.update_time = std::option::Option::Some(v.into());
18570 self
18571 }
18572
18573 /// Sets or clears the value of [update_time][crate::model::MirroringDeploymentGroup::update_time].
18574 ///
18575 /// # Example
18576 /// ```ignore,no_run
18577 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18578 /// use wkt::Timestamp;
18579 /// let x = MirroringDeploymentGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
18580 /// let x = MirroringDeploymentGroup::new().set_or_clear_update_time(None::<Timestamp>);
18581 /// ```
18582 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
18583 where
18584 T: std::convert::Into<wkt::Timestamp>,
18585 {
18586 self.update_time = v.map(|x| x.into());
18587 self
18588 }
18589
18590 /// Sets the value of [labels][crate::model::MirroringDeploymentGroup::labels].
18591 ///
18592 /// # Example
18593 /// ```ignore,no_run
18594 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18595 /// let x = MirroringDeploymentGroup::new().set_labels([
18596 /// ("key0", "abc"),
18597 /// ("key1", "xyz"),
18598 /// ]);
18599 /// ```
18600 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
18601 where
18602 T: std::iter::IntoIterator<Item = (K, V)>,
18603 K: std::convert::Into<std::string::String>,
18604 V: std::convert::Into<std::string::String>,
18605 {
18606 use std::iter::Iterator;
18607 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18608 self
18609 }
18610
18611 /// Sets the value of [network][crate::model::MirroringDeploymentGroup::network].
18612 ///
18613 /// # Example
18614 /// ```ignore,no_run
18615 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18616 /// let x = MirroringDeploymentGroup::new().set_network("example");
18617 /// ```
18618 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18619 self.network = v.into();
18620 self
18621 }
18622
18623 /// Sets the value of [connected_endpoint_groups][crate::model::MirroringDeploymentGroup::connected_endpoint_groups].
18624 ///
18625 /// # Example
18626 /// ```ignore,no_run
18627 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18628 /// use google_cloud_networksecurity_v1::model::mirroring_deployment_group::ConnectedEndpointGroup;
18629 /// let x = MirroringDeploymentGroup::new()
18630 /// .set_connected_endpoint_groups([
18631 /// ConnectedEndpointGroup::default()/* use setters */,
18632 /// ConnectedEndpointGroup::default()/* use (different) setters */,
18633 /// ]);
18634 /// ```
18635 pub fn set_connected_endpoint_groups<T, V>(mut self, v: T) -> Self
18636 where
18637 T: std::iter::IntoIterator<Item = V>,
18638 V: std::convert::Into<crate::model::mirroring_deployment_group::ConnectedEndpointGroup>,
18639 {
18640 use std::iter::Iterator;
18641 self.connected_endpoint_groups = v.into_iter().map(|i| i.into()).collect();
18642 self
18643 }
18644
18645 /// Sets the value of [nested_deployments][crate::model::MirroringDeploymentGroup::nested_deployments].
18646 ///
18647 /// # Example
18648 /// ```ignore,no_run
18649 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18650 /// use google_cloud_networksecurity_v1::model::mirroring_deployment_group::Deployment;
18651 /// let x = MirroringDeploymentGroup::new()
18652 /// .set_nested_deployments([
18653 /// Deployment::default()/* use setters */,
18654 /// Deployment::default()/* use (different) setters */,
18655 /// ]);
18656 /// ```
18657 #[deprecated]
18658 pub fn set_nested_deployments<T, V>(mut self, v: T) -> Self
18659 where
18660 T: std::iter::IntoIterator<Item = V>,
18661 V: std::convert::Into<crate::model::mirroring_deployment_group::Deployment>,
18662 {
18663 use std::iter::Iterator;
18664 self.nested_deployments = v.into_iter().map(|i| i.into()).collect();
18665 self
18666 }
18667
18668 /// Sets the value of [state][crate::model::MirroringDeploymentGroup::state].
18669 ///
18670 /// # Example
18671 /// ```ignore,no_run
18672 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18673 /// use google_cloud_networksecurity_v1::model::mirroring_deployment_group::State;
18674 /// let x0 = MirroringDeploymentGroup::new().set_state(State::Active);
18675 /// let x1 = MirroringDeploymentGroup::new().set_state(State::Creating);
18676 /// let x2 = MirroringDeploymentGroup::new().set_state(State::Deleting);
18677 /// ```
18678 pub fn set_state<T: std::convert::Into<crate::model::mirroring_deployment_group::State>>(
18679 mut self,
18680 v: T,
18681 ) -> Self {
18682 self.state = v.into();
18683 self
18684 }
18685
18686 /// Sets the value of [reconciling][crate::model::MirroringDeploymentGroup::reconciling].
18687 ///
18688 /// # Example
18689 /// ```ignore,no_run
18690 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18691 /// let x = MirroringDeploymentGroup::new().set_reconciling(true);
18692 /// ```
18693 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18694 self.reconciling = v.into();
18695 self
18696 }
18697
18698 /// Sets the value of [description][crate::model::MirroringDeploymentGroup::description].
18699 ///
18700 /// # Example
18701 /// ```ignore,no_run
18702 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18703 /// let x = MirroringDeploymentGroup::new().set_description("example");
18704 /// ```
18705 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18706 self.description = v.into();
18707 self
18708 }
18709
18710 /// Sets the value of [locations][crate::model::MirroringDeploymentGroup::locations].
18711 ///
18712 /// # Example
18713 /// ```ignore,no_run
18714 /// # use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
18715 /// use google_cloud_networksecurity_v1::model::MirroringLocation;
18716 /// let x = MirroringDeploymentGroup::new()
18717 /// .set_locations([
18718 /// MirroringLocation::default()/* use setters */,
18719 /// MirroringLocation::default()/* use (different) setters */,
18720 /// ]);
18721 /// ```
18722 pub fn set_locations<T, V>(mut self, v: T) -> Self
18723 where
18724 T: std::iter::IntoIterator<Item = V>,
18725 V: std::convert::Into<crate::model::MirroringLocation>,
18726 {
18727 use std::iter::Iterator;
18728 self.locations = v.into_iter().map(|i| i.into()).collect();
18729 self
18730 }
18731}
18732
18733impl wkt::message::Message for MirroringDeploymentGroup {
18734 fn typename() -> &'static str {
18735 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringDeploymentGroup"
18736 }
18737}
18738
18739/// Defines additional types related to [MirroringDeploymentGroup].
18740pub mod mirroring_deployment_group {
18741 #[allow(unused_imports)]
18742 use super::*;
18743
18744 /// An endpoint group connected to this deployment group.
18745 #[derive(Clone, Default, PartialEq)]
18746 #[non_exhaustive]
18747 pub struct ConnectedEndpointGroup {
18748 /// Output only. The connected endpoint group's resource name, for example:
18749 /// `projects/123456789/locations/global/mirroringEndpointGroups/my-eg`.
18750 /// See <https://google.aip.dev/124>.
18751 pub name: std::string::String,
18752
18753 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18754 }
18755
18756 impl ConnectedEndpointGroup {
18757 pub fn new() -> Self {
18758 std::default::Default::default()
18759 }
18760
18761 /// Sets the value of [name][crate::model::mirroring_deployment_group::ConnectedEndpointGroup::name].
18762 ///
18763 /// # Example
18764 /// ```ignore,no_run
18765 /// # use google_cloud_networksecurity_v1::model::mirroring_deployment_group::ConnectedEndpointGroup;
18766 /// let x = ConnectedEndpointGroup::new().set_name("example");
18767 /// ```
18768 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18769 self.name = v.into();
18770 self
18771 }
18772 }
18773
18774 impl wkt::message::Message for ConnectedEndpointGroup {
18775 fn typename() -> &'static str {
18776 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup"
18777 }
18778 }
18779
18780 /// A deployment belonging to this deployment group.
18781 #[derive(Clone, Default, PartialEq)]
18782 #[non_exhaustive]
18783 pub struct Deployment {
18784 /// Output only. The name of the Mirroring Deployment, in the format:
18785 /// `projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}`.
18786 pub name: std::string::String,
18787
18788 /// Output only. Most recent known state of the deployment.
18789 pub state: crate::model::mirroring_deployment::State,
18790
18791 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18792 }
18793
18794 impl Deployment {
18795 pub fn new() -> Self {
18796 std::default::Default::default()
18797 }
18798
18799 /// Sets the value of [name][crate::model::mirroring_deployment_group::Deployment::name].
18800 ///
18801 /// # Example
18802 /// ```ignore,no_run
18803 /// # use google_cloud_networksecurity_v1::model::mirroring_deployment_group::Deployment;
18804 /// let x = Deployment::new().set_name("example");
18805 /// ```
18806 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18807 self.name = v.into();
18808 self
18809 }
18810
18811 /// Sets the value of [state][crate::model::mirroring_deployment_group::Deployment::state].
18812 ///
18813 /// # Example
18814 /// ```ignore,no_run
18815 /// # use google_cloud_networksecurity_v1::model::mirroring_deployment_group::Deployment;
18816 /// use google_cloud_networksecurity_v1::model::mirroring_deployment::State;
18817 /// let x0 = Deployment::new().set_state(State::Active);
18818 /// let x1 = Deployment::new().set_state(State::Creating);
18819 /// let x2 = Deployment::new().set_state(State::Deleting);
18820 /// ```
18821 pub fn set_state<T: std::convert::Into<crate::model::mirroring_deployment::State>>(
18822 mut self,
18823 v: T,
18824 ) -> Self {
18825 self.state = v.into();
18826 self
18827 }
18828 }
18829
18830 impl wkt::message::Message for Deployment {
18831 fn typename() -> &'static str {
18832 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment"
18833 }
18834 }
18835
18836 /// The current state of the deployment group.
18837 ///
18838 /// # Working with unknown values
18839 ///
18840 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18841 /// additional enum variants at any time. Adding new variants is not considered
18842 /// a breaking change. Applications should write their code in anticipation of:
18843 ///
18844 /// - New values appearing in future releases of the client library, **and**
18845 /// - New values received dynamically, without application changes.
18846 ///
18847 /// Please consult the [Working with enums] section in the user guide for some
18848 /// guidelines.
18849 ///
18850 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18851 #[derive(Clone, Debug, PartialEq)]
18852 #[non_exhaustive]
18853 pub enum State {
18854 /// State not set (this is not a valid state).
18855 Unspecified,
18856 /// The deployment group is ready.
18857 Active,
18858 /// The deployment group is being created.
18859 Creating,
18860 /// The deployment group is being deleted.
18861 Deleting,
18862 /// The deployment group is being wiped out (project deleted).
18863 Closed,
18864 /// If set, the enum was initialized with an unknown value.
18865 ///
18866 /// Applications can examine the value using [State::value] or
18867 /// [State::name].
18868 UnknownValue(state::UnknownValue),
18869 }
18870
18871 #[doc(hidden)]
18872 pub mod state {
18873 #[allow(unused_imports)]
18874 use super::*;
18875 #[derive(Clone, Debug, PartialEq)]
18876 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18877 }
18878
18879 impl State {
18880 /// Gets the enum value.
18881 ///
18882 /// Returns `None` if the enum contains an unknown value deserialized from
18883 /// the string representation of enums.
18884 pub fn value(&self) -> std::option::Option<i32> {
18885 match self {
18886 Self::Unspecified => std::option::Option::Some(0),
18887 Self::Active => std::option::Option::Some(1),
18888 Self::Creating => std::option::Option::Some(2),
18889 Self::Deleting => std::option::Option::Some(3),
18890 Self::Closed => std::option::Option::Some(4),
18891 Self::UnknownValue(u) => u.0.value(),
18892 }
18893 }
18894
18895 /// Gets the enum value as a string.
18896 ///
18897 /// Returns `None` if the enum contains an unknown value deserialized from
18898 /// the integer representation of enums.
18899 pub fn name(&self) -> std::option::Option<&str> {
18900 match self {
18901 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18902 Self::Active => std::option::Option::Some("ACTIVE"),
18903 Self::Creating => std::option::Option::Some("CREATING"),
18904 Self::Deleting => std::option::Option::Some("DELETING"),
18905 Self::Closed => std::option::Option::Some("CLOSED"),
18906 Self::UnknownValue(u) => u.0.name(),
18907 }
18908 }
18909 }
18910
18911 impl std::default::Default for State {
18912 fn default() -> Self {
18913 use std::convert::From;
18914 Self::from(0)
18915 }
18916 }
18917
18918 impl std::fmt::Display for State {
18919 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18920 wkt::internal::display_enum(f, self.name(), self.value())
18921 }
18922 }
18923
18924 impl std::convert::From<i32> for State {
18925 fn from(value: i32) -> Self {
18926 match value {
18927 0 => Self::Unspecified,
18928 1 => Self::Active,
18929 2 => Self::Creating,
18930 3 => Self::Deleting,
18931 4 => Self::Closed,
18932 _ => Self::UnknownValue(state::UnknownValue(
18933 wkt::internal::UnknownEnumValue::Integer(value),
18934 )),
18935 }
18936 }
18937 }
18938
18939 impl std::convert::From<&str> for State {
18940 fn from(value: &str) -> Self {
18941 use std::string::ToString;
18942 match value {
18943 "STATE_UNSPECIFIED" => Self::Unspecified,
18944 "ACTIVE" => Self::Active,
18945 "CREATING" => Self::Creating,
18946 "DELETING" => Self::Deleting,
18947 "CLOSED" => Self::Closed,
18948 _ => Self::UnknownValue(state::UnknownValue(
18949 wkt::internal::UnknownEnumValue::String(value.to_string()),
18950 )),
18951 }
18952 }
18953 }
18954
18955 impl serde::ser::Serialize for State {
18956 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18957 where
18958 S: serde::Serializer,
18959 {
18960 match self {
18961 Self::Unspecified => serializer.serialize_i32(0),
18962 Self::Active => serializer.serialize_i32(1),
18963 Self::Creating => serializer.serialize_i32(2),
18964 Self::Deleting => serializer.serialize_i32(3),
18965 Self::Closed => serializer.serialize_i32(4),
18966 Self::UnknownValue(u) => u.0.serialize(serializer),
18967 }
18968 }
18969 }
18970
18971 impl<'de> serde::de::Deserialize<'de> for State {
18972 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18973 where
18974 D: serde::Deserializer<'de>,
18975 {
18976 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18977 ".google.cloud.networksecurity.v1.MirroringDeploymentGroup.State",
18978 ))
18979 }
18980 }
18981}
18982
18983/// Request message for ListMirroringDeploymentGroups.
18984#[derive(Clone, Default, PartialEq)]
18985#[non_exhaustive]
18986pub struct ListMirroringDeploymentGroupsRequest {
18987 /// Required. The parent, which owns this collection of deployment groups.
18988 /// Example: `projects/123456789/locations/global`.
18989 /// See <https://google.aip.dev/132> for more details.
18990 pub parent: std::string::String,
18991
18992 /// Optional. Requested page size. Server may return fewer items than
18993 /// requested. If unspecified, server will pick an appropriate default. See
18994 /// <https://google.aip.dev/158> for more details.
18995 pub page_size: i32,
18996
18997 /// Optional. A page token, received from a previous
18998 /// `ListMirroringDeploymentGroups` call. Provide this to retrieve the
18999 /// subsequent page. When paginating, all other parameters provided to
19000 /// `ListMirroringDeploymentGroups` must match the call that provided the page
19001 /// token. See <https://google.aip.dev/158> for more details.
19002 pub page_token: std::string::String,
19003
19004 /// Optional. Filter expression.
19005 /// See <https://google.aip.dev/160#filtering> for more details.
19006 pub filter: std::string::String,
19007
19008 /// Optional. Sort expression.
19009 /// See <https://google.aip.dev/132#ordering> for more details.
19010 pub order_by: std::string::String,
19011
19012 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19013}
19014
19015impl ListMirroringDeploymentGroupsRequest {
19016 pub fn new() -> Self {
19017 std::default::Default::default()
19018 }
19019
19020 /// Sets the value of [parent][crate::model::ListMirroringDeploymentGroupsRequest::parent].
19021 ///
19022 /// # Example
19023 /// ```ignore,no_run
19024 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19025 /// let x = ListMirroringDeploymentGroupsRequest::new().set_parent("example");
19026 /// ```
19027 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19028 self.parent = v.into();
19029 self
19030 }
19031
19032 /// Sets the value of [page_size][crate::model::ListMirroringDeploymentGroupsRequest::page_size].
19033 ///
19034 /// # Example
19035 /// ```ignore,no_run
19036 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19037 /// let x = ListMirroringDeploymentGroupsRequest::new().set_page_size(42);
19038 /// ```
19039 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19040 self.page_size = v.into();
19041 self
19042 }
19043
19044 /// Sets the value of [page_token][crate::model::ListMirroringDeploymentGroupsRequest::page_token].
19045 ///
19046 /// # Example
19047 /// ```ignore,no_run
19048 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19049 /// let x = ListMirroringDeploymentGroupsRequest::new().set_page_token("example");
19050 /// ```
19051 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19052 self.page_token = v.into();
19053 self
19054 }
19055
19056 /// Sets the value of [filter][crate::model::ListMirroringDeploymentGroupsRequest::filter].
19057 ///
19058 /// # Example
19059 /// ```ignore,no_run
19060 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19061 /// let x = ListMirroringDeploymentGroupsRequest::new().set_filter("example");
19062 /// ```
19063 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19064 self.filter = v.into();
19065 self
19066 }
19067
19068 /// Sets the value of [order_by][crate::model::ListMirroringDeploymentGroupsRequest::order_by].
19069 ///
19070 /// # Example
19071 /// ```ignore,no_run
19072 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsRequest;
19073 /// let x = ListMirroringDeploymentGroupsRequest::new().set_order_by("example");
19074 /// ```
19075 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19076 self.order_by = v.into();
19077 self
19078 }
19079}
19080
19081impl wkt::message::Message for ListMirroringDeploymentGroupsRequest {
19082 fn typename() -> &'static str {
19083 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest"
19084 }
19085}
19086
19087/// Response message for ListMirroringDeploymentGroups.
19088#[derive(Clone, Default, PartialEq)]
19089#[non_exhaustive]
19090pub struct ListMirroringDeploymentGroupsResponse {
19091 /// The deployment groups from the specified parent.
19092 pub mirroring_deployment_groups: std::vec::Vec<crate::model::MirroringDeploymentGroup>,
19093
19094 /// A token that can be sent as `page_token` to retrieve the next page.
19095 /// If this field is omitted, there are no subsequent pages.
19096 /// See <https://google.aip.dev/158> for more details.
19097 pub next_page_token: std::string::String,
19098
19099 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19100}
19101
19102impl ListMirroringDeploymentGroupsResponse {
19103 pub fn new() -> Self {
19104 std::default::Default::default()
19105 }
19106
19107 /// Sets the value of [mirroring_deployment_groups][crate::model::ListMirroringDeploymentGroupsResponse::mirroring_deployment_groups].
19108 ///
19109 /// # Example
19110 /// ```ignore,no_run
19111 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsResponse;
19112 /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19113 /// let x = ListMirroringDeploymentGroupsResponse::new()
19114 /// .set_mirroring_deployment_groups([
19115 /// MirroringDeploymentGroup::default()/* use setters */,
19116 /// MirroringDeploymentGroup::default()/* use (different) setters */,
19117 /// ]);
19118 /// ```
19119 pub fn set_mirroring_deployment_groups<T, V>(mut self, v: T) -> Self
19120 where
19121 T: std::iter::IntoIterator<Item = V>,
19122 V: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19123 {
19124 use std::iter::Iterator;
19125 self.mirroring_deployment_groups = v.into_iter().map(|i| i.into()).collect();
19126 self
19127 }
19128
19129 /// Sets the value of [next_page_token][crate::model::ListMirroringDeploymentGroupsResponse::next_page_token].
19130 ///
19131 /// # Example
19132 /// ```ignore,no_run
19133 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentGroupsResponse;
19134 /// let x = ListMirroringDeploymentGroupsResponse::new().set_next_page_token("example");
19135 /// ```
19136 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19137 self.next_page_token = v.into();
19138 self
19139 }
19140}
19141
19142impl wkt::message::Message for ListMirroringDeploymentGroupsResponse {
19143 fn typename() -> &'static str {
19144 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse"
19145 }
19146}
19147
19148#[doc(hidden)]
19149impl google_cloud_gax::paginator::internal::PageableResponse
19150 for ListMirroringDeploymentGroupsResponse
19151{
19152 type PageItem = crate::model::MirroringDeploymentGroup;
19153
19154 fn items(self) -> std::vec::Vec<Self::PageItem> {
19155 self.mirroring_deployment_groups
19156 }
19157
19158 fn next_page_token(&self) -> std::string::String {
19159 use std::clone::Clone;
19160 self.next_page_token.clone()
19161 }
19162}
19163
19164/// Request message for GetMirroringDeploymentGroup.
19165#[derive(Clone, Default, PartialEq)]
19166#[non_exhaustive]
19167pub struct GetMirroringDeploymentGroupRequest {
19168 /// Required. The name of the deployment group to retrieve.
19169 /// Format:
19170 /// projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group}
19171 pub name: std::string::String,
19172
19173 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19174}
19175
19176impl GetMirroringDeploymentGroupRequest {
19177 pub fn new() -> Self {
19178 std::default::Default::default()
19179 }
19180
19181 /// Sets the value of [name][crate::model::GetMirroringDeploymentGroupRequest::name].
19182 ///
19183 /// # Example
19184 /// ```ignore,no_run
19185 /// # use google_cloud_networksecurity_v1::model::GetMirroringDeploymentGroupRequest;
19186 /// let x = GetMirroringDeploymentGroupRequest::new().set_name("example");
19187 /// ```
19188 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19189 self.name = v.into();
19190 self
19191 }
19192}
19193
19194impl wkt::message::Message for GetMirroringDeploymentGroupRequest {
19195 fn typename() -> &'static str {
19196 "type.googleapis.com/google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest"
19197 }
19198}
19199
19200/// Request message for CreateMirroringDeploymentGroup.
19201#[derive(Clone, Default, PartialEq)]
19202#[non_exhaustive]
19203pub struct CreateMirroringDeploymentGroupRequest {
19204 /// Required. The parent resource where this deployment group will be created.
19205 /// Format: projects/{project}/locations/{location}
19206 pub parent: std::string::String,
19207
19208 /// Required. The ID to use for the new deployment group, which will become the
19209 /// final component of the deployment group's resource name.
19210 pub mirroring_deployment_group_id: std::string::String,
19211
19212 /// Required. The deployment group to create.
19213 pub mirroring_deployment_group: std::option::Option<crate::model::MirroringDeploymentGroup>,
19214
19215 /// Optional. A unique identifier for this request. Must be a UUID4.
19216 /// This request is only idempotent if a `request_id` is provided.
19217 /// See <https://google.aip.dev/155> for more details.
19218 pub request_id: std::string::String,
19219
19220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19221}
19222
19223impl CreateMirroringDeploymentGroupRequest {
19224 pub fn new() -> Self {
19225 std::default::Default::default()
19226 }
19227
19228 /// Sets the value of [parent][crate::model::CreateMirroringDeploymentGroupRequest::parent].
19229 ///
19230 /// # Example
19231 /// ```ignore,no_run
19232 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19233 /// let x = CreateMirroringDeploymentGroupRequest::new().set_parent("example");
19234 /// ```
19235 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19236 self.parent = v.into();
19237 self
19238 }
19239
19240 /// Sets the value of [mirroring_deployment_group_id][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group_id].
19241 ///
19242 /// # Example
19243 /// ```ignore,no_run
19244 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19245 /// let x = CreateMirroringDeploymentGroupRequest::new().set_mirroring_deployment_group_id("example");
19246 /// ```
19247 pub fn set_mirroring_deployment_group_id<T: std::convert::Into<std::string::String>>(
19248 mut self,
19249 v: T,
19250 ) -> Self {
19251 self.mirroring_deployment_group_id = v.into();
19252 self
19253 }
19254
19255 /// Sets the value of [mirroring_deployment_group][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group].
19256 ///
19257 /// # Example
19258 /// ```ignore,no_run
19259 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19260 /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19261 /// let x = CreateMirroringDeploymentGroupRequest::new().set_mirroring_deployment_group(MirroringDeploymentGroup::default()/* use setters */);
19262 /// ```
19263 pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
19264 where
19265 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19266 {
19267 self.mirroring_deployment_group = std::option::Option::Some(v.into());
19268 self
19269 }
19270
19271 /// Sets or clears the value of [mirroring_deployment_group][crate::model::CreateMirroringDeploymentGroupRequest::mirroring_deployment_group].
19272 ///
19273 /// # Example
19274 /// ```ignore,no_run
19275 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19276 /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19277 /// let x = CreateMirroringDeploymentGroupRequest::new().set_or_clear_mirroring_deployment_group(Some(MirroringDeploymentGroup::default()/* use setters */));
19278 /// let x = CreateMirroringDeploymentGroupRequest::new().set_or_clear_mirroring_deployment_group(None::<MirroringDeploymentGroup>);
19279 /// ```
19280 pub fn set_or_clear_mirroring_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
19281 where
19282 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19283 {
19284 self.mirroring_deployment_group = v.map(|x| x.into());
19285 self
19286 }
19287
19288 /// Sets the value of [request_id][crate::model::CreateMirroringDeploymentGroupRequest::request_id].
19289 ///
19290 /// # Example
19291 /// ```ignore,no_run
19292 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentGroupRequest;
19293 /// let x = CreateMirroringDeploymentGroupRequest::new().set_request_id("example");
19294 /// ```
19295 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19296 self.request_id = v.into();
19297 self
19298 }
19299}
19300
19301impl wkt::message::Message for CreateMirroringDeploymentGroupRequest {
19302 fn typename() -> &'static str {
19303 "type.googleapis.com/google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest"
19304 }
19305}
19306
19307/// Request message for UpdateMirroringDeploymentGroup.
19308#[derive(Clone, Default, PartialEq)]
19309#[non_exhaustive]
19310pub struct UpdateMirroringDeploymentGroupRequest {
19311 /// Optional. The list of fields to update.
19312 /// Fields are specified relative to the deployment group
19313 /// (e.g. `description`; *not*
19314 /// `mirroring_deployment_group.description`). See
19315 /// <https://google.aip.dev/161> for more details.
19316 pub update_mask: std::option::Option<wkt::FieldMask>,
19317
19318 /// Required. The deployment group to update.
19319 pub mirroring_deployment_group: std::option::Option<crate::model::MirroringDeploymentGroup>,
19320
19321 /// Optional. A unique identifier for this request. Must be a UUID4.
19322 /// This request is only idempotent if a `request_id` is provided.
19323 /// See <https://google.aip.dev/155> for more details.
19324 pub request_id: std::string::String,
19325
19326 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19327}
19328
19329impl UpdateMirroringDeploymentGroupRequest {
19330 pub fn new() -> Self {
19331 std::default::Default::default()
19332 }
19333
19334 /// Sets the value of [update_mask][crate::model::UpdateMirroringDeploymentGroupRequest::update_mask].
19335 ///
19336 /// # Example
19337 /// ```ignore,no_run
19338 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19339 /// use wkt::FieldMask;
19340 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
19341 /// ```
19342 pub fn set_update_mask<T>(mut self, v: T) -> Self
19343 where
19344 T: std::convert::Into<wkt::FieldMask>,
19345 {
19346 self.update_mask = std::option::Option::Some(v.into());
19347 self
19348 }
19349
19350 /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringDeploymentGroupRequest::update_mask].
19351 ///
19352 /// # Example
19353 /// ```ignore,no_run
19354 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19355 /// use wkt::FieldMask;
19356 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
19357 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
19358 /// ```
19359 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19360 where
19361 T: std::convert::Into<wkt::FieldMask>,
19362 {
19363 self.update_mask = v.map(|x| x.into());
19364 self
19365 }
19366
19367 /// Sets the value of [mirroring_deployment_group][crate::model::UpdateMirroringDeploymentGroupRequest::mirroring_deployment_group].
19368 ///
19369 /// # Example
19370 /// ```ignore,no_run
19371 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19372 /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19373 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_mirroring_deployment_group(MirroringDeploymentGroup::default()/* use setters */);
19374 /// ```
19375 pub fn set_mirroring_deployment_group<T>(mut self, v: T) -> Self
19376 where
19377 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19378 {
19379 self.mirroring_deployment_group = std::option::Option::Some(v.into());
19380 self
19381 }
19382
19383 /// Sets or clears the value of [mirroring_deployment_group][crate::model::UpdateMirroringDeploymentGroupRequest::mirroring_deployment_group].
19384 ///
19385 /// # Example
19386 /// ```ignore,no_run
19387 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19388 /// use google_cloud_networksecurity_v1::model::MirroringDeploymentGroup;
19389 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_or_clear_mirroring_deployment_group(Some(MirroringDeploymentGroup::default()/* use setters */));
19390 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_or_clear_mirroring_deployment_group(None::<MirroringDeploymentGroup>);
19391 /// ```
19392 pub fn set_or_clear_mirroring_deployment_group<T>(mut self, v: std::option::Option<T>) -> Self
19393 where
19394 T: std::convert::Into<crate::model::MirroringDeploymentGroup>,
19395 {
19396 self.mirroring_deployment_group = v.map(|x| x.into());
19397 self
19398 }
19399
19400 /// Sets the value of [request_id][crate::model::UpdateMirroringDeploymentGroupRequest::request_id].
19401 ///
19402 /// # Example
19403 /// ```ignore,no_run
19404 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentGroupRequest;
19405 /// let x = UpdateMirroringDeploymentGroupRequest::new().set_request_id("example");
19406 /// ```
19407 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19408 self.request_id = v.into();
19409 self
19410 }
19411}
19412
19413impl wkt::message::Message for UpdateMirroringDeploymentGroupRequest {
19414 fn typename() -> &'static str {
19415 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest"
19416 }
19417}
19418
19419/// Request message for DeleteMirroringDeploymentGroup.
19420#[derive(Clone, Default, PartialEq)]
19421#[non_exhaustive]
19422pub struct DeleteMirroringDeploymentGroupRequest {
19423 /// Required. The deployment group to delete.
19424 pub name: std::string::String,
19425
19426 /// Optional. A unique identifier for this request. Must be a UUID4.
19427 /// This request is only idempotent if a `request_id` is provided.
19428 /// See <https://google.aip.dev/155> for more details.
19429 pub request_id: std::string::String,
19430
19431 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19432}
19433
19434impl DeleteMirroringDeploymentGroupRequest {
19435 pub fn new() -> Self {
19436 std::default::Default::default()
19437 }
19438
19439 /// Sets the value of [name][crate::model::DeleteMirroringDeploymentGroupRequest::name].
19440 ///
19441 /// # Example
19442 /// ```ignore,no_run
19443 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringDeploymentGroupRequest;
19444 /// let x = DeleteMirroringDeploymentGroupRequest::new().set_name("example");
19445 /// ```
19446 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19447 self.name = v.into();
19448 self
19449 }
19450
19451 /// Sets the value of [request_id][crate::model::DeleteMirroringDeploymentGroupRequest::request_id].
19452 ///
19453 /// # Example
19454 /// ```ignore,no_run
19455 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringDeploymentGroupRequest;
19456 /// let x = DeleteMirroringDeploymentGroupRequest::new().set_request_id("example");
19457 /// ```
19458 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19459 self.request_id = v.into();
19460 self
19461 }
19462}
19463
19464impl wkt::message::Message for DeleteMirroringDeploymentGroupRequest {
19465 fn typename() -> &'static str {
19466 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest"
19467 }
19468}
19469
19470/// A deployment represents a zonal mirroring backend ready to accept
19471/// GENEVE-encapsulated replica traffic, e.g. a zonal instance group fronted by
19472/// an internal passthrough load balancer. Deployments are always part of a
19473/// global deployment group which represents a global mirroring service.
19474#[derive(Clone, Default, PartialEq)]
19475#[non_exhaustive]
19476pub struct MirroringDeployment {
19477 /// Immutable. Identifier. The resource name of this deployment, for example:
19478 /// `projects/123456789/locations/us-central1-a/mirroringDeployments/my-dep`.
19479 /// See <https://google.aip.dev/122> for more details.
19480 pub name: std::string::String,
19481
19482 /// Output only. The timestamp when the resource was created.
19483 /// See <https://google.aip.dev/148#timestamps>.
19484 pub create_time: std::option::Option<wkt::Timestamp>,
19485
19486 /// Output only. The timestamp when the resource was most recently updated.
19487 /// See <https://google.aip.dev/148#timestamps>.
19488 pub update_time: std::option::Option<wkt::Timestamp>,
19489
19490 /// Optional. Labels are key/value pairs that help to organize and filter
19491 /// resources.
19492 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
19493
19494 /// Required. Immutable. The regional forwarding rule that fronts the mirroring
19495 /// collectors, for example:
19496 /// `projects/123456789/regions/us-central1/forwardingRules/my-rule`. See
19497 /// <https://google.aip.dev/124>.
19498 pub forwarding_rule: std::string::String,
19499
19500 /// Required. Immutable. The deployment group that this deployment is a part
19501 /// of, for example:
19502 /// `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
19503 /// See <https://google.aip.dev/124>.
19504 pub mirroring_deployment_group: std::string::String,
19505
19506 /// Output only. The current state of the deployment.
19507 /// See <https://google.aip.dev/216>.
19508 pub state: crate::model::mirroring_deployment::State,
19509
19510 /// Output only. The current state of the resource does not match the user's
19511 /// intended state, and the system is working to reconcile them. This part of
19512 /// the normal operation (e.g. linking a new association to the parent group).
19513 /// See <https://google.aip.dev/128>.
19514 pub reconciling: bool,
19515
19516 /// Optional. User-provided description of the deployment.
19517 /// Used as additional context for the deployment.
19518 pub description: std::string::String,
19519
19520 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19521}
19522
19523impl MirroringDeployment {
19524 pub fn new() -> Self {
19525 std::default::Default::default()
19526 }
19527
19528 /// Sets the value of [name][crate::model::MirroringDeployment::name].
19529 ///
19530 /// # Example
19531 /// ```ignore,no_run
19532 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19533 /// let x = MirroringDeployment::new().set_name("example");
19534 /// ```
19535 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19536 self.name = v.into();
19537 self
19538 }
19539
19540 /// Sets the value of [create_time][crate::model::MirroringDeployment::create_time].
19541 ///
19542 /// # Example
19543 /// ```ignore,no_run
19544 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19545 /// use wkt::Timestamp;
19546 /// let x = MirroringDeployment::new().set_create_time(Timestamp::default()/* use setters */);
19547 /// ```
19548 pub fn set_create_time<T>(mut self, v: T) -> Self
19549 where
19550 T: std::convert::Into<wkt::Timestamp>,
19551 {
19552 self.create_time = std::option::Option::Some(v.into());
19553 self
19554 }
19555
19556 /// Sets or clears the value of [create_time][crate::model::MirroringDeployment::create_time].
19557 ///
19558 /// # Example
19559 /// ```ignore,no_run
19560 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19561 /// use wkt::Timestamp;
19562 /// let x = MirroringDeployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
19563 /// let x = MirroringDeployment::new().set_or_clear_create_time(None::<Timestamp>);
19564 /// ```
19565 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
19566 where
19567 T: std::convert::Into<wkt::Timestamp>,
19568 {
19569 self.create_time = v.map(|x| x.into());
19570 self
19571 }
19572
19573 /// Sets the value of [update_time][crate::model::MirroringDeployment::update_time].
19574 ///
19575 /// # Example
19576 /// ```ignore,no_run
19577 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19578 /// use wkt::Timestamp;
19579 /// let x = MirroringDeployment::new().set_update_time(Timestamp::default()/* use setters */);
19580 /// ```
19581 pub fn set_update_time<T>(mut self, v: T) -> Self
19582 where
19583 T: std::convert::Into<wkt::Timestamp>,
19584 {
19585 self.update_time = std::option::Option::Some(v.into());
19586 self
19587 }
19588
19589 /// Sets or clears the value of [update_time][crate::model::MirroringDeployment::update_time].
19590 ///
19591 /// # Example
19592 /// ```ignore,no_run
19593 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19594 /// use wkt::Timestamp;
19595 /// let x = MirroringDeployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
19596 /// let x = MirroringDeployment::new().set_or_clear_update_time(None::<Timestamp>);
19597 /// ```
19598 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
19599 where
19600 T: std::convert::Into<wkt::Timestamp>,
19601 {
19602 self.update_time = v.map(|x| x.into());
19603 self
19604 }
19605
19606 /// Sets the value of [labels][crate::model::MirroringDeployment::labels].
19607 ///
19608 /// # Example
19609 /// ```ignore,no_run
19610 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19611 /// let x = MirroringDeployment::new().set_labels([
19612 /// ("key0", "abc"),
19613 /// ("key1", "xyz"),
19614 /// ]);
19615 /// ```
19616 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
19617 where
19618 T: std::iter::IntoIterator<Item = (K, V)>,
19619 K: std::convert::Into<std::string::String>,
19620 V: std::convert::Into<std::string::String>,
19621 {
19622 use std::iter::Iterator;
19623 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
19624 self
19625 }
19626
19627 /// Sets the value of [forwarding_rule][crate::model::MirroringDeployment::forwarding_rule].
19628 ///
19629 /// # Example
19630 /// ```ignore,no_run
19631 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19632 /// let x = MirroringDeployment::new().set_forwarding_rule("example");
19633 /// ```
19634 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19635 self.forwarding_rule = v.into();
19636 self
19637 }
19638
19639 /// Sets the value of [mirroring_deployment_group][crate::model::MirroringDeployment::mirroring_deployment_group].
19640 ///
19641 /// # Example
19642 /// ```ignore,no_run
19643 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19644 /// let x = MirroringDeployment::new().set_mirroring_deployment_group("example");
19645 /// ```
19646 pub fn set_mirroring_deployment_group<T: std::convert::Into<std::string::String>>(
19647 mut self,
19648 v: T,
19649 ) -> Self {
19650 self.mirroring_deployment_group = v.into();
19651 self
19652 }
19653
19654 /// Sets the value of [state][crate::model::MirroringDeployment::state].
19655 ///
19656 /// # Example
19657 /// ```ignore,no_run
19658 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19659 /// use google_cloud_networksecurity_v1::model::mirroring_deployment::State;
19660 /// let x0 = MirroringDeployment::new().set_state(State::Active);
19661 /// let x1 = MirroringDeployment::new().set_state(State::Creating);
19662 /// let x2 = MirroringDeployment::new().set_state(State::Deleting);
19663 /// ```
19664 pub fn set_state<T: std::convert::Into<crate::model::mirroring_deployment::State>>(
19665 mut self,
19666 v: T,
19667 ) -> Self {
19668 self.state = v.into();
19669 self
19670 }
19671
19672 /// Sets the value of [reconciling][crate::model::MirroringDeployment::reconciling].
19673 ///
19674 /// # Example
19675 /// ```ignore,no_run
19676 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19677 /// let x = MirroringDeployment::new().set_reconciling(true);
19678 /// ```
19679 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
19680 self.reconciling = v.into();
19681 self
19682 }
19683
19684 /// Sets the value of [description][crate::model::MirroringDeployment::description].
19685 ///
19686 /// # Example
19687 /// ```ignore,no_run
19688 /// # use google_cloud_networksecurity_v1::model::MirroringDeployment;
19689 /// let x = MirroringDeployment::new().set_description("example");
19690 /// ```
19691 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19692 self.description = v.into();
19693 self
19694 }
19695}
19696
19697impl wkt::message::Message for MirroringDeployment {
19698 fn typename() -> &'static str {
19699 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringDeployment"
19700 }
19701}
19702
19703/// Defines additional types related to [MirroringDeployment].
19704pub mod mirroring_deployment {
19705 #[allow(unused_imports)]
19706 use super::*;
19707
19708 /// The current state of the deployment.
19709 ///
19710 /// # Working with unknown values
19711 ///
19712 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19713 /// additional enum variants at any time. Adding new variants is not considered
19714 /// a breaking change. Applications should write their code in anticipation of:
19715 ///
19716 /// - New values appearing in future releases of the client library, **and**
19717 /// - New values received dynamically, without application changes.
19718 ///
19719 /// Please consult the [Working with enums] section in the user guide for some
19720 /// guidelines.
19721 ///
19722 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19723 #[derive(Clone, Debug, PartialEq)]
19724 #[non_exhaustive]
19725 pub enum State {
19726 /// State not set (this is not a valid state).
19727 Unspecified,
19728 /// The deployment is ready and in sync with the parent group.
19729 Active,
19730 /// The deployment is being created.
19731 Creating,
19732 /// The deployment is being deleted.
19733 Deleting,
19734 /// The deployment is out of sync with the parent group.
19735 /// In most cases, this is a result of a transient issue within the system
19736 /// (e.g. a delayed data-path config) and the system is expected to recover
19737 /// automatically. See the parent deployment group's state for more details.
19738 OutOfSync,
19739 /// An attempt to delete the deployment has failed. This is a terminal state
19740 /// and the deployment is not expected to recover. The only permitted
19741 /// operation is to retry deleting the deployment.
19742 DeleteFailed,
19743 /// If set, the enum was initialized with an unknown value.
19744 ///
19745 /// Applications can examine the value using [State::value] or
19746 /// [State::name].
19747 UnknownValue(state::UnknownValue),
19748 }
19749
19750 #[doc(hidden)]
19751 pub mod state {
19752 #[allow(unused_imports)]
19753 use super::*;
19754 #[derive(Clone, Debug, PartialEq)]
19755 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19756 }
19757
19758 impl State {
19759 /// Gets the enum value.
19760 ///
19761 /// Returns `None` if the enum contains an unknown value deserialized from
19762 /// the string representation of enums.
19763 pub fn value(&self) -> std::option::Option<i32> {
19764 match self {
19765 Self::Unspecified => std::option::Option::Some(0),
19766 Self::Active => std::option::Option::Some(1),
19767 Self::Creating => std::option::Option::Some(2),
19768 Self::Deleting => std::option::Option::Some(3),
19769 Self::OutOfSync => std::option::Option::Some(4),
19770 Self::DeleteFailed => std::option::Option::Some(5),
19771 Self::UnknownValue(u) => u.0.value(),
19772 }
19773 }
19774
19775 /// Gets the enum value as a string.
19776 ///
19777 /// Returns `None` if the enum contains an unknown value deserialized from
19778 /// the integer representation of enums.
19779 pub fn name(&self) -> std::option::Option<&str> {
19780 match self {
19781 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
19782 Self::Active => std::option::Option::Some("ACTIVE"),
19783 Self::Creating => std::option::Option::Some("CREATING"),
19784 Self::Deleting => std::option::Option::Some("DELETING"),
19785 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
19786 Self::DeleteFailed => std::option::Option::Some("DELETE_FAILED"),
19787 Self::UnknownValue(u) => u.0.name(),
19788 }
19789 }
19790 }
19791
19792 impl std::default::Default for State {
19793 fn default() -> Self {
19794 use std::convert::From;
19795 Self::from(0)
19796 }
19797 }
19798
19799 impl std::fmt::Display for State {
19800 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19801 wkt::internal::display_enum(f, self.name(), self.value())
19802 }
19803 }
19804
19805 impl std::convert::From<i32> for State {
19806 fn from(value: i32) -> Self {
19807 match value {
19808 0 => Self::Unspecified,
19809 1 => Self::Active,
19810 2 => Self::Creating,
19811 3 => Self::Deleting,
19812 4 => Self::OutOfSync,
19813 5 => Self::DeleteFailed,
19814 _ => Self::UnknownValue(state::UnknownValue(
19815 wkt::internal::UnknownEnumValue::Integer(value),
19816 )),
19817 }
19818 }
19819 }
19820
19821 impl std::convert::From<&str> for State {
19822 fn from(value: &str) -> Self {
19823 use std::string::ToString;
19824 match value {
19825 "STATE_UNSPECIFIED" => Self::Unspecified,
19826 "ACTIVE" => Self::Active,
19827 "CREATING" => Self::Creating,
19828 "DELETING" => Self::Deleting,
19829 "OUT_OF_SYNC" => Self::OutOfSync,
19830 "DELETE_FAILED" => Self::DeleteFailed,
19831 _ => Self::UnknownValue(state::UnknownValue(
19832 wkt::internal::UnknownEnumValue::String(value.to_string()),
19833 )),
19834 }
19835 }
19836 }
19837
19838 impl serde::ser::Serialize for State {
19839 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19840 where
19841 S: serde::Serializer,
19842 {
19843 match self {
19844 Self::Unspecified => serializer.serialize_i32(0),
19845 Self::Active => serializer.serialize_i32(1),
19846 Self::Creating => serializer.serialize_i32(2),
19847 Self::Deleting => serializer.serialize_i32(3),
19848 Self::OutOfSync => serializer.serialize_i32(4),
19849 Self::DeleteFailed => serializer.serialize_i32(5),
19850 Self::UnknownValue(u) => u.0.serialize(serializer),
19851 }
19852 }
19853 }
19854
19855 impl<'de> serde::de::Deserialize<'de> for State {
19856 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19857 where
19858 D: serde::Deserializer<'de>,
19859 {
19860 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
19861 ".google.cloud.networksecurity.v1.MirroringDeployment.State",
19862 ))
19863 }
19864 }
19865}
19866
19867/// Request message for ListMirroringDeployments.
19868#[derive(Clone, Default, PartialEq)]
19869#[non_exhaustive]
19870pub struct ListMirroringDeploymentsRequest {
19871 /// Required. The parent, which owns this collection of deployments.
19872 /// Example: `projects/123456789/locations/us-central1-a`.
19873 /// See <https://google.aip.dev/132> for more details.
19874 pub parent: std::string::String,
19875
19876 /// Optional. Requested page size. Server may return fewer items than
19877 /// requested. If unspecified, server will pick an appropriate default. See
19878 /// <https://google.aip.dev/158> for more details.
19879 pub page_size: i32,
19880
19881 /// Optional. A page token, received from a previous `ListMirroringDeployments`
19882 /// call. Provide this to retrieve the subsequent page. When paginating, all
19883 /// other parameters provided to `ListMirroringDeployments` must match the call
19884 /// that provided the page token. See <https://google.aip.dev/158> for more
19885 /// details.
19886 pub page_token: std::string::String,
19887
19888 /// Optional. Filter expression.
19889 /// See <https://google.aip.dev/160#filtering> for more details.
19890 pub filter: std::string::String,
19891
19892 /// Optional. Sort expression.
19893 /// See <https://google.aip.dev/132#ordering> for more details.
19894 pub order_by: std::string::String,
19895
19896 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19897}
19898
19899impl ListMirroringDeploymentsRequest {
19900 pub fn new() -> Self {
19901 std::default::Default::default()
19902 }
19903
19904 /// Sets the value of [parent][crate::model::ListMirroringDeploymentsRequest::parent].
19905 ///
19906 /// # Example
19907 /// ```ignore,no_run
19908 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
19909 /// let x = ListMirroringDeploymentsRequest::new().set_parent("example");
19910 /// ```
19911 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19912 self.parent = v.into();
19913 self
19914 }
19915
19916 /// Sets the value of [page_size][crate::model::ListMirroringDeploymentsRequest::page_size].
19917 ///
19918 /// # Example
19919 /// ```ignore,no_run
19920 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
19921 /// let x = ListMirroringDeploymentsRequest::new().set_page_size(42);
19922 /// ```
19923 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19924 self.page_size = v.into();
19925 self
19926 }
19927
19928 /// Sets the value of [page_token][crate::model::ListMirroringDeploymentsRequest::page_token].
19929 ///
19930 /// # Example
19931 /// ```ignore,no_run
19932 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
19933 /// let x = ListMirroringDeploymentsRequest::new().set_page_token("example");
19934 /// ```
19935 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19936 self.page_token = v.into();
19937 self
19938 }
19939
19940 /// Sets the value of [filter][crate::model::ListMirroringDeploymentsRequest::filter].
19941 ///
19942 /// # Example
19943 /// ```ignore,no_run
19944 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
19945 /// let x = ListMirroringDeploymentsRequest::new().set_filter("example");
19946 /// ```
19947 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19948 self.filter = v.into();
19949 self
19950 }
19951
19952 /// Sets the value of [order_by][crate::model::ListMirroringDeploymentsRequest::order_by].
19953 ///
19954 /// # Example
19955 /// ```ignore,no_run
19956 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsRequest;
19957 /// let x = ListMirroringDeploymentsRequest::new().set_order_by("example");
19958 /// ```
19959 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19960 self.order_by = v.into();
19961 self
19962 }
19963}
19964
19965impl wkt::message::Message for ListMirroringDeploymentsRequest {
19966 fn typename() -> &'static str {
19967 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest"
19968 }
19969}
19970
19971/// Response message for ListMirroringDeployments.
19972#[derive(Clone, Default, PartialEq)]
19973#[non_exhaustive]
19974pub struct ListMirroringDeploymentsResponse {
19975 /// The deployments from the specified parent.
19976 pub mirroring_deployments: std::vec::Vec<crate::model::MirroringDeployment>,
19977
19978 /// A token that can be sent as `page_token` to retrieve the next page.
19979 /// If this field is omitted, there are no subsequent pages.
19980 /// See <https://google.aip.dev/158> for more details.
19981 pub next_page_token: std::string::String,
19982
19983 /// Locations that could not be reached.
19984 pub unreachable: std::vec::Vec<std::string::String>,
19985
19986 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19987}
19988
19989impl ListMirroringDeploymentsResponse {
19990 pub fn new() -> Self {
19991 std::default::Default::default()
19992 }
19993
19994 /// Sets the value of [mirroring_deployments][crate::model::ListMirroringDeploymentsResponse::mirroring_deployments].
19995 ///
19996 /// # Example
19997 /// ```ignore,no_run
19998 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsResponse;
19999 /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20000 /// let x = ListMirroringDeploymentsResponse::new()
20001 /// .set_mirroring_deployments([
20002 /// MirroringDeployment::default()/* use setters */,
20003 /// MirroringDeployment::default()/* use (different) setters */,
20004 /// ]);
20005 /// ```
20006 pub fn set_mirroring_deployments<T, V>(mut self, v: T) -> Self
20007 where
20008 T: std::iter::IntoIterator<Item = V>,
20009 V: std::convert::Into<crate::model::MirroringDeployment>,
20010 {
20011 use std::iter::Iterator;
20012 self.mirroring_deployments = v.into_iter().map(|i| i.into()).collect();
20013 self
20014 }
20015
20016 /// Sets the value of [next_page_token][crate::model::ListMirroringDeploymentsResponse::next_page_token].
20017 ///
20018 /// # Example
20019 /// ```ignore,no_run
20020 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsResponse;
20021 /// let x = ListMirroringDeploymentsResponse::new().set_next_page_token("example");
20022 /// ```
20023 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20024 self.next_page_token = v.into();
20025 self
20026 }
20027
20028 /// Sets the value of [unreachable][crate::model::ListMirroringDeploymentsResponse::unreachable].
20029 ///
20030 /// # Example
20031 /// ```ignore,no_run
20032 /// # use google_cloud_networksecurity_v1::model::ListMirroringDeploymentsResponse;
20033 /// let x = ListMirroringDeploymentsResponse::new().set_unreachable(["a", "b", "c"]);
20034 /// ```
20035 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
20036 where
20037 T: std::iter::IntoIterator<Item = V>,
20038 V: std::convert::Into<std::string::String>,
20039 {
20040 use std::iter::Iterator;
20041 self.unreachable = v.into_iter().map(|i| i.into()).collect();
20042 self
20043 }
20044}
20045
20046impl wkt::message::Message for ListMirroringDeploymentsResponse {
20047 fn typename() -> &'static str {
20048 "type.googleapis.com/google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse"
20049 }
20050}
20051
20052#[doc(hidden)]
20053impl google_cloud_gax::paginator::internal::PageableResponse for ListMirroringDeploymentsResponse {
20054 type PageItem = crate::model::MirroringDeployment;
20055
20056 fn items(self) -> std::vec::Vec<Self::PageItem> {
20057 self.mirroring_deployments
20058 }
20059
20060 fn next_page_token(&self) -> std::string::String {
20061 use std::clone::Clone;
20062 self.next_page_token.clone()
20063 }
20064}
20065
20066/// Request message for GetMirroringDeployment.
20067#[derive(Clone, Default, PartialEq)]
20068#[non_exhaustive]
20069pub struct GetMirroringDeploymentRequest {
20070 /// Required. The name of the deployment to retrieve.
20071 /// Format:
20072 /// projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}
20073 pub name: std::string::String,
20074
20075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20076}
20077
20078impl GetMirroringDeploymentRequest {
20079 pub fn new() -> Self {
20080 std::default::Default::default()
20081 }
20082
20083 /// Sets the value of [name][crate::model::GetMirroringDeploymentRequest::name].
20084 ///
20085 /// # Example
20086 /// ```ignore,no_run
20087 /// # use google_cloud_networksecurity_v1::model::GetMirroringDeploymentRequest;
20088 /// let x = GetMirroringDeploymentRequest::new().set_name("example");
20089 /// ```
20090 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20091 self.name = v.into();
20092 self
20093 }
20094}
20095
20096impl wkt::message::Message for GetMirroringDeploymentRequest {
20097 fn typename() -> &'static str {
20098 "type.googleapis.com/google.cloud.networksecurity.v1.GetMirroringDeploymentRequest"
20099 }
20100}
20101
20102/// Request message for CreateMirroringDeployment.
20103#[derive(Clone, Default, PartialEq)]
20104#[non_exhaustive]
20105pub struct CreateMirroringDeploymentRequest {
20106 /// Required. The parent resource where this deployment will be created.
20107 /// Format: projects/{project}/locations/{location}
20108 pub parent: std::string::String,
20109
20110 /// Required. The ID to use for the new deployment, which will become the final
20111 /// component of the deployment's resource name.
20112 pub mirroring_deployment_id: std::string::String,
20113
20114 /// Required. The deployment to create.
20115 pub mirroring_deployment: std::option::Option<crate::model::MirroringDeployment>,
20116
20117 /// Optional. A unique identifier for this request. Must be a UUID4.
20118 /// This request is only idempotent if a `request_id` is provided.
20119 /// See <https://google.aip.dev/155> for more details.
20120 pub request_id: std::string::String,
20121
20122 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20123}
20124
20125impl CreateMirroringDeploymentRequest {
20126 pub fn new() -> Self {
20127 std::default::Default::default()
20128 }
20129
20130 /// Sets the value of [parent][crate::model::CreateMirroringDeploymentRequest::parent].
20131 ///
20132 /// # Example
20133 /// ```ignore,no_run
20134 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20135 /// let x = CreateMirroringDeploymentRequest::new().set_parent("example");
20136 /// ```
20137 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20138 self.parent = v.into();
20139 self
20140 }
20141
20142 /// Sets the value of [mirroring_deployment_id][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment_id].
20143 ///
20144 /// # Example
20145 /// ```ignore,no_run
20146 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20147 /// let x = CreateMirroringDeploymentRequest::new().set_mirroring_deployment_id("example");
20148 /// ```
20149 pub fn set_mirroring_deployment_id<T: std::convert::Into<std::string::String>>(
20150 mut self,
20151 v: T,
20152 ) -> Self {
20153 self.mirroring_deployment_id = v.into();
20154 self
20155 }
20156
20157 /// Sets the value of [mirroring_deployment][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment].
20158 ///
20159 /// # Example
20160 /// ```ignore,no_run
20161 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20162 /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20163 /// let x = CreateMirroringDeploymentRequest::new().set_mirroring_deployment(MirroringDeployment::default()/* use setters */);
20164 /// ```
20165 pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
20166 where
20167 T: std::convert::Into<crate::model::MirroringDeployment>,
20168 {
20169 self.mirroring_deployment = std::option::Option::Some(v.into());
20170 self
20171 }
20172
20173 /// Sets or clears the value of [mirroring_deployment][crate::model::CreateMirroringDeploymentRequest::mirroring_deployment].
20174 ///
20175 /// # Example
20176 /// ```ignore,no_run
20177 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20178 /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20179 /// let x = CreateMirroringDeploymentRequest::new().set_or_clear_mirroring_deployment(Some(MirroringDeployment::default()/* use setters */));
20180 /// let x = CreateMirroringDeploymentRequest::new().set_or_clear_mirroring_deployment(None::<MirroringDeployment>);
20181 /// ```
20182 pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
20183 where
20184 T: std::convert::Into<crate::model::MirroringDeployment>,
20185 {
20186 self.mirroring_deployment = v.map(|x| x.into());
20187 self
20188 }
20189
20190 /// Sets the value of [request_id][crate::model::CreateMirroringDeploymentRequest::request_id].
20191 ///
20192 /// # Example
20193 /// ```ignore,no_run
20194 /// # use google_cloud_networksecurity_v1::model::CreateMirroringDeploymentRequest;
20195 /// let x = CreateMirroringDeploymentRequest::new().set_request_id("example");
20196 /// ```
20197 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20198 self.request_id = v.into();
20199 self
20200 }
20201}
20202
20203impl wkt::message::Message for CreateMirroringDeploymentRequest {
20204 fn typename() -> &'static str {
20205 "type.googleapis.com/google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest"
20206 }
20207}
20208
20209/// Request message for UpdateMirroringDeployment.
20210#[derive(Clone, Default, PartialEq)]
20211#[non_exhaustive]
20212pub struct UpdateMirroringDeploymentRequest {
20213 /// Optional. The list of fields to update.
20214 /// Fields are specified relative to the deployment
20215 /// (e.g. `description`; *not* `mirroring_deployment.description`).
20216 /// See <https://google.aip.dev/161> for more details.
20217 pub update_mask: std::option::Option<wkt::FieldMask>,
20218
20219 /// Required. The deployment to update.
20220 pub mirroring_deployment: std::option::Option<crate::model::MirroringDeployment>,
20221
20222 /// Optional. A unique identifier for this request. Must be a UUID4.
20223 /// This request is only idempotent if a `request_id` is provided.
20224 /// See <https://google.aip.dev/155> for more details.
20225 pub request_id: std::string::String,
20226
20227 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20228}
20229
20230impl UpdateMirroringDeploymentRequest {
20231 pub fn new() -> Self {
20232 std::default::Default::default()
20233 }
20234
20235 /// Sets the value of [update_mask][crate::model::UpdateMirroringDeploymentRequest::update_mask].
20236 ///
20237 /// # Example
20238 /// ```ignore,no_run
20239 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20240 /// use wkt::FieldMask;
20241 /// let x = UpdateMirroringDeploymentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20242 /// ```
20243 pub fn set_update_mask<T>(mut self, v: T) -> Self
20244 where
20245 T: std::convert::Into<wkt::FieldMask>,
20246 {
20247 self.update_mask = std::option::Option::Some(v.into());
20248 self
20249 }
20250
20251 /// Sets or clears the value of [update_mask][crate::model::UpdateMirroringDeploymentRequest::update_mask].
20252 ///
20253 /// # Example
20254 /// ```ignore,no_run
20255 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20256 /// use wkt::FieldMask;
20257 /// let x = UpdateMirroringDeploymentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20258 /// let x = UpdateMirroringDeploymentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20259 /// ```
20260 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20261 where
20262 T: std::convert::Into<wkt::FieldMask>,
20263 {
20264 self.update_mask = v.map(|x| x.into());
20265 self
20266 }
20267
20268 /// Sets the value of [mirroring_deployment][crate::model::UpdateMirroringDeploymentRequest::mirroring_deployment].
20269 ///
20270 /// # Example
20271 /// ```ignore,no_run
20272 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20273 /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20274 /// let x = UpdateMirroringDeploymentRequest::new().set_mirroring_deployment(MirroringDeployment::default()/* use setters */);
20275 /// ```
20276 pub fn set_mirroring_deployment<T>(mut self, v: T) -> Self
20277 where
20278 T: std::convert::Into<crate::model::MirroringDeployment>,
20279 {
20280 self.mirroring_deployment = std::option::Option::Some(v.into());
20281 self
20282 }
20283
20284 /// Sets or clears the value of [mirroring_deployment][crate::model::UpdateMirroringDeploymentRequest::mirroring_deployment].
20285 ///
20286 /// # Example
20287 /// ```ignore,no_run
20288 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20289 /// use google_cloud_networksecurity_v1::model::MirroringDeployment;
20290 /// let x = UpdateMirroringDeploymentRequest::new().set_or_clear_mirroring_deployment(Some(MirroringDeployment::default()/* use setters */));
20291 /// let x = UpdateMirroringDeploymentRequest::new().set_or_clear_mirroring_deployment(None::<MirroringDeployment>);
20292 /// ```
20293 pub fn set_or_clear_mirroring_deployment<T>(mut self, v: std::option::Option<T>) -> Self
20294 where
20295 T: std::convert::Into<crate::model::MirroringDeployment>,
20296 {
20297 self.mirroring_deployment = v.map(|x| x.into());
20298 self
20299 }
20300
20301 /// Sets the value of [request_id][crate::model::UpdateMirroringDeploymentRequest::request_id].
20302 ///
20303 /// # Example
20304 /// ```ignore,no_run
20305 /// # use google_cloud_networksecurity_v1::model::UpdateMirroringDeploymentRequest;
20306 /// let x = UpdateMirroringDeploymentRequest::new().set_request_id("example");
20307 /// ```
20308 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20309 self.request_id = v.into();
20310 self
20311 }
20312}
20313
20314impl wkt::message::Message for UpdateMirroringDeploymentRequest {
20315 fn typename() -> &'static str {
20316 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest"
20317 }
20318}
20319
20320/// Request message for DeleteMirroringDeployment.
20321#[derive(Clone, Default, PartialEq)]
20322#[non_exhaustive]
20323pub struct DeleteMirroringDeploymentRequest {
20324 /// Required. Name of the resource
20325 pub name: std::string::String,
20326
20327 /// Optional. A unique identifier for this request. Must be a UUID4.
20328 /// This request is only idempotent if a `request_id` is provided.
20329 /// See <https://google.aip.dev/155> for more details.
20330 pub request_id: std::string::String,
20331
20332 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20333}
20334
20335impl DeleteMirroringDeploymentRequest {
20336 pub fn new() -> Self {
20337 std::default::Default::default()
20338 }
20339
20340 /// Sets the value of [name][crate::model::DeleteMirroringDeploymentRequest::name].
20341 ///
20342 /// # Example
20343 /// ```ignore,no_run
20344 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringDeploymentRequest;
20345 /// let x = DeleteMirroringDeploymentRequest::new().set_name("example");
20346 /// ```
20347 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20348 self.name = v.into();
20349 self
20350 }
20351
20352 /// Sets the value of [request_id][crate::model::DeleteMirroringDeploymentRequest::request_id].
20353 ///
20354 /// # Example
20355 /// ```ignore,no_run
20356 /// # use google_cloud_networksecurity_v1::model::DeleteMirroringDeploymentRequest;
20357 /// let x = DeleteMirroringDeploymentRequest::new().set_request_id("example");
20358 /// ```
20359 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20360 self.request_id = v.into();
20361 self
20362 }
20363}
20364
20365impl wkt::message::Message for DeleteMirroringDeploymentRequest {
20366 fn typename() -> &'static str {
20367 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest"
20368 }
20369}
20370
20371/// Details about mirroring in a specific cloud location.
20372#[derive(Clone, Default, PartialEq)]
20373#[non_exhaustive]
20374pub struct MirroringLocation {
20375 /// Output only. The cloud location, e.g. "us-central1-a" or "asia-south1".
20376 pub location: std::string::String,
20377
20378 /// Output only. The current state of the association in this location.
20379 pub state: crate::model::mirroring_location::State,
20380
20381 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20382}
20383
20384impl MirroringLocation {
20385 pub fn new() -> Self {
20386 std::default::Default::default()
20387 }
20388
20389 /// Sets the value of [location][crate::model::MirroringLocation::location].
20390 ///
20391 /// # Example
20392 /// ```ignore,no_run
20393 /// # use google_cloud_networksecurity_v1::model::MirroringLocation;
20394 /// let x = MirroringLocation::new().set_location("example");
20395 /// ```
20396 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20397 self.location = v.into();
20398 self
20399 }
20400
20401 /// Sets the value of [state][crate::model::MirroringLocation::state].
20402 ///
20403 /// # Example
20404 /// ```ignore,no_run
20405 /// # use google_cloud_networksecurity_v1::model::MirroringLocation;
20406 /// use google_cloud_networksecurity_v1::model::mirroring_location::State;
20407 /// let x0 = MirroringLocation::new().set_state(State::Active);
20408 /// let x1 = MirroringLocation::new().set_state(State::OutOfSync);
20409 /// ```
20410 pub fn set_state<T: std::convert::Into<crate::model::mirroring_location::State>>(
20411 mut self,
20412 v: T,
20413 ) -> Self {
20414 self.state = v.into();
20415 self
20416 }
20417}
20418
20419impl wkt::message::Message for MirroringLocation {
20420 fn typename() -> &'static str {
20421 "type.googleapis.com/google.cloud.networksecurity.v1.MirroringLocation"
20422 }
20423}
20424
20425/// Defines additional types related to [MirroringLocation].
20426pub mod mirroring_location {
20427 #[allow(unused_imports)]
20428 use super::*;
20429
20430 /// The current state of a resource in the location.
20431 ///
20432 /// # Working with unknown values
20433 ///
20434 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20435 /// additional enum variants at any time. Adding new variants is not considered
20436 /// a breaking change. Applications should write their code in anticipation of:
20437 ///
20438 /// - New values appearing in future releases of the client library, **and**
20439 /// - New values received dynamically, without application changes.
20440 ///
20441 /// Please consult the [Working with enums] section in the user guide for some
20442 /// guidelines.
20443 ///
20444 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20445 #[derive(Clone, Debug, PartialEq)]
20446 #[non_exhaustive]
20447 pub enum State {
20448 /// State not set (this is not a valid state).
20449 Unspecified,
20450 /// The resource is ready and in sync in the location.
20451 Active,
20452 /// The resource is out of sync in the location.
20453 /// In most cases, this is a result of a transient issue within the system
20454 /// (e.g. an inaccessible location) and the system is expected to recover
20455 /// automatically.
20456 OutOfSync,
20457 /// If set, the enum was initialized with an unknown value.
20458 ///
20459 /// Applications can examine the value using [State::value] or
20460 /// [State::name].
20461 UnknownValue(state::UnknownValue),
20462 }
20463
20464 #[doc(hidden)]
20465 pub mod state {
20466 #[allow(unused_imports)]
20467 use super::*;
20468 #[derive(Clone, Debug, PartialEq)]
20469 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20470 }
20471
20472 impl State {
20473 /// Gets the enum value.
20474 ///
20475 /// Returns `None` if the enum contains an unknown value deserialized from
20476 /// the string representation of enums.
20477 pub fn value(&self) -> std::option::Option<i32> {
20478 match self {
20479 Self::Unspecified => std::option::Option::Some(0),
20480 Self::Active => std::option::Option::Some(1),
20481 Self::OutOfSync => std::option::Option::Some(2),
20482 Self::UnknownValue(u) => u.0.value(),
20483 }
20484 }
20485
20486 /// Gets the enum value as a string.
20487 ///
20488 /// Returns `None` if the enum contains an unknown value deserialized from
20489 /// the integer representation of enums.
20490 pub fn name(&self) -> std::option::Option<&str> {
20491 match self {
20492 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
20493 Self::Active => std::option::Option::Some("ACTIVE"),
20494 Self::OutOfSync => std::option::Option::Some("OUT_OF_SYNC"),
20495 Self::UnknownValue(u) => u.0.name(),
20496 }
20497 }
20498 }
20499
20500 impl std::default::Default for State {
20501 fn default() -> Self {
20502 use std::convert::From;
20503 Self::from(0)
20504 }
20505 }
20506
20507 impl std::fmt::Display for State {
20508 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20509 wkt::internal::display_enum(f, self.name(), self.value())
20510 }
20511 }
20512
20513 impl std::convert::From<i32> for State {
20514 fn from(value: i32) -> Self {
20515 match value {
20516 0 => Self::Unspecified,
20517 1 => Self::Active,
20518 2 => Self::OutOfSync,
20519 _ => Self::UnknownValue(state::UnknownValue(
20520 wkt::internal::UnknownEnumValue::Integer(value),
20521 )),
20522 }
20523 }
20524 }
20525
20526 impl std::convert::From<&str> for State {
20527 fn from(value: &str) -> Self {
20528 use std::string::ToString;
20529 match value {
20530 "STATE_UNSPECIFIED" => Self::Unspecified,
20531 "ACTIVE" => Self::Active,
20532 "OUT_OF_SYNC" => Self::OutOfSync,
20533 _ => Self::UnknownValue(state::UnknownValue(
20534 wkt::internal::UnknownEnumValue::String(value.to_string()),
20535 )),
20536 }
20537 }
20538 }
20539
20540 impl serde::ser::Serialize for State {
20541 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20542 where
20543 S: serde::Serializer,
20544 {
20545 match self {
20546 Self::Unspecified => serializer.serialize_i32(0),
20547 Self::Active => serializer.serialize_i32(1),
20548 Self::OutOfSync => serializer.serialize_i32(2),
20549 Self::UnknownValue(u) => u.0.serialize(serializer),
20550 }
20551 }
20552 }
20553
20554 impl<'de> serde::de::Deserialize<'de> for State {
20555 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20556 where
20557 D: serde::Deserializer<'de>,
20558 {
20559 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
20560 ".google.cloud.networksecurity.v1.MirroringLocation.State",
20561 ))
20562 }
20563 }
20564}
20565
20566/// SecurityProfileGroup is a resource that defines the behavior for various
20567/// ProfileTypes.
20568#[derive(Clone, Default, PartialEq)]
20569#[non_exhaustive]
20570pub struct SecurityProfileGroup {
20571 /// Immutable. Identifier. Name of the SecurityProfileGroup resource. It
20572 /// matches pattern
20573 /// `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`.
20574 pub name: std::string::String,
20575
20576 /// Optional. An optional description of the profile group. Max length 2048
20577 /// characters.
20578 pub description: std::string::String,
20579
20580 /// Output only. Resource creation timestamp.
20581 pub create_time: std::option::Option<wkt::Timestamp>,
20582
20583 /// Output only. Last resource update timestamp.
20584 pub update_time: std::option::Option<wkt::Timestamp>,
20585
20586 /// Output only. This checksum is computed by the server based on the value of
20587 /// other fields, and may be sent on update and delete requests to ensure the
20588 /// client has an up-to-date value before proceeding.
20589 pub etag: std::string::String,
20590
20591 /// Output only. Identifier used by the data-path. Unique within {container,
20592 /// location}.
20593 pub data_path_id: u64,
20594
20595 /// Optional. Labels as key value pairs.
20596 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
20597
20598 /// Optional. Reference to a SecurityProfile with the ThreatPrevention
20599 /// configuration.
20600 pub threat_prevention_profile: std::string::String,
20601
20602 /// Optional. Reference to a SecurityProfile with the CustomMirroring
20603 /// configuration.
20604 pub custom_mirroring_profile: std::string::String,
20605
20606 /// Optional. Reference to a SecurityProfile with the CustomIntercept
20607 /// configuration.
20608 pub custom_intercept_profile: std::string::String,
20609
20610 /// Optional. Reference to a SecurityProfile with the UrlFiltering
20611 /// configuration.
20612 pub url_filtering_profile: std::string::String,
20613
20614 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20615}
20616
20617impl SecurityProfileGroup {
20618 pub fn new() -> Self {
20619 std::default::Default::default()
20620 }
20621
20622 /// Sets the value of [name][crate::model::SecurityProfileGroup::name].
20623 ///
20624 /// # Example
20625 /// ```ignore,no_run
20626 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20627 /// let x = SecurityProfileGroup::new().set_name("example");
20628 /// ```
20629 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20630 self.name = v.into();
20631 self
20632 }
20633
20634 /// Sets the value of [description][crate::model::SecurityProfileGroup::description].
20635 ///
20636 /// # Example
20637 /// ```ignore,no_run
20638 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20639 /// let x = SecurityProfileGroup::new().set_description("example");
20640 /// ```
20641 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20642 self.description = v.into();
20643 self
20644 }
20645
20646 /// Sets the value of [create_time][crate::model::SecurityProfileGroup::create_time].
20647 ///
20648 /// # Example
20649 /// ```ignore,no_run
20650 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20651 /// use wkt::Timestamp;
20652 /// let x = SecurityProfileGroup::new().set_create_time(Timestamp::default()/* use setters */);
20653 /// ```
20654 pub fn set_create_time<T>(mut self, v: T) -> Self
20655 where
20656 T: std::convert::Into<wkt::Timestamp>,
20657 {
20658 self.create_time = std::option::Option::Some(v.into());
20659 self
20660 }
20661
20662 /// Sets or clears the value of [create_time][crate::model::SecurityProfileGroup::create_time].
20663 ///
20664 /// # Example
20665 /// ```ignore,no_run
20666 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20667 /// use wkt::Timestamp;
20668 /// let x = SecurityProfileGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
20669 /// let x = SecurityProfileGroup::new().set_or_clear_create_time(None::<Timestamp>);
20670 /// ```
20671 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
20672 where
20673 T: std::convert::Into<wkt::Timestamp>,
20674 {
20675 self.create_time = v.map(|x| x.into());
20676 self
20677 }
20678
20679 /// Sets the value of [update_time][crate::model::SecurityProfileGroup::update_time].
20680 ///
20681 /// # Example
20682 /// ```ignore,no_run
20683 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20684 /// use wkt::Timestamp;
20685 /// let x = SecurityProfileGroup::new().set_update_time(Timestamp::default()/* use setters */);
20686 /// ```
20687 pub fn set_update_time<T>(mut self, v: T) -> Self
20688 where
20689 T: std::convert::Into<wkt::Timestamp>,
20690 {
20691 self.update_time = std::option::Option::Some(v.into());
20692 self
20693 }
20694
20695 /// Sets or clears the value of [update_time][crate::model::SecurityProfileGroup::update_time].
20696 ///
20697 /// # Example
20698 /// ```ignore,no_run
20699 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20700 /// use wkt::Timestamp;
20701 /// let x = SecurityProfileGroup::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
20702 /// let x = SecurityProfileGroup::new().set_or_clear_update_time(None::<Timestamp>);
20703 /// ```
20704 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
20705 where
20706 T: std::convert::Into<wkt::Timestamp>,
20707 {
20708 self.update_time = v.map(|x| x.into());
20709 self
20710 }
20711
20712 /// Sets the value of [etag][crate::model::SecurityProfileGroup::etag].
20713 ///
20714 /// # Example
20715 /// ```ignore,no_run
20716 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20717 /// let x = SecurityProfileGroup::new().set_etag("example");
20718 /// ```
20719 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20720 self.etag = v.into();
20721 self
20722 }
20723
20724 /// Sets the value of [data_path_id][crate::model::SecurityProfileGroup::data_path_id].
20725 ///
20726 /// # Example
20727 /// ```ignore,no_run
20728 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20729 /// let x = SecurityProfileGroup::new().set_data_path_id(42_u32);
20730 /// ```
20731 pub fn set_data_path_id<T: std::convert::Into<u64>>(mut self, v: T) -> Self {
20732 self.data_path_id = v.into();
20733 self
20734 }
20735
20736 /// Sets the value of [labels][crate::model::SecurityProfileGroup::labels].
20737 ///
20738 /// # Example
20739 /// ```ignore,no_run
20740 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20741 /// let x = SecurityProfileGroup::new().set_labels([
20742 /// ("key0", "abc"),
20743 /// ("key1", "xyz"),
20744 /// ]);
20745 /// ```
20746 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
20747 where
20748 T: std::iter::IntoIterator<Item = (K, V)>,
20749 K: std::convert::Into<std::string::String>,
20750 V: std::convert::Into<std::string::String>,
20751 {
20752 use std::iter::Iterator;
20753 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
20754 self
20755 }
20756
20757 /// Sets the value of [threat_prevention_profile][crate::model::SecurityProfileGroup::threat_prevention_profile].
20758 ///
20759 /// # Example
20760 /// ```ignore,no_run
20761 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20762 /// let x = SecurityProfileGroup::new().set_threat_prevention_profile("example");
20763 /// ```
20764 pub fn set_threat_prevention_profile<T: std::convert::Into<std::string::String>>(
20765 mut self,
20766 v: T,
20767 ) -> Self {
20768 self.threat_prevention_profile = v.into();
20769 self
20770 }
20771
20772 /// Sets the value of [custom_mirroring_profile][crate::model::SecurityProfileGroup::custom_mirroring_profile].
20773 ///
20774 /// # Example
20775 /// ```ignore,no_run
20776 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20777 /// let x = SecurityProfileGroup::new().set_custom_mirroring_profile("example");
20778 /// ```
20779 pub fn set_custom_mirroring_profile<T: std::convert::Into<std::string::String>>(
20780 mut self,
20781 v: T,
20782 ) -> Self {
20783 self.custom_mirroring_profile = v.into();
20784 self
20785 }
20786
20787 /// Sets the value of [custom_intercept_profile][crate::model::SecurityProfileGroup::custom_intercept_profile].
20788 ///
20789 /// # Example
20790 /// ```ignore,no_run
20791 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20792 /// let x = SecurityProfileGroup::new().set_custom_intercept_profile("example");
20793 /// ```
20794 pub fn set_custom_intercept_profile<T: std::convert::Into<std::string::String>>(
20795 mut self,
20796 v: T,
20797 ) -> Self {
20798 self.custom_intercept_profile = v.into();
20799 self
20800 }
20801
20802 /// Sets the value of [url_filtering_profile][crate::model::SecurityProfileGroup::url_filtering_profile].
20803 ///
20804 /// # Example
20805 /// ```ignore,no_run
20806 /// # use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
20807 /// let x = SecurityProfileGroup::new().set_url_filtering_profile("example");
20808 /// ```
20809 pub fn set_url_filtering_profile<T: std::convert::Into<std::string::String>>(
20810 mut self,
20811 v: T,
20812 ) -> Self {
20813 self.url_filtering_profile = v.into();
20814 self
20815 }
20816}
20817
20818impl wkt::message::Message for SecurityProfileGroup {
20819 fn typename() -> &'static str {
20820 "type.googleapis.com/google.cloud.networksecurity.v1.SecurityProfileGroup"
20821 }
20822}
20823
20824/// SecurityProfile is a resource that defines the behavior for one of many
20825/// ProfileTypes.
20826#[derive(Clone, Default, PartialEq)]
20827#[non_exhaustive]
20828pub struct SecurityProfile {
20829 /// Immutable. Identifier. Name of the SecurityProfile resource. It matches
20830 /// pattern
20831 /// `projects|organizations/*/locations/{location}/securityProfiles/{security_profile}`.
20832 pub name: std::string::String,
20833
20834 /// Optional. An optional description of the profile. Max length 512
20835 /// characters.
20836 pub description: std::string::String,
20837
20838 /// Output only. Resource creation timestamp.
20839 pub create_time: std::option::Option<wkt::Timestamp>,
20840
20841 /// Output only. Last resource update timestamp.
20842 pub update_time: std::option::Option<wkt::Timestamp>,
20843
20844 /// Output only. This checksum is computed by the server based on the value of
20845 /// other fields, and may be sent on update and delete requests to ensure the
20846 /// client has an up-to-date value before proceeding.
20847 pub etag: std::string::String,
20848
20849 /// Optional. Labels as key value pairs.
20850 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
20851
20852 /// Immutable. The single ProfileType that the SecurityProfile resource
20853 /// configures.
20854 pub r#type: crate::model::security_profile::ProfileType,
20855
20856 /// The behavior for the ProfileType that the SecurityProfile resource is meant
20857 /// to configure. This field must correspond to the ProfileType of the
20858 /// SecurityProfile.
20859 pub profile: std::option::Option<crate::model::security_profile::Profile>,
20860
20861 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20862}
20863
20864impl SecurityProfile {
20865 pub fn new() -> Self {
20866 std::default::Default::default()
20867 }
20868
20869 /// Sets the value of [name][crate::model::SecurityProfile::name].
20870 ///
20871 /// # Example
20872 /// ```ignore,no_run
20873 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
20874 /// let x = SecurityProfile::new().set_name("example");
20875 /// ```
20876 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20877 self.name = v.into();
20878 self
20879 }
20880
20881 /// Sets the value of [description][crate::model::SecurityProfile::description].
20882 ///
20883 /// # Example
20884 /// ```ignore,no_run
20885 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
20886 /// let x = SecurityProfile::new().set_description("example");
20887 /// ```
20888 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20889 self.description = v.into();
20890 self
20891 }
20892
20893 /// Sets the value of [create_time][crate::model::SecurityProfile::create_time].
20894 ///
20895 /// # Example
20896 /// ```ignore,no_run
20897 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
20898 /// use wkt::Timestamp;
20899 /// let x = SecurityProfile::new().set_create_time(Timestamp::default()/* use setters */);
20900 /// ```
20901 pub fn set_create_time<T>(mut self, v: T) -> Self
20902 where
20903 T: std::convert::Into<wkt::Timestamp>,
20904 {
20905 self.create_time = std::option::Option::Some(v.into());
20906 self
20907 }
20908
20909 /// Sets or clears the value of [create_time][crate::model::SecurityProfile::create_time].
20910 ///
20911 /// # Example
20912 /// ```ignore,no_run
20913 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
20914 /// use wkt::Timestamp;
20915 /// let x = SecurityProfile::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
20916 /// let x = SecurityProfile::new().set_or_clear_create_time(None::<Timestamp>);
20917 /// ```
20918 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
20919 where
20920 T: std::convert::Into<wkt::Timestamp>,
20921 {
20922 self.create_time = v.map(|x| x.into());
20923 self
20924 }
20925
20926 /// Sets the value of [update_time][crate::model::SecurityProfile::update_time].
20927 ///
20928 /// # Example
20929 /// ```ignore,no_run
20930 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
20931 /// use wkt::Timestamp;
20932 /// let x = SecurityProfile::new().set_update_time(Timestamp::default()/* use setters */);
20933 /// ```
20934 pub fn set_update_time<T>(mut self, v: T) -> Self
20935 where
20936 T: std::convert::Into<wkt::Timestamp>,
20937 {
20938 self.update_time = std::option::Option::Some(v.into());
20939 self
20940 }
20941
20942 /// Sets or clears the value of [update_time][crate::model::SecurityProfile::update_time].
20943 ///
20944 /// # Example
20945 /// ```ignore,no_run
20946 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
20947 /// use wkt::Timestamp;
20948 /// let x = SecurityProfile::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
20949 /// let x = SecurityProfile::new().set_or_clear_update_time(None::<Timestamp>);
20950 /// ```
20951 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
20952 where
20953 T: std::convert::Into<wkt::Timestamp>,
20954 {
20955 self.update_time = v.map(|x| x.into());
20956 self
20957 }
20958
20959 /// Sets the value of [etag][crate::model::SecurityProfile::etag].
20960 ///
20961 /// # Example
20962 /// ```ignore,no_run
20963 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
20964 /// let x = SecurityProfile::new().set_etag("example");
20965 /// ```
20966 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20967 self.etag = v.into();
20968 self
20969 }
20970
20971 /// Sets the value of [labels][crate::model::SecurityProfile::labels].
20972 ///
20973 /// # Example
20974 /// ```ignore,no_run
20975 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
20976 /// let x = SecurityProfile::new().set_labels([
20977 /// ("key0", "abc"),
20978 /// ("key1", "xyz"),
20979 /// ]);
20980 /// ```
20981 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
20982 where
20983 T: std::iter::IntoIterator<Item = (K, V)>,
20984 K: std::convert::Into<std::string::String>,
20985 V: std::convert::Into<std::string::String>,
20986 {
20987 use std::iter::Iterator;
20988 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
20989 self
20990 }
20991
20992 /// Sets the value of [r#type][crate::model::SecurityProfile::type].
20993 ///
20994 /// # Example
20995 /// ```ignore,no_run
20996 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
20997 /// use google_cloud_networksecurity_v1::model::security_profile::ProfileType;
20998 /// let x0 = SecurityProfile::new().set_type(ProfileType::ThreatPrevention);
20999 /// let x1 = SecurityProfile::new().set_type(ProfileType::CustomMirroring);
21000 /// let x2 = SecurityProfile::new().set_type(ProfileType::CustomIntercept);
21001 /// ```
21002 pub fn set_type<T: std::convert::Into<crate::model::security_profile::ProfileType>>(
21003 mut self,
21004 v: T,
21005 ) -> Self {
21006 self.r#type = v.into();
21007 self
21008 }
21009
21010 /// Sets the value of [profile][crate::model::SecurityProfile::profile].
21011 ///
21012 /// Note that all the setters affecting `profile` are mutually
21013 /// exclusive.
21014 ///
21015 /// # Example
21016 /// ```ignore,no_run
21017 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21018 /// use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
21019 /// let x = SecurityProfile::new().set_profile(Some(
21020 /// google_cloud_networksecurity_v1::model::security_profile::Profile::ThreatPreventionProfile(ThreatPreventionProfile::default().into())));
21021 /// ```
21022 pub fn set_profile<
21023 T: std::convert::Into<std::option::Option<crate::model::security_profile::Profile>>,
21024 >(
21025 mut self,
21026 v: T,
21027 ) -> Self {
21028 self.profile = v.into();
21029 self
21030 }
21031
21032 /// The value of [profile][crate::model::SecurityProfile::profile]
21033 /// if it holds a `ThreatPreventionProfile`, `None` if the field is not set or
21034 /// holds a different branch.
21035 pub fn threat_prevention_profile(
21036 &self,
21037 ) -> std::option::Option<&std::boxed::Box<crate::model::ThreatPreventionProfile>> {
21038 #[allow(unreachable_patterns)]
21039 self.profile.as_ref().and_then(|v| match v {
21040 crate::model::security_profile::Profile::ThreatPreventionProfile(v) => {
21041 std::option::Option::Some(v)
21042 }
21043 _ => std::option::Option::None,
21044 })
21045 }
21046
21047 /// Sets the value of [profile][crate::model::SecurityProfile::profile]
21048 /// to hold a `ThreatPreventionProfile`.
21049 ///
21050 /// Note that all the setters affecting `profile` are
21051 /// mutually exclusive.
21052 ///
21053 /// # Example
21054 /// ```ignore,no_run
21055 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21056 /// use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
21057 /// let x = SecurityProfile::new().set_threat_prevention_profile(ThreatPreventionProfile::default()/* use setters */);
21058 /// assert!(x.threat_prevention_profile().is_some());
21059 /// assert!(x.custom_mirroring_profile().is_none());
21060 /// assert!(x.custom_intercept_profile().is_none());
21061 /// assert!(x.url_filtering_profile().is_none());
21062 /// ```
21063 pub fn set_threat_prevention_profile<
21064 T: std::convert::Into<std::boxed::Box<crate::model::ThreatPreventionProfile>>,
21065 >(
21066 mut self,
21067 v: T,
21068 ) -> Self {
21069 self.profile = std::option::Option::Some(
21070 crate::model::security_profile::Profile::ThreatPreventionProfile(v.into()),
21071 );
21072 self
21073 }
21074
21075 /// The value of [profile][crate::model::SecurityProfile::profile]
21076 /// if it holds a `CustomMirroringProfile`, `None` if the field is not set or
21077 /// holds a different branch.
21078 pub fn custom_mirroring_profile(
21079 &self,
21080 ) -> std::option::Option<&std::boxed::Box<crate::model::CustomMirroringProfile>> {
21081 #[allow(unreachable_patterns)]
21082 self.profile.as_ref().and_then(|v| match v {
21083 crate::model::security_profile::Profile::CustomMirroringProfile(v) => {
21084 std::option::Option::Some(v)
21085 }
21086 _ => std::option::Option::None,
21087 })
21088 }
21089
21090 /// Sets the value of [profile][crate::model::SecurityProfile::profile]
21091 /// to hold a `CustomMirroringProfile`.
21092 ///
21093 /// Note that all the setters affecting `profile` are
21094 /// mutually exclusive.
21095 ///
21096 /// # Example
21097 /// ```ignore,no_run
21098 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21099 /// use google_cloud_networksecurity_v1::model::CustomMirroringProfile;
21100 /// let x = SecurityProfile::new().set_custom_mirroring_profile(CustomMirroringProfile::default()/* use setters */);
21101 /// assert!(x.custom_mirroring_profile().is_some());
21102 /// assert!(x.threat_prevention_profile().is_none());
21103 /// assert!(x.custom_intercept_profile().is_none());
21104 /// assert!(x.url_filtering_profile().is_none());
21105 /// ```
21106 pub fn set_custom_mirroring_profile<
21107 T: std::convert::Into<std::boxed::Box<crate::model::CustomMirroringProfile>>,
21108 >(
21109 mut self,
21110 v: T,
21111 ) -> Self {
21112 self.profile = std::option::Option::Some(
21113 crate::model::security_profile::Profile::CustomMirroringProfile(v.into()),
21114 );
21115 self
21116 }
21117
21118 /// The value of [profile][crate::model::SecurityProfile::profile]
21119 /// if it holds a `CustomInterceptProfile`, `None` if the field is not set or
21120 /// holds a different branch.
21121 pub fn custom_intercept_profile(
21122 &self,
21123 ) -> std::option::Option<&std::boxed::Box<crate::model::CustomInterceptProfile>> {
21124 #[allow(unreachable_patterns)]
21125 self.profile.as_ref().and_then(|v| match v {
21126 crate::model::security_profile::Profile::CustomInterceptProfile(v) => {
21127 std::option::Option::Some(v)
21128 }
21129 _ => std::option::Option::None,
21130 })
21131 }
21132
21133 /// Sets the value of [profile][crate::model::SecurityProfile::profile]
21134 /// to hold a `CustomInterceptProfile`.
21135 ///
21136 /// Note that all the setters affecting `profile` are
21137 /// mutually exclusive.
21138 ///
21139 /// # Example
21140 /// ```ignore,no_run
21141 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21142 /// use google_cloud_networksecurity_v1::model::CustomInterceptProfile;
21143 /// let x = SecurityProfile::new().set_custom_intercept_profile(CustomInterceptProfile::default()/* use setters */);
21144 /// assert!(x.custom_intercept_profile().is_some());
21145 /// assert!(x.threat_prevention_profile().is_none());
21146 /// assert!(x.custom_mirroring_profile().is_none());
21147 /// assert!(x.url_filtering_profile().is_none());
21148 /// ```
21149 pub fn set_custom_intercept_profile<
21150 T: std::convert::Into<std::boxed::Box<crate::model::CustomInterceptProfile>>,
21151 >(
21152 mut self,
21153 v: T,
21154 ) -> Self {
21155 self.profile = std::option::Option::Some(
21156 crate::model::security_profile::Profile::CustomInterceptProfile(v.into()),
21157 );
21158 self
21159 }
21160
21161 /// The value of [profile][crate::model::SecurityProfile::profile]
21162 /// if it holds a `UrlFilteringProfile`, `None` if the field is not set or
21163 /// holds a different branch.
21164 pub fn url_filtering_profile(
21165 &self,
21166 ) -> std::option::Option<&std::boxed::Box<crate::model::UrlFilteringProfile>> {
21167 #[allow(unreachable_patterns)]
21168 self.profile.as_ref().and_then(|v| match v {
21169 crate::model::security_profile::Profile::UrlFilteringProfile(v) => {
21170 std::option::Option::Some(v)
21171 }
21172 _ => std::option::Option::None,
21173 })
21174 }
21175
21176 /// Sets the value of [profile][crate::model::SecurityProfile::profile]
21177 /// to hold a `UrlFilteringProfile`.
21178 ///
21179 /// Note that all the setters affecting `profile` are
21180 /// mutually exclusive.
21181 ///
21182 /// # Example
21183 /// ```ignore,no_run
21184 /// # use google_cloud_networksecurity_v1::model::SecurityProfile;
21185 /// use google_cloud_networksecurity_v1::model::UrlFilteringProfile;
21186 /// let x = SecurityProfile::new().set_url_filtering_profile(UrlFilteringProfile::default()/* use setters */);
21187 /// assert!(x.url_filtering_profile().is_some());
21188 /// assert!(x.threat_prevention_profile().is_none());
21189 /// assert!(x.custom_mirroring_profile().is_none());
21190 /// assert!(x.custom_intercept_profile().is_none());
21191 /// ```
21192 pub fn set_url_filtering_profile<
21193 T: std::convert::Into<std::boxed::Box<crate::model::UrlFilteringProfile>>,
21194 >(
21195 mut self,
21196 v: T,
21197 ) -> Self {
21198 self.profile = std::option::Option::Some(
21199 crate::model::security_profile::Profile::UrlFilteringProfile(v.into()),
21200 );
21201 self
21202 }
21203}
21204
21205impl wkt::message::Message for SecurityProfile {
21206 fn typename() -> &'static str {
21207 "type.googleapis.com/google.cloud.networksecurity.v1.SecurityProfile"
21208 }
21209}
21210
21211/// Defines additional types related to [SecurityProfile].
21212pub mod security_profile {
21213 #[allow(unused_imports)]
21214 use super::*;
21215
21216 /// The possible types that the SecurityProfile resource can configure.
21217 ///
21218 /// # Working with unknown values
21219 ///
21220 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21221 /// additional enum variants at any time. Adding new variants is not considered
21222 /// a breaking change. Applications should write their code in anticipation of:
21223 ///
21224 /// - New values appearing in future releases of the client library, **and**
21225 /// - New values received dynamically, without application changes.
21226 ///
21227 /// Please consult the [Working with enums] section in the user guide for some
21228 /// guidelines.
21229 ///
21230 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
21231 #[derive(Clone, Debug, PartialEq)]
21232 #[non_exhaustive]
21233 pub enum ProfileType {
21234 /// Profile type not specified.
21235 Unspecified,
21236 /// Profile type for threat prevention.
21237 ThreatPrevention,
21238 /// Profile type for packet mirroring v2
21239 CustomMirroring,
21240 /// Profile type for TPPI.
21241 CustomIntercept,
21242 /// Profile type for URL filtering.
21243 UrlFiltering,
21244 /// If set, the enum was initialized with an unknown value.
21245 ///
21246 /// Applications can examine the value using [ProfileType::value] or
21247 /// [ProfileType::name].
21248 UnknownValue(profile_type::UnknownValue),
21249 }
21250
21251 #[doc(hidden)]
21252 pub mod profile_type {
21253 #[allow(unused_imports)]
21254 use super::*;
21255 #[derive(Clone, Debug, PartialEq)]
21256 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21257 }
21258
21259 impl ProfileType {
21260 /// Gets the enum value.
21261 ///
21262 /// Returns `None` if the enum contains an unknown value deserialized from
21263 /// the string representation of enums.
21264 pub fn value(&self) -> std::option::Option<i32> {
21265 match self {
21266 Self::Unspecified => std::option::Option::Some(0),
21267 Self::ThreatPrevention => std::option::Option::Some(1),
21268 Self::CustomMirroring => std::option::Option::Some(2),
21269 Self::CustomIntercept => std::option::Option::Some(3),
21270 Self::UrlFiltering => std::option::Option::Some(5),
21271 Self::UnknownValue(u) => u.0.value(),
21272 }
21273 }
21274
21275 /// Gets the enum value as a string.
21276 ///
21277 /// Returns `None` if the enum contains an unknown value deserialized from
21278 /// the integer representation of enums.
21279 pub fn name(&self) -> std::option::Option<&str> {
21280 match self {
21281 Self::Unspecified => std::option::Option::Some("PROFILE_TYPE_UNSPECIFIED"),
21282 Self::ThreatPrevention => std::option::Option::Some("THREAT_PREVENTION"),
21283 Self::CustomMirroring => std::option::Option::Some("CUSTOM_MIRRORING"),
21284 Self::CustomIntercept => std::option::Option::Some("CUSTOM_INTERCEPT"),
21285 Self::UrlFiltering => std::option::Option::Some("URL_FILTERING"),
21286 Self::UnknownValue(u) => u.0.name(),
21287 }
21288 }
21289 }
21290
21291 impl std::default::Default for ProfileType {
21292 fn default() -> Self {
21293 use std::convert::From;
21294 Self::from(0)
21295 }
21296 }
21297
21298 impl std::fmt::Display for ProfileType {
21299 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21300 wkt::internal::display_enum(f, self.name(), self.value())
21301 }
21302 }
21303
21304 impl std::convert::From<i32> for ProfileType {
21305 fn from(value: i32) -> Self {
21306 match value {
21307 0 => Self::Unspecified,
21308 1 => Self::ThreatPrevention,
21309 2 => Self::CustomMirroring,
21310 3 => Self::CustomIntercept,
21311 5 => Self::UrlFiltering,
21312 _ => Self::UnknownValue(profile_type::UnknownValue(
21313 wkt::internal::UnknownEnumValue::Integer(value),
21314 )),
21315 }
21316 }
21317 }
21318
21319 impl std::convert::From<&str> for ProfileType {
21320 fn from(value: &str) -> Self {
21321 use std::string::ToString;
21322 match value {
21323 "PROFILE_TYPE_UNSPECIFIED" => Self::Unspecified,
21324 "THREAT_PREVENTION" => Self::ThreatPrevention,
21325 "CUSTOM_MIRRORING" => Self::CustomMirroring,
21326 "CUSTOM_INTERCEPT" => Self::CustomIntercept,
21327 "URL_FILTERING" => Self::UrlFiltering,
21328 _ => Self::UnknownValue(profile_type::UnknownValue(
21329 wkt::internal::UnknownEnumValue::String(value.to_string()),
21330 )),
21331 }
21332 }
21333 }
21334
21335 impl serde::ser::Serialize for ProfileType {
21336 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21337 where
21338 S: serde::Serializer,
21339 {
21340 match self {
21341 Self::Unspecified => serializer.serialize_i32(0),
21342 Self::ThreatPrevention => serializer.serialize_i32(1),
21343 Self::CustomMirroring => serializer.serialize_i32(2),
21344 Self::CustomIntercept => serializer.serialize_i32(3),
21345 Self::UrlFiltering => serializer.serialize_i32(5),
21346 Self::UnknownValue(u) => u.0.serialize(serializer),
21347 }
21348 }
21349 }
21350
21351 impl<'de> serde::de::Deserialize<'de> for ProfileType {
21352 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21353 where
21354 D: serde::Deserializer<'de>,
21355 {
21356 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProfileType>::new(
21357 ".google.cloud.networksecurity.v1.SecurityProfile.ProfileType",
21358 ))
21359 }
21360 }
21361
21362 /// The behavior for the ProfileType that the SecurityProfile resource is meant
21363 /// to configure. This field must correspond to the ProfileType of the
21364 /// SecurityProfile.
21365 #[derive(Clone, Debug, PartialEq)]
21366 #[non_exhaustive]
21367 pub enum Profile {
21368 /// The threat prevention configuration for the SecurityProfile.
21369 ThreatPreventionProfile(std::boxed::Box<crate::model::ThreatPreventionProfile>),
21370 /// The custom Packet Mirroring v2 configuration for the SecurityProfile.
21371 CustomMirroringProfile(std::boxed::Box<crate::model::CustomMirroringProfile>),
21372 /// The custom TPPI configuration for the SecurityProfile.
21373 CustomInterceptProfile(std::boxed::Box<crate::model::CustomInterceptProfile>),
21374 /// The URL filtering configuration for the SecurityProfile.
21375 UrlFilteringProfile(std::boxed::Box<crate::model::UrlFilteringProfile>),
21376 }
21377}
21378
21379/// CustomInterceptProfile defines in-band integration behavior (intercept).
21380/// It is used by firewall rules with an APPLY_SECURITY_PROFILE_GROUP action.
21381#[derive(Clone, Default, PartialEq)]
21382#[non_exhaustive]
21383pub struct CustomInterceptProfile {
21384 /// Required. The target InterceptEndpointGroup.
21385 /// When a firewall rule with this security profile attached matches a packet,
21386 /// the packet will be intercepted to the location-local target in this group.
21387 pub intercept_endpoint_group: std::string::String,
21388
21389 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21390}
21391
21392impl CustomInterceptProfile {
21393 pub fn new() -> Self {
21394 std::default::Default::default()
21395 }
21396
21397 /// Sets the value of [intercept_endpoint_group][crate::model::CustomInterceptProfile::intercept_endpoint_group].
21398 ///
21399 /// # Example
21400 /// ```ignore,no_run
21401 /// # use google_cloud_networksecurity_v1::model::CustomInterceptProfile;
21402 /// let x = CustomInterceptProfile::new().set_intercept_endpoint_group("example");
21403 /// ```
21404 pub fn set_intercept_endpoint_group<T: std::convert::Into<std::string::String>>(
21405 mut self,
21406 v: T,
21407 ) -> Self {
21408 self.intercept_endpoint_group = v.into();
21409 self
21410 }
21411}
21412
21413impl wkt::message::Message for CustomInterceptProfile {
21414 fn typename() -> &'static str {
21415 "type.googleapis.com/google.cloud.networksecurity.v1.CustomInterceptProfile"
21416 }
21417}
21418
21419/// CustomMirroringProfile defines out-of-band integration behavior (mirroring).
21420/// It is used by mirroring rules with a MIRROR action.
21421#[derive(Clone, Default, PartialEq)]
21422#[non_exhaustive]
21423pub struct CustomMirroringProfile {
21424 /// Required. Immutable. The target MirroringEndpointGroup.
21425 /// When a mirroring rule with this security profile attached matches a packet,
21426 /// a replica will be mirrored to the location-local target in this group.
21427 pub mirroring_endpoint_group: std::string::String,
21428
21429 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21430}
21431
21432impl CustomMirroringProfile {
21433 pub fn new() -> Self {
21434 std::default::Default::default()
21435 }
21436
21437 /// Sets the value of [mirroring_endpoint_group][crate::model::CustomMirroringProfile::mirroring_endpoint_group].
21438 ///
21439 /// # Example
21440 /// ```ignore,no_run
21441 /// # use google_cloud_networksecurity_v1::model::CustomMirroringProfile;
21442 /// let x = CustomMirroringProfile::new().set_mirroring_endpoint_group("example");
21443 /// ```
21444 pub fn set_mirroring_endpoint_group<T: std::convert::Into<std::string::String>>(
21445 mut self,
21446 v: T,
21447 ) -> Self {
21448 self.mirroring_endpoint_group = v.into();
21449 self
21450 }
21451}
21452
21453impl wkt::message::Message for CustomMirroringProfile {
21454 fn typename() -> &'static str {
21455 "type.googleapis.com/google.cloud.networksecurity.v1.CustomMirroringProfile"
21456 }
21457}
21458
21459/// Request used with the ListSecurityProfileGroups method.
21460#[derive(Clone, Default, PartialEq)]
21461#[non_exhaustive]
21462pub struct ListSecurityProfileGroupsRequest {
21463 /// Required. The project or organization and location from which the
21464 /// SecurityProfileGroups should be listed, specified in the format
21465 /// `projects|organizations/*/locations/{location}`.
21466 pub parent: std::string::String,
21467
21468 /// Optional. Maximum number of SecurityProfileGroups to return per call.
21469 pub page_size: i32,
21470
21471 /// Optional. The value returned by the last
21472 /// `ListSecurityProfileGroupsResponse` Indicates that this is a
21473 /// continuation of a prior `ListSecurityProfileGroups` call, and
21474 /// that the system should return the next page of data.
21475 pub page_token: std::string::String,
21476
21477 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21478}
21479
21480impl ListSecurityProfileGroupsRequest {
21481 pub fn new() -> Self {
21482 std::default::Default::default()
21483 }
21484
21485 /// Sets the value of [parent][crate::model::ListSecurityProfileGroupsRequest::parent].
21486 ///
21487 /// # Example
21488 /// ```ignore,no_run
21489 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsRequest;
21490 /// let x = ListSecurityProfileGroupsRequest::new().set_parent("example");
21491 /// ```
21492 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21493 self.parent = v.into();
21494 self
21495 }
21496
21497 /// Sets the value of [page_size][crate::model::ListSecurityProfileGroupsRequest::page_size].
21498 ///
21499 /// # Example
21500 /// ```ignore,no_run
21501 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsRequest;
21502 /// let x = ListSecurityProfileGroupsRequest::new().set_page_size(42);
21503 /// ```
21504 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
21505 self.page_size = v.into();
21506 self
21507 }
21508
21509 /// Sets the value of [page_token][crate::model::ListSecurityProfileGroupsRequest::page_token].
21510 ///
21511 /// # Example
21512 /// ```ignore,no_run
21513 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsRequest;
21514 /// let x = ListSecurityProfileGroupsRequest::new().set_page_token("example");
21515 /// ```
21516 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21517 self.page_token = v.into();
21518 self
21519 }
21520}
21521
21522impl wkt::message::Message for ListSecurityProfileGroupsRequest {
21523 fn typename() -> &'static str {
21524 "type.googleapis.com/google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest"
21525 }
21526}
21527
21528/// Response returned by the ListSecurityProfileGroups method.
21529#[derive(Clone, Default, PartialEq)]
21530#[non_exhaustive]
21531pub struct ListSecurityProfileGroupsResponse {
21532 /// List of SecurityProfileGroups resources.
21533 pub security_profile_groups: std::vec::Vec<crate::model::SecurityProfileGroup>,
21534
21535 /// If there might be more results than those appearing in this response, then
21536 /// `next_page_token` is included. To get the next set of results, call this
21537 /// method again using the value of `next_page_token` as `page_token`.
21538 pub next_page_token: std::string::String,
21539
21540 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21541}
21542
21543impl ListSecurityProfileGroupsResponse {
21544 pub fn new() -> Self {
21545 std::default::Default::default()
21546 }
21547
21548 /// Sets the value of [security_profile_groups][crate::model::ListSecurityProfileGroupsResponse::security_profile_groups].
21549 ///
21550 /// # Example
21551 /// ```ignore,no_run
21552 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsResponse;
21553 /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21554 /// let x = ListSecurityProfileGroupsResponse::new()
21555 /// .set_security_profile_groups([
21556 /// SecurityProfileGroup::default()/* use setters */,
21557 /// SecurityProfileGroup::default()/* use (different) setters */,
21558 /// ]);
21559 /// ```
21560 pub fn set_security_profile_groups<T, V>(mut self, v: T) -> Self
21561 where
21562 T: std::iter::IntoIterator<Item = V>,
21563 V: std::convert::Into<crate::model::SecurityProfileGroup>,
21564 {
21565 use std::iter::Iterator;
21566 self.security_profile_groups = v.into_iter().map(|i| i.into()).collect();
21567 self
21568 }
21569
21570 /// Sets the value of [next_page_token][crate::model::ListSecurityProfileGroupsResponse::next_page_token].
21571 ///
21572 /// # Example
21573 /// ```ignore,no_run
21574 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfileGroupsResponse;
21575 /// let x = ListSecurityProfileGroupsResponse::new().set_next_page_token("example");
21576 /// ```
21577 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21578 self.next_page_token = v.into();
21579 self
21580 }
21581}
21582
21583impl wkt::message::Message for ListSecurityProfileGroupsResponse {
21584 fn typename() -> &'static str {
21585 "type.googleapis.com/google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse"
21586 }
21587}
21588
21589#[doc(hidden)]
21590impl google_cloud_gax::paginator::internal::PageableResponse for ListSecurityProfileGroupsResponse {
21591 type PageItem = crate::model::SecurityProfileGroup;
21592
21593 fn items(self) -> std::vec::Vec<Self::PageItem> {
21594 self.security_profile_groups
21595 }
21596
21597 fn next_page_token(&self) -> std::string::String {
21598 use std::clone::Clone;
21599 self.next_page_token.clone()
21600 }
21601}
21602
21603/// Request used by the GetSecurityProfileGroup method.
21604#[derive(Clone, Default, PartialEq)]
21605#[non_exhaustive]
21606pub struct GetSecurityProfileGroupRequest {
21607 /// Required. A name of the SecurityProfileGroup to get. Must be in the format
21608 /// `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`.
21609 pub name: std::string::String,
21610
21611 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21612}
21613
21614impl GetSecurityProfileGroupRequest {
21615 pub fn new() -> Self {
21616 std::default::Default::default()
21617 }
21618
21619 /// Sets the value of [name][crate::model::GetSecurityProfileGroupRequest::name].
21620 ///
21621 /// # Example
21622 /// ```ignore,no_run
21623 /// # use google_cloud_networksecurity_v1::model::GetSecurityProfileGroupRequest;
21624 /// let x = GetSecurityProfileGroupRequest::new().set_name("example");
21625 /// ```
21626 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21627 self.name = v.into();
21628 self
21629 }
21630}
21631
21632impl wkt::message::Message for GetSecurityProfileGroupRequest {
21633 fn typename() -> &'static str {
21634 "type.googleapis.com/google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest"
21635 }
21636}
21637
21638/// Request used by the CreateSecurityProfileGroup method.
21639#[derive(Clone, Default, PartialEq)]
21640#[non_exhaustive]
21641pub struct CreateSecurityProfileGroupRequest {
21642 /// Required. The parent resource of the SecurityProfileGroup. Must be in the
21643 /// format `projects|organizations/*/locations/{location}`.
21644 pub parent: std::string::String,
21645
21646 /// Required. Short name of the SecurityProfileGroup resource to be created.
21647 /// This value should be 1-63 characters long, containing only
21648 /// letters, numbers, hyphens, and underscores, and should not start
21649 /// with a number. E.g. "security_profile_group1".
21650 pub security_profile_group_id: std::string::String,
21651
21652 /// Required. SecurityProfileGroup resource to be created.
21653 pub security_profile_group: std::option::Option<crate::model::SecurityProfileGroup>,
21654
21655 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21656}
21657
21658impl CreateSecurityProfileGroupRequest {
21659 pub fn new() -> Self {
21660 std::default::Default::default()
21661 }
21662
21663 /// Sets the value of [parent][crate::model::CreateSecurityProfileGroupRequest::parent].
21664 ///
21665 /// # Example
21666 /// ```ignore,no_run
21667 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileGroupRequest;
21668 /// let x = CreateSecurityProfileGroupRequest::new().set_parent("example");
21669 /// ```
21670 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21671 self.parent = v.into();
21672 self
21673 }
21674
21675 /// Sets the value of [security_profile_group_id][crate::model::CreateSecurityProfileGroupRequest::security_profile_group_id].
21676 ///
21677 /// # Example
21678 /// ```ignore,no_run
21679 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileGroupRequest;
21680 /// let x = CreateSecurityProfileGroupRequest::new().set_security_profile_group_id("example");
21681 /// ```
21682 pub fn set_security_profile_group_id<T: std::convert::Into<std::string::String>>(
21683 mut self,
21684 v: T,
21685 ) -> Self {
21686 self.security_profile_group_id = v.into();
21687 self
21688 }
21689
21690 /// Sets the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
21691 ///
21692 /// # Example
21693 /// ```ignore,no_run
21694 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileGroupRequest;
21695 /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21696 /// let x = CreateSecurityProfileGroupRequest::new().set_security_profile_group(SecurityProfileGroup::default()/* use setters */);
21697 /// ```
21698 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
21699 where
21700 T: std::convert::Into<crate::model::SecurityProfileGroup>,
21701 {
21702 self.security_profile_group = std::option::Option::Some(v.into());
21703 self
21704 }
21705
21706 /// Sets or clears the value of [security_profile_group][crate::model::CreateSecurityProfileGroupRequest::security_profile_group].
21707 ///
21708 /// # Example
21709 /// ```ignore,no_run
21710 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileGroupRequest;
21711 /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21712 /// let x = CreateSecurityProfileGroupRequest::new().set_or_clear_security_profile_group(Some(SecurityProfileGroup::default()/* use setters */));
21713 /// let x = CreateSecurityProfileGroupRequest::new().set_or_clear_security_profile_group(None::<SecurityProfileGroup>);
21714 /// ```
21715 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
21716 where
21717 T: std::convert::Into<crate::model::SecurityProfileGroup>,
21718 {
21719 self.security_profile_group = v.map(|x| x.into());
21720 self
21721 }
21722}
21723
21724impl wkt::message::Message for CreateSecurityProfileGroupRequest {
21725 fn typename() -> &'static str {
21726 "type.googleapis.com/google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest"
21727 }
21728}
21729
21730/// Request used by the UpdateSecurityProfileGroup method.
21731#[derive(Clone, Default, PartialEq)]
21732#[non_exhaustive]
21733pub struct UpdateSecurityProfileGroupRequest {
21734 /// Required. Field mask is used to specify the fields to be overwritten in the
21735 /// SecurityProfileGroup resource by the update.
21736 /// The fields specified in the update_mask are relative to the resource, not
21737 /// the full request. A field will be overwritten if it is in the mask.
21738 pub update_mask: std::option::Option<wkt::FieldMask>,
21739
21740 /// Required. Updated SecurityProfileGroup resource.
21741 pub security_profile_group: std::option::Option<crate::model::SecurityProfileGroup>,
21742
21743 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21744}
21745
21746impl UpdateSecurityProfileGroupRequest {
21747 pub fn new() -> Self {
21748 std::default::Default::default()
21749 }
21750
21751 /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
21752 ///
21753 /// # Example
21754 /// ```ignore,no_run
21755 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileGroupRequest;
21756 /// use wkt::FieldMask;
21757 /// let x = UpdateSecurityProfileGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21758 /// ```
21759 pub fn set_update_mask<T>(mut self, v: T) -> Self
21760 where
21761 T: std::convert::Into<wkt::FieldMask>,
21762 {
21763 self.update_mask = std::option::Option::Some(v.into());
21764 self
21765 }
21766
21767 /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileGroupRequest::update_mask].
21768 ///
21769 /// # Example
21770 /// ```ignore,no_run
21771 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileGroupRequest;
21772 /// use wkt::FieldMask;
21773 /// let x = UpdateSecurityProfileGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21774 /// let x = UpdateSecurityProfileGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21775 /// ```
21776 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21777 where
21778 T: std::convert::Into<wkt::FieldMask>,
21779 {
21780 self.update_mask = v.map(|x| x.into());
21781 self
21782 }
21783
21784 /// Sets the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
21785 ///
21786 /// # Example
21787 /// ```ignore,no_run
21788 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileGroupRequest;
21789 /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21790 /// let x = UpdateSecurityProfileGroupRequest::new().set_security_profile_group(SecurityProfileGroup::default()/* use setters */);
21791 /// ```
21792 pub fn set_security_profile_group<T>(mut self, v: T) -> Self
21793 where
21794 T: std::convert::Into<crate::model::SecurityProfileGroup>,
21795 {
21796 self.security_profile_group = std::option::Option::Some(v.into());
21797 self
21798 }
21799
21800 /// Sets or clears the value of [security_profile_group][crate::model::UpdateSecurityProfileGroupRequest::security_profile_group].
21801 ///
21802 /// # Example
21803 /// ```ignore,no_run
21804 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileGroupRequest;
21805 /// use google_cloud_networksecurity_v1::model::SecurityProfileGroup;
21806 /// let x = UpdateSecurityProfileGroupRequest::new().set_or_clear_security_profile_group(Some(SecurityProfileGroup::default()/* use setters */));
21807 /// let x = UpdateSecurityProfileGroupRequest::new().set_or_clear_security_profile_group(None::<SecurityProfileGroup>);
21808 /// ```
21809 pub fn set_or_clear_security_profile_group<T>(mut self, v: std::option::Option<T>) -> Self
21810 where
21811 T: std::convert::Into<crate::model::SecurityProfileGroup>,
21812 {
21813 self.security_profile_group = v.map(|x| x.into());
21814 self
21815 }
21816}
21817
21818impl wkt::message::Message for UpdateSecurityProfileGroupRequest {
21819 fn typename() -> &'static str {
21820 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest"
21821 }
21822}
21823
21824/// Request used by the DeleteSecurityProfileGroup method.
21825#[derive(Clone, Default, PartialEq)]
21826#[non_exhaustive]
21827pub struct DeleteSecurityProfileGroupRequest {
21828 /// Required. A name of the SecurityProfileGroup to delete. Must be in the
21829 /// format
21830 /// `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`.
21831 pub name: std::string::String,
21832
21833 /// Optional. If client provided etag is out of date, delete will return
21834 /// FAILED_PRECONDITION error.
21835 pub etag: std::string::String,
21836
21837 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21838}
21839
21840impl DeleteSecurityProfileGroupRequest {
21841 pub fn new() -> Self {
21842 std::default::Default::default()
21843 }
21844
21845 /// Sets the value of [name][crate::model::DeleteSecurityProfileGroupRequest::name].
21846 ///
21847 /// # Example
21848 /// ```ignore,no_run
21849 /// # use google_cloud_networksecurity_v1::model::DeleteSecurityProfileGroupRequest;
21850 /// let x = DeleteSecurityProfileGroupRequest::new().set_name("example");
21851 /// ```
21852 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21853 self.name = v.into();
21854 self
21855 }
21856
21857 /// Sets the value of [etag][crate::model::DeleteSecurityProfileGroupRequest::etag].
21858 ///
21859 /// # Example
21860 /// ```ignore,no_run
21861 /// # use google_cloud_networksecurity_v1::model::DeleteSecurityProfileGroupRequest;
21862 /// let x = DeleteSecurityProfileGroupRequest::new().set_etag("example");
21863 /// ```
21864 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21865 self.etag = v.into();
21866 self
21867 }
21868}
21869
21870impl wkt::message::Message for DeleteSecurityProfileGroupRequest {
21871 fn typename() -> &'static str {
21872 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest"
21873 }
21874}
21875
21876/// Request used with the ListSecurityProfiles method.
21877#[derive(Clone, Default, PartialEq)]
21878#[non_exhaustive]
21879pub struct ListSecurityProfilesRequest {
21880 /// Required. The project or organization and location from which the
21881 /// SecurityProfiles should be listed, specified in the format
21882 /// `projects|organizations/*/locations/{location}`.
21883 pub parent: std::string::String,
21884
21885 /// Optional. Maximum number of SecurityProfiles to return per call.
21886 pub page_size: i32,
21887
21888 /// Optional. The value returned by the last
21889 /// `ListSecurityProfilesResponse` Indicates that this is a continuation of a
21890 /// prior `ListSecurityProfiles` call, and that the system should return the
21891 /// next page of data.
21892 pub page_token: std::string::String,
21893
21894 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21895}
21896
21897impl ListSecurityProfilesRequest {
21898 pub fn new() -> Self {
21899 std::default::Default::default()
21900 }
21901
21902 /// Sets the value of [parent][crate::model::ListSecurityProfilesRequest::parent].
21903 ///
21904 /// # Example
21905 /// ```ignore,no_run
21906 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesRequest;
21907 /// let x = ListSecurityProfilesRequest::new().set_parent("example");
21908 /// ```
21909 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21910 self.parent = v.into();
21911 self
21912 }
21913
21914 /// Sets the value of [page_size][crate::model::ListSecurityProfilesRequest::page_size].
21915 ///
21916 /// # Example
21917 /// ```ignore,no_run
21918 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesRequest;
21919 /// let x = ListSecurityProfilesRequest::new().set_page_size(42);
21920 /// ```
21921 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
21922 self.page_size = v.into();
21923 self
21924 }
21925
21926 /// Sets the value of [page_token][crate::model::ListSecurityProfilesRequest::page_token].
21927 ///
21928 /// # Example
21929 /// ```ignore,no_run
21930 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesRequest;
21931 /// let x = ListSecurityProfilesRequest::new().set_page_token("example");
21932 /// ```
21933 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21934 self.page_token = v.into();
21935 self
21936 }
21937}
21938
21939impl wkt::message::Message for ListSecurityProfilesRequest {
21940 fn typename() -> &'static str {
21941 "type.googleapis.com/google.cloud.networksecurity.v1.ListSecurityProfilesRequest"
21942 }
21943}
21944
21945/// Response returned by the ListSecurityProfiles method.
21946#[derive(Clone, Default, PartialEq)]
21947#[non_exhaustive]
21948pub struct ListSecurityProfilesResponse {
21949 /// List of SecurityProfile resources.
21950 pub security_profiles: std::vec::Vec<crate::model::SecurityProfile>,
21951
21952 /// If there might be more results than those appearing in this response, then
21953 /// `next_page_token` is included. To get the next set of results, call this
21954 /// method again using the value of `next_page_token` as `page_token`.
21955 pub next_page_token: std::string::String,
21956
21957 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21958}
21959
21960impl ListSecurityProfilesResponse {
21961 pub fn new() -> Self {
21962 std::default::Default::default()
21963 }
21964
21965 /// Sets the value of [security_profiles][crate::model::ListSecurityProfilesResponse::security_profiles].
21966 ///
21967 /// # Example
21968 /// ```ignore,no_run
21969 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesResponse;
21970 /// use google_cloud_networksecurity_v1::model::SecurityProfile;
21971 /// let x = ListSecurityProfilesResponse::new()
21972 /// .set_security_profiles([
21973 /// SecurityProfile::default()/* use setters */,
21974 /// SecurityProfile::default()/* use (different) setters */,
21975 /// ]);
21976 /// ```
21977 pub fn set_security_profiles<T, V>(mut self, v: T) -> Self
21978 where
21979 T: std::iter::IntoIterator<Item = V>,
21980 V: std::convert::Into<crate::model::SecurityProfile>,
21981 {
21982 use std::iter::Iterator;
21983 self.security_profiles = v.into_iter().map(|i| i.into()).collect();
21984 self
21985 }
21986
21987 /// Sets the value of [next_page_token][crate::model::ListSecurityProfilesResponse::next_page_token].
21988 ///
21989 /// # Example
21990 /// ```ignore,no_run
21991 /// # use google_cloud_networksecurity_v1::model::ListSecurityProfilesResponse;
21992 /// let x = ListSecurityProfilesResponse::new().set_next_page_token("example");
21993 /// ```
21994 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21995 self.next_page_token = v.into();
21996 self
21997 }
21998}
21999
22000impl wkt::message::Message for ListSecurityProfilesResponse {
22001 fn typename() -> &'static str {
22002 "type.googleapis.com/google.cloud.networksecurity.v1.ListSecurityProfilesResponse"
22003 }
22004}
22005
22006#[doc(hidden)]
22007impl google_cloud_gax::paginator::internal::PageableResponse for ListSecurityProfilesResponse {
22008 type PageItem = crate::model::SecurityProfile;
22009
22010 fn items(self) -> std::vec::Vec<Self::PageItem> {
22011 self.security_profiles
22012 }
22013
22014 fn next_page_token(&self) -> std::string::String {
22015 use std::clone::Clone;
22016 self.next_page_token.clone()
22017 }
22018}
22019
22020/// Request used by the GetSecurityProfile method.
22021#[derive(Clone, Default, PartialEq)]
22022#[non_exhaustive]
22023pub struct GetSecurityProfileRequest {
22024 /// Required. A name of the SecurityProfile to get. Must be in the format
22025 /// `projects|organizations/*/locations/{location}/securityProfiles/{security_profile_id}`.
22026 pub name: std::string::String,
22027
22028 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22029}
22030
22031impl GetSecurityProfileRequest {
22032 pub fn new() -> Self {
22033 std::default::Default::default()
22034 }
22035
22036 /// Sets the value of [name][crate::model::GetSecurityProfileRequest::name].
22037 ///
22038 /// # Example
22039 /// ```ignore,no_run
22040 /// # use google_cloud_networksecurity_v1::model::GetSecurityProfileRequest;
22041 /// let x = GetSecurityProfileRequest::new().set_name("example");
22042 /// ```
22043 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22044 self.name = v.into();
22045 self
22046 }
22047}
22048
22049impl wkt::message::Message for GetSecurityProfileRequest {
22050 fn typename() -> &'static str {
22051 "type.googleapis.com/google.cloud.networksecurity.v1.GetSecurityProfileRequest"
22052 }
22053}
22054
22055/// Request used by the CreateSecurityProfile method.
22056#[derive(Clone, Default, PartialEq)]
22057#[non_exhaustive]
22058pub struct CreateSecurityProfileRequest {
22059 /// Required. The parent resource of the SecurityProfile. Must be in the format
22060 /// `projects|organizations/*/locations/{location}`.
22061 pub parent: std::string::String,
22062
22063 /// Required. Short name of the SecurityProfile resource to be created. This
22064 /// value should be 1-63 characters long, containing only letters, numbers,
22065 /// hyphens, and underscores, and should not start with a number. E.g.
22066 /// "security_profile1".
22067 pub security_profile_id: std::string::String,
22068
22069 /// Required. SecurityProfile resource to be created.
22070 pub security_profile: std::option::Option<crate::model::SecurityProfile>,
22071
22072 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22073}
22074
22075impl CreateSecurityProfileRequest {
22076 pub fn new() -> Self {
22077 std::default::Default::default()
22078 }
22079
22080 /// Sets the value of [parent][crate::model::CreateSecurityProfileRequest::parent].
22081 ///
22082 /// # Example
22083 /// ```ignore,no_run
22084 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileRequest;
22085 /// let x = CreateSecurityProfileRequest::new().set_parent("example");
22086 /// ```
22087 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22088 self.parent = v.into();
22089 self
22090 }
22091
22092 /// Sets the value of [security_profile_id][crate::model::CreateSecurityProfileRequest::security_profile_id].
22093 ///
22094 /// # Example
22095 /// ```ignore,no_run
22096 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileRequest;
22097 /// let x = CreateSecurityProfileRequest::new().set_security_profile_id("example");
22098 /// ```
22099 pub fn set_security_profile_id<T: std::convert::Into<std::string::String>>(
22100 mut self,
22101 v: T,
22102 ) -> Self {
22103 self.security_profile_id = v.into();
22104 self
22105 }
22106
22107 /// Sets the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
22108 ///
22109 /// # Example
22110 /// ```ignore,no_run
22111 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileRequest;
22112 /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22113 /// let x = CreateSecurityProfileRequest::new().set_security_profile(SecurityProfile::default()/* use setters */);
22114 /// ```
22115 pub fn set_security_profile<T>(mut self, v: T) -> Self
22116 where
22117 T: std::convert::Into<crate::model::SecurityProfile>,
22118 {
22119 self.security_profile = std::option::Option::Some(v.into());
22120 self
22121 }
22122
22123 /// Sets or clears the value of [security_profile][crate::model::CreateSecurityProfileRequest::security_profile].
22124 ///
22125 /// # Example
22126 /// ```ignore,no_run
22127 /// # use google_cloud_networksecurity_v1::model::CreateSecurityProfileRequest;
22128 /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22129 /// let x = CreateSecurityProfileRequest::new().set_or_clear_security_profile(Some(SecurityProfile::default()/* use setters */));
22130 /// let x = CreateSecurityProfileRequest::new().set_or_clear_security_profile(None::<SecurityProfile>);
22131 /// ```
22132 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
22133 where
22134 T: std::convert::Into<crate::model::SecurityProfile>,
22135 {
22136 self.security_profile = v.map(|x| x.into());
22137 self
22138 }
22139}
22140
22141impl wkt::message::Message for CreateSecurityProfileRequest {
22142 fn typename() -> &'static str {
22143 "type.googleapis.com/google.cloud.networksecurity.v1.CreateSecurityProfileRequest"
22144 }
22145}
22146
22147/// Request used by the UpdateSecurityProfile method.
22148#[derive(Clone, Default, PartialEq)]
22149#[non_exhaustive]
22150pub struct UpdateSecurityProfileRequest {
22151 /// Required. Field mask is used to specify the fields to be overwritten in the
22152 /// SecurityProfile resource by the update.
22153 /// The fields specified in the update_mask are relative to the resource, not
22154 /// the full request. A field will be overwritten if it is in the mask.
22155 pub update_mask: std::option::Option<wkt::FieldMask>,
22156
22157 /// Required. Updated SecurityProfile resource.
22158 pub security_profile: std::option::Option<crate::model::SecurityProfile>,
22159
22160 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22161}
22162
22163impl UpdateSecurityProfileRequest {
22164 pub fn new() -> Self {
22165 std::default::Default::default()
22166 }
22167
22168 /// Sets the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
22169 ///
22170 /// # Example
22171 /// ```ignore,no_run
22172 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileRequest;
22173 /// use wkt::FieldMask;
22174 /// let x = UpdateSecurityProfileRequest::new().set_update_mask(FieldMask::default()/* use setters */);
22175 /// ```
22176 pub fn set_update_mask<T>(mut self, v: T) -> Self
22177 where
22178 T: std::convert::Into<wkt::FieldMask>,
22179 {
22180 self.update_mask = std::option::Option::Some(v.into());
22181 self
22182 }
22183
22184 /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityProfileRequest::update_mask].
22185 ///
22186 /// # Example
22187 /// ```ignore,no_run
22188 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileRequest;
22189 /// use wkt::FieldMask;
22190 /// let x = UpdateSecurityProfileRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
22191 /// let x = UpdateSecurityProfileRequest::new().set_or_clear_update_mask(None::<FieldMask>);
22192 /// ```
22193 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22194 where
22195 T: std::convert::Into<wkt::FieldMask>,
22196 {
22197 self.update_mask = v.map(|x| x.into());
22198 self
22199 }
22200
22201 /// Sets the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
22202 ///
22203 /// # Example
22204 /// ```ignore,no_run
22205 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileRequest;
22206 /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22207 /// let x = UpdateSecurityProfileRequest::new().set_security_profile(SecurityProfile::default()/* use setters */);
22208 /// ```
22209 pub fn set_security_profile<T>(mut self, v: T) -> Self
22210 where
22211 T: std::convert::Into<crate::model::SecurityProfile>,
22212 {
22213 self.security_profile = std::option::Option::Some(v.into());
22214 self
22215 }
22216
22217 /// Sets or clears the value of [security_profile][crate::model::UpdateSecurityProfileRequest::security_profile].
22218 ///
22219 /// # Example
22220 /// ```ignore,no_run
22221 /// # use google_cloud_networksecurity_v1::model::UpdateSecurityProfileRequest;
22222 /// use google_cloud_networksecurity_v1::model::SecurityProfile;
22223 /// let x = UpdateSecurityProfileRequest::new().set_or_clear_security_profile(Some(SecurityProfile::default()/* use setters */));
22224 /// let x = UpdateSecurityProfileRequest::new().set_or_clear_security_profile(None::<SecurityProfile>);
22225 /// ```
22226 pub fn set_or_clear_security_profile<T>(mut self, v: std::option::Option<T>) -> Self
22227 where
22228 T: std::convert::Into<crate::model::SecurityProfile>,
22229 {
22230 self.security_profile = v.map(|x| x.into());
22231 self
22232 }
22233}
22234
22235impl wkt::message::Message for UpdateSecurityProfileRequest {
22236 fn typename() -> &'static str {
22237 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateSecurityProfileRequest"
22238 }
22239}
22240
22241/// Request used by the DeleteSecurityProfile method.
22242#[derive(Clone, Default, PartialEq)]
22243#[non_exhaustive]
22244pub struct DeleteSecurityProfileRequest {
22245 /// Required. A name of the SecurityProfile to delete. Must be in the format
22246 /// `projects|organizations/*/locations/{location}/securityProfiles/{security_profile_id}`.
22247 pub name: std::string::String,
22248
22249 /// Optional. If client provided etag is out of date, delete will return
22250 /// FAILED_PRECONDITION error.
22251 pub etag: std::string::String,
22252
22253 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22254}
22255
22256impl DeleteSecurityProfileRequest {
22257 pub fn new() -> Self {
22258 std::default::Default::default()
22259 }
22260
22261 /// Sets the value of [name][crate::model::DeleteSecurityProfileRequest::name].
22262 ///
22263 /// # Example
22264 /// ```ignore,no_run
22265 /// # use google_cloud_networksecurity_v1::model::DeleteSecurityProfileRequest;
22266 /// let x = DeleteSecurityProfileRequest::new().set_name("example");
22267 /// ```
22268 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22269 self.name = v.into();
22270 self
22271 }
22272
22273 /// Sets the value of [etag][crate::model::DeleteSecurityProfileRequest::etag].
22274 ///
22275 /// # Example
22276 /// ```ignore,no_run
22277 /// # use google_cloud_networksecurity_v1::model::DeleteSecurityProfileRequest;
22278 /// let x = DeleteSecurityProfileRequest::new().set_etag("example");
22279 /// ```
22280 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22281 self.etag = v.into();
22282 self
22283 }
22284}
22285
22286impl wkt::message::Message for DeleteSecurityProfileRequest {
22287 fn typename() -> &'static str {
22288 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteSecurityProfileRequest"
22289 }
22290}
22291
22292/// ThreatPreventionProfile defines an action for specific threat signatures or
22293/// severity levels.
22294#[derive(Clone, Default, PartialEq)]
22295#[non_exhaustive]
22296pub struct ThreatPreventionProfile {
22297 /// Optional. Configuration for overriding threats actions by severity match.
22298 pub severity_overrides: std::vec::Vec<crate::model::SeverityOverride>,
22299
22300 /// Optional. Configuration for overriding threats actions by threat_id match.
22301 /// If a threat is matched both by configuration provided in severity_overrides
22302 /// and threat_overrides, the threat_overrides action is applied.
22303 pub threat_overrides: std::vec::Vec<crate::model::ThreatOverride>,
22304
22305 /// Optional. Configuration for overriding antivirus actions per protocol.
22306 pub antivirus_overrides: std::vec::Vec<crate::model::AntivirusOverride>,
22307
22308 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22309}
22310
22311impl ThreatPreventionProfile {
22312 pub fn new() -> Self {
22313 std::default::Default::default()
22314 }
22315
22316 /// Sets the value of [severity_overrides][crate::model::ThreatPreventionProfile::severity_overrides].
22317 ///
22318 /// # Example
22319 /// ```ignore,no_run
22320 /// # use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
22321 /// use google_cloud_networksecurity_v1::model::SeverityOverride;
22322 /// let x = ThreatPreventionProfile::new()
22323 /// .set_severity_overrides([
22324 /// SeverityOverride::default()/* use setters */,
22325 /// SeverityOverride::default()/* use (different) setters */,
22326 /// ]);
22327 /// ```
22328 pub fn set_severity_overrides<T, V>(mut self, v: T) -> Self
22329 where
22330 T: std::iter::IntoIterator<Item = V>,
22331 V: std::convert::Into<crate::model::SeverityOverride>,
22332 {
22333 use std::iter::Iterator;
22334 self.severity_overrides = v.into_iter().map(|i| i.into()).collect();
22335 self
22336 }
22337
22338 /// Sets the value of [threat_overrides][crate::model::ThreatPreventionProfile::threat_overrides].
22339 ///
22340 /// # Example
22341 /// ```ignore,no_run
22342 /// # use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
22343 /// use google_cloud_networksecurity_v1::model::ThreatOverride;
22344 /// let x = ThreatPreventionProfile::new()
22345 /// .set_threat_overrides([
22346 /// ThreatOverride::default()/* use setters */,
22347 /// ThreatOverride::default()/* use (different) setters */,
22348 /// ]);
22349 /// ```
22350 pub fn set_threat_overrides<T, V>(mut self, v: T) -> Self
22351 where
22352 T: std::iter::IntoIterator<Item = V>,
22353 V: std::convert::Into<crate::model::ThreatOverride>,
22354 {
22355 use std::iter::Iterator;
22356 self.threat_overrides = v.into_iter().map(|i| i.into()).collect();
22357 self
22358 }
22359
22360 /// Sets the value of [antivirus_overrides][crate::model::ThreatPreventionProfile::antivirus_overrides].
22361 ///
22362 /// # Example
22363 /// ```ignore,no_run
22364 /// # use google_cloud_networksecurity_v1::model::ThreatPreventionProfile;
22365 /// use google_cloud_networksecurity_v1::model::AntivirusOverride;
22366 /// let x = ThreatPreventionProfile::new()
22367 /// .set_antivirus_overrides([
22368 /// AntivirusOverride::default()/* use setters */,
22369 /// AntivirusOverride::default()/* use (different) setters */,
22370 /// ]);
22371 /// ```
22372 pub fn set_antivirus_overrides<T, V>(mut self, v: T) -> Self
22373 where
22374 T: std::iter::IntoIterator<Item = V>,
22375 V: std::convert::Into<crate::model::AntivirusOverride>,
22376 {
22377 use std::iter::Iterator;
22378 self.antivirus_overrides = v.into_iter().map(|i| i.into()).collect();
22379 self
22380 }
22381}
22382
22383impl wkt::message::Message for ThreatPreventionProfile {
22384 fn typename() -> &'static str {
22385 "type.googleapis.com/google.cloud.networksecurity.v1.ThreatPreventionProfile"
22386 }
22387}
22388
22389/// Defines what action to take for a specific severity match.
22390#[derive(Clone, Default, PartialEq)]
22391#[non_exhaustive]
22392pub struct SeverityOverride {
22393 /// Required. Severity level to match.
22394 pub severity: crate::model::Severity,
22395
22396 /// Required. Threat action override.
22397 pub action: crate::model::ThreatAction,
22398
22399 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22400}
22401
22402impl SeverityOverride {
22403 pub fn new() -> Self {
22404 std::default::Default::default()
22405 }
22406
22407 /// Sets the value of [severity][crate::model::SeverityOverride::severity].
22408 ///
22409 /// # Example
22410 /// ```ignore,no_run
22411 /// # use google_cloud_networksecurity_v1::model::SeverityOverride;
22412 /// use google_cloud_networksecurity_v1::model::Severity;
22413 /// let x0 = SeverityOverride::new().set_severity(Severity::Informational);
22414 /// let x1 = SeverityOverride::new().set_severity(Severity::Low);
22415 /// let x2 = SeverityOverride::new().set_severity(Severity::Medium);
22416 /// ```
22417 pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
22418 self.severity = v.into();
22419 self
22420 }
22421
22422 /// Sets the value of [action][crate::model::SeverityOverride::action].
22423 ///
22424 /// # Example
22425 /// ```ignore,no_run
22426 /// # use google_cloud_networksecurity_v1::model::SeverityOverride;
22427 /// use google_cloud_networksecurity_v1::model::ThreatAction;
22428 /// let x0 = SeverityOverride::new().set_action(ThreatAction::DefaultAction);
22429 /// let x1 = SeverityOverride::new().set_action(ThreatAction::Allow);
22430 /// let x2 = SeverityOverride::new().set_action(ThreatAction::Alert);
22431 /// ```
22432 pub fn set_action<T: std::convert::Into<crate::model::ThreatAction>>(mut self, v: T) -> Self {
22433 self.action = v.into();
22434 self
22435 }
22436}
22437
22438impl wkt::message::Message for SeverityOverride {
22439 fn typename() -> &'static str {
22440 "type.googleapis.com/google.cloud.networksecurity.v1.SeverityOverride"
22441 }
22442}
22443
22444/// Defines what action to take for a specific threat_id match.
22445#[derive(Clone, Default, PartialEq)]
22446#[non_exhaustive]
22447pub struct ThreatOverride {
22448 /// Required. Vendor-specific ID of a threat to override.
22449 pub threat_id: std::string::String,
22450
22451 /// Output only. Type of the threat (read only).
22452 pub r#type: crate::model::ThreatType,
22453
22454 /// Required. Threat action override. For some threat types, only a subset of
22455 /// actions applies.
22456 pub action: crate::model::ThreatAction,
22457
22458 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22459}
22460
22461impl ThreatOverride {
22462 pub fn new() -> Self {
22463 std::default::Default::default()
22464 }
22465
22466 /// Sets the value of [threat_id][crate::model::ThreatOverride::threat_id].
22467 ///
22468 /// # Example
22469 /// ```ignore,no_run
22470 /// # use google_cloud_networksecurity_v1::model::ThreatOverride;
22471 /// let x = ThreatOverride::new().set_threat_id("example");
22472 /// ```
22473 pub fn set_threat_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22474 self.threat_id = v.into();
22475 self
22476 }
22477
22478 /// Sets the value of [r#type][crate::model::ThreatOverride::type].
22479 ///
22480 /// # Example
22481 /// ```ignore,no_run
22482 /// # use google_cloud_networksecurity_v1::model::ThreatOverride;
22483 /// use google_cloud_networksecurity_v1::model::ThreatType;
22484 /// let x0 = ThreatOverride::new().set_type(ThreatType::Unknown);
22485 /// let x1 = ThreatOverride::new().set_type(ThreatType::Vulnerability);
22486 /// let x2 = ThreatOverride::new().set_type(ThreatType::Antivirus);
22487 /// ```
22488 pub fn set_type<T: std::convert::Into<crate::model::ThreatType>>(mut self, v: T) -> Self {
22489 self.r#type = v.into();
22490 self
22491 }
22492
22493 /// Sets the value of [action][crate::model::ThreatOverride::action].
22494 ///
22495 /// # Example
22496 /// ```ignore,no_run
22497 /// # use google_cloud_networksecurity_v1::model::ThreatOverride;
22498 /// use google_cloud_networksecurity_v1::model::ThreatAction;
22499 /// let x0 = ThreatOverride::new().set_action(ThreatAction::DefaultAction);
22500 /// let x1 = ThreatOverride::new().set_action(ThreatAction::Allow);
22501 /// let x2 = ThreatOverride::new().set_action(ThreatAction::Alert);
22502 /// ```
22503 pub fn set_action<T: std::convert::Into<crate::model::ThreatAction>>(mut self, v: T) -> Self {
22504 self.action = v.into();
22505 self
22506 }
22507}
22508
22509impl wkt::message::Message for ThreatOverride {
22510 fn typename() -> &'static str {
22511 "type.googleapis.com/google.cloud.networksecurity.v1.ThreatOverride"
22512 }
22513}
22514
22515/// Defines what action to take for antivirus threats per protocol.
22516#[derive(Clone, Default, PartialEq)]
22517#[non_exhaustive]
22518pub struct AntivirusOverride {
22519 /// Required. Protocol to match.
22520 pub protocol: crate::model::Protocol,
22521
22522 /// Required. Threat action override. For some threat types, only a subset of
22523 /// actions applies.
22524 pub action: crate::model::ThreatAction,
22525
22526 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22527}
22528
22529impl AntivirusOverride {
22530 pub fn new() -> Self {
22531 std::default::Default::default()
22532 }
22533
22534 /// Sets the value of [protocol][crate::model::AntivirusOverride::protocol].
22535 ///
22536 /// # Example
22537 /// ```ignore,no_run
22538 /// # use google_cloud_networksecurity_v1::model::AntivirusOverride;
22539 /// use google_cloud_networksecurity_v1::model::Protocol;
22540 /// let x0 = AntivirusOverride::new().set_protocol(Protocol::Smtp);
22541 /// let x1 = AntivirusOverride::new().set_protocol(Protocol::Smb);
22542 /// let x2 = AntivirusOverride::new().set_protocol(Protocol::Pop3);
22543 /// ```
22544 pub fn set_protocol<T: std::convert::Into<crate::model::Protocol>>(mut self, v: T) -> Self {
22545 self.protocol = v.into();
22546 self
22547 }
22548
22549 /// Sets the value of [action][crate::model::AntivirusOverride::action].
22550 ///
22551 /// # Example
22552 /// ```ignore,no_run
22553 /// # use google_cloud_networksecurity_v1::model::AntivirusOverride;
22554 /// use google_cloud_networksecurity_v1::model::ThreatAction;
22555 /// let x0 = AntivirusOverride::new().set_action(ThreatAction::DefaultAction);
22556 /// let x1 = AntivirusOverride::new().set_action(ThreatAction::Allow);
22557 /// let x2 = AntivirusOverride::new().set_action(ThreatAction::Alert);
22558 /// ```
22559 pub fn set_action<T: std::convert::Into<crate::model::ThreatAction>>(mut self, v: T) -> Self {
22560 self.action = v.into();
22561 self
22562 }
22563}
22564
22565impl wkt::message::Message for AntivirusOverride {
22566 fn typename() -> &'static str {
22567 "type.googleapis.com/google.cloud.networksecurity.v1.AntivirusOverride"
22568 }
22569}
22570
22571/// UrlFilteringProfile defines filters based on URL.
22572#[derive(Clone, Default, PartialEq)]
22573#[non_exhaustive]
22574pub struct UrlFilteringProfile {
22575 /// Optional. The list of filtering configs in which each config defines an
22576 /// action to take for some URL match.
22577 pub url_filters: std::vec::Vec<crate::model::UrlFilter>,
22578
22579 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22580}
22581
22582impl UrlFilteringProfile {
22583 pub fn new() -> Self {
22584 std::default::Default::default()
22585 }
22586
22587 /// Sets the value of [url_filters][crate::model::UrlFilteringProfile::url_filters].
22588 ///
22589 /// # Example
22590 /// ```ignore,no_run
22591 /// # use google_cloud_networksecurity_v1::model::UrlFilteringProfile;
22592 /// use google_cloud_networksecurity_v1::model::UrlFilter;
22593 /// let x = UrlFilteringProfile::new()
22594 /// .set_url_filters([
22595 /// UrlFilter::default()/* use setters */,
22596 /// UrlFilter::default()/* use (different) setters */,
22597 /// ]);
22598 /// ```
22599 pub fn set_url_filters<T, V>(mut self, v: T) -> Self
22600 where
22601 T: std::iter::IntoIterator<Item = V>,
22602 V: std::convert::Into<crate::model::UrlFilter>,
22603 {
22604 use std::iter::Iterator;
22605 self.url_filters = v.into_iter().map(|i| i.into()).collect();
22606 self
22607 }
22608}
22609
22610impl wkt::message::Message for UrlFilteringProfile {
22611 fn typename() -> &'static str {
22612 "type.googleapis.com/google.cloud.networksecurity.v1.UrlFilteringProfile"
22613 }
22614}
22615
22616/// A URL filter defines an action to take for some URL match.
22617#[derive(Clone, Default, PartialEq)]
22618#[non_exhaustive]
22619pub struct UrlFilter {
22620 /// Required. The action taken when this filter is applied.
22621 pub filtering_action: crate::model::url_filter::UrlFilteringAction,
22622
22623 /// Required. The list of strings that a URL must match with for this filter to
22624 /// be applied.
22625 pub urls: std::vec::Vec<std::string::String>,
22626
22627 /// Required. The priority of this filter within the URL Filtering Profile.
22628 /// Lower integers indicate higher priorities. The priority of a filter must be
22629 /// unique within a URL Filtering Profile.
22630 pub priority: std::option::Option<i32>,
22631
22632 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22633}
22634
22635impl UrlFilter {
22636 pub fn new() -> Self {
22637 std::default::Default::default()
22638 }
22639
22640 /// Sets the value of [filtering_action][crate::model::UrlFilter::filtering_action].
22641 ///
22642 /// # Example
22643 /// ```ignore,no_run
22644 /// # use google_cloud_networksecurity_v1::model::UrlFilter;
22645 /// use google_cloud_networksecurity_v1::model::url_filter::UrlFilteringAction;
22646 /// let x0 = UrlFilter::new().set_filtering_action(UrlFilteringAction::Allow);
22647 /// let x1 = UrlFilter::new().set_filtering_action(UrlFilteringAction::Deny);
22648 /// ```
22649 pub fn set_filtering_action<
22650 T: std::convert::Into<crate::model::url_filter::UrlFilteringAction>,
22651 >(
22652 mut self,
22653 v: T,
22654 ) -> Self {
22655 self.filtering_action = v.into();
22656 self
22657 }
22658
22659 /// Sets the value of [urls][crate::model::UrlFilter::urls].
22660 ///
22661 /// # Example
22662 /// ```ignore,no_run
22663 /// # use google_cloud_networksecurity_v1::model::UrlFilter;
22664 /// let x = UrlFilter::new().set_urls(["a", "b", "c"]);
22665 /// ```
22666 pub fn set_urls<T, V>(mut self, v: T) -> Self
22667 where
22668 T: std::iter::IntoIterator<Item = V>,
22669 V: std::convert::Into<std::string::String>,
22670 {
22671 use std::iter::Iterator;
22672 self.urls = v.into_iter().map(|i| i.into()).collect();
22673 self
22674 }
22675
22676 /// Sets the value of [priority][crate::model::UrlFilter::priority].
22677 ///
22678 /// # Example
22679 /// ```ignore,no_run
22680 /// # use google_cloud_networksecurity_v1::model::UrlFilter;
22681 /// let x = UrlFilter::new().set_priority(42);
22682 /// ```
22683 pub fn set_priority<T>(mut self, v: T) -> Self
22684 where
22685 T: std::convert::Into<i32>,
22686 {
22687 self.priority = std::option::Option::Some(v.into());
22688 self
22689 }
22690
22691 /// Sets or clears the value of [priority][crate::model::UrlFilter::priority].
22692 ///
22693 /// # Example
22694 /// ```ignore,no_run
22695 /// # use google_cloud_networksecurity_v1::model::UrlFilter;
22696 /// let x = UrlFilter::new().set_or_clear_priority(Some(42));
22697 /// let x = UrlFilter::new().set_or_clear_priority(None::<i32>);
22698 /// ```
22699 pub fn set_or_clear_priority<T>(mut self, v: std::option::Option<T>) -> Self
22700 where
22701 T: std::convert::Into<i32>,
22702 {
22703 self.priority = v.map(|x| x.into());
22704 self
22705 }
22706}
22707
22708impl wkt::message::Message for UrlFilter {
22709 fn typename() -> &'static str {
22710 "type.googleapis.com/google.cloud.networksecurity.v1.UrlFilter"
22711 }
22712}
22713
22714/// Defines additional types related to [UrlFilter].
22715pub mod url_filter {
22716 #[allow(unused_imports)]
22717 use super::*;
22718
22719 /// Action to be taken when a URL matches a filter.
22720 ///
22721 /// # Working with unknown values
22722 ///
22723 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22724 /// additional enum variants at any time. Adding new variants is not considered
22725 /// a breaking change. Applications should write their code in anticipation of:
22726 ///
22727 /// - New values appearing in future releases of the client library, **and**
22728 /// - New values received dynamically, without application changes.
22729 ///
22730 /// Please consult the [Working with enums] section in the user guide for some
22731 /// guidelines.
22732 ///
22733 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22734 #[derive(Clone, Debug, PartialEq)]
22735 #[non_exhaustive]
22736 pub enum UrlFilteringAction {
22737 /// Filtering action not specified.
22738 Unspecified,
22739 /// The connection matching this filter will be allowed to transmit.
22740 Allow,
22741 /// The connection matching this filter will be dropped.
22742 Deny,
22743 /// If set, the enum was initialized with an unknown value.
22744 ///
22745 /// Applications can examine the value using [UrlFilteringAction::value] or
22746 /// [UrlFilteringAction::name].
22747 UnknownValue(url_filtering_action::UnknownValue),
22748 }
22749
22750 #[doc(hidden)]
22751 pub mod url_filtering_action {
22752 #[allow(unused_imports)]
22753 use super::*;
22754 #[derive(Clone, Debug, PartialEq)]
22755 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22756 }
22757
22758 impl UrlFilteringAction {
22759 /// Gets the enum value.
22760 ///
22761 /// Returns `None` if the enum contains an unknown value deserialized from
22762 /// the string representation of enums.
22763 pub fn value(&self) -> std::option::Option<i32> {
22764 match self {
22765 Self::Unspecified => std::option::Option::Some(0),
22766 Self::Allow => std::option::Option::Some(1),
22767 Self::Deny => std::option::Option::Some(2),
22768 Self::UnknownValue(u) => u.0.value(),
22769 }
22770 }
22771
22772 /// Gets the enum value as a string.
22773 ///
22774 /// Returns `None` if the enum contains an unknown value deserialized from
22775 /// the integer representation of enums.
22776 pub fn name(&self) -> std::option::Option<&str> {
22777 match self {
22778 Self::Unspecified => std::option::Option::Some("URL_FILTERING_ACTION_UNSPECIFIED"),
22779 Self::Allow => std::option::Option::Some("ALLOW"),
22780 Self::Deny => std::option::Option::Some("DENY"),
22781 Self::UnknownValue(u) => u.0.name(),
22782 }
22783 }
22784 }
22785
22786 impl std::default::Default for UrlFilteringAction {
22787 fn default() -> Self {
22788 use std::convert::From;
22789 Self::from(0)
22790 }
22791 }
22792
22793 impl std::fmt::Display for UrlFilteringAction {
22794 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22795 wkt::internal::display_enum(f, self.name(), self.value())
22796 }
22797 }
22798
22799 impl std::convert::From<i32> for UrlFilteringAction {
22800 fn from(value: i32) -> Self {
22801 match value {
22802 0 => Self::Unspecified,
22803 1 => Self::Allow,
22804 2 => Self::Deny,
22805 _ => Self::UnknownValue(url_filtering_action::UnknownValue(
22806 wkt::internal::UnknownEnumValue::Integer(value),
22807 )),
22808 }
22809 }
22810 }
22811
22812 impl std::convert::From<&str> for UrlFilteringAction {
22813 fn from(value: &str) -> Self {
22814 use std::string::ToString;
22815 match value {
22816 "URL_FILTERING_ACTION_UNSPECIFIED" => Self::Unspecified,
22817 "ALLOW" => Self::Allow,
22818 "DENY" => Self::Deny,
22819 _ => Self::UnknownValue(url_filtering_action::UnknownValue(
22820 wkt::internal::UnknownEnumValue::String(value.to_string()),
22821 )),
22822 }
22823 }
22824 }
22825
22826 impl serde::ser::Serialize for UrlFilteringAction {
22827 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22828 where
22829 S: serde::Serializer,
22830 {
22831 match self {
22832 Self::Unspecified => serializer.serialize_i32(0),
22833 Self::Allow => serializer.serialize_i32(1),
22834 Self::Deny => serializer.serialize_i32(2),
22835 Self::UnknownValue(u) => u.0.serialize(serializer),
22836 }
22837 }
22838 }
22839
22840 impl<'de> serde::de::Deserialize<'de> for UrlFilteringAction {
22841 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22842 where
22843 D: serde::Deserializer<'de>,
22844 {
22845 deserializer.deserialize_any(wkt::internal::EnumVisitor::<UrlFilteringAction>::new(
22846 ".google.cloud.networksecurity.v1.UrlFilter.UrlFilteringAction",
22847 ))
22848 }
22849 }
22850}
22851
22852/// ServerTlsPolicy is a resource that specifies how a server should authenticate
22853/// incoming requests. This resource itself does not affect configuration unless
22854/// it is attached to a target HTTPS proxy or endpoint config selector resource.
22855///
22856/// ServerTlsPolicy in the form accepted by Application Load Balancers can
22857/// be attached only to TargetHttpsProxy with an `EXTERNAL`, `EXTERNAL_MANAGED`
22858/// or `INTERNAL_MANAGED` load balancing scheme. Traffic Director compatible
22859/// ServerTlsPolicies can be attached to EndpointPolicy and TargetHttpsProxy with
22860/// Traffic Director `INTERNAL_SELF_MANAGED` load balancing scheme.
22861#[derive(Clone, Default, PartialEq)]
22862#[non_exhaustive]
22863pub struct ServerTlsPolicy {
22864 /// Required. Name of the ServerTlsPolicy resource. It matches the pattern
22865 /// `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`
22866 pub name: std::string::String,
22867
22868 /// Free-text description of the resource.
22869 pub description: std::string::String,
22870
22871 /// Output only. The timestamp when the resource was created.
22872 pub create_time: std::option::Option<wkt::Timestamp>,
22873
22874 /// Output only. The timestamp when the resource was updated.
22875 pub update_time: std::option::Option<wkt::Timestamp>,
22876
22877 /// Set of label tags associated with the resource.
22878 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
22879
22880 /// This field applies only for Traffic Director policies. It is must be set to
22881 /// false for Application Load Balancer policies.
22882 ///
22883 /// Determines if server allows plaintext connections. If set to true, server
22884 /// allows plain text connections. By default, it is set to false. This setting
22885 /// is not exclusive of other encryption modes. For example, if `allow_open`
22886 /// and `mtls_policy` are set, server allows both plain text and mTLS
22887 /// connections. See documentation of other encryption modes to confirm
22888 /// compatibility.
22889 ///
22890 /// Consider using it if you wish to upgrade in place your deployment to TLS
22891 /// while having mixed TLS and non-TLS traffic reaching port :80.
22892 pub allow_open: bool,
22893
22894 /// Optional if policy is to be used with Traffic Director. For Application
22895 /// Load Balancers must be empty.
22896 ///
22897 /// Defines a mechanism to provision server identity (public and private keys).
22898 /// Cannot be combined with `allow_open` as a permissive mode that allows both
22899 /// plain text and TLS is not supported.
22900 pub server_certificate: std::option::Option<crate::model::CertificateProvider>,
22901
22902 /// This field is required if the policy is used with Application Load
22903 /// Balancers. This field can be empty for Traffic Director.
22904 ///
22905 /// Defines a mechanism to provision peer validation certificates for peer to
22906 /// peer authentication (Mutual TLS - mTLS). If not specified, client
22907 /// certificate will not be requested. The connection is treated as TLS and not
22908 /// mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
22909 /// text and mTLS connections.
22910 pub mtls_policy: std::option::Option<crate::model::server_tls_policy::MTLSPolicy>,
22911
22912 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22913}
22914
22915impl ServerTlsPolicy {
22916 pub fn new() -> Self {
22917 std::default::Default::default()
22918 }
22919
22920 /// Sets the value of [name][crate::model::ServerTlsPolicy::name].
22921 ///
22922 /// # Example
22923 /// ```ignore,no_run
22924 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
22925 /// let x = ServerTlsPolicy::new().set_name("example");
22926 /// ```
22927 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22928 self.name = v.into();
22929 self
22930 }
22931
22932 /// Sets the value of [description][crate::model::ServerTlsPolicy::description].
22933 ///
22934 /// # Example
22935 /// ```ignore,no_run
22936 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
22937 /// let x = ServerTlsPolicy::new().set_description("example");
22938 /// ```
22939 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22940 self.description = v.into();
22941 self
22942 }
22943
22944 /// Sets the value of [create_time][crate::model::ServerTlsPolicy::create_time].
22945 ///
22946 /// # Example
22947 /// ```ignore,no_run
22948 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
22949 /// use wkt::Timestamp;
22950 /// let x = ServerTlsPolicy::new().set_create_time(Timestamp::default()/* use setters */);
22951 /// ```
22952 pub fn set_create_time<T>(mut self, v: T) -> Self
22953 where
22954 T: std::convert::Into<wkt::Timestamp>,
22955 {
22956 self.create_time = std::option::Option::Some(v.into());
22957 self
22958 }
22959
22960 /// Sets or clears the value of [create_time][crate::model::ServerTlsPolicy::create_time].
22961 ///
22962 /// # Example
22963 /// ```ignore,no_run
22964 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
22965 /// use wkt::Timestamp;
22966 /// let x = ServerTlsPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
22967 /// let x = ServerTlsPolicy::new().set_or_clear_create_time(None::<Timestamp>);
22968 /// ```
22969 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
22970 where
22971 T: std::convert::Into<wkt::Timestamp>,
22972 {
22973 self.create_time = v.map(|x| x.into());
22974 self
22975 }
22976
22977 /// Sets the value of [update_time][crate::model::ServerTlsPolicy::update_time].
22978 ///
22979 /// # Example
22980 /// ```ignore,no_run
22981 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
22982 /// use wkt::Timestamp;
22983 /// let x = ServerTlsPolicy::new().set_update_time(Timestamp::default()/* use setters */);
22984 /// ```
22985 pub fn set_update_time<T>(mut self, v: T) -> Self
22986 where
22987 T: std::convert::Into<wkt::Timestamp>,
22988 {
22989 self.update_time = std::option::Option::Some(v.into());
22990 self
22991 }
22992
22993 /// Sets or clears the value of [update_time][crate::model::ServerTlsPolicy::update_time].
22994 ///
22995 /// # Example
22996 /// ```ignore,no_run
22997 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
22998 /// use wkt::Timestamp;
22999 /// let x = ServerTlsPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
23000 /// let x = ServerTlsPolicy::new().set_or_clear_update_time(None::<Timestamp>);
23001 /// ```
23002 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
23003 where
23004 T: std::convert::Into<wkt::Timestamp>,
23005 {
23006 self.update_time = v.map(|x| x.into());
23007 self
23008 }
23009
23010 /// Sets the value of [labels][crate::model::ServerTlsPolicy::labels].
23011 ///
23012 /// # Example
23013 /// ```ignore,no_run
23014 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23015 /// let x = ServerTlsPolicy::new().set_labels([
23016 /// ("key0", "abc"),
23017 /// ("key1", "xyz"),
23018 /// ]);
23019 /// ```
23020 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
23021 where
23022 T: std::iter::IntoIterator<Item = (K, V)>,
23023 K: std::convert::Into<std::string::String>,
23024 V: std::convert::Into<std::string::String>,
23025 {
23026 use std::iter::Iterator;
23027 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
23028 self
23029 }
23030
23031 /// Sets the value of [allow_open][crate::model::ServerTlsPolicy::allow_open].
23032 ///
23033 /// # Example
23034 /// ```ignore,no_run
23035 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23036 /// let x = ServerTlsPolicy::new().set_allow_open(true);
23037 /// ```
23038 pub fn set_allow_open<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23039 self.allow_open = v.into();
23040 self
23041 }
23042
23043 /// Sets the value of [server_certificate][crate::model::ServerTlsPolicy::server_certificate].
23044 ///
23045 /// # Example
23046 /// ```ignore,no_run
23047 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23048 /// use google_cloud_networksecurity_v1::model::CertificateProvider;
23049 /// let x = ServerTlsPolicy::new().set_server_certificate(CertificateProvider::default()/* use setters */);
23050 /// ```
23051 pub fn set_server_certificate<T>(mut self, v: T) -> Self
23052 where
23053 T: std::convert::Into<crate::model::CertificateProvider>,
23054 {
23055 self.server_certificate = std::option::Option::Some(v.into());
23056 self
23057 }
23058
23059 /// Sets or clears the value of [server_certificate][crate::model::ServerTlsPolicy::server_certificate].
23060 ///
23061 /// # Example
23062 /// ```ignore,no_run
23063 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23064 /// use google_cloud_networksecurity_v1::model::CertificateProvider;
23065 /// let x = ServerTlsPolicy::new().set_or_clear_server_certificate(Some(CertificateProvider::default()/* use setters */));
23066 /// let x = ServerTlsPolicy::new().set_or_clear_server_certificate(None::<CertificateProvider>);
23067 /// ```
23068 pub fn set_or_clear_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
23069 where
23070 T: std::convert::Into<crate::model::CertificateProvider>,
23071 {
23072 self.server_certificate = v.map(|x| x.into());
23073 self
23074 }
23075
23076 /// Sets the value of [mtls_policy][crate::model::ServerTlsPolicy::mtls_policy].
23077 ///
23078 /// # Example
23079 /// ```ignore,no_run
23080 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23081 /// use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23082 /// let x = ServerTlsPolicy::new().set_mtls_policy(MTLSPolicy::default()/* use setters */);
23083 /// ```
23084 pub fn set_mtls_policy<T>(mut self, v: T) -> Self
23085 where
23086 T: std::convert::Into<crate::model::server_tls_policy::MTLSPolicy>,
23087 {
23088 self.mtls_policy = std::option::Option::Some(v.into());
23089 self
23090 }
23091
23092 /// Sets or clears the value of [mtls_policy][crate::model::ServerTlsPolicy::mtls_policy].
23093 ///
23094 /// # Example
23095 /// ```ignore,no_run
23096 /// # use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23097 /// use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23098 /// let x = ServerTlsPolicy::new().set_or_clear_mtls_policy(Some(MTLSPolicy::default()/* use setters */));
23099 /// let x = ServerTlsPolicy::new().set_or_clear_mtls_policy(None::<MTLSPolicy>);
23100 /// ```
23101 pub fn set_or_clear_mtls_policy<T>(mut self, v: std::option::Option<T>) -> Self
23102 where
23103 T: std::convert::Into<crate::model::server_tls_policy::MTLSPolicy>,
23104 {
23105 self.mtls_policy = v.map(|x| x.into());
23106 self
23107 }
23108}
23109
23110impl wkt::message::Message for ServerTlsPolicy {
23111 fn typename() -> &'static str {
23112 "type.googleapis.com/google.cloud.networksecurity.v1.ServerTlsPolicy"
23113 }
23114}
23115
23116/// Defines additional types related to [ServerTlsPolicy].
23117pub mod server_tls_policy {
23118 #[allow(unused_imports)]
23119 use super::*;
23120
23121 /// Specification of the MTLSPolicy.
23122 #[derive(Clone, Default, PartialEq)]
23123 #[non_exhaustive]
23124 pub struct MTLSPolicy {
23125 /// When the client presents an invalid certificate or no certificate to the
23126 /// load balancer, the `client_validation_mode` specifies how the client
23127 /// connection is handled.
23128 ///
23129 /// Required if the policy is to be used with the Application Load
23130 /// Balancers. For Traffic Director it must be empty.
23131 pub client_validation_mode:
23132 crate::model::server_tls_policy::mtls_policy::ClientValidationMode,
23133
23134 /// Required if the policy is to be used with Traffic Director. For
23135 /// Application Load Balancers it must be empty.
23136 ///
23137 /// Defines the mechanism to obtain the Certificate Authority certificate to
23138 /// validate the client certificate.
23139 pub client_validation_ca: std::vec::Vec<crate::model::ValidationCA>,
23140
23141 /// Reference to the TrustConfig from certificatemanager.googleapis.com
23142 /// namespace.
23143 ///
23144 /// If specified, the chain validation will be performed against certificates
23145 /// configured in the given TrustConfig.
23146 ///
23147 /// Allowed only if the policy is to be used with Application Load
23148 /// Balancers.
23149 pub client_validation_trust_config: std::string::String,
23150
23151 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23152 }
23153
23154 impl MTLSPolicy {
23155 pub fn new() -> Self {
23156 std::default::Default::default()
23157 }
23158
23159 /// Sets the value of [client_validation_mode][crate::model::server_tls_policy::MTLSPolicy::client_validation_mode].
23160 ///
23161 /// # Example
23162 /// ```ignore,no_run
23163 /// # use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23164 /// use google_cloud_networksecurity_v1::model::server_tls_policy::mtls_policy::ClientValidationMode;
23165 /// let x0 = MTLSPolicy::new().set_client_validation_mode(ClientValidationMode::AllowInvalidOrMissingClientCert);
23166 /// let x1 = MTLSPolicy::new().set_client_validation_mode(ClientValidationMode::RejectInvalid);
23167 /// ```
23168 pub fn set_client_validation_mode<
23169 T: std::convert::Into<crate::model::server_tls_policy::mtls_policy::ClientValidationMode>,
23170 >(
23171 mut self,
23172 v: T,
23173 ) -> Self {
23174 self.client_validation_mode = v.into();
23175 self
23176 }
23177
23178 /// Sets the value of [client_validation_ca][crate::model::server_tls_policy::MTLSPolicy::client_validation_ca].
23179 ///
23180 /// # Example
23181 /// ```ignore,no_run
23182 /// # use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23183 /// use google_cloud_networksecurity_v1::model::ValidationCA;
23184 /// let x = MTLSPolicy::new()
23185 /// .set_client_validation_ca([
23186 /// ValidationCA::default()/* use setters */,
23187 /// ValidationCA::default()/* use (different) setters */,
23188 /// ]);
23189 /// ```
23190 pub fn set_client_validation_ca<T, V>(mut self, v: T) -> Self
23191 where
23192 T: std::iter::IntoIterator<Item = V>,
23193 V: std::convert::Into<crate::model::ValidationCA>,
23194 {
23195 use std::iter::Iterator;
23196 self.client_validation_ca = v.into_iter().map(|i| i.into()).collect();
23197 self
23198 }
23199
23200 /// Sets the value of [client_validation_trust_config][crate::model::server_tls_policy::MTLSPolicy::client_validation_trust_config].
23201 ///
23202 /// # Example
23203 /// ```ignore,no_run
23204 /// # use google_cloud_networksecurity_v1::model::server_tls_policy::MTLSPolicy;
23205 /// let x = MTLSPolicy::new().set_client_validation_trust_config("example");
23206 /// ```
23207 pub fn set_client_validation_trust_config<T: std::convert::Into<std::string::String>>(
23208 mut self,
23209 v: T,
23210 ) -> Self {
23211 self.client_validation_trust_config = v.into();
23212 self
23213 }
23214 }
23215
23216 impl wkt::message::Message for MTLSPolicy {
23217 fn typename() -> &'static str {
23218 "type.googleapis.com/google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy"
23219 }
23220 }
23221
23222 /// Defines additional types related to [MTLSPolicy].
23223 pub mod mtls_policy {
23224 #[allow(unused_imports)]
23225 use super::*;
23226
23227 /// Mutual TLS certificate validation mode.
23228 ///
23229 /// # Working with unknown values
23230 ///
23231 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23232 /// additional enum variants at any time. Adding new variants is not considered
23233 /// a breaking change. Applications should write their code in anticipation of:
23234 ///
23235 /// - New values appearing in future releases of the client library, **and**
23236 /// - New values received dynamically, without application changes.
23237 ///
23238 /// Please consult the [Working with enums] section in the user guide for some
23239 /// guidelines.
23240 ///
23241 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23242 #[derive(Clone, Debug, PartialEq)]
23243 #[non_exhaustive]
23244 pub enum ClientValidationMode {
23245 /// Not allowed.
23246 Unspecified,
23247 /// Allow connection even if certificate chain validation
23248 /// of the client certificate failed or no client certificate was
23249 /// presented. The proof of possession of the private key is always checked
23250 /// if client certificate was presented. This mode requires the backend to
23251 /// implement processing of data extracted from a client certificate to
23252 /// authenticate the peer, or to reject connections if the client
23253 /// certificate fingerprint is missing.
23254 AllowInvalidOrMissingClientCert,
23255 /// Require a client certificate and allow connection to the backend only
23256 /// if validation of the client certificate passed.
23257 ///
23258 /// If set, requires a reference to non-empty TrustConfig specified in
23259 /// `client_validation_trust_config`.
23260 RejectInvalid,
23261 /// If set, the enum was initialized with an unknown value.
23262 ///
23263 /// Applications can examine the value using [ClientValidationMode::value] or
23264 /// [ClientValidationMode::name].
23265 UnknownValue(client_validation_mode::UnknownValue),
23266 }
23267
23268 #[doc(hidden)]
23269 pub mod client_validation_mode {
23270 #[allow(unused_imports)]
23271 use super::*;
23272 #[derive(Clone, Debug, PartialEq)]
23273 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23274 }
23275
23276 impl ClientValidationMode {
23277 /// Gets the enum value.
23278 ///
23279 /// Returns `None` if the enum contains an unknown value deserialized from
23280 /// the string representation of enums.
23281 pub fn value(&self) -> std::option::Option<i32> {
23282 match self {
23283 Self::Unspecified => std::option::Option::Some(0),
23284 Self::AllowInvalidOrMissingClientCert => std::option::Option::Some(1),
23285 Self::RejectInvalid => std::option::Option::Some(2),
23286 Self::UnknownValue(u) => u.0.value(),
23287 }
23288 }
23289
23290 /// Gets the enum value as a string.
23291 ///
23292 /// Returns `None` if the enum contains an unknown value deserialized from
23293 /// the integer representation of enums.
23294 pub fn name(&self) -> std::option::Option<&str> {
23295 match self {
23296 Self::Unspecified => {
23297 std::option::Option::Some("CLIENT_VALIDATION_MODE_UNSPECIFIED")
23298 }
23299 Self::AllowInvalidOrMissingClientCert => {
23300 std::option::Option::Some("ALLOW_INVALID_OR_MISSING_CLIENT_CERT")
23301 }
23302 Self::RejectInvalid => std::option::Option::Some("REJECT_INVALID"),
23303 Self::UnknownValue(u) => u.0.name(),
23304 }
23305 }
23306 }
23307
23308 impl std::default::Default for ClientValidationMode {
23309 fn default() -> Self {
23310 use std::convert::From;
23311 Self::from(0)
23312 }
23313 }
23314
23315 impl std::fmt::Display for ClientValidationMode {
23316 fn fmt(
23317 &self,
23318 f: &mut std::fmt::Formatter<'_>,
23319 ) -> std::result::Result<(), std::fmt::Error> {
23320 wkt::internal::display_enum(f, self.name(), self.value())
23321 }
23322 }
23323
23324 impl std::convert::From<i32> for ClientValidationMode {
23325 fn from(value: i32) -> Self {
23326 match value {
23327 0 => Self::Unspecified,
23328 1 => Self::AllowInvalidOrMissingClientCert,
23329 2 => Self::RejectInvalid,
23330 _ => Self::UnknownValue(client_validation_mode::UnknownValue(
23331 wkt::internal::UnknownEnumValue::Integer(value),
23332 )),
23333 }
23334 }
23335 }
23336
23337 impl std::convert::From<&str> for ClientValidationMode {
23338 fn from(value: &str) -> Self {
23339 use std::string::ToString;
23340 match value {
23341 "CLIENT_VALIDATION_MODE_UNSPECIFIED" => Self::Unspecified,
23342 "ALLOW_INVALID_OR_MISSING_CLIENT_CERT" => Self::AllowInvalidOrMissingClientCert,
23343 "REJECT_INVALID" => Self::RejectInvalid,
23344 _ => Self::UnknownValue(client_validation_mode::UnknownValue(
23345 wkt::internal::UnknownEnumValue::String(value.to_string()),
23346 )),
23347 }
23348 }
23349 }
23350
23351 impl serde::ser::Serialize for ClientValidationMode {
23352 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23353 where
23354 S: serde::Serializer,
23355 {
23356 match self {
23357 Self::Unspecified => serializer.serialize_i32(0),
23358 Self::AllowInvalidOrMissingClientCert => serializer.serialize_i32(1),
23359 Self::RejectInvalid => serializer.serialize_i32(2),
23360 Self::UnknownValue(u) => u.0.serialize(serializer),
23361 }
23362 }
23363 }
23364
23365 impl<'de> serde::de::Deserialize<'de> for ClientValidationMode {
23366 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23367 where
23368 D: serde::Deserializer<'de>,
23369 {
23370 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ClientValidationMode>::new(
23371 ".google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.ClientValidationMode"))
23372 }
23373 }
23374 }
23375}
23376
23377/// Request used by the ListServerTlsPolicies method.
23378#[derive(Clone, Default, PartialEq)]
23379#[non_exhaustive]
23380pub struct ListServerTlsPoliciesRequest {
23381 /// Required. The project and location from which the ServerTlsPolicies should
23382 /// be listed, specified in the format `projects/*/locations/{location}`.
23383 pub parent: std::string::String,
23384
23385 /// Maximum number of ServerTlsPolicies to return per call.
23386 pub page_size: i32,
23387
23388 /// The value returned by the last `ListServerTlsPoliciesResponse`
23389 /// Indicates that this is a continuation of a prior
23390 /// `ListServerTlsPolicies` call, and that the system
23391 /// should return the next page of data.
23392 pub page_token: std::string::String,
23393
23394 /// Optional. Setting this field to `true` will opt the request into returning
23395 /// the resources that are reachable, and into including the names of those
23396 /// that were unreachable in the [ListServerTlsPoliciesResponse.unreachable]
23397 /// field. This can only be `true` when reading across collections e.g. when
23398 /// `parent` is set to `"projects/example/locations/-"`.
23399 pub return_partial_success: bool,
23400
23401 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23402}
23403
23404impl ListServerTlsPoliciesRequest {
23405 pub fn new() -> Self {
23406 std::default::Default::default()
23407 }
23408
23409 /// Sets the value of [parent][crate::model::ListServerTlsPoliciesRequest::parent].
23410 ///
23411 /// # Example
23412 /// ```ignore,no_run
23413 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesRequest;
23414 /// let x = ListServerTlsPoliciesRequest::new().set_parent("example");
23415 /// ```
23416 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23417 self.parent = v.into();
23418 self
23419 }
23420
23421 /// Sets the value of [page_size][crate::model::ListServerTlsPoliciesRequest::page_size].
23422 ///
23423 /// # Example
23424 /// ```ignore,no_run
23425 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesRequest;
23426 /// let x = ListServerTlsPoliciesRequest::new().set_page_size(42);
23427 /// ```
23428 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
23429 self.page_size = v.into();
23430 self
23431 }
23432
23433 /// Sets the value of [page_token][crate::model::ListServerTlsPoliciesRequest::page_token].
23434 ///
23435 /// # Example
23436 /// ```ignore,no_run
23437 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesRequest;
23438 /// let x = ListServerTlsPoliciesRequest::new().set_page_token("example");
23439 /// ```
23440 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23441 self.page_token = v.into();
23442 self
23443 }
23444
23445 /// Sets the value of [return_partial_success][crate::model::ListServerTlsPoliciesRequest::return_partial_success].
23446 ///
23447 /// # Example
23448 /// ```ignore,no_run
23449 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesRequest;
23450 /// let x = ListServerTlsPoliciesRequest::new().set_return_partial_success(true);
23451 /// ```
23452 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23453 self.return_partial_success = v.into();
23454 self
23455 }
23456}
23457
23458impl wkt::message::Message for ListServerTlsPoliciesRequest {
23459 fn typename() -> &'static str {
23460 "type.googleapis.com/google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest"
23461 }
23462}
23463
23464/// Response returned by the ListServerTlsPolicies method.
23465#[derive(Clone, Default, PartialEq)]
23466#[non_exhaustive]
23467pub struct ListServerTlsPoliciesResponse {
23468 /// List of ServerTlsPolicy resources.
23469 pub server_tls_policies: std::vec::Vec<crate::model::ServerTlsPolicy>,
23470
23471 /// If there might be more results than those appearing in this response, then
23472 /// `next_page_token` is included. To get the next set of results, call this
23473 /// method again using the value of `next_page_token` as `page_token`.
23474 pub next_page_token: std::string::String,
23475
23476 /// Unreachable resources. Populated when the request opts into
23477 /// `return_partial_success` and reading across collections e.g. when
23478 /// attempting to list all resources across all supported locations.
23479 pub unreachable: std::vec::Vec<std::string::String>,
23480
23481 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23482}
23483
23484impl ListServerTlsPoliciesResponse {
23485 pub fn new() -> Self {
23486 std::default::Default::default()
23487 }
23488
23489 /// Sets the value of [server_tls_policies][crate::model::ListServerTlsPoliciesResponse::server_tls_policies].
23490 ///
23491 /// # Example
23492 /// ```ignore,no_run
23493 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesResponse;
23494 /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23495 /// let x = ListServerTlsPoliciesResponse::new()
23496 /// .set_server_tls_policies([
23497 /// ServerTlsPolicy::default()/* use setters */,
23498 /// ServerTlsPolicy::default()/* use (different) setters */,
23499 /// ]);
23500 /// ```
23501 pub fn set_server_tls_policies<T, V>(mut self, v: T) -> Self
23502 where
23503 T: std::iter::IntoIterator<Item = V>,
23504 V: std::convert::Into<crate::model::ServerTlsPolicy>,
23505 {
23506 use std::iter::Iterator;
23507 self.server_tls_policies = v.into_iter().map(|i| i.into()).collect();
23508 self
23509 }
23510
23511 /// Sets the value of [next_page_token][crate::model::ListServerTlsPoliciesResponse::next_page_token].
23512 ///
23513 /// # Example
23514 /// ```ignore,no_run
23515 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesResponse;
23516 /// let x = ListServerTlsPoliciesResponse::new().set_next_page_token("example");
23517 /// ```
23518 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23519 self.next_page_token = v.into();
23520 self
23521 }
23522
23523 /// Sets the value of [unreachable][crate::model::ListServerTlsPoliciesResponse::unreachable].
23524 ///
23525 /// # Example
23526 /// ```ignore,no_run
23527 /// # use google_cloud_networksecurity_v1::model::ListServerTlsPoliciesResponse;
23528 /// let x = ListServerTlsPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
23529 /// ```
23530 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
23531 where
23532 T: std::iter::IntoIterator<Item = V>,
23533 V: std::convert::Into<std::string::String>,
23534 {
23535 use std::iter::Iterator;
23536 self.unreachable = v.into_iter().map(|i| i.into()).collect();
23537 self
23538 }
23539}
23540
23541impl wkt::message::Message for ListServerTlsPoliciesResponse {
23542 fn typename() -> &'static str {
23543 "type.googleapis.com/google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse"
23544 }
23545}
23546
23547#[doc(hidden)]
23548impl google_cloud_gax::paginator::internal::PageableResponse for ListServerTlsPoliciesResponse {
23549 type PageItem = crate::model::ServerTlsPolicy;
23550
23551 fn items(self) -> std::vec::Vec<Self::PageItem> {
23552 self.server_tls_policies
23553 }
23554
23555 fn next_page_token(&self) -> std::string::String {
23556 use std::clone::Clone;
23557 self.next_page_token.clone()
23558 }
23559}
23560
23561/// Request used by the GetServerTlsPolicy method.
23562#[derive(Clone, Default, PartialEq)]
23563#[non_exhaustive]
23564pub struct GetServerTlsPolicyRequest {
23565 /// Required. A name of the ServerTlsPolicy to get. Must be in the format
23566 /// `projects/*/locations/{location}/serverTlsPolicies/*`.
23567 pub name: std::string::String,
23568
23569 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23570}
23571
23572impl GetServerTlsPolicyRequest {
23573 pub fn new() -> Self {
23574 std::default::Default::default()
23575 }
23576
23577 /// Sets the value of [name][crate::model::GetServerTlsPolicyRequest::name].
23578 ///
23579 /// # Example
23580 /// ```ignore,no_run
23581 /// # use google_cloud_networksecurity_v1::model::GetServerTlsPolicyRequest;
23582 /// let x = GetServerTlsPolicyRequest::new().set_name("example");
23583 /// ```
23584 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23585 self.name = v.into();
23586 self
23587 }
23588}
23589
23590impl wkt::message::Message for GetServerTlsPolicyRequest {
23591 fn typename() -> &'static str {
23592 "type.googleapis.com/google.cloud.networksecurity.v1.GetServerTlsPolicyRequest"
23593 }
23594}
23595
23596/// Request used by the CreateServerTlsPolicy method.
23597#[derive(Clone, Default, PartialEq)]
23598#[non_exhaustive]
23599pub struct CreateServerTlsPolicyRequest {
23600 /// Required. The parent resource of the ServerTlsPolicy. Must be in
23601 /// the format `projects/*/locations/{location}`.
23602 pub parent: std::string::String,
23603
23604 /// Required. Short name of the ServerTlsPolicy resource to be created. This
23605 /// value should be 1-63 characters long, containing only letters, numbers,
23606 /// hyphens, and underscores, and should not start with a number. E.g.
23607 /// "server_mtls_policy".
23608 pub server_tls_policy_id: std::string::String,
23609
23610 /// Required. ServerTlsPolicy resource to be created.
23611 pub server_tls_policy: std::option::Option<crate::model::ServerTlsPolicy>,
23612
23613 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23614}
23615
23616impl CreateServerTlsPolicyRequest {
23617 pub fn new() -> Self {
23618 std::default::Default::default()
23619 }
23620
23621 /// Sets the value of [parent][crate::model::CreateServerTlsPolicyRequest::parent].
23622 ///
23623 /// # Example
23624 /// ```ignore,no_run
23625 /// # use google_cloud_networksecurity_v1::model::CreateServerTlsPolicyRequest;
23626 /// let x = CreateServerTlsPolicyRequest::new().set_parent("example");
23627 /// ```
23628 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23629 self.parent = v.into();
23630 self
23631 }
23632
23633 /// Sets the value of [server_tls_policy_id][crate::model::CreateServerTlsPolicyRequest::server_tls_policy_id].
23634 ///
23635 /// # Example
23636 /// ```ignore,no_run
23637 /// # use google_cloud_networksecurity_v1::model::CreateServerTlsPolicyRequest;
23638 /// let x = CreateServerTlsPolicyRequest::new().set_server_tls_policy_id("example");
23639 /// ```
23640 pub fn set_server_tls_policy_id<T: std::convert::Into<std::string::String>>(
23641 mut self,
23642 v: T,
23643 ) -> Self {
23644 self.server_tls_policy_id = v.into();
23645 self
23646 }
23647
23648 /// Sets the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
23649 ///
23650 /// # Example
23651 /// ```ignore,no_run
23652 /// # use google_cloud_networksecurity_v1::model::CreateServerTlsPolicyRequest;
23653 /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23654 /// let x = CreateServerTlsPolicyRequest::new().set_server_tls_policy(ServerTlsPolicy::default()/* use setters */);
23655 /// ```
23656 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
23657 where
23658 T: std::convert::Into<crate::model::ServerTlsPolicy>,
23659 {
23660 self.server_tls_policy = std::option::Option::Some(v.into());
23661 self
23662 }
23663
23664 /// Sets or clears the value of [server_tls_policy][crate::model::CreateServerTlsPolicyRequest::server_tls_policy].
23665 ///
23666 /// # Example
23667 /// ```ignore,no_run
23668 /// # use google_cloud_networksecurity_v1::model::CreateServerTlsPolicyRequest;
23669 /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23670 /// let x = CreateServerTlsPolicyRequest::new().set_or_clear_server_tls_policy(Some(ServerTlsPolicy::default()/* use setters */));
23671 /// let x = CreateServerTlsPolicyRequest::new().set_or_clear_server_tls_policy(None::<ServerTlsPolicy>);
23672 /// ```
23673 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
23674 where
23675 T: std::convert::Into<crate::model::ServerTlsPolicy>,
23676 {
23677 self.server_tls_policy = v.map(|x| x.into());
23678 self
23679 }
23680}
23681
23682impl wkt::message::Message for CreateServerTlsPolicyRequest {
23683 fn typename() -> &'static str {
23684 "type.googleapis.com/google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest"
23685 }
23686}
23687
23688/// Request used by UpdateServerTlsPolicy method.
23689#[derive(Clone, Default, PartialEq)]
23690#[non_exhaustive]
23691pub struct UpdateServerTlsPolicyRequest {
23692 /// Optional. Field mask is used to specify the fields to be overwritten in the
23693 /// ServerTlsPolicy resource by the update. The fields
23694 /// specified in the update_mask are relative to the resource, not
23695 /// the full request. A field will be overwritten if it is in the
23696 /// mask. If the user does not provide a mask then all fields will be
23697 /// overwritten.
23698 pub update_mask: std::option::Option<wkt::FieldMask>,
23699
23700 /// Required. Updated ServerTlsPolicy resource.
23701 pub server_tls_policy: std::option::Option<crate::model::ServerTlsPolicy>,
23702
23703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23704}
23705
23706impl UpdateServerTlsPolicyRequest {
23707 pub fn new() -> Self {
23708 std::default::Default::default()
23709 }
23710
23711 /// Sets the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
23712 ///
23713 /// # Example
23714 /// ```ignore,no_run
23715 /// # use google_cloud_networksecurity_v1::model::UpdateServerTlsPolicyRequest;
23716 /// use wkt::FieldMask;
23717 /// let x = UpdateServerTlsPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
23718 /// ```
23719 pub fn set_update_mask<T>(mut self, v: T) -> Self
23720 where
23721 T: std::convert::Into<wkt::FieldMask>,
23722 {
23723 self.update_mask = std::option::Option::Some(v.into());
23724 self
23725 }
23726
23727 /// Sets or clears the value of [update_mask][crate::model::UpdateServerTlsPolicyRequest::update_mask].
23728 ///
23729 /// # Example
23730 /// ```ignore,no_run
23731 /// # use google_cloud_networksecurity_v1::model::UpdateServerTlsPolicyRequest;
23732 /// use wkt::FieldMask;
23733 /// let x = UpdateServerTlsPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
23734 /// let x = UpdateServerTlsPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
23735 /// ```
23736 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
23737 where
23738 T: std::convert::Into<wkt::FieldMask>,
23739 {
23740 self.update_mask = v.map(|x| x.into());
23741 self
23742 }
23743
23744 /// Sets the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
23745 ///
23746 /// # Example
23747 /// ```ignore,no_run
23748 /// # use google_cloud_networksecurity_v1::model::UpdateServerTlsPolicyRequest;
23749 /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23750 /// let x = UpdateServerTlsPolicyRequest::new().set_server_tls_policy(ServerTlsPolicy::default()/* use setters */);
23751 /// ```
23752 pub fn set_server_tls_policy<T>(mut self, v: T) -> Self
23753 where
23754 T: std::convert::Into<crate::model::ServerTlsPolicy>,
23755 {
23756 self.server_tls_policy = std::option::Option::Some(v.into());
23757 self
23758 }
23759
23760 /// Sets or clears the value of [server_tls_policy][crate::model::UpdateServerTlsPolicyRequest::server_tls_policy].
23761 ///
23762 /// # Example
23763 /// ```ignore,no_run
23764 /// # use google_cloud_networksecurity_v1::model::UpdateServerTlsPolicyRequest;
23765 /// use google_cloud_networksecurity_v1::model::ServerTlsPolicy;
23766 /// let x = UpdateServerTlsPolicyRequest::new().set_or_clear_server_tls_policy(Some(ServerTlsPolicy::default()/* use setters */));
23767 /// let x = UpdateServerTlsPolicyRequest::new().set_or_clear_server_tls_policy(None::<ServerTlsPolicy>);
23768 /// ```
23769 pub fn set_or_clear_server_tls_policy<T>(mut self, v: std::option::Option<T>) -> Self
23770 where
23771 T: std::convert::Into<crate::model::ServerTlsPolicy>,
23772 {
23773 self.server_tls_policy = v.map(|x| x.into());
23774 self
23775 }
23776}
23777
23778impl wkt::message::Message for UpdateServerTlsPolicyRequest {
23779 fn typename() -> &'static str {
23780 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest"
23781 }
23782}
23783
23784/// Request used by the DeleteServerTlsPolicy method.
23785#[derive(Clone, Default, PartialEq)]
23786#[non_exhaustive]
23787pub struct DeleteServerTlsPolicyRequest {
23788 /// Required. A name of the ServerTlsPolicy to delete. Must be in
23789 /// the format `projects/*/locations/{location}/serverTlsPolicies/*`.
23790 pub name: std::string::String,
23791
23792 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23793}
23794
23795impl DeleteServerTlsPolicyRequest {
23796 pub fn new() -> Self {
23797 std::default::Default::default()
23798 }
23799
23800 /// Sets the value of [name][crate::model::DeleteServerTlsPolicyRequest::name].
23801 ///
23802 /// # Example
23803 /// ```ignore,no_run
23804 /// # use google_cloud_networksecurity_v1::model::DeleteServerTlsPolicyRequest;
23805 /// let x = DeleteServerTlsPolicyRequest::new().set_name("example");
23806 /// ```
23807 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23808 self.name = v.into();
23809 self
23810 }
23811}
23812
23813impl wkt::message::Message for DeleteServerTlsPolicyRequest {
23814 fn typename() -> &'static str {
23815 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest"
23816 }
23817}
23818
23819/// Specification of the GRPC Endpoint.
23820#[derive(Clone, Default, PartialEq)]
23821#[non_exhaustive]
23822pub struct GrpcEndpoint {
23823 /// Required. The target URI of the gRPC endpoint. Only UDS path is supported,
23824 /// and should start with "unix:".
23825 pub target_uri: std::string::String,
23826
23827 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23828}
23829
23830impl GrpcEndpoint {
23831 pub fn new() -> Self {
23832 std::default::Default::default()
23833 }
23834
23835 /// Sets the value of [target_uri][crate::model::GrpcEndpoint::target_uri].
23836 ///
23837 /// # Example
23838 /// ```ignore,no_run
23839 /// # use google_cloud_networksecurity_v1::model::GrpcEndpoint;
23840 /// let x = GrpcEndpoint::new().set_target_uri("example");
23841 /// ```
23842 pub fn set_target_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23843 self.target_uri = v.into();
23844 self
23845 }
23846}
23847
23848impl wkt::message::Message for GrpcEndpoint {
23849 fn typename() -> &'static str {
23850 "type.googleapis.com/google.cloud.networksecurity.v1.GrpcEndpoint"
23851 }
23852}
23853
23854/// Specification of ValidationCA. Defines the mechanism to obtain the
23855/// Certificate Authority certificate to validate the peer certificate.
23856#[derive(Clone, Default, PartialEq)]
23857#[non_exhaustive]
23858pub struct ValidationCA {
23859 /// The type of certificate provider which provides the CA certificate.
23860 pub r#type: std::option::Option<crate::model::validation_ca::Type>,
23861
23862 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23863}
23864
23865impl ValidationCA {
23866 pub fn new() -> Self {
23867 std::default::Default::default()
23868 }
23869
23870 /// Sets the value of [r#type][crate::model::ValidationCA::type].
23871 ///
23872 /// Note that all the setters affecting `r#type` are mutually
23873 /// exclusive.
23874 ///
23875 /// # Example
23876 /// ```ignore,no_run
23877 /// # use google_cloud_networksecurity_v1::model::ValidationCA;
23878 /// use google_cloud_networksecurity_v1::model::GrpcEndpoint;
23879 /// let x = ValidationCA::new().set_type(Some(
23880 /// google_cloud_networksecurity_v1::model::validation_ca::Type::GrpcEndpoint(GrpcEndpoint::default().into())));
23881 /// ```
23882 pub fn set_type<
23883 T: std::convert::Into<std::option::Option<crate::model::validation_ca::Type>>,
23884 >(
23885 mut self,
23886 v: T,
23887 ) -> Self {
23888 self.r#type = v.into();
23889 self
23890 }
23891
23892 /// The value of [r#type][crate::model::ValidationCA::r#type]
23893 /// if it holds a `GrpcEndpoint`, `None` if the field is not set or
23894 /// holds a different branch.
23895 pub fn grpc_endpoint(
23896 &self,
23897 ) -> std::option::Option<&std::boxed::Box<crate::model::GrpcEndpoint>> {
23898 #[allow(unreachable_patterns)]
23899 self.r#type.as_ref().and_then(|v| match v {
23900 crate::model::validation_ca::Type::GrpcEndpoint(v) => std::option::Option::Some(v),
23901 _ => std::option::Option::None,
23902 })
23903 }
23904
23905 /// Sets the value of [r#type][crate::model::ValidationCA::r#type]
23906 /// to hold a `GrpcEndpoint`.
23907 ///
23908 /// Note that all the setters affecting `r#type` are
23909 /// mutually exclusive.
23910 ///
23911 /// # Example
23912 /// ```ignore,no_run
23913 /// # use google_cloud_networksecurity_v1::model::ValidationCA;
23914 /// use google_cloud_networksecurity_v1::model::GrpcEndpoint;
23915 /// let x = ValidationCA::new().set_grpc_endpoint(GrpcEndpoint::default()/* use setters */);
23916 /// assert!(x.grpc_endpoint().is_some());
23917 /// assert!(x.certificate_provider_instance().is_none());
23918 /// ```
23919 pub fn set_grpc_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::GrpcEndpoint>>>(
23920 mut self,
23921 v: T,
23922 ) -> Self {
23923 self.r#type =
23924 std::option::Option::Some(crate::model::validation_ca::Type::GrpcEndpoint(v.into()));
23925 self
23926 }
23927
23928 /// The value of [r#type][crate::model::ValidationCA::r#type]
23929 /// if it holds a `CertificateProviderInstance`, `None` if the field is not set or
23930 /// holds a different branch.
23931 pub fn certificate_provider_instance(
23932 &self,
23933 ) -> std::option::Option<&std::boxed::Box<crate::model::CertificateProviderInstance>> {
23934 #[allow(unreachable_patterns)]
23935 self.r#type.as_ref().and_then(|v| match v {
23936 crate::model::validation_ca::Type::CertificateProviderInstance(v) => {
23937 std::option::Option::Some(v)
23938 }
23939 _ => std::option::Option::None,
23940 })
23941 }
23942
23943 /// Sets the value of [r#type][crate::model::ValidationCA::r#type]
23944 /// to hold a `CertificateProviderInstance`.
23945 ///
23946 /// Note that all the setters affecting `r#type` are
23947 /// mutually exclusive.
23948 ///
23949 /// # Example
23950 /// ```ignore,no_run
23951 /// # use google_cloud_networksecurity_v1::model::ValidationCA;
23952 /// use google_cloud_networksecurity_v1::model::CertificateProviderInstance;
23953 /// let x = ValidationCA::new().set_certificate_provider_instance(CertificateProviderInstance::default()/* use setters */);
23954 /// assert!(x.certificate_provider_instance().is_some());
23955 /// assert!(x.grpc_endpoint().is_none());
23956 /// ```
23957 pub fn set_certificate_provider_instance<
23958 T: std::convert::Into<std::boxed::Box<crate::model::CertificateProviderInstance>>,
23959 >(
23960 mut self,
23961 v: T,
23962 ) -> Self {
23963 self.r#type = std::option::Option::Some(
23964 crate::model::validation_ca::Type::CertificateProviderInstance(v.into()),
23965 );
23966 self
23967 }
23968}
23969
23970impl wkt::message::Message for ValidationCA {
23971 fn typename() -> &'static str {
23972 "type.googleapis.com/google.cloud.networksecurity.v1.ValidationCA"
23973 }
23974}
23975
23976/// Defines additional types related to [ValidationCA].
23977pub mod validation_ca {
23978 #[allow(unused_imports)]
23979 use super::*;
23980
23981 /// The type of certificate provider which provides the CA certificate.
23982 #[derive(Clone, Debug, PartialEq)]
23983 #[non_exhaustive]
23984 pub enum Type {
23985 /// gRPC specific configuration to access the gRPC server to
23986 /// obtain the CA certificate.
23987 GrpcEndpoint(std::boxed::Box<crate::model::GrpcEndpoint>),
23988 /// The certificate provider instance specification that will be passed to
23989 /// the data plane, which will be used to load necessary credential
23990 /// information.
23991 CertificateProviderInstance(std::boxed::Box<crate::model::CertificateProviderInstance>),
23992 }
23993}
23994
23995/// Specification of a TLS certificate provider instance. Workloads may have one
23996/// or more CertificateProvider instances (plugins) and one of them is enabled
23997/// and configured by specifying this message. Workloads use the values from this
23998/// message to locate and load the CertificateProvider instance configuration.
23999#[derive(Clone, Default, PartialEq)]
24000#[non_exhaustive]
24001pub struct CertificateProviderInstance {
24002 /// Required. Plugin instance name, used to locate and load CertificateProvider
24003 /// instance configuration. Set to "google_cloud_private_spiffe" to use
24004 /// Certificate Authority Service certificate provider instance.
24005 pub plugin_instance: std::string::String,
24006
24007 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24008}
24009
24010impl CertificateProviderInstance {
24011 pub fn new() -> Self {
24012 std::default::Default::default()
24013 }
24014
24015 /// Sets the value of [plugin_instance][crate::model::CertificateProviderInstance::plugin_instance].
24016 ///
24017 /// # Example
24018 /// ```ignore,no_run
24019 /// # use google_cloud_networksecurity_v1::model::CertificateProviderInstance;
24020 /// let x = CertificateProviderInstance::new().set_plugin_instance("example");
24021 /// ```
24022 pub fn set_plugin_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24023 self.plugin_instance = v.into();
24024 self
24025 }
24026}
24027
24028impl wkt::message::Message for CertificateProviderInstance {
24029 fn typename() -> &'static str {
24030 "type.googleapis.com/google.cloud.networksecurity.v1.CertificateProviderInstance"
24031 }
24032}
24033
24034/// Specification of certificate provider. Defines the mechanism to obtain the
24035/// certificate and private key for peer to peer authentication.
24036#[derive(Clone, Default, PartialEq)]
24037#[non_exhaustive]
24038pub struct CertificateProvider {
24039 /// The type of certificate provider which provides the certificates and
24040 /// private keys.
24041 pub r#type: std::option::Option<crate::model::certificate_provider::Type>,
24042
24043 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24044}
24045
24046impl CertificateProvider {
24047 pub fn new() -> Self {
24048 std::default::Default::default()
24049 }
24050
24051 /// Sets the value of [r#type][crate::model::CertificateProvider::type].
24052 ///
24053 /// Note that all the setters affecting `r#type` are mutually
24054 /// exclusive.
24055 ///
24056 /// # Example
24057 /// ```ignore,no_run
24058 /// # use google_cloud_networksecurity_v1::model::CertificateProvider;
24059 /// use google_cloud_networksecurity_v1::model::GrpcEndpoint;
24060 /// let x = CertificateProvider::new().set_type(Some(
24061 /// google_cloud_networksecurity_v1::model::certificate_provider::Type::GrpcEndpoint(GrpcEndpoint::default().into())));
24062 /// ```
24063 pub fn set_type<
24064 T: std::convert::Into<std::option::Option<crate::model::certificate_provider::Type>>,
24065 >(
24066 mut self,
24067 v: T,
24068 ) -> Self {
24069 self.r#type = v.into();
24070 self
24071 }
24072
24073 /// The value of [r#type][crate::model::CertificateProvider::r#type]
24074 /// if it holds a `GrpcEndpoint`, `None` if the field is not set or
24075 /// holds a different branch.
24076 pub fn grpc_endpoint(
24077 &self,
24078 ) -> std::option::Option<&std::boxed::Box<crate::model::GrpcEndpoint>> {
24079 #[allow(unreachable_patterns)]
24080 self.r#type.as_ref().and_then(|v| match v {
24081 crate::model::certificate_provider::Type::GrpcEndpoint(v) => {
24082 std::option::Option::Some(v)
24083 }
24084 _ => std::option::Option::None,
24085 })
24086 }
24087
24088 /// Sets the value of [r#type][crate::model::CertificateProvider::r#type]
24089 /// to hold a `GrpcEndpoint`.
24090 ///
24091 /// Note that all the setters affecting `r#type` are
24092 /// mutually exclusive.
24093 ///
24094 /// # Example
24095 /// ```ignore,no_run
24096 /// # use google_cloud_networksecurity_v1::model::CertificateProvider;
24097 /// use google_cloud_networksecurity_v1::model::GrpcEndpoint;
24098 /// let x = CertificateProvider::new().set_grpc_endpoint(GrpcEndpoint::default()/* use setters */);
24099 /// assert!(x.grpc_endpoint().is_some());
24100 /// assert!(x.certificate_provider_instance().is_none());
24101 /// ```
24102 pub fn set_grpc_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::GrpcEndpoint>>>(
24103 mut self,
24104 v: T,
24105 ) -> Self {
24106 self.r#type = std::option::Option::Some(
24107 crate::model::certificate_provider::Type::GrpcEndpoint(v.into()),
24108 );
24109 self
24110 }
24111
24112 /// The value of [r#type][crate::model::CertificateProvider::r#type]
24113 /// if it holds a `CertificateProviderInstance`, `None` if the field is not set or
24114 /// holds a different branch.
24115 pub fn certificate_provider_instance(
24116 &self,
24117 ) -> std::option::Option<&std::boxed::Box<crate::model::CertificateProviderInstance>> {
24118 #[allow(unreachable_patterns)]
24119 self.r#type.as_ref().and_then(|v| match v {
24120 crate::model::certificate_provider::Type::CertificateProviderInstance(v) => {
24121 std::option::Option::Some(v)
24122 }
24123 _ => std::option::Option::None,
24124 })
24125 }
24126
24127 /// Sets the value of [r#type][crate::model::CertificateProvider::r#type]
24128 /// to hold a `CertificateProviderInstance`.
24129 ///
24130 /// Note that all the setters affecting `r#type` are
24131 /// mutually exclusive.
24132 ///
24133 /// # Example
24134 /// ```ignore,no_run
24135 /// # use google_cloud_networksecurity_v1::model::CertificateProvider;
24136 /// use google_cloud_networksecurity_v1::model::CertificateProviderInstance;
24137 /// let x = CertificateProvider::new().set_certificate_provider_instance(CertificateProviderInstance::default()/* use setters */);
24138 /// assert!(x.certificate_provider_instance().is_some());
24139 /// assert!(x.grpc_endpoint().is_none());
24140 /// ```
24141 pub fn set_certificate_provider_instance<
24142 T: std::convert::Into<std::boxed::Box<crate::model::CertificateProviderInstance>>,
24143 >(
24144 mut self,
24145 v: T,
24146 ) -> Self {
24147 self.r#type = std::option::Option::Some(
24148 crate::model::certificate_provider::Type::CertificateProviderInstance(v.into()),
24149 );
24150 self
24151 }
24152}
24153
24154impl wkt::message::Message for CertificateProvider {
24155 fn typename() -> &'static str {
24156 "type.googleapis.com/google.cloud.networksecurity.v1.CertificateProvider"
24157 }
24158}
24159
24160/// Defines additional types related to [CertificateProvider].
24161pub mod certificate_provider {
24162 #[allow(unused_imports)]
24163 use super::*;
24164
24165 /// The type of certificate provider which provides the certificates and
24166 /// private keys.
24167 #[derive(Clone, Debug, PartialEq)]
24168 #[non_exhaustive]
24169 pub enum Type {
24170 /// gRPC specific configuration to access the gRPC server to
24171 /// obtain the cert and private key.
24172 GrpcEndpoint(std::boxed::Box<crate::model::GrpcEndpoint>),
24173 /// The certificate provider instance specification that will be passed to
24174 /// the data plane, which will be used to load necessary credential
24175 /// information.
24176 CertificateProviderInstance(std::boxed::Box<crate::model::CertificateProviderInstance>),
24177 }
24178}
24179
24180/// The TlsInspectionPolicy resource contains references to CA pools in
24181/// Certificate Authority Service and associated metadata.
24182#[derive(Clone, Default, PartialEq)]
24183#[non_exhaustive]
24184pub struct TlsInspectionPolicy {
24185 /// Required. Name of the resource. Name is of the form
24186 /// projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}
24187 /// tls_inspection_policy should match the
24188 /// pattern:(^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
24189 pub name: std::string::String,
24190
24191 /// Optional. Free-text description of the resource.
24192 pub description: std::string::String,
24193
24194 /// Output only. The timestamp when the resource was created.
24195 pub create_time: std::option::Option<wkt::Timestamp>,
24196
24197 /// Output only. The timestamp when the resource was updated.
24198 pub update_time: std::option::Option<wkt::Timestamp>,
24199
24200 /// Required. A CA pool resource used to issue interception certificates.
24201 /// The CA pool string has a relative resource path following the form
24202 /// "projects/{project}/locations/{location}/caPools/{ca_pool}".
24203 pub ca_pool: std::string::String,
24204
24205 /// Optional. A TrustConfig resource used when making a connection to the TLS
24206 /// server. This is a relative resource path following the form
24207 /// "projects/{project}/locations/{location}/trustConfigs/{trust_config}". This
24208 /// is necessary to intercept TLS connections to servers with certificates
24209 /// signed by a private CA or self-signed certificates.
24210 /// Note that Secure Web Proxy does not yet honor this field.
24211 pub trust_config: std::string::String,
24212
24213 /// Optional. If FALSE (the default), use our default set of public CAs in
24214 /// addition to any CAs specified in trust_config. These public CAs are
24215 /// currently based on the Mozilla Root Program and are subject to change over
24216 /// time. If TRUE, do not accept our default set of public CAs. Only CAs
24217 /// specified in trust_config will be accepted. This defaults to FALSE (use
24218 /// public CAs in addition to trust_config) for backwards compatibility, but
24219 /// trusting public root CAs is *not recommended* unless the traffic in
24220 /// question is outbound to public web servers. When possible, prefer setting
24221 /// this to "false" and explicitly specifying trusted CAs and certificates in a
24222 /// TrustConfig. Note that Secure Web Proxy does not yet honor this field.
24223 pub exclude_public_ca_set: std::option::Option<bool>,
24224
24225 /// Optional. Minimum TLS version that the firewall should use when negotiating
24226 /// connections with both clients and servers. If this is not set, then the
24227 /// default value is to allow the broadest set of clients and servers (TLS 1.0
24228 /// or higher). Setting this to more restrictive values may improve security,
24229 /// but may also prevent the firewall from connecting to some clients or
24230 /// servers.
24231 /// Note that Secure Web Proxy does not yet honor this field.
24232 pub min_tls_version: crate::model::tls_inspection_policy::TlsVersion,
24233
24234 /// Optional. The selected Profile. If this is not set, then the default value
24235 /// is to allow the broadest set of clients and servers ("PROFILE_COMPATIBLE").
24236 /// Setting this to more restrictive values may improve security, but may also
24237 /// prevent the TLS inspection proxy from connecting to some clients or
24238 /// servers. Note that Secure Web Proxy does not yet honor this field.
24239 pub tls_feature_profile: crate::model::tls_inspection_policy::Profile,
24240
24241 /// Optional. List of custom TLS cipher suites selected.
24242 /// This field is valid only if the selected tls_feature_profile is CUSTOM.
24243 /// The [compute.SslPoliciesService.ListAvailableFeatures][] method returns the
24244 /// set of features that can be specified in this list.
24245 /// Note that Secure Web Proxy does not yet honor this field.
24246 pub custom_tls_features: std::vec::Vec<std::string::String>,
24247
24248 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24249}
24250
24251impl TlsInspectionPolicy {
24252 pub fn new() -> Self {
24253 std::default::Default::default()
24254 }
24255
24256 /// Sets the value of [name][crate::model::TlsInspectionPolicy::name].
24257 ///
24258 /// # Example
24259 /// ```ignore,no_run
24260 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24261 /// let x = TlsInspectionPolicy::new().set_name("example");
24262 /// ```
24263 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24264 self.name = v.into();
24265 self
24266 }
24267
24268 /// Sets the value of [description][crate::model::TlsInspectionPolicy::description].
24269 ///
24270 /// # Example
24271 /// ```ignore,no_run
24272 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24273 /// let x = TlsInspectionPolicy::new().set_description("example");
24274 /// ```
24275 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24276 self.description = v.into();
24277 self
24278 }
24279
24280 /// Sets the value of [create_time][crate::model::TlsInspectionPolicy::create_time].
24281 ///
24282 /// # Example
24283 /// ```ignore,no_run
24284 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24285 /// use wkt::Timestamp;
24286 /// let x = TlsInspectionPolicy::new().set_create_time(Timestamp::default()/* use setters */);
24287 /// ```
24288 pub fn set_create_time<T>(mut self, v: T) -> Self
24289 where
24290 T: std::convert::Into<wkt::Timestamp>,
24291 {
24292 self.create_time = std::option::Option::Some(v.into());
24293 self
24294 }
24295
24296 /// Sets or clears the value of [create_time][crate::model::TlsInspectionPolicy::create_time].
24297 ///
24298 /// # Example
24299 /// ```ignore,no_run
24300 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24301 /// use wkt::Timestamp;
24302 /// let x = TlsInspectionPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
24303 /// let x = TlsInspectionPolicy::new().set_or_clear_create_time(None::<Timestamp>);
24304 /// ```
24305 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
24306 where
24307 T: std::convert::Into<wkt::Timestamp>,
24308 {
24309 self.create_time = v.map(|x| x.into());
24310 self
24311 }
24312
24313 /// Sets the value of [update_time][crate::model::TlsInspectionPolicy::update_time].
24314 ///
24315 /// # Example
24316 /// ```ignore,no_run
24317 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24318 /// use wkt::Timestamp;
24319 /// let x = TlsInspectionPolicy::new().set_update_time(Timestamp::default()/* use setters */);
24320 /// ```
24321 pub fn set_update_time<T>(mut self, v: T) -> Self
24322 where
24323 T: std::convert::Into<wkt::Timestamp>,
24324 {
24325 self.update_time = std::option::Option::Some(v.into());
24326 self
24327 }
24328
24329 /// Sets or clears the value of [update_time][crate::model::TlsInspectionPolicy::update_time].
24330 ///
24331 /// # Example
24332 /// ```ignore,no_run
24333 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24334 /// use wkt::Timestamp;
24335 /// let x = TlsInspectionPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
24336 /// let x = TlsInspectionPolicy::new().set_or_clear_update_time(None::<Timestamp>);
24337 /// ```
24338 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
24339 where
24340 T: std::convert::Into<wkt::Timestamp>,
24341 {
24342 self.update_time = v.map(|x| x.into());
24343 self
24344 }
24345
24346 /// Sets the value of [ca_pool][crate::model::TlsInspectionPolicy::ca_pool].
24347 ///
24348 /// # Example
24349 /// ```ignore,no_run
24350 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24351 /// let x = TlsInspectionPolicy::new().set_ca_pool("example");
24352 /// ```
24353 pub fn set_ca_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24354 self.ca_pool = v.into();
24355 self
24356 }
24357
24358 /// Sets the value of [trust_config][crate::model::TlsInspectionPolicy::trust_config].
24359 ///
24360 /// # Example
24361 /// ```ignore,no_run
24362 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24363 /// let x = TlsInspectionPolicy::new().set_trust_config("example");
24364 /// ```
24365 pub fn set_trust_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24366 self.trust_config = v.into();
24367 self
24368 }
24369
24370 /// Sets the value of [exclude_public_ca_set][crate::model::TlsInspectionPolicy::exclude_public_ca_set].
24371 ///
24372 /// # Example
24373 /// ```ignore,no_run
24374 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24375 /// let x = TlsInspectionPolicy::new().set_exclude_public_ca_set(true);
24376 /// ```
24377 pub fn set_exclude_public_ca_set<T>(mut self, v: T) -> Self
24378 where
24379 T: std::convert::Into<bool>,
24380 {
24381 self.exclude_public_ca_set = std::option::Option::Some(v.into());
24382 self
24383 }
24384
24385 /// Sets or clears the value of [exclude_public_ca_set][crate::model::TlsInspectionPolicy::exclude_public_ca_set].
24386 ///
24387 /// # Example
24388 /// ```ignore,no_run
24389 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24390 /// let x = TlsInspectionPolicy::new().set_or_clear_exclude_public_ca_set(Some(false));
24391 /// let x = TlsInspectionPolicy::new().set_or_clear_exclude_public_ca_set(None::<bool>);
24392 /// ```
24393 pub fn set_or_clear_exclude_public_ca_set<T>(mut self, v: std::option::Option<T>) -> Self
24394 where
24395 T: std::convert::Into<bool>,
24396 {
24397 self.exclude_public_ca_set = v.map(|x| x.into());
24398 self
24399 }
24400
24401 /// Sets the value of [min_tls_version][crate::model::TlsInspectionPolicy::min_tls_version].
24402 ///
24403 /// # Example
24404 /// ```ignore,no_run
24405 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24406 /// use google_cloud_networksecurity_v1::model::tls_inspection_policy::TlsVersion;
24407 /// let x0 = TlsInspectionPolicy::new().set_min_tls_version(TlsVersion::Tls10);
24408 /// let x1 = TlsInspectionPolicy::new().set_min_tls_version(TlsVersion::Tls11);
24409 /// let x2 = TlsInspectionPolicy::new().set_min_tls_version(TlsVersion::Tls12);
24410 /// ```
24411 pub fn set_min_tls_version<
24412 T: std::convert::Into<crate::model::tls_inspection_policy::TlsVersion>,
24413 >(
24414 mut self,
24415 v: T,
24416 ) -> Self {
24417 self.min_tls_version = v.into();
24418 self
24419 }
24420
24421 /// Sets the value of [tls_feature_profile][crate::model::TlsInspectionPolicy::tls_feature_profile].
24422 ///
24423 /// # Example
24424 /// ```ignore,no_run
24425 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24426 /// use google_cloud_networksecurity_v1::model::tls_inspection_policy::Profile;
24427 /// let x0 = TlsInspectionPolicy::new().set_tls_feature_profile(Profile::Compatible);
24428 /// let x1 = TlsInspectionPolicy::new().set_tls_feature_profile(Profile::Modern);
24429 /// let x2 = TlsInspectionPolicy::new().set_tls_feature_profile(Profile::Restricted);
24430 /// ```
24431 pub fn set_tls_feature_profile<
24432 T: std::convert::Into<crate::model::tls_inspection_policy::Profile>,
24433 >(
24434 mut self,
24435 v: T,
24436 ) -> Self {
24437 self.tls_feature_profile = v.into();
24438 self
24439 }
24440
24441 /// Sets the value of [custom_tls_features][crate::model::TlsInspectionPolicy::custom_tls_features].
24442 ///
24443 /// # Example
24444 /// ```ignore,no_run
24445 /// # use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24446 /// let x = TlsInspectionPolicy::new().set_custom_tls_features(["a", "b", "c"]);
24447 /// ```
24448 pub fn set_custom_tls_features<T, V>(mut self, v: T) -> Self
24449 where
24450 T: std::iter::IntoIterator<Item = V>,
24451 V: std::convert::Into<std::string::String>,
24452 {
24453 use std::iter::Iterator;
24454 self.custom_tls_features = v.into_iter().map(|i| i.into()).collect();
24455 self
24456 }
24457}
24458
24459impl wkt::message::Message for TlsInspectionPolicy {
24460 fn typename() -> &'static str {
24461 "type.googleapis.com/google.cloud.networksecurity.v1.TlsInspectionPolicy"
24462 }
24463}
24464
24465/// Defines additional types related to [TlsInspectionPolicy].
24466pub mod tls_inspection_policy {
24467 #[allow(unused_imports)]
24468 use super::*;
24469
24470 /// The minimum version of TLS protocol that can be used by clients or servers
24471 /// to establish a connection with the TLS inspection proxy.
24472 ///
24473 /// # Working with unknown values
24474 ///
24475 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24476 /// additional enum variants at any time. Adding new variants is not considered
24477 /// a breaking change. Applications should write their code in anticipation of:
24478 ///
24479 /// - New values appearing in future releases of the client library, **and**
24480 /// - New values received dynamically, without application changes.
24481 ///
24482 /// Please consult the [Working with enums] section in the user guide for some
24483 /// guidelines.
24484 ///
24485 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24486 #[derive(Clone, Debug, PartialEq)]
24487 #[non_exhaustive]
24488 pub enum TlsVersion {
24489 /// Indicates no TLS version was specified.
24490 Unspecified,
24491 /// TLS 1.0
24492 Tls10,
24493 /// TLS 1.1
24494 Tls11,
24495 /// TLS 1.2
24496 Tls12,
24497 /// TLS 1.3
24498 Tls13,
24499 /// If set, the enum was initialized with an unknown value.
24500 ///
24501 /// Applications can examine the value using [TlsVersion::value] or
24502 /// [TlsVersion::name].
24503 UnknownValue(tls_version::UnknownValue),
24504 }
24505
24506 #[doc(hidden)]
24507 pub mod tls_version {
24508 #[allow(unused_imports)]
24509 use super::*;
24510 #[derive(Clone, Debug, PartialEq)]
24511 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24512 }
24513
24514 impl TlsVersion {
24515 /// Gets the enum value.
24516 ///
24517 /// Returns `None` if the enum contains an unknown value deserialized from
24518 /// the string representation of enums.
24519 pub fn value(&self) -> std::option::Option<i32> {
24520 match self {
24521 Self::Unspecified => std::option::Option::Some(0),
24522 Self::Tls10 => std::option::Option::Some(1),
24523 Self::Tls11 => std::option::Option::Some(2),
24524 Self::Tls12 => std::option::Option::Some(3),
24525 Self::Tls13 => std::option::Option::Some(4),
24526 Self::UnknownValue(u) => u.0.value(),
24527 }
24528 }
24529
24530 /// Gets the enum value as a string.
24531 ///
24532 /// Returns `None` if the enum contains an unknown value deserialized from
24533 /// the integer representation of enums.
24534 pub fn name(&self) -> std::option::Option<&str> {
24535 match self {
24536 Self::Unspecified => std::option::Option::Some("TLS_VERSION_UNSPECIFIED"),
24537 Self::Tls10 => std::option::Option::Some("TLS_1_0"),
24538 Self::Tls11 => std::option::Option::Some("TLS_1_1"),
24539 Self::Tls12 => std::option::Option::Some("TLS_1_2"),
24540 Self::Tls13 => std::option::Option::Some("TLS_1_3"),
24541 Self::UnknownValue(u) => u.0.name(),
24542 }
24543 }
24544 }
24545
24546 impl std::default::Default for TlsVersion {
24547 fn default() -> Self {
24548 use std::convert::From;
24549 Self::from(0)
24550 }
24551 }
24552
24553 impl std::fmt::Display for TlsVersion {
24554 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24555 wkt::internal::display_enum(f, self.name(), self.value())
24556 }
24557 }
24558
24559 impl std::convert::From<i32> for TlsVersion {
24560 fn from(value: i32) -> Self {
24561 match value {
24562 0 => Self::Unspecified,
24563 1 => Self::Tls10,
24564 2 => Self::Tls11,
24565 3 => Self::Tls12,
24566 4 => Self::Tls13,
24567 _ => Self::UnknownValue(tls_version::UnknownValue(
24568 wkt::internal::UnknownEnumValue::Integer(value),
24569 )),
24570 }
24571 }
24572 }
24573
24574 impl std::convert::From<&str> for TlsVersion {
24575 fn from(value: &str) -> Self {
24576 use std::string::ToString;
24577 match value {
24578 "TLS_VERSION_UNSPECIFIED" => Self::Unspecified,
24579 "TLS_1_0" => Self::Tls10,
24580 "TLS_1_1" => Self::Tls11,
24581 "TLS_1_2" => Self::Tls12,
24582 "TLS_1_3" => Self::Tls13,
24583 _ => Self::UnknownValue(tls_version::UnknownValue(
24584 wkt::internal::UnknownEnumValue::String(value.to_string()),
24585 )),
24586 }
24587 }
24588 }
24589
24590 impl serde::ser::Serialize for TlsVersion {
24591 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24592 where
24593 S: serde::Serializer,
24594 {
24595 match self {
24596 Self::Unspecified => serializer.serialize_i32(0),
24597 Self::Tls10 => serializer.serialize_i32(1),
24598 Self::Tls11 => serializer.serialize_i32(2),
24599 Self::Tls12 => serializer.serialize_i32(3),
24600 Self::Tls13 => serializer.serialize_i32(4),
24601 Self::UnknownValue(u) => u.0.serialize(serializer),
24602 }
24603 }
24604 }
24605
24606 impl<'de> serde::de::Deserialize<'de> for TlsVersion {
24607 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24608 where
24609 D: serde::Deserializer<'de>,
24610 {
24611 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TlsVersion>::new(
24612 ".google.cloud.networksecurity.v1.TlsInspectionPolicy.TlsVersion",
24613 ))
24614 }
24615 }
24616
24617 /// Profile specifies the set of TLS cipher suites (and possibly
24618 /// other features in the future) that can be used by the firewall when
24619 /// negotiating TLS connections with clients and servers. The meaning of these
24620 /// fields is identical to the load balancers' SSLPolicy resource.
24621 ///
24622 /// # Working with unknown values
24623 ///
24624 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24625 /// additional enum variants at any time. Adding new variants is not considered
24626 /// a breaking change. Applications should write their code in anticipation of:
24627 ///
24628 /// - New values appearing in future releases of the client library, **and**
24629 /// - New values received dynamically, without application changes.
24630 ///
24631 /// Please consult the [Working with enums] section in the user guide for some
24632 /// guidelines.
24633 ///
24634 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24635 #[derive(Clone, Debug, PartialEq)]
24636 #[non_exhaustive]
24637 pub enum Profile {
24638 /// Indicates no profile was specified.
24639 Unspecified,
24640 /// Compatible profile. Allows the broadest set of clients, even those
24641 /// which support only out-of-date SSL features to negotiate with the TLS
24642 /// inspection proxy.
24643 Compatible,
24644 /// Modern profile. Supports a wide set of SSL features, allowing modern
24645 /// clients to negotiate SSL with the TLS inspection proxy.
24646 Modern,
24647 /// Restricted profile. Supports a reduced set of SSL features, intended to
24648 /// meet stricter compliance requirements.
24649 Restricted,
24650 /// Custom profile. Allow only the set of allowed SSL features specified in
24651 /// the custom_features field of SslPolicy.
24652 Custom,
24653 /// If set, the enum was initialized with an unknown value.
24654 ///
24655 /// Applications can examine the value using [Profile::value] or
24656 /// [Profile::name].
24657 UnknownValue(profile::UnknownValue),
24658 }
24659
24660 #[doc(hidden)]
24661 pub mod profile {
24662 #[allow(unused_imports)]
24663 use super::*;
24664 #[derive(Clone, Debug, PartialEq)]
24665 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24666 }
24667
24668 impl Profile {
24669 /// Gets the enum value.
24670 ///
24671 /// Returns `None` if the enum contains an unknown value deserialized from
24672 /// the string representation of enums.
24673 pub fn value(&self) -> std::option::Option<i32> {
24674 match self {
24675 Self::Unspecified => std::option::Option::Some(0),
24676 Self::Compatible => std::option::Option::Some(1),
24677 Self::Modern => std::option::Option::Some(2),
24678 Self::Restricted => std::option::Option::Some(3),
24679 Self::Custom => std::option::Option::Some(4),
24680 Self::UnknownValue(u) => u.0.value(),
24681 }
24682 }
24683
24684 /// Gets the enum value as a string.
24685 ///
24686 /// Returns `None` if the enum contains an unknown value deserialized from
24687 /// the integer representation of enums.
24688 pub fn name(&self) -> std::option::Option<&str> {
24689 match self {
24690 Self::Unspecified => std::option::Option::Some("PROFILE_UNSPECIFIED"),
24691 Self::Compatible => std::option::Option::Some("PROFILE_COMPATIBLE"),
24692 Self::Modern => std::option::Option::Some("PROFILE_MODERN"),
24693 Self::Restricted => std::option::Option::Some("PROFILE_RESTRICTED"),
24694 Self::Custom => std::option::Option::Some("PROFILE_CUSTOM"),
24695 Self::UnknownValue(u) => u.0.name(),
24696 }
24697 }
24698 }
24699
24700 impl std::default::Default for Profile {
24701 fn default() -> Self {
24702 use std::convert::From;
24703 Self::from(0)
24704 }
24705 }
24706
24707 impl std::fmt::Display for Profile {
24708 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24709 wkt::internal::display_enum(f, self.name(), self.value())
24710 }
24711 }
24712
24713 impl std::convert::From<i32> for Profile {
24714 fn from(value: i32) -> Self {
24715 match value {
24716 0 => Self::Unspecified,
24717 1 => Self::Compatible,
24718 2 => Self::Modern,
24719 3 => Self::Restricted,
24720 4 => Self::Custom,
24721 _ => Self::UnknownValue(profile::UnknownValue(
24722 wkt::internal::UnknownEnumValue::Integer(value),
24723 )),
24724 }
24725 }
24726 }
24727
24728 impl std::convert::From<&str> for Profile {
24729 fn from(value: &str) -> Self {
24730 use std::string::ToString;
24731 match value {
24732 "PROFILE_UNSPECIFIED" => Self::Unspecified,
24733 "PROFILE_COMPATIBLE" => Self::Compatible,
24734 "PROFILE_MODERN" => Self::Modern,
24735 "PROFILE_RESTRICTED" => Self::Restricted,
24736 "PROFILE_CUSTOM" => Self::Custom,
24737 _ => Self::UnknownValue(profile::UnknownValue(
24738 wkt::internal::UnknownEnumValue::String(value.to_string()),
24739 )),
24740 }
24741 }
24742 }
24743
24744 impl serde::ser::Serialize for Profile {
24745 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24746 where
24747 S: serde::Serializer,
24748 {
24749 match self {
24750 Self::Unspecified => serializer.serialize_i32(0),
24751 Self::Compatible => serializer.serialize_i32(1),
24752 Self::Modern => serializer.serialize_i32(2),
24753 Self::Restricted => serializer.serialize_i32(3),
24754 Self::Custom => serializer.serialize_i32(4),
24755 Self::UnknownValue(u) => u.0.serialize(serializer),
24756 }
24757 }
24758 }
24759
24760 impl<'de> serde::de::Deserialize<'de> for Profile {
24761 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24762 where
24763 D: serde::Deserializer<'de>,
24764 {
24765 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Profile>::new(
24766 ".google.cloud.networksecurity.v1.TlsInspectionPolicy.Profile",
24767 ))
24768 }
24769 }
24770}
24771
24772/// Request used by the CreateTlsInspectionPolicy method.
24773#[derive(Clone, Default, PartialEq)]
24774#[non_exhaustive]
24775pub struct CreateTlsInspectionPolicyRequest {
24776 /// Required. The parent resource of the TlsInspectionPolicy. Must be in the
24777 /// format `projects/{project}/locations/{location}`.
24778 pub parent: std::string::String,
24779
24780 /// Required. Short name of the TlsInspectionPolicy resource to be created.
24781 /// This value should be 1-63 characters long, containing only
24782 /// letters, numbers, hyphens, and underscores, and should not start
24783 /// with a number. E.g. "tls_inspection_policy1".
24784 pub tls_inspection_policy_id: std::string::String,
24785
24786 /// Required. TlsInspectionPolicy resource to be created.
24787 pub tls_inspection_policy: std::option::Option<crate::model::TlsInspectionPolicy>,
24788
24789 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24790}
24791
24792impl CreateTlsInspectionPolicyRequest {
24793 pub fn new() -> Self {
24794 std::default::Default::default()
24795 }
24796
24797 /// Sets the value of [parent][crate::model::CreateTlsInspectionPolicyRequest::parent].
24798 ///
24799 /// # Example
24800 /// ```ignore,no_run
24801 /// # use google_cloud_networksecurity_v1::model::CreateTlsInspectionPolicyRequest;
24802 /// let x = CreateTlsInspectionPolicyRequest::new().set_parent("example");
24803 /// ```
24804 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24805 self.parent = v.into();
24806 self
24807 }
24808
24809 /// Sets the value of [tls_inspection_policy_id][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy_id].
24810 ///
24811 /// # Example
24812 /// ```ignore,no_run
24813 /// # use google_cloud_networksecurity_v1::model::CreateTlsInspectionPolicyRequest;
24814 /// let x = CreateTlsInspectionPolicyRequest::new().set_tls_inspection_policy_id("example");
24815 /// ```
24816 pub fn set_tls_inspection_policy_id<T: std::convert::Into<std::string::String>>(
24817 mut self,
24818 v: T,
24819 ) -> Self {
24820 self.tls_inspection_policy_id = v.into();
24821 self
24822 }
24823
24824 /// Sets the value of [tls_inspection_policy][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy].
24825 ///
24826 /// # Example
24827 /// ```ignore,no_run
24828 /// # use google_cloud_networksecurity_v1::model::CreateTlsInspectionPolicyRequest;
24829 /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24830 /// let x = CreateTlsInspectionPolicyRequest::new().set_tls_inspection_policy(TlsInspectionPolicy::default()/* use setters */);
24831 /// ```
24832 pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
24833 where
24834 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
24835 {
24836 self.tls_inspection_policy = std::option::Option::Some(v.into());
24837 self
24838 }
24839
24840 /// Sets or clears the value of [tls_inspection_policy][crate::model::CreateTlsInspectionPolicyRequest::tls_inspection_policy].
24841 ///
24842 /// # Example
24843 /// ```ignore,no_run
24844 /// # use google_cloud_networksecurity_v1::model::CreateTlsInspectionPolicyRequest;
24845 /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24846 /// let x = CreateTlsInspectionPolicyRequest::new().set_or_clear_tls_inspection_policy(Some(TlsInspectionPolicy::default()/* use setters */));
24847 /// let x = CreateTlsInspectionPolicyRequest::new().set_or_clear_tls_inspection_policy(None::<TlsInspectionPolicy>);
24848 /// ```
24849 pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
24850 where
24851 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
24852 {
24853 self.tls_inspection_policy = v.map(|x| x.into());
24854 self
24855 }
24856}
24857
24858impl wkt::message::Message for CreateTlsInspectionPolicyRequest {
24859 fn typename() -> &'static str {
24860 "type.googleapis.com/google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest"
24861 }
24862}
24863
24864/// Request used with the ListTlsInspectionPolicies method.
24865#[derive(Clone, Default, PartialEq)]
24866#[non_exhaustive]
24867pub struct ListTlsInspectionPoliciesRequest {
24868 /// Required. The project and location from which the TlsInspectionPolicies
24869 /// should be listed, specified in the format
24870 /// `projects/{project}/locations/{location}`.
24871 pub parent: std::string::String,
24872
24873 /// Maximum number of TlsInspectionPolicies to return per call.
24874 pub page_size: i32,
24875
24876 /// The value returned by the last
24877 /// 'ListTlsInspectionPoliciesResponse' Indicates that this is a
24878 /// continuation of a prior 'ListTlsInspectionPolicies' call, and
24879 /// that the system should return the next page of data.
24880 pub page_token: std::string::String,
24881
24882 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24883}
24884
24885impl ListTlsInspectionPoliciesRequest {
24886 pub fn new() -> Self {
24887 std::default::Default::default()
24888 }
24889
24890 /// Sets the value of [parent][crate::model::ListTlsInspectionPoliciesRequest::parent].
24891 ///
24892 /// # Example
24893 /// ```ignore,no_run
24894 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesRequest;
24895 /// let x = ListTlsInspectionPoliciesRequest::new().set_parent("example");
24896 /// ```
24897 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24898 self.parent = v.into();
24899 self
24900 }
24901
24902 /// Sets the value of [page_size][crate::model::ListTlsInspectionPoliciesRequest::page_size].
24903 ///
24904 /// # Example
24905 /// ```ignore,no_run
24906 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesRequest;
24907 /// let x = ListTlsInspectionPoliciesRequest::new().set_page_size(42);
24908 /// ```
24909 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
24910 self.page_size = v.into();
24911 self
24912 }
24913
24914 /// Sets the value of [page_token][crate::model::ListTlsInspectionPoliciesRequest::page_token].
24915 ///
24916 /// # Example
24917 /// ```ignore,no_run
24918 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesRequest;
24919 /// let x = ListTlsInspectionPoliciesRequest::new().set_page_token("example");
24920 /// ```
24921 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24922 self.page_token = v.into();
24923 self
24924 }
24925}
24926
24927impl wkt::message::Message for ListTlsInspectionPoliciesRequest {
24928 fn typename() -> &'static str {
24929 "type.googleapis.com/google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest"
24930 }
24931}
24932
24933/// Response returned by the ListTlsInspectionPolicies method.
24934#[derive(Clone, Default, PartialEq)]
24935#[non_exhaustive]
24936pub struct ListTlsInspectionPoliciesResponse {
24937 /// List of TlsInspectionPolicies resources.
24938 pub tls_inspection_policies: std::vec::Vec<crate::model::TlsInspectionPolicy>,
24939
24940 /// If there might be more results than those appearing in this response, then
24941 /// 'next_page_token' is included. To get the next set of results, call this
24942 /// method again using the value of 'next_page_token' as 'page_token'.
24943 pub next_page_token: std::string::String,
24944
24945 /// Locations that could not be reached.
24946 pub unreachable: std::vec::Vec<std::string::String>,
24947
24948 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24949}
24950
24951impl ListTlsInspectionPoliciesResponse {
24952 pub fn new() -> Self {
24953 std::default::Default::default()
24954 }
24955
24956 /// Sets the value of [tls_inspection_policies][crate::model::ListTlsInspectionPoliciesResponse::tls_inspection_policies].
24957 ///
24958 /// # Example
24959 /// ```ignore,no_run
24960 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesResponse;
24961 /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
24962 /// let x = ListTlsInspectionPoliciesResponse::new()
24963 /// .set_tls_inspection_policies([
24964 /// TlsInspectionPolicy::default()/* use setters */,
24965 /// TlsInspectionPolicy::default()/* use (different) setters */,
24966 /// ]);
24967 /// ```
24968 pub fn set_tls_inspection_policies<T, V>(mut self, v: T) -> Self
24969 where
24970 T: std::iter::IntoIterator<Item = V>,
24971 V: std::convert::Into<crate::model::TlsInspectionPolicy>,
24972 {
24973 use std::iter::Iterator;
24974 self.tls_inspection_policies = v.into_iter().map(|i| i.into()).collect();
24975 self
24976 }
24977
24978 /// Sets the value of [next_page_token][crate::model::ListTlsInspectionPoliciesResponse::next_page_token].
24979 ///
24980 /// # Example
24981 /// ```ignore,no_run
24982 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesResponse;
24983 /// let x = ListTlsInspectionPoliciesResponse::new().set_next_page_token("example");
24984 /// ```
24985 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24986 self.next_page_token = v.into();
24987 self
24988 }
24989
24990 /// Sets the value of [unreachable][crate::model::ListTlsInspectionPoliciesResponse::unreachable].
24991 ///
24992 /// # Example
24993 /// ```ignore,no_run
24994 /// # use google_cloud_networksecurity_v1::model::ListTlsInspectionPoliciesResponse;
24995 /// let x = ListTlsInspectionPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
24996 /// ```
24997 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
24998 where
24999 T: std::iter::IntoIterator<Item = V>,
25000 V: std::convert::Into<std::string::String>,
25001 {
25002 use std::iter::Iterator;
25003 self.unreachable = v.into_iter().map(|i| i.into()).collect();
25004 self
25005 }
25006}
25007
25008impl wkt::message::Message for ListTlsInspectionPoliciesResponse {
25009 fn typename() -> &'static str {
25010 "type.googleapis.com/google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse"
25011 }
25012}
25013
25014#[doc(hidden)]
25015impl google_cloud_gax::paginator::internal::PageableResponse for ListTlsInspectionPoliciesResponse {
25016 type PageItem = crate::model::TlsInspectionPolicy;
25017
25018 fn items(self) -> std::vec::Vec<Self::PageItem> {
25019 self.tls_inspection_policies
25020 }
25021
25022 fn next_page_token(&self) -> std::string::String {
25023 use std::clone::Clone;
25024 self.next_page_token.clone()
25025 }
25026}
25027
25028/// Request used by the GetTlsInspectionPolicy method.
25029#[derive(Clone, Default, PartialEq)]
25030#[non_exhaustive]
25031pub struct GetTlsInspectionPolicyRequest {
25032 /// Required. A name of the TlsInspectionPolicy to get. Must be in the format
25033 /// `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`.
25034 pub name: std::string::String,
25035
25036 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25037}
25038
25039impl GetTlsInspectionPolicyRequest {
25040 pub fn new() -> Self {
25041 std::default::Default::default()
25042 }
25043
25044 /// Sets the value of [name][crate::model::GetTlsInspectionPolicyRequest::name].
25045 ///
25046 /// # Example
25047 /// ```ignore,no_run
25048 /// # use google_cloud_networksecurity_v1::model::GetTlsInspectionPolicyRequest;
25049 /// let x = GetTlsInspectionPolicyRequest::new().set_name("example");
25050 /// ```
25051 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25052 self.name = v.into();
25053 self
25054 }
25055}
25056
25057impl wkt::message::Message for GetTlsInspectionPolicyRequest {
25058 fn typename() -> &'static str {
25059 "type.googleapis.com/google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest"
25060 }
25061}
25062
25063/// Request used by the DeleteTlsInspectionPolicy method.
25064#[derive(Clone, Default, PartialEq)]
25065#[non_exhaustive]
25066pub struct DeleteTlsInspectionPolicyRequest {
25067 /// Required. A name of the TlsInspectionPolicy to delete. Must be in the
25068 /// format
25069 /// `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`.
25070 pub name: std::string::String,
25071
25072 /// If set to true, any rules for this TlsInspectionPolicy will also be
25073 /// deleted. (Otherwise, the request will only work if the TlsInspectionPolicy
25074 /// has no rules.)
25075 pub force: bool,
25076
25077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25078}
25079
25080impl DeleteTlsInspectionPolicyRequest {
25081 pub fn new() -> Self {
25082 std::default::Default::default()
25083 }
25084
25085 /// Sets the value of [name][crate::model::DeleteTlsInspectionPolicyRequest::name].
25086 ///
25087 /// # Example
25088 /// ```ignore,no_run
25089 /// # use google_cloud_networksecurity_v1::model::DeleteTlsInspectionPolicyRequest;
25090 /// let x = DeleteTlsInspectionPolicyRequest::new().set_name("example");
25091 /// ```
25092 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25093 self.name = v.into();
25094 self
25095 }
25096
25097 /// Sets the value of [force][crate::model::DeleteTlsInspectionPolicyRequest::force].
25098 ///
25099 /// # Example
25100 /// ```ignore,no_run
25101 /// # use google_cloud_networksecurity_v1::model::DeleteTlsInspectionPolicyRequest;
25102 /// let x = DeleteTlsInspectionPolicyRequest::new().set_force(true);
25103 /// ```
25104 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
25105 self.force = v.into();
25106 self
25107 }
25108}
25109
25110impl wkt::message::Message for DeleteTlsInspectionPolicyRequest {
25111 fn typename() -> &'static str {
25112 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest"
25113 }
25114}
25115
25116/// Request used by the UpdateTlsInspectionPolicy method.
25117#[derive(Clone, Default, PartialEq)]
25118#[non_exhaustive]
25119pub struct UpdateTlsInspectionPolicyRequest {
25120 /// Optional. Field mask is used to specify the fields to be overwritten in the
25121 /// TlsInspectionPolicy resource by the update.
25122 /// The fields specified in the update_mask are relative to the resource, not
25123 /// the full request. A field will be overwritten if it is in the mask. If the
25124 /// user does not provide a mask then all fields will be overwritten.
25125 pub update_mask: std::option::Option<wkt::FieldMask>,
25126
25127 /// Required. Updated TlsInspectionPolicy resource.
25128 pub tls_inspection_policy: std::option::Option<crate::model::TlsInspectionPolicy>,
25129
25130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25131}
25132
25133impl UpdateTlsInspectionPolicyRequest {
25134 pub fn new() -> Self {
25135 std::default::Default::default()
25136 }
25137
25138 /// Sets the value of [update_mask][crate::model::UpdateTlsInspectionPolicyRequest::update_mask].
25139 ///
25140 /// # Example
25141 /// ```ignore,no_run
25142 /// # use google_cloud_networksecurity_v1::model::UpdateTlsInspectionPolicyRequest;
25143 /// use wkt::FieldMask;
25144 /// let x = UpdateTlsInspectionPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
25145 /// ```
25146 pub fn set_update_mask<T>(mut self, v: T) -> Self
25147 where
25148 T: std::convert::Into<wkt::FieldMask>,
25149 {
25150 self.update_mask = std::option::Option::Some(v.into());
25151 self
25152 }
25153
25154 /// Sets or clears the value of [update_mask][crate::model::UpdateTlsInspectionPolicyRequest::update_mask].
25155 ///
25156 /// # Example
25157 /// ```ignore,no_run
25158 /// # use google_cloud_networksecurity_v1::model::UpdateTlsInspectionPolicyRequest;
25159 /// use wkt::FieldMask;
25160 /// let x = UpdateTlsInspectionPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
25161 /// let x = UpdateTlsInspectionPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
25162 /// ```
25163 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
25164 where
25165 T: std::convert::Into<wkt::FieldMask>,
25166 {
25167 self.update_mask = v.map(|x| x.into());
25168 self
25169 }
25170
25171 /// Sets the value of [tls_inspection_policy][crate::model::UpdateTlsInspectionPolicyRequest::tls_inspection_policy].
25172 ///
25173 /// # Example
25174 /// ```ignore,no_run
25175 /// # use google_cloud_networksecurity_v1::model::UpdateTlsInspectionPolicyRequest;
25176 /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
25177 /// let x = UpdateTlsInspectionPolicyRequest::new().set_tls_inspection_policy(TlsInspectionPolicy::default()/* use setters */);
25178 /// ```
25179 pub fn set_tls_inspection_policy<T>(mut self, v: T) -> Self
25180 where
25181 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
25182 {
25183 self.tls_inspection_policy = std::option::Option::Some(v.into());
25184 self
25185 }
25186
25187 /// Sets or clears the value of [tls_inspection_policy][crate::model::UpdateTlsInspectionPolicyRequest::tls_inspection_policy].
25188 ///
25189 /// # Example
25190 /// ```ignore,no_run
25191 /// # use google_cloud_networksecurity_v1::model::UpdateTlsInspectionPolicyRequest;
25192 /// use google_cloud_networksecurity_v1::model::TlsInspectionPolicy;
25193 /// let x = UpdateTlsInspectionPolicyRequest::new().set_or_clear_tls_inspection_policy(Some(TlsInspectionPolicy::default()/* use setters */));
25194 /// let x = UpdateTlsInspectionPolicyRequest::new().set_or_clear_tls_inspection_policy(None::<TlsInspectionPolicy>);
25195 /// ```
25196 pub fn set_or_clear_tls_inspection_policy<T>(mut self, v: std::option::Option<T>) -> Self
25197 where
25198 T: std::convert::Into<crate::model::TlsInspectionPolicy>,
25199 {
25200 self.tls_inspection_policy = v.map(|x| x.into());
25201 self
25202 }
25203}
25204
25205impl wkt::message::Message for UpdateTlsInspectionPolicyRequest {
25206 fn typename() -> &'static str {
25207 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest"
25208 }
25209}
25210
25211/// UrlList proto helps users to set reusable, independently manageable lists
25212/// of hosts, host patterns, URLs, URL patterns.
25213#[derive(Clone, Default, PartialEq)]
25214#[non_exhaustive]
25215pub struct UrlList {
25216 /// Required. Name of the resource provided by the user.
25217 /// Name is of the form
25218 /// projects/{project}/locations/{location}/urlLists/{url_list}
25219 /// url_list should match the
25220 /// pattern:(^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
25221 pub name: std::string::String,
25222
25223 /// Output only. Time when the security policy was created.
25224 pub create_time: std::option::Option<wkt::Timestamp>,
25225
25226 /// Output only. Time when the security policy was updated.
25227 pub update_time: std::option::Option<wkt::Timestamp>,
25228
25229 /// Optional. Free-text description of the resource.
25230 pub description: std::string::String,
25231
25232 /// Required. FQDNs and URLs.
25233 pub values: std::vec::Vec<std::string::String>,
25234
25235 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25236}
25237
25238impl UrlList {
25239 pub fn new() -> Self {
25240 std::default::Default::default()
25241 }
25242
25243 /// Sets the value of [name][crate::model::UrlList::name].
25244 ///
25245 /// # Example
25246 /// ```ignore,no_run
25247 /// # use google_cloud_networksecurity_v1::model::UrlList;
25248 /// let x = UrlList::new().set_name("example");
25249 /// ```
25250 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25251 self.name = v.into();
25252 self
25253 }
25254
25255 /// Sets the value of [create_time][crate::model::UrlList::create_time].
25256 ///
25257 /// # Example
25258 /// ```ignore,no_run
25259 /// # use google_cloud_networksecurity_v1::model::UrlList;
25260 /// use wkt::Timestamp;
25261 /// let x = UrlList::new().set_create_time(Timestamp::default()/* use setters */);
25262 /// ```
25263 pub fn set_create_time<T>(mut self, v: T) -> Self
25264 where
25265 T: std::convert::Into<wkt::Timestamp>,
25266 {
25267 self.create_time = std::option::Option::Some(v.into());
25268 self
25269 }
25270
25271 /// Sets or clears the value of [create_time][crate::model::UrlList::create_time].
25272 ///
25273 /// # Example
25274 /// ```ignore,no_run
25275 /// # use google_cloud_networksecurity_v1::model::UrlList;
25276 /// use wkt::Timestamp;
25277 /// let x = UrlList::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
25278 /// let x = UrlList::new().set_or_clear_create_time(None::<Timestamp>);
25279 /// ```
25280 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
25281 where
25282 T: std::convert::Into<wkt::Timestamp>,
25283 {
25284 self.create_time = v.map(|x| x.into());
25285 self
25286 }
25287
25288 /// Sets the value of [update_time][crate::model::UrlList::update_time].
25289 ///
25290 /// # Example
25291 /// ```ignore,no_run
25292 /// # use google_cloud_networksecurity_v1::model::UrlList;
25293 /// use wkt::Timestamp;
25294 /// let x = UrlList::new().set_update_time(Timestamp::default()/* use setters */);
25295 /// ```
25296 pub fn set_update_time<T>(mut self, v: T) -> Self
25297 where
25298 T: std::convert::Into<wkt::Timestamp>,
25299 {
25300 self.update_time = std::option::Option::Some(v.into());
25301 self
25302 }
25303
25304 /// Sets or clears the value of [update_time][crate::model::UrlList::update_time].
25305 ///
25306 /// # Example
25307 /// ```ignore,no_run
25308 /// # use google_cloud_networksecurity_v1::model::UrlList;
25309 /// use wkt::Timestamp;
25310 /// let x = UrlList::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
25311 /// let x = UrlList::new().set_or_clear_update_time(None::<Timestamp>);
25312 /// ```
25313 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
25314 where
25315 T: std::convert::Into<wkt::Timestamp>,
25316 {
25317 self.update_time = v.map(|x| x.into());
25318 self
25319 }
25320
25321 /// Sets the value of [description][crate::model::UrlList::description].
25322 ///
25323 /// # Example
25324 /// ```ignore,no_run
25325 /// # use google_cloud_networksecurity_v1::model::UrlList;
25326 /// let x = UrlList::new().set_description("example");
25327 /// ```
25328 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25329 self.description = v.into();
25330 self
25331 }
25332
25333 /// Sets the value of [values][crate::model::UrlList::values].
25334 ///
25335 /// # Example
25336 /// ```ignore,no_run
25337 /// # use google_cloud_networksecurity_v1::model::UrlList;
25338 /// let x = UrlList::new().set_values(["a", "b", "c"]);
25339 /// ```
25340 pub fn set_values<T, V>(mut self, v: T) -> Self
25341 where
25342 T: std::iter::IntoIterator<Item = V>,
25343 V: std::convert::Into<std::string::String>,
25344 {
25345 use std::iter::Iterator;
25346 self.values = v.into_iter().map(|i| i.into()).collect();
25347 self
25348 }
25349}
25350
25351impl wkt::message::Message for UrlList {
25352 fn typename() -> &'static str {
25353 "type.googleapis.com/google.cloud.networksecurity.v1.UrlList"
25354 }
25355}
25356
25357/// Request used by the ListUrlList method.
25358#[derive(Clone, Default, PartialEq)]
25359#[non_exhaustive]
25360pub struct ListUrlListsRequest {
25361 /// Required. The project and location from which the UrlLists should
25362 /// be listed, specified in the format
25363 /// `projects/{project}/locations/{location}`.
25364 pub parent: std::string::String,
25365
25366 /// Maximum number of UrlLists to return per call.
25367 pub page_size: i32,
25368
25369 /// The value returned by the last `ListUrlListsResponse`
25370 /// Indicates that this is a continuation of a prior
25371 /// `ListUrlLists` call, and that the system
25372 /// should return the next page of data.
25373 pub page_token: std::string::String,
25374
25375 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25376}
25377
25378impl ListUrlListsRequest {
25379 pub fn new() -> Self {
25380 std::default::Default::default()
25381 }
25382
25383 /// Sets the value of [parent][crate::model::ListUrlListsRequest::parent].
25384 ///
25385 /// # Example
25386 /// ```ignore,no_run
25387 /// # use google_cloud_networksecurity_v1::model::ListUrlListsRequest;
25388 /// let x = ListUrlListsRequest::new().set_parent("example");
25389 /// ```
25390 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25391 self.parent = v.into();
25392 self
25393 }
25394
25395 /// Sets the value of [page_size][crate::model::ListUrlListsRequest::page_size].
25396 ///
25397 /// # Example
25398 /// ```ignore,no_run
25399 /// # use google_cloud_networksecurity_v1::model::ListUrlListsRequest;
25400 /// let x = ListUrlListsRequest::new().set_page_size(42);
25401 /// ```
25402 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
25403 self.page_size = v.into();
25404 self
25405 }
25406
25407 /// Sets the value of [page_token][crate::model::ListUrlListsRequest::page_token].
25408 ///
25409 /// # Example
25410 /// ```ignore,no_run
25411 /// # use google_cloud_networksecurity_v1::model::ListUrlListsRequest;
25412 /// let x = ListUrlListsRequest::new().set_page_token("example");
25413 /// ```
25414 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25415 self.page_token = v.into();
25416 self
25417 }
25418}
25419
25420impl wkt::message::Message for ListUrlListsRequest {
25421 fn typename() -> &'static str {
25422 "type.googleapis.com/google.cloud.networksecurity.v1.ListUrlListsRequest"
25423 }
25424}
25425
25426/// Response returned by the ListUrlLists method.
25427#[derive(Clone, Default, PartialEq)]
25428#[non_exhaustive]
25429pub struct ListUrlListsResponse {
25430 /// List of UrlList resources.
25431 pub url_lists: std::vec::Vec<crate::model::UrlList>,
25432
25433 /// If there might be more results than those appearing in this response, then
25434 /// `next_page_token` is included. To get the next set of results, call this
25435 /// method again using the value of `next_page_token` as `page_token`.
25436 pub next_page_token: std::string::String,
25437
25438 /// Locations that could not be reached.
25439 pub unreachable: std::vec::Vec<std::string::String>,
25440
25441 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25442}
25443
25444impl ListUrlListsResponse {
25445 pub fn new() -> Self {
25446 std::default::Default::default()
25447 }
25448
25449 /// Sets the value of [url_lists][crate::model::ListUrlListsResponse::url_lists].
25450 ///
25451 /// # Example
25452 /// ```ignore,no_run
25453 /// # use google_cloud_networksecurity_v1::model::ListUrlListsResponse;
25454 /// use google_cloud_networksecurity_v1::model::UrlList;
25455 /// let x = ListUrlListsResponse::new()
25456 /// .set_url_lists([
25457 /// UrlList::default()/* use setters */,
25458 /// UrlList::default()/* use (different) setters */,
25459 /// ]);
25460 /// ```
25461 pub fn set_url_lists<T, V>(mut self, v: T) -> Self
25462 where
25463 T: std::iter::IntoIterator<Item = V>,
25464 V: std::convert::Into<crate::model::UrlList>,
25465 {
25466 use std::iter::Iterator;
25467 self.url_lists = v.into_iter().map(|i| i.into()).collect();
25468 self
25469 }
25470
25471 /// Sets the value of [next_page_token][crate::model::ListUrlListsResponse::next_page_token].
25472 ///
25473 /// # Example
25474 /// ```ignore,no_run
25475 /// # use google_cloud_networksecurity_v1::model::ListUrlListsResponse;
25476 /// let x = ListUrlListsResponse::new().set_next_page_token("example");
25477 /// ```
25478 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25479 self.next_page_token = v.into();
25480 self
25481 }
25482
25483 /// Sets the value of [unreachable][crate::model::ListUrlListsResponse::unreachable].
25484 ///
25485 /// # Example
25486 /// ```ignore,no_run
25487 /// # use google_cloud_networksecurity_v1::model::ListUrlListsResponse;
25488 /// let x = ListUrlListsResponse::new().set_unreachable(["a", "b", "c"]);
25489 /// ```
25490 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
25491 where
25492 T: std::iter::IntoIterator<Item = V>,
25493 V: std::convert::Into<std::string::String>,
25494 {
25495 use std::iter::Iterator;
25496 self.unreachable = v.into_iter().map(|i| i.into()).collect();
25497 self
25498 }
25499}
25500
25501impl wkt::message::Message for ListUrlListsResponse {
25502 fn typename() -> &'static str {
25503 "type.googleapis.com/google.cloud.networksecurity.v1.ListUrlListsResponse"
25504 }
25505}
25506
25507#[doc(hidden)]
25508impl google_cloud_gax::paginator::internal::PageableResponse for ListUrlListsResponse {
25509 type PageItem = crate::model::UrlList;
25510
25511 fn items(self) -> std::vec::Vec<Self::PageItem> {
25512 self.url_lists
25513 }
25514
25515 fn next_page_token(&self) -> std::string::String {
25516 use std::clone::Clone;
25517 self.next_page_token.clone()
25518 }
25519}
25520
25521/// Request used by the GetUrlList method.
25522#[derive(Clone, Default, PartialEq)]
25523#[non_exhaustive]
25524pub struct GetUrlListRequest {
25525 /// Required. A name of the UrlList to get. Must be in the format
25526 /// `projects/*/locations/{location}/urlLists/*`.
25527 pub name: std::string::String,
25528
25529 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25530}
25531
25532impl GetUrlListRequest {
25533 pub fn new() -> Self {
25534 std::default::Default::default()
25535 }
25536
25537 /// Sets the value of [name][crate::model::GetUrlListRequest::name].
25538 ///
25539 /// # Example
25540 /// ```ignore,no_run
25541 /// # use google_cloud_networksecurity_v1::model::GetUrlListRequest;
25542 /// let x = GetUrlListRequest::new().set_name("example");
25543 /// ```
25544 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25545 self.name = v.into();
25546 self
25547 }
25548}
25549
25550impl wkt::message::Message for GetUrlListRequest {
25551 fn typename() -> &'static str {
25552 "type.googleapis.com/google.cloud.networksecurity.v1.GetUrlListRequest"
25553 }
25554}
25555
25556/// Request used by the CreateUrlList method.
25557#[derive(Clone, Default, PartialEq)]
25558#[non_exhaustive]
25559pub struct CreateUrlListRequest {
25560 /// Required. The parent resource of the UrlList. Must be in
25561 /// the format `projects/*/locations/{location}`.
25562 pub parent: std::string::String,
25563
25564 /// Required. Short name of the UrlList resource to be created. This value
25565 /// should be 1-63 characters long, containing only letters, numbers, hyphens,
25566 /// and underscores, and should not start with a number. E.g. "url_list".
25567 pub url_list_id: std::string::String,
25568
25569 /// Required. UrlList resource to be created.
25570 pub url_list: std::option::Option<crate::model::UrlList>,
25571
25572 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25573}
25574
25575impl CreateUrlListRequest {
25576 pub fn new() -> Self {
25577 std::default::Default::default()
25578 }
25579
25580 /// Sets the value of [parent][crate::model::CreateUrlListRequest::parent].
25581 ///
25582 /// # Example
25583 /// ```ignore,no_run
25584 /// # use google_cloud_networksecurity_v1::model::CreateUrlListRequest;
25585 /// let x = CreateUrlListRequest::new().set_parent("example");
25586 /// ```
25587 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25588 self.parent = v.into();
25589 self
25590 }
25591
25592 /// Sets the value of [url_list_id][crate::model::CreateUrlListRequest::url_list_id].
25593 ///
25594 /// # Example
25595 /// ```ignore,no_run
25596 /// # use google_cloud_networksecurity_v1::model::CreateUrlListRequest;
25597 /// let x = CreateUrlListRequest::new().set_url_list_id("example");
25598 /// ```
25599 pub fn set_url_list_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25600 self.url_list_id = v.into();
25601 self
25602 }
25603
25604 /// Sets the value of [url_list][crate::model::CreateUrlListRequest::url_list].
25605 ///
25606 /// # Example
25607 /// ```ignore,no_run
25608 /// # use google_cloud_networksecurity_v1::model::CreateUrlListRequest;
25609 /// use google_cloud_networksecurity_v1::model::UrlList;
25610 /// let x = CreateUrlListRequest::new().set_url_list(UrlList::default()/* use setters */);
25611 /// ```
25612 pub fn set_url_list<T>(mut self, v: T) -> Self
25613 where
25614 T: std::convert::Into<crate::model::UrlList>,
25615 {
25616 self.url_list = std::option::Option::Some(v.into());
25617 self
25618 }
25619
25620 /// Sets or clears the value of [url_list][crate::model::CreateUrlListRequest::url_list].
25621 ///
25622 /// # Example
25623 /// ```ignore,no_run
25624 /// # use google_cloud_networksecurity_v1::model::CreateUrlListRequest;
25625 /// use google_cloud_networksecurity_v1::model::UrlList;
25626 /// let x = CreateUrlListRequest::new().set_or_clear_url_list(Some(UrlList::default()/* use setters */));
25627 /// let x = CreateUrlListRequest::new().set_or_clear_url_list(None::<UrlList>);
25628 /// ```
25629 pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
25630 where
25631 T: std::convert::Into<crate::model::UrlList>,
25632 {
25633 self.url_list = v.map(|x| x.into());
25634 self
25635 }
25636}
25637
25638impl wkt::message::Message for CreateUrlListRequest {
25639 fn typename() -> &'static str {
25640 "type.googleapis.com/google.cloud.networksecurity.v1.CreateUrlListRequest"
25641 }
25642}
25643
25644/// Request used by UpdateUrlList method.
25645#[derive(Clone, Default, PartialEq)]
25646#[non_exhaustive]
25647pub struct UpdateUrlListRequest {
25648 /// Optional. Field mask is used to specify the fields to be overwritten in the
25649 /// UrlList resource by the update. The fields
25650 /// specified in the update_mask are relative to the resource, not
25651 /// the full request. A field will be overwritten if it is in the
25652 /// mask. If the user does not provide a mask then all fields will be
25653 /// overwritten.
25654 pub update_mask: std::option::Option<wkt::FieldMask>,
25655
25656 /// Required. Updated UrlList resource.
25657 pub url_list: std::option::Option<crate::model::UrlList>,
25658
25659 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25660}
25661
25662impl UpdateUrlListRequest {
25663 pub fn new() -> Self {
25664 std::default::Default::default()
25665 }
25666
25667 /// Sets the value of [update_mask][crate::model::UpdateUrlListRequest::update_mask].
25668 ///
25669 /// # Example
25670 /// ```ignore,no_run
25671 /// # use google_cloud_networksecurity_v1::model::UpdateUrlListRequest;
25672 /// use wkt::FieldMask;
25673 /// let x = UpdateUrlListRequest::new().set_update_mask(FieldMask::default()/* use setters */);
25674 /// ```
25675 pub fn set_update_mask<T>(mut self, v: T) -> Self
25676 where
25677 T: std::convert::Into<wkt::FieldMask>,
25678 {
25679 self.update_mask = std::option::Option::Some(v.into());
25680 self
25681 }
25682
25683 /// Sets or clears the value of [update_mask][crate::model::UpdateUrlListRequest::update_mask].
25684 ///
25685 /// # Example
25686 /// ```ignore,no_run
25687 /// # use google_cloud_networksecurity_v1::model::UpdateUrlListRequest;
25688 /// use wkt::FieldMask;
25689 /// let x = UpdateUrlListRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
25690 /// let x = UpdateUrlListRequest::new().set_or_clear_update_mask(None::<FieldMask>);
25691 /// ```
25692 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
25693 where
25694 T: std::convert::Into<wkt::FieldMask>,
25695 {
25696 self.update_mask = v.map(|x| x.into());
25697 self
25698 }
25699
25700 /// Sets the value of [url_list][crate::model::UpdateUrlListRequest::url_list].
25701 ///
25702 /// # Example
25703 /// ```ignore,no_run
25704 /// # use google_cloud_networksecurity_v1::model::UpdateUrlListRequest;
25705 /// use google_cloud_networksecurity_v1::model::UrlList;
25706 /// let x = UpdateUrlListRequest::new().set_url_list(UrlList::default()/* use setters */);
25707 /// ```
25708 pub fn set_url_list<T>(mut self, v: T) -> Self
25709 where
25710 T: std::convert::Into<crate::model::UrlList>,
25711 {
25712 self.url_list = std::option::Option::Some(v.into());
25713 self
25714 }
25715
25716 /// Sets or clears the value of [url_list][crate::model::UpdateUrlListRequest::url_list].
25717 ///
25718 /// # Example
25719 /// ```ignore,no_run
25720 /// # use google_cloud_networksecurity_v1::model::UpdateUrlListRequest;
25721 /// use google_cloud_networksecurity_v1::model::UrlList;
25722 /// let x = UpdateUrlListRequest::new().set_or_clear_url_list(Some(UrlList::default()/* use setters */));
25723 /// let x = UpdateUrlListRequest::new().set_or_clear_url_list(None::<UrlList>);
25724 /// ```
25725 pub fn set_or_clear_url_list<T>(mut self, v: std::option::Option<T>) -> Self
25726 where
25727 T: std::convert::Into<crate::model::UrlList>,
25728 {
25729 self.url_list = v.map(|x| x.into());
25730 self
25731 }
25732}
25733
25734impl wkt::message::Message for UpdateUrlListRequest {
25735 fn typename() -> &'static str {
25736 "type.googleapis.com/google.cloud.networksecurity.v1.UpdateUrlListRequest"
25737 }
25738}
25739
25740/// Request used by the DeleteUrlList method.
25741#[derive(Clone, Default, PartialEq)]
25742#[non_exhaustive]
25743pub struct DeleteUrlListRequest {
25744 /// Required. A name of the UrlList to delete. Must be in
25745 /// the format `projects/*/locations/{location}/urlLists/*`.
25746 pub name: std::string::String,
25747
25748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25749}
25750
25751impl DeleteUrlListRequest {
25752 pub fn new() -> Self {
25753 std::default::Default::default()
25754 }
25755
25756 /// Sets the value of [name][crate::model::DeleteUrlListRequest::name].
25757 ///
25758 /// # Example
25759 /// ```ignore,no_run
25760 /// # use google_cloud_networksecurity_v1::model::DeleteUrlListRequest;
25761 /// let x = DeleteUrlListRequest::new().set_name("example");
25762 /// ```
25763 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25764 self.name = v.into();
25765 self
25766 }
25767}
25768
25769impl wkt::message::Message for DeleteUrlListRequest {
25770 fn typename() -> &'static str {
25771 "type.googleapis.com/google.cloud.networksecurity.v1.DeleteUrlListRequest"
25772 }
25773}
25774
25775/// Severity level.
25776///
25777/// # Working with unknown values
25778///
25779/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25780/// additional enum variants at any time. Adding new variants is not considered
25781/// a breaking change. Applications should write their code in anticipation of:
25782///
25783/// - New values appearing in future releases of the client library, **and**
25784/// - New values received dynamically, without application changes.
25785///
25786/// Please consult the [Working with enums] section in the user guide for some
25787/// guidelines.
25788///
25789/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
25790#[derive(Clone, Debug, PartialEq)]
25791#[non_exhaustive]
25792pub enum Severity {
25793 /// Severity level not specified.
25794 Unspecified,
25795 /// Suspicious events that do not pose an immediate threat, but that are
25796 /// reported to call attention to deeper problems that could possibly exist.
25797 Informational,
25798 /// Warning-level threats that have very little impact on an organization's
25799 /// infrastructure. They usually require local or physical system access and
25800 /// may often result in victim privacy issues and information leakage.
25801 Low,
25802 /// Minor threats in which impact is minimized, that do not compromise the
25803 /// target or exploits that require an attacker to reside on the same local
25804 /// network as the victim, affect only non-standard configurations or obscure
25805 /// applications, or provide very limited access.
25806 Medium,
25807 /// Threats that have the ability to become critical but have mitigating
25808 /// factors; for example, they may be difficult to exploit, do not result in
25809 /// elevated privileges, or do not have a large victim pool.
25810 High,
25811 /// Serious threats, such as those that affect default installations of widely
25812 /// deployed software, result in root compromise of servers, and the exploit
25813 /// code is widely available to attackers. The attacker usually does not need
25814 /// any special authentication credentials or knowledge about the individual
25815 /// victims and the target does not need to be manipulated into performing any
25816 /// special functions.
25817 Critical,
25818 /// If set, the enum was initialized with an unknown value.
25819 ///
25820 /// Applications can examine the value using [Severity::value] or
25821 /// [Severity::name].
25822 UnknownValue(severity::UnknownValue),
25823}
25824
25825#[doc(hidden)]
25826pub mod severity {
25827 #[allow(unused_imports)]
25828 use super::*;
25829 #[derive(Clone, Debug, PartialEq)]
25830 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25831}
25832
25833impl Severity {
25834 /// Gets the enum value.
25835 ///
25836 /// Returns `None` if the enum contains an unknown value deserialized from
25837 /// the string representation of enums.
25838 pub fn value(&self) -> std::option::Option<i32> {
25839 match self {
25840 Self::Unspecified => std::option::Option::Some(0),
25841 Self::Informational => std::option::Option::Some(1),
25842 Self::Low => std::option::Option::Some(2),
25843 Self::Medium => std::option::Option::Some(3),
25844 Self::High => std::option::Option::Some(4),
25845 Self::Critical => std::option::Option::Some(5),
25846 Self::UnknownValue(u) => u.0.value(),
25847 }
25848 }
25849
25850 /// Gets the enum value as a string.
25851 ///
25852 /// Returns `None` if the enum contains an unknown value deserialized from
25853 /// the integer representation of enums.
25854 pub fn name(&self) -> std::option::Option<&str> {
25855 match self {
25856 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
25857 Self::Informational => std::option::Option::Some("INFORMATIONAL"),
25858 Self::Low => std::option::Option::Some("LOW"),
25859 Self::Medium => std::option::Option::Some("MEDIUM"),
25860 Self::High => std::option::Option::Some("HIGH"),
25861 Self::Critical => std::option::Option::Some("CRITICAL"),
25862 Self::UnknownValue(u) => u.0.name(),
25863 }
25864 }
25865}
25866
25867impl std::default::Default for Severity {
25868 fn default() -> Self {
25869 use std::convert::From;
25870 Self::from(0)
25871 }
25872}
25873
25874impl std::fmt::Display for Severity {
25875 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25876 wkt::internal::display_enum(f, self.name(), self.value())
25877 }
25878}
25879
25880impl std::convert::From<i32> for Severity {
25881 fn from(value: i32) -> Self {
25882 match value {
25883 0 => Self::Unspecified,
25884 1 => Self::Informational,
25885 2 => Self::Low,
25886 3 => Self::Medium,
25887 4 => Self::High,
25888 5 => Self::Critical,
25889 _ => Self::UnknownValue(severity::UnknownValue(
25890 wkt::internal::UnknownEnumValue::Integer(value),
25891 )),
25892 }
25893 }
25894}
25895
25896impl std::convert::From<&str> for Severity {
25897 fn from(value: &str) -> Self {
25898 use std::string::ToString;
25899 match value {
25900 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
25901 "INFORMATIONAL" => Self::Informational,
25902 "LOW" => Self::Low,
25903 "MEDIUM" => Self::Medium,
25904 "HIGH" => Self::High,
25905 "CRITICAL" => Self::Critical,
25906 _ => Self::UnknownValue(severity::UnknownValue(
25907 wkt::internal::UnknownEnumValue::String(value.to_string()),
25908 )),
25909 }
25910 }
25911}
25912
25913impl serde::ser::Serialize for Severity {
25914 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25915 where
25916 S: serde::Serializer,
25917 {
25918 match self {
25919 Self::Unspecified => serializer.serialize_i32(0),
25920 Self::Informational => serializer.serialize_i32(1),
25921 Self::Low => serializer.serialize_i32(2),
25922 Self::Medium => serializer.serialize_i32(3),
25923 Self::High => serializer.serialize_i32(4),
25924 Self::Critical => serializer.serialize_i32(5),
25925 Self::UnknownValue(u) => u.0.serialize(serializer),
25926 }
25927 }
25928}
25929
25930impl<'de> serde::de::Deserialize<'de> for Severity {
25931 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25932 where
25933 D: serde::Deserializer<'de>,
25934 {
25935 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
25936 ".google.cloud.networksecurity.v1.Severity",
25937 ))
25938 }
25939}
25940
25941/// Type of threat.
25942///
25943/// # Working with unknown values
25944///
25945/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25946/// additional enum variants at any time. Adding new variants is not considered
25947/// a breaking change. Applications should write their code in anticipation of:
25948///
25949/// - New values appearing in future releases of the client library, **and**
25950/// - New values received dynamically, without application changes.
25951///
25952/// Please consult the [Working with enums] section in the user guide for some
25953/// guidelines.
25954///
25955/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
25956#[derive(Clone, Debug, PartialEq)]
25957#[non_exhaustive]
25958pub enum ThreatType {
25959 /// Type of threat not specified.
25960 Unspecified,
25961 /// Type of threat is not derivable from threat ID. An override will be
25962 /// created for all types. Firewall will ignore overridden signature ID's
25963 /// that don't exist in the specific type.
25964 Unknown,
25965 /// Threats related to system flaws that an attacker might otherwise attempt
25966 /// to exploit.
25967 Vulnerability,
25968 /// Threats related to viruses and malware found in executables and file
25969 /// types.
25970 Antivirus,
25971 /// Threats related to command-and-control (C2) activity, where spyware on an
25972 /// infected client is collecting data without the user's consent and/or
25973 /// communicating with a remote attacker.
25974 Spyware,
25975 /// Threats related to DNS.
25976 Dns,
25977 /// If set, the enum was initialized with an unknown value.
25978 ///
25979 /// Applications can examine the value using [ThreatType::value] or
25980 /// [ThreatType::name].
25981 UnknownValue(threat_type::UnknownValue),
25982}
25983
25984#[doc(hidden)]
25985pub mod threat_type {
25986 #[allow(unused_imports)]
25987 use super::*;
25988 #[derive(Clone, Debug, PartialEq)]
25989 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25990}
25991
25992impl ThreatType {
25993 /// Gets the enum value.
25994 ///
25995 /// Returns `None` if the enum contains an unknown value deserialized from
25996 /// the string representation of enums.
25997 pub fn value(&self) -> std::option::Option<i32> {
25998 match self {
25999 Self::Unspecified => std::option::Option::Some(0),
26000 Self::Unknown => std::option::Option::Some(1),
26001 Self::Vulnerability => std::option::Option::Some(2),
26002 Self::Antivirus => std::option::Option::Some(3),
26003 Self::Spyware => std::option::Option::Some(4),
26004 Self::Dns => std::option::Option::Some(5),
26005 Self::UnknownValue(u) => u.0.value(),
26006 }
26007 }
26008
26009 /// Gets the enum value as a string.
26010 ///
26011 /// Returns `None` if the enum contains an unknown value deserialized from
26012 /// the integer representation of enums.
26013 pub fn name(&self) -> std::option::Option<&str> {
26014 match self {
26015 Self::Unspecified => std::option::Option::Some("THREAT_TYPE_UNSPECIFIED"),
26016 Self::Unknown => std::option::Option::Some("UNKNOWN"),
26017 Self::Vulnerability => std::option::Option::Some("VULNERABILITY"),
26018 Self::Antivirus => std::option::Option::Some("ANTIVIRUS"),
26019 Self::Spyware => std::option::Option::Some("SPYWARE"),
26020 Self::Dns => std::option::Option::Some("DNS"),
26021 Self::UnknownValue(u) => u.0.name(),
26022 }
26023 }
26024}
26025
26026impl std::default::Default for ThreatType {
26027 fn default() -> Self {
26028 use std::convert::From;
26029 Self::from(0)
26030 }
26031}
26032
26033impl std::fmt::Display for ThreatType {
26034 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26035 wkt::internal::display_enum(f, self.name(), self.value())
26036 }
26037}
26038
26039impl std::convert::From<i32> for ThreatType {
26040 fn from(value: i32) -> Self {
26041 match value {
26042 0 => Self::Unspecified,
26043 1 => Self::Unknown,
26044 2 => Self::Vulnerability,
26045 3 => Self::Antivirus,
26046 4 => Self::Spyware,
26047 5 => Self::Dns,
26048 _ => Self::UnknownValue(threat_type::UnknownValue(
26049 wkt::internal::UnknownEnumValue::Integer(value),
26050 )),
26051 }
26052 }
26053}
26054
26055impl std::convert::From<&str> for ThreatType {
26056 fn from(value: &str) -> Self {
26057 use std::string::ToString;
26058 match value {
26059 "THREAT_TYPE_UNSPECIFIED" => Self::Unspecified,
26060 "UNKNOWN" => Self::Unknown,
26061 "VULNERABILITY" => Self::Vulnerability,
26062 "ANTIVIRUS" => Self::Antivirus,
26063 "SPYWARE" => Self::Spyware,
26064 "DNS" => Self::Dns,
26065 _ => Self::UnknownValue(threat_type::UnknownValue(
26066 wkt::internal::UnknownEnumValue::String(value.to_string()),
26067 )),
26068 }
26069 }
26070}
26071
26072impl serde::ser::Serialize for ThreatType {
26073 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26074 where
26075 S: serde::Serializer,
26076 {
26077 match self {
26078 Self::Unspecified => serializer.serialize_i32(0),
26079 Self::Unknown => serializer.serialize_i32(1),
26080 Self::Vulnerability => serializer.serialize_i32(2),
26081 Self::Antivirus => serializer.serialize_i32(3),
26082 Self::Spyware => serializer.serialize_i32(4),
26083 Self::Dns => serializer.serialize_i32(5),
26084 Self::UnknownValue(u) => u.0.serialize(serializer),
26085 }
26086 }
26087}
26088
26089impl<'de> serde::de::Deserialize<'de> for ThreatType {
26090 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26091 where
26092 D: serde::Deserializer<'de>,
26093 {
26094 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ThreatType>::new(
26095 ".google.cloud.networksecurity.v1.ThreatType",
26096 ))
26097 }
26098}
26099
26100/// Threat action override.
26101///
26102/// # Working with unknown values
26103///
26104/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26105/// additional enum variants at any time. Adding new variants is not considered
26106/// a breaking change. Applications should write their code in anticipation of:
26107///
26108/// - New values appearing in future releases of the client library, **and**
26109/// - New values received dynamically, without application changes.
26110///
26111/// Please consult the [Working with enums] section in the user guide for some
26112/// guidelines.
26113///
26114/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
26115#[derive(Clone, Debug, PartialEq)]
26116#[non_exhaustive]
26117pub enum ThreatAction {
26118 /// Threat action not specified.
26119 Unspecified,
26120 /// The default action (as specified by the vendor) is taken.
26121 DefaultAction,
26122 /// The packet matching this rule will be allowed to transmit.
26123 Allow,
26124 /// The packet matching this rule will be allowed to transmit, but a threat_log
26125 /// entry will be sent to the consumer project.
26126 Alert,
26127 /// The packet matching this rule will be dropped, and a threat_log entry will
26128 /// be sent to the consumer project.
26129 Deny,
26130 /// If set, the enum was initialized with an unknown value.
26131 ///
26132 /// Applications can examine the value using [ThreatAction::value] or
26133 /// [ThreatAction::name].
26134 UnknownValue(threat_action::UnknownValue),
26135}
26136
26137#[doc(hidden)]
26138pub mod threat_action {
26139 #[allow(unused_imports)]
26140 use super::*;
26141 #[derive(Clone, Debug, PartialEq)]
26142 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26143}
26144
26145impl ThreatAction {
26146 /// Gets the enum value.
26147 ///
26148 /// Returns `None` if the enum contains an unknown value deserialized from
26149 /// the string representation of enums.
26150 pub fn value(&self) -> std::option::Option<i32> {
26151 match self {
26152 Self::Unspecified => std::option::Option::Some(0),
26153 Self::DefaultAction => std::option::Option::Some(4),
26154 Self::Allow => std::option::Option::Some(1),
26155 Self::Alert => std::option::Option::Some(2),
26156 Self::Deny => std::option::Option::Some(3),
26157 Self::UnknownValue(u) => u.0.value(),
26158 }
26159 }
26160
26161 /// Gets the enum value as a string.
26162 ///
26163 /// Returns `None` if the enum contains an unknown value deserialized from
26164 /// the integer representation of enums.
26165 pub fn name(&self) -> std::option::Option<&str> {
26166 match self {
26167 Self::Unspecified => std::option::Option::Some("THREAT_ACTION_UNSPECIFIED"),
26168 Self::DefaultAction => std::option::Option::Some("DEFAULT_ACTION"),
26169 Self::Allow => std::option::Option::Some("ALLOW"),
26170 Self::Alert => std::option::Option::Some("ALERT"),
26171 Self::Deny => std::option::Option::Some("DENY"),
26172 Self::UnknownValue(u) => u.0.name(),
26173 }
26174 }
26175}
26176
26177impl std::default::Default for ThreatAction {
26178 fn default() -> Self {
26179 use std::convert::From;
26180 Self::from(0)
26181 }
26182}
26183
26184impl std::fmt::Display for ThreatAction {
26185 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26186 wkt::internal::display_enum(f, self.name(), self.value())
26187 }
26188}
26189
26190impl std::convert::From<i32> for ThreatAction {
26191 fn from(value: i32) -> Self {
26192 match value {
26193 0 => Self::Unspecified,
26194 1 => Self::Allow,
26195 2 => Self::Alert,
26196 3 => Self::Deny,
26197 4 => Self::DefaultAction,
26198 _ => Self::UnknownValue(threat_action::UnknownValue(
26199 wkt::internal::UnknownEnumValue::Integer(value),
26200 )),
26201 }
26202 }
26203}
26204
26205impl std::convert::From<&str> for ThreatAction {
26206 fn from(value: &str) -> Self {
26207 use std::string::ToString;
26208 match value {
26209 "THREAT_ACTION_UNSPECIFIED" => Self::Unspecified,
26210 "DEFAULT_ACTION" => Self::DefaultAction,
26211 "ALLOW" => Self::Allow,
26212 "ALERT" => Self::Alert,
26213 "DENY" => Self::Deny,
26214 _ => Self::UnknownValue(threat_action::UnknownValue(
26215 wkt::internal::UnknownEnumValue::String(value.to_string()),
26216 )),
26217 }
26218 }
26219}
26220
26221impl serde::ser::Serialize for ThreatAction {
26222 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26223 where
26224 S: serde::Serializer,
26225 {
26226 match self {
26227 Self::Unspecified => serializer.serialize_i32(0),
26228 Self::DefaultAction => serializer.serialize_i32(4),
26229 Self::Allow => serializer.serialize_i32(1),
26230 Self::Alert => serializer.serialize_i32(2),
26231 Self::Deny => serializer.serialize_i32(3),
26232 Self::UnknownValue(u) => u.0.serialize(serializer),
26233 }
26234 }
26235}
26236
26237impl<'de> serde::de::Deserialize<'de> for ThreatAction {
26238 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26239 where
26240 D: serde::Deserializer<'de>,
26241 {
26242 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ThreatAction>::new(
26243 ".google.cloud.networksecurity.v1.ThreatAction",
26244 ))
26245 }
26246}
26247
26248/// Antivirus protocol.
26249///
26250/// # Working with unknown values
26251///
26252/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26253/// additional enum variants at any time. Adding new variants is not considered
26254/// a breaking change. Applications should write their code in anticipation of:
26255///
26256/// - New values appearing in future releases of the client library, **and**
26257/// - New values received dynamically, without application changes.
26258///
26259/// Please consult the [Working with enums] section in the user guide for some
26260/// guidelines.
26261///
26262/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
26263#[derive(Clone, Debug, PartialEq)]
26264#[non_exhaustive]
26265pub enum Protocol {
26266 /// Protocol not specified.
26267 Unspecified,
26268 /// SMTP protocol
26269 Smtp,
26270 /// SMB protocol
26271 Smb,
26272 /// POP3 protocol
26273 Pop3,
26274 /// IMAP protocol
26275 Imap,
26276 /// HTTP2 protocol
26277 Http2,
26278 /// HTTP protocol
26279 Http,
26280 /// FTP protocol
26281 Ftp,
26282 /// If set, the enum was initialized with an unknown value.
26283 ///
26284 /// Applications can examine the value using [Protocol::value] or
26285 /// [Protocol::name].
26286 UnknownValue(protocol::UnknownValue),
26287}
26288
26289#[doc(hidden)]
26290pub mod protocol {
26291 #[allow(unused_imports)]
26292 use super::*;
26293 #[derive(Clone, Debug, PartialEq)]
26294 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26295}
26296
26297impl Protocol {
26298 /// Gets the enum value.
26299 ///
26300 /// Returns `None` if the enum contains an unknown value deserialized from
26301 /// the string representation of enums.
26302 pub fn value(&self) -> std::option::Option<i32> {
26303 match self {
26304 Self::Unspecified => std::option::Option::Some(0),
26305 Self::Smtp => std::option::Option::Some(1),
26306 Self::Smb => std::option::Option::Some(2),
26307 Self::Pop3 => std::option::Option::Some(3),
26308 Self::Imap => std::option::Option::Some(4),
26309 Self::Http2 => std::option::Option::Some(5),
26310 Self::Http => std::option::Option::Some(6),
26311 Self::Ftp => std::option::Option::Some(7),
26312 Self::UnknownValue(u) => u.0.value(),
26313 }
26314 }
26315
26316 /// Gets the enum value as a string.
26317 ///
26318 /// Returns `None` if the enum contains an unknown value deserialized from
26319 /// the integer representation of enums.
26320 pub fn name(&self) -> std::option::Option<&str> {
26321 match self {
26322 Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
26323 Self::Smtp => std::option::Option::Some("SMTP"),
26324 Self::Smb => std::option::Option::Some("SMB"),
26325 Self::Pop3 => std::option::Option::Some("POP3"),
26326 Self::Imap => std::option::Option::Some("IMAP"),
26327 Self::Http2 => std::option::Option::Some("HTTP2"),
26328 Self::Http => std::option::Option::Some("HTTP"),
26329 Self::Ftp => std::option::Option::Some("FTP"),
26330 Self::UnknownValue(u) => u.0.name(),
26331 }
26332 }
26333}
26334
26335impl std::default::Default for Protocol {
26336 fn default() -> Self {
26337 use std::convert::From;
26338 Self::from(0)
26339 }
26340}
26341
26342impl std::fmt::Display for Protocol {
26343 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26344 wkt::internal::display_enum(f, self.name(), self.value())
26345 }
26346}
26347
26348impl std::convert::From<i32> for Protocol {
26349 fn from(value: i32) -> Self {
26350 match value {
26351 0 => Self::Unspecified,
26352 1 => Self::Smtp,
26353 2 => Self::Smb,
26354 3 => Self::Pop3,
26355 4 => Self::Imap,
26356 5 => Self::Http2,
26357 6 => Self::Http,
26358 7 => Self::Ftp,
26359 _ => Self::UnknownValue(protocol::UnknownValue(
26360 wkt::internal::UnknownEnumValue::Integer(value),
26361 )),
26362 }
26363 }
26364}
26365
26366impl std::convert::From<&str> for Protocol {
26367 fn from(value: &str) -> Self {
26368 use std::string::ToString;
26369 match value {
26370 "PROTOCOL_UNSPECIFIED" => Self::Unspecified,
26371 "SMTP" => Self::Smtp,
26372 "SMB" => Self::Smb,
26373 "POP3" => Self::Pop3,
26374 "IMAP" => Self::Imap,
26375 "HTTP2" => Self::Http2,
26376 "HTTP" => Self::Http,
26377 "FTP" => Self::Ftp,
26378 _ => Self::UnknownValue(protocol::UnknownValue(
26379 wkt::internal::UnknownEnumValue::String(value.to_string()),
26380 )),
26381 }
26382 }
26383}
26384
26385impl serde::ser::Serialize for Protocol {
26386 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26387 where
26388 S: serde::Serializer,
26389 {
26390 match self {
26391 Self::Unspecified => serializer.serialize_i32(0),
26392 Self::Smtp => serializer.serialize_i32(1),
26393 Self::Smb => serializer.serialize_i32(2),
26394 Self::Pop3 => serializer.serialize_i32(3),
26395 Self::Imap => serializer.serialize_i32(4),
26396 Self::Http2 => serializer.serialize_i32(5),
26397 Self::Http => serializer.serialize_i32(6),
26398 Self::Ftp => serializer.serialize_i32(7),
26399 Self::UnknownValue(u) => u.0.serialize(serializer),
26400 }
26401 }
26402}
26403
26404impl<'de> serde::de::Deserialize<'de> for Protocol {
26405 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26406 where
26407 D: serde::Deserializer<'de>,
26408 {
26409 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
26410 ".google.cloud.networksecurity.v1.Protocol",
26411 ))
26412 }
26413}